DayZ 1.24
Loading...
Searching...
No Matches
ActionDisinfectPlant.c
Go to the documentation of this file.
8
10{
11 PlantBase m_Plant;
12
14 {
17
18 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_SPRAYPLANT;
19 //m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
20 m_FullBody = true;
21
22 m_Text = "#apply";
23 }
24
30
31 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32 {
34 if (Class.CastTo(garden_base, target.GetObject()))
35 {
36 Slot slot;
37
39 garden_base.GetActionComponentNameList(target.GetComponentIndex(), selections);
40 string selection;
41
42 for (int s = 0; s < selections.Count(); s++)
43 {
44 selection = selections[s];
45 slot = garden_base.GetSlotBySelection(selection);
46 if (slot)
47 break;
48 }
49
50 if (slot && slot.GetPlant())
51 {
52 m_Plant = PlantBase.Cast(slot.GetPlant());
53 if (m_Plant.IsGrowing() && m_Plant.NeedsSpraying())
54 {
55 if (m_Plant.GetPlantStateIndex() < 1)
56 return false;
57
58 if (item.GetQuantity() > 0)
59 return true;
60 }
61 }
62 }
63 return false;
64 /*PlantBase plant;
65 if ( Class.CastTo(plant, target.GetObject() ) && !item.IsDamageDestroyed() )
66 {
67 if ( plant.IsGrowing() && plant.NeedsSpraying() )
68 {
69 if ( item.GetQuantity() > 0 )
70 {
71 return true;
72 }
73 }
74 }
75
76 return false;*/
77 }
78
80 {
81 Object targetObject = action_data.m_Target.GetObject();
82 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
83 if (nacdata)
84 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
85 }
86
88 {
89 Object targetObject = action_data.m_Target.GetObject();
90 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
91 if (nacdata)
92 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
93 }
94};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override void OnFinishProgressClient(ActionData action_data)
override void CreateConditionComponents()
override void OnFinishProgressServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float DEFAULT
const float GARDEN_DISINFECT_PLANT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.