namespace = achievement

# Clash of the Titans
country_event = {
	id = achievement.1
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		is_ai = no
		from = {
			OR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
		fromfromfrom = {
			any_controlled_ship = { is_ship_size = massive_ship_fallen_empire }
		}
		fromfrom = {
			any_controlled_ship = { is_ship_size = titan }
		}
		NOT = { has_country_flag = clash_of_the_titans }
	}

	immediate = {
		set_country_flag = clash_of_the_titans
	}
}

# Stay on Target
country_event = {
	id = achievement.2
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		is_ai = no
		fromfromfrom = {
			is_ship_size = colossus
			OR = {
				has_status = firing
				has_status = charging
			}
		}
	}

	immediate = {
		set_country_flag = stay_on_target
	}
}

# Pandora's World
country_event = {
	id = achievement.3
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		is_ai = no
		NOT = { has_country_flag = pandoras_world }
		from.owner = {
			OR = {
				has_valid_civic = civic_machine_terminator
				has_valid_civic = civic_hive_devouring_swarm
				has_valid_civic = civic_fanatic_purifiers
			}
		}
	}

	immediate = {
		set_country_flag = pandoras_world
	}
}

# Emissary
fleet_event = {
	id = achievement.4
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		owner = {
			is_ai = no
			NOT = { has_country_flag = emissary }
		}
	}

	immediate = {
		owner = { set_country_flag = emissary }
	}
}

# Unlimited Power!
country_event = {
	id = achievement.5
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		is_ai = no
		NOT = { has_country_flag = unlimited_power_achievement }
	}

	immediate = {
		set_country_flag = unlimited_power_achievement
	}
}

# Archaeologist
fleet_event = {
	id = achievement.6
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		owner = {
			is_ai = no
			NOT = { has_country_flag = archaeologist_achievement }
		}
	}

	immediate = {
		owner = { set_country_flag = archaeologist_achievement }
	}
}

# Terraform
carrier_event = {
	id = achievement.7
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		from = {
			is_ai = no
			NOT = { has_country_flag = paradise_found_achievement }
		}
	}

	immediate = {
		from = { set_country_flag = terraform_achievement }
		if = {
			limit = { is_planet_class = pc_gaia }
			from = {
				set_country_flag = paradise_found_achievement
			}
		}
	}
}
