Ejemplo n.º 1
0
        public virtual void ApplyDamage(Projectile projectile, Vector3 impulseVector)
        {
            physicsState.velocity += impulseVector;
            health -= projectile.GetDamage();

            if (health <= 0.0)
            {
                OnDeath();
            }

            colorTime = HIT_COLOR_TIME;
            blendColor = HIT_COLOR;
        }
Ejemplo n.º 2
0
 public override void ApplyDamage(Projectile projectile, Vector3 impulseVector)
 {
     hitFlashTimer = 1;
     base.ApplyDamage(projectile, impulseVector);
 }
Ejemplo n.º 3
0
        protected void FireGun(Vector3 forwardVector)
        {
            if (delayTime > 0.0)
                return;

            delayTime = ATTACK_DELAY_TIME + ATTACK_DELAY_TIME * (explosionMagnitude - 1) / Projectile.EXPLOSION_MAX_MAGNITUDE;

            if (projectile == null)
                CreateProjectile();
            projectile.SetVelocity(forwardVector);

            projectile.SetMagnitude(explosionMagnitude);

            projectile = null;
        }
Ejemplo n.º 4
0
 public override void ApplyDamage(Projectile projectile, Vector3 impulseVector)
 {
     Actor sender = projectile.GetSender();
     if (sender.GetTeam() != this.GetTeam() && !sender.IsDead())
     {
         if (enemy != null)
         {
             enemy = (enemy.GetHealth() <= sender.GetHealth()) ? enemy : sender;
         }
         else
         {
             enemy = sender;
         }
     }
     base.ApplyDamage(projectile, impulseVector);
 }
Ejemplo n.º 5
0
 protected void CreateProjectile()
 {
     projectile = new Projectile(this, "TracerParticle", "ExplosionParticle");
     projectile.Transformation.SetPosition(physicsState.position);
     projectile.Transformation.SetRotation(rotation);
     this.scene.Entities.Add(projectile);
     projectile.OnAdd(this.scene);
 }