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

◆ Update()

void Update ( float deltaT)
protected

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

275 {
276 // no updates on restrained characters
277 if (m_Player.IsRestrained())
278 return;
279
281 {
282 if (GetGame().IsServer() && m_Callback && !m_Player.GetItemInHands())
283 {
284 m_Player.GetHumanInventory().CreateInHands("SurrenderDummyItem");
285 }
286 m_ItemToBeCreated = false;
287 }
288
289 int gestureSlot = 0;
290 #ifndef SERVER
291 gestureSlot = DetermineGestureIndex();
292 #endif
293 //deferred emote cancel
294 if (m_InstantCancelEmote) //'hard' cancel
295 {
296 if (m_Callback)
297 {
298 m_Callback.Cancel();
299 }
300
301 if (m_MenuEmote)
302 {
303 m_MenuEmote = null;
304 }
306 m_InstantCancelEmote = false;
308 if (m_IsSurrendered)
310 else
311 SetEmoteLockState(false);
312 }
313 else if (m_CancelEmote) //'soft' cancel
314 {
315 if (m_IsSurrendered)
316 {
318 }
319 else if (m_Callback)
320 {
321 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_INTERRUPT);
322 }
323
325 m_CancelEmote = false;
326 }
327
328 if (m_MenuEmote && m_MenuEmote.GetForced() > EmoteLauncher.FORCE_NONE && !GetGame().IsDedicatedServer()) //forced emote playing
329 {
331 }
332 else if (m_Callback)
333 {
334 bool uiGesture = false;
335 if (!GetGame().IsDedicatedServer())
336 {
338
340 {
342 }
343
345 {
347 }
348 }
349
350 if (gestureSlot > 0 || m_GestureInterruptInput || (m_HIC.IsSingleUse() && !uiGesture) || (m_HIC.IsContinuousUseStart() && !uiGesture) || (m_Callback.m_IsFullbody && !uiGesture && m_HIC.IsWeaponRaised()))
351 {
353 {
354 if (m_Callback.GetState() == m_Callback.STATE_LOOP_LOOP)
355 {
357 }
358 else
359 {
360 return;
361 }
362 }
364 {
365 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_ACTION);
366 }
368 {
369 if (m_RPSOutcome != -1)
370 {
371 if (m_RPSOutcome == 0)
372 {
373 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_ROCK);
374 }
375 else if (m_RPSOutcome == 1)
376 {
377 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_PAPER);
378 }
379 else if (m_RPSOutcome == 2)
380 {
381 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_SCISSORS);
382 }
383 m_RPSOutcome = -1;
384 }
385 else
386 {
387 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
388 }
389 }
391 {
393 }
395 {
397 }
398 }
399
400 if (m_LastMask != -1 && m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_PRONE))
401 {
402 m_Callback.Cancel();
403 }
404
406 {
408 }
409
411 {
413 }
414
416 {
418 }
419 }
420 //no m_Callback exists
421 else
422 {
423 if (m_bEmoteIsRequestPending && (m_Player.IsUnconscious() || !m_Player.IsAlive()))
424 {
426 }
427
429 {
430 OnEmoteEnd();
431 }
432 else if (!m_Player.GetItemInHands() && m_IsSurrendered && !m_ItemToBeCreated && (!m_MenuEmote || m_MenuEmote.GetForced() != EmoteLauncher.FORCE_NONE)) //play only when there is time to do so
433 {
434 PlaySurrenderInOut(false);
435 return;
436 }
437 // getting out of surrender state
438 else if (m_IsSurrendered && m_Player.GetItemInHands() && (m_HIC.IsSingleUse() || m_HIC.IsContinuousUseStart() || m_HIC.IsWeaponRaised()))
439 {
440 if (m_Player.GetItemInHands())
441 m_Player.GetItemInHands().DeleteSafe();//Note, this keeps item 'alive' until it is released by all the systems (inventory swapping etc.)
442 return;
443 }
444 // fallback in case lock does not end properly
445 else if (m_IsSurrendered && (!m_Player.GetItemInHands() || (m_Player.GetItemInHands() && m_Player.GetItemInHands().GetType() != "SurrenderDummyItem" && m_EmoteLockState)))
446 {
448 return;
449 }
450 //actual emote launch
452 {
454 }
455 //client-side emote launcher
456 else if (!m_bEmoteIsPlaying && m_MenuEmote && !GetGame().IsDedicatedServer())
457 {
459 }
460 else if (!m_MenuEmote && gestureSlot > 0)
461 {
462 CreateEmoteCBFromMenu(gestureSlot,true); //translation no longer needed
463 }
464 }
465 }
EmoteCB m_Callback
Определения EmoteManager.c:111
const int CALLBACK_CMD_END
Определения EmoteManager.c:139
int m_RPSOutcome
Определения EmoteManager.c:136
void CreateEmoteCBFromMenu(int id, bool interrupts_same=false)
Определения EmoteManager.c:759
const int CALLBACK_CMD_INVALID
Определения EmoteManager.c:138
int m_CurrentGestureID
Определения EmoteManager.c:134
bool m_CancelEmote
Определения EmoteManager.c:121
int m_DeferredEmoteExecution
Определения EmoteManager.c:131
void InterruptCallbackCommand()
Определения EmoteManager.c:769
int m_LastMask
Определения EmoteManager.c:135
void PlaySurrenderInOut(bool state)
Определения EmoteManager.c:981
int DetermineGestureIndex()
Определения EmoteManager.c:234
void CommitSuicide()
Определения EmoteManager.c:687
bool m_GestureInterruptInput
Определения EmoteManager.c:123
void ClearSurrenderState()
clears surrender state only
Определения EmoteManager.c:1099
const int CALLBACK_CMD_INSTACANCEL
Определения EmoteManager.c:141
void OnEmoteEnd()
Определения EmoteManager.c:467
void SetEmoteLockState(bool state)
Определения EmoteManager.c:1030
ref EmoteLauncher m_MenuEmote
Определения EmoteManager.c:116
bool InterruptGestureCheck()
Определения EmoteManager.c:1138
bool InterruptWaterCheck()
Определения EmoteManager.c:1167
bool m_EmoteLockState
Определения EmoteManager.c:130
bool m_ItemToBeCreated
Определения EmoteManager.c:120
bool m_IsSurrendered
Определения EmoteManager.c:119
const int CALLBACK_CMD_GESTURE_INTERRUPT
Определения EmoteManager.c:140
HumanInputController m_HIC
Определения EmoteManager.c:112
void EndCallbackCommand()
Определения EmoteManager.c:779
bool m_bEmoteIsPlaying
Определения EmoteManager.c:118
bool m_InstantCancelEmote
Определения EmoteManager.c:122
bool m_bEmoteIsRequestPending
Определения EmoteManager.c:117
void SendEmoteRequestSync(int id)
Определения EmoteManager.c:796
bool PlayEmote(int id)
Определения EmoteManager.c:588
DayZPlayer m_Player
Определения Hand_Events.c:42
proto native UIManager GetUIManager()
static const int FORCE_NONE
Определения EmoteManager.c:76
Определения EmoteManager.c:75
bool IsMenuOpen(int id)
Returns true if menu with specific ID is opened (see MenuID)
Определения UIManager.c:154
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()
const int ID_EMOTE_RPS_P
Определения 3_Game/constants.c:394
const int ID_EMOTE_RPS
Определения 3_Game/constants.c:383
const int ID_EMOTE_THUMB
Определения 3_Game/constants.c:368
const int ID_EMOTE_RPS_S
Определения 3_Game/constants.c:395
const int ID_EMOTE_SUICIDE
Определения 3_Game/constants.c:370
const int ID_EMOTE_RPS_R
Определения 3_Game/constants.c:393
const int ID_EMOTE_THUMBDOWN
Определения 3_Game/constants.c:375
const int MENU_GESTURES
Определения 3_Game/constants.c:194

