Exemple #1
0
 protected override void HandleCollision(ICollidable c2)
 {
     if (c2 is Enemy && Team != EntityConstants.GetStatsFromID(EntityConstants.TEAM, IDs.DEFAULT_ENEMY) || c2 is Player && Team == EntityConstants.GetStatsFromID(EntityConstants.TEAM, IDs.DEFAULT_ENEMY) || c2 is Wall)
     {
         Particles.GenerateDeathParticles(Sprite, Position, 2, Angle, false);
     }
     base.HandleCollision(c2);
 }
        protected override void HandleCollision(ICollidable c2)
        {
            if (c2 is Player)
            {
                Player p = (c2 as Player);
                if (Team == EntityConstants.GetStatsFromID(EntityConstants.TEAM, IDs.DEFAULT_ENEMY))
                {
                    p.Health -= Damage * Difficulty.ENEMY_BULLETDAMAGEFACTOR;///5; ///!! times FACTOR
                    Camera.Shake(Damage);
                }
            }

            if (c2 is Enemy)
            {
                if (Team != EntityConstants.GetStatsFromID(EntityConstants.TEAM, IDs.DEFAULT_ENEMY))
                {
                    if (this.id == IDs.CHARGINGBULLET)
                    {
                        if (c2 != prevC2 || hitMeBbyOneMoreTime.IsFinished)
                        {
                            Enemy e = c2 as Enemy;
                            e.Health -= Damage;
                            Traits.SHOTSHIT.Counter++;
                            prevC2 = e;
                            hitMeBbyOneMoreTime.Reset();
                        }
                    }
                    else
                    {
                        Enemy e = c2 as Enemy;
                        e.Health -= Damage;
                        e.AddForce(Velocity * Velocity.Length() / 2 * Mass / e.Hull.Mass); //! remove lator
                        Traits.SHOTSHIT.Counter++;
                    }
                }
            }
            if (Health <= 0)
            {
                Death();
            }
        }
Exemple #3
0
 public override void Death()
 {
     Health = EntityConstants.GetStatsFromID(EntityConstants.HEALTH, IDs.DEFAULT_BULLET);
     base.Death();
 }
 public override void SetStats(IDs id)
 {
     Damage = EntityConstants.GetStatsFromID(EntityConstants.DAMAGE, id);
     Health = EntityConstants.GetStatsFromID(EntityConstants.HEALTH, id);
     base.SetStats(id);
 }