DayZ 1.24
Loading...
Searching...
No Matches
ActionFillObject Class Reference
Inheritance diagram for ActionFillObject:
[legend]
Collaboration diagram for ActionFillObject:
[legend]

Protected Member Functions

void ActionFillObject ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnFinishProgressClient (ActionData action_data)
 

Protected Attributes

int m_ActionState
 
const int EMPTY = 0
 
const int FILLED = 1
 

Additional Inherited Members

- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 9 of file ActionFillObject.c.

Constructor & Destructor Documentation

◆ ActionFillObject()

void ActionFillObject::ActionFillObject ( )
inlineprotected

Member Function Documentation

◆ ActionCondition()

override bool ActionFillObject::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected

Definition at line 42 of file ActionFillObject.c.

43 {
44 if (player.IsPlacingLocal())
45 return false;
46
47 HescoBox hesco;
48 if (Class.CastTo(hesco, target.GetObject()))
49 {
50 if (hesco.CanBeFilledAtPosition(player.GetPosition()))
51 {
52 if (hesco.GetState() == HescoBox.UNFOLDED)
53 {
55 return true;
56 }
57 else if (hesco.GetState() == HescoBox.FILLED)
58 {
60 return true;
61 }
62 }
63 }
64
65 return false;
66 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), EMPTY, FILLED, and m_ActionState.

◆ CreateConditionComponents()

override void ActionFillObject::CreateConditionComponents ( )
inlineprotected

Definition at line 25 of file ActionFillObject.c.

26 {
27
30 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ OnActionInfoUpdate()

override void ActionFillObject::OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected

Definition at line 32 of file ActionFillObject.c.

33 {
34 HescoBox hesco = HescoBox.Cast(target.GetObject());
35
36 if (hesco.GetState() == HescoBox.UNFOLDED)
37 m_Text = "#empty";
38 else
39 m_Text = "#fill";
40 }
string m_Text
Definition ActionBase.c:49

References m_Text.

◆ OnFinishProgressClient()

override void ActionFillObject::OnFinishProgressClient ( ActionData action_data)
inlineprotected

Definition at line 86 of file ActionFillObject.c.

87 {
88 HescoBox hesco;
89
90 if (Class.CastTo(hesco, action_data.m_Target.GetObject()))
91 {
92 if (hesco.GetState() == HescoBox.UNFOLDED)
93 hesco.Fill();
94 else if (hesco.GetState() == HescoBox.FILLED)
95 hesco.Unfold();
96 }
97 }

References Class::CastTo().

◆ OnFinishProgressServer()

override void ActionFillObject::OnFinishProgressServer ( ActionData action_data)
inlineprotected

Definition at line 68 of file ActionFillObject.c.

69 {
70 HescoBox hesco;
71
72 if (Class.CastTo(hesco, action_data.m_Target.GetObject()))
73 {
74 const float ITEM_DAMAGE = 0.05;
75 action_data.m_MainItem.DecreaseHealth("", "", action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(ITEM_DAMAGE, this.GetSpecialtyWeight()) * 100);
76
77 if (hesco.GetState() == HescoBox.UNFOLDED)
78 hesco.Fill();
79 else if (hesco.GetState() == HescoBox.FILLED)
80 hesco.Unfold();
81 }
82
83 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
84 }

References Class::CastTo(), and m_SpecialtyWeight.

Member Data Documentation

◆ EMPTY

const int ActionFillObject::EMPTY = 0
protected

Definition at line 13 of file ActionFillObject.c.

Referenced by ActionCondition().

◆ FILLED

const int ActionFillObject::FILLED = 1
protected

Definition at line 14 of file ActionFillObject.c.

Referenced by ActionCondition().

◆ m_ActionState

int ActionFillObject::m_ActionState
protected

Definition at line 11 of file ActionFillObject.c.

Referenced by ActionCondition().


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