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

simple class starting animation action specified by m_action and m_actionType More...

Collaboration diagram for WeaponStartAction:
[legend]

Private Member Functions

override void OnEntry (WeaponEventBase e)
 
override bool IsWaitingForActionFinish ()
 
override bool IsWaitingForActionFinish ()
 
override bool IsWaitingForActionFinish ()
 
override bool IsWaitingForActionFinish ()
 
override void OnEntry (WeaponEventBase e)
 
override bool IsWaitingForActionFinish ()
 
override void OnUpdate (float dt)
 
override void OnExit (WeaponEventBase e)
 
override bool IsWaitingForActionFinish ()
 
override void OnEntry (WeaponEventBase e)
 
override void OnUpdate (float dt)
 
override void OnExit (WeaponEventBase e)
 
override void OnAbort (WeaponEventBase e)
 
override bool IsWaitingForActionFinish ()
 
override void OnEntry (WeaponEventBase e)
 
override void OnUpdate (float dt)
 
override void OnExit (WeaponEventBase e)
 
void WeaponUnjamming_Start (Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
 
override void OnEntry (WeaponEventBase e)
 
override void OnUpdate (float dt)
 
override void OnExit (WeaponEventBase e)
 

Private Attributes

float m_dtAccumulator
 
float m_jamTime
 

Detailed Description

simple class starting animation action specified by m_action and m_actionType

Definition at line 2 of file WeaponChambering.c.

Member Function Documentation

◆ IsWaitingForActionFinish() [1/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 14 of file WeaponChambering.c.

15 {
16 return true;
17 }

◆ IsWaitingForActionFinish() [2/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 612 of file WeaponChambering.c.

613 {
614 return true;
615 }

◆ IsWaitingForActionFinish() [3/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 4 of file WeaponChamberingLooped.c.

4{ return true; }

◆ IsWaitingForActionFinish() [4/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 58 of file WeaponCharging.c.

59 {
60 return true;
61 }

◆ IsWaitingForActionFinish() [5/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 14 of file WeaponFire.c.

14{ return true; }

◆ IsWaitingForActionFinish() [6/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 46 of file WeaponFire.c.

46{ return true; }

◆ IsWaitingForActionFinish() [7/7]

override bool WeaponStartAction::IsWaitingForActionFinish ( )
inlineprivate

Definition at line 266 of file WeaponFire.c.

266{ return true; }

◆ OnAbort()

override void WeaponStartAction::OnAbort ( WeaponEventBase e)
inlineprivate

Definition at line 89 of file WeaponFire.c.

90 {
91 m_weapon.ResetBurstCount();
92 super.OnAbort(e);
93 }
class WeaponGuardIsDestroyed extends WeaponGuardBase m_weapon
Definition Guards.c:602

References m_weapon.

◆ OnEntry() [1/5]

override void WeaponStartAction::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 4 of file WeaponChambering.c.

5 {
6 super.OnEntry(e);
7 if (e)
8 {
9 m_weapon.SelectionBulletHide();
10 m_weapon.ForceSyncSelectionState();
11 }
12 }

References m_weapon.

◆ OnEntry() [2/5]

override void WeaponStartAction::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 6 of file WeaponFire.c.

7 {
8 super.OnEntry(e);
9 if (e)
11 m_weapon.ResetBurstCount();
12 }
float m_dtAccumulator
Definition WeaponFire.c:4

References m_dtAccumulator, and m_weapon.

◆ OnEntry() [3/5]

override void WeaponStartAction::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 48 of file WeaponFire.c.

49 {
50 if (e)
51 {
53
54 if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponFire bang!");
55 //m_weapon.Fire();
56 int mi = m_weapon.GetCurrentMuzzle();
58 {
60 if (Class.CastTo(p, e.m_player))
61 p.GetAimingModel().SetRecoil(m_weapon);
62 m_weapon.OnFire(mi);
63 }
64 }
65 super.OnEntry(e);
66 }
void wpnPrint(string s)
Definition Debug.c:1
proto native bool TryFireWeapon(EntityAI weapon, int muzzleIndex)
Super root of all classes in Enforce script.
Definition EnScript.c:11
static bool IsWeaponLogEnable()
Definition Debug.c:799
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), LogManager::IsWeaponLogEnable(), m_dtAccumulator, m_weapon, TryFireWeapon(), and wpnPrint().

◆ OnEntry() [4/5]

override void WeaponStartAction::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 268 of file WeaponFire.c.

269 {
270 if (e)
271 {
272 m_dtAccumulator = 0;
273
274 if (LogManager.IsWeaponLogEnable()) wpnPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " WeaponFire bang! and jam?");
275 //m_weapon.Fire();
276 int mi = m_weapon.GetCurrentMuzzle();
278 {
279 m_weapon.SetJammed(true);
281 if (Class.CastTo(p, e.m_player))
282 p.GetAimingModel().SetRecoil(m_weapon);
283 m_weapon.OnFire(mi);
284 }
285 }
286 m_weapon.ResetBurstCount();
287 super.OnEntry(e);
288 }

References Class::CastTo(), LogManager::IsWeaponLogEnable(), m_dtAccumulator, m_weapon, TryFireWeapon(), and wpnPrint().

◆ OnEntry() [5/5]

override void WeaponStartAction::OnEntry ( WeaponEventBase e)
inlineprivate

Definition at line 22 of file WeaponUnjamming.c.

23 {
24 super.OnEntry(e);
25 }

◆ OnExit() [1/4]

override void WeaponStartAction::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 33 of file WeaponFire.c.

34 {
36 super.OnExit(e);
37 }

References m_dtAccumulator.

◆ OnExit() [2/4]

override void WeaponStartAction::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 82 of file WeaponFire.c.

83 {
84 if (e)
86 super.OnExit(e);
87 }

References m_dtAccumulator.

◆ OnExit() [3/4]

override void WeaponStartAction::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 304 of file WeaponFire.c.

305 {
306 m_dtAccumulator = 0;
307 super.OnExit(e);
308 }

References m_dtAccumulator.

◆ OnExit() [4/4]

override void WeaponStartAction::OnExit ( WeaponEventBase e)
inlineprivate

Definition at line 64 of file WeaponUnjamming.c.

65 {
66 m_dtAccumulator = 0.0;
67 m_jamTime = 0.0;
68 super.OnExit(e);
69 }

References m_dtAccumulator.

◆ OnUpdate() [1/4]

override void WeaponStartAction::OnUpdate ( float dt)
inlineprivate

Definition at line 16 of file WeaponFire.c.

17 {
20 Class.CastTo(p, m_weapon.GetHierarchyParent());
21 if (p)
22 {
23 HumanInputController hic = p.GetInputController();
24
25 int muzzleIndex = m_weapon.GetCurrentMuzzle();
26 float reloadTime = m_weapon.GetReloadTime(muzzleIndex);
27 if (hic.IsAttackButton() && m_dtAccumulator >= reloadTime)
28 if (m_weapon.CanProcessWeaponEvents())
29 m_weapon.ProcessWeaponEvent(new WeaponEventDryFireTimeout(p));
30 }
31 }

References Class::CastTo(), m_dtAccumulator, and m_weapon.

◆ OnUpdate() [2/4]

override void WeaponStartAction::OnUpdate ( float dt)
inlineprivate

Definition at line 68 of file WeaponFire.c.

69 {
71
73 Class.CastTo(p, m_weapon.GetHierarchyParent());
74
75 int muzzleIndex = m_weapon.GetCurrentMuzzle();
76 float reloadTime = m_weapon.GetReloadTime(muzzleIndex);
78 if (m_weapon.CanProcessWeaponEvents())
79 m_weapon.ProcessWeaponEvent(new WeaponEventReloadTimeout(p));
80 }

References Class::CastTo(), m_dtAccumulator, and m_weapon.

◆ OnUpdate() [3/4]

override void WeaponStartAction::OnUpdate ( float dt)
inlineprivate

Definition at line 290 of file WeaponFire.c.

291 {
293
295 Class.CastTo(p, m_weapon.GetHierarchyParent());
296
297 int muzzleIndex = m_weapon.GetCurrentMuzzle();
298 float reloadTime = m_weapon.GetReloadTime(muzzleIndex);
300 if (m_weapon.CanProcessWeaponEvents())
301 m_weapon.ProcessWeaponEvent(new WeaponEventReloadTimeout(p));
302 }

References Class::CastTo(), m_dtAccumulator, and m_weapon.

◆ OnUpdate() [4/4]

override void WeaponStartAction::OnUpdate ( float dt)
inlineprivate

Definition at line 27 of file WeaponUnjamming.c.

28 {
30
32 Class.CastTo(p, m_weapon.GetHierarchyParent());
33 if (p)
34 {
35 HumanInputController hic = p.GetInputController();
36 HumanCommandWeapons hcw = p.GetCommandModifier_Weapons();
37
39 {
40 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " Unjammed!");
41 hcw.StartAction(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_END);
42 m_weapon.ProcessWeaponEvent(new WeaponEventUnjammingTimeout(p));
43 return; // unjammed successfuly
44 }
45
46
47 if (hic.IsReloadOrMechanismContinuousUse())
48 {
49 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " Unjamming...");
50 }
51#ifndef PLATFORM_CONSOLE
52#ifndef SERVER_FOR_CONSOLE
53 else
54 {
55 if (LogManager.IsWeaponLogEnable()) wpnDebugPrint("[wpnfsm] " + Object.GetDebugName(m_weapon) + " Unjamming failed, weapon still jammed");
56 hcw.StartAction(WeaponActions.UNJAMMING, WeaponActionUnjammingTypes.UNJAMMING_INTERRUPT);
57 m_weapon.ProcessWeaponEvent(new WeaponEventUnjammingFailedTimeout(p));
58 }
59#endif
60#endif
61 }
62 }
void wpnDebugPrint(string s)
Definition Debug.c:9
WeaponActions
actions
Definition human.c:796
WeaponActionUnjammingTypes
Definition human.c:892

References Class::CastTo(), LogManager::IsWeaponLogEnable(), m_dtAccumulator, m_weapon, and wpnDebugPrint().

◆ WeaponUnjamming_Start()

void WeaponStartAction::WeaponUnjamming_Start ( Weapon_Base w = NULL,
WeaponStateBase parent = NULL,
WeaponActions action = WeaponActions.NONE,
int actionType = -1 )
inlineprivate

Definition at line 16 of file WeaponUnjamming.c.

17 {
18 m_dtAccumulator = 0.0;
19 m_jamTime = 0.0;
20 }

References m_dtAccumulator.

Member Data Documentation

◆ m_dtAccumulator

float WeaponStartAction::m_dtAccumulator
private

Definition at line 4 of file WeaponFire.c.

◆ m_jamTime

float WeaponStartAction::m_jamTime
private

Definition at line 14 of file WeaponUnjamming.c.


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