Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
actionarmexplosive.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
5 m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.EXPLOSIVE_ARM);
6 }
7
8 override void InitActionComponent()
9 {
10 super.InitActionComponent();
11
12 RegisterAnimationEvent("CraftingAction", UA_IN_CRAFTING);
13 }
14}
15
17{
19 {
20 m_CallbackClass = ActionArmExplosiveCB;
21 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
22 m_FullBody = true;
23 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
24 m_Text = "#STR_ArmExplosive";
25 m_Sound = "craft_universal_0";
26 }
27
29 {
30 m_ConditionTarget = new CCTNonRuined(UAMaxDistances.DEFAULT);
31 m_ConditionItem = new CCINotPresent();
32 }
33
34 override typename GetInputType()
35 {
37 }
38
39 override bool HasProgress()
40 {
41 return true;
42 }
43
44 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
45 {
46 if (target.GetParent())
47 return false;
48
49 ItemBase targetItem = ItemBase.Cast(target.GetObject());
50 if (targetItem && targetItem.IsBeingPlaced())
51 return false;
52
53 ExplosivesBase explosive = ExplosivesBase.Cast(target.GetObject());
54
55 return explosive && !explosive.GetArmed();
56 }
57
58 override void OnStartServer(ActionData action_data)
59 {
60 super.OnStartServer(action_data);
61
62 ExplosivesBase item = ExplosivesBase.Cast(action_data.m_Target.GetObject());
63 if (item.GetArmSoundset() != string.Empty)
64 item.StartItemSoundServer(SoundConstants.ITEM_EXPLOSIVE_ARM);
65 }
66
67 override void OnEndServer(ActionData action_data)
68 {
69 super.OnEndServer(action_data);
70
71 ExplosivesBase item = ExplosivesBase.Cast(action_data.m_Target.GetObject());
72 if (item.GetArmSoundset() != string.Empty)
73 item.StopItemSoundServer(SoundConstants.ITEM_EXPLOSIVE_ARM);
74 }
75
76 override void OnFinishProgressServer(ActionData action_data)
77 {
78 super.OnFinishProgressServer(action_data);
79
80 ExplosivesBase explosive = ExplosivesBase.Cast(action_data.m_Target.GetObject());
81 if (explosive)
82 explosive.OnPlacementComplete(action_data.m_Player, explosive.GetPosition(), action_data.m_Player.GetOrientation());
83 }
84}
ActionArmExplosiveCB ActionContinuousBaseCB ActionArmExplosive()
int m_CommandUID
Definition actionbase.c:31
override GetInputType()
ActionData m_ActionData
bool HasProgress()
For UI: hiding of progress bar.
Definition actionbase.c:250
void CreateConditionComponents()
Definition actionbase.c:230
void OnFinishProgressServer(ActionData action_data)
override void OnStartServer(ActionData action_data)
override void OnEndServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
const int UA_IN_CRAFTING
Definition constants.c:483
EffectSound m_Sound