Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionDigGardenPlot
+ Граф наследования:ActionDigGardenPlot:

Закрытые члены

void ActionDigGardenPlot ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void SetupAnimation (ItemBase item)
 
void CheckSurfaceBelowGardenPlot (PlayerBase player, GardenPlot item_GP, Hologram hologram)
 
override void DropDuringPlacing (PlayerBase player)
 
override void OnFinishProgressClient (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 

Закрытые данные

GardenPlot m_GardenPlot
 

Подробное описание

Конструктор(ы)

◆ ActionDigGardenPlot()

void ActionDigGardenPlot ( )
inlineprivate
14 {
15 m_CallbackClass = ActionDigGardenPlotCB;
16 m_FullBody = true;
17 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
19 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIGMANIPULATE;
20
21 m_Text = "#make_garden_plot";
22 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
float m_SpecialtyWeight
Definition ActionBase.c:68
int m_StanceMask
Definition ActionBase.c:53
Definition ActionDigGardenPlot.c:2
Definition ActionConstants.c:119
const float ROUGH_LOW
Definition ActionConstants.c:120
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки m_FullBody, m_SpecialtyWeight, m_StanceMask, m_Text и UASoftSkillsWeight::ROUGH_LOW.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
25 {
26 //Client
27 if (!GetGame().IsDedicatedServer())
28 {
29 //Action not allowed if player has broken legs
30 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
31 return false;
32
33 if (player.IsPlacingLocal())
34 {
35 Hologram hologram = player.GetHologramLocal();
36 GardenPlot item_GP;
37 Class.CastTo(item_GP, hologram.GetProjectionEntity());
39
40 if (!hologram.IsColliding())
41 {
42 return true;
43 }
44 }
45 return false;
46 }
47 //Server
48 return true;
49 }
eBrokenLegs
Definition EBrokenLegs.c:2
void CheckSurfaceBelowGardenPlot(PlayerBase player, GardenPlot item_GP, Hologram hologram)
Definition ActionDigGardenPlot.c:59
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Hologram.c:2
Definition EntityAI.c:95
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), CheckSurfaceBelowGardenPlot() и GetGame().

◆ CheckSurfaceBelowGardenPlot()

void CheckSurfaceBelowGardenPlot ( PlayerBase player,
GardenPlot item_GP,
Hologram hologram )
inlineprivate
60 {
61 vector min_max[2];
62 item_GP.GetCollisionBox(min_max);
63 float offset = min_max[1][1] - min_max[0][1];
64 //Print(offset);
65 vector pos_adjusted = item_GP.GetPosition();
67
68 if (item_GP.CanBePlaced(player, /*item_GP.GetPosition()*/pos_adjusted) )
69 {
70 if (item_GP.CanBePlaced(NULL, item_GP.CoordToParent(hologram.GetLeftCloseProjectionVector())))
71 {
72 if (item_GP.CanBePlaced(NULL, item_GP.CoordToParent(hologram.GetRightCloseProjectionVector())))
73 {
74 if (item_GP.CanBePlaced(NULL, item_GP.CoordToParent(hologram.GetLeftFarProjectionVector())))
75 {
76 if (item_GP.CanBePlaced(NULL, item_GP.CoordToParent(hologram.GetRightFarProjectionVector())))
77 {
78 hologram.SetIsCollidingGPlot(false);
79
80 return;
81 }
82 }
83 }
84 }
85 }
86
87 hologram.SetIsCollidingGPlot(true);
88 }
Definition EnConvert.c:106

Используется в ActionCondition().

◆ DropDuringPlacing()

override void DropDuringPlacing ( PlayerBase player)
inlineprivate
91 {
92 }

◆ OnFinishProgressClient()

override void OnFinishProgressClient ( ActionData action_data)
inlineprivate
95 {
98 poActionData.m_AlreadyPlaced = true;
99 }
Definition ActionDeployBase.c:2

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
102 {
106 vector position = action_data.m_Player.GetLocalProjectionPosition();
107 vector orientation = action_data.m_Player.GetLocalProjectionOrientation();
108
109 if (GetGame().IsMultiplayer())
110 {
111 m_GardenPlot = GardenPlot.Cast(action_data.m_Player.GetHologramServer().PlaceEntity(entity_for_placing));
112 m_GardenPlot.SetOrientation(orientation);
113 action_data.m_Player.GetHologramServer().CheckPowerSource();
114 action_data.m_Player.PlacingCompleteServer();
115
116 m_GardenPlot.OnPlacementComplete(action_data.m_Player);
117 }
118
119 //local singleplayer
120 if (!GetGame().IsMultiplayer())
121 {
122 m_GardenPlot = GardenPlot.Cast(action_data.m_Player.GetHologramLocal().PlaceEntity(entity_for_placing));
123 m_GardenPlot.SetOrientation(orientation);
124 action_data.m_Player.PlacingCompleteLocal();
125
126 m_GardenPlot.OnPlacementComplete(action_data.m_Player);
127 }
128
129 GetGame().ClearJuncture(action_data.m_Player, entity_for_placing);
130 action_data.m_MainItem.SetIsBeingPlaced(false);
131 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
132 poActionData.m_AlreadyPlaced = true;
133 action_data.m_MainItem.SoundSynchRemoteReset();
134
135 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, 10);
136
137 }
GardenPlot m_GardenPlot
Definition ActionDigGardenPlot.c:11
Definition Building.c:6

Перекрестные ссылки GetGame(), m_GardenPlot и m_SpecialtyWeight.

◆ SetupAnimation()

override void SetupAnimation ( ItemBase item)
inlineprivate
52 {
53 if (item)
54 {
55 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DIG;
56 }
57 }

Поля

◆ m_GardenPlot

GardenPlot m_GardenPlot
private

Используется в OnFinishProgressServer().


Объявления и описания членов класса находятся в файле: