Пример #1
0
 public void enableNitrogenExplosion()
 {
     if (this.nitrogenActive)
     {
         return;
     }
     this.nitrogenActive = true;
     if (BoltNetwork.isRunning && BoltNetwork.isClient)
     {
         BoltEntity component = this.parentGo.GetComponent <BoltEntity>();
         if (component && component.isAttached)
         {
             SendMessageEvent sendMessageEvent = SendMessageEvent.Create(GlobalTargets.OnlyServer);
             sendMessageEvent.Target  = component;
             sendMessageEvent.Message = "enableNitrogenExplosion";
             sendMessageEvent.Send();
         }
     }
     this.flameGo.SetActive(true);
     if (!BoltNetwork.isClient)
     {
         Rigidbody component2 = this.parentGo.GetComponent <Rigidbody>();
         if (component2)
         {
             component2.isKinematic = false;
             component2.useGravity  = true;
         }
         this.spawnedBomb = UnityEngine.Object.Instantiate <GameObject>(this.ExplodeGo, base.transform.position, base.transform.rotation);
         this.spawnedBomb.SendMessage("setWaitTime", this.waitTime, SendMessageOptions.DontRequireReceiver);
         base.Invoke("CleanUp", (float)this.waitTime);
     }
     this.nitrogenActive = true;
 }
Пример #2
0
 private void Explosion()
 {
     if (BoltNetwork.isRunning && this.entity.IsAttached())
     {
         SendMessageEvent sendMessageEvent = SendMessageEvent.Create(GlobalTargets.OnlyServer);
         sendMessageEvent.Target  = this.entity;
         sendMessageEvent.Message = "ExplosionReal";
         sendMessageEvent.Send();
     }
     else
     {
         this.ExplosionReal();
     }
 }
Пример #3
0
 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");
     }
 }
Пример #4
0
 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");
         }
     }
 }
Пример #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("SmallTree") && this.CanHit && this.FireStick)
     {
         other.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
     }
     if ((other.gameObject.CompareTag("enemyCollide") || other.gameObject.CompareTag("animalCollide")) && this.CanHit)
     {
         this.CanHit = false;
         base.Invoke("ResetCanHit", this.DelayAmount);
         if (this.Stick)
         {
             other.SendMessage("Hit", SendMessageOptions.DontRequireReceiver);
             if (base.GetComponent <AudioSource>())
             {
                 base.GetComponent <AudioSource>().Play();
             }
         }
         if (this.Rock)
         {
             other.SendMessage("Hit", SendMessageOptions.DontRequireReceiver);
             if (base.GetComponent <AudioSource>())
             {
                 base.GetComponent <AudioSource>().Play();
             }
         }
         if (this.FireStick)
         {
             if (BoltNetwork.isRunning)
             {
                 BoltEntity componentInParent = other.GetComponentInParent <BoltEntity>();
                 if (componentInParent && !componentInParent.isOwner)
                 {
                     SendMessageEvent sendMessageEvent  = SendMessageEvent.Create(componentInParent, EntityTargets.OnlyOwner);
                     SendMessageEvent sendMessageEvent2 = SendMessageEvent.Create(componentInParent, EntityTargets.OnlyOwner);
                     sendMessageEvent2.Message = "Douse";
                     sendMessageEvent2.Target  = componentInParent;
                     sendMessageEvent2.Send();
                     sendMessageEvent.Message = "Burn";
                     sendMessageEvent.Target  = componentInParent;
                     sendMessageEvent.Send();
                 }
                 else
                 {
                     other.SendMessage("Douse", SendMessageOptions.DontRequireReceiver);
                     other.transform.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
                 }
             }
             else
             {
                 other.SendMessage("Douse", SendMessageOptions.DontRequireReceiver);
                 other.transform.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
             }
             if (base.GetComponent <AudioSource>())
             {
                 base.GetComponent <AudioSource>().Play();
             }
         }
         if (this.FlameThrower)
         {
             other.SendMessage("Douse", SendMessageOptions.DontRequireReceiver);
             other.SendMessage("Burn", SendMessageOptions.DontRequireReceiver);
         }
         if (this.Axe)
         {
             other.SendMessage("HitAxe", SendMessageOptions.DontRequireReceiver);
             if (base.GetComponent <AudioSource>())
             {
                 base.GetComponent <AudioSource>().Play();
             }
         }
     }
     if (other.gameObject.CompareTag("Tree") && this.CanHit && this.Swung && this.Axe)
     {
         this.CanHit = false;
         base.Invoke("ResetCanHit", this.DelayAmount);
         if (base.GetComponent <AudioSource>())
         {
             this.Audio.SendMessage("PlayAxeHit");
         }
         other.SendMessage("Hit");
     }
 }