DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс DoubleBarrel_Base
+ Граф наследования:DoubleBarrel_Base:

Закрытые члены

override void InitStateMachine ()
 
override bool CanChamberBullet (int muzzleIndex, Magazine mag)
 
override void SetActions ()
 

Закрытые данные

ref WeaponStableState L_L
 
ref WeaponStableState L_E
 
ref WeaponStableState E_L
 
ref WeaponStableState F_L
 
ref WeaponStableState F_F
 
ref WeaponStableState F_E
 
ref WeaponStableState E_F
 
ref WeaponStableState E_E
 

Подробное описание

Методы

◆ CanChamberBullet()

override bool CanChamberBullet ( int muzzleIndex,
Magazine mag )
inlineprivate
300 {
301 for(int i = 0; i < GetMuzzleCount(); i++)
302 {
303 if( CanChamberFromMag(i, mag) )
304 {
305 if(IsChamberEmpty(i))
306 return true;
307
309 return true;
310 }
311 }
312 return false;
313 }
bool IsChamberFiredOut(int idx)
Definition WeaponStableState.c:153
Definition EntityAI.c:95

Перекрестные ссылки IsChamberFiredOut().

◆ InitStateMachine()

override void InitStateMachine ( )
inlineprivate
131 {
132 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_END));
133 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_1));
134 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_2));
135 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_3));
136 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_4));
137 // setup abilities
138 m_abilities.Insert(new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
139 m_abilities.Insert(new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
140 m_abilities.Insert(new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
141
142 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
143 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
144
145
146
147 // basic weapon states
156
157
158 WeaponStateBase Mech = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
159
164
166
171
176
177 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
178 WeaponEventBase __L__ = new WeaponEventLoad1Bullet;
179 WeaponEventBase __T__ = new WeaponEventTrigger;
180 //WeaponEventBase __U__ = new WeaponEventUnjam;
181 WeaponEventBase __M__ = new WeaponEventMechanism;
182 WeaponEventBase _abt_ = new WeaponEventHumanCommandActionAborted;
183 WeaponEventBase _rto_ = new WeaponEventReloadTimeout;
184 WeaponEventBase _dto_ = new WeaponEventDryFireTimeout;
185
186 m_fsm = new WeaponFSM();
187
188 m_fsm.AddTransition(new WeaponTransition( E_E, __M__, Mech));
189 m_fsm.AddTransition(new WeaponTransition( L_L, __M__, Mech));
190 m_fsm.AddTransition(new WeaponTransition( L_E, __M__, Mech));
191 m_fsm.AddTransition(new WeaponTransition( E_L, __M__, Mech));
192 m_fsm.AddTransition(new WeaponTransition( F_L, __M__, Mech));
193 m_fsm.AddTransition(new WeaponTransition( F_F, __M__, Mech));
194 m_fsm.AddTransition(new WeaponTransition( F_E, __M__, Mech));
195 m_fsm.AddTransition(new WeaponTransition( E_F, __M__, Mech));
196 m_fsm.AddTransition(new WeaponTransition( Mech, _fin_, E_E));
197
198 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, F_F, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
199 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, F_E, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberEmpty(this, MuzzleIndex.Second))));
200 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, E_F, NULL, new GuardAnd( new WeaponGuardChamberEmpty(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
201 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, F_L, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
202 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, L_L, NULL, new GuardAnd( new WeaponGuardChamberFull(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
203 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, L_E, NULL, new GuardAnd( new WeaponGuardChamberFull(this, MuzzleIndex.First), new WeaponGuardChamberEmpty(this, MuzzleIndex.Second))));
204 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, E_L, NULL, new GuardAnd( new WeaponGuardChamberEmpty(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
205 m_fsm.AddTransition(new WeaponTransition( Mech, _abt_, E_E));
206
207 m_fsm.AddTransition(new WeaponTransition( F_F, __L__, Chamber_E));
208 m_fsm.AddTransition(new WeaponTransition( F_E, __L__, Chamber_E));
209 m_fsm.AddTransition(new WeaponTransition( E_F, __L__, Chamber_E));
210 m_fsm.AddTransition(new WeaponTransition( E_E, __L__, Chamber_E));
211 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _fin_, L_E, NULL, new WeaponGuardChamberEmpty(this, MuzzleIndex.Second)));
212 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _fin_, L_L));
213
214 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _abt_, F_F, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
215 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _abt_, F_E, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberEmpty(this, MuzzleIndex.Second))));
216 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _abt_, E_F, NULL, new GuardAnd( new WeaponGuardChamberEmpty(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
217 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _abt_, L_L, NULL, new GuardAnd( new WeaponGuardChamberFull(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
218 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _abt_, L_E, NULL, new GuardAnd( new WeaponGuardChamberFull(this, MuzzleIndex.First), new WeaponGuardChamberEmpty(this, MuzzleIndex.Second))));
219 m_fsm.AddTransition(new WeaponTransition( Chamber_E, _abt_, E_E));
220
221
222 m_fsm.AddTransition(new WeaponTransition( L_E, __L__, Chamber_L_E));
223 m_fsm.AddTransition(new WeaponTransition( Chamber_L_E, _abt_, L_L, NULL, new WeaponGuardChamberFull(this, MuzzleIndex.Second)));
224 m_fsm.AddTransition(new WeaponTransition( Chamber_L_E, _abt_, L_E));
225 m_fsm.AddTransition(new WeaponTransition( Chamber_L_E, _fin_, L_L, NULL, new WeaponGuardChamberFull(this, MuzzleIndex.Second)));
226 m_fsm.AddTransition(new WeaponTransition( Chamber_L_E, _fin_, L_E));
227
228 m_fsm.AddTransition(new WeaponTransition( E_L, __L__, Chamber_E_L));
229 m_fsm.AddTransition(new WeaponTransition( Chamber_E_L, _abt_, L_L, NULL, new WeaponGuardChamberFull(this, MuzzleIndex.First)));
230 m_fsm.AddTransition(new WeaponTransition( Chamber_E_L, _abt_, E_L));
231 m_fsm.AddTransition(new WeaponTransition( Chamber_E_L, _fin_, L_L, NULL, new WeaponGuardChamberFull(this, MuzzleIndex.First)));
232 m_fsm.AddTransition(new WeaponTransition( Chamber_E_L, _fin_, E_L));
233
234 m_fsm.AddTransition(new WeaponTransition( F_L, __L__, Chamber_F_L));
235 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _abt_, F_L, NULL, new WeaponGuardChamberFiredOut(this, MuzzleIndex.First)));
236 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _abt_, L_L, NULL, new GuardAnd( new WeaponGuardChamberFull(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
237 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _abt_, E_L, NULL, new GuardAnd( new WeaponGuardChamberEmpty(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
238 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _abt_, L_E));
239 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _fin_, F_L, NULL, new WeaponGuardChamberFiredOut(this, MuzzleIndex.First)));
240 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _fin_, L_L, NULL, new GuardAnd( new WeaponGuardChamberFull(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
241 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _fin_, E_L, NULL, new GuardAnd( new WeaponGuardChamberEmpty(this, MuzzleIndex.First), new WeaponGuardChamberFull(this, MuzzleIndex.Second))));
242 m_fsm.AddTransition(new WeaponTransition( Chamber_F_L, _fin_, L_E));
243
244 m_fsm.AddTransition(new WeaponTransition( L_E, __T__, Trigger_L_E));
245 m_fsm.AddTransition(new WeaponTransition( Trigger_L_E, _fin_, F_E));
246 m_fsm.AddTransition(new WeaponTransition( Trigger_L_E, _rto_, F_E));
247 m_fsm.AddTransition(new WeaponTransition( Trigger_L_E, _abt_, F_E));
248
249 m_fsm.AddTransition(new WeaponTransition( E_L, __T__, Trigger_E_L));
250 m_fsm.AddTransition(new WeaponTransition( Trigger_E_L, _fin_, E_F));
251 m_fsm.AddTransition(new WeaponTransition( Trigger_E_L, _rto_, E_F));
252 m_fsm.AddTransition(new WeaponTransition( Trigger_E_L, _abt_, E_F));
253
254 m_fsm.AddTransition(new WeaponTransition( F_L, __T__, Trigger_F_L));
255 m_fsm.AddTransition(new WeaponTransition( Trigger_F_L, _fin_, F_F));
256 m_fsm.AddTransition(new WeaponTransition( Trigger_F_L, _rto_, F_F));
257 m_fsm.AddTransition(new WeaponTransition( Trigger_F_L, _abt_, F_F));
258
259 m_fsm.AddTransition(new WeaponTransition( L_L, __T__, Trigger_L_L));
260 m_fsm.AddTransition(new WeaponTransition( Trigger_L_L, _fin_, F_F, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
261 m_fsm.AddTransition(new WeaponTransition( Trigger_L_L, _rto_, F_F, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
262 m_fsm.AddTransition(new WeaponTransition( Trigger_L_L, _abt_, F_F, NULL, new GuardAnd( new WeaponGuardChamberFiredOut(this, MuzzleIndex.First), new WeaponGuardChamberFiredOut(this, MuzzleIndex.Second))));
263 m_fsm.AddTransition(new WeaponTransition( Trigger_L_L, _fin_, F_L));
264 m_fsm.AddTransition(new WeaponTransition( Trigger_L_L, _rto_, F_L));
265 m_fsm.AddTransition(new WeaponTransition( Trigger_L_L, _abt_, F_L));
266
267 m_fsm.AddTransition(new WeaponTransition( F_F, __T__, Trigger_F_F));
268 m_fsm.AddTransition(new WeaponTransition( Trigger_F_F, _fin_, F_F));
269 m_fsm.AddTransition(new WeaponTransition( Trigger_F_F, _dto_, F_F));
270 m_fsm.AddTransition(new WeaponTransition( Trigger_F_F, _abt_, F_F));
271
272 m_fsm.AddTransition(new WeaponTransition( F_E, __T__, Trigger_F_E));
273 m_fsm.AddTransition(new WeaponTransition( Trigger_F_E, _fin_, F_E));
274 m_fsm.AddTransition(new WeaponTransition( Trigger_F_E, _dto_, F_E));
275 m_fsm.AddTransition(new WeaponTransition( Trigger_F_E, _abt_, F_E));
276
277 m_fsm.AddTransition(new WeaponTransition( E_F, __T__, Trigger_E_F));
278 m_fsm.AddTransition(new WeaponTransition( Trigger_E_F, _fin_, E_F));
279 m_fsm.AddTransition(new WeaponTransition( Trigger_E_F, _dto_, E_F));
280 m_fsm.AddTransition(new WeaponTransition( Trigger_E_F, _abt_, E_F));
281
282 m_fsm.AddTransition(new WeaponTransition( E_E, __T__, Trigger_E_E));
283 m_fsm.AddTransition(new WeaponTransition( Trigger_E_E, _fin_, E_E));
284 m_fsm.AddTransition(new WeaponTransition( Trigger_E_E, _dto_, E_E));
285 m_fsm.AddTransition(new WeaponTransition( Trigger_E_E, _abt_, E_E));
286
287
288
289 SetInitialState(E_E);
290
291 for(int i = 0; i < GetMuzzleCount(); i++)
292 {
293 HideBullet(i);
294 }
295 m_fsm.Start();
296
297 }
DoubleBarrelAnimState
Definition DoubleBarrel_Base.c:2
enum FSMTransition WeaponTransition
void ChamberMultiBullet(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
Definition WeaponChambering.c:646
pair ( action, actionType )
Definition Weapon_Base.c:5
ref WeaponStableState F_L
Definition DoubleBarrel_Base.c:124
ref WeaponStableState E_L
Definition DoubleBarrel_Base.c:123
ref WeaponStableState E_F
Definition DoubleBarrel_Base.c:127
ref WeaponStableState E_E
Definition DoubleBarrel_Base.c:128
ref WeaponStableState L_L
Definition DoubleBarrel_Base.c:121
ref WeaponStableState L_E
Definition DoubleBarrel_Base.c:122
ref WeaponStableState F_E
Definition DoubleBarrel_Base.c:126
ref WeaponStableState F_F
Definition DoubleBarrel_Base.c:125
charging of weapon without ammo to be chambered
signalize mechanism manipulation
Definition Events.c:35
weapon finite state machine
Definition WeaponFire.c:199
represent weapon state base
Definition BulletHide.c:2
unjam submachine
WeaponActionChamberingTypes
Definition human.c:876
WeaponActions
actions
Definition human.c:816
WeaponActionUnjammingTypes
Definition human.c:912
WeaponActionFireTypes
Definition human.c:920

Перекрестные ссылки ChamberMultiBullet(), E_E, E_F, E_L, F_E, F_F, F_L, L_E и L_L.

◆ SetActions()

override void SetActions ( )
inlineprivate
316 {
317 super.SetActions();
319
322 }
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
void RemoveAction(typename actionName)
Definition AdvancedCommunication.c:252
FirearmActionLoadBullet FirearmActionBase FirearmActionLoadBulletQuick()
Definition FirearmActionLoadMultiBullet.c:2
Definition FirearmActionLoadMultiBullet.c:95

Перекрестные ссылки AddAction(), FirearmActionLoadBulletQuick() и RemoveAction().

Поля

◆ E_E

ref WeaponStableState E_E
private

Используется в InitStateMachine().

◆ E_F

ref WeaponStableState E_F
private

Используется в InitStateMachine().

◆ E_L

ref WeaponStableState E_L
private

Используется в InitStateMachine().

◆ F_E

ref WeaponStableState F_E
private

Используется в InitStateMachine().

◆ F_F

ref WeaponStableState F_F
private

Используется в InitStateMachine().

◆ F_L

ref WeaponStableState F_L
private

Используется в InitStateMachine().

◆ L_E

ref WeaponStableState L_E
private

Используется в InitStateMachine().

◆ L_L

ref WeaponStableState L_L
private

Используется в InitStateMachine().


Объявления и описания членов класса находятся в файле: