DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnAction()

override bool Building::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprivate

См. определение в файле 3_Game/DayZ/Entities/Building.c строка 193

194 {
195 if (super.OnAction(action_id, player, ctx))
196 return true;
197
198 if (g_Game.IsClient() || !g_Game.IsMultiplayer())
199 {
200 switch (action_id)
201 {
202 case EActions.GIZMO_OBJECT:
203 if (GetGizmoApi())
205 return true;
206 }
207 }
208
209 switch (action_id)
210 {
211 case EActions.BUILDING_PLAY_DOOR_SOUND:
212 PlayDoorSound(GetNearestDoorBySoundPos(player.GetPosition()));
213 return true;
214 }
215
216 if (!g_Game.IsServer())
217 return false;
218
219 switch (action_id)
220 {
221 case EActions.BUILDING_OUTPUT_LOG:
223 return true;
224 case EActions.BUILDING_OPEN_DOOR:
225 OpenDoor(GetNearestDoorBySoundPos(player.GetPosition()));
226 return true;
227 case EActions.BUILDING_CLOSE_DOOR:
228 CloseDoor(GetNearestDoorBySoundPos(player.GetPosition()));
229 return true;
230 case EActions.BUILDING_LOCK_DOOR:
231 LockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
232 return true;
233 case EActions.BUILDING_UNLOCK_DOOR:
234 UnlockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
235 return true;
236 }
237
238 return false;
239 }
DayZGame g_Game
Определения DayZGame.c:3942
EActions
Определения EActions.c:2
proto GizmoApi GetGizmoApi()
proto native void OpenDoor(int index)
Attempts to open the door.
proto native void LockDoor(int index, bool force=false)
Locks the door if not already locked, resets the door health. 'force = true' will close the door if o...
int GetNearestDoorBySoundPos(vector position)
Gets the nearest door based on the sound position (quick and dirty function for debugging)
Определения 3_Game/DayZ/Entities/Building.c:71
proto native void CloseDoor(int index)
Attempts to close the door.
proto native void PlayDoorSound(int index)
Plays the appropriate sound at the door, based on animation phase and state.
proto native void UnlockDoor(int index, bool animate=true)
Unlocks the door if locked, AJAR animation optional.
proto native void OutputDoorLog()
Requires special build as logging is disabled even on internal builds due to memory usage....
proto void SelectObject(Object object)

Перекрестные ссылки CloseDoor(), g_Game, GetGizmoApi(), GetNearestDoorBySoundPos(), LockDoor(), EntityAI::Man(), OpenDoor(), OutputDoorLog(), PlayDoorSound(), GizmoApi::SelectObject() и UnlockDoor().