add visualRadius

This commit is contained in:
2025-01-17 17:51:00 +09:00
parent a44693aa5d
commit 80ccb92815
6 changed files with 76 additions and 59 deletions
+6 -1
View File
@@ -13,11 +13,12 @@ export default class Entity {
health = null
height = 40
maxHealth = 1
memory = {} // TODO: WARNING: currently only used for minions (code smell?)
memory = {}
position = null
radius = 0
speed = 400
team = Team.neutral
visualRadius = null
#attacking = false
#dest = null
@@ -39,6 +40,9 @@ export default class Entity {
if (this.health == null) {
this.health = this.maxHealth
}
if (this.visualRadius == null) {
this.visualRadius = this.radius
}
}
get destination() { return this.#dest }
@@ -90,6 +94,7 @@ export default class Entity {
castAction(slot, cursor, halt = false) {
const ability = this.abilities[slot]
if (ability == null) { return }
if (this.casting != null) {
const abilityBeingCasted = this.casting.ability