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

◆ CommitSuicide()

void CommitSuicide ( )
protected

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

686 {
687 Weapon_Base weapon;
688 WeaponEventBase weapon_event = new WeaponEventTrigger;
689
690 if (Weapon_Base.CastTo(weapon,m_Player.GetItemInHands()))
691 {
692 if (weapon.CanFire())
693 {
694 m_Callback.RegisterAnimationEvent("Simulation_End",EmoteConstants.EMOTE_SUICIDE_SIMULATION_END);
695 m_Player.SetSuicide(true);
696 weapon.ProcessWeaponEvent(weapon_event);
697 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
698 if (m_Player.IsAlive())
699 {
700 EntityAI helm = m_Player.FindAttachmentBySlotName("Headgear");
701 if (helm && GetGame().IsServer())
702 {
703 float damage = helm.GetMaxHealth("","");
704 helm.AddHealth("","", -damage/2);
705 }
707 if (m_AdminLog)
708 {
709 m_AdminLog.Suicide(m_Player);
710 }
711 }
712 }
713 else
714 {
715 if (!weapon.IsDamageDestroyed())
716 {
717 weapon.ProcessWeaponEvent(weapon_event);
718 }
719 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
720 }
721 }
722 else if (m_Player.GetItemInHands() && m_Player.GetItemInHands().ConfigIsExisting("suicideAnim"))
723 {
724 m_Callback.RegisterAnimationEvent("Death",EmoteConstants.EMOTE_SUICIDE_DEATH);
725 m_Callback.RegisterAnimationEvent("Bleed",EmoteConstants.EMOTE_SUICIDE_BLEED);
726 m_Callback.RegisterAnimationEvent("Simulation_End",EmoteConstants.EMOTE_SUICIDE_SIMULATION_END);
727 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
728 m_Player.SetSuicide(true);
729 }
730 else
731 {
732 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_FINISH);
733 }
734 }
EmoteCB m_Callback
Определения EmoteManager.c:111
PluginAdminLog m_AdminLog
Определения EmoteManager.c:142
void KillPlayer()
Определения EmoteManager.c:736
DayZPlayer m_Player
Определения Hand_Events.c:42
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
Определения constants.c:359
Определения Building.c:6
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
shorthand
Определения BoltActionRifle_Base.c:6
signalize mechanism manipulation
Определения Events.c:35
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()
const int EMOTE_SUICIDE_SIMULATION_END
Определения constants.c:410
const int EMOTE_SUICIDE_BLEED
Определения constants.c:409
const int EMOTE_SUICIDE_DEATH
Определения constants.c:408
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10

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

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