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

Private Member Functions

void ActionPickupChicken ()
 
override GetInputType ()
 
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 ActionPickupChicken.c.

Constructor & Destructor Documentation

◆ ActionPickupChicken()

void ActionPickupChicken::ActionPickupChicken ( )
inlineprivate

Definition at line 3 of file ActionPickupChicken.c.

4 {
5 m_Text = "#take";
6 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 19 of file ActionPickupChicken.c.

20 {
21 if (player.GetCommand_Vehicle())
22 return false;
23
25 if (Class.CastTo(chicken, target.GetObject()))
26 return !chicken.IsAlive();
27 return false;
28 }
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().

◆ CreateConditionComponents()

override void ActionPickupChicken::CreateConditionComponents ( )
inlineprivate

Definition at line 13 of file ActionPickupChicken.c.

14 {
17 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override ActionPickupChicken::GetInputType ( )
inlineprivate

◆ OnExecuteServer()

override void ActionPickupChicken::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 30 of file ActionPickupChicken.c.

31 {
32 // We will switch the item
34 if (targetChicken)
35 {
36 DeadChicken_ColorBase deadChicken = DeadChicken_ColorBase.Cast(action_data.m_Player.GetHumanInventory().CreateInHands(targetChicken.GetDeadItemName()));
37
38 if (deadChicken == null)
39 {
40 deadChicken = DeadChicken_ColorBase.Cast(action_data.m_Player.GetHumanInventory().CreateInInventory(targetChicken.GetDeadItemName()));
41
42 if (deadChicken == null)
43 deadChicken = DeadChicken_ColorBase.Cast(GetGame().CreateObjectEx(targetChicken.GetDeadItemName(), targetChicken.GetPosition(), ECE_PLACE_ON_SURFACE, RF_ORIGINAL));
44 }
45 targetChicken.Delete();
46 }
47 }
const int RF_ORIGINAL
const int ECE_PLACE_ON_SURFACE
proto native CGame GetGame()

References ECE_PLACE_ON_SURFACE, GetGame(), and RF_ORIGINAL.


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