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

Private Member Functions

void ActionMountBarbedWire ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override string GetAdminLogMessage (ActionData action_data)
 
- 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)
 

Private Attributes

float m_DamageAmount
 
string m_SlotName
 

Detailed Description

Definition at line 9 of file ActionMountBarbedWire.c.

Constructor & Destructor Documentation

◆ ActionMountBarbedWire()

void ActionMountBarbedWire::ActionMountBarbedWire ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

override bool ActionMountBarbedWire::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 32 of file ActionMountBarbedWire.c.

33 {
34 Object targetObject = target.GetObject();
35
36 if (targetObject && targetObject.CanUseConstruction() && targetObject.CanUseConstructionBuild())
37 {
39
40 string selection = targetObject.GetActionComponentName(target.GetComponentIndex());
41
42 if (selection.Length() > 0)
43 {
44 BarbedWire barbed_wire = BarbedWire.Cast(base_building.FindAttachmentBySlotName(selection));
45 if (barbed_wire && !barbed_wire.IsMounted() && !barbed_wire.IsRuined())
46 {
47 m_SlotName = selection;
48
49 return true;
50 }
51 }
52 }
53
54 return false;
55 }
proto native int Length()
Returns length of string.

References string::Length(), and m_SlotName.

◆ CreateConditionComponents()

override void ActionMountBarbedWire::CreateConditionComponents ( )
inlineprivate

◆ GetAdminLogMessage()

override string ActionMountBarbedWire::GetAdminLogMessage ( ActionData action_data)
inlineprivate

Definition at line 90 of file ActionMountBarbedWire.c.

91 {
92 string message = string.Format("Player %1 Mounted BarbedWire on %2", action_data.m_Player, action_data.m_Target.GetObject().ClassName());
93 return message;
94 }

◆ OnFinishProgressServer()

override void ActionMountBarbedWire::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 57 of file ActionMountBarbedWire.c.

58 {
60 BarbedWire barbed_wire = BarbedWire.Cast(base_building.FindAttachmentBySlotName(m_SlotName));
61
62 //mount and refresh parent
63 barbed_wire.SetMountedState(true);
64
65 //solution for DamageSystem's case sensitivity
66 string zone = "invalid";
68 zones.Copy(base_building.GetEntityDamageZoneMap().GetKeyArray());
69
70 string tmp = "";
71 string test = "";
72 for (int i = 0; i < zones.Count(); i++)
73 {
74 tmp = zones.Get(i);
75 test = tmp;
76 test.ToLower();
77
78 if (test == m_SlotName)
79 {
80 zone = tmp;
81 break;
82 }
83 }
84
85 base_building.SetHealth01(zone, "Health", barbed_wire.GetHealth01("", "Health")); //attachment slot names and damagezone names must match
86
87 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
88 }

References m_SlotName, and m_SpecialtyWeight.

Member Data Documentation

◆ m_DamageAmount

float ActionMountBarbedWire::m_DamageAmount
private

Definition at line 11 of file ActionMountBarbedWire.c.

Referenced by ActionMountBarbedWire().

◆ m_SlotName

string ActionMountBarbedWire::m_SlotName
private

Definition at line 12 of file ActionMountBarbedWire.c.

Referenced by ActionCondition(), and OnFinishProgressServer().


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