DayZ 1.24
Loading...
Searching...
No Matches
ActionWaterPlant.c
Go to the documentation of this file.
10
12{
14 {
16 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_EMPTY_VESSEL;
17 m_FullBody = true;
19 m_Text = "#water_plant";
20 m_LockTargetOnUse = false;
21 }
22
28
29 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
30 {
31 Object targetObject = target.GetObject();
32
33 if (targetObject != NULL && targetObject.IsInherited(PlantBase) && item != NULL && !item.IsDamageDestroyed())
34 {
35 PlantBase plant = PlantBase.Cast(targetObject);
36
37 if (plant.NeedsWater() && item.GetQuantity() > 0)
38 return true;
39 }
40
41 return false;
42 }
43
45 {
46 Object targetObject = action_data.m_Target.GetObject();
47
48 if (targetObject != NULL && targetObject.IsInherited(PlantBase))
49 {
50 PlantBase plant = PlantBase.Cast(targetObject);
51 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
52 float water = nacdata.param1;
53 Slot slot = plant.GetSlot();
54 water = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus(water, this.GetSpecialtyWeight());
55 slot.GiveWater(water);
56 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
57 }
58 }
59
61 {
62 Object targetObject = action_data.m_Target.GetObject();
63
64 if (targetObject != NULL && targetObject.IsInherited(PlantBase))
65 {
66 PlantBase plant = PlantBase.Cast(targetObject);
67 Param1<float> nacdata = Param1<float>.Cast(action_data.m_ActionComponent.GetACData());
68 float water = nacdata.param1;
69 Slot slot = plant.GetSlot();
70 water = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus(water, this.GetSpecialtyWeight());
71 slot.GiveWater(water);
72 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
73 }
74 }
75};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
float GetSpecialtyWeight()
Definition ActionBase.c:967
bool m_LockTargetOnUse
Definition ActionBase.c:51
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
const float QUANTITY_USED_PER_SEC
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnFinishProgressClient(ActionData action_data)
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597