public override void Collide(GameNode node)
        {
            ParticleEffects.TriggerExplosionSquaresSmall(this.Position);
            this.TakeDamage(node.Health, node);

            //if (Player.AIControlled)
            //    node.TakeDamage((int)(this.Damage / 2), this);
            //else
                node.TakeDamage(this.Damage, this);
        }
示例#2
0
        private void LaserDamage(TimeSpan gameTime, GameNode target)
        {
            if (Player.Ship != null && target != null)
            {
                laserDamageTime += (float)gameTime.TotalSeconds;
                                                
                if (laserDamageTime >= 0.25)
                {
                    target.TakeDamage(5, Player.Ship);
                }

                if (target.Dead == true || target.Health <= 0)
                {
                    Player.Ship.laserDefence--;
                    ParticleEffects.TriggerExplosionSquaresSmall(target.Position);
                }
            }

            if (laserDamageTime >= 0.25)
            {
                laserDamageTime = 0;
            }
        }
        public override void Collide(GameNode node)
        {
            if (!this.parentShip.Invulnerable && !node.Invulnerable)
            {
                int nodeHealth = node.Health;

                if (this.Health < 0)
                    this.Health = 0;

                if (this.Health > 0)
                {
                    node.TakeDamage(this.Health, this);
                    this.TakeDamage(nodeHealth, node);

                    base.Collide(node);
                }
            }
        }
        public override void Collide(GameNode node)
        {
            if (Player.EnemyPlayer != null && !Player.EnemyPlayer.isInvulnerable && !node.Invulnerable)
            {
                int nodeHealth = node.Health;

                if (this.Health < 0)
                    this.Health = 0;

                if (this.Health > 0)
                {
                    node.TakeDamage(this.Health, this);
                    this.TakeDamage(nodeHealth, node);

                    base.Collide(node);
                }
            }
        }
 public override void Collide(GameNode node)
 {
     ParticleEffects.TriggerExplosionSquaresSmall(this.Position);
     this.TakeDamage(node.Health, node);
     node.TakeDamage(this.Damage, this);
 }
示例#6
0
 public override void Collide(GameNode node)
 {
     int nodeHealth = node.Health;
     node.TakeDamage(this.Health, this);
     this.TakeDamage(nodeHealth, node);
 }