chore: run gdformat on all gdscript files

This commit is contained in:
2025-08-19 08:43:13 +02:00
parent efb9f0d92f
commit 77f1d0811c
10 changed files with 69 additions and 24 deletions

View File

@@ -15,12 +15,14 @@ var max_health: float
var god_mode: bool = false
var is_dead: bool = false
func _ready() -> void:
move_speed = default_move_speed
max_health = default_max_health
health = max_health
GlobalConst.sig_debug_enemy_god_mode.connect(enemy_god_mode_toggle)
func _physics_process(delta: float) -> void:
if target:
var direction = global_position.direction_to(target.global_position)
@@ -31,6 +33,7 @@ func _physics_process(delta: float) -> void:
else:
deal_damage()
func take_damage(value: float):
if god_mode:
return
@@ -40,13 +43,15 @@ func take_damage(value: float):
add_child(dm)
if health <= 0:
die()
func deal_damage():
if target.is_in_group("damagable"):
if contact_damage_cd.is_stopped():
target.take_damage(default_contact_damage)
contact_damage_cd.start()
func die():
if is_dead:
return
@@ -56,13 +61,16 @@ func die():
animation_player.play("die")
animation_player.animation_finished.connect(_on_die_anim_finished)
func cheer_anim():
if not animation_player.is_playing():
animation_player.play("jump")
func enemy_god_mode_toggle(toggle_on: bool) -> void:
god_mode = toggle_on
func _on_die_anim_finished(name: String):
visible = false
queue_free()