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

◆ OnAction()

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

См. определение в файле Building.c строка 182

183 {
184 if (super.OnAction(action_id, player, ctx))
185 return true;
186
187 switch (action_id)
188 {
189 case EActions.BUILDING_PLAY_DOOR_SOUND:
190 PlayDoorSound(GetNearestDoorBySoundPos(player.GetPosition()));
191 return true;
192 }
193
194 if (!GetGame().IsServer())
195 return false;
196
197 switch (action_id)
198 {
199 case EActions.BUILDING_OUTPUT_LOG:
201 return true;
202 case EActions.BUILDING_OPEN_DOOR:
203 OpenDoor(GetNearestDoorBySoundPos(player.GetPosition()));
204 return true;
205 case EActions.BUILDING_CLOSE_DOOR:
206 CloseDoor(GetNearestDoorBySoundPos(player.GetPosition()));
207 return true;
208 case EActions.BUILDING_LOCK_DOOR:
209 LockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
210 return true;
211 case EActions.BUILDING_UNLOCK_DOOR:
212 UnlockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
213 return true;
214 }
215
216 return false;
217 }
EActions
Определения EActions.c:2
proto native void CloseDoor(int index)
Attempts to close the door.
int GetNearestDoorBySoundPos(vector position)
Gets the nearest door based on the sound position (quick and dirty function for debugging)
Определения Building.c:66
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...
proto native void OutputDoorLog()
Requires special build as logging is disabled even on internal builds due to memory usage....
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 CGame GetGame()

Перекрестные ссылки CloseDoor(), GetGame(), GetNearestDoorBySoundPos(), LockDoor(), Man(), OpenDoor(), OutputDoorLog(), PlayDoorSound() и UnlockDoor().