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

◆ CanPlayEmote()

bool CanPlayEmote ( int id)
protected

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

1060 {
1061 //special cases
1063 {
1064 return true;
1065 }
1066
1067 if (!m_Player || !m_Player.IsAlive() || (!IsEmotePlaying() && (m_Player.GetCommand_Action() || m_Player.GetCommandModifier_Action())) || m_Player.GetThrowing().IsThrowingModeEnabled())
1068 {
1069 return false;
1070 }
1071
1072 ItemBase item = m_Player.GetItemInHands();
1073 if (item)
1074 {
1075 if (item.IsHeavyBehaviour() && id != EmoteConstants.ID_EMOTE_SURRENDER)
1076 {
1077 return false;
1078 }
1079
1080 SurrenderDummyItem sda;
1081 if (m_Player.IsItemsToDelete() && Class.CastTo(sda,item) && !sda.IsSetForDeletion())
1082 {
1083 return false;
1084 }
1085 }
1086
1087 if ((m_Player.GetWeaponManager() && m_Player.GetWeaponManager().IsRunning()) || (m_Player.GetActionManager() && m_Player.GetActionManager().GetRunningAction()))
1088 {
1089 return false;
1090 }
1091
1092 if (m_HIC.IsWeaponRaised() || m_Player.IsRolling() || m_Player.IsClimbing() || m_Player.IsRestrainStarted() || m_Player.IsFighting() || m_Player.IsSwimming() || m_Player.IsClimbingLadder() || m_Player.IsFalling() || m_Player.IsUnconscious() || m_Player.IsJumpInProgress() || m_Player.IsRestrained()) // rework conditions into something better?
1093 {
1094 return false;
1095 }
1096
1097 if (m_Player.GetCommand_Vehicle())
1098 {
1099 return false;
1100 }
1101
1102 HumanCommandMove cm = m_Player.GetCommand_Move();
1103 if (cm)
1104 {
1105 if (cm.IsOnBack() && id != EmoteConstants.ID_EMOTE_SURRENDER)
1106 return false;
1107 if (cm.IsChangingStance())
1108 return false;
1109 }
1110
1111 //"locks" player in surrender state
1113 {
1114 return false;
1115 }
1116
1117 if (m_Player.GetDayZPlayerInventory().IsProcessing())
1118 {
1119 return false;
1120 }
1121
1122 EmoteBase emote;
1123 if (m_NameEmoteMap.Find(id,emote))
1124 {
1125 int callback_ID;
1126 int stancemask;
1127 bool is_fullbody;
1128 if (DetermineEmoteData(emote,callback_ID,stancemask,is_fullbody) && emote.EmoteCondition(stancemask))
1129 {
1130 return true;
1131 }
1132 }
1133
1134 return false;
1135 }
map m_Player
const int CALLBACK_CMD_END
Определения EmoteManager.c:156
const int CALLBACK_CMD_INSTACANCEL
Определения EmoteManager.c:158
bool IsEmotePlaying()
Определения EmoteManager.c:1370
bool DetermineEmoteData(EmoteBase emote, out int callback_ID, out int stancemask, out bool is_fullbody)
Also includes a stance check for FB callbacks.
Определения EmoteManager.c:269
bool m_IsSurrendered
Определения EmoteManager.c:133
const int CALLBACK_CMD_GESTURE_INTERRUPT
Определения EmoteManager.c:157
ref map< int, ref EmoteBase > m_NameEmoteMap
Определения EmoteManager.c:162
HumanInputController m_HIC
Определения EmoteManager.c:126
Super root of all classes in Enforce script.
Определения EnScript.c:11
bool EmoteCondition(int stancemask)
Определения EmoteBase.c:12
Определения EmoteBase.c:2
proto native bool IsOnBack()
return true if prone is on back
proto native bool IsChangingStance()
returns true if character is changing stance
Определения human.c:434
const int ID_EMOTE_SURRENDER
Определения 3_Game/DayZ/constants.c:399
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки CALLBACK_CMD_END, CALLBACK_CMD_GESTURE_INTERRUPT, CALLBACK_CMD_INSTACANCEL, Class::CastTo(), DetermineEmoteData(), EmoteBase::EmoteCondition(), EmoteConstants::ID_EMOTE_SURRENDER, HumanCommandMove::IsChangingStance(), IsEmotePlaying(), HumanCommandMove::IsOnBack(), m_HIC, m_IsSurrendered и m_NameEmoteMap.

Используется в OnInputUserDataProcess(), SendEmoteRequestSync() и SendEmoteRequestSyncEx().