private void HitAxe() { this.Blood(); if (this.Health >= -20 || this.animator.GetBool("deathfinalBOOL")) { } if (EnemyHealth.CurrentAttacker) { SendMessageEvent sendMessageEvent = SendMessageEvent.Raise(EnemyHealth.CurrentAttacker, EntityTargets.OnlyOwner); sendMessageEvent.Message = "GotBloody"; sendMessageEvent.Send(); } else { LocalPlayer.GameObject.SendMessage("GotBloody"); } }
public void HitReal(int damage) { if (this.hitBlock || this.deadBlock) { return; } if (!base.enabled) { return; } if (this.ai.creepy || this.ai.creepy_male || this.ai.creepy_fat || this.ai.creepy_baby) { this.Health -= damage; if (this.setup.pmCombat) { this.setup.pmCombat.FsmVariables.GetFsmBool("gettingHit").Value = true; this.setup.pmCombat.SendEvent("gotHit"); base.Invoke("resetGettingHit", 1.3f); } if (this.Health < 1) { this.Die(); } else if (this.onFireEventInstance == null) { FMODCommon.PlayOneshot(this.HurtEvent, base.transform.position, new object[] { "mutant_health", this.HealthPercentage }); } return; } if (this.targetSwitcher) { this.targetSwitcher.attackerType = 4; } this.hitBlock = true; base.Invoke("hitBlockReset", 0.25f); if (this.animator.GetBool("deathBOOL")) { this.damageMult = 2; } else { this.damageMult = 1; } if (this.animator.GetBool("sleepBOOL")) { this.Health -= 100; } else { this.Health -= damage * this.damageMult; } if (this.Health <= 80 && this.Health >= 45) { this.animator.SetIntegerReflected("hurtLevelInt", 1); } if (this.Health < 45 && this.Health >= 30) { this.animator.SetIntegerReflected("hurtLevelInt", 2); } if (this.Health < 30 && this.Health >= 1 && this.animator) { this.animator.SetIntegerReflected("hurtLevelInt", 3); } base.Invoke("setMpRandInt", 1f); if (this.Health < 1) { if (this.animator) { this.animator.SetIntegerReflected("hurtLevelInt", 4); } this.setup.pmCombat.enabled = true; this.setup.pmCombat.FsmVariables.GetFsmBool("deathFinal").Value = true; if (this.onFire) { this.animator.SetBoolReflected("burning", true); this.animator.SetBoolReflected("deathBOOL", true); } if (this.animator) { this.animator.SetBoolReflected("deathfinalBOOL", true); } if (!this.doStealthKill && !this.onFire && this.animator) { this.animator.SetIntegerReflected("randInt1", UnityEngine.Random.Range(0, 8)); this.animator.SetTriggerReflected("deathTrigger"); } this.Die(); } else if (this.hitDir == 1) { if (!this.setup.ai.creepy && !this.setup.ai.creepy_male && !this.setup.ai.creepy_fat && !this.setup.ai.creepy_baby && this.setup.search.lookingForTarget && this.doStealthKill) { this.Die(); } else { if (this.animator) { if (this.onFire && !this.hitEventBlock) { this.animator.SetBoolReflected("burning", true); if (!this.animator.GetBool("trapBool")) { this.animator.SetTriggerReflected("damageTrigger"); } } else if (!this.hitEventBlock) { this.animator.SetTriggerReflected("damageBehindTrigger"); this.animator.SetBoolReflected("burning", false); } } if (this.setup.pmCombat) { if (this.onFire && !this.hitEventBlock) { this.setup.pmCombat.enabled = true; this.setup.pmCombat.FsmVariables.GetFsmBool("onFireBool").Value = true; this.setup.pmCombat.SendEvent("gotHit"); this.hitEventBlock = true; } else if (!this.onFire) { this.setup.pmCombat.SendEvent("gotHit"); this.setup.pmCombat.FsmVariables.GetFsmBool("onFireBool").Value = false; } } if (this.setup.pmSearch && this.setup.pmSearch.enabled) { this.setup.pmSearch.SendEvent("gotHit"); } if (this.setup.pmEncounter && this.setup.pmEncounter.enabled) { this.setup.pmEncounter.SendEvent("gotHit"); } } } else if (this.hitDir == 0) { this.doStealthKill = false; if (this.animator) { if (this.simplifyHitsForMp || BoltNetwork.isRunning) { this.animator.SetTriggerReflected("simpleHitTrigger"); } else if (this.onFire && !this.hitEventBlock) { this.animator.SetBoolReflected("burning", true); if (!this.animator.GetBool("trapBool")) { this.animator.SetTriggerReflected("damageTrigger"); } } else if (!this.hitEventBlock) { this.animator.SetBoolReflected("burning", false); this.animator.SetTriggerReflected("damageTrigger"); } } if (this.setup.pmCombat) { this.setup.pmCombat.enabled = true; if (this.onFire && !this.hitEventBlock) { this.setup.pmCombat.enabled = true; this.setup.pmCombat.FsmVariables.GetFsmBool("onFireBool").Value = true; this.setup.pmCombat.SendEvent("gotHit"); this.hitEventBlock = true; } else if (!this.onFire) { this.setup.pmCombat.SendEvent("gotHit"); this.setup.pmCombat.FsmVariables.GetFsmBool("onFireBool").Value = false; } } if (this.setup.pmSearch && this.setup.pmSearch.enabled) { this.setup.pmSearch.SendEvent("gotHit"); } if (this.setup.pmEncounter && this.setup.pmEncounter.enabled) { this.setup.pmEncounter.SendEvent("gotHit"); } } this.Blood(); this.RandomSplurt = UnityEngine.Random.Range(0, 10); if (!this.ai.creepy && !this.ai.creepy_male && !this.ai.maleSkinny && !this.ai.femaleSkinny && !this.ai.pale && !this.ai.creepy_fat && !this.ai.creepy_baby && !this.alreadyBurnt && this.RandomSplurt == 2) { if (this.MP.MyRandom != 0 || this.MySkin) { } if (this.MP.MyRandom != 1 || this.MySkin) { } if (this.MP.MyRandom != 2 || this.MySkin) { } if (this.MP.MyRandom != 3 || this.MySkin) { } if (EnemyHealth.CurrentAttacker) { SendMessageEvent sendMessageEvent = SendMessageEvent.Raise(EnemyHealth.CurrentAttacker, EntityTargets.OnlyOwner); sendMessageEvent.Message = "GotBloody"; sendMessageEvent.Send(); } else { LocalPlayer.GameObject.SendMessage("GotBloody"); } } }