DayZ
1.27
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
ActionCraftBoltsFeather.c
См. документацию.
1
class
ActionCraftBoltsFeatherCB
:
ActionContinuousBaseCB
2
{
3
private
const
float
TIME_TO_CRAFT
= 3.0;
4
5
override
void
CreateActionComponent
()
6
{
7
m_ActionData
.m_ActionComponent =
new
CAContinuousRepeat
(
TIME_TO_CRAFT
);
8
}
9
};
10
11
class
ActionCraftBoltsFeather
:
ActionContinuousBase
12
{
13
protected
bool
m_IsFeatherInHands
;
14
protected
Ammunition_Base
m_ResultEntity
;
15
16
void
ActionCraftBoltsFeather
()
17
{
18
m_CallbackClass
=
ActionCraftBoltsFeatherCB
;
19
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONFB_CRAFTING;
20
m_FullBody
=
true
;
21
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH;
22
m_SpecialtyWeight
= UASoftSkillsWeight.ROUGH_HIGH;
23
24
m_Text
=
"#STR_CraftBolt1"
;
25
26
}
27
28
override
void
CreateConditionComponents
()
29
{
30
m_ConditionItem
=
new
CCINonRuined
();
31
m_ConditionTarget
=
new
CCTNonRuined
();
32
}
33
34
protected
bool
IsFeatherType
(
string
itemInHandsType)
35
{
36
return
itemInHandsType ==
"ChickenFeather"
;
37
}
38
39
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
40
{
41
if
(
IsFeatherType
(item.ClassName()))
42
{
43
//feather in hands
44
if
(target.GetObject())
45
return
(target.GetObject().ClassName() ==
"Ammo_ImprovisedBolt_1"
);
46
}
47
else
if
(target.GetObject())
48
{
49
// bolt in hands
50
return
IsFeatherType
(target.GetObject().ClassName());
51
}
52
return
false
;
53
}
54
55
override
void
OnStartServer
(
ActionData
action_data)
56
{
57
super.OnStartServer(action_data);
58
59
m_IsFeatherInHands
=
IsFeatherType
(action_data.m_MainItem.ClassName());
60
m_ResultEntity
= null;
61
}
62
63
override
void
OnFinishProgressServer
(
ActionData
action_data)
64
{
65
ItemBase
feather;
66
Ammunition_Base
bolt;
67
68
bool
added =
false
;
69
70
if
(
m_IsFeatherInHands
)
71
{
72
//feather in hands
73
feather = action_data.m_MainItem;
74
bolt =
Ammunition_Base
.Cast(action_data.m_Target.GetObject());
75
}
76
else
77
{
78
// bolt in hands
79
bolt =
Ammunition_Base
.Cast(action_data.m_MainItem);
80
feather =
ItemBase
.Cast(action_data.m_Target.GetObject());
81
}
82
83
if
(!bolt || !feather)
84
return
;
85
86
float
dmg;
87
string
type;
88
89
bolt.ServerAcquireCartridge(dmg, type);
90
91
if
(
m_ResultEntity
)
92
{
93
type =
m_ResultEntity
.ConfigGetString(
"Ammo"
);
94
if
(
m_ResultEntity
.GetAmmoCount() <
m_ResultEntity
.GetAmmoMax())
95
{
96
m_ResultEntity
.ServerStoreCartridge(dmg, type);
97
added =
true
;
98
}
99
}
100
101
if
(!added)
102
{
103
m_ResultEntity
=
Ammunition_Base
.Cast(action_data.m_Player.SpawnEntityOnGroundRaycastDispersed(
"Ammo_ImprovisedBolt_2"
));
104
type =
m_ResultEntity
.ConfigGetString(
"Ammo"
);
105
m_ResultEntity
.ServerSetAmmoCount(0);
106
m_ResultEntity
.ServerStoreCartridge(dmg, type);
107
m_ResultEntity
.SetHealth01(
""
,
""
, bolt.GetHealth01(
""
,
""
));
108
}
109
110
feather.AddQuantity(-1);
111
}
112
};
ActionData
ActionBase ActionData
Определения
ActionBase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_SpecialtyWeight
float m_SpecialtyWeight
Определения
ActionBase.c:77
ActionBase::m_StanceMask
int m_StanceMask
Определения
ActionBase.c:62
ActionBase::m_Text
string m_Text
Определения
ActionBase.c:58
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Определения
ActionBase.c:64
ActionBase::m_FullBody
bool m_FullBody
Определения
ActionBase.c:61
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Определения
ActionBase.c:65
ActionBaseCB::m_ActionData
ActionData m_ActionData
Определения
AnimatedActionBase.c:3
ActionContinuousBase::ActionContinuousBase
void ActionContinuousBase()
Определения
ActionContinuousBase.c:124
ActionContinuousBaseCB
Определения
ActionContinuousBase.c:2
ActionCraftBoltsFeather::m_ResultEntity
Ammunition_Base m_ResultEntity
Определения
ActionCraftBoltsFeather.c:14
ActionCraftBoltsFeather::IsFeatherType
bool IsFeatherType(string itemInHandsType)
Определения
ActionCraftBoltsFeather.c:34
ActionCraftBoltsFeather::OnStartServer
override void OnStartServer(ActionData action_data)
Определения
ActionCraftBoltsFeather.c:55
ActionCraftBoltsFeather::CreateConditionComponents
override void CreateConditionComponents()
Определения
ActionCraftBoltsFeather.c:28
ActionCraftBoltsFeather::OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Определения
ActionCraftBoltsFeather.c:63
ActionCraftBoltsFeather::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения
ActionCraftBoltsFeather.c:39
ActionCraftBoltsFeather::ActionCraftBoltsFeather
void ActionCraftBoltsFeather()
Определения
ActionCraftBoltsFeather.c:16
ActionCraftBoltsFeather::m_IsFeatherInHands
bool m_IsFeatherInHands
Определения
ActionCraftBoltsFeather.c:13
ActionCraftBoltsFeatherCB::CreateActionComponent
override void CreateActionComponent()
Определения
ActionCraftBoltsFeather.c:5
ActionCraftBoltsFeatherCB::TIME_TO_CRAFT
const float TIME_TO_CRAFT
Определения
ActionCraftBoltsFeather.c:3
ActionCraftBoltsFeatherCB
Определения
ActionCraftBoltsFeather.c:2
Ammunition_Base
ammo pile base
Определения
AmmunitionPiles.c:3
AnimatedActionBase::m_CommandUID
int m_CommandUID
Определения
AnimatedActionBase.c:143
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Определения
AnimatedActionBase.c:145
CAContinuousRepeat
Определения
CAContinuousRepeat.c:2
CCINonRuined
Определения
CCINonRuined.c:2
CCTNonRuined
Определения
CCTNonRuined.c:2
ItemBase
Определения
InventoryItem.c:731
PlayerBase
Определения
PlayerBaseClient.c:2
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Определения
dayzplayer.c:602
Ishodniki
scripts
4_World
Classes
UserActionsComponent
Actions
Continuous
ActionCraftBoltsFeather.c
Создано системой
1.13.2