diff --git a/README.md b/README.md
index d54bf63..b1f8abd 100644
--- a/README.md
+++ b/README.md
@@ -330,3 +330,13 @@ Prueba sugerida: iniciar Nivel 02, comprobar puerta cerrada con enemigos vivos,
derrotar a los ocho, cruzar la puerta, caer en la cripta, aprender las tres
fases y comprobar que aparece la pantalla de victoria. No se han ejecutado
pruebas dentro de Godot en el entorno de generacion del parche.
+
+### Mejora visual incremental del Nivel 02
+
+La Muerte Espectral usa un atlas SVG animado (flotacion, acercamiento, carga,
+barrido, conjuro, impacto, cambio de fase y muerte), con guadana separada que
+retrocede durante la preparacion y gira en el lanzamiento. Ahora se desliza
+hacia el jugador entre acciones, muestra destello y dano flotante al recibir
+golpes, y ajusta la camara al comenzar la pelea. La puerta del osario tiene
+marco de piedra, calaveras, hojas de hierro y cadenas; el bloqueo fisico se
+retira cuando termina la animacion de apertura. Todo el arte es temporal.
diff --git a/assets/bosses/muerte/muerte_body_atlas.svg b/assets/bosses/muerte/muerte_body_atlas.svg
new file mode 100644
index 0000000..2b99138
--- /dev/null
+++ b/assets/bosses/muerte/muerte_body_atlas.svg
@@ -0,0 +1,377 @@
+
+
\ No newline at end of file
diff --git a/assets/bosses/muerte/muerte_frames.tres b/assets/bosses/muerte/muerte_frames.tres
new file mode 100644
index 0000000..bfd7d72
--- /dev/null
+++ b/assets/bosses/muerte/muerte_frames.tres
@@ -0,0 +1,141 @@
+[gd_resource type="SpriteFrames" load_steps=18 format=3]
+
+[ext_resource type="Texture2D" path="res://assets/bosses/muerte/muerte_body_atlas.svg" id="atlas"]
+
+[sub_resource type="AtlasTexture" id="idle_0"]
+atlas = ExtResource("atlas")
+region = Rect2(0, 0, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="idle_1"]
+atlas = ExtResource("atlas")
+region = Rect2(256, 0, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="approach_0"]
+atlas = ExtResource("atlas")
+region = Rect2(512, 0, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="approach_1"]
+atlas = ExtResource("atlas")
+region = Rect2(768, 0, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="slash_warn"]
+atlas = ExtResource("atlas")
+region = Rect2(0, 256, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="slash_0"]
+atlas = ExtResource("atlas")
+region = Rect2(256, 256, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="slash_1"]
+atlas = ExtResource("atlas")
+region = Rect2(512, 256, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="cast_0"]
+atlas = ExtResource("atlas")
+region = Rect2(768, 256, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="cast_1"]
+atlas = ExtResource("atlas")
+region = Rect2(0, 512, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="dash_0"]
+atlas = ExtResource("atlas")
+region = Rect2(256, 512, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="phase_0"]
+atlas = ExtResource("atlas")
+region = Rect2(512, 512, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="phase_1"]
+atlas = ExtResource("atlas")
+region = Rect2(768, 512, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="hurt_0"]
+atlas = ExtResource("atlas")
+region = Rect2(0, 768, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="death_0"]
+atlas = ExtResource("atlas")
+region = Rect2(256, 768, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="death_1"]
+atlas = ExtResource("atlas")
+region = Rect2(512, 768, 256, 256)
+filter_clip = true
+
+[sub_resource type="AtlasTexture" id="death_2"]
+atlas = ExtResource("atlas")
+region = Rect2(768, 768, 256, 256)
+filter_clip = true
+
+[resource]
+animations = [
+{
+"frames": [{"duration": 1.0, "texture": SubResource("idle_0")}, {"duration": 1.0, "texture": SubResource("idle_1")}],
+"loop": true,
+"name": &"idle",
+"speed": 5.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("approach_0")}, {"duration": 1.0, "texture": SubResource("approach_1")}],
+"loop": true,
+"name": &"approach",
+"speed": 8.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("slash_warn")}],
+"loop": false,
+"name": &"telegraph",
+"speed": 6.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("slash_0")}, {"duration": 1.0, "texture": SubResource("slash_1")}],
+"loop": false,
+"name": &"slash",
+"speed": 11.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("cast_0")}, {"duration": 1.0, "texture": SubResource("cast_1")}],
+"loop": true,
+"name": &"cast",
+"speed": 7.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("dash_0")}],
+"loop": true,
+"name": &"dash",
+"speed": 8.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("phase_0")}, {"duration": 1.0, "texture": SubResource("phase_1")}],
+"loop": true,
+"name": &"phase",
+"speed": 7.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("hurt_0")}],
+"loop": false,
+"name": &"hurt",
+"speed": 8.0
+},
+{
+"frames": [{"duration": 1.0, "texture": SubResource("death_0")}, {"duration": 1.0, "texture": SubResource("death_1")}, {"duration": 1.0, "texture": SubResource("death_2")}],
+"loop": false,
+"name": &"death",
+"speed": 4.0
+}
+]
diff --git a/assets/bosses/muerte/spectral_scythe.svg b/assets/bosses/muerte/spectral_scythe.svg
new file mode 100644
index 0000000..2b0d550
--- /dev/null
+++ b/assets/bosses/muerte/spectral_scythe.svg
@@ -0,0 +1,16 @@
+
\ No newline at end of file
diff --git a/bosses/spectral_death/spectral_death.gd b/bosses/spectral_death/spectral_death.gd
index ec03283..28a5c21 100644
--- a/bosses/spectral_death/spectral_death.gd
+++ b/bosses/spectral_death/spectral_death.gd
@@ -1,5 +1,6 @@
extends Node2D
-## Boss de prueba: tres fases y secuencias deterministas. Sin dependencias del arte final.
+## La Muerte Espectral: tres barras, patrones fijos y una presentacion animada
+## independiente del arte definitivo. Conserva el contrato de enemigo original.
signal died
const PHASE_HEALTH: int = 40
@@ -18,11 +19,14 @@ var current_health: int = PHASE_HEALTH
var _started: bool = false
var _step: int = 0
var _state: String = "waiting"
+var _state_elapsed: float = 0.0
+var _state_duration: float = 0.01
var _timer: float = 0.0
var _elapsed: float = 0.0
var _attack: String = ""
var _target: Node2D
var _facing: float = -1.0
+var _move_target_x: float = 3840.0
var _projectile_start: Vector2
var _projectile_end: Vector2
var _projectile_pos: Vector2
@@ -31,51 +35,104 @@ var _hit_this_attack: bool = false
var _next_sweep: int = 0
var _dash_start: float = 0.0
var _dash_end: float = 0.0
+var _hit_flash: float = 0.0
+var _hit_direction: float = 1.0
+var _hit_number: int = 0
+var _death_elapsed: float = 0.0
@onready var hurtbox: Area2D = $Hurtbox
@onready var status: Label = $BossHUD/Panel/Rows/Status
@onready var bars: HBoxContainer = $BossHUD/Panel/Rows/Bars
+@onready var body: AnimatedSprite2D = $Body
+@onready var weapon_pivot: Node2D = $WeaponPivot
+@onready var held_scythe: Sprite2D = $WeaponPivot/HeldScythe
+@onready var thrown_scythe: Sprite2D = $ThrownScythe
+
func _ready() -> void:
visible = true
+ body.play(&"idle")
_update_hud()
+
func _process(delta: float) -> void:
_elapsed += delta
- queue_redraw()
+ _hit_flash = maxf(0.0, _hit_flash - delta)
if is_dead:
+ _death_elapsed += delta
+ _update_visuals()
+ queue_redraw()
return
if not is_instance_valid(_target):
_target = get_tree().get_first_node_in_group("player") as Node2D
if not is_instance_valid(_target):
+ _update_visuals()
+ queue_redraw()
return
if not _started:
if _target.global_position.x >= ARENA_LEFT and _target.global_position.y >= FLOOR_Y - 240.0:
_started = true
- _state = "rest"
- _timer = 1.5
+ _set_state("rest", 1.5)
$BossHUD.visible = true
+ _start_camera_framing()
+ _update_visuals()
+ queue_redraw()
return
- if _state != "dash_active":
- _facing = 1.0 if _target.global_position.x > global_position.x else -1.0
+
+ _state_elapsed += delta
_timer -= delta
match _state:
"rest", "transition":
if _timer <= 0.0:
_begin_next_attack()
+ "move":
+ global_position.x = move_toward(global_position.x, _move_target_x, (340.0 + 60.0 * phase) * delta)
+ if absf(global_position.x - _move_target_x) < 8.0 or _timer <= 0.0:
+ _begin_windup()
"windup":
if _timer <= 0.0:
_begin_active()
"active":
- _update_active(delta)
+ _update_active()
if _timer <= 0.0:
_end_attack()
"dash_active":
- var t: float = clampf(1.0 - _timer / 0.45, 0.0, 1.0)
+ var t: float = clampf(_state_elapsed / _state_duration, 0.0, 1.0)
global_position.x = lerpf(_dash_start, _dash_end, t)
_damage_near(global_position + Vector2(0, 45), 92.0)
if _timer <= 0.0:
_end_attack()
+ _update_visuals()
+ queue_redraw()
+
+
+func _start_camera_framing() -> void:
+ # Caben el personaje, el arma y la cabeza en pantalla durante la pelea.
+ var camera: Camera2D = _target.get_node_or_null("Camera2D") as Camera2D
+ if camera != null:
+ create_tween().tween_property(camera, "zoom", Vector2(1.30, 1.30), 0.85).set_trans(Tween.TRANS_SINE)
+
+
+func _set_state(name: String, duration: float) -> void:
+ _state = name
+ _state_duration = maxf(0.01, duration)
+ _state_elapsed = 0.0
+ _timer = _state_duration
+ _play_state_animation()
+
+
+func _play_state_animation() -> void:
+ var animation: StringName = &"idle"
+ match _state:
+ "move": animation = &"approach"
+ "transition": animation = &"phase"
+ "dead": animation = &"death"
+ "windup": animation = &"cast" if _attack in ["scythe", "runes"] else &"telegraph"
+ "dash_active": animation = &"dash"
+ "active":
+ animation = &"slash" if _attack in ["sweep", "double_sweep"] else &"cast"
+ body.play(animation)
+
func _begin_next_attack() -> void:
var sequence: Array = PATTERNS[phase]
@@ -84,47 +141,56 @@ func _begin_next_attack() -> void:
_hit_this_attack = false
_next_sweep = 0
if _attack == "rest":
- _state = "rest"
- _timer = maxf(0.65, 1.35 - phase * 0.23)
+ _set_state("rest", maxf(0.65, 1.35 - phase * 0.23))
return
_facing = 1.0 if _target.global_position.x > global_position.x else -1.0
+ # Se acerca o se retira ANTES de atacar. La posicion se fija al entrar
+ # en este estado: no persigue al jugador durante la preparacion o el golpe.
+ var gap: float = 155.0
+ if _attack == "scythe": gap = 240.0
+ if _attack == "runes": gap = 270.0
+ if _attack == "dash": gap = 300.0
+ _move_target_x = clampf(_target.global_position.x - _facing * gap, ARENA_LEFT + 125.0, ARENA_RIGHT - 125.0)
+ _set_state("move", clampf(absf(_move_target_x - global_position.x) / (340.0 + 60.0 * phase), 0.28, 1.6))
+
+
+func _begin_windup() -> void:
+ _facing = 1.0 if _target.global_position.x > global_position.x else -1.0
if _attack == "runes":
- # Se anuncian antes de explotar; siempre dejan espacio seguro.
- _runes = [clampf(_target.global_position.x, ARENA_LEFT + 75, ARENA_RIGHT - 75)]
- _runes.append(clampf(_runes[0] + (210 if _runes[0] < 3750 else -210), ARENA_LEFT + 75, ARENA_RIGHT - 75))
+ _runes = [clampf(_target.global_position.x, ARENA_LEFT + 75.0, ARENA_RIGHT - 75.0)]
+ _runes.append(clampf(_runes[0] + (210.0 if _runes[0] < 3750.0 else -210.0), ARENA_LEFT + 75.0, ARENA_RIGHT - 75.0))
if _attack == "scythe":
- _projectile_start = Vector2(global_position.x, FLOOR_Y - 85)
- _projectile_end = Vector2(clampf(_target.global_position.x, ARENA_LEFT + 40, ARENA_RIGHT - 40), FLOOR_Y - 85)
+ _projectile_start = global_position + Vector2(_facing * 76.0, -37.0)
+ _projectile_end = Vector2(clampf(_target.global_position.x, ARENA_LEFT + 50.0, ARENA_RIGHT - 50.0), FLOOR_Y - 85.0)
_projectile_pos = _projectile_start
if _attack == "dash":
_dash_start = global_position.x
- _dash_end = clampf(_target.global_position.x + _facing * 95.0, ARENA_LEFT + 90, ARENA_RIGHT - 90)
- _state = "windup"
- _timer = maxf(0.65, 0.95 - phase * 0.08)
+ _dash_end = clampf(_target.global_position.x + _facing * 95.0, ARENA_LEFT + 90.0, ARENA_RIGHT - 90.0)
+ _set_state("windup", maxf(0.68, 1.02 - phase * 0.09))
+
func _begin_active() -> void:
- _state = "dash_active" if _attack == "dash" else "active"
match _attack:
- "sweep": _timer = 0.38
- "double_sweep": _timer = 0.85
- "scythe": _timer = 1.25
- "runes": _timer = 0.38
- "dash": _timer = 0.45
+ "sweep": _set_state("active", 0.38)
+ "double_sweep": _set_state("active", 0.85)
+ "scythe": _set_state("active", 1.25)
+ "runes": _set_state("active", 0.38)
+ "dash": _set_state("dash_active", 0.45)
-func _update_active(_delta: float) -> void:
+
+func _update_active() -> void:
match _attack:
"sweep":
- _damage_near(global_position + Vector2(_facing * 95, 30), 115.0)
+ _damage_near(global_position + Vector2(_facing * 95.0, 30.0), 115.0)
"double_sweep":
var second: bool = _timer < 0.42
if second and _next_sweep == 0:
_next_sweep = 1
_hit_this_attack = false
- _damage_near(global_position + Vector2(_facing * (95 if not second else -95), 30), 110.0)
+ _damage_near(global_position + Vector2(_facing * (95.0 if not second else -95.0), 30.0), 110.0)
"scythe":
- var t: float = 1.0 - _timer / 1.25
+ var t: float = clampf(_state_elapsed / _state_duration, 0.0, 1.0)
_projectile_pos = _projectile_start.lerp(_projectile_end, 2.0 * t if t < 0.5 else 2.0 * (1.0 - t))
- # El retorno de la guadana tambien es peligroso.
if _target.global_position.distance_to(_projectile_pos) < 62.0:
_hurt_player()
"runes":
@@ -132,40 +198,69 @@ func _update_active(_delta: float) -> void:
if absf(_target.global_position.x - x) < 65.0 and _target.global_position.y > FLOOR_Y - 160.0:
_hurt_player()
+
func _end_attack() -> void:
- _state = "rest"
- _timer = maxf(0.55, 0.92 - phase * 0.12)
_runes.clear()
+ _set_state("rest", maxf(0.55, 0.92 - phase * 0.12))
+
func _damage_near(center: Vector2, radius: float) -> void:
if _target.global_position.distance_to(center) <= radius:
_hurt_player()
+
func _hurt_player() -> void:
if not _hit_this_attack and _target.has_method("take_damage") and not bool(_target.get("is_dead")):
_hit_this_attack = true
_target.call("take_damage", [6, 8, 10][phase], global_position, 0.85)
-func take_damage(amount: int, _source_position: Vector2) -> void:
+
+func take_damage(amount: int, source_position: Vector2) -> void:
if is_dead or not _started or _state == "transition" or amount <= 0:
return
current_health = maxi(0, current_health - amount)
+ _hit_flash = 0.20
+ _hit_direction = -1.0 if source_position.x > global_position.x else 1.0
+ _spawn_damage_number(amount)
+ if is_instance_valid(_target):
+ var camera: Camera2D = _target.get_node_or_null("Camera2D") as Camera2D
+ if camera != null and camera.has_method("impact"):
+ camera.call("impact", 2.4, 0.16, Color(0.78, 1.0, 0.9))
if current_health == 0:
if phase == 2:
is_dead = true
- _state = "dead"
- $Hurtbox.set_deferred("monitorable", false)
+ _set_state("dead", 1.2)
+ hurtbox.set_deferred("monitorable", false)
$BossHUD.visible = false
died.emit()
else:
phase += 1
current_health = PHASE_HEALTH
_step = 0
- _state = "transition"
- _timer = 2.0
_runes.clear()
+ _set_state("transition", 2.0)
_update_hud()
+
+func _spawn_damage_number(amount: int) -> void:
+ var number: Label = Label.new()
+ number.text = "-%d" % amount
+ number.z_index = 20
+ number.add_theme_font_size_override("font_size", 27)
+ number.add_theme_color_override("font_color", Color(1.0, 0.96, 0.72))
+ number.add_theme_color_override("font_outline_color", Color(0.1, 0.05, 0.17))
+ number.add_theme_constant_override("outline_size", 5)
+ _hit_number += 1
+ number.position = Vector2(-28.0 + float(_hit_number % 3) * 19.0, -165.0)
+ add_child(number)
+ var tween: Tween = create_tween()
+ tween.set_parallel(true)
+ tween.tween_property(number, "position", number.position + Vector2(0.0, -73.0), 0.67).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
+ tween.tween_property(number, "modulate:a", 0.0, 0.67)
+ tween.set_parallel(false)
+ tween.tween_callback(number.queue_free)
+
+
func _update_hud() -> void:
if not is_node_ready():
return
@@ -174,43 +269,133 @@ func _update_hud() -> void:
var bar: ProgressBar = bars.get_child(i) as ProgressBar
bar.value = 0 if i < phase else (current_health if i == phase else PHASE_HEALTH)
-func _draw() -> void:
+
+func _update_visuals() -> void:
+ var bob: float = sin(_elapsed * (2.3 + phase * 0.4)) * (6.0 if _state != "transition" else 12.0)
+ var fraction: float = clampf(_state_elapsed / _state_duration, 0.0, 1.0)
+ var flash: float = clampf(_hit_flash / 0.20, 0.0, 1.0)
+ body.flip_h = _facing < 0.0
+ body.position = Vector2(_hit_direction * flash * 11.0, -26.0 + bob)
+ body.rotation = 0.0
+ body.scale = Vector2(1.14, 1.14)
+ if _state == "move":
+ body.rotation = 0.06 * sin(_elapsed * 8.0) * _facing
+ elif _state == "windup":
+ body.rotation = -0.10 * _facing * fraction
+ elif _state in ["active", "dash_active"]:
+ body.rotation = 0.11 * _facing * sin(fraction * PI)
+ elif _state == "transition":
+ body.scale *= 1.0 + 0.065 * sin(_elapsed * 13.0)
if is_dead:
- # Disolucion del manto tras la derrota.
- var a: float = 0.4 + 0.2 * sin(_elapsed * 9.0)
- draw_circle(Vector2.ZERO, 52.0, Color(0.5, 0.15, 0.7, a))
+ body.modulate.a = 1.0 - clampf(_death_elapsed / 1.45, 0.0, 1.0)
+ body.position.y -= 25.0 * _death_elapsed
+ else:
+ body.modulate.a = 1.0
+ if flash > 0.0:
+ body.modulate = Color(1.0, 0.4 + 0.6 * (1.0 - flash), 0.42 + 0.58 * (1.0 - flash), 1.0)
+ if flash > 0.48 and body.animation != &"hurt":
+ body.play(&"hurt")
+ elif flash <= 0.48 and body.animation == &"hurt":
+ _play_state_animation()
+ else:
+ if body.animation == &"hurt":
+ _play_state_animation()
+ body.modulate = Color.WHITE if not is_dead else body.modulate
+
+ weapon_pivot.position = Vector2(_facing * 69.0, -32.0 + bob)
+ weapon_pivot.scale = Vector2(_facing, 1.0)
+ var angle: float = -0.10 + 0.08 * sin(_elapsed * 2.2)
+ match _state:
+ "move": angle = -0.1 + 0.20 * sin(_elapsed * 9.0)
+ "windup":
+ if _attack in ["sweep", "double_sweep", "scythe", "dash"]:
+ angle = lerpf(-0.10, -1.9 if _attack == "scythe" else -1.55, fraction * fraction * (3.0 - 2.0 * fraction))
+ else:
+ angle = lerpf(-0.1, -0.8, fraction)
+ "active":
+ match _attack:
+ "sweep": angle = lerpf(-1.55, 1.35, fraction)
+ "double_sweep": angle = lerpf(-1.55, 1.3, fraction * 2.0) if fraction < 0.5 else lerpf(1.3, -1.5, (fraction - 0.5) * 2.0)
+ "runes": angle = -0.8 + 0.22 * sin(_elapsed * 15.0)
+ "scythe": angle = -1.9
+ "dash_active": angle = 1.1
+ "transition": angle = 0.0 + 0.2 * sin(_elapsed * 12.0)
+ weapon_pivot.rotation = angle
+ held_scythe.visible = not is_dead and not (_state == "active" and _attack == "scythe")
+ thrown_scythe.visible = not is_dead and _state == "active" and _attack == "scythe"
+ if thrown_scythe.visible:
+ thrown_scythe.position = to_local(_projectile_pos)
+ thrown_scythe.rotation = _elapsed * 17.0
+
+
+func _draw() -> void:
+ var aura: Color = Color(0.35, 0.86, 0.85) if phase == 0 else (Color(0.69, 0.39, 1.0) if phase == 1 else Color(1.0, 0.30, 0.43))
+ var bob: float = sin(_elapsed * 2.3) * 7.0
+ var shimmer: float = 0.65 + 0.35 * sin(_elapsed * 3.5)
+ if is_dead:
+ for i: int in range(9):
+ var a: float = TAU * float(i) / 9.0
+ var r: float = 22.0 + _death_elapsed * 120.0
+ draw_circle(Vector2(cos(a) * r, -45.0 + sin(a) * r - _death_elapsed * 35.0), 4.0 + i % 3, Color(0.59, 0.95, 0.88, maxf(0.0, 0.85 - _death_elapsed * 0.65)))
return
- var bob: float = sin(_elapsed * 2.6) * 8.0
- var robe: Color = Color(0.14, 0.10, 0.25)
- var glow: Color = Color(0.66, 0.32, 0.95) if phase == 0 else (Color(1, 0.45, 0.2) if phase == 1 else Color(1, 0.12, 0.25))
- # Aura, capa, capucha, craneo, ojos y guadana: arte vectorial provisional animado.
- draw_circle(Vector2(0, bob), 94, Color(glow.r, glow.g, glow.b, 0.10 + 0.04 * sin(_elapsed * 5)))
- draw_colored_polygon(PackedVector2Array([Vector2(-50, -45 + bob), Vector2(43, -46 + bob), Vector2(80, 110 + bob), Vector2(-80, 110 + bob)]), robe)
- draw_colored_polygon(PackedVector2Array([Vector2(-50, -42 + bob), Vector2(0, -109 + bob), Vector2(50, -42 + bob), Vector2(43, 18 + bob), Vector2(-45, 18 + bob)]), Color(0.08, 0.065, 0.13))
- draw_circle(Vector2(0, -48 + bob), 30, Color(0.72, 0.73, 0.69))
- draw_colored_polygon(PackedVector2Array([Vector2(-22, -37 + bob), Vector2(21, -37 + bob), Vector2(14, -14 + bob), Vector2(-12, -14 + bob)]), Color(0.72, 0.73, 0.69))
- draw_circle(Vector2(-12, -50 + bob), 7, glow)
- draw_circle(Vector2(12, -50 + bob), 7, glow)
- draw_line(Vector2(47, -64 + bob), Vector2(86, 95 + bob), Color(0.64, 0.67, 0.72), 7)
- draw_arc(Vector2(78, -68 + bob), 53, -2.4, 0.5, 22, Color(0.82, 0.9, 0.93), 10)
+ # Silueta flotante y sombra sobre el suelo: su desplazamiento es visible.
+ draw_circle(Vector2(0.0, FLOOR_Y - global_position.y), 48.0, Color(0.02, 0.01, 0.045, 0.28))
+ draw_circle(Vector2(0.0, -38.0 + bob), 120.0, Color(aura.r, aura.g, aura.b, 0.07 + shimmer * 0.035))
+ for i: int in range(5):
+ var theta: float = _elapsed * 0.8 + float(i) * TAU / 5.0
+ var mote: Vector2 = Vector2(cos(theta) * 88.0, -35.0 + sin(theta) * 70.0)
+ draw_circle(mote, 3.0 + shimmer * 2.0, Color(aura.r, aura.g, aura.b, 0.55))
+ if _state == "move":
+ for i: int in range(3):
+ draw_line(Vector2(-_facing * (40.0 + i * 24.0), 45.0 - i * 15.0), Vector2(-_facing * (76.0 + i * 29.0), 50.0 - i * 15.0), Color(aura.r, aura.g, aura.b, 0.4 - i * 0.1), 4.0)
if _state == "transition":
- draw_arc(Vector2(0, bob), 112, 0, TAU, 48, glow, 6)
+ var ring: float = 85.0 + 34.0 * absf(sin(_elapsed * 8.0))
+ draw_arc(Vector2(0.0, -35.0), ring, 0.0, TAU, 48, aura, 6.0)
+ draw_arc(Vector2(0.0, -35.0), ring + 14.0, 0.0, TAU, 40, Color(aura.r, aura.g, aura.b, 0.45), 2.0)
if _state == "windup":
match _attack:
"sweep", "double_sweep":
- draw_rect(Rect2(Vector2(_facing * 35 if _facing > 0 else -245, 0), Vector2(210, 100)), Color(1, 0.25, 0.22, 0.28))
+ var origin: Vector2 = Vector2(_facing * 90.0, 32.0)
+ draw_arc(origin, 118.0, -1.08 if _facing > 0.0 else PI - 1.08, 1.08 if _facing > 0.0 else PI + 1.08, 28, Color(1.0, 0.59, 0.28, shimmer), 5.0)
"scythe":
- draw_line(to_local(_projectile_start), to_local(_projectile_end), Color(0.95, 0.35, 0.95, 0.8), 5)
+ var line_end: Vector2 = to_local(_projectile_end)
+ for j: int in range(8):
+ var a: Vector2 = to_local(_projectile_start).lerp(line_end, float(j) / 8.0)
+ var b: Vector2 = to_local(_projectile_start).lerp(line_end, float(j + 0.55) / 8.0)
+ draw_line(a, b, Color(0.7, 1.0, 0.9, 0.4 + shimmer * 0.35), 4.0)
"runes":
- for x: float in _runes:
- draw_rect(Rect2(to_local(Vector2(x - 65, FLOOR_Y - 17)), Vector2(130, 17)), Color(1, 0.2, 0.2, 0.65))
+ _draw_runes(false, aura)
"dash":
- draw_line(Vector2.ZERO, Vector2(_dash_end - global_position.x, 0), glow, 7)
+ draw_line(Vector2.ZERO, Vector2(_dash_end - global_position.x, 0.0), Color(aura.r, aura.g, aura.b, 0.85), 6.0)
if _state == "active":
if _attack == "scythe":
- draw_arc(to_local(_projectile_pos), 34, _elapsed * 12, _elapsed * 12 + 4.7, 18, Color(0.8, 0.9, 1), 9)
+ var pos: Vector2 = to_local(_projectile_pos)
+ draw_arc(pos, 54.0, _elapsed * 15.0, _elapsed * 15.0 + PI * 1.5, 20, Color(0.64, 1.0, 0.89, 0.78), 5.0)
+ for k: int in range(3):
+ var behind: Vector2 = pos - Vector2(_facing * (20.0 + k * 16.0), 0.0)
+ draw_circle(behind, 15.0 - k * 3.0, Color(aura.r, aura.g, aura.b, 0.22 - k * 0.05))
elif _attack == "runes":
- for x: float in _runes:
- draw_rect(Rect2(to_local(Vector2(x - 65, FLOOR_Y - 170)), Vector2(130, 170)), Color(1, 0.2, 0.2, 0.45))
- elif _attack == "sweep" or _attack == "double_sweep":
- draw_arc(Vector2(_facing * 55, bob), 118, -1.1, 1.1, 22, glow, 13)
+ _draw_runes(true, aura)
+ elif _attack in ["sweep", "double_sweep"]:
+ var flip: float = -_facing if _attack == "double_sweep" and _next_sweep == 1 else _facing
+ draw_arc(Vector2(flip * 65.0, -22.0), 150.0, -1.1 if flip > 0.0 else PI - 1.1, 1.12 if flip > 0.0 else PI + 1.12, 30, Color(aura.r, aura.g, aura.b, 0.83), 12.0)
+ if _hit_flash > 0.0:
+ var pulse: float = _hit_flash / 0.20
+ draw_arc(Vector2(0.0, -30.0), 105.0 + (1.0 - pulse) * 45.0, 0.0, TAU, 32, Color(1.0, 0.98, 0.80, pulse), 7.0 * pulse)
+ for i: int in range(9):
+ var a: float = TAU * float(i) / 9.0 + _elapsed * 2.0
+ var start: Vector2 = Vector2(cos(a) * 36.0, -35.0 + sin(a) * 36.0)
+ var finish: Vector2 = start + Vector2(cos(a), sin(a)) * (45.0 + 38.0 * (1.0 - pulse))
+ draw_line(start, finish, Color(1.0, 0.95, 0.76, pulse), 4.0 * pulse)
+
+
+func _draw_runes(active: bool, aura: Color) -> void:
+ for x: float in _runes:
+ var center: Vector2 = to_local(Vector2(x, FLOOR_Y - 5.0))
+ var ring_color: Color = Color(1.0, 0.33, 0.38, 0.9) if active else Color(aura.r, aura.g, aura.b, 0.85)
+ draw_arc(center, 57.0, 0.0, TAU, 32, ring_color, 6.0)
+ draw_line(center + Vector2(-42.0, 0.0), center + Vector2(42.0, 0.0), ring_color, 4.0)
+ draw_line(center + Vector2(-20.0, -25.0), center + Vector2(20.0, 25.0), ring_color, 4.0)
+ draw_line(center + Vector2(20.0, -25.0), center + Vector2(-20.0, 25.0), ring_color, 4.0)
+ if active:
+ draw_rect(Rect2(center + Vector2(-60.0, -170.0), Vector2(120.0, 170.0)), Color(1.0, 0.25, 0.36, 0.25))
diff --git a/bosses/spectral_death/spectral_death.tscn b/bosses/spectral_death/spectral_death.tscn
index f3fad2e..b545f07 100644
--- a/bosses/spectral_death/spectral_death.tscn
+++ b/bosses/spectral_death/spectral_death.tscn
@@ -1,9 +1,29 @@
-[gd_scene load_steps=3 format=3]
+[gd_scene load_steps=8 format=3]
[ext_resource type="Script" path="res://bosses/spectral_death/spectral_death.gd" id="boss"]
+[ext_resource type="SpriteFrames" path="res://assets/bosses/muerte/muerte_frames.tres" id="frames"]
+[ext_resource type="Texture2D" path="res://assets/bosses/muerte/spectral_scythe.svg" id="scythe"]
[sub_resource type="RectangleShape2D" id="hurt_shape"]
-size = Vector2(118, 204)
+size = Vector2(154, 270)
+
+[sub_resource type="StyleBoxFlat" id="hud_panel"]
+bg_color = Color(0.08, 0.045, 0.13, 0.85)
+border_width_left = 2
+border_width_top = 2
+border_width_right = 2
+border_width_bottom = 2
+border_color = Color(0.53, 0.36, 0.68, 0.95)
+corner_radius_top_left = 7
+corner_radius_top_right = 7
+corner_radius_bottom_right = 7
+corner_radius_bottom_left = 7
+
+[sub_resource type="StyleBoxFlat" id="bar_empty"]
+bg_color = Color(0.17, 0.11, 0.22, 1)
+
+[sub_resource type="StyleBoxFlat" id="bar_fill"]
+bg_color = Color(0.61, 0.91, 0.78, 1)
[node name="SpectralDeath" type="Node2D" groups=["enemy"]]
script = ExtResource("boss")
@@ -16,8 +36,29 @@ monitoring = false
monitorable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"]
+position = Vector2(0, -12)
shape = SubResource("hurt_shape")
+[node name="Body" type="AnimatedSprite2D" parent="."]
+position = Vector2(0, -26)
+scale = Vector2(1.14, 1.14)
+sprite_frames = ExtResource("frames")
+animation = &"idle"
+autoplay = "idle"
+
+[node name="WeaponPivot" type="Node2D" parent="."]
+position = Vector2(-69, -32)
+
+[node name="HeldScythe" type="Sprite2D" parent="WeaponPivot"]
+texture = ExtResource("scythe")
+offset = Vector2(30, -73)
+scale = Vector2(1.25, 1.25)
+
+[node name="ThrownScythe" type="Sprite2D" parent="."]
+visible = false
+texture = ExtResource("scythe")
+scale = Vector2(1.2, 1.2)
+
[node name="BossHUD" type="CanvasLayer" parent="."]
visible = false
layer = 3
@@ -28,31 +69,44 @@ anchor_right = 1.0
offset_left = 64.0
offset_top = 22.0
offset_right = -64.0
-offset_bottom = 82.0
+offset_bottom = 90.0
+theme_override_styles/panel = SubResource("hud_panel")
[node name="Rows" type="VBoxContainer" parent="BossHUD/Panel"]
+theme_override_constants/separation = 7
[node name="Status" type="Label" parent="BossHUD/Panel/Rows"]
+theme_override_colors/font_color = Color(0.91, 0.95, 0.92, 1)
+theme_override_font_sizes/font_size = 21
text = "LA MUERTE ESPECTRAL"
horizontal_alignment = 1
[node name="Bars" type="HBoxContainer" parent="BossHUD/Panel/Rows"]
-theme_override_constants/separation = 6
+theme_override_constants/separation = 8
[node name="Life1" type="ProgressBar" parent="BossHUD/Panel/Rows/Bars"]
+custom_minimum_size = Vector2(0, 14)
size_flags_horizontal = 3
+theme_override_styles/background = SubResource("bar_empty")
+theme_override_styles/fill = SubResource("bar_fill")
max_value = 40.0
value = 40.0
show_percentage = false
[node name="Life2" type="ProgressBar" parent="BossHUD/Panel/Rows/Bars"]
+custom_minimum_size = Vector2(0, 14)
size_flags_horizontal = 3
+theme_override_styles/background = SubResource("bar_empty")
+theme_override_styles/fill = SubResource("bar_fill")
max_value = 40.0
value = 40.0
show_percentage = false
[node name="Life3" type="ProgressBar" parent="BossHUD/Panel/Rows/Bars"]
+custom_minimum_size = Vector2(0, 14)
size_flags_horizontal = 3
+theme_override_styles/background = SubResource("bar_empty")
+theme_override_styles/fill = SubResource("bar_fill")
max_value = 40.0
value = 40.0
show_percentage = false
diff --git a/levels/level_02.gd b/levels/level_02.gd
index fc54dc8..ae3c1d3 100644
--- a/levels/level_02.gd
+++ b/levels/level_02.gd
@@ -7,7 +7,7 @@ var _boss_defeated: bool = false
@onready var gate: StaticBody2D = $Gate
@onready var gate_shape: CollisionShape2D = $Gate/CollisionShape2D
-@onready var gate_visual: Polygon2D = $Gate/Visual
+@onready var gate_visual: OssuaryGateVisual = $Gate/Visual
@onready var notice: Label = $GateMessage/Text
@onready var boss: Node2D = $Boss
@@ -18,6 +18,7 @@ func _ready() -> void:
remaining += 1
enemy.connect("died", _on_enemy_died)
boss.connect("died", _on_boss_died)
+ gate_visual.fully_open.connect(_on_gate_fully_opened)
$GateSensor.body_entered.connect(_on_gate_approach)
$GateSensor.body_exited.connect(_on_gate_depart)
_update_gate()
@@ -28,13 +29,19 @@ func _on_enemy_died() -> void:
func _update_gate() -> void:
_gate_open = remaining == 0
- gate_shape.set_deferred("disabled", _gate_open)
- gate_visual.visible = not _gate_open
+ gate_visual.set_unlocked(_gate_open)
+ if not _gate_open:
+ gate_shape.set_deferred("disabled", false)
if _gate_open:
notice.text = "TODOS DERROTADOS. EL SELLO SE HA ROTO."
else:
notice.text = LOCKED_TEXT
+func _on_gate_fully_opened() -> void:
+ # La colision no desaparece hasta terminar de abrirse visualmente.
+ gate_shape.set_deferred("disabled", true)
+
+
func _on_gate_approach(body: Node2D) -> void:
if body.is_in_group("player"):
$GateMessage.visible = true
diff --git a/levels/level_02.tscn b/levels/level_02.tscn
index 635cb37..3bd0ff7 100644
--- a/levels/level_02.tscn
+++ b/levels/level_02.tscn
@@ -2,6 +2,7 @@
[ext_resource type="Script" path="res://levels/level_02.gd" id="level"]
[ext_resource type="Script" path="res://levels/level_02_art.gd" id="art"]
+[ext_resource type="Script" path="res://world/triggers/ossuary_gate_visual.gd" id="gate_art"]
[ext_resource type="PackedScene" path="res://player/player.tscn" id="player"]
[ext_resource type="PackedScene" path="res://ui/mobile_controls/mobile_controls.tscn" id="mobile"]
[ext_resource type="PackedScene" path="res://world/terrain/ground.tscn" id="ground"]
@@ -160,9 +161,8 @@ collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Gate"]
shape = SubResource("gate_collision")
-[node name="Visual" type="Polygon2D" parent="Gate"]
-color = Color(0.72, 0.17, 0.30, 0.92)
-polygon = PackedVector2Array(-22, -110, 22, -110, 22, 110, -22, 110)
+[node name="Visual" type="Node2D" parent="Gate"]
+script = ExtResource("gate_art")
[node name="GateSensor" type="Area2D" parent="."]
position = Vector2(3030, 600)
diff --git a/levels/level_02_art.gd b/levels/level_02_art.gd
index 0402558..06d93ac 100644
--- a/levels/level_02_art.gd
+++ b/levels/level_02_art.gd
@@ -20,9 +20,6 @@ func _draw() -> void:
for i: int in range(3):
var y: float = 770 + i * 120
draw_colored_polygon(PackedVector2Array([Vector2(3150, y), Vector2(3220, y), Vector2(3185, y + 38)]), Color(0.75, 0.23, 0.42, 0.7))
- draw_rect(Rect2(3040, 470, 28, 240), Color(0.27, 0.22, 0.31))
- draw_rect(Rect2(3095, 470, 28, 240), Color(0.27, 0.22, 0.31))
- draw_rect(Rect2(3040, 445, 84, 32), Color(0.37, 0.27, 0.39))
# Cripta: columnas, arco, luna ensangrentada y antorchas.
draw_circle(Vector2(3790, 890), 64, Color(0.69, 0.18, 0.23, 0.35))
for x: float in [3340.0, 3520.0, 4030.0, 4240.0]:
diff --git a/tests/test_level_02_visual_resources.py b/tests/test_level_02_visual_resources.py
new file mode 100644
index 0000000..831983e
--- /dev/null
+++ b/tests/test_level_02_visual_resources.py
@@ -0,0 +1,58 @@
+"""Contratos del parche incremental: arte, animacion y puerta del Nivel 02.
+
+Verifica recursos sin sustituir la inspeccion visual ni las pruebas del motor.
+"""
+from pathlib import Path
+import re
+import unittest
+from xml.etree import ElementTree
+
+ROOT = Path(__file__).resolve().parents[1]
+LEVEL = (ROOT / "levels/level_02.tscn").read_text(encoding="utf-8")
+BOSS = (ROOT / "bosses/spectral_death/spectral_death.tscn").read_text(encoding="utf-8")
+BOSS_CODE = (ROOT / "bosses/spectral_death/spectral_death.gd").read_text(encoding="utf-8")
+GATE_CODE = (ROOT / "world/triggers/ossuary_gate_visual.gd").read_text(encoding="utf-8")
+
+
+class Level02VisualResourceTests(unittest.TestCase):
+ def test_scene_references_are_real_files(self):
+ for scene in [LEVEL, BOSS]:
+ for resource in re.findall(r'path="res://([^\"]+)"', scene):
+ self.assertTrue((ROOT / resource).is_file(), resource)
+
+ def test_reaper_has_real_animation_frames_and_separate_weapon(self):
+ atlas = ROOT / "assets/bosses/muerte/muerte_body_atlas.svg"
+ scythe = ROOT / "assets/bosses/muerte/spectral_scythe.svg"
+ for path in (atlas, scythe):
+ root = ElementTree.parse(path).getroot()
+ self.assertIn("viewBox", root.attrib)
+ self.assertGreater(int(root.attrib["width"]), 90)
+ frames = (ROOT / "assets/bosses/muerte/muerte_frames.tres").read_text()
+ for animation in ("idle", "approach", "telegraph", "slash", "cast", "dash", "phase", "hurt", "death"):
+ self.assertIn(f'"name": &"{animation}"', frames)
+ self.assertIn('name="WeaponPivot"', BOSS)
+ self.assertIn('name="ThrownScythe"', BOSS)
+ self.assertIn('name="Body" type="AnimatedSprite2D"', BOSS)
+
+ def test_hit_reaction_and_movement_do_not_replace_combat_patterns(self):
+ self.assertIn('func _spawn_damage_number(amount: int)', BOSS_CODE)
+ self.assertIn('body.play(&"hurt")', BOSS_CODE)
+ self.assertIn('func _start_camera_framing()', BOSS_CODE)
+ self.assertIn('"move":', BOSS_CODE)
+ self.assertIn('"double_sweep", "scythe", "runes", "dash", "rest"', BOSS_CODE)
+ self.assertIn('current_health = PHASE_HEALTH', BOSS_CODE)
+
+ def test_gate_keeps_the_original_kill_requirement_and_opens_visibly(self):
+ level_code = (ROOT / "levels/level_02.gd").read_text()
+ self.assertIn('remaining == 0', level_code)
+ self.assertIn('has de derrotar a todos los mal nacidos para poder atravesar esta puerta!', level_code)
+ self.assertIn('gate_visual.fully_open.connect(', level_code)
+ self.assertIn('gate_visual.set_unlocked(_gate_open)', level_code)
+ self.assertIn('func _draw_skull(', GATE_CODE)
+ self.assertIn('func _draw_leaf(', GATE_CODE)
+ self.assertIn('fully_open.emit()', GATE_CODE)
+ self.assertIn('name="Visual" type="Node2D"', LEVEL)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/world/triggers/ossuary_gate_visual.gd b/world/triggers/ossuary_gate_visual.gd
new file mode 100644
index 0000000..bed5617
--- /dev/null
+++ b/world/triggers/ossuary_gate_visual.gd
@@ -0,0 +1,154 @@
+extends Node2D
+class_name OssuaryGateVisual
+## Porton de calaveras provisional: hojas de hierro, cadenas, sello y apertura
+## lateral animada. No controla las muertes ni las colisiones del nivel.
+signal fully_open
+
+@export_range(0.2, 4.0, 0.1) var open_duration: float = 1.15
+
+var _unlocked: bool = false
+var _progress: float = 0.0
+var _elapsed: float = 0.0
+var _signalled: bool = false
+
+const STONE: Color = Color(0.24, 0.22, 0.29)
+const STONE_EDGE: Color = Color(0.53, 0.49, 0.59)
+const IRON: Color = Color(0.12, 0.12, 0.19)
+const IRON_EDGE: Color = Color(0.53, 0.58, 0.63)
+const BONE: Color = Color(0.90, 0.84, 0.71)
+
+
+func set_unlocked(value: bool) -> void:
+ if _unlocked == value:
+ return
+ _unlocked = value
+ if not value:
+ _signalled = false
+
+
+func _process(delta: float) -> void:
+ _elapsed += delta
+ _progress = move_toward(_progress, 1.0 if _unlocked else 0.0, delta / open_duration)
+ if _unlocked and _progress >= 1.0 and not _signalled:
+ _signalled = true
+ fully_open.emit()
+ queue_redraw()
+
+
+func _draw() -> void:
+ var pale: Color = Color(0.45, 1.0, 0.85) if _unlocked else Color(1.0, 0.33, 0.31)
+ var pulse: float = 0.6 + 0.4 * sin(_elapsed * 4.0)
+
+ # Sombra y vacio de la cripta. El resplandor se vuelve verde al abrir.
+ draw_colored_polygon(PackedVector2Array([
+ Vector2(-96, 116), Vector2(-96, -62), Vector2(-91, -89),
+ Vector2(-72, -120), Vector2(-40, -142), Vector2(0, -150),
+ Vector2(40, -142), Vector2(72, -120), Vector2(91, -89),
+ Vector2(96, -62), Vector2(96, 116)
+ ]), Color(0.055, 0.05, 0.092))
+ draw_rect(Rect2(Vector2(-65, -89), Vector2(130, 198)), Color(0.025, 0.06 + 0.04 * pulse, 0.08))
+ draw_circle(Vector2(0, 6), 42.0, Color(pale.r, pale.g, pale.b, 0.10 + 0.08 * pulse))
+
+ # Las hojas se deslizan a los lados y dejan pasar al personaje.
+ for side: int in [-1, 1]:
+ _draw_leaf(side, side * (31.0 + 60.0 * _progress), pale, pulse)
+
+ # Marco principal de bloques de piedra, dibujado por delante de las hojas.
+ for side: int in [-1, 1]:
+ var x: float = -91.0 if side < 0 else 65.0
+ draw_rect(Rect2(Vector2(x, -93), Vector2(26, 211)), STONE)
+ draw_rect(Rect2(Vector2(x + (20 if side < 0 else 0), -88), Vector2(6, 204)), STONE_EDGE.darkened(0.25))
+ for i: int in range(5):
+ draw_line(Vector2(x, -69 + i * 39), Vector2(x + 26, -69 + i * 39), Color(0.11, 0.11, 0.17), 2.0)
+ _draw_skull(Vector2(side * 78.0, -46.0), 0.38, pale)
+ # Arco de piedra, moldura y remaches.
+ draw_arc(Vector2(0, -61), 91.0, PI, TAU, 45, STONE, 25.0)
+ draw_arc(Vector2(0, -61), 91.0, PI, TAU, 45, STONE_EDGE, 5.0)
+ draw_arc(Vector2(0, -61), 65.0, PI, TAU, 40, Color(0.66, 0.58, 0.76), 4.0)
+ for i: int in range(9):
+ var angle: float = PI + float(i) * PI / 8.0
+ var point: Vector2 = Vector2(cos(angle), sin(angle)) * 88.0 + Vector2(0, -61)
+ draw_circle(point, 4.0, Color(0.12, 0.11, 0.18))
+ draw_rect(Rect2(Vector2(-105, 109), Vector2(210, 15)), STONE)
+ draw_line(Vector2(-103, 109), Vector2(103, 109), STONE_EDGE, 4.0)
+
+ # El craneo principal domina el umbral. Cuernos y huesos cruzados.
+ _draw_bone(Vector2(-31, -149), Vector2(31, -122), 5.0)
+ _draw_bone(Vector2(31, -149), Vector2(-31, -122), 5.0)
+ _draw_skull(Vector2(0.0, -131.0), 0.76, pale)
+ for side: int in [-1, 1]:
+ draw_line(Vector2(side * 41, -127), Vector2(side * 60, -147), STONE_EDGE, 5.0)
+ draw_line(Vector2(side * 60, -147), Vector2(side * 52, -116), STONE_EDGE, 4.0)
+
+ if _progress < 0.97:
+ # Cadenas y cerradura central; desaparecen al romper el sello.
+ var opacity: float = 1.0 - _progress
+ for i: int in range(6):
+ var y: float = -44.0 + i * 23.0
+ draw_arc(Vector2(-4 + (i % 2) * 8, y), 10.0, 0, TAU, 18, Color(0.75, 0.72, 0.76, opacity), 4.0)
+ draw_rect(Rect2(Vector2(-18, 22), Vector2(36, 41)), Color(0.26, 0.16, 0.30, opacity))
+ draw_rect(Rect2(Vector2(-14, 27), Vector2(28, 28)), Color(0.63, 0.50, 0.71, opacity), false, 3.0)
+ draw_circle(Vector2(0, 42), 7.0 + pulse * 2.0, Color(pale.r, pale.g, pale.b, opacity))
+ if _progress > 0.0 and _progress < 1.0:
+ # Chispas del sello mientras se desliza la puerta.
+ for i: int in range(7):
+ var a: float = float(i) * TAU / 7.0 + _elapsed * 2.5
+ var r: float = 18.0 + _progress * 80.0
+ draw_circle(Vector2(cos(a) * r, sin(a) * r * 0.55), 2.0 + i % 3, Color(0.75, 1.0, 0.82, 1.0 - _progress))
+
+
+func _draw_leaf(side: int, cx: float, glow: Color, pulse: float) -> void:
+ var x: float = cx - 30.0
+ # Acero viejo con barras, remaches y espinas, no un simple rectangulo.
+ draw_rect(Rect2(Vector2(x, -94), Vector2(60, 205)), IRON)
+ draw_rect(Rect2(Vector2(x + 4, -90), Vector2(52, 197)), Color(0.20, 0.18, 0.26), false, 4.0)
+ for j: int in range(4):
+ var bar_x: float = x + 10 + j * 13
+ draw_line(Vector2(bar_x, -86), Vector2(bar_x, 106), IRON_EDGE.darkened(0.30), 5.0)
+ draw_line(Vector2(bar_x + 1, -86), Vector2(bar_x + 1, 106), Color(0.09, 0.08, 0.14), 2.0)
+ # Punta de lanza en cada barra.
+ draw_colored_polygon(PackedVector2Array([
+ Vector2(bar_x - 5, -85), Vector2(bar_x, -104), Vector2(bar_x + 5, -85)
+ ]), IRON_EDGE)
+ for j: int in range(4):
+ var y: float = -65 + j * 52
+ draw_rect(Rect2(Vector2(x + 4, y), Vector2(52, 8)), Color(0.34, 0.31, 0.40))
+ for i: int in range(3):
+ draw_circle(Vector2(x + 13 + i * 17, y + 4), 2.0, Color(0.70, 0.66, 0.67))
+ # Huesos cruzados y craneo tallado sobre cada hoja.
+ _draw_bone(Vector2(cx - 18, -38), Vector2(cx + 18, 12), 5.0)
+ _draw_bone(Vector2(cx + 18, -38), Vector2(cx - 18, 12), 5.0)
+ _draw_skull(Vector2(cx, -12), 0.70, glow)
+ # Grietas en la madera ennegrecida, pulso espectral.
+ draw_line(Vector2(cx - 20, 58), Vector2(cx - 6, 69), Color(glow.r, glow.g, glow.b, 0.48 * pulse), 3.0)
+ draw_line(Vector2(cx - 6, 69), Vector2(cx + 5, 64), Color(glow.r, glow.g, glow.b, 0.48 * pulse), 3.0)
+ draw_line(Vector2(cx + 5, 64), Vector2(cx + 16, 88), Color(glow.r, glow.g, glow.b, 0.48 * pulse), 3.0)
+
+
+func _draw_bone(a: Vector2, b: Vector2, width: float) -> void:
+ draw_line(a, b, BONE.darkened(0.18), width)
+ for end: Vector2 in [a, b]:
+ draw_circle(end + Vector2(-2, 0), width * 0.56, BONE)
+ draw_circle(end + Vector2(2, 0), width * 0.56, BONE)
+
+
+func _draw_skull(center: Vector2, scale_value: float, glow: Color) -> void:
+ var r: float = 26.0 * scale_value
+ var skull: Color = BONE
+ # Silueta ancha en la frente y mandibula con dientes individuales.
+ draw_circle(center + Vector2(0, -4 * scale_value), r, Color(0.28, 0.24, 0.29))
+ draw_circle(center + Vector2(0, -5 * scale_value), r - 2.0, skull)
+ draw_rect(Rect2(center + Vector2(-r * 0.56, r * 0.38), Vector2(r * 1.12, r * 0.72)), skull)
+ for side: int in [-1, 1]:
+ var eye: Vector2 = center + Vector2(side * r * 0.43, -r * 0.15)
+ draw_circle(eye, r * 0.30, Color(0.07, 0.06, 0.13))
+ draw_circle(eye, r * 0.12, glow)
+ draw_colored_polygon(PackedVector2Array([
+ center + Vector2(0, r * 0.10),
+ center + Vector2(-r * 0.20, r * 0.46),
+ center + Vector2(r * 0.20, r * 0.46)
+ ]), Color(0.12, 0.08, 0.16))
+ for tooth: int in range(4):
+ var xx: float = center.x - r * 0.42 + tooth * r * 0.28
+ draw_line(Vector2(xx, center.y + r * 0.60), Vector2(xx, center.y + r * 1.03), Color(0.35, 0.32, 0.33), maxf(1.0, 2.0 * scale_value))
+ draw_line(center + Vector2(-r * 0.55, -r * 0.70), center + Vector2(-r * 0.12, -r * 0.83), Color.WHITE, maxf(1.0, 2.0 * scale_value))