﻿# Grand Remembrance AGOT Debug - Scripted Effects
# Sets the minimum base GR variables needed for gr_obituary.10 to render.
# AGOT-specific vars are set inline in each test event.

gr_agot_debug_base_setup = {
	# --- Predecessor / Chronicler ---
	# Points both at ROOT (the player character) so loc tokens resolve correctly.
	set_variable = { name = gr_predecessor value = root }
	set_variable = { name = gr_chronicler value = root }
	set_variable = { name = gr_chronicler_type value = flag:court_chronicler }

	# --- Title tier and count ---
	set_variable = { name = gr_tier value = 4 }        # King
	set_variable = { name = gr_title_count value = 1 }
	set_variable = { name = gr_title_1 value = root.primary_title }

	# --- Identity (pulls from actual character so names/house render correctly) ---
	set_variable = { name = gr_house_name value = root.house }
	set_variable = { name = gr_culture value = root.culture }

	# --- Reign / death details ---
	set_variable = { name = gr_reign_years value = 24 }
	set_variable = { name = gr_death_age value = 52 }
	set_variable = { name = gr_death_year value = 190 }  # AC year for AGOT context
	set_variable = { name = gr_death_reason value = flag:old_age }

	# --- Opinion (positive default; override per-test as needed) ---
	set_variable = { name = gr_opinion value = 50 }

	# --- Score ---
	set_variable = { name = gr_score value = 1800 }
	set_variable = { name = gr_legacy_score value = 1800 }
	set_variable = { name = gr_dynasty_total value = 1800 }
	set_variable = { name = gr_score_tier value = flag:magnificent }

	# --- Random seed (0 = first variant; override per-test to check other variants) ---
	set_variable = { name = gr_random_seed value = 0 }
}

