Exemplo n.º 1
0
 // Token: 0x060018BA RID: 6330 RVA: 0x0008A1AC File Offset: 0x000885AC
 public void askDamage(byte amount, Vector3 newRagdoll, out EPlayerKill kill, out uint xp, bool trackKill = true)
 {
     kill = EPlayerKill.NONE;
     xp   = 0u;
     if (amount == 0 || this.isDead)
     {
         return;
     }
     if (!this.isDead)
     {
         if ((ushort)amount >= this.health)
         {
             this.health = 0;
         }
         else
         {
             this.health -= (ushort)amount;
         }
         this.ragdoll = newRagdoll;
         if (this.health == 0)
         {
             kill = EPlayerKill.ANIMAL;
             if (this.asset != null)
             {
                 xp = this.asset.rewardXP;
             }
             AnimalManager.dropLoot(this);
             AnimalManager.sendAnimalDead(this, this.ragdoll);
             if (trackKill)
             {
                 for (int i = 0; i < Provider.clients.Count; i++)
                 {
                     SteamPlayer steamPlayer = Provider.clients[i];
                     if (!(steamPlayer.player == null) && !(steamPlayer.player.movement == null) && !(steamPlayer.player.life == null) && !steamPlayer.player.life.isDead)
                     {
                         if ((steamPlayer.player.transform.position - base.transform.position).sqrMagnitude < 262144f)
                         {
                             steamPlayer.player.quests.trackAnimalKill(this);
                         }
                     }
                 }
             }
         }
         else if (this.asset != null && this.asset.panics != null && this.asset.panics.Length > 0)
         {
             AnimalManager.sendAnimalPanic(this);
         }
         this.lastRegen = Time.time;
     }
 }
Exemplo n.º 2
0
 public void askDamage(byte amount, Vector3 newRagdoll, out EPlayerKill kill, out uint xp)
 {
     kill = EPlayerKill.NONE;
     xp   = 0u;
     if (amount == 0 || this.isDead)
     {
         return;
     }
     if (!this.isDead)
     {
         if ((ushort)amount >= this.health)
         {
             this.health = 0;
         }
         else
         {
             this.health -= (ushort)amount;
         }
         this.ragdoll = newRagdoll;
         if (this.health == 0)
         {
             kill = EPlayerKill.ANIMAL;
             if (this.asset != null)
             {
                 xp = this.asset.rewardXP;
             }
             AnimalManager.dropLoot(this);
             AnimalManager.sendAnimalDead(this, this.ragdoll);
         }
         else if (this.asset != null && this.asset.panics != null && this.asset.panics.Length > 0)
         {
             AnimalManager.sendAnimalPanic(this);
         }
         this.lastRegen = Time.time;
     }
 }