Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
doublebarrel_base.c
Go to the documentation of this file.
2 {
3  DEFAULT = 0,
4 };
5 
7 {
8  UNKNOWN = 0,
11  FireoutLoaded = 3,
12  FireoutFireout = 4,
13  FireoutEmpty = 5,
14  EmptyEmpty = 6,
15  EmptyLoaded = 7,
16  EmptyFireout = 8,
17 }
18 
19 enum MuzzleIndex
20 {
21  First = 0,
22  Second = 1,
23 }
24 
25 class DoubleBarrelLoadedLoaded extends WeaponStableState
26 {
27  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { LoadedLoaded L_L"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.First); }
28  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } LoadedLoaded L_L"); } }
29  override int GetCurrentStateID () { return DoubleBarrelStableStateID.LoadedLoaded; }
30  override bool HasBullet () { return true; }
31  override bool HasMagazine () { return false; }
32  override bool IsJammed () { return false; }
33  override bool IsRepairEnabled () { return true; }
35 };
36 class DoubleBarrelLoadedEmpty extends WeaponStableState
37 {
38  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { LoadedEmpty L_E"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.First);}
39  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } LoadedEmpty L_E"); } }
40  override int GetCurrentStateID () { return DoubleBarrelStableStateID.LoadedEmpty; }
41  override bool HasBullet () { return true; }
42  override bool HasMagazine () { return false; }
43  override bool IsJammed () { return false; }
44  override bool IsRepairEnabled () { return true; }
45  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.L, MuzzleState.E}; }
46 };
47 class DoubleBarrelEmptyLoaded extends WeaponStableState
48 {
49  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { EmptyLoaded E_L"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.Second);}
50  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } EmptyLoaded E_L"); } }
51  override int GetCurrentStateID () { return DoubleBarrelStableStateID.EmptyLoaded; }
52  override bool HasBullet () { return true; }
53  override bool HasMagazine () { return false; }
54  override bool IsJammed () { return false; }
55  override bool IsRepairEnabled () { return true; }
56  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.E, MuzzleState.L}; }
57 };
58 class DoubleBarrelFireoutLoaded extends WeaponStableState
59 {
60  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { FireoutLoaded F_L"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.Second);}
61  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } FireoutLoaded F_L"); } }
62  override int GetCurrentStateID () { return DoubleBarrelStableStateID.FireoutLoaded; }
63  override bool HasBullet () { return true; }
64  override bool HasMagazine () { return false; }
65  override bool IsJammed () { return false; }
66  override bool IsRepairEnabled () { return true; }
67  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.F, MuzzleState.L}; }
68 };
69 class DoubleBarrelFireoutFireout extends WeaponStableState
70 {
71  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { FireoutFireout F_F"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.First);}
72  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } FireoutFireout F_F"); } }
73  override int GetCurrentStateID () { return DoubleBarrelStableStateID.FireoutFireout; }
74  override bool HasBullet () { return true; }
75  override bool HasMagazine () { return false; }
76  override bool IsJammed () { return false; }
77  override bool IsRepairEnabled () { return true; }
78  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.F, MuzzleState.F}; }
79 };
80 
81 class DoubleBarrelFireoutEmpty extends WeaponStableState
82 {
83  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { FireoutEmpty F_E"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.First);}
84  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } FireoutEmpty F_E"); } }
85  override int GetCurrentStateID () { return DoubleBarrelStableStateID.FireoutEmpty; }
86  override bool HasBullet () { return true; }
87  override bool HasMagazine () { return false; }
88  override bool IsJammed () { return false; }
89  override bool IsRepairEnabled () { return true; }
90  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.F, MuzzleState.E}; }
91 };
92 
93 class DoubleBarrelEmptyFireout extends WeaponStableState
94 {
95  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { EmptyFireout E_F"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.First);}
96  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } EmptyFireout E_F"); } }
97  override int GetCurrentStateID () { return DoubleBarrelStableStateID.EmptyFireout; }
98  override bool HasBullet () { return true; }
99  override bool HasMagazine () { return false; }
100  override bool IsJammed () { return false; }
101  override bool IsRepairEnabled () { return true; }
102  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.E, MuzzleState.F}; }
103 };
104 
105 class DoubleBarrelEmptyEmpty extends WeaponStableState
106 {
107  override void OnEntry (WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { EmptyEmpty E_E"); } super.OnEntry(e); m_weapon.SetCurrentMuzzle(MuzzleIndex.First);}
108  override void OnExit (WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) { wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } EmptyEmpty E_E"); } }
109  override int GetCurrentStateID () { return DoubleBarrelStableStateID.EmptyEmpty; }
110  override bool HasBullet () { return false; }
111  override bool HasMagazine () { return false; }
112  override bool IsJammed () { return false; }
113  override bool IsRepairEnabled () { return true; }
114  override void InitMuzzleArray () { m_muzzleHasBullet = {MuzzleState.E, MuzzleState.E}; }
115 };
116 
117 
118 
120 {
121  ref WeaponStableState L_L;
122  ref WeaponStableState L_E;
123  ref WeaponStableState E_L;
124  ref WeaponStableState F_L;
125  ref WeaponStableState F_F;
126  ref WeaponStableState F_E;
127  ref WeaponStableState E_F;
128  ref WeaponStableState E_E;
129 
130  override void InitStateMachine()
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
148  L_L = new DoubleBarrelLoadedLoaded(this, NULL, DoubleBarrelAnimState.DEFAULT);
149  L_E = new DoubleBarrelLoadedEmpty(this, NULL, DoubleBarrelAnimState.DEFAULT);
150  E_L = new DoubleBarrelEmptyLoaded(this, NULL, DoubleBarrelAnimState.DEFAULT);
151  F_L = new DoubleBarrelFireoutLoaded(this, NULL, DoubleBarrelAnimState.DEFAULT);
152  F_F = new DoubleBarrelFireoutFireout(this, NULL, DoubleBarrelAnimState.DEFAULT);
153  F_E = new DoubleBarrelFireoutEmpty(this, NULL, DoubleBarrelAnimState.DEFAULT);
154  E_F = new DoubleBarrelEmptyFireout(this, NULL, DoubleBarrelAnimState.DEFAULT);
155  E_E = new DoubleBarrelEmptyEmpty(this, NULL, DoubleBarrelAnimState.DEFAULT);
156 
157 
158  WeaponStateBase Mech = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
159 
160  ChamberMultiBullet Chamber_E = new ChamberMultiBullet(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_2,WeaponActionChamberingTypes.CHAMBERING_END);
161  ChamberMultiBullet Chamber_L_E = new ChamberMultiBullet(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_3,WeaponActionChamberingTypes.CHAMBERING_END);
162  ChamberMultiBullet Chamber_F_L = new ChamberMultiBullet(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_4,WeaponActionChamberingTypes.CHAMBERING_END);
163  ChamberMultiBullet Chamber_E_L = new ChamberMultiBullet(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_DOUBLE_1,WeaponActionChamberingTypes.CHAMBERING_END);
164 
165  WeaponStateBase Unjam_J = new WeaponUnjamming(this, NULL, WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START);
166 
167  WeaponStateBase Trigger_L_E = new WeaponFireMultiMuzzle(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
168  WeaponStateBase Trigger_E_L = new WeaponFireMultiMuzzle(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
169  WeaponStateBase Trigger_F_L = new WeaponFireMultiMuzzle(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
170  WeaponStateBase Trigger_L_L = new WeaponFireMultiMuzzle(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL);
171 
172  WeaponStateBase Trigger_F_F = new WeaponDryFire(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
173  WeaponStateBase Trigger_F_E = new WeaponDryFire(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
174  WeaponStateBase Trigger_E_F = new WeaponDryFire(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
175  WeaponStateBase Trigger_E_E = new WeaponDryFire(this, NULL, WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY);
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  }
298 
299  override bool CanChamberBullet (int muzzleIndex, Magazine mag)
300  {
301  for(int i = 0; i < GetMuzzleCount(); i++)
302  {
303  if( CanChamberFromMag(i, mag) )
304  {
305  if(IsChamberEmpty(i))
306  return true;
307 
308  if(IsChamberFiredOut(i))
309  return true;
310  }
311  }
312  return false;
313  }
314 
315  override void SetActions()
316  {
317  super.SetActions();
319 
322  }
323 };
LoadedEmpty
LoadedEmpty
Definition: doublebarrel_base.c:4
OnEntry
class DoubleBarrelLoadedEmpty extends WeaponStableState OnEntry
LogManager
Definition: debug.c:734
EmptyEmpty
EmptyEmpty
Definition: doublebarrel_base.c:8
WeaponFireMultiMuzzle
Definition: weaponfire.c:198
DEFAULT
@ DEFAULT
default weapon state, closed and discharged
Definition: doublebarrel_base.c:3
IsJammed
override bool IsJammed()
Definition: doublebarrel_base.c:32
WeaponActionUnjammingTypes
WeaponActionUnjammingTypes
Definition: human.c:904
HasBullet
override bool HasBullet()
Definition: doublebarrel_base.c:30
FirearmActionLoadMultiBullet
Definition: firearmactionloadmultibullet.c:1
FirearmActionLoadBulletQuick
FirearmActionLoadMultiBullet FirearmActionLoadBulletQuick
RemoveAction
void RemoveAction(typename actionName)
Definition: advancedcommunication.c:118
FirearmActionLoadMultiBulletQuick
Definition: firearmactionloadmultibullet.c:94
IsChamberFiredOut
bool IsChamberFiredOut(int idx)
Definition: weaponstablestate.c:153
ChamberMultiBullet
void ChamberMultiBullet(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int startActionType=-1, int endActionType=-1)
Definition: weaponchambering.c:646
WeaponActionFireTypes
WeaponActionFireTypes
Definition: human.c:912
OnExit
override void OnExit(WeaponEventBase e)
Definition: doublebarrel_base.c:28
UNKNOWN
UNKNOWN
Definition: doublebarrel_base.c:2
FireoutEmpty
FireoutEmpty
Definition: doublebarrel_base.c:7
DoubleBarrelAnimState
DoubleBarrelAnimState
Definition: doublebarrel_base.c:1
WeaponActions
WeaponActions
actions
Definition: human.c:808
GetCurrentStateID
override int GetCurrentStateID()
Definition: doublebarrel_base.c:29
FireoutLoaded
FireoutLoaded
Definition: doublebarrel_base.c:5
WeaponUnjamming
unjam submachine
First
enum DoubleBarrelStableStateID First
HasMagazine
override bool HasMagazine()
Definition: doublebarrel_base.c:31
LoadedLoaded
LoadedLoaded
Definition: doublebarrel_base.c:3
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
Object
Definition: objecttyped.c:1
EmptyFireout
EmptyFireout
Definition: doublebarrel_base.c:10
m_muzzleHasBullet
ref array< MuzzleState > m_muzzleHasBullet
Definition: weaponstablestate.c:30
Rifle_Base
base for rifles @NOTE name copies config base class
Definition: sks.c:69
WeaponCharging
charging of weapon without ammo to be chambered
WeaponTransition
enum FSMTransition WeaponTransition
FireoutFireout
FireoutFireout
Definition: doublebarrel_base.c:6
EmptyLoaded
EmptyLoaded
Definition: doublebarrel_base.c:9
InitMuzzleArray
override void InitMuzzleArray()
Definition: doublebarrel_base.c:34
AbilityRecord
pair ( action, actionType )
Definition: weapon_base.c:4
WeaponEventBase
signalize mechanism manipulation
Definition: events.c:34
WeaponStateBase
represent weapon state base
Definition: bullethide.c:1
m_weapon
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition: guards.c:583
Second
enum DoubleBarrelStableStateID Second
wpnPrint
void wpnPrint(string s)
Definition: debug.c:1
WeaponActionChamberingTypes
WeaponActionChamberingTypes
Definition: human.c:868
WeaponFSM
weapon finite state machine
DoubleBarrelStableStateID
DoubleBarrelStableStateID
Definition: doublebarrel_base.c:6
IsRepairEnabled
override bool IsRepairEnabled()
Definition: doublebarrel_base.c:33
WeaponStableState
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
Definition: crossbow.c:26
DoubleBarrel_Base
Definition: doublebarrel_base.c:119
MuzzleState
MuzzleState
Definition: weaponstablestate.c:14