♻️REFACTOR: Mejoras en la viabilidad para desarrollo

This commit is contained in:
Diego De la Viuda Llorente committed 2026-10-29 13:23:46 +01:00
1 parent 5aba6c7b47
commit fd0118d964
98 files changed
+5985 -3024

No files matched your search

+7 -7
View File
@@ -1,6 +1,6 @@
extends SceneTree
## Real-engine integration checks; Python resource tests do not execute these.
## Pruebas de integracion con el motor real; las pruebas de Python no las ejecutan.
## godot --headless --path . --script res://tests/test_enemy_ai_runtime.gd
var _failures: int = 0
@@ -41,8 +41,8 @@ func _test_safe_start() -> void:
_check(enemies.get_child_count() == 29, "Keep all 29 encounters")
_check(is_equal_approx((enemies.get_node("Enemy01") as Node2D).position.x, 1260.0),
"First enemy was not relocated")
# Notifier callbacks do not run in headless mode. Waking EVERY enemy also
# proves that a wide window cannot bypass the new proximity check.
# Los avisos de visibilidad no se ejecutan sin ventana. Activar TODOS los enemigos
# tambien comprueba que una ventana ancha no evita el filtro de proximidad.
for node: Node in enemies.get_children():
node.set("is_awake", true)
await _frames(90)
@@ -124,8 +124,8 @@ func _test_damage_and_push() -> void:
_enemy.set("attack_direction", 1.0)
_enemy.call("_set_attack_hitbox_progress", 0.5)
await _frames(3)
# This puts the sweep centre PAST the player. Push must still be away from
# the enemy, not towards it. Exercise the real Area2D overlap path.
# 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(is_equal_approx(_player.velocity.x, 558.0), "Guard must push away with 1.8x horizontal impulse")
@@ -181,8 +181,8 @@ func _arena(variant: String, floors: Array[Rect2], enemy_position: Vector2,
_enemy.set("show_debug_enemy_info", false)
_world.add_child(_enemy)
_enemy.set("is_awake", false)
# Settle onto the floor before enabling pursuit. Ground sweep checks use
# the collision state from move_and_slide(), not merely the spawn position.
# Apoyar al enemigo antes de activar la persecucion. El barrido utiliza el
# estado de colision de move_and_slide(), no solo la posicion de aparicion.
await _frames(10)
_enemy.set("attack_cooldown_timer", 1000.0)
_enemy.set("is_awake", true)