Add profile-specific attack motion curves

This commit is contained in:
2026-06-18 22:43:46 +09:00
parent 70a34cf262
commit 3cdadf8599
2 changed files with 91 additions and 4 deletions

View File

@@ -489,6 +489,7 @@ func _check_attack_motion_profiles(failures: Array[String]) -> void:
failures.append("heavy animation should use swing SFX before hit resolution")
if scene._action_motion_sfx("tactic_damage") != "skill_cast":
failures.append("tactic animation should use skill cast SFX")
_check_attack_motion_curves(failures, scene)
scene.free()
@@ -569,6 +570,46 @@ func _check_stored_attack_motion(failures: Array[String], scene, unit_id: String
failures.append("%s stored motion duration should be positive: %s" % [unit_id, str(motion)])
func _check_attack_motion_curves(failures: Array[String], scene) -> void:
var profiles := ["arrow", "cavalry_charge", "infantry_strike", "command_strike", "heavy_strike", "tactic_damage", "tactic_heal", "tactic_support", "slash"]
for profile in profiles:
for sample in [0.0, 0.25, 0.5, 0.75, 1.0]:
var lunge: float = scene._action_motion_lunge_curve(profile, sample)
var peak: float = scene._action_motion_effect_peak(profile, sample)
if lunge < -0.001 or lunge > 1.001:
failures.append("%s lunge curve out of bounds at %.2f: %.3f" % [profile, sample, lunge])
if peak < -0.001 or peak > 1.001:
failures.append("%s effect peak out of bounds at %.2f: %.3f" % [profile, sample, peak])
if absf(scene._action_motion_lunge_curve(profile, 0.0)) > 0.001:
failures.append("%s lunge should start near zero" % profile)
if absf(scene._action_motion_lunge_curve(profile, 1.0)) > 0.001:
failures.append("%s lunge should recover near zero" % profile)
var arrow_mid: float = scene._action_motion_lunge_curve("arrow", 0.5) * scene._action_motion_lunge_scale("arrow")
var infantry_mid: float = scene._action_motion_lunge_curve("infantry_strike", 0.5) * scene._action_motion_lunge_scale("infantry_strike")
var cavalry_mid: float = scene._action_motion_lunge_curve("cavalry_charge", 0.5) * scene._action_motion_lunge_scale("cavalry_charge")
var heavy_early: float = scene._action_motion_lunge_curve("heavy_strike", 0.25) * scene._action_motion_lunge_scale("heavy_strike")
var heavy_late: float = scene._action_motion_lunge_curve("heavy_strike", 0.72) * scene._action_motion_lunge_scale("heavy_strike")
var tactic_mid: float = scene._action_motion_lunge_curve("tactic_damage", 0.5) * scene._action_motion_lunge_scale("tactic_damage")
if not (arrow_mid < infantry_mid and tactic_mid < infantry_mid):
failures.append("lunge curves should keep arrow and tactic planted below infantry: arrow %.3f tactic %.3f infantry %.3f" % [arrow_mid, tactic_mid, infantry_mid])
if cavalry_mid <= infantry_mid:
failures.append("cavalry mid-lunge should exceed infantry: cavalry %.3f infantry %.3f" % [cavalry_mid, infantry_mid])
if heavy_late <= heavy_early:
failures.append("heavy strike should build toward a later lunge: early %.3f late %.3f" % [heavy_early, heavy_late])
if scene._action_motion_effect_peak("arrow", 0.34) <= scene._action_motion_effect_peak("arrow", 0.82):
failures.append("arrow effect should peak early and fade after flight")
if scene._action_motion_effect_peak("heavy_strike", 0.62) <= scene._action_motion_effect_peak("heavy_strike", 0.25):
failures.append("heavy effect should peak later than its wind-up")
if scene._action_motion_effect_peak("heavy_strike", 1.0) > 0.001:
failures.append("heavy effect should fade near zero by the end")
if scene._action_motion_effect_peak("command_strike", 0.0) <= 0.0:
failures.append("command effect should keep a visible ring during wind-up")
if scene._action_motion_effect_peak("tactic_heal", 0.0) <= 0.0:
failures.append("tactic heal effect should keep a visible sigil during wind-up")
func _check_attack_motion_signal(failures: Array[String]) -> void:
var state = BattleStateScript.new()
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):