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

Private Member Functions

void ActionCreateGreenhouseGardenPlot ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (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)
 

Private Attributes

GardenPlot m_GardenPlot
 
const float CAMERA_PITCH_THRESHOLD = -30
 

Detailed Description

Definition at line 9 of file ActionCreateGreenhouseGardenPlot.c.

Constructor & Destructor Documentation

◆ ActionCreateGreenhouseGardenPlot()

void ActionCreateGreenhouseGardenPlot::ActionCreateGreenhouseGardenPlot ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 30 of file ActionCreateGreenhouseGardenPlot.c.

31 {
32 if (!target)
33 return false;
34
35 if (player.IsPlacingLocal())
36 return false;
37
38 Object target_object = target.GetObject();
39
42
44 {
45 string action_selection = target_object.GetActionComponentName(target.GetComponentIndex());
46 //Update selections in model, name the desired part Soil to improve action condition check
47 if (action_selection != "soil")
48 return false;
49
50 //check if there is any gardenplot objects in the current building
53 vector pos = target_object.GetPosition();
54 pos[1] = pos[1] - 1; //Lower by one meter for check if plot already present
55 GetGame().GetObjectsAtPosition3D(pos, 2, nearest_objects, proxy_cargos);
56
57 for (int i = 0; i < nearest_objects.Count(); ++i)
58 {
59 Object object = nearest_objects.Get(i);
60
61 if (object.IsInherited(GardenPlot))
62 return false;
63 }
64
65 return true;
66 }
67
68 return false;
69 }
class Land_Misc_Greenhouse extends BuildingSuper Land_Misc_Polytunnel()
void Land_Misc_Greenhouse()
proto native CGame GetGame()

References GetGame(), Land_Misc_Greenhouse(), and Land_Misc_Polytunnel().

◆ CreateConditionComponents()

override void ActionCreateGreenhouseGardenPlot::CreateConditionComponents ( )
inlineprivate

Definition at line 24 of file ActionCreateGreenhouseGardenPlot.c.

25 {
28 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ OnFinishProgressServer()

override void ActionCreateGreenhouseGardenPlot::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 71 of file ActionCreateGreenhouseGardenPlot.c.

72 {
76 Object targetObject = action_data.m_Target.GetObject();
77
78 vector position = targetObject.GetPosition();
79
80 //Depending on where we dig the required height offset is not the same
83
84 if (polytunnel)
85 position[1] = position[1] - 1.15; //Lower Y position by roughly 1 meter to compensate for spawning location offset
86 else
87 position[1] = position[1] - 1.05;
88
89 vector orientation = targetObject.GetOrientation();
90
91 if (GetGame().IsMultiplayer())
92 {
94 if (tunnel)
95 m_GardenPlot = GardenPlot.Cast(GetGame().CreateObjectEx("GardenPlotPolytunnel", position, ECE_KEEPHEIGHT));
96 else
97 m_GardenPlot = GardenPlot.Cast(GetGame().CreateObjectEx("GardenPlotGreenhouse", position, ECE_KEEPHEIGHT));
98
99 m_GardenPlot.SetOrientation(orientation);
100 }
101 }
const int ECE_KEEPHEIGHT

References ECE_KEEPHEIGHT, GetGame(), Land_Misc_Greenhouse(), Land_Misc_Polytunnel(), and m_GardenPlot.

Member Data Documentation

◆ CAMERA_PITCH_THRESHOLD

const float ActionCreateGreenhouseGardenPlot::CAMERA_PITCH_THRESHOLD = -30
private

Definition at line 12 of file ActionCreateGreenhouseGardenPlot.c.

◆ m_GardenPlot

GardenPlot ActionCreateGreenhouseGardenPlot::m_GardenPlot
private

Definition at line 11 of file ActionCreateGreenhouseGardenPlot.c.

Referenced by OnFinishProgressServer().


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