Пример #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;
        }
Пример #2
0
 public override void ApplyDamage(Projectile projectile, Vector3 impulseVector)
 {
     hitFlashTimer = 1;
     base.ApplyDamage(projectile, impulseVector);
 }
Пример #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;
        }
Пример #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);
 }
Пример #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);
 }