コード例 #1
0
 private void Hit(int damage)
 {
     if (!this.animator)
     {
         this.animator = base.transform.GetComponentInParent <Animator>();
     }
     if (this.animator && this.animator.GetCurrentAnimatorStateInfo(0).shortNameHash == Scene.animHash.nooseTrapDeathHash)
     {
         return;
     }
     if (this.ignoreHit)
     {
         this.ignoreHit = false;
         return;
     }
     if (this.infected)
     {
         LocalPlayer.Stats.BloodInfection.TryGetInfected();
     }
     if (base.entity.IsAttached())
     {
         HitCorpse hitCorpse = HitCorpse.Create(GlobalTargets.OnlyServer);
         hitCorpse.Entity        = base.entity;
         hitCorpse.Damage        = damage;
         hitCorpse.BodyPartIndex = base.GetComponentInParent <CoopSliceAndDiceMutant>().GetBodyPartIndex(this);
         hitCorpse.Send();
         if (!base.entity.isOwner)
         {
             this.DoLocalCut(this.Health - damage);
         }
     }
     else
     {
         this.DoLocalCut(this.Health - damage);
     }
 }
コード例 #2
0
 private void Hit(int damage)
 {
     if (this.ignoreHit)
     {
         this.ignoreHit = false;
         return;
     }
     if (this.infected)
     {
         LocalPlayer.Stats.BloodInfection.TryGetInfected();
     }
     if (this.entity.IsAttached())
     {
         HitCorpse hitCorpse = HitCorpse.Create(GlobalTargets.OnlyServer);
         hitCorpse.Entity        = this.entity;
         hitCorpse.Damage        = damage;
         hitCorpse.BodyPartIndex = base.GetComponentInParent <CoopSliceAndDiceMutant>().GetBodyPartIndex(this);
         hitCorpse.Send();
     }
     else
     {
         this.DoLocalCut(this.Health - damage);
     }
 }