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

Private Member Functions

void ActionClapBearTrapWithThisItem ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionClapBearTrapWithThisItem.c.

Constructor & Destructor Documentation

◆ ActionClapBearTrapWithThisItem()

void ActionClapBearTrapWithThisItem::ActionClapBearTrapWithThisItem ( )
inlineprivate

Definition at line 3 of file ActionClapBearTrapWithThisItem.c.

4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_POKE;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
7 m_FullBody = true;
8 m_Text = "#trigger_bear_trap";
9 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, m_FullBody, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 17 of file ActionClapBearTrapWithThisItem.c.

18 {
19 if (!target)
20 return false;
21
22 BearTrap trap;
23 if (Class.CastTo(trap, target.GetObject()))
24 return trap.IsActive() && trap.CanBeDisarmed() && IsInReach(player, target, UAMaxDistances.DEFAULT);
25
26 return false;
27 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:856
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float DEFAULT
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), UAMaxDistances::DEFAULT, and IsInReach().

◆ CreateConditionComponents()

override void ActionClapBearTrapWithThisItem::CreateConditionComponents ( )
inlineprivate

Definition at line 11 of file ActionClapBearTrapWithThisItem.c.

12 {
15 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ OnExecuteServer()

override void ActionClapBearTrapWithThisItem::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 29 of file ActionClapBearTrapWithThisItem.c.

30 {
31 BearTrap trap;
32 Class.CastTo(trap, action_data.m_Target.GetObject());
33
34 trap.Disarm();
35 }

References Class::CastTo().


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