mejoras en jugabilidad

This commit is contained in:
Diego De la Viuda Llorente committed 2026-11-11 18:14:14 +01:00
1 parent d983bc2e69
commit ec7e35ddf6
40 files changed
+856 -538

No files matched your search

+12 -6
View File
@@ -47,7 +47,7 @@ func _test_safe_start() -> void:
for node: Node in enemies.get_children():
node.set("is_awake", true)
await _frames(90)
_check(int(_player.get("current_health")) == 50, "No damage at the starting point")
_check(int(_player.get("current_health")) == 30, "No damage at the starting point")
for node: Node in enemies.get_children():
_check(not bool(node.get("_is_pursuing")), "Spawn aggro: " + str(node.name))
@@ -61,7 +61,8 @@ func _test_chasing_and_return() -> void:
_player.position.x = 2000.0
await _advance(120)
_check(not bool(_enemy.get("_is_pursuing")), "Lose target outside the leash")
_check(absf(_enemy.position.x - 100.0) < 12.0, "Return towards spawn, do not teleport")
_check(absf(_enemy.position.x - 100.0) <= float(_enemy.get("patrol_range")) + 24.0,
"Return to the patrol zone instead of chasing forever")
func _test_jumping() -> void:
@@ -128,26 +129,30 @@ func _test_damage_and_push() -> void:
# El centro del barrido queda MAS ALLA del jugador. El empuje debe alejarlo
# del enemigo, no acercarlo. Se prueba el solapamiento real de Area2D.
_enemy.call("_update_attack_damage")
_check(int(_player.get("current_health")) == 44, "Guard hit must deal six HP")
_check(int(_player.get("current_health")) == 24, "Guard hit must deal six HP")
_check(is_equal_approx(_player.velocity.x, 558.0), "Guard must push away with 1.8x horizontal impulse")
_check(_player.velocity.y < -270.0, "Guard also has a slightly stronger upward impulse")
_player.set("invulnerability_timer", 0.0)
_enemy.call("_update_attack_damage")
_check(int(_player.get("current_health")) == 44, "One sweep must not hit twice")
_check(int(_player.get("current_health")) == 24, "One sweep must not hit twice")
_player.call("take_damage", 2, _enemy.global_position)
_check(int(_player.get("current_health")) == 42, "Old two-argument damage callers still work")
_check(int(_player.get("current_health")) == 22, "Old two-argument damage callers still work")
_check(is_equal_approx(_player.velocity.x, 310.0), "Default impulse remains unchanged")
_player.set("invulnerability_timer", 0.0)
_player.set("_shield_hits", 1)
_player.velocity = Vector2.ZERO
_player.call("take_damage", 6, _enemy.global_position, 1.8)
_check(int(_player.get("current_health")) == 42 and _player.velocity == Vector2.ZERO,
_check(int(_player.get("current_health")) == 22 and _player.velocity == Vector2.ZERO,
"A shield must block both damage and impulse")
_enemy.set("_jump_in_progress", true)
_enemy.call("take_damage", 1, _player.global_position)
_check(not bool(_enemy.get("_jump_in_progress")), "Hit must cancel jump steering, preserving knockback")
_check(float(_enemy.get("stagger_resistance_timer")) > 0.0, "An accepted hit starts stagger resistance")
_enemy.set("attack_state", 1) # WINDUP
_enemy.call("take_damage", 1, _player.global_position)
_check(int(_enemy.get("attack_state")) == 1, "Repeated punch must not cancel the enemy forever")
_enemy.call("take_damage", 100, _player.global_position)
_check(bool(_enemy.get("is_dead")) and _enemy.visible, "Retain the delayed death animation")
_enemy.call("_respawn")
@@ -155,6 +160,7 @@ func _test_damage_and_push() -> void:
_check(not bool(_enemy.get("_is_pursuing")) and not bool(_enemy.get("_jump_in_progress")),
"Respawn must reset pursuit and jump state")
_check(is_zero_approx(float(_enemy.get("_jump_cooldown_timer"))), "Respawn must reset the jump cooldown")
_check(is_zero_approx(float(_enemy.get("stagger_resistance_timer"))), "Respawn must reset stagger resistance")
func _arena(variant: String, floors: Array[Rect2], enemy_position: Vector2,