DayZ 1.27
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 (!m_Player.GetItemInHands() && GetGame().IsServer())
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 SetEmoteLockState(false);
309 }
310 else if (m_CancelEmote) //'soft' cancel
311 {
312 if (m_IsSurrendered)
313 {
315 }
316 else if (m_Callback)
317 {
318 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_INTERRUPT);
319 }
320
322 m_CancelEmote = false;
323 }
324
325 if (m_MenuEmote && m_MenuEmote.GetForced() > EmoteLauncher.FORCE_NONE && !GetGame().IsDedicatedServer()) //forced emote playing
326 {
328 }
329 else if (m_Callback)
330 {
331 bool uiGesture = false;
332 if (!GetGame().IsDedicatedServer())
333 {
335
337 {
339 }
340
342 {
344 }
345 }
346
347 if (gestureSlot > 0 || m_GestureInterruptInput || (m_HIC.IsSingleUse() && !uiGesture) || (m_HIC.IsContinuousUseStart() && !uiGesture) || (m_Callback.m_IsFullbody && !uiGesture && m_HIC.IsWeaponRaised()))
348 {
350 {
351 if (m_Callback.GetState() == m_Callback.STATE_LOOP_LOOP)
352 {
354 }
355 else
356 {
357 return;
358 }
359 }
361 {
362 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_ACTION);
363 }
365 {
366 if (m_RPSOutcome != -1)
367 {
368 if (m_RPSOutcome == 0)
369 {
370 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_ROCK);
371 }
372 else if (m_RPSOutcome == 1)
373 {
374 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_PAPER);
375 }
376 else if (m_RPSOutcome == 2)
377 {
378 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_SCISSORS);
379 }
380 m_RPSOutcome = -1;
381 }
382 else
383 {
384 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
385 }
386 }
388 {
390 }
392 {
394 }
395 }
396
397 if (m_LastMask != -1 && m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_PRONE))
398 {
399 m_Callback.Cancel();
400 }
401
403 {
405 }
406
408 {
410 }
411
413 {
415 }
416 }
417 //no m_Callback exists
418 else
419 {
420 if (m_bEmoteIsRequestPending && (m_Player.IsUnconscious() || !m_Player.IsAlive()))
421 {
423 }
424
426 {
427 OnEmoteEnd();
428 }
429 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
430 {
431 PlaySurrenderInOut(false);
432 return;
433 }
434 // getting out of surrender state - hard cancel
435 else if (m_IsSurrendered && (m_HIC.IsSingleUse() || m_HIC.IsContinuousUseStart() || m_HIC.IsWeaponRaised()))
436 {
437 if (m_Player.GetItemInHands())
438 m_Player.GetItemInHands().DeleteSafe();//Note, this keeps item 'alive' until it is released by all the systems (inventory swapping etc.)
439 return;
440 }
441 // fallback in case lock does not end properly
442 else if (m_IsSurrendered && (!m_Player.GetItemInHands() || (m_Player.GetItemInHands() && m_Player.GetItemInHands().GetType() != "SurrenderDummyItem" && m_EmoteLockState)))
443 {
444 m_IsSurrendered = false;
445 SetEmoteLockState(false);
446 return;
447 }
448 //actual emote launch
450 {
452 }
453 //client-side emote launcher
454 else if (!m_bEmoteIsPlaying && m_MenuEmote && !GetGame().IsDedicatedServer())
455 {
457 }
458 else if (!m_MenuEmote && gestureSlot > 0)
459 {
460 CreateEmoteCBFromMenu(gestureSlot,true); //translation no longer needed
461 }
462 }
463 }
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:757
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:767
int m_LastMask
Определения EmoteManager.c:135
void PlaySurrenderInOut(bool state)
Определения EmoteManager.c:979
int DetermineGestureIndex()
Определения EmoteManager.c:234
void CommitSuicide()
Определения EmoteManager.c:685
bool m_GestureInterruptInput
Определения EmoteManager.c:123
const int CALLBACK_CMD_INSTACANCEL
Определения EmoteManager.c:141
void OnEmoteEnd()
Определения EmoteManager.c:465
void EndSurrenderRequest(SurrenderData data=null)
directly force-ends surrender state from outside of normal flow
Определения EmoteManager.c:1070
void SetEmoteLockState(bool state)
Определения EmoteManager.c:1014
ref EmoteLauncher m_MenuEmote
Определения EmoteManager.c:116
bool InterruptGestureCheck()
Определения EmoteManager.c:1092
bool InterruptWaterCheck()
Определения EmoteManager.c:1121
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:777
bool m_bEmoteIsPlaying
Определения EmoteManager.c:118
bool m_InstantCancelEmote
Определения EmoteManager.c:122
bool m_bEmoteIsRequestPending
Определения EmoteManager.c:117
void SendEmoteRequestSync(int id)
Определения EmoteManager.c:794
bool PlayEmote(int id)
Определения EmoteManager.c:586
DayZPlayer m_Player
Определения Hand_Events.c:42
proto native UIManager GetUIManager()
Определения constants.c:359
static const int FORCE_NONE
Определения EmoteManager.c:76
Определения EmoteManager.c:75
Определения EmoteManager.c:1192
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
Определения constants.c:394
const int ID_EMOTE_RPS
Определения constants.c:383
const int ID_EMOTE_THUMB
Определения constants.c:368
const int ID_EMOTE_RPS_S
Определения constants.c:395
const int ID_EMOTE_SUICIDE
Определения constants.c:370
const int ID_EMOTE_RPS_R
Определения constants.c:393
const int ID_EMOTE_THUMBDOWN
Определения constants.c:375
const int MENU_GESTURES
Определения constants.c:194

Перекрестные ссылки CALLBACK_CMD_END, CALLBACK_CMD_GESTURE_INTERRUPT, CALLBACK_CMD_INSTACANCEL, CALLBACK_CMD_INVALID, CommitSuicide(), CreateEmoteCBFromMenu(), DetermineGestureIndex(), EndCallbackCommand(), EndSurrenderRequest(), 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().