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

Private Member Functions

void ActionUnmountBarbedWire ()
 
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 ActionUnMountBarbedWire.c.

Constructor & Destructor Documentation

◆ ActionUnmountBarbedWire()

void ActionUnmountBarbedWire::ActionUnmountBarbedWire ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 32 of file ActionUnMountBarbedWire.c.

33 {
34 Object targetObject = target.GetObject();
35
36 if (targetObject && targetObject.CanUseConstruction())
37 {
39 if (!base_building.IsPlayerInside(player, ""))
40 return false;
41
42 string selection = targetObject.GetActionComponentName(target.GetComponentIndex());
43
44 if (selection.Length() > 0)
45 {
46 int delimiter_index = selection.IndexOfFrom(0, "_mounted");
47 if (delimiter_index > -1)
48 {
49 selection = selection.Substring(0, delimiter_index);
50
51 BarbedWire barbed_wire = BarbedWire.Cast(base_building.FindAttachmentBySlotName(selection));
52 if (barbed_wire && barbed_wire.IsMounted())
53 {
54 m_SlotName = selection;
55
56 return true;
57 }
58 }
59 }
60 }
61
62 return false;
63 }
proto native int Length()
Returns length of string.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position. Returns -1 when not found.

References string::IndexOfFrom(), string::Length(), m_SlotName, and string::Substring().

◆ CreateConditionComponents()

override void ActionUnmountBarbedWire::CreateConditionComponents ( )
inlineprivate

◆ GetAdminLogMessage()

override string ActionUnmountBarbedWire::GetAdminLogMessage ( ActionData action_data)
inlineprivate

Definition at line 76 of file ActionUnMountBarbedWire.c.

77 {
78 string message = string.Format("Player %1 Unmounted BarbedWire from %2", action_data.m_Player, action_data.m_Target.GetObject().ClassName());
79 return message;
80 }

◆ OnFinishProgressServer()

override void ActionUnmountBarbedWire::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 65 of file ActionUnMountBarbedWire.c.

66 {
68 BarbedWire barbed_wire = BarbedWire.Cast(base_building.FindAttachmentBySlotName(m_SlotName));
69
70 //unmount and refresh parent
71 barbed_wire.SetMountedState(false);
72
73 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
74 }

References m_SlotName, and m_SpecialtyWeight.

Member Data Documentation

◆ m_DamageAmount

float ActionUnmountBarbedWire::m_DamageAmount
private

Definition at line 11 of file ActionUnMountBarbedWire.c.

Referenced by ActionUnmountBarbedWire().

◆ m_SlotName

string ActionUnmountBarbedWire::m_SlotName
private

Definition at line 12 of file ActionUnMountBarbedWire.c.

Referenced by ActionCondition(), and OnFinishProgressServer().


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