DayZ 1.24
Loading...
Searching...
No Matches
HandStartAction.c
Go to the documentation of this file.
1
5{
8
10 {
12 m_ActionType = actionType;
13 }
14
15 override void OnEntry(HandEventBase e)
16 {
17 super.OnEntry(e);
18
19 if (e.m_Player)
20 {
21 HumanCommandWeapons hcw = e.m_Player.GetCommandModifier_Weapons();
22 if (hcw)
23 {
24 if (m_ActionType == -1)
25 {
26 hcw.StartAction(-1, -1);
27 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("HCW: " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " playing A=-1 AT=-1 fini=" + hcw.IsActionFinished());
28 }
29 else
30 {
31 hcw.StartAction(m_Action, m_ActionType);
32
33 if (hcw.GetRunningAction() == m_Action && hcw.GetRunningActionType() == m_ActionType)
34 {
35 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("HCW: " + Object.GetDebugName(e.m_Player) + " STS = " + e.m_Player.GetSimulationTimeStamp() + " playing A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType) + " fini=" + hcw.IsActionFinished());
36 }
37 else
38 Error("HCW: NOT playing A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType) + " fini=" + hcw.IsActionFinished());
39 }
40 }
41 else if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("---: remote playing A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType));
42 }
43 else
44 {
45 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("---: warning, no player wants to play A=" + typename.EnumToString(WeaponActions, m_Action) + " AT=" + WeaponActionTypeToString(m_Action, m_ActionType));
46 }
47 }
48 override void OnExit(HandEventBase e)
49 {
50 super.OnExit(e);
51 }
52
53 override bool IsIdle() { return false; }
54};
55
enum ActionInputType m_Action
void hndDebugPrint(string s)
Definition HandFSM.c:1
Abstracted event, not to be used, only inherited.
simple class starting animation action specified by m_action and m_actionType
represent hand state base
override void OnExit(HandEventBase e)
override void OnEntry(HandEventBase e)
override bool IsIdle()
void HandStartAction(Man player=NULL, HandStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
specific action sub-type
WeaponActions m_Action
int m_ActionType
action to be played
static bool IsInventoryHFSMLogEnable()
Definition Debug.c:749
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
WeaponActions
actions
Definition human.c:796
string WeaponActionTypeToString(int A, int AT)
Definition human.c:923