feat: complete playtest parity improvements

This commit is contained in:
goose
2026-10-08 19:06:19 -04:00
parent cce25a1908
commit eca098b4b9
139 changed files with 3001 additions and 982 deletions
+24 -4
View File
@@ -9,7 +9,7 @@ var game: Game
func before_each() -> void:
game = GameScene.instantiate()
game.configure_new_run(RunSettings.new("E4-PET-E2E", &"crawler", false, true), "Pet Tester", &"vanguard")
game.configure_new_run(RunSettings.new("E4-PET-E2E", &"crawler", false, true), "Pet Tester")
add_child_autofree(game)
await get_tree().process_frame
await get_tree().process_frame
@@ -24,20 +24,40 @@ func test_pet_choice_spawns_visible_companion_and_real_input_changes_command_sta
await _dispatch_key(KEY_K)
assert_true(panel.visible)
assert_string_contains((panel.get_node("Body") as RichTextLabel).get_parsed_text(), "Follow")
var panel_text := (panel.get_node("Body") as RichTextLabel).get_parsed_text()
assert_string_contains(panel_text, "Reste en arrière")
assert_string_contains(panel_text, "Défends-moi")
assert_string_contains(panel_text, "Attaque à vue")
await _dispatch_key(KEY_RIGHT)
assert_eq(companion.stance, CompanionState.Stance.DEFEND)
assert_eq(companion.stance, CompanionState.Stance.DEFEND_ME)
assert_string_contains(String(game.get_run_state().recent_events(1)[0].kind), "companion_stance")
await _dispatch_key(KEY_ESCAPE)
assert_false(panel.visible)
func test_companion_uses_the_temporary_dog_sprite() -> void:
var companion_sprite := game.get_node("World/Companion") as Sprite2D
assert_not_null(companion_sprite.texture)
assert_string_contains(companion_sprite.texture.resource_path, "war_dog.png")
func test_floor_transition_places_the_living_pet_next_to_the_player() -> void:
var state := game.get_game_state()
state.player.cell = state.floor_state.exit
state.exit_reached = false
game.get_run_state().current_floor_deadline().turns_remaining = 0
game.submit_player_action(preload("res://scripts/domain/run/player_action.gd").new(&"interact"))
assert_eq(game.get_run_state().current_floor, 1)
assert_lte(state.companion.actor.cell.distance_to(state.player.cell), 1.0)
assert_ne(state.companion.actor.cell, state.player.cell)
func test_live_enemy_attack_is_intercepted_in_support_and_companion_death_leaves_player_run_alive() -> void:
var state := game.get_game_state()
var companion := state.companion
companion.actor.hit_points = 1
companion.actor.max_hit_points = 1
companion.actor.cell = state.player.cell + Vector2i.RIGHT
assert_true(companion.set_stance(CompanionState.Stance.SUPPORT))
assert_true(companion.set_stance(CompanionState.Stance.DEFEND_ME))
var enemy: ActorState = state.enemies.values()[0]
enemy.cell = state.player.cell + Vector2i.LEFT
enemy.weapon_damage = 20