Перекрестные ссылки CALLBACK_CMD_END, CALLBACK_CMD_GESTURE_INTERRUPT, CALLBACK_CMD_INSTACANCEL, CALLBACK_CMD_INVALID, ClearSurrenderState(), CommitSuicide(), CreateEmoteCBFromMenu(), DetermineGestureIndex(), EndCallbackCommand(), EmoteLauncher::FORCE_NONE, GetGame(), CGame::GetUIManager(), EmoteConstants::ID_EMOTE_RPS, EmoteConstants::ID_EMOTE_RPS_P, EmoteConstants::ID_EMOTE_RPS_R, EmoteConstants::ID_EMOTE_RPS_S, EmoteConstants::ID_EMOTE_SUICIDE, EmoteConstants::ID_EMOTE_THUMB, EmoteConstants::ID_EMOTE_THUMBDOWN, InterruptCallbackCommand(), InterruptGestureCheck(), InterruptWaterCheck(), UIManager::IsMenuOpen(), m_bEmoteIsPlaying, m_bEmoteIsRequestPending, m_Callback, m_CancelEmote, m_CurrentGestureID, m_DeferredEmoteExecution, m_EmoteLockState, m_GestureInterruptInput, m_HIC, m_InstantCancelEmote, m_IsSurrendered, m_ItemToBeCreated, m_LastMask, m_MenuEmote, m_Player, m_RPSOutcome, MENU_GESTURES, OnEmoteEnd(), PlayEmote(), PlaySurrenderInOut(), SendEmoteRequestSync() и SetEmoteLockState().