DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionUnpackGift.c
См. документацию.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.UNPACK);
6 }
7};
8
10{
12 {
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
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
45
46 float dmg = item.GetHealth01("","");
47
48 if( dmg > 0.25 )
49 {
50 Object paper = GetGame().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(GetGame().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};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
const int RF_DEFAULT
Определения CentralEconomy.c:65
float m_SpecialtyWeight
Определения ActionBase.c:77
int m_StanceMask
Определения ActionBase.c:62
string m_Text
Определения ActionBase.c:58
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
override bool HasTarget()
Определения ActionUnpackGift.c:27
void ActionUnpackGift()
Определения ActionUnpackGift.c:11
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionUnpackGift.c:32
override void CreateConditionComponents()
Определения ActionUnpackGift.c:21
override void OnFinishProgressServer(ActionData action_data)
Определения ActionUnpackGift.c:37
override void CreateActionComponent()
Определения ActionUnpackGift.c:3
int m_CommandUID
Определения AnimatedActionBase.c:143
Определения CCINonRuined.c:2
Определения CCTSelf.c:2
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
Определения Cargo.c:7
Определения Building.c:6
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
Определения Inventory.c:1255
script counterpart to engine's class Inventory
Определения Inventory.c:79
InventoryLocation.
Определения InventoryLocation.c:29
Определения InventoryItem.c:731
Определения ObjectTyped.c:2
Определения PlayerBaseClient.c:2
const float UNPACK
Определения ActionConstants.c:86
Определения ActionConstants.c:28
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()