Class BaseEnemyConfig

java.lang.Object
com.csse3200.game.entities.configs.BaseEntityConfig
com.csse3200.game.entities.configs.BaseEnemyConfig

public class BaseEnemyConfig extends BaseEntityConfig
Defines all enemy configs to be loaded by the Enemy Factory. Variables: idCounter - counter for the unique id of the enemy speed - factor of how fast the enemy moves fullHealth - the full health of the enemy health - the current health of the enemy id - unique identifier for the enemy drops - the items that the enemy drops when it dies views - the different images of enemy over different states state - the current state of the enemy (full health, half health, low health) baseAttack - the base damage of an enemy's attack Functions takeDamage - process the damge taken by the enemy attack - process an attack die - process of death (remove from game and drop resources)
  • Field Details

    • speed

      public final int speed
    • fullHeath

      public final int fullHeath
  • Constructor Details

    • BaseEnemyConfig

      public BaseEnemyConfig(ArrayList<Currency> drops, ArrayList<Melee> closeRangeAbilities, ArrayList<Weapon> longRangeAbilities)
      Creates a new enemy config with default values.
    • BaseEnemyConfig

      public BaseEnemyConfig(int speed, int health, ArrayList<Currency> drops, ArrayList<Melee> closeRangeAbilities, ArrayList<Weapon> longRangeAbilities, int baseAttack)
      Creates a new enemy config with the given values.
      Parameters:
      speed - the speed of the enemy
      health - the full of the enemy
      drops - the drops of the enemy
      baseAttack - the base damage to the target
  • Method Details

    • generateId

      public int generateId()
      Generate a unique id based on the previous enemy id
    • getId

      public int getId()
      return the unique id of the enemy
    • getDrops

      public String getDrops()
      return the currency the enemy will drop when it dies
    • getCloseRangeAbilities

      public ArrayList<Melee> getCloseRangeAbilities()
      return the close range (Melee) attacks of the enemy
    • getLongRangeAbilities

      public ArrayList<Weapon> getLongRangeAbilities()
      return the long range (Projectile) attacks of the enemy
    • toString

      public String toString()
      Overrides:
      toString in class Object