class_name P99RuntimeFixture extends RefCounted const P98Fixture = preload("res://tests/p9_8/runtime_fixture.gd") const BossService = preload("res://p9_8/boss_service.gd") const BossBattleService = preload("res://p9_8/boss_battle_service.gd") const CharterService = preload("res://p9_9/charter_service.gd") static func closed_p98() -> Dictionary: var operations = BossService.new() assert(operations.state.restore_snapshot(P98Fixture.boss_muster())) var plan: Dictionary = operations.commit_boss_plan("p99-fixture-plan", "rotate") assert(plan.ok) var battle = BossBattleService.new() var started: Dictionary = battle.start_from_contract(operations.state) assert(started.ok) var guard := 0 while not battle.state.terminal and guard < 3000: battle.advance_ticks(1) guard += 1 assert(battle.state.outcome == "victory") var settled: Dictionary = operations.settle_boss("p99-fixture-settle", battle.state.snapshot()) assert(settled.ok) var closed: Dictionary = operations.close_contract("p99-fixture-close") assert(closed.ok) return operations.state.snapshot() static func claimed_profile(claim_id := "CH-RG01-CATALOG-01") -> Dictionary: var charter = CharterService.new(closed_p98()) var result: Dictionary = charter.claim("p99-fixture-%s" % claim_id, claim_id, charter.state.revision) assert(result.ok) return charter.state.snapshot()