DayZ 1.24
Loading...
Searching...
No Matches
WeaponGuardBase Class Reference

represents guard on a transition from state to state More...

Collaboration diagram for WeaponGuardBase:
[legend]

Protected Member Functions

void WeaponGuardJammed (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardIsDestroyed (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardHasAmmoInnerMagazine (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardHasAmmoInEvent (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardHasMag (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberEmpty (Weapon_Base w=NULL, int muzzle_index=0)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardCurrentChamberEmpty (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardAnyChamberEmpty (Weapon_Base w=NULL, int muzzle_index=0)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberFull (Weapon_Base w=NULL, int muzzle_index=0)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardCurrentChamberFull (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardInnerMagazineFull (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardInnerMagazineFullShareChamber (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberFiredOut (Weapon_Base w=NULL, int muzzle_index=0)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardCurrentChamberFiredOut (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardAnyChamberFiredOut (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardCanAttachMag (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardCanSwapMag (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardCanDetachMag (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberHasRoomForMoreThanOne (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardInternalMagazineHasRoomForBullet (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberHasRoomForOne (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberMultiHasRoomBulltet (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardChamberMultiHasRoomBulltetIgnoreLast (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardMagazinesHaveEqualSizes (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardWeaponCharged (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardWeaponOpen (Weapon_Base w=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 

Protected Attributes

Weapon_Base m_weapon
 
int m_muzzle
 

Private Member Functions

bool GuardCondition (WeaponEventBase e)
 
void GuardAnd (WeaponGuardBase arg0=NULL, WeaponGuardBase arg1=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void GuardNot (WeaponGuardBase arg0=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void GuardOr (WeaponGuardBase arg0=NULL, WeaponGuardBase arg1=NULL)
 
override bool GuardCondition (WeaponEventBase e)
 
void WeaponGuardHasAmmoInLoopedState (WeaponChambering_Base state)
 
override bool GuardCondition (WeaponEventBase e)
 

Private Attributes

ref WeaponGuardBase m_arg0
 
ref WeaponGuardBase m_arg1
 
WeaponChambering_Base m_state
 

Detailed Description

represents guard on a transition from state to state

Definition at line 4 of file Guards.c.

Member Function Documentation

◆ GuardAnd()

void WeaponGuardBase::GuardAnd ( WeaponGuardBase arg0 = NULL,
WeaponGuardBase arg1 = NULL )
inlineprivate

Definition at line 19 of file Guards.c.

19{ m_arg0 = arg0; m_arg1 = arg1; }
ref WeaponGuardBase m_arg1
Definition Guards.c:17
ref WeaponGuardBase m_arg0
Definition Guards.c:16

◆ GuardCondition() [1/31]

bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprivate

Definition at line 11 of file Guards.c.

11{ return true; }

◆ GuardCondition() [2/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprivate

Definition at line 21 of file Guards.c.

22 {
23 bool result = m_arg0.GuardCondition(e) && m_arg1.GuardCondition(e);
24 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] guard - " + m_arg0.Type() + " && " + m_arg1.Type() + " = " + result);
25 return result;
26 }
void wpnDebugPrint(string s)
Definition Debug.c:9
static bool IsWeaponLogEnable()
Definition Debug.c:799

References LogManager::IsWeaponLogEnable(), and wpnDebugPrint().

◆ GuardCondition() [3/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprivate

Definition at line 35 of file Guards.c.

36 {
37 bool result = !m_arg0.GuardCondition(e);
38 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] guard - ! " + m_arg0.Type() + " = " + result);
39 return result;
40 }

References LogManager::IsWeaponLogEnable(), and wpnDebugPrint().

◆ GuardCondition() [4/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprivate

Definition at line 50 of file Guards.c.

51 {
52 bool result = m_arg0.GuardCondition(e) || m_arg1.GuardCondition(e);
53 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] guard - " + m_arg0.Type() + " || " + m_arg1.Type() + " = " + result);
54 return result;
55 }

References LogManager::IsWeaponLogEnable(), and wpnDebugPrint().

◆ GuardCondition() [5/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 65 of file Guards.c.

66 {
67 /*int mi = m_weapon.GetCurrentMuzzle();
68 if (m_weapon.IsChamberJammed(mi))*/
69 if (m_weapon.IsJammed())
70 {
71 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - jammed");
72 return true;
73 }
74 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] guard - not jammed");
75 return false;
76 }
Weapon_Base m_weapon
Definition Guards.c:62

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [6/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 84 of file Guards.c.

85 {
86 if (m_weapon.IsDamageDestroyed())
87 {
88 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - weapon destroyed");
89 return true;
90 }
91 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - weapon not destroyed");
92 return false;
93 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [7/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 120 of file Guards.c.

121 {
122 int mi = m_weapon.GetCurrentMuzzle();
123 if (m_weapon.GetInternalMagazineCartridgeCount(mi) >= 1)
124 {
125 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - has ammo in inner magazine");
126 return true;
127 }
128 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - no ammo in inner magazine");
129 return false;
130 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [8/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 138 of file Guards.c.

139 {
140 Magazine mag = e.m_magazine;
141 if (mag != NULL && mag.GetAmmoCount() > 0)
142 {
143 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - has ammo in event");
144 return true;
145 }
146 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - no ammo in event");
147 return false;
148 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [9/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 157 of file Guards.c.

158 {
159 int mi = m_weapon.GetCurrentMuzzle();
160 Magazine mag = m_weapon.GetMagazine(mi);
161 if (mag != NULL)
162 {
163 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - has magazine");
164 return true;
165 }
166 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - no magazine");
167 return false;
168 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [10/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 177 of file Guards.c.

178 {
179 if (m_weapon.IsChamberEmpty(m_muzzle))
180 {
181 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber (" + m_muzzle + ") empty");
182 return true;
183 }
184 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber (" + m_muzzle + ") not empty");
185 return false;
186 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [11/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 194 of file Guards.c.

195 {
196 int mi = m_weapon.GetCurrentMuzzle();
197 if (m_weapon.IsChamberEmpty(mi))
198 {
199 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber empty");
200 return true;
201 }
202 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber not empty");
203 return false;
204 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [12/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 213 of file Guards.c.

214 {
215 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
216 {
217 if (m_weapon.IsChamberEmpty(i))
218 {
219 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - multi chamber (" + i + ") empty");
220 return true;
221 }
222 }
223 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - no chamber empty");
224 return false;
225 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [13/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 234 of file Guards.c.

235 {
236 if (m_weapon.IsChamberFull(m_muzzle))
237 {
238 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber (" + m_muzzle + ") full");
239 return true;
240 }
241 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber (" + m_muzzle + ") not full");
242 return false;
243 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [14/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 251 of file Guards.c.

252 {
253 int mi = m_weapon.GetCurrentMuzzle();
254 if (m_weapon.IsChamberFull(mi))
255 {
256 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber full");
257 return true;
258 }
259 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber not full");
260 return false;
261 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [15/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 270 of file Guards.c.

271 {
272 int mi = m_weapon.GetCurrentMuzzle();
273 if (m_weapon.IsInternalMagazineFull(mi))
274 {
275 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - internal magazine full");
276 return true;
277 }
278 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - internal magazine not full");
279 return false;
280 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [16/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 288 of file Guards.c.

289 {
290 int mi = m_weapon.GetCurrentMuzzle();
291
292 if (m_weapon.IsChamberFull(mi) && m_weapon.IsInternalMagazineFull(mi))
293 {
294 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - internal magazine with share chamber is full");
295 return true;
296 }
297 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - internal magazine with share chamber is not full");
298 return false;
299 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [17/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 308 of file Guards.c.

309 {
310 if (m_weapon.IsChamberFiredOut(m_muzzle))
311 {
312 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber (" + m_muzzle + ") fireout");
313 return true;
314 }
315 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber (" + m_muzzle + ") not fireout");
316 return false;
317 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [18/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 325 of file Guards.c.

326 {
327 int mi = m_weapon.GetCurrentMuzzle();
328 if (m_weapon.IsChamberFiredOut(mi))
329 {
330 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber fired out");
331 return true;
332 }
333 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber not fired out");
334 return false;
335 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [19/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 343 of file Guards.c.

344 {
345 for (int i = 0; i < m_weapon.GetMuzzleCount(); i++)
346 {
347 if (m_weapon.IsChamberFiredOut(i))
348 {
349 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - multi chamber (" + i + ") fired out");
350 return true;
351 }
352 }
353
354 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - any chamber has not fired out");
355 return false;
356 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [20/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 364 of file Guards.c.

365 {
366 int mi = m_weapon.GetCurrentMuzzle();
367 if (m_weapon && e.m_magazine && m_weapon.CanAttachMagazine(mi, e.m_magazine))
368 {
369 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - can attach magazine");
370 return true;
371 }
372 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - cannot attach magazine");
373 return false;
374 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [21/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 382 of file Guards.c.

383 {
384 int mi = m_weapon.GetCurrentMuzzle();
385 Magazine attached_mag = m_weapon.GetMagazine(mi);
386 if (m_weapon && e.m_magazine && e.m_magazine != attached_mag /*&& m_weapon.CanSwapMagazine(mi, e.m_magazine)*/)
387 {
388 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - can swap magazine");
389 return true;
390 }
391 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - cannot swap magazine");
392 return false;
393 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [22/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 401 of file Guards.c.

402 {
403 int mi = m_weapon.GetCurrentMuzzle();
404 if (m_weapon && e.m_magazine && m_weapon.GetMagazine(mi)/* && m_weapon.CanDetachMagazine(mi, e.m_magazine)*/)
405 {
406 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - can detach magazine");
407 return true;
408 }
409 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - cannot detach magazine");
410 return false;
411 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [23/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 419 of file Guards.c.

420 {
421 int mi = m_weapon.GetCurrentMuzzle();
422 if (m_weapon.GetInternalMagazineMaxCartridgeCount(mi) - m_weapon.GetInternalMagazineCartridgeCount(mi) > 1)
423 {
424 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has room for more than 1b");
425 return true;
426 }
427 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has no room for more than 1b");
428 return false;
429 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [24/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 437 of file Guards.c.

438 {
439 int mi = m_weapon.GetCurrentMuzzle();
440 if (m_weapon.GetInternalMagazineMaxCartridgeCount(mi) - m_weapon.GetInternalMagazineCartridgeCount(mi) >= 1)
441 {
442 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has room for bullet");
443 return true;
444 }
445 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has no room for bullet");
446 return false;
447 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [25/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 455 of file Guards.c.

456 {
457 int mi = m_weapon.GetCurrentMuzzle();
458 if (m_weapon.GetTotalMaxCartridgeCount(mi) - m_weapon.GetTotalCartridgeCount(mi) == 1)
459 {
460 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has room for 1b");
461 return true;
462 }
463 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has no room for 1b");
464 return false;
465 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [26/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 473 of file Guards.c.

474 {
475 int i = m_weapon.GetMuzzleCount() - 1;
476 for (; i >= 0; i--)
477 {
478 if (m_weapon.GetTotalMaxCartridgeCount(i) - m_weapon.GetTotalCartridgeCount(i) >= 1)
479 {
480 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has room for 1b");
481 return true;
482 }
483 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has no room for 1b");
484 }
485 return false;
486 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [27/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 494 of file Guards.c.

495 {
496 int i = m_weapon.GetMuzzleCount() - 1;
497 bool emty_one = false;
498 for (; i >= 0; i--)
499 {
500 if (m_weapon.GetTotalMaxCartridgeCount(i) - m_weapon.GetTotalCartridgeCount(i) >= 1)
501 {
502 if (!emty_one)
503 emty_one = true;
504 else
505 {
506 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has room for 1b");
507 return true;
508 }
509 }
510 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - chamber has no room for 1b");
511 }
512 return false;
513 }

References LogManager::IsWeaponLogEnable(), m_weapon, and wpnDebugPrint().

◆ GuardCondition() [28/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprivate

Definition at line 522 of file Guards.c.

523 {
524 Magazine mag = m_state.m_srcMagazine;
525 if (mag != NULL && mag.GetAmmoCount() > 0)
526 {
527 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] guard - has ammo in looped state");
528 return true;
529 }
530 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] guard - no ammo in looped state");
531 return false;
532 }
WeaponChambering_Base m_state
Definition Guards.c:519

References LogManager::IsWeaponLogEnable(), and wpnDebugPrint().

◆ GuardCondition() [29/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 540 of file Guards.c.

541 {
542 int mi = m_weapon.GetCurrentMuzzle();
543 Magazine mag = m_weapon.GetMagazine(mi);
544 Magazine mag2 = e.m_magazine;
545 if (mag != NULL && mag2 != NULL)
546 {
548 if (eq)
549 {
550 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - same inventory sizes");
551 return true;
552 }
553
554 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - different inventory sizes");
555 return false;
556 }
557 Error("[wpnfsm] " + Object.GetDebugName(m_weapon) + " guard - mag == NULL or mag2 == NULL, cannot perform comparison");
558 return false;
559 }
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
bool magazinesHaveEqualSizes(notnull Magazine mag, notnull Magazine mag2)

References Error(), LogManager::IsWeaponLogEnable(), m_weapon, magazinesHaveEqualSizes(), and wpnDebugPrint().

◆ GuardCondition() [30/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 568 of file Guards.c.

569 {
570 return m_weapon.IsCharged();
571 }

References m_weapon.

◆ GuardCondition() [31/31]

override bool WeaponGuardBase::GuardCondition ( WeaponEventBase e)
inlineprotected

Definition at line 592 of file Guards.c.

593 {
594 return m_weapon.IsWeaponOpen();
595 }

References m_weapon.

◆ GuardNot()

void WeaponGuardBase::GuardNot ( WeaponGuardBase arg0 = NULL)
inlineprivate

Definition at line 33 of file Guards.c.

33{ m_arg0 = arg0; }

◆ GuardOr()

void WeaponGuardBase::GuardOr ( WeaponGuardBase arg0 = NULL,
WeaponGuardBase arg1 = NULL )
inlineprivate

Definition at line 48 of file Guards.c.

48{ m_arg0 = arg0; m_arg1 = arg1; }

◆ WeaponGuardAnyChamberEmpty()

void WeaponGuardBase::WeaponGuardAnyChamberEmpty ( Weapon_Base w = NULL,
int muzzle_index = 0 )
inlineprotected

Definition at line 211 of file Guards.c.

References m_weapon.

◆ WeaponGuardAnyChamberFiredOut()

void WeaponGuardBase::WeaponGuardAnyChamberFiredOut ( Weapon_Base w = NULL)
inlineprotected

Definition at line 341 of file Guards.c.

341{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardCanAttachMag()

void WeaponGuardBase::WeaponGuardCanAttachMag ( Weapon_Base w = NULL)
inlineprotected

Definition at line 362 of file Guards.c.

362{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardCanDetachMag()

void WeaponGuardBase::WeaponGuardCanDetachMag ( Weapon_Base w = NULL)
inlineprotected

Definition at line 399 of file Guards.c.

399{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardCanSwapMag()

void WeaponGuardBase::WeaponGuardCanSwapMag ( Weapon_Base w = NULL)
inlineprotected

Definition at line 380 of file Guards.c.

380{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardChamberEmpty()

void WeaponGuardBase::WeaponGuardChamberEmpty ( Weapon_Base w = NULL,
int muzzle_index = 0 )
inlineprotected

Definition at line 175 of file Guards.c.

References m_weapon.

◆ WeaponGuardChamberFiredOut()

void WeaponGuardBase::WeaponGuardChamberFiredOut ( Weapon_Base w = NULL,
int muzzle_index = 0 )
inlineprotected

Definition at line 306 of file Guards.c.

References m_weapon.

◆ WeaponGuardChamberFull()

void WeaponGuardBase::WeaponGuardChamberFull ( Weapon_Base w = NULL,
int muzzle_index = 0 )
inlineprotected

Definition at line 232 of file Guards.c.

References m_weapon.

◆ WeaponGuardChamberHasRoomForMoreThanOne()

void WeaponGuardBase::WeaponGuardChamberHasRoomForMoreThanOne ( Weapon_Base w = NULL)
inlineprotected

Definition at line 417 of file Guards.c.

417{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardChamberHasRoomForOne()

void WeaponGuardBase::WeaponGuardChamberHasRoomForOne ( Weapon_Base w = NULL)
inlineprotected

Definition at line 453 of file Guards.c.

453{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardChamberMultiHasRoomBulltet()

void WeaponGuardBase::WeaponGuardChamberMultiHasRoomBulltet ( Weapon_Base w = NULL)
inlineprotected

Definition at line 471 of file Guards.c.

471{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardChamberMultiHasRoomBulltetIgnoreLast()

void WeaponGuardBase::WeaponGuardChamberMultiHasRoomBulltetIgnoreLast ( Weapon_Base w = NULL)
inlineprotected

Definition at line 492 of file Guards.c.

492{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardCurrentChamberEmpty()

void WeaponGuardBase::WeaponGuardCurrentChamberEmpty ( Weapon_Base w = NULL)
inlineprotected

Definition at line 192 of file Guards.c.

192{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardCurrentChamberFiredOut()

void WeaponGuardBase::WeaponGuardCurrentChamberFiredOut ( Weapon_Base w = NULL)
inlineprotected

Definition at line 323 of file Guards.c.

323{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardCurrentChamberFull()

void WeaponGuardBase::WeaponGuardCurrentChamberFull ( Weapon_Base w = NULL)
inlineprotected

Definition at line 249 of file Guards.c.

249{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardHasAmmoInEvent()

void WeaponGuardBase::WeaponGuardHasAmmoInEvent ( Weapon_Base w = NULL)
inlineprotected

Definition at line 136 of file Guards.c.

136{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardHasAmmoInLoopedState()

void WeaponGuardBase::WeaponGuardHasAmmoInLoopedState ( WeaponChambering_Base state)
inlineprivate

Definition at line 520 of file Guards.c.

520{ m_state = state; }

◆ WeaponGuardHasAmmoInnerMagazine()

void WeaponGuardBase::WeaponGuardHasAmmoInnerMagazine ( Weapon_Base w = NULL)
inlineprotected

Definition at line 118 of file Guards.c.

118{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardHasMag()

void WeaponGuardBase::WeaponGuardHasMag ( Weapon_Base w = NULL)
inlineprotected

Definition at line 155 of file Guards.c.

155{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardInnerMagazineFull()

void WeaponGuardBase::WeaponGuardInnerMagazineFull ( Weapon_Base w = NULL)
inlineprotected

Definition at line 268 of file Guards.c.

268{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardInnerMagazineFullShareChamber()

void WeaponGuardBase::WeaponGuardInnerMagazineFullShareChamber ( Weapon_Base w = NULL)
inlineprotected

Definition at line 286 of file Guards.c.

286{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardInternalMagazineHasRoomForBullet()

void WeaponGuardBase::WeaponGuardInternalMagazineHasRoomForBullet ( Weapon_Base w = NULL)
inlineprotected

Definition at line 435 of file Guards.c.

435{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardIsDestroyed()

void WeaponGuardBase::WeaponGuardIsDestroyed ( Weapon_Base w = NULL)
inlineprotected

Definition at line 82 of file Guards.c.

82{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardJammed()

void WeaponGuardBase::WeaponGuardJammed ( Weapon_Base w = NULL)
inlineprotected

Definition at line 63 of file Guards.c.

63{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardMagazinesHaveEqualSizes()

void WeaponGuardBase::WeaponGuardMagazinesHaveEqualSizes ( Weapon_Base w = NULL)
inlineprotected

Definition at line 538 of file Guards.c.

538{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardWeaponCharged()

void WeaponGuardBase::WeaponGuardWeaponCharged ( Weapon_Base w = NULL)
inlineprotected

Definition at line 566 of file Guards.c.

566{ m_weapon = w; }

References m_weapon.

◆ WeaponGuardWeaponOpen()

void WeaponGuardBase::WeaponGuardWeaponOpen ( Weapon_Base w = NULL)
inlineprotected

Definition at line 590 of file Guards.c.

590{ m_weapon = w; }

References m_weapon.

Member Data Documentation

◆ m_arg0

ref WeaponGuardBase WeaponGuardBase::m_arg0
private

Definition at line 16 of file Guards.c.

◆ m_arg1

ref WeaponGuardBase WeaponGuardBase::m_arg1
private

Definition at line 17 of file Guards.c.

◆ m_muzzle

int WeaponGuardBase::m_muzzle
protected

Definition at line 174 of file Guards.c.

◆ m_state

WeaponChambering_Base WeaponGuardBase::m_state
private

Definition at line 519 of file Guards.c.

◆ m_weapon

Weapon_Base WeaponGuardBase::m_weapon
protected

Definition at line 62 of file Guards.c.


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