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

◆ CommitSuicide()

void CommitSuicide ( )
protected

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

776 {
777 Weapon_Base weapon;
778 WeaponEventBase weapon_event = new WeaponEventTrigger;
779
780 if (Weapon_Base.CastTo(weapon,m_Player.GetItemInHands()))
781 {
782 if (weapon.CanFire())
783 {
784 m_Callback.RegisterAnimationEvent("Simulation_End",EmoteConstants.EMOTE_SUICIDE_SIMULATION_END);
785 m_Player.SetSuicide(true);
786 weapon.ProcessWeaponEvent(weapon_event);
787 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
788 if (m_Player.IsAlive())
789 {
790 EntityAI helm = m_Player.FindAttachmentBySlotName("Headgear");
791 if (helm && g_Game.IsServer())
792 {
793 float damage = helm.GetMaxHealth("","");
794 helm.AddHealth("","", -damage/2);
795 }
796 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(this.KillPlayer);
797 if (m_AdminLog)
798 {
799 m_AdminLog.Suicide(m_Player);
800 }
801 }
802 }
803 else
804 {
805 if (!weapon.IsDamageDestroyed())
806 {
807 weapon.ProcessWeaponEvent(weapon_event);
808 }
809 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
810 }
811 }
812 else if (m_Player.GetItemInHands() && m_Player.GetItemInHands().ConfigIsExisting("suicideAnim"))
813 {
814 m_Callback.RegisterAnimationEvent("Death",EmoteConstants.EMOTE_SUICIDE_DEATH);
815 m_Callback.RegisterAnimationEvent("Bleed",EmoteConstants.EMOTE_SUICIDE_BLEED);
816 m_Callback.RegisterAnimationEvent("Simulation_End",EmoteConstants.EMOTE_SUICIDE_SIMULATION_END);
817 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
818 m_Player.SetSuicide(true);
819 }
820 else
821 {
822 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
823 }
824 }
map m_Player
DayZGame g_Game
Определения DayZGame.c:3942
EmoteCB m_Callback
Определения EmoteManager.c:125
PluginAdminLog m_AdminLog
Определения EmoteManager.c:159
void KillPlayer()
Определения EmoteManager.c:826
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:410
const int EMOTE_SUICIDE_BLEED
Определения 3_Game/DayZ/constants.c:409
const int EMOTE_SUICIDE_DEATH
Определения 3_Game/DayZ/constants.c:408
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.

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