added battle state as globals, adds half working battle flow

This commit is contained in:
Luca 2024-09-29 16:18:32 +02:00
parent b09eee0805
commit 4963131d3e
12 changed files with 250 additions and 95 deletions

View file

@ -45,3 +45,13 @@ func _physics_process(delta: float) -> void:
velocity = Vector3.ZERO
in_battle = true
collider.start_battle(self)
func faint() -> void:
self.queue_free()
func attack_enemy(enemy: Monster) -> int:
var damage = data.attack_enemy(enemy.data)
return damage
func take_damage(amount: int) -> void:
data.take_damage(amount)