Personajes seleccionables
This commit is contained in:
1 parent
66f4d8b33b
commit
97335c9d21
42 files changed
+5282
-3106
No files matched your search
+34
-9
@@ -134,8 +134,9 @@ const COMBAT_FX = preload("res://effects/combat_fx.gd")
|
||||
## Fraccion del control horizontal que se mantiene durante la caida ofensiva.
|
||||
@export_range(0.0, 1.0) var ground_pound_horizontal_control: float = 0.25
|
||||
|
||||
## Radio del impacto al aterrizar, en pixeles.
|
||||
@export var ground_pound_radius: float = 54.0
|
||||
## Radio comun en pixeles: 108, el doble del anterior (54), para toda la banda.
|
||||
## El circulo fisico y el efecto comparten este alcance; no depende del personaje.
|
||||
@export var ground_pound_radius: float = 108.0
|
||||
## Centro del impacto respecto al cuerpo del jugador.
|
||||
@export var ground_pound_offset: Vector2 = Vector2(0.0, 24.0)
|
||||
|
||||
@@ -262,11 +263,19 @@ var _special_damage_budgets: Dictionary = {}
|
||||
var _special_damage_dealt: Dictionary = {}
|
||||
var _hurt_animation_timer: float = 0.0
|
||||
var _landing_animation_timer: float = 0.0
|
||||
# Pose exclusiva del impacto ofensivo; un aterrizaje normal sigue usando land.
|
||||
var _pound_landing_timer: float = 0.0
|
||||
var _punch_swing_shown: bool = false
|
||||
|
||||
|
||||
## Carga el personaje y prepara ataques, animacion y senales iniciales del HUD.
|
||||
func _ready() -> void:
|
||||
# Resuelve la eleccion antes de vida, animaciones y senales iniciales del HUD.
|
||||
var session: RunSessionState = get_node_or_null("/root/RunSession") as RunSessionState
|
||||
if session != null:
|
||||
var selected: CharacterData = session.character_for(self)
|
||||
if selected != null:
|
||||
character_data = selected
|
||||
if character_data == null:
|
||||
push_error("Player needs a CharacterData resource.")
|
||||
return
|
||||
@@ -529,9 +538,13 @@ func _start_ground_pound() -> void:
|
||||
func _ground_pound_impact() -> void:
|
||||
ground_pound_active = false
|
||||
ground_pound_debug_timer = debug_impact_duration
|
||||
_landing_animation_timer = 0.20
|
||||
_pound_landing_timer = 0.28
|
||||
# La pose especifica no reemplaza la animacion de un salto normal.
|
||||
if animated_sprite.sprite_frames.has_animation(&"pound_land"):
|
||||
animated_sprite.play(&"pound_land")
|
||||
animated_sprite.set_frame_and_progress(0, 0.0)
|
||||
COMBAT_FX.spawn(get_parent(), global_position + Vector2(0, 26),
|
||||
&"ground_pound", facing_direction, ground_pound_radius)
|
||||
StringName(character_data.ground_pound_effect), facing_direction, ground_pound_radius)
|
||||
feedback_camera.call("impact", 2.8, 0.24)
|
||||
|
||||
# Calcula el dano a partir de la altura maxima sobre el punto de despegue y aplica sus limites.
|
||||
@@ -584,8 +597,8 @@ func _start_special_attack() -> void:
|
||||
_special_damage_dealt.clear()
|
||||
punch_timer = 0.0
|
||||
velocity.x = 0.0
|
||||
feedback_camera.call("start_solo", special_duration)
|
||||
_spawn_floating_text("GUITAR SOLO!", Color(0.76, 0.85, 1.0))
|
||||
feedback_camera.call("start_solo", special_duration, character_data.special_color)
|
||||
_spawn_floating_text(character_data.special_label, character_data.special_color)
|
||||
|
||||
|
||||
## Avanza las fases visuales del solo y emite cada pulso una sola vez.
|
||||
@@ -602,9 +615,17 @@ func _update_special_attack(delta: float) -> void:
|
||||
break
|
||||
_apply_special_attack(_special_charge_used, _special_pulses_sent)
|
||||
_special_pulses_sent += 1
|
||||
# Cada nota grave visible coincide con su pulso y sacudida, no con un temporizador aparte.
|
||||
if character_data.special_effect == "bass_pulse":
|
||||
animated_sprite.play(&"special")
|
||||
animated_sprite.set_frame_and_progress(0, 0.0)
|
||||
var effect_radius: float = minf(special_radius, 300.0) if special_radius > 0.0 else 300.0
|
||||
COMBAT_FX.spawn(get_parent(), global_position, &"solo", facing_direction, effect_radius)
|
||||
feedback_camera.call("impact", 2.0, 0.18, Color(0.61, 0.82, 1.0))
|
||||
COMBAT_FX.spawn(get_parent(), global_position,
|
||||
StringName(character_data.special_effect), facing_direction, effect_radius)
|
||||
# Un movimiento de camara por pulso; los platos y ondas nunca aplican dano adicional.
|
||||
feedback_camera.call("impact", character_data.special_shake_strength,
|
||||
character_data.special_shake_duration, character_data.special_color,
|
||||
character_data.special_shake_frequency)
|
||||
velocity.x = -facing_direction * 35.0
|
||||
if _special_elapsed >= special_duration:
|
||||
_special_active = false
|
||||
@@ -852,6 +873,7 @@ func _reload_level() -> void:
|
||||
func _update_timers(delta: float) -> void:
|
||||
_hurt_animation_timer = maxf(0.0, _hurt_animation_timer - delta)
|
||||
_landing_animation_timer = maxf(0.0, _landing_animation_timer - delta)
|
||||
_pound_landing_timer = maxf(0.0, _pound_landing_timer - delta)
|
||||
punch_timer = max(punch_timer - delta, 0.0)
|
||||
attack_cooldown_timer = max(attack_cooldown_timer - delta, 0.0)
|
||||
ground_pound_debug_timer = max(ground_pound_debug_timer - delta, 0.0)
|
||||
@@ -887,6 +909,8 @@ func _update_animation() -> void:
|
||||
animation_name = &"punch"
|
||||
elif not is_on_floor():
|
||||
animation_name = &"jump" if velocity.y < 0.0 else &"fall"
|
||||
elif _pound_landing_timer > 0.0:
|
||||
animation_name = &"pound_land"
|
||||
elif _landing_animation_timer > 0.0:
|
||||
animation_name = &"land"
|
||||
elif absf(velocity.x) > 10.0:
|
||||
@@ -942,7 +966,8 @@ func _setup_attack_hitboxes() -> void:
|
||||
func _draw() -> void:
|
||||
if is_on_floor():
|
||||
draw_rect(Rect2(-14, 24, 28, 3), Color(0.05, 0.06, 0.10, 0.25))
|
||||
if ground_pound_active:
|
||||
# Los trazos dorados tipo baqueta pertenecen solo a Ivan.
|
||||
if ground_pound_active and character_data != null and character_data.ground_pound_effect == "ground_pound":
|
||||
for side: float in [-1.0, 1.0]:
|
||||
draw_line(Vector2(17 * side, -30), Vector2(17 * side, -9), Color(1.0, 0.8, 0.45, 0.75), 2.0)
|
||||
# Los mensajes de objetos se muestran aunque este desactivada la depuracion de colisiones.
|
||||
|
||||
Reference in new issue
Block a user