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

Private Member Functions

void ActionPlantSeed ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnExecuteClient (ActionData action_data)
 
void Process (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionPlantSeed.c.

Constructor & Destructor Documentation

◆ ActionPlantSeed()

void ActionPlantSeed::ActionPlantSeed ( )
inlineprivate

Definition at line 3 of file ActionPlantSeed.c.

4 {
6
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_DROPITEM_HANDS;
8 m_FullBody = false;
9 m_Text = "#plant_seed";
10 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68
const float PRECISE_MEDIUM
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, m_FullBody, m_SpecialtyWeight, m_Text, and UASoftSkillsWeight::PRECISE_MEDIUM.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 23 of file ActionPlantSeed.c.

24 {
25 GardenBase targetObject = GardenBase.Cast(target.GetObject());
26
27 if (targetObject && (!targetObject.IsHologram() || !targetObject.IsBeingPlaced()))
28 {
30 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
31
32 for (int s = 0; s < selections.Count(); s++)
33 {
34 string selection = selections[s];
35 Slot slot = targetObject.GetSlotBySelection(selection);
36 if (slot)
37 {
38 if (item != NULL && item.GetQuantity() > 0 && targetObject.CanPlantSeed(selection))
39 return true;
40 }
41 }
42 }
43
44 return false;
45 }

◆ CreateConditionComponents()

override void ActionPlantSeed::CreateConditionComponents ( )
inlineprivate

Definition at line 12 of file ActionPlantSeed.c.

13 {
16 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ HasTarget()

override bool ActionPlantSeed::HasTarget ( )
inlineprivate

Definition at line 18 of file ActionPlantSeed.c.

19 {
20 return true;
21 }

◆ OnExecuteClient()

override void ActionPlantSeed::OnExecuteClient ( ActionData action_data)
inlineprivate

Definition at line 52 of file ActionPlantSeed.c.

53 {
54 //Process(action_data);
55 }

◆ OnExecuteServer()

override void ActionPlantSeed::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 47 of file ActionPlantSeed.c.

48 {
50 }
void Process(ActionData action_data)

References Process().

◆ Process()

void ActionPlantSeed::Process ( ActionData action_data)
inlineprivate

Definition at line 57 of file ActionPlantSeed.c.

58 {
59 Object targetObject = action_data.m_Target.GetObject();
60 int slot_ID;
61
62 if (targetObject != NULL && targetObject.IsInherited(GardenBase))
63 {
66 targetObject.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
67
68 for (int s = 0; s < selections.Count(); s++)
69 {
70 string selection = selections[s];
71 Slot slot = garden_base.GetSlotBySelection(selection);
72 if (slot)
73 {
74 slot_ID = slot.GetSlotId();
75 break;
76 }
77 }
78
79 //int slot_ID = slot.GetSlotId();
80
81 ItemBase seed_IB = ItemBase.Cast(action_data.m_MainItem);
82
83 seed_IB.SplitIntoStackMax(garden_base, slot_ID, action_data.m_Player);
84 }
85
86 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
87 }

References m_SpecialtyWeight.

Referenced by OnExecuteServer().


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