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

Private Member Functions

void ActionDigWorms ()
 
override void CreateConditionComponents ()
 
override bool Can (PlayerBase player, ActionTarget target, ItemBase item, int condition_mask)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
override bool HasTarget ()
 
override void OnFinishProgressServer (ActionData action_data)
 
void SetDiggingAnimation (ItemBase item)
 
bool IsTargetFertile (ActionTarget target)
 
bool IsPlayerOnGround (PlayerBase player)
 
- 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 14 of file ActionDigWorms.c.

Constructor & Destructor Documentation

◆ ActionDigWorms()

void ActionDigWorms::ActionDigWorms ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 40 of file ActionDigWorms.c.

41 {
42 if (player.IsPlacingLocal())
43 return false;
44
46 }
bool IsPlayerOnGround(PlayerBase player)
bool IsTargetFertile(ActionTarget target)

References IsPlayerOnGround(), and IsTargetFertile().

◆ ActionConditionContinue()

override bool ActionDigWorms::ActionConditionContinue ( ActionData action_data)
inlineprivate

Definition at line 48 of file ActionDigWorms.c.

49 {
50 return IsPlayerOnGround(action_data.m_Player);
51 }

References IsPlayerOnGround().

◆ Can()

override bool ActionDigWorms::Can ( PlayerBase player,
ActionTarget target,
ItemBase item,
int condition_mask )
inlineprivate

Definition at line 32 of file ActionDigWorms.c.

33 {
35 return false;
36
37 return player.CheckFreeSpace(vector.Forward, 0.8, false);
38 }
static const vector Forward
Definition EnConvert.c:109

References vector::Forward.

◆ CreateConditionComponents()

override void ActionDigWorms::CreateConditionComponents ( )
inlineprivate

Definition at line 26 of file ActionDigWorms.c.

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.

◆ HasTarget()

override bool ActionDigWorms::HasTarget ( )
inlineprivate

Definition at line 66 of file ActionDigWorms.c.

67 {
68 return true;
69 }

◆ IsPlayerOnGround()

bool ActionDigWorms::IsPlayerOnGround ( PlayerBase player)
inlineprivate

Definition at line 111 of file ActionDigWorms.c.

112 {
113 vector position = player.GetPosition();
114 float heightDiff = GetGame().SurfaceY(position[0], position[2]);
116
117 return heightDiff <= 0.4; // Player is considered on ground
118 }
proto native CGame GetGame()

References GetGame().

Referenced by ActionCondition(), and ActionConditionContinue().

◆ IsTargetFertile()

bool ActionDigWorms::IsTargetFertile ( ActionTarget target)
inlineprivate

Definition at line 94 of file ActionDigWorms.c.

95 {
96 if (target)
97 {
98 string surface_type;
100 position = target.GetCursorHitPos();
101
102 GetGame().SurfaceGetType(position[0], position[2], surface_type);
103
104 if (GetGame().IsSurfaceFertile(surface_type))
105 return true;
106 }
107
108 return false;
109 }

References GetGame().

Referenced by ActionCondition().

◆ OnFinishProgressServer()

override void ActionDigWorms::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 71 of file ActionDigWorms.c.

72 {
74 Class.CastTo(worms, GetGame().CreateObjectEx("Worm", action_data.m_Player.GetPosition(), ECE_PLACE_ON_SURFACE));
75 worms.SetQuantity(10, false);
76 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 4);
77 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
78 }
const int ECE_PLACE_ON_SURFACE
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(), ECE_PLACE_ON_SURFACE, GetGame(), and m_SpecialtyWeight.

◆ SetDiggingAnimation()

void ActionDigWorms::SetDiggingAnimation ( ItemBase item)
inlineprivate

Definition at line 80 of file ActionDigWorms.c.

81 {
82 if (item.KindOf("Knife"))
83 {
84 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DEPLOY_1HD;
85 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
86 }
87 else
88 {
89 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGMANIPULATE;
90 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
91 }
92 }

References AnimatedActionBase::m_CommandUID, and m_StanceMask.

Referenced by SetupAction().

◆ SetupAction()

override bool ActionDigWorms::SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate

Definition at line 53 of file ActionDigWorms.c.

54 {
55 if (super.SetupAction(player, target, item, action_data, extra_data))
56 {
57 if (item)
59
60 return true;
61 }
62
63 return false;
64 }
void SetDiggingAnimation(ItemBase item)

References SetDiggingAnimation().


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