DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ActionOpenDoors.c

См. исходные тексты.

Структуры данных

class  ActionOpenDoors
 

Функции

ActionOpenDoors ActionInteractBase CheckIfDoorIsLocked ()
 
void ActionOpenDoors ()
 
override void CreateConditionComponents ()
 
bool CreatesNoise ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override bool IsLockTargetOnUse ()
 

Переменные

ref NoiseParams m_NoisePar
 

Функции

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
protected

◆ ActionOpenDoors()

void ActionOpenDoors ( )
99 {
100 return false;
101 }

◆ CheckIfDoorIsLocked()

bool CheckIfDoorIsLocked ( )
94 {
95 return false;
96 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
104{
106
107 void ActionOpenDoors()
108 {
109 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
110 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
111 m_Text = "#open";
112 }
113
114 override void CreateConditionComponents()
115 {
116 m_ConditionItem = new CCINone();
117 m_ConditionTarget = new CCTCursor();
118 }
119
120 protected bool CheckIfDoorIsLocked()
121 {
122 return true;
123 }
124
125 protected bool CreatesNoise()
126 {
127 return true;
128 }
129
130 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
131 {
132 if (!target)
133 return false;
134
135 if (!IsBuilding(target))
136 return false;
137
138 Building building;
139 if (Class.CastTo(building, target.GetObject()))
140 {
141 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
142 if (doorIndex != -1)
143 {
144 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
145 return false;
146
147 return building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked());
148
149 }
150 }
151
152 return false;
153 }
154
155 override void OnStartServer(ActionData action_data)
156 {
157 super.OnStartServer(action_data);
158
159 Building building;
160 if (Class.CastTo(building, action_data.m_Target.GetObject()))
161 {
162 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
163 if (doorIndex != -1)
164 {
165 if (building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked()))
166 {
167 building.OpenDoor(doorIndex);
168 }
169 }
170 }
171 }
172
173 override void OnEndServer(ActionData action_data)
174 {
175 super.OnEndServer(action_data);
176
177 m_NoisePar = new NoiseParams();
178 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
179 NoiseSystem noise = GetGame().GetNoiseSystem();
180 if (noise && CreatesNoise())
181 {
182 if (action_data.m_Player)
183 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
184 }
185 }
186
187 override bool IsLockTargetOnUse()
188 {
189 return false;
190 }
191}
192
194{
195 override bool CheckIfDoorIsLocked()
196 {
197 return false;
198 }
199
200 override protected bool CreatesNoise()
201 {
202 return false;
203 }
204};
int m_CommandUID
Definition ActionBase.c:31
int m_StanceMask
Definition ActionBase.c:33
void ActionOpenDoors()
Definition ActionOpenDoors.c:96
override void OnEndServer(ActionData action_data)
Definition ActionOpenDoors.c:162
ref NoiseParams m_NoisePar
Definition ActionOpenDoors.c:94
override void CreateConditionComponents()
Definition ActionOpenDoors.c:103
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition ActionOpenDoors.c:119
override bool IsLockTargetOnUse()
Definition ActionOpenDoors.c:176
bool CreatesNoise()
Definition ActionOpenDoors.c:114
ActionOpenDoors ActionInteractBase CheckIfDoorIsLocked()
Definition ActionOpenDoors.c:93
override void OnStartServer(ActionData action_data)
Definition ActionOpenDoors.c:144
class NoiseSystem NoiseParams()
Definition Noise.c:15
Definition ActionInteractBase.c:39
Definition ActionOpenDoors.c:2
Definition CCINone.c:2
Definition CCTCursor.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition InventoryItem.c:731
Definition SensesAIEvaluate.c:2
static float GetNoiseReduction(Weather weather)
Definition SensesAIEvaluate.c:18
Definition Noise.c:2
Definition EntityAI.c:95
Definition PlayerBaseClient.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

◆ CreatesNoise()

bool CreatesNoise ( )
protected
115{
117
118 void ActionOpenDoors()
119 {
120 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
121 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
122 m_Text = "#open";
123 }
124
125 override void CreateConditionComponents()
126 {
127 m_ConditionItem = new CCINone();
128 m_ConditionTarget = new CCTCursor();
129 }
130
131 protected bool CheckIfDoorIsLocked()
132 {
133 return true;
134 }
135
136 protected bool CreatesNoise()
137 {
138 return true;
139 }
140
141 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
142 {
143 if (!target)
144 return false;
145
146 if (!IsBuilding(target))
147 return false;
148
149 Building building;
150 if (Class.CastTo(building, target.GetObject()))
151 {
152 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
153 if (doorIndex != -1)
154 {
155 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
156 return false;
157
158 return building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked());
159
160 }
161 }
162
163 return false;
164 }
165
166 override void OnStartServer(ActionData action_data)
167 {
168 super.OnStartServer(action_data);
169
170 Building building;
171 if (Class.CastTo(building, action_data.m_Target.GetObject()))
172 {
173 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
174 if (doorIndex != -1)
175 {
176 if (building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked()))
177 {
178 building.OpenDoor(doorIndex);
179 }
180 }
181 }
182 }
183
184 override void OnEndServer(ActionData action_data)
185 {
186 super.OnEndServer(action_data);
187
188 m_NoisePar = new NoiseParams();
189 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
190 NoiseSystem noise = GetGame().GetNoiseSystem();
191 if (noise && CreatesNoise())
192 {
193 if (action_data.m_Player)
194 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
195 }
196 }
197
198 override bool IsLockTargetOnUse()
199 {
200 return false;
201 }
202}
203
205{
206 override bool CheckIfDoorIsLocked()
207 {
208 return false;
209 }
210
211 override protected bool CreatesNoise()
212 {
213 return false;
214 }
215};

