DayZ 1.24
Loading...
Searching...
No Matches
BoltActionRifle_Base Class Reference
Inheritance diagram for BoltActionRifle_Base:
[legend]
Collaboration diagram for BoltActionRifle_Base:
[legend]

Private Member Functions

override void InitStateMachine ()
 
override void SetActions ()
 

Private Attributes

ref WeaponStableState C0
 
ref WeaponStableState C1
 
ref WeaponStableState D1
 
ref WeaponStableState JF
 

Detailed Description

Definition at line 68 of file BoltActionRifleInnerMagazine_Base.c.

Member Function Documentation

◆ InitStateMachine()

override void BoltActionRifle_Base::InitStateMachine ( )
inlineprivate

Definition at line 76 of file BoltActionRifleInnerMagazine_Base.c.

77 {
78 m_abilities.Insert(new AbilityRecord(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
79 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_CLOSED_KEEP));
80 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_CLOSED));
81 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE));
82 m_abilities.Insert(new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
83 m_abilities.Insert(new AbilityRecord(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END));
84 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
85 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_COCKED));
86 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED));
87 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
88
89
90 C0 = new BARIMEmptyDischarged(this, NULL, BARIMAnimState.DEFAULT);
91 C1 = new BARIMLoadedCharged(this, NULL, BARIMAnimState.DEFAULT);
92 JF = new BARIMLoadedJammed(this, NULL, BARIMAnimState.JAMMED);
93 D1 = new BARIMLoadedDischarged(this, NULL, BARIMAnimState.DEFAULT);
94
95 WeaponStateBase Mech_C1 = new WeaponChargingInnerMag(this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
96 WeaponStateBase Mech_D1 = new WeaponChargingInnerMag(this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
97
98
99 LoopedChambering Chamber_C0 = new LoopedChambering(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_CLOSED, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
100 LoopedChambering Chamber_C1 = new LoopedChambering(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_CLOSED_KEEP, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
101 LoopedChambering Chamber_D1 = new LoopedChambering(this, NULL, WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_STARTLOOPABLE_CLOSED, WeaponActionChamberingTypes.CHAMBERING_ENDLOOPABLE);
102
104
109
111
112
113 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
114 WeaponEventBase __L__ = new WeaponEventLoad1Bullet;
115 WeaponEventBase __T__ = new WeaponEventTrigger;
116 WeaponEventBase __TJ_ = new WeaponEventTriggerToJam;
117 WeaponEventBase __U__ = new WeaponEventUnjam;
118 WeaponEventBase __M__ = new WeaponEventMechanism;
119 WeaponEventBase _abt_ = new WeaponEventHumanCommandActionAborted;
120 WeaponEventBase _rto_ = new WeaponEventReloadTimeout;
121 WeaponEventBase _dto_ = new WeaponEventDryFireTimeout;
122
123 m_fsm = new WeaponFSM();
124
125 // Mechanism
126 //----------------------------------------
127 m_fsm.AddTransition(new WeaponTransition(C0, __M__, Mech_C1));
128
129 m_fsm.AddTransition(new WeaponTransition(C1, __M__, Mech_C1));
130 m_fsm.AddTransition(new WeaponTransition(Mech_C1, _fin_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
131 m_fsm.AddTransition(new WeaponTransition(Mech_C1, _fin_, C1));
132 m_fsm.AddTransition(new WeaponTransition(Mech_C1, _abt_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
133 m_fsm.AddTransition(new WeaponTransition(Mech_C1, _abt_, C1));
134
135 m_fsm.AddTransition(new WeaponTransition(D1, __M__, Mech_D1));
136 m_fsm.AddTransition(new WeaponTransition(Mech_D1, _fin_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
137 m_fsm.AddTransition(new WeaponTransition(Mech_D1, _fin_, D1, NULL, new WeaponGuardCurrentChamberFiredOut(this)));
138 m_fsm.AddTransition(new WeaponTransition(Mech_D1, _fin_, C1));
139 m_fsm.AddTransition(new WeaponTransition(Mech_D1, _abt_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
140 m_fsm.AddTransition(new WeaponTransition(Mech_D1, _abt_, D1, NULL, new WeaponGuardCurrentChamberFiredOut(this)));
141 m_fsm.AddTransition(new WeaponTransition(Mech_D1, _abt_, C1));
142
143
144 //----------------------------------------
145
146 m_fsm.AddTransition(new WeaponTransition(C0, __L__, Chamber_C0));
147 m_fsm.AddTransition(new WeaponTransition(Chamber_C0, _fin_, C1));
148 m_fsm.AddTransition(new WeaponTransition(Chamber_C0, _abt_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
149 m_fsm.AddTransition(new WeaponTransition(Chamber_C0, _abt_, C1));
150
151 m_fsm.AddTransition(new WeaponTransition(C1, __L__, Chamber_C1, NULL, new GuardNot(new WeaponGuardInnerMagazineFullShareChamber(this))));
152 m_fsm.AddTransition(new WeaponTransition(Chamber_C1, _fin_, C1));
153 m_fsm.AddTransition(new WeaponTransition(Chamber_C1, _abt_, C1));
154
155 m_fsm.AddTransition(new WeaponTransition(D1, __L__, Chamber_D1));
156 m_fsm.AddTransition(new WeaponTransition(Chamber_D1, _fin_, C1));
157 m_fsm.AddTransition(new WeaponTransition(Chamber_D1, _abt_, D1, NULL, new WeaponGuardCurrentChamberFiredOut(this)));
158 m_fsm.AddTransition(new WeaponTransition(Chamber_D1, _abt_, C1));
159
160 //------------------------------------------
161
162 m_fsm.AddTransition(new WeaponTransition(JF, __U__, Unjam_JF));
163 m_fsm.AddTransition(new WeaponTransition(Unjam_JF, _fin_, JF, NULL, new WeaponGuardJammed(this)));
164 m_fsm.AddTransition(new WeaponTransition(Unjam_JF, _fin_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
165 m_fsm.AddTransition(new WeaponTransition(Unjam_JF, _fin_, C1));
166 m_fsm.AddTransition(new WeaponTransition(Unjam_JF, _abt_, JF, NULL, new WeaponGuardJammed(this)));
167 m_fsm.AddTransition(new WeaponTransition(Unjam_JF, _abt_, C0, NULL, new WeaponGuardCurrentChamberEmpty(this)));
168 m_fsm.AddTransition(new WeaponTransition(Unjam_JF, _abt_, C1));
169
170
171 //-----------------------------------------
172
173 // fire
174 m_fsm.AddTransition(new WeaponTransition(C0, __T__, Trigger_C0)); // fire.cocked
175 m_fsm.AddTransition(new WeaponTransition(Trigger_C0, _fin_, C0));
176 m_fsm.AddTransition(new WeaponTransition(Trigger_C0, _dto_, C0));
177 m_fsm.AddTransition(new WeaponTransition(Trigger_C0, _abt_, C0));
178
179 m_fsm.AddTransition(new WeaponTransition(C1, __T__, Trigger_C1)); // fire.cocked
180 m_fsm.AddTransition(new WeaponTransition(Trigger_C1, _fin_, D1));
181 m_fsm.AddTransition(new WeaponTransition(Trigger_C1, _rto_, D1));
182 m_fsm.AddTransition(new WeaponTransition(Trigger_C1, _abt_, D1));
183
184 m_fsm.AddTransition(new WeaponTransition(D1, __T__, Trigger_D1)); // fire.cocked
185 m_fsm.AddTransition(new WeaponTransition(Trigger_D1, _fin_, D1));
186 m_fsm.AddTransition(new WeaponTransition(Trigger_D1, _dto_, D1));
187 m_fsm.AddTransition(new WeaponTransition(Trigger_D1, _abt_, D1));
188
189 m_fsm.AddTransition(new WeaponTransition(JF, __T__, Trigger_JF)); // fire.cocked
190 m_fsm.AddTransition(new WeaponTransition(Trigger_JF, _fin_, JF));
191 m_fsm.AddTransition(new WeaponTransition(Trigger_JF, _dto_, JF));
192 m_fsm.AddTransition(new WeaponTransition(Trigger_JF, _abt_, JF));
193
194
195 m_fsm.AddTransition(new WeaponTransition(C1, __TJ_, Trigger_C1J)); // fire.cocked
196 m_fsm.AddTransition(new WeaponTransition(Trigger_C1J, _fin_, JF));
197 m_fsm.AddTransition(new WeaponTransition(Trigger_C1J, _rto_, JF));
198 m_fsm.AddTransition(new WeaponTransition(Trigger_C1J, _abt_, JF));
199
200 //---------------------------------------------
201
202 SetInitialState(C0);
203
204 SelectionBulletHide();
205 HideMagazine();
206
207 m_fsm.Start();
208 }
enum FSMTransition WeaponTransition
pair ( action, actionType )
Definition Weapon_Base.c:5
signalize mechanism manipulation
Definition Events.c:35
weapon finite state machine
represent weapon state base
Definition BulletHide.c:2
unjam submachine
WeaponActionChamberingTypes
Definition human.c:856
WeaponActions
actions
Definition human.c:796
WeaponActionUnjammingTypes
Definition human.c:892
WeaponActionFireTypes
Definition human.c:900

◆ SetActions()

override void BoltActionRifle_Base::SetActions ( )
inlineprivate

Definition at line 210 of file BoltActionRifleInnerMagazine_Base.c.

211 {
212 super.SetActions();
214
217
218 }
void AddAction(typename actionName)
void RemoveAction(typename actionName)
FirearmActionLoadBullet FirearmActionBase FirearmActionLoadBulletQuick()

References AddAction(), FirearmActionLoadBulletQuick(), and RemoveAction().

Member Data Documentation

◆ C0

ref WeaponStableState BoltActionRifle_Base::C0
private

Definition at line 70 of file BoltActionRifleInnerMagazine_Base.c.

◆ C1

ref WeaponStableState BoltActionRifle_Base::C1
private

Definition at line 71 of file BoltActionRifleInnerMagazine_Base.c.

◆ D1

ref WeaponStableState BoltActionRifle_Base::D1
private

Definition at line 72 of file BoltActionRifleInnerMagazine_Base.c.

◆ JF

ref WeaponStableState BoltActionRifle_Base::JF
private

Definition at line 73 of file BoltActionRifleInnerMagazine_Base.c.


The documentation for this class was generated from the following file: