Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionworldflagactionswitch.c
Go to the documentation of this file.
1 class FlagTendencyActionReciveData : ActionReciveData
2 {
3  bool m_TendencyRecived;
4 }
5 
6 class FlagTendencyActionData : ActionData
7 {
8  bool m_Tendency;
9 };
10 
12 {
13  bool m_switch_to;
15  {
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
17  }
18 
19  override void CreateConditionComponents()
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 
69  override bool RemoveForceTargetAfterUse()
70  {
71  return false;
72  }
73 
74  override typename GetInputType()
75  {
76  return InteractActionInput;
77  }
78 
79  void SetFlagTendencyOnCurrentActionInvalid(bool state)
80  {
81 
82  }
83 };
ItemBase
Definition: inventoryitem.c:730
FlagTendencyActionReciveData
Definition: actionworldflagactionswitch.c:1
CCINone
Definition: ccinone.c:1
m_Tendency
FlagTendencyActionReciveData m_Tendency
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
InteractActionInput
Definition: actioninput.c:534
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionWorldFlagActionSwitch
Definition: actionworldflagactionswitch.c:11
CCTCursor
Definition: cctcursor.c:1
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53