◆ IsLockTargetOnUse()

override bool IsLockTargetOnUse ( )
protected
177{
179
180 void ActionOpenDoors()
181 {
182 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
183 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
184 m_Text = "#open";
185 }
186
187 override void CreateConditionComponents()
188 {
189 m_ConditionItem = new CCINone();
190 m_ConditionTarget = new CCTCursor();
191 }
192
193 protected bool CheckIfDoorIsLocked()
194 {
195 return true;
196 }
197
198 protected bool CreatesNoise()
199 {
200 return true;
201 }
202
203 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
204 {
205 if (!target)
206 return false;
207
208 if (!IsBuilding(target))
209 return false;
210
211 Building building;
212 if (Class.CastTo(building, target.GetObject()))
213 {
214 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
215 if (doorIndex != -1)
216 {
217 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
218 return false;
219
220 return building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked());
221
222 }
223 }
224
225 return false;
226 }
227
228 override void OnStartServer(ActionData action_data)
229 {
230 super.OnStartServer(action_data);
231
232 Building building;
233 if (Class.CastTo(building, action_data.m_Target.GetObject()))
234 {
235 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
236 if (doorIndex != -1)
237 {
238 if (building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked()))
239 {
240 building.OpenDoor(doorIndex);
241 }
242 }
243 }
244 }
245
246 override void OnEndServer(ActionData action_data)
247 {
248 super.OnEndServer(action_data);
249
250 m_NoisePar = new NoiseParams();
251 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
252 NoiseSystem noise = GetGame().GetNoiseSystem();
253 if (noise && CreatesNoise())
254 {
255 if (action_data.m_Player)
256 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
257 }
258 }
259
260 override bool IsLockTargetOnUse()
261 {
262 return false;
263 }
264}
265
267{
268 override bool CheckIfDoorIsLocked()
269 {
270 return false;
271 }
272
273 override protected bool CreatesNoise()
274 {
275 return false;
276 }
277};

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
protected
163{
165
166 void ActionOpenDoors()
167 {
168 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
169 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
170 m_Text = "#open";
171 }
172
173 override void CreateConditionComponents()
174 {
175 m_ConditionItem = new CCINone();
176 m_ConditionTarget = new CCTCursor();
177 }
178
179 protected bool CheckIfDoorIsLocked()
180 {
181 return true;
182 }
183
184 protected bool CreatesNoise()
185 {
186 return true;
187 }
188
189 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
190 {
191 if (!target)
192 return false;
193
194 if (!IsBuilding(target))
195 return false;
196
197 Building building;
198 if (Class.CastTo(building, target.GetObject()))
199 {
200 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
201 if (doorIndex != -1)
202 {
203 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
204 return false;
205
206 return building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked());
207
208 }
209 }
210
211 return false;
212 }
213
214 override void OnStartServer(ActionData action_data)
215 {
216 super.OnStartServer(action_data);
217
218 Building building;
219 if (Class.CastTo(building, action_data.m_Target.GetObject()))
220 {
221 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
222 if (doorIndex != -1)
223 {
224 if (building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked()))
225 {
226 building.OpenDoor(doorIndex);
227 }
228 }
229 }
230 }
231
232 override void OnEndServer(ActionData action_data)
233 {
234 super.OnEndServer(action_data);
235
236 m_NoisePar = new NoiseParams();
237 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
238 NoiseSystem noise = GetGame().GetNoiseSystem();
239 if (noise && CreatesNoise())
240 {
241 if (action_data.m_Player)
242 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
243 }
244 }
245
246 override bool IsLockTargetOnUse()
247 {
248 return false;
249 }
250}
251
253{
254 override bool CheckIfDoorIsLocked()
255 {
256 return false;
257 }
258
259 override protected bool CreatesNoise()
260 {
261 return false;
262 }
263};

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
protected
145{
147
148 void ActionOpenDoors()
149 {
150 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
151 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
152 m_Text = "#open";
153 }
154
155 override void CreateConditionComponents()
156 {
157 m_ConditionItem = new CCINone();
158 m_ConditionTarget = new CCTCursor();
159 }
160
161 protected bool CheckIfDoorIsLocked()
162 {
163 return true;
164 }
165
166 protected bool CreatesNoise()
167 {
168 return true;
169 }
170
171 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
172 {
173 if (!target)
174 return false;
175
176 if (!IsBuilding(target))
177 return false;
178
179 Building building;
180 if (Class.CastTo(building, target.GetObject()))
181 {
182 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
183 if (doorIndex != -1)
184 {
185 if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
186 return false;
187
188 return building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked());
189
190 }
191 }
192
193 return false;
194 }
195
196 override void OnStartServer(ActionData action_data)
197 {
198 super.OnStartServer(action_data);
199
200 Building building;
201 if (Class.CastTo(building, action_data.m_Target.GetObject()))
202 {
203 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
204 if (doorIndex != -1)
205 {
206 if (building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked()))
207 {
208 building.OpenDoor(doorIndex);
209 }
210 }
211 }
212 }
213
214 override void OnEndServer(ActionData action_data)
215 {
216 super.OnEndServer(action_data);
217
218 m_NoisePar = new NoiseParams();
219 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
220 NoiseSystem noise = GetGame().GetNoiseSystem();
221 if (noise && CreatesNoise())
222 {
223 if (action_data.m_Player)
224 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
225 }
226 }
227
228 override bool IsLockTargetOnUse()
229 {
230 return false;
231 }
232}
233
235{
236 override bool CheckIfDoorIsLocked()
237 {
238 return false;
239 }
240
241 override protected bool CreatesNoise()
242 {
243 return false;
244 }
245};

Переменные

◆ m_NoisePar