Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionunpackgift.c
Go to the documentation of this file.
1
class
ActionUnpackGiftCB
:
ActionContinuousBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
m_ActionData
.m_ActionComponent =
new
CAContinuousTime
(
UATimeSpent
.
UNPACK
);
6
}
7
};
8
9
class
ActionUnpackGift
:
ActionContinuousBase
10
{
11
void
ActionUnpackGift
()
12
{
13
m_CallbackClass
=
ActionUnpackGiftCB
;
14
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENITEM;
15
//m_FullBody = true;
16
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_ERECT |
DayZPlayerConstants
.STANCEMASK_CROUCH;
17
m_SpecialtyWeight
= UASoftSkillsWeight.ROUGH_LOW;
18
m_Text
=
"#STR_Unwrap"
;
19
}
20
21
override
void
CreateConditionComponents
()
22
{
23
m_ConditionItem
=
new
CCINonRuined
;
24
m_ConditionTarget
=
new
CCTSelf
;
25
}
26
27
override
bool
HasTarget
()
28
{
29
return
false
;
30
}
31
32
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
33
{
34
return
true
;
35
}
36
37
override
void
OnFinishProgressServer
(
ActionData
action_data )
38
{
39
ItemBase
item =
ItemBase
.Cast(action_data.m_MainItem);
40
41
CargoBase
cargo = item.GetInventory().GetCargo();
42
43
InventoryLocation
il_dst =
new
InventoryLocation
;
44
InventoryLocation
il_src =
new
InventoryLocation
;
45
46
float
dmg = item.GetHealth01(
""
,
""
);
47
48
if
( dmg > 0.25 )
49
{
50
Object
paper =
g_Game
.CreateObjectEx(
"GiftWrapPaper"
,action_data.m_Player.GetPosition(),
ECE_PLACE_ON_SURFACE
,
RF_DEFAULT
);
51
paper.SetHealth01(
""
,
""
, dmg - 0.25 );
52
}
53
54
for
(
int
i = cargo.
GetItemCount
() - 1; i >= 0 ; i--)
55
{
56
EntityAI
cargo_item = cargo.
GetItem
(i);
57
58
GameInventory
.
SetGroundPosByOwner
(action_data.m_Player,cargo_item,il_dst);
59
cargo_item.GetInventory().GetCurrentInventoryLocation(il_src);
60
61
if
(
g_Game
.IsDedicatedServer())
62
action_data.m_Player.ServerTakeToDst( il_src, il_dst );
63
else
64
action_data.m_Player.LocalTakeToDst( il_src, il_dst );
65
}
66
67
item.DeleteSafe();
68
}
69
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
RF_DEFAULT
const int RF_DEFAULT
Definition
centraleconomy.c:65
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
animatedactionbase.c:3
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_SpecialtyWeight
float m_SpecialtyWeight
Definition
actionbase.c:83
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionContinuousBaseCB
Definition
actioncontinuousbase.c:2
ActionContinuousBase::ActionContinuousBase
void ActionContinuousBase()
Definition
actioncontinuousbase.c:124
ActionUnpackGiftCB
Definition
actionunpackgift.c:2
ActionUnpackGiftCB::CreateActionComponent
override void CreateActionComponent()
Definition
actionunpackgift.c:3
ActionUnpackGift::OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition
actionunpackgift.c:37
ActionUnpackGift::ActionUnpackGift
void ActionUnpackGift()
Definition
actionunpackgift.c:11
ActionUnpackGift::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionunpackgift.c:21
ActionUnpackGift::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionunpackgift.c:32
ActionUnpackGift::HasTarget
override bool HasTarget()
Definition
actionunpackgift.c:27
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Definition
animatedactionbase.c:145
CAContinuousTime
Definition
cacontinuoustime.c:2
CCINonRuined
Definition
ccinonruined.c:2
CCTSelf
Definition
cctself.c:2
CargoBase
represents base for cargo storage for entities
Definition
cargo.c:7
CargoBase::GetItemCount
proto native int GetItemCount()
CargoBase::GetItem
proto native EntityAI GetItem(int index)
EntityAI
Definition
inventoryitem.c:2
GameInventory
script counterpart to engine's class Inventory
Definition
inventory.c:81
GameInventory::SetGroundPosByOwner
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
Definition
inventory.c:1257
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
ItemBase
Definition
inventoryitem.c:742
Object
Definition
objecttyped.c:2
PlayerBase
Definition
playerbaseclient.c:2
UATimeSpent
Definition
actionconstants.c:28
UATimeSpent::UNPACK
const float UNPACK
Definition
actionconstants.c:86
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
continuous
actionunpackgift.c
Generated by
1.17.0