2026-10-28 15:39:06 +02:00
extends RefCounted
var failures = 0
func check ( ok , label ) :
if not ok : failures + = 1 ; push_error ( " VISUAL QA: " + label )
func run ( g ) :
await g . get_tree ( ) . create_timer ( . 3 ) . timeout
g . start_game ( ) ; g . paused = true
var w = g . workshop
for kind in range ( 10 ) :
var actor = preload ( " res://soul_actor.gd " ) . new ( kind ) ; g . add_child ( actor ) ; actor . configure ( g ) ; actor . rotation = Vector3 . ZERO
actor . mount_station ( 4 ) ; actor . update_torture ( . 1 , true )
check ( actor . bone_local ( " root " ) . distance_to ( Vector3 ( 0 , . 90 , - . 12 ) ) < . 02 , " chair pelvis %d " %kind )
for side in [ " L " , " R " ] :
var x = 1 if side == " L " else - 1
print ( " CHAIR " , kind , " " , side , " foot= " , actor . bone_local ( " foot. " + side ) , " wrist= " , actor . bone_local ( " wrist. " + side ) )
2026-10-29 16:30:06 +02:00
check ( actor . bone_local ( " foot. " + side ) . distance_to ( Vector3 ( x * . 23 , . 42 , . 48 ) ) < . 13 , " chair ankle on raised footrest %d " %kind )
2026-10-28 15:39:06 +02:00
check ( actor . bone_local ( " wrist. " + side ) . distance_to ( Vector3 ( x * . 61 , 1.15 , . 2 ) ) < . 12 , " chair wrist %d " %kind )
var before = actor . bone_world ( " head " ) ; actor . update_torture ( . 2 , true )
check ( actor . bone_world ( " head " ) . distance_to ( before ) > . 001 , " chair reaction " )
actor . mount_station ( 0 ) ; actor . update_torture ( . 1 , false ) ; actor . whip_reaction ( ) ; actor . update_torture ( . 05 , true ) ; check ( actor . impulse > 0 , " whip recoil " )
actor . mount_station ( 5 ) ; actor . update_torture ( . 1 , true ) ; before = actor . bone_world ( " wrist.L " ) ; actor . update_torture ( . 2 , true ) ; check ( actor . bone_world ( " wrist.L " ) . distance_to ( before ) > . 01 , " cauldron arm animation " )
actor . unmount_station ( ) ; check ( actor . model . position == Vector3 . ZERO and not actor . mounted , " pose reset " ) ; actor . queue_free ( )
for kind in [ 0 , 1 , 2 , 4 , 5 ] :
var d = w . add_station ( kind , Vector3 ( kind * 2 , 0 , 0 ) )
if kind == 0 : check ( d . device . get_meta ( " pillory_apertures " ) == 3 , " open pillory " )
if kind == 2 : check ( d . motion . water . get_meta ( " water_vertices " ) > 18000 , " dense wheel water " )
if kind == 5 : check ( d . special . liquid . get_meta ( " water_vertices " ) > 18000 , " dense boiling water " )
for node in g . get_children ( ) :
if node is MultiMeshInstance3D :
for index in range ( node . multimesh . instance_count ) :
var at = node . multimesh . get_instance_transform ( index ) . origin
check ( not ( absf ( at . x - 7.65 ) < . 05 and at . y > . 3 and absf ( at . z ) < 5.1 ) , " old interior wall removed " )
var soul = g . souls [ 0 ] ; soul . required = [ 0 ] ; w . sentences . update_label ( soul )
check ( soul . task_icon_nodes [ 0 ] . custom_minimum_size . is_equal_approx ( Vector2 ( 28.8 , 28.8 ) ) , " icons +20 percent " )
var effect = preload ( " res://whip_impact.gd " ) . new ( ) ; soul . visual . mount_station ( 0 ) ; soul . visual . update_torture ( 0 , false ) ; effect . play ( g , w . stations [ 0 ] . device , soul . visual )
check ( effect . particles . size ( ) == 14 , " whip particles " )
effect . _process ( . 2 ) ; check ( effect . age == 0 , " effect freezes on pause " ) ; g . paused = false ; effect . _process ( . 4 )
await g . get_tree ( ) . process_frame ; check ( not is_instance_valid ( effect ) , " effect expires " )
if failures == 0 : print ( " ALL VISUAL TESTS PASSED: ten skeletons, chair IK, device reactions, dense water, enlarged icons, VFX pause and cleanup " )
g . get_tree ( ) . quit ( 1 if failures else 0 )