# Removes every gr_agot_ variable from ROOT.
# Fire gr_agot_debug.99 from console to clean up between tests.
gr_agot_debug_cleanup = {
	# --- Trait vars ---
	if = { limit = { has_variable = gr_agot_dragonrider }     remove_variable = gr_agot_dragonrider }
	if = { limit = { has_variable = gr_agot_dragonless }      remove_variable = gr_agot_dragonless }
	if = { limit = { has_variable = gr_agot_dragonwidowed }   remove_variable = gr_agot_dragonwidowed }
	if = { limit = { has_variable = gr_agot_dragonslayer }    remove_variable = gr_agot_dragonslayer }
	if = { limit = { has_variable = gr_agot_kingsguard }      remove_variable = gr_agot_kingsguard }
	if = { limit = { has_variable = gr_agot_nightswatch }     remove_variable = gr_agot_nightswatch }
	if = { limit = { has_variable = gr_agot_nw_lifestyle }    remove_variable = gr_agot_nw_lifestyle }
	if = { limit = { has_variable = gr_agot_deserter }        remove_variable = gr_agot_deserter }
	if = { limit = { has_variable = gr_agot_knight }          remove_variable = gr_agot_knight }
	if = { limit = { has_variable = gr_agot_squire }          remove_variable = gr_agot_squire }
	if = { limit = { has_variable = gr_agot_stripped_knight } remove_variable = gr_agot_stripped_knight }
	if = { limit = { has_variable = gr_agot_maester }         remove_variable = gr_agot_maester }
	if = { limit = { has_variable = gr_agot_religious_role }  remove_variable = gr_agot_religious_role }
	if = { limit = { has_variable = gr_agot_greyscale }       remove_variable = gr_agot_greyscale }
	if = { limit = { has_variable = gr_agot_burned }          remove_variable = gr_agot_burned }
	if = { limit = { has_variable = gr_agot_one_handed }      remove_variable = gr_agot_one_handed }
	if = { limit = { has_variable = gr_agot_crippled }        remove_variable = gr_agot_crippled }
	if = { limit = { has_variable = gr_agot_mute }            remove_variable = gr_agot_mute }
	if = { limit = { has_variable = gr_agot_dragon_dreams }   remove_variable = gr_agot_dragon_dreams }
	if = { limit = { has_variable = gr_agot_greensight }      remove_variable = gr_agot_greensight }
	if = { limit = { has_variable = gr_agot_authoritative }   remove_variable = gr_agot_authoritative }
	if = { limit = { has_variable = gr_agot_rude }            remove_variable = gr_agot_rude }
	if = { limit = { has_variable = gr_agot_inquisitive }     remove_variable = gr_agot_inquisitive }
	if = { limit = { has_variable = gr_agot_uncouth }         remove_variable = gr_agot_uncouth }
	if = { limit = { has_variable = gr_agot_paramour }        remove_variable = gr_agot_paramour }
	if = { limit = { has_variable = gr_agot_spider }          remove_variable = gr_agot_spider }
	if = { limit = { has_variable = gr_agot_kinslayer_accidental } remove_variable = gr_agot_kinslayer_accidental }
	if = { limit = { has_variable = gr_agot_broke_vows }      remove_variable = gr_agot_broke_vows }
	if = { limit = { has_variable = gr_agot_fire_obsessed }   remove_variable = gr_agot_fire_obsessed }
	if = { limit = { has_variable = gr_agot_faith }           remove_variable = gr_agot_faith }
	if = { limit = { has_variable = gr_agot_heritage }        remove_variable = gr_agot_heritage }
	# --- War vars ---
	if = { limit = { has_variable = gr_agot_war_reyne }       remove_variable = gr_agot_war_reyne }
	if = { limit = { has_variable = gr_agot_war_blackfyre }   remove_variable = gr_agot_war_blackfyre }
	if = { limit = { has_variable = gr_agot_war_ninepenny }   remove_variable = gr_agot_war_ninepenny }
	if = { limit = { has_variable = gr_agot_war_faegon }      remove_variable = gr_agot_war_faegon }
	if = { limit = { has_variable = gr_agot_war_daemon }      remove_variable = gr_agot_war_daemon }
	if = { limit = { has_variable = gr_agot_war_duskendale }  remove_variable = gr_agot_war_duskendale }
	if = { limit = { has_variable = gr_agot_war_dragon }      remove_variable = gr_agot_war_dragon }
	if = { limit = { has_variable = gr_agot_war_dragon_tier } remove_variable = gr_agot_war_dragon_tier }
	if = { limit = { has_variable = gr_agot_war_ranging }     remove_variable = gr_agot_war_ranging }
	if = { limit = { has_variable = gr_agot_war_wall_reclaim } remove_variable = gr_agot_war_wall_reclaim }
	if = { limit = { has_variable = gr_agot_war_rebellion }   remove_variable = gr_agot_war_rebellion }
	if = { limit = { has_variable = gr_agot_war_succession }  remove_variable = gr_agot_war_succession }
	if = { limit = { has_variable = gr_agot_war_independence } remove_variable = gr_agot_war_independence }
	if = { limit = { has_variable = gr_agot_war_pirate }      remove_variable = gr_agot_war_pirate }
	if = { limit = { has_variable = gr_agot_war_slavery }     remove_variable = gr_agot_war_slavery }
	if = { limit = { has_variable = gr_agot_war_eradicate }   remove_variable = gr_agot_war_eradicate }
	if = { limit = { has_variable = gr_agot_iron_throne }     remove_variable = gr_agot_iron_throne }
	if = { limit = { has_variable = gr_agot_sub_kingdom_count } remove_variable = gr_agot_sub_kingdom_count }
	if = { limit = { has_variable = gr_agot_half_blind }      remove_variable = gr_agot_half_blind }
	if = { limit = { has_variable = gr_agot_the_mark }        remove_variable = gr_agot_the_mark }
	if = { limit = { has_variable = gr_agot_shivers }         remove_variable = gr_agot_shivers }
	if = { limit = { has_variable = gr_agot_scurvy }          remove_variable = gr_agot_scurvy }
	if = { limit = { has_variable = gr_agot_govt_old }        remove_variable = gr_agot_govt_old }
	if = { limit = { has_variable = gr_agot_govt_new }        remove_variable = gr_agot_govt_new }
	if = { limit = { has_variable = gr_memory_govt_change }   remove_variable = gr_memory_govt_change }
	if = { limit = { has_variable = gr_agot_bank_defaulted }  remove_variable = gr_agot_bank_defaulted }
	if = { limit = { has_variable = gr_agot_bank_ib_shareholder } remove_variable = gr_agot_bank_ib_shareholder }
	if = { limit = { has_variable = gr_agot_bank_founder }    remove_variable = gr_agot_bank_founder }
	if = { limit = { has_variable = gr_agot_bank_died_in_debt } remove_variable = gr_agot_bank_died_in_debt }
	# --- Base GR vars set by debug setup ---
	if = { limit = { has_variable = gr_predecessor }          remove_variable = gr_predecessor }
	if = { limit = { has_variable = gr_chronicler }           remove_variable = gr_chronicler }
	if = { limit = { has_variable = gr_chronicler_type }      remove_variable = gr_chronicler_type }
	if = { limit = { has_variable = gr_tier }                 remove_variable = gr_tier }
	if = { limit = { has_variable = gr_title_count }          remove_variable = gr_title_count }
	if = { limit = { has_variable = gr_title_1 }              remove_variable = gr_title_1 }
	if = { limit = { has_variable = gr_house_name }           remove_variable = gr_house_name }
	if = { limit = { has_variable = gr_culture }              remove_variable = gr_culture }
	if = { limit = { has_variable = gr_reign_years }          remove_variable = gr_reign_years }
	if = { limit = { has_variable = gr_death_age }            remove_variable = gr_death_age }
	if = { limit = { has_variable = gr_death_year }           remove_variable = gr_death_year }
	if = { limit = { has_variable = gr_death_reason }         remove_variable = gr_death_reason }
	if = { limit = { has_variable = gr_opinion }              remove_variable = gr_opinion }
	if = { limit = { has_variable = gr_score }                remove_variable = gr_score }
	if = { limit = { has_variable = gr_legacy_score }         remove_variable = gr_legacy_score }
	if = { limit = { has_variable = gr_dynasty_total }        remove_variable = gr_dynasty_total }
	if = { limit = { has_variable = gr_score_tier }           remove_variable = gr_score_tier }
	if = { limit = { has_variable = gr_random_seed }          remove_variable = gr_random_seed }
}
