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

◆ CommitSuicide()

void CommitSuicide ( )
protected

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

743 {
744 Weapon_Base weapon;
745 WeaponEventBase weapon_event = new WeaponEventTrigger;
746
747 if (Weapon_Base.CastTo(weapon,m_Player.GetItemInHands()))
748 {
749 if (weapon.CanFire())
750 {
751 m_Callback.RegisterAnimationEvent("Simulation_End",EmoteConstants.EMOTE_SUICIDE_SIMULATION_END);
752 m_Player.SetSuicide(true);
753 weapon.ProcessWeaponEvent(weapon_event);
754 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
755 if (m_Player.IsAlive())
756 {
757 EntityAI helm = m_Player.FindAttachmentBySlotName("Headgear");
758 if (helm && g_Game.IsServer())
759 {
760 float damage = helm.GetMaxHealth("","");
761 helm.AddHealth("","", -damage/2);
762 }
763 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(this.KillPlayer);
764 if (m_AdminLog)
765 {
766 m_AdminLog.Suicide(m_Player);
767 }
768 }
769 }
770 else
771 {
772 if (!weapon.IsDamageDestroyed())
773 {
774 weapon.ProcessWeaponEvent(weapon_event);
775 }
776 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
777 }
778 }
779 else if (m_Player.GetItemInHands() && m_Player.GetItemInHands().ConfigIsExisting("suicideAnim"))
780 {
781 m_Callback.RegisterAnimationEvent("Death",EmoteConstants.EMOTE_SUICIDE_DEATH);
782 m_Callback.RegisterAnimationEvent("Bleed",EmoteConstants.EMOTE_SUICIDE_BLEED);
783 m_Callback.RegisterAnimationEvent("Simulation_End",EmoteConstants.EMOTE_SUICIDE_SIMULATION_END);
784 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
785 m_Player.SetSuicide(true);
786 }
787 else
788 {
789 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
790 }
791 }
DayZGame g_Game
Определения DayZGame.c:4074
EmoteCB m_Callback
Определения EmoteManager.c:120
PluginAdminLog m_AdminLog
Определения EmoteManager.c:152
void KillPlayer()
Определения EmoteManager.c:793
DayZPlayer m_Player
Определения Hand_Events.c:42
shorthand
Определения BoltActionRifle_Base.c:6
signalize mechanism manipulation
Определения Events.c:35
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
const int EMOTE_SUICIDE_SIMULATION_END
Определения 3_Game/DayZ/constants.c:418
const int EMOTE_SUICIDE_BLEED
Определения 3_Game/DayZ/constants.c:417
const int EMOTE_SUICIDE_DEATH
Определения 3_Game/DayZ/constants.c:416
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/DayZ/tools/tools.c:10

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, EmoteConstants::EMOTE_SUICIDE_BLEED, EmoteConstants::EMOTE_SUICIDE_DEATH, EmoteConstants::EMOTE_SUICIDE_SIMULATION_END, g_Game, KillPlayer(), m_AdminLog, m_Callback и m_Player.

Используется в RequestCommitSuicide() и Update().