Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionPackGift
+ Граф наследования:ActionPackGift:

Закрытые члены

void ActionPackGift ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressClient (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
- Закрытые члены унаследованные от 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)
 

Подробное описание

Конструктор(ы)

◆ ActionPackGift()

void ActionPackGift ( )
inlineprivate
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENITEM;
15 //m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
18 m_Text = "#STR_Wrap";
19 }
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68
int m_StanceMask
Definition ActionBase.c:53
Definition ActionPackGift.c:2
int m_CommandUID
Definition AnimatedActionBase.c:135
m_CallbackClass
Definition AnimatedActionBase.c:137
Definition ActionConstants.c:119
const float ROUGH_LOW
Definition ActionConstants.c:120
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, m_SpecialtyWeight, m_StanceMask, m_Text и UASoftSkillsWeight::ROUGH_LOW.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
33 {
34 ItemBase item_to_pack = ItemBase.Cast(target.GetObject());
35 if (!item_to_pack)
36 return false;
37
38 if ( !item_to_pack.IsTakeable() ) return false;
39 if ( item_to_pack.IsBeingPlaced() ) return false;
40 if ( BaseBuildingBase.Cast(item_to_pack) ) return false;
41 if ( !item_to_pack.CanPutInCargo(null) ) return false;
42
43 EntityAI tgt_parent = EntityAI.Cast( target.GetParent() );
44
45 if ( tgt_parent )
46 {
47 if ( item_to_pack.GetInventory().IsAttachment() )
48 {
49 if ( !item_to_pack.CanDetachAttachment(tgt_parent) || !tgt_parent.CanReleaseAttachment(item_to_pack) )
50 return false;
51 }
52 else
53 {
54 if ( !item_to_pack.CanRemoveFromCargo(tgt_parent) || !tgt_parent.CanReleaseCargo(item_to_pack) )
55 return false;
56 }
57 }
58
59 if ( item_to_pack.GetInventory().GetCargo() && item_to_pack.GetInventory().GetCargo().GetItemCount() > 0)
60 return false;
61
62 if ( !item_to_pack.IsWeapon() && item_to_pack.GetInventory().AttachmentCount() > 0)
63 return false;
64
65
66 int x,y;
67 GetGame().GetInventoryItemSize( item_to_pack, x, y );
68
69 if( x > 5 || y > 5 )
70 return false;
71
72 return true;
73 }
Icon x
Icon y
Definition Fence.c:2
Definition Building.c:6
Definition InventoryItem.c:731
Definition EntityAI.c:95
proto native CGame GetGame()

Перекрестные ссылки GetGame(), x и y.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
22 {
25 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
Definition CCINonRuined.c:2
Definition CCTNonRuined.c:2

Перекрестные ссылки m_ConditionItem и m_ConditionTarget.

◆ HasTarget()

override bool HasTarget ( )
inlineprivate
28 {
29 return true;
30 }

◆ OnFinishProgressClient()

override void OnFinishProgressClient ( ActionData action_data)
inlineprivate
76 {
77 PlayerBase player = action_data.m_Player;
78 ItemBase item_to_pack = ItemBase.Cast(action_data.m_Target.GetObject());
79
80 player.RemoveQuickBarEntityShortcut(item_to_pack);
81
82 }
Definition PlayerBaseClient.c:2

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
85 {
86 ItemBase item_to_pack = ItemBase.Cast(action_data.m_Target.GetObject());
87 ItemBase item = action_data.m_MainItem;
88 PlayerBase player = action_data.m_Player;
89 string typeName;
90
91 if (item_to_pack)
92 {
93 int x,y;
94 GetGame().GetInventoryItemSize( item_to_pack, x, y );
95 int rnd = Math.RandomIntInclusive(1, 4);
96
98
99 if( x <= 2 && y <= 2 )
100 {
101 typeName = "GiftBox_Small_" + rnd;
102 }
103 else if( x <= 3 && y <= 3 )
104 {
105 typeName = "GiftBox_Medium_" + rnd;
106 }
107 else if( x <= 5 && y <= 5 )
108 {
109 typeName = "GiftBox_Large_" + rnd;
110 }
111 else return;
112
113
114 if(!GetGame().IsDedicatedServer())
115 player.RemoveQuickBarEntityShortcut(item_to_pack);
116
118 player.ServerReplaceItemWithNew(lambda);
119
120 }
121
122
123 }
Definition EnMath.c:7
Definition ActionPackGift.c:127
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки GetGame(), Math::RandomIntInclusive(), x и y.


Объявления и описания членов класса находятся в файле: