Class BaseEnemyConfig
java.lang.Object
com.csse3200.game.entities.configs.BaseEntityConfig
com.csse3200.game.entities.configs.BaseEnemyConfig
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 Summary
Fields inherited from class com.csse3200.game.entities.configs.BaseEntityConfig
baseAttack, health
-
Constructor Summary
ConstructorDescriptionBaseEnemyConfig
(int speed, int health, ArrayList<Currency> drops, ArrayList<Melee> closeRangeAbilities, ArrayList<Weapon> longRangeAbilities, int baseAttack) Creates a new enemy config with the given values.BaseEnemyConfig
(ArrayList<Currency> drops, ArrayList<Melee> closeRangeAbilities, ArrayList<Weapon> longRangeAbilities) Creates a new enemy config with default values. -
Method Summary
Modifier and TypeMethodDescriptionint
Generate a unique id based on the previous enemy idreturn the close range (Melee) attacks of the enemygetDrops()
return the currency the enemy will drop when it diesint
getId()
return the unique id of the enemyreturn the long range (Projectile) attacks of the enemytoString()
-
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 enemyhealth
- the full of the enemydrops
- the drops of the enemybaseAttack
- 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
return the currency the enemy will drop when it dies -
getCloseRangeAbilities
return the close range (Melee) attacks of the enemy -
getLongRangeAbilities
return the long range (Projectile) attacks of the enemy -
toString
-