Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
weaponstartaction.c
Go to the documentation of this file.
1
5{
6 WeaponActions m_action;
7 int m_actionType;
8
9 void WeaponStartAction (Weapon_Base w = NULL, WeaponStateBase parent = NULL, WeaponActions action = WeaponActions.NONE, int actionType = -1)
10 {
11 m_action = action;
12 m_actionType = actionType;
13 }
14
15 override void OnEntry (WeaponEventBase e)
16 {
17 super.OnEntry(e);
18 if (e)
19 {
20 if (e.m_player)
21 {
22 HumanCommandWeapons hcw = e.m_player.GetCommandModifier_Weapons();
23 if (hcw)
24 {
25 HumanCommandAdditives ad = e.m_player.GetCommandModifier_Additives();
26 if (ad)
27 ad.CancelModifier();
28
29 hcw.StartAction(m_action, m_actionType);
30
31 if (hcw.GetRunningAction() == m_action && hcw.GetRunningActionType() == m_actionType)
32 {
33 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("HCW: playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType) + " fini=" + hcw.IsActionFinished()); }
34 }
35 else
36 Error("HCW: NOT playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType) + " fini=" + hcw.IsActionFinished());
37 }
38 else
39 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("---: remote playing A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType)); }
40 }
41 else
42 {
43 if (LogManager.IsWeaponLogEnable()) { wpnDebugPrint("---: warning, no player wants to play A=" + typename.EnumToString(WeaponActions, m_action) + " AT=" + WeaponActionTypeToString(m_action, m_actionType)); }
44 }
45 }
46 }
47 override void OnExit (WeaponEventBase e)
48 {
49 super.OnExit(e);
50 }
51};
52
53
void wpnDebugPrint(string s)
Definition debug.c:9
signalize mechanism manipulation
Definition events.c:35
simple class starting animation action specified by m_action and m_actionType
represent weapon state base
Definition bullethide.c:2
void Error(string err)
Messagebox with error message.
Definition endebug.c:90
HandStateEquipped OnEntry
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
class WeaponEndAction extends WeaponStartAction m_action