Class Enemy
A Player reference
Fields
| Enemy.hp | The enemies hp value. |
| Enemy.max_hp | The enemies maximum hp value. |
| Enemy.active | true if the enemy is being updated every frame. |
Methods
| Enemy:get_hitboxes () | Gets the hitboxes of an enemy reference. |
| Enemy:damage (dmg) | Damages an enemy. |
| Enemy:effect (effect, adds) | Adds a value to an enemy Stat. |
| Enemy:get_stat (effect) | Gets the value of an enemy Stat. |
| Enemy:set_stat (effect, set) | Sets the value of an enemy Stat. |
| Enemy:has_ai (effect) | Returns true if the enemy has the AI property. |
| Enemy:add_anger (anger) | Increases the enemies anger stat. |
Fields
- Enemy.hp
- The enemies hp value.
- Enemy.max_hp
- The enemies maximum hp value.
- Enemy.active
- true if the enemy is being updated every frame.
Methods
- Enemy:get_hitboxes ()
-
Gets the hitboxes of an enemy reference.
Returns:
-
Rect[]
A list of all the hitboxes (world space)
- Enemy:damage (dmg)
-
Damages an enemy.
Parameters:
- dmg float The ammount of damage to apply.
- Enemy:effect (effect, adds)
-
Adds a value to an enemy Stat.
Parameters:
- effect integer The effect id to add
- adds float The ammount of the effect to add
See also:
- Enemy:get_stat (effect)
-
Gets the value of an enemy Stat.
Parameters:
- effect integer The effect id to add
Returns:
-
float
The value of the effect
See also:
- Enemy:set_stat (effect, set)
-
Sets the value of an enemy Stat.
Parameters:
- effect integer The effect id to add
- set float The new value for the stat
See also:
- Enemy:has_ai (effect)
-
Returns true if the enemy has the AI property.
Parameters:
- effect integer The AI property id to check
Returns:
-
boolean
true if the enemy has the property
- Enemy:add_anger (anger)
-
Increases the enemies anger stat.
Parameters:
- anger float The ammount of anger to add