DayZ 1.24
Loading...
Searching...
No Matches
ActionWorldFlagActionSwitch.c
Go to the documentation of this file.
1class FlagTendencyActionReciveData : ActionReciveData
2{
4}
5
7{
9};
10
12{
15 {
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17 }
18
20 {
23 }
24
25 /*override string GetText()
26 {
27 if (!m_switch_to)
28 return "#switch_to_flag_raise";
29 return "#switch_to_flag_lower";
30 }*/
31
32 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
33 {
34 TerritoryFlag totem = TerritoryFlag.Cast(target.GetObject());
35 if (!totem)
36 return false;
37
38 float state = totem.GetAnimationPhase("flag_mast");
39
40 if (totem && totem.FindAttachmentBySlotName("Material_FPole_Flag"))
41 {
42 if (player.GetFlagTendencyRaise() && state < 1)
43 {
44 m_switch_to = true;
45 return true;
46 }
47 else if (!player.GetFlagTendencyRaise() && state > 0)
48 {
49 m_switch_to = false;
50 return true;
51 }
52 }
53 return false;
54 }
55
56 override void Start(ActionData action_data) //Setup on start of action
57 {
58 super.Start(action_data);
59
60 bool state = action_data.m_Player.GetFlagTendencyRaise();
61 action_data.m_Player.SetFlagTendencyRaise(!state);
62 }
63
64 override bool IsInstant()
65 {
66 return true;
67 }
68
70 {
71 return false;
72 }
73
74 override typename GetInputType()
75 {
77 }
78
83};
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
TransferLiquidActionReciveData m_Tendency
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void Start(ActionData action_data)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597