namespace = game_start

### Change homeworld to Tombworld if have Post-Apocalyptic civic on Game Start
country_event = {
	id = game_start.32
	hide_window = yes
	is_triggered_only = yes

	trigger = { 
		OR = { 
			has_civic = civic_post_apocalyptic 
			has_civic = civic_machine_terminator
		}
	}

	immediate = {
		random_owned_planet ={
			limit = { is_capital = yes
					  NOT = { is_planet_class = pc_ringworld_habitable }
			}
			change_pc = pc_nuked
		}
		random_owned_planet ={
			limit = { is_capital = yes }
			reset_start_buildings_and_blockers_post_apoc = yes
		}
	}
}

### Change homeworld to Gaia World if have Life-Seeded civic on Game Start
country_event = {
	id = game_start.34
	hide_window = yes
	is_triggered_only = yes

	trigger = { has_civic = civic_life_seeded }

	immediate = {
		every_owned_pop = {
			modify_species = {
				species = this
				ideal_planet_class = pc_gaia
				base = none # makes this replace parent species
			}
		}
		random_owned_planet = {
			limit = { is_capital = yes
					  NOT = { is_planet_class = pc_ringworld_habitable }
			}
			change_pc = pc_gaia
			set_planet_size = 25
			reroll_deposits = yes
			reset_start_buildings_and_blockers_life_seeded = yes
		}
		# Nuke other colonies gained from advanced empire, etc
		every_owned_planet = {
			limit = { is_capital = no }
			every_tile = { 
				kill_pop = yes 
				remove_building = yes
			}
		}
		change_dominant_species = { species = last_created change_all = yes }
	}
}