Пример #1
0
 public override bool Hit(Bullet bullet, Vec2 hitPos)
 {
     if ((double)this._hitPoints <= 0.0)
     {
         return(false);
     }
     if (bullet.isLocal && this.owner == null)
     {
         Thing.Fondle((Thing)this, DuckNetwork.localConnection);
     }
     for (int index = 0; (double)index < 1.0 + (double)this.damageMultiplier / 2.0; ++index)
     {
         Level.Add((Thing) new GlassParticle(hitPos.x, hitPos.y, bullet.travelDirNormalized));
     }
     SFX.Play("woodHit");
     if (bullet.isLocal)
     {
         this._hitPoints       -= this.damageMultiplier;
         this.damageMultiplier += 2f;
         if (TeamSelect2.Enabled("EXPLODEYCRATES"))
         {
             if (this.duck != null)
             {
                 this.duck.ThrowItem();
             }
             this.Destroy((DestroyType) new DTShot(bullet));
             Level.Add((Thing) new GrenadeExplosion(this.x, this.y));
         }
         if ((double)this._hitPoints <= 0.0)
         {
             this.Destroy((DestroyType) new DTShot(bullet));
         }
     }
     return(base.Hit(bullet, hitPos));
 }
Пример #2
0
 public override bool Hit(Bullet bullet, Vec2 hitPos)
 {
     if (bullet.isLocal && TeamSelect2.Enabled("EXPLODEYCRATES"))
     {
         if (this.duck != null)
         {
             this.duck.ThrowItem();
         }
         this.Destroy((DestroyType) new DTShot(bullet));
         Level.Remove((Thing)this);
         Level.Add((Thing) new GrenadeExplosion(this.x, this.y));
     }
     return(base.Hit(bullet, hitPos));
 }
Пример #3
0
 public override bool Hit(Bullet bullet, Vec2 hitPos)
 {
     if ((double)this._hitPoints <= 0.0)
     {
         return(base.Hit(bullet, hitPos));
     }
     if (bullet.isLocal && this.owner == null)
     {
         Thing.Fondle((Thing)this, DuckNetwork.localConnection);
     }
     for (int index = 0; (double)index < 1.0 + (double)this.damageMultiplier / 2.0; ++index)
     {
         Thing thing = (Thing)WoodDebris.New(hitPos.x, hitPos.y);
         thing.hSpeed = (float)(-(double)bullet.travelDirNormalized.x * 2.0 * ((double)Rando.Float(1f) + 0.300000011920929));
         thing.vSpeed = (float)(-(double)bullet.travelDirNormalized.y * 2.0 * ((double)Rando.Float(1f) + 0.300000011920929)) - Rando.Float(2f);
         Level.Add(thing);
     }
     SFX.Play("woodHit");
     if (bullet.isLocal && TeamSelect2.Enabled("EXPLODEYCRATES"))
     {
         Thing.Fondle((Thing)this, DuckNetwork.localConnection);
         if (this.duck != null)
         {
             this.duck.ThrowItem();
         }
         this.Destroy((DestroyType) new DTShot(bullet));
         Level.Add((Thing) new GrenadeExplosion(this.x, this.y));
     }
     if (bullet.isLocal)
     {
         this._hitPoints       -= this.damageMultiplier;
         this.damageMultiplier += 2f;
     }
     if ((double)this._hitPoints <= 0.0)
     {
         this.Destroy((DestroyType) new DTShot(bullet));
     }
     return(base.Hit(bullet, hitPos));
 }