Esempio n. 1
0
 public void collideWith(Enemy e)
 {
     if (e != null)
     {
         e.health -= damagePerSecond;
         if (e.health <= 0)
         {
             e.dieFromHero(hero);
         }
     }
 }
Esempio n. 2
0
 public override void AffectEnemy(Enemy e, float secondsPassed)
 {
     e.hitBy(hero, DAMAGE_PER_SECOND * secondsPassed);
 }
Esempio n. 3
0
 public override void AffectEnemy(Enemy e, float secondsPassed)
 {
     e.globalMoveSpeedMultiplier -= SLOWING_FACTOR;
 }
Esempio n. 4
0
 public EnemyMemento(Enemy target)
 {
     Target = target;
     state = target.state;
     AItarget = target.targetedAI.Target;
     position = target.position;
     health = target.health;
     direction = target.direction;
     rotation = target.rotation;
     dying = target.dying;
     deathEmitterMemento = target.deathEmitter.GenerateMementoFromCurrentFrame();
 }
Esempio n. 5
0
 public void hitBy(Enemy e, float damage)
 {
     if (RetroGame.INVINCIBILITY)
         return;
     health -= damage;
     if (health <= 0)
     {
         if (attemptDie())
         {
             playerPrisoner = new PlayerPrisoner(this, levelX, levelY, tileX, tileY);
             RetroGame.EscapeScreen.levelManager.levels[levelX, levelY].prisoners.Add(playerPrisoner);
             return;
         }
     }
     SoundManager.PlaySoundOnce("PlayerHit", playInReverseDuringReverse: true);
     flashWithColor(Color.Red.withAlpha(150), 2, 0.5f);
 }
Esempio n. 6
0
 // What does this shield do to the enemy?
 public abstract void AffectEnemy(Enemy e, float secondsPassed);
Esempio n. 7
0
        public void collideWith(Enemy e)
        {
            if (e != null)
            {
                if (dying)
                    return;
                e.hitBy(gunPowerup.hero, damage);
                SoundManager.PlaySoundOnce("EnemyHit", playInReverseDuringReverse: true);
                if (phasing)
                    enemiesAlreadyHit.Add(e);
            }

            if (phasing && e == null)
            {
            }
            else
            {
                explosionEmitter.position = position;
                explosionEmitter.particlesEmitted = 0;
                explosionEmitter.active = true;
                trailEmitter.active = false;
            }

            if (!phasing)
            {
                dying = true;
            }
        }