DayZ 1.24
Loading...
Searching...
No Matches
ActionWaterPlant Class Reference
Inheritance diagram for ActionWaterPlant:
[legend]
Collaboration diagram for ActionWaterPlant:
[legend]

Private Member Functions

void ActionWaterPlant ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnFinishProgressClient (ActionData action_data)
 
- Private Member Functions inherited from 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)
 

Detailed Description

Definition at line 11 of file ActionWaterPlant.c.

Constructor & Destructor Documentation

◆ ActionWaterPlant()

void ActionWaterPlant::ActionWaterPlant ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

override bool ActionWaterPlant::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 29 of file ActionWaterPlant.c.

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 }

◆ CreateConditionComponents()

override void ActionWaterPlant::CreateConditionComponents ( )
inlineprivate

◆ OnFinishProgressClient()

override void ActionWaterPlant::OnFinishProgressClient ( ActionData action_data)
inlineprivate

Definition at line 60 of file ActionWaterPlant.c.

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 }
float GetSpecialtyWeight()
Definition ActionBase.c:967

References GetSpecialtyWeight(), and m_SpecialtyWeight.

◆ OnFinishProgressServer()

override void ActionWaterPlant::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 44 of file ActionWaterPlant.c.

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 }

References GetSpecialtyWeight(), and m_SpecialtyWeight.


The documentation for this class was generated from the following file: