Example #1
0
 void DamageLiving(ExplosionSite site, Bomb bomb)
 {
     foreach (Living x in Globals.BlobManager.GetLifeBehaviours())
     {
         if (Globals.Level.IsPathBlocked(site.position, x.transform.position))
         {
             // in cover
             continue;
         }
         float d   = (x.transform.position - site.position).magnitude;
         float dmg = bomb.ComputeDamage(d);
         if (bomb.IsPlayerBomb == (x == Globals.Player.living))
         {
             dmg *= x.FriendlyFireMult;
         }
         if (dmg > 0)
         {
             x.Health -= dmg;
         }
     }
 }