DayZ 1.24
Loading...
Searching...
No Matches
RifleBoltLock_Base.c
Go to the documentation of this file.
2{
3 DEFAULT = 0,
4 OPENED = 1,
5 JAMMED = 2,
6};
7
20
22{
23 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { close nobull nomag"); super.OnEntry(e); }
24 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } close nobull nomag"); }
25 override int GetCurrentStateID() { return RBLStableStateID.RBL_CLO_BU0_MA0; }
26 override bool HasBullet() { return false; }
27 override bool HasMagazine() { return false; }
28 override bool IsJammed() { return false; }
29 override bool IsRepairEnabled() { return true; }
31};
33{
34 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { close bullet nomag"); super.OnEntry(e); }
35 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } close bullet nomag"); }
36 override int GetCurrentStateID() { return RBLStableStateID.RBL_CLO_BU1_MA0; }
37 override bool HasBullet() { return true; }
38 override bool HasMagazine() { return false; }
39 override bool IsJammed() { return false; }
40 override bool IsRepairEnabled() { return true; }
42};
44{
45 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { close bullet mag"); super.OnEntry(e); }
46 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } close bullet mag"); }
47 override int GetCurrentStateID() { return RBLStableStateID.RBL_CLO_BU1_MA1; }
48 override bool HasBullet() { return true; }
49 override bool HasMagazine() { return true; }
50 override bool IsJammed() { return false; }
51 override bool IsRepairEnabled() { return true; }
53};
55{
56 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { close nobull mag"); super.OnEntry(e); }
57 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } close nobull mag"); }
58 override int GetCurrentStateID() { return RBLStableStateID.RBL_CLO_BU0_MA1; }
59 override bool HasBullet() { return false; }
60 override bool HasMagazine() { return true; }
61 override bool IsJammed() { return false; }
62 override bool IsRepairEnabled() { return true; }
64};
66{
67 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { lock nobull mag"); m_weapon.SetWeaponOpen(true); super.OnEntry(e); }
68 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } open nobull mag"); }
69 override int GetCurrentStateID() { return RBLStableStateID.RBL_OPN_BU0_MA1; }
70 override bool HasBullet() { return false; }
71 override bool HasMagazine() { return true; }
72 override bool IsJammed() { return false; }
73 override bool IsBoltOpen() { return true; }
74 override bool IsRepairEnabled() { return true; }
76};
78{
79 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { lock nobull nomag"); m_weapon.SetWeaponOpen(true); super.OnEntry(e); }
80 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } open nobull nomag"); }
81 override int GetCurrentStateID() { return RBLStableStateID.RBL_OPN_BU0_MA0; }
82 override bool HasBullet() { return false; }
83 override bool HasMagazine() { return false; }
84 override bool IsJammed() { return false; }
85 override bool IsBoltOpen() { return true; }
86 override bool IsRepairEnabled() { return true; }
88};
90{
91 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { jammed bullet nomag"); super.OnEntry(e); }
92 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } jammed bullet nomag"); }
93 override int GetCurrentStateID() { return RBLStableStateID.RBL_JAM_BU1_MA0; }
94 override bool HasBullet() { return true; }
95 override bool HasMagazine() { return false; }
96 override bool IsJammed() { return true; }
97 override bool IsBoltOpen() { return true; }
98 override bool IsRepairEnabled() { return true; }
100};
102{
103 override void OnEntry(WeaponEventBase e) { if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " { jammed bullet mag"); super.OnEntry(e); }
104 override void OnExit(WeaponEventBase e) { super.OnExit(e); if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " } jammed bullet mag"); }
105 override int GetCurrentStateID() { return RBLStableStateID.RBL_JAM_BU1_MA1; }
106 override bool HasBullet() { return true; }
107 override bool HasMagazine() { return true; }
108 override bool IsJammed() { return true; }
109 override bool IsBoltOpen() { return true; }
110 override bool IsRepairEnabled() { return true; }
112};
113
114
119class RifleBoltLock_Base extends Rifle_Base
120{
129
131 {
132 }
133
134 override void InitStateMachine()
135 {
136 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_BULLET)));
137 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET)));
138 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET)));
139 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET)));
140 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN)));
141 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET_OPEN)));
142 m_abilities.Insert(new AbilityRecord(WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH)));
143
144 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, GetWeaponSpecificCommand(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED)));
145 m_abilities.Insert(new AbilityRecord(WeaponActions.CHAMBERING, GetWeaponSpecificCommand(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_UNIQUE_CLOSED)));
146
147 m_abilities.Insert(new AbilityRecord(WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED)));
148 m_abilities.Insert(new AbilityRecord(WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED)));//????
149
150 m_abilities.Insert(new AbilityRecord(WeaponActions.UNJAMMING, GetWeaponSpecificCommand(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START)));
151 m_abilities.Insert(new AbilityRecord(WeaponActions.UNJAMMING, GetWeaponSpecificCommand(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END)));
152
153 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL)));
154 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_LAST)));
155 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM)));
156 m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY)));
157
158 //m_abilities.Insert(new AbilityRecord(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_UNCOCKED));
159
160 // setup state machine
161 // basic weapon states
162 // close-locked-jammed | nobullet-bullet | nomag-mag
163 // regexp: [CLJ][01][01]
164 C00 = new RBL_CLO_BU0_MA0(this, NULL, RBLAnimState.DEFAULT);
165 C10 = new RBL_CLO_BU1_MA0(this, NULL, RBLAnimState.DEFAULT);
166 C11 = new RBL_CLO_BU1_MA1(this, NULL, RBLAnimState.DEFAULT);
167 C01 = new RBL_CLO_BU0_MA1(this, NULL, RBLAnimState.DEFAULT);
168 O00 = new RBL_OPN_BU0_MA0(this, NULL, RBLAnimState.OPENED);
169 O01 = new RBL_OPN_BU0_MA1(this, NULL, RBLAnimState.OPENED);
170 JF0 = new RBL_JAM_BU1_MA0(this, NULL, RBLAnimState.JAMMED);
171 JF1 = new RBL_JAM_BU1_MA1(this, NULL, RBLAnimState.JAMMED);
172
173 // unstable (intermediate) states
174 WeaponCharging Mech_C00 = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
175 WeaponCharging Mech_C01 = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
176 WeaponCharging Mech_O00 = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
177 WeaponCharging Mech_O01 = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_OPENED));
178
179 WeaponCharging Mech_C10 = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
180 WeaponCharging Mech_C11 = new WeaponCharging(this, NULL, WeaponActions.MECHANISM, GetWeaponSpecificCommand(WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED));
181
182 WeaponStateBase Trigger_C00 = new WeaponDryFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY)); // cock without clip
183 WeaponStateBase Trigger_C10 = new WeaponFireLast(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL)); // cock with clip
184 WeaponFireAndChamberNext Trigger_C11 = new WeaponFireAndChamberNext(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_NORMAL));
185 WeaponStateBase Trigger_C11L = new WeaponFireLast(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_LAST));
186 WeaponStateBase Trigger_C01 = new WeaponDryFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
187 WeaponStateBase Trigger_O00 = new WeaponDryFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
188 WeaponStateBase Trigger_O01 = new WeaponDryFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
189 WeaponStateBase Trigger_JF0 = new WeaponDryFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
190 WeaponStateBase Trigger_JF1 = new WeaponDryFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_DRY));
191
192 //Fire and jam
193 WeaponStateBase Trigger_C10J = new WeaponFireToJam(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM)); // cock with clip
194 WeaponStateBase Trigger_C11J = new WeaponFireToJam(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM));
195
196 // WeaponStateBase Trigger_C11J = new WeaponFire(this, NULL, WeaponActions.FIRE, GetWeaponSpecificCommand(WeaponActions.FIRE, WeaponActionFireTypes.FIRE_JAM));
197
198 WeaponStateBase Unjam_JF0 = new WeaponUnjamming(this, NULL, WeaponActions.UNJAMMING, GetWeaponSpecificCommand(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
199 WeaponStateBase Unjam_JF1 = new WeaponUnjamming(this, NULL, WeaponActions.UNJAMMING, GetWeaponSpecificCommand(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_START));
200
201 WeaponChambering Chamber_C00 = new WeaponChambering(this, NULL, WeaponActions.CHAMBERING, GetWeaponSpecificCommand(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED));
202 WeaponChambering Chamber_C01 = new WeaponChambering(this, NULL, WeaponActions.CHAMBERING, GetWeaponSpecificCommand(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_CLOSED));
203 WeaponChambering Chamber_O00 = new WeaponChambering(this, NULL, WeaponActions.CHAMBERING, GetWeaponSpecificCommand(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_UNIQUE_CLOSED));
204 WeaponChambering Chamber_O01 = new WeaponChambering(this, NULL, WeaponActions.CHAMBERING, GetWeaponSpecificCommand(WeaponActions.CHAMBERING, WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_UNIQUE_CLOSED));
205
206 WeaponAttachMagazine Attach_C00 = new WeaponAttachMagazine(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET));
207 WeaponAttachMagazine Attach_C10 = new WeaponAttachMagazine(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET));
208 WeaponAttachMagazine Attach_O00 = new WeaponAttachMagazine(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN));//TODO Need add open animation
209 WeaponAttachMagazine Attach_JF0 = new WeaponAttachMagazine(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET));
210
211 WeaponReplacingMagAndChamberNext Reload_C11 = new WeaponReplacingMagAndChamberNext(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_BULLET));
212 WeaponReplacingMagAndChamberNext Reload_C01 = new WeaponReplacingMagAndChamberNext(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET));
213 WeaponReplacingMagAndChamberNext Reload_O01 = new WeaponReplacingMagAndChamberNext(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET_OPEN));//TODO Need add open animation
214 WeaponReplacingMagAndChamberNext Reload_JF1 = new WeaponReplacingMagAndChamberNext(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_BULLET));
215
216 WeaponDetachingMag Detach_C11 = new WeaponDetachingMag(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
217 WeaponDetachingMag Detach_C01 = new WeaponDetachingMag(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
218 WeaponDetachingMag Detach_O01 = new WeaponDetachingMag(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
219 WeaponDetachingMag Detach_JF1 = new WeaponDetachingMag(this, NULL, WeaponActions.RELOAD, GetWeaponSpecificCommand(WeaponActions.RELOAD, WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_DETACH));
220
221 //WeaponStateBase chmMag = new WeaponChamberFromAttMag(this, NULL, WeaponActions.MECHANISM, WeaponActionMechanismTypes.MECHANISM_CLOSED);
222
223 // events
224 WeaponEventBase __M__ = new WeaponEventMechanism;
225 WeaponEventBase __T__ = new WeaponEventTrigger;
226 WeaponEventBase __TJ_ = new WeaponEventTriggerToJam;
227 WeaponEventBase __U__ = new WeaponEventUnjam;
228 WeaponEventBase __L__ = new WeaponEventLoad1Bullet;
229 WeaponEventBase __A__ = new WeaponEventAttachMagazine;
230 WeaponEventBase __D__ = new WeaponEventDetachMagazine;
231 WeaponEventBase __S__ = new WeaponEventSwapMagazine;
232 WeaponEventBase _fin_ = new WeaponEventHumanCommandActionFinished;
233 WeaponEventBase _abt_ = new WeaponEventHumanCommandActionAborted;
234 WeaponEventBase _rto_ = new WeaponEventReloadTimeout;
235 WeaponEventBase _dto_ = new WeaponEventDryFireTimeout;
236
237 m_fsm = new WeaponFSM();
238
239 // order: Discharged-Charged | nobullet-bullet | nomag-mag
240 // charging
241 m_fsm.AddTransition(new WeaponTransition(C00, __M__, Mech_C00)); // charge from dischg nobullet nomag
242 m_fsm.AddTransition(new WeaponTransition(Mech_C00, _fin_, C00));
243 m_fsm.AddTransition(new WeaponTransition(Mech_C00, _abt_, C00));
244
245 m_fsm.AddTransition(new WeaponTransition(C10, __M__, Mech_C10)); // charge from bullet nomag
246 m_fsm.AddTransition(new WeaponTransition(Mech_C10, _fin_, C00, NULL, new WeaponGuardCurrentChamberEmpty(this)));
247 m_fsm.AddTransition(new WeaponTransition(Mech_C10, _fin_, C10));
248 m_fsm.AddTransition(new WeaponTransition(Mech_C10, _abt_, C00, NULL, new WeaponGuardCurrentChamberEmpty(this)));
249 m_fsm.AddTransition(new WeaponTransition(Mech_C10, _abt_, C10));
250
251 m_fsm.AddTransition(new WeaponTransition(C11, __M__, Mech_C11)); // charge from dischg nobullet nomag
252 m_fsm.AddTransition(new WeaponTransition(Mech_C11, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
253 m_fsm.AddTransition(new WeaponTransition(Mech_C11, _fin_, C11));
254 m_fsm.AddTransition(new WeaponTransition(Mech_C11, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
255 m_fsm.AddTransition(new WeaponTransition(Mech_C11, _abt_, C11));
256
257
258 m_fsm.AddTransition(new WeaponTransition(C01, __M__, Mech_C01)); // charge from dischg nobullet nomag
259 m_fsm.AddTransition(new WeaponTransition(Mech_C01, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
260 m_fsm.AddTransition(new WeaponTransition(Mech_C01, _fin_, C11));
261 m_fsm.AddTransition(new WeaponTransition(Mech_C01, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
262 m_fsm.AddTransition(new WeaponTransition(Mech_C01, _abt_, C11));
263
264 m_fsm.AddTransition(new WeaponTransition(O00, __M__, Mech_O00)); // charge from dischg nobullet nomag
265 m_fsm.AddTransition(new WeaponTransition(Mech_O00, _fin_, O00, NULL, new WeaponGuardWeaponOpen(this)));
266 m_fsm.AddTransition(new WeaponTransition(Mech_O00, _fin_, C00));
267 m_fsm.AddTransition(new WeaponTransition(Mech_O00, _abt_, O00, NULL, new WeaponGuardWeaponOpen(this)));
268 m_fsm.AddTransition(new WeaponTransition(Mech_O00, _abt_, C00));
269
270 m_fsm.AddTransition(new WeaponTransition(O01, __M__, Mech_O01)); // charge from dischg nobullet nomag
271 m_fsm.AddTransition(new WeaponTransition(Mech_O01, _fin_, O01, NULL, new WeaponGuardWeaponOpen(this)));
272 m_fsm.AddTransition(new WeaponTransition(Mech_O01, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
273 m_fsm.AddTransition(new WeaponTransition(Mech_O01, _fin_, C11));
274 m_fsm.AddTransition(new WeaponTransition(Mech_O01, _abt_, O01, NULL, new WeaponGuardWeaponOpen(this)));
275 m_fsm.AddTransition(new WeaponTransition(Mech_O01, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
276 m_fsm.AddTransition(new WeaponTransition(Mech_O01, _abt_, C11));
277
278 // fire
279 m_fsm.AddTransition(new WeaponTransition(C00, __T__, Trigger_C00));
280 m_fsm.AddTransition(new WeaponTransition(Trigger_C00, _fin_, C00));
281 m_fsm.AddTransition(new WeaponTransition(Trigger_C00, _dto_, C00));
282 m_fsm.AddTransition(new WeaponTransition(Trigger_C00, _abt_, C00));
283
284 m_fsm.AddTransition(new WeaponTransition(C01, __T__, Trigger_C01));
285 m_fsm.AddTransition(new WeaponTransition(Trigger_C01, _fin_, C01));
286 m_fsm.AddTransition(new WeaponTransition(Trigger_C01, _dto_, C01));
287 m_fsm.AddTransition(new WeaponTransition(Trigger_C01, _abt_, C01));
288
289 m_fsm.AddTransition(new WeaponTransition(C10, __T__, Trigger_C10));
290 m_fsm.AddTransition(new WeaponTransition(Trigger_C10, _fin_, C00));
291 m_fsm.AddTransition(new WeaponTransition(Trigger_C10, _rto_, C00));
292 m_fsm.AddTransition(new WeaponTransition(Trigger_C10, _abt_, C00));
293
294 m_fsm.AddTransition(new WeaponTransition(C11, __T__, Trigger_C11, NULL, new WeaponGuardHasAmmo(this)));
295 m_fsm.AddTransition(new WeaponTransition(Trigger_C11, _fin_, C11));
296 m_fsm.AddTransition(new WeaponTransition(Trigger_C11, _rto_, C11));
297 m_fsm.AddTransition(new WeaponTransition(Trigger_C11, _abt_, C11));
298
299 m_fsm.AddTransition(new WeaponTransition(C11, __T__, Trigger_C11L));
300 m_fsm.AddTransition(new WeaponTransition(Trigger_C11L, _fin_, O01));
301 m_fsm.AddTransition(new WeaponTransition(Trigger_C11L, _rto_, O01));
302 m_fsm.AddTransition(new WeaponTransition(Trigger_C11L, _abt_, O01));
303
304 m_fsm.AddTransition(new WeaponTransition(O00, __T__, Trigger_O00));
305 m_fsm.AddTransition(new WeaponTransition(Trigger_O00, _fin_, O00));
306 m_fsm.AddTransition(new WeaponTransition(Trigger_O00, _dto_, O00));
307 m_fsm.AddTransition(new WeaponTransition(Trigger_O00, _abt_, O00));
308
309 m_fsm.AddTransition(new WeaponTransition(O01, __T__, Trigger_O01));
310 m_fsm.AddTransition(new WeaponTransition(Trigger_O01, _fin_, O01));
311 m_fsm.AddTransition(new WeaponTransition(Trigger_O01, _dto_, O01));
312 m_fsm.AddTransition(new WeaponTransition(Trigger_O01, _abt_, O01));
313
314 m_fsm.AddTransition(new WeaponTransition(JF0, __T__, Trigger_JF0)); // opened fire.uncocked w mag
315 m_fsm.AddTransition(new WeaponTransition(Trigger_JF0, _fin_, JF0));
316 m_fsm.AddTransition(new WeaponTransition(Trigger_JF0, _dto_, JF0));
317 m_fsm.AddTransition(new WeaponTransition(Trigger_JF0, _abt_, JF0));
318
319 m_fsm.AddTransition(new WeaponTransition(JF1, __T__, Trigger_JF1)); // opened fire.uncocked w mag
320 m_fsm.AddTransition(new WeaponTransition(Trigger_JF1, _fin_, JF1));
321 m_fsm.AddTransition(new WeaponTransition(Trigger_JF1, _dto_, JF1));
322 m_fsm.AddTransition(new WeaponTransition(Trigger_JF1, _abt_, JF1));
323
324
325 m_fsm.AddTransition(new WeaponTransition(C10, __TJ_, Trigger_C10J));
326 m_fsm.AddTransition(new WeaponTransition(Trigger_C10J, _fin_, JF0));
327 m_fsm.AddTransition(new WeaponTransition(Trigger_C10J, _rto_, JF0));
328 m_fsm.AddTransition(new WeaponTransition(Trigger_C10J, _abt_, JF0));
329
330 m_fsm.AddTransition(new WeaponTransition(C11, __TJ_, Trigger_C11J));
331 m_fsm.AddTransition(new WeaponTransition(Trigger_C11J, _fin_, JF1));
332 m_fsm.AddTransition(new WeaponTransition(Trigger_C11J, _rto_, JF1));
333 m_fsm.AddTransition(new WeaponTransition(Trigger_C11J, _abt_, JF1));
334
335
336 // load cartridge
337 m_fsm.AddTransition(new WeaponTransition(C00, __L__, Chamber_C00)); // chamber from closed=1
338 m_fsm.AddTransition(new WeaponTransition(Chamber_C00, _fin_, O00, NULL, new WeaponGuardWeaponOpen(this)));
339 m_fsm.AddTransition(new WeaponTransition(Chamber_C00, _fin_, C00, NULL, new WeaponGuardChamberEmpty(this)));
340 m_fsm.AddTransition(new WeaponTransition(Chamber_C00, _fin_, C10));
341 m_fsm.AddTransition(new WeaponTransition(Chamber_C00, _abt_, O00, NULL, new WeaponGuardWeaponOpen(this)));
342 m_fsm.AddTransition(new WeaponTransition(Chamber_C00, _abt_, C00, NULL, new WeaponGuardChamberEmpty(this)));
343 m_fsm.AddTransition(new WeaponTransition(Chamber_C00, _abt_, C10));
344
345 m_fsm.AddTransition(new WeaponTransition(C01, __L__, Chamber_C01)); // chamber from closed charged
346 m_fsm.AddTransition(new WeaponTransition(Chamber_C01, _fin_, O01, NULL, new WeaponGuardWeaponOpen(this)));
347 m_fsm.AddTransition(new WeaponTransition(Chamber_C01, _fin_, C01, NULL, new WeaponGuardChamberEmpty(this)));
348 m_fsm.AddTransition(new WeaponTransition(Chamber_C01, _fin_, C11));
349 m_fsm.AddTransition(new WeaponTransition(Chamber_C01, _abt_, O01, NULL, new WeaponGuardWeaponOpen(this)));
350 m_fsm.AddTransition(new WeaponTransition(Chamber_C01, _abt_, C01, NULL, new WeaponGuardChamberEmpty(this)));
351 m_fsm.AddTransition(new WeaponTransition(Chamber_C01, _abt_, C11));
352
353 m_fsm.AddTransition(new WeaponTransition(O00, __L__, Chamber_O00)); // chamber from closed charged
354 m_fsm.AddTransition(new WeaponTransition(Chamber_O00, _fin_, O00, NULL, new WeaponGuardCurrentChamberEmpty(this)));
355 m_fsm.AddTransition(new WeaponTransition(Chamber_O00, _fin_, C10));
356 m_fsm.AddTransition(new WeaponTransition(Chamber_O00, _abt_, O00, NULL, new WeaponGuardCurrentChamberEmpty(this)));
357 m_fsm.AddTransition(new WeaponTransition(Chamber_O00, _abt_, C10));
358
359 m_fsm.AddTransition(new WeaponTransition(O01, __L__, Chamber_O01)); // chamber from closed charged
360 m_fsm.AddTransition(new WeaponTransition(Chamber_O01, _fin_, O01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
361 m_fsm.AddTransition(new WeaponTransition(Chamber_O01, _fin_, C11));
362 m_fsm.AddTransition(new WeaponTransition(Chamber_O01, _abt_, O01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
363 m_fsm.AddTransition(new WeaponTransition(Chamber_O01, _abt_, C11));
364
365 // attach magazine (no mag in weapon)
366 m_fsm.AddTransition(new WeaponTransition(C00, __A__, Attach_C00, NULL, new WeaponGuardCanAttachMag(this))); // attach from CLO/b0/m0
367 m_fsm.AddTransition(new WeaponTransition(Attach_C00, _fin_, C00, NULL, new GuardNot(new WeaponGuardHasMag(this))));
368 m_fsm.AddTransition(new WeaponTransition(Attach_C00, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
369 m_fsm.AddTransition(new WeaponTransition(Attach_C00, _fin_, C11));
370 m_fsm.AddTransition(new WeaponTransition(Attach_C00, _abt_, C00, NULL, new GuardNot(new WeaponGuardHasMag(this))));
371 m_fsm.AddTransition(new WeaponTransition(Attach_C00, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
372 m_fsm.AddTransition(new WeaponTransition(Attach_C00, _abt_, C11));
373
374 m_fsm.AddTransition(new WeaponTransition(C10, __A__, Attach_C10, NULL, new WeaponGuardCanAttachMag(this))); // attach from CLO/b1/m0
375 m_fsm.AddTransition(new WeaponTransition(Attach_C10, _fin_, C11, NULL, new WeaponGuardHasMag(this)));
376 m_fsm.AddTransition(new WeaponTransition(Attach_C10, _fin_, C10));
377 m_fsm.AddTransition(new WeaponTransition(Attach_C10, _abt_, C11, NULL, new WeaponGuardHasMag(this)));
378 m_fsm.AddTransition(new WeaponTransition(Attach_C10, _abt_, C10));
379
380 m_fsm.AddTransition(new WeaponTransition(O00, __A__, Attach_O00, NULL, new WeaponGuardCanAttachMag(this))); // attach from CLO/b0/m0
381 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _fin_, O00, NULL, new GuardNot(new WeaponGuardHasMag(this))));
382 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _fin_, O01, NULL, new WeaponGuardWeaponOpen(this)));
383 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
384 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _fin_, C11));
385 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _abt_, O00, NULL, new GuardNot(new WeaponGuardHasMag(this))));
386 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _abt_, O01, NULL, new WeaponGuardWeaponOpen(this)));
387 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
388 m_fsm.AddTransition(new WeaponTransition(Attach_O00, _abt_, C11));
389
390 m_fsm.AddTransition(new WeaponTransition(JF0, __A__, Attach_JF0, NULL, new WeaponGuardCanAttachMag(this))); // attach from JAM/b1/m0
391 m_fsm.AddTransition(new WeaponTransition(Attach_JF0, _fin_, JF1, NULL, new WeaponGuardHasMag(this)));
392 m_fsm.AddTransition(new WeaponTransition(Attach_JF0, _fin_, JF0));
393 m_fsm.AddTransition(new WeaponTransition(Attach_JF0, _abt_, JF1, NULL, new WeaponGuardHasMag(this)));
394 m_fsm.AddTransition(new WeaponTransition(Attach_JF0, _abt_, JF0));
395
396
397 // replace magazine
398 m_fsm.AddTransition(new WeaponTransition(C11, __S__, Reload_C11, NULL, new WeaponGuardCanSwapMag(this))); // swap in Chg/b1/m1
399 m_fsm.AddTransition(new WeaponTransition(Reload_C11, _fin_, C11, NULL, new WeaponGuardHasMag(this)));
400 m_fsm.AddTransition(new WeaponTransition(Reload_C11, _fin_, C10));
401 m_fsm.AddTransition(new WeaponTransition(Reload_C11, _abt_, C11, NULL, new WeaponGuardHasMag(this)));
402 m_fsm.AddTransition(new WeaponTransition(Reload_C11, _abt_, C10));
403
404
405 m_fsm.AddTransition(new WeaponTransition(C01, __S__, Reload_C01, NULL, new WeaponGuardCanSwapMag(this))); // swap in CLO/b0/m1
406 m_fsm.AddTransition(new WeaponTransition(Reload_C01, _fin_, C11, NULL, new WeaponGuardCurrentChamberFull(this)));
407 m_fsm.AddTransition(new WeaponTransition(Reload_C01, _fin_, C01, NULL, new WeaponGuardHasMag(this)));
408 m_fsm.AddTransition(new WeaponTransition(Reload_C01, _fin_, C00));
409 m_fsm.AddTransition(new WeaponTransition(Reload_C01, _abt_, C11, NULL, new WeaponGuardCurrentChamberFull(this)));
410 m_fsm.AddTransition(new WeaponTransition(Reload_C01, _abt_, C01, NULL, new WeaponGuardHasMag(this)));
411 m_fsm.AddTransition(new WeaponTransition(Reload_C01, _abt_, C00));
412
413
414 m_fsm.AddTransition(new WeaponTransition(O01, __S__, Reload_O01, NULL, new WeaponGuardCanSwapMag(this))); // swap in CLO/b0/m1
415 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _fin_, O00, NULL, new GuardNot(new WeaponGuardHasMag(this))));
416 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _fin_, O01, NULL, new WeaponGuardWeaponOpen(this)));
417 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
418 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _fin_, C11));
419 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _abt_, O00, NULL, new GuardNot(new WeaponGuardHasMag(this))));
420 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _abt_, O01, NULL, new WeaponGuardWeaponOpen(this)));
421 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
422 m_fsm.AddTransition(new WeaponTransition(Reload_O01, _abt_, C11));
423
424 m_fsm.AddTransition(new WeaponTransition(JF1, __S__, Reload_JF1, NULL, new WeaponGuardCanSwapMag(this))); // swap in JAM/b1/m1
425 m_fsm.AddTransition(new WeaponTransition(Reload_JF1, _fin_, JF1, NULL, new WeaponGuardHasMag(this)));
426 m_fsm.AddTransition(new WeaponTransition(Reload_JF1, _fin_, JF0));
427 m_fsm.AddTransition(new WeaponTransition(Reload_JF1, _abt_, JF1, NULL, new WeaponGuardHasMag(this)));
428 m_fsm.AddTransition(new WeaponTransition(Reload_JF1, _abt_, JF0));
429
430 // @TODO: abort in jam
431
432 // detach magazine
433 m_fsm.AddTransition(new WeaponTransition(C11, __D__, Detach_C11, NULL, new WeaponGuardCanDetachMag(this))); // detach from Chg/b1/m1
434 m_fsm.AddTransition(new WeaponTransition(Detach_C11, _fin_, C11, NULL, new WeaponGuardHasMag(this)));
435 m_fsm.AddTransition(new WeaponTransition(Detach_C11, _fin_, C10));
436 m_fsm.AddTransition(new WeaponTransition(Detach_C11, _abt_, C11, NULL, new WeaponGuardHasMag(this)));
437 m_fsm.AddTransition(new WeaponTransition(Detach_C11, _abt_, C10));
438
439 m_fsm.AddTransition(new WeaponTransition(C01, __D__, Detach_C01, NULL, new WeaponGuardCanDetachMag(this))); // detach from Chg/b0/m1
440 m_fsm.AddTransition(new WeaponTransition(Detach_C01, _fin_, C01, NULL, new WeaponGuardHasMag(this)));
441 m_fsm.AddTransition(new WeaponTransition(Detach_C01, _fin_, C00));
442 m_fsm.AddTransition(new WeaponTransition(Detach_C01, _abt_, C01, NULL, new WeaponGuardHasMag(this)));
443 m_fsm.AddTransition(new WeaponTransition(Detach_C01, _abt_, C00));
444
445 m_fsm.AddTransition(new WeaponTransition(O01, __D__, Detach_O01, NULL, new WeaponGuardCanDetachMag(this))); // detach from Dic/b0/m1
446 m_fsm.AddTransition(new WeaponTransition(Detach_O01, _fin_, O01, NULL, new WeaponGuardHasMag(this)));
447 m_fsm.AddTransition(new WeaponTransition(Detach_O01, _fin_, O00));
448 m_fsm.AddTransition(new WeaponTransition(Detach_O01, _abt_, O01, NULL, new WeaponGuardHasMag(this)));
449 m_fsm.AddTransition(new WeaponTransition(Detach_O01, _abt_, O00));
450
451 m_fsm.AddTransition(new WeaponTransition(JF1, __D__, Detach_JF1, NULL, new WeaponGuardCanDetachMag(this))); // detach from CLO/b1/m1 jammed
452 m_fsm.AddTransition(new WeaponTransition(Detach_JF1, _fin_, JF1, NULL, new WeaponGuardHasMag(this)));
453 m_fsm.AddTransition(new WeaponTransition(Detach_JF1, _fin_, JF0));
454 m_fsm.AddTransition(new WeaponTransition(Detach_JF1, _abt_, JF1, NULL, new WeaponGuardHasMag(this)));
455 m_fsm.AddTransition(new WeaponTransition(Detach_JF1, _abt_, JF0));
456
457
458 // unjam
459 m_fsm.AddTransition(new WeaponTransition(JF0, __U__, Unjam_JF0)); // unjam nomag
460 m_fsm.AddTransition(new WeaponTransition(Unjam_JF0, _fin_, JF0, NULL, new WeaponGuardJammed(this)));
461 m_fsm.AddTransition(new WeaponTransition(Unjam_JF0, _fin_, C00));
462 m_fsm.AddTransition(new WeaponTransition(Unjam_JF0, _abt_, JF0, NULL, new WeaponGuardJammed(this)));
463 m_fsm.AddTransition(new WeaponTransition(Unjam_JF0, _abt_, C00));
464
465 m_fsm.AddTransition(new WeaponTransition(JF1, __U__, Unjam_JF1)); // unjam with mag with ammo
466 m_fsm.AddTransition(new WeaponTransition(Unjam_JF1, _fin_, JF1, NULL, new WeaponGuardJammed(this)));
467 m_fsm.AddTransition(new WeaponTransition(Unjam_JF1, _fin_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
468 m_fsm.AddTransition(new WeaponTransition(Unjam_JF1, _fin_, C11));
469 m_fsm.AddTransition(new WeaponTransition(Unjam_JF1, _abt_, JF1, NULL, new WeaponGuardJammed(this)));
470 m_fsm.AddTransition(new WeaponTransition(Unjam_JF1, _abt_, C01, NULL, new WeaponGuardCurrentChamberEmpty(this)));
471 m_fsm.AddTransition(new WeaponTransition(Unjam_JF1, _abt_, C11));
472
473 SetInitialState(C00);
474
475 SelectionBulletHide();
476 HideMagazine();
477
478 m_fsm.Start();
479 }
480
481 override float GetChanceToJam()
482 {
483 float chanceToJam = super.GetChanceToJam();
484 Magazine mag = GetMagazine(GetCurrentMuzzle());
485
486 if (mag)
487 chanceToJam = chanceToJam + ((1.0 - chanceToJam) * mag.GetChanceToJam());
488 else
489 chanceToJam = chanceToJam + ((1.0 - chanceToJam) * 0.06);
490
491 return chanceToJam;
492 }
493
494 override void SetActions()
495 {
496 super.SetActions();
498 //AddAction(ActionAdvancedDetachMagazine);
499 }
500};
501
void wpnPrint(string s)
Definition Debug.c:1
void AddAction(typename actionName)
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition Guards.c:602
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
Definition Guards.c:99
void WeaponGuardWeaponOpen(Weapon_Base w=NULL)
Definition Guards.c:604
RBL_CLO_BU0_MA0
RBL_OPN_BU0_MA1
RBLAnimState
@ OPENED
@ DEFAULT
default weapon state, closed and discharged
@ JAMMED
RBL_CLO_BU0_MA1
RBLStableStateID
RBL_JAM_BU1_MA0
RBL_CLO_BU1_MA0
RBL_CLO_BU1_MA1
RBL_OPN_BU0_MA0
RBL_JAM_BU1_MA1
class SSPFireout extends WeaponStableState OnEntry
enum FSMTransition WeaponTransition
MuzzleState
ref array< MuzzleState > m_muzzleHasBullet
pair ( action, actionType )
Definition Weapon_Base.c:5
static bool IsWeaponLogEnable()
Definition Debug.c:799
base for rifles @NOTE name copies config base class
Definition SKS.c:70
void RifleBoltLock_Base()
override float GetChanceToJam()
ref WeaponStableState O01
ref WeaponStableState O00
override void SetActions()
override void InitStateMachine()
charging of weapon without ammo to be chambered
signalize mechanism manipulation
Definition Events.c:35
weapon finite state machine
replace current magazine with new one
represents weapon's stable state (i.e. the basic states that the weapon will spend the most time in)
Definition Crossbow.c:27
override bool IsBoltOpen()
override bool IsJammed()
Definition Crossbow.c:33
override void OnExit(WeaponEventBase e)
Definition Crossbow.c:29
override void InitMuzzleArray()
Definition Crossbow.c:35
override void OnEntry(WeaponEventBase e)
override bool HasBullet()
Definition Crossbow.c:31
override int GetCurrentStateID()
Definition Crossbow.c:30
override bool IsRepairEnabled()
Definition Crossbow.c:34
override bool HasMagazine()
Definition Crossbow.c:32
represent weapon state base
Definition BulletHide.c:2
handle jamming state set jam/unjam state for weapon
Definition SKS.c:53
override bool IsBoltOpen()
override void InitMuzzleArray()
override bool HasMagazine()
override bool IsRepairEnabled()
override void OnEntry(WeaponEventBase e)
override int GetCurrentStateID()
override bool IsJammed()
override bool HasBullet()
override void OnExit(WeaponEventBase e)
unjam submachine
WeaponActionChamberingTypes
Definition human.c:856
WeaponActions
actions
Definition human.c:796
WeaponActionReloadTypes
Definition human.c:812
WeaponActionUnjammingTypes
Definition human.c:892
WeaponActionFireTypes
Definition human.c:900