Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionpickupchicken.c
Go to the documentation of this file.
1
2
class
ActionPickupChicken
:
ActionInteractBase
3
{
4
void
ActionPickupChicken
()
5
{
6
m_Text
=
"#take"
;
7
}
8
9
override
typename
GetInputType
()
10
{
11
return
ContinuousInteractActionInput
;
12
}
13
14
override
void
CreateConditionComponents
()
15
{
16
m_ConditionItem
=
new
CCINone
;
17
m_ConditionTarget
=
new
CCTNone
;
18
}
19
20
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
21
{
22
if
( player.GetCommand_Vehicle() )
23
return
false
;
24
25
Animal_GallusGallusDomesticus
chicken;
26
if
(
Class
.
CastTo
( chicken, target.GetObject() ) )
27
{
28
return
!chicken.IsAlive();
29
}
30
return
false
;
31
}
32
33
override
void
OnExecuteServer
(
ActionData
action_data )
34
{
35
// We will switch the item
36
Animal_GallusGallusDomesticus
targetChicken =
Animal_GallusGallusDomesticus
.Cast( action_data.m_Target.GetObject() );
37
if
( targetChicken )
38
{
39
DeadChicken_ColorBase
deadChicken =
DeadChicken_ColorBase
.Cast( action_data.m_Player.GetHumanInventory().CreateInHands( targetChicken.
GetDeadItemName
() ) );
40
41
if
( deadChicken == null )
42
{
43
deadChicken =
DeadChicken_ColorBase
.Cast( action_data.m_Player.GetHumanInventory().CreateInInventory( targetChicken.
GetDeadItemName
() ) );
44
45
if
( deadChicken == null )
46
deadChicken =
DeadChicken_ColorBase
.Cast(
g_Game
.CreateObjectEx( targetChicken.
GetDeadItemName
(), targetChicken.GetPosition(),
ECE_PLACE_ON_SURFACE
,
RF_ORIGINAL
) );
47
}
48
targetChicken.Delete();
49
}
50
}
51
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
RF_ORIGINAL
const int RF_ORIGINAL
Definition
centraleconomy.c:63
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
ActionPickupChicken::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionpickupchicken.c:33
ActionPickupChicken::ActionPickupChicken
void ActionPickupChicken()
Definition
actionpickupchicken.c:4
ActionPickupChicken::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionpickupchicken.c:14
ActionPickupChicken::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionpickupchicken.c:20
ActionPickupChicken::GetInputType
override GetInputType()
Definition
actionpickupchicken.c:9
Animal_GallusGallusDomesticus
Definition
animalbase.c:282
Animal_GallusGallusDomesticus::GetDeadItemName
override string GetDeadItemName()
Definition
animalbase.c:283
CCINone
Definition
ccinone.c:2
CCTNone
Definition
cctnone.c:2
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
ContinuousInteractActionInput
Definition
actioninput.c:523
DeadChicken_ColorBase
Definition
chicken_colorbase.c:2
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionpickupchicken.c
Generated by
1.17.0