Class EnemySystem

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, com.esotericsoftware.kryo.KryoSerializable

public final class EnemySystem extends GameSystem
  • Field Details

    • DAMAGE_DRAIN_MAX_ITERATIONS

      public static final int DAMAGE_DRAIN_MAX_ITERATIONS
      See Also:
    • RANDOM_SIDE_SHIFT

      public static final int RANDOM_SIDE_SHIFT
      See Also:
    • MIDDLE_SIDE_SHIFT

      public static final int MIDDLE_SIDE_SHIFT
      See Also:
    • flyingEnemy

      public boolean[] flyingEnemy
    • enemyColor

      public com.badlogic.gdx.graphics.Color[] enemyColor
      Can be changed in runtime, per-session copy of values taken from Enemy.Factory Must be updated on state restore as assets are not stored in replay
    • enemyTexture

      public com.badlogic.gdx.graphics.g2d.TextureRegion[] enemyTexture
    • enemyHighlightTexture

      public com.badlogic.gdx.graphics.g2d.TextureRegion[] enemyHighlightTexture
    • enemyEmojiTexture

      public com.badlogic.gdx.graphics.g2d.TextureRegion[] enemyEmojiTexture
    • enemyDamageVulnerability

      public boolean[][] enemyDamageVulnerability
    • enemySpecialDamageVulnerability

      public boolean[][] enemySpecialDamageVulnerability
    • enemyBuffVulnerability

      public float[][] enemyBuffVulnerability
  • Constructor Details

    • EnemySystem

      public EnemySystem()
  • Method Details

    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      write in class Registrable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      read in class Registrable
    • affectsGameState

      public boolean affectsGameState()
      Specified by:
      affectsGameState in class GameSystem
    • setup

      public void setup()
      Description copied from class: GameSystem
      Произвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.
      Overrides:
      setup in class GameSystem
    • postSetup

      public void postSetup()
      Description copied from class: GameSystem
      Произвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены
      Overrides:
      postSetup in class GameSystem
    • postStateRestore

      public void postStateRestore()
      Overrides:
      postStateRestore in class GameSystem
    • register

      public void register(Enemy enemy)
    • getReference

      public Enemy.EnemyReference getReference(Enemy enemy)
      Use this method if you need to store a reference to Enemy anywhere.
      Returns:
      managed wrap for Enemy which will become empty as soon as Enemy becomes unregistered
    • register

      public void register(Enemy enemy, int sideShiftIndex)
    • register

      public void register(Enemy enemy, Path path, int sideShiftIndex, float passedTiles)
    • queueDamage

      public void queueDamage(DamageRecord record)
    • getTowersMaxDps

      public double getTowersMaxDps()
      Returns:
      максимальный урон в секунду от всех башен
    • setTowersMaxDps

      public void setTowersMaxDps(double mdps)
    • despawnEnemy

      public void despawnEnemy(Enemy enemy)
    • queueEnemyKill

      public void queueEnemyKill(DamageRecord lastDamage)
    • queueAllEnemiesPathfinding

      public void queueAllEnemiesPathfinding()
      Обновить пути всех врагов. Полезно в случае, если сменилась конфигурация карты.
    • addEnemy

      public void addEnemy(Enemy enemy, Tile tile, int sideShift)
      Добавить врага в текущую волну У врага будет рандомно установлен спавн
      Parameters:
      sideShift - -1 - рандомно, Path.MIDDLE_SIDE_SHIFT - посредине и тд
    • addStaticEnemy

      public void addStaticEnemy(Enemy enemy, float x, float y)
    • addEnemy

      public void addEnemy(Enemy enemy, SpawnTile spawnTile, int sideShift, Wave wave, float passedTiles)
    • addEnemy

      public void addEnemy(Enemy enemy, SpawnTile spawnTile, Path path, int sideShift, Wave wave, float passedTiles)
    • drainDamageAndKillQueue

      public void drainDamageAndKillQueue()
      Actually applies the damage given to the enemies
    • drainDamageAndKillQueueTillEmpty

      public void drainDamageAndKillQueueTillEmpty()
    • update

      public void update(float deltaTime)
      Overrides:
      update in class GameSystem
    • getSystemName

      public String getSystemName()
      Specified by:
      getSystemName in class GameSystem
    • isEmojiEnemies

      public boolean isEmojiEnemies()
    • getColor

      public com.badlogic.gdx.graphics.Color getColor(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • getTexture

      public com.badlogic.gdx.graphics.g2d.TextureRegion getTexture(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • getHighlightTexture

      public com.badlogic.gdx.graphics.g2d.TextureRegion getHighlightTexture(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • getEmojiTexture

      public com.badlogic.gdx.graphics.g2d.TextureRegion getEmojiTexture(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, float interpolatedTime)
    • drawEnemyHealth

      public void drawEnemyHealth(com.badlogic.gdx.graphics.g2d.Batch batch)
    • dispose

      public void dispose()
      Description copied from interface: com.badlogic.gdx.utils.Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class GameSystem