# possible - filters out achivements on game start so we dont have to check everything all the time
# happened - checks if achivement happened

peccavi = {
	possible = {
		always = no
		# has_variable = peccavi_ach_possible
	}
	happened = {
		always = no
		# exists = c:BIC
		# this = c:BIC
		# c:BIC = {
			# owns_entire_state_region = STATE_SINDH
			# owns_entire_state_region = STATE_PUNJAB
		# }
	}
}

perkeletankki = { 
	possible = {
		always = no
		# has_variable = perkeletankki_ach_possible
	}
	happened = {
		always = no
		# exists = c:FIN
		# this = c:FIN
		# hidden_trigger = {
			# market_capital.market = {
				# mg:tanks = {
					# market_goods_production >= 100
				# }
			# }
		# }
	}
}



luxurious_luxembourg = {
	possible = {
		always = no
		# has_variable = luxurious_luxembourg_ach_possible
	}
	happened = {
		always = no
		# exists = c:LUX
		# this = c:LUX
		# c:LUX = {
			# leading_producer_of = g:luxury_clothes
			# leading_producer_of = g:luxury_furniture
			# leading_producer_of = g:porcelain
		# }
	}
}

anarchy_in_the_uk = {
	possible = {
		always = no
		# has_variable = anarchy_in_the_uk_ach_possible
	}
	happened = {
		always = no
		# exists = c:GBR
		# this = c:GBR
		# hidden_trigger = {
			# c:GBR = {
				# has_law = law_type:law_anarchy
			# }
		# }
	}
}

muhammed_alis_ambition = {
	possible = {
		always = no
		# has_variable = muhammed_alis_ambition_ach_possible
	}
	happened = {
		always = no
		# exists = c:ARA
		# this = c:ARA
		# hidden_trigger = {
			# c:ARA = {
				# owns_entire_state_region = STATE_EASTERN_THRACE
			# }
		# }
	}
}

an_empire_under_the_pun = {
	possible = {
		always = no
		# has_variable = an_empire_under_the_pun_ach_possible
	}
	happened = {
		always = no
		# exists = c:PAN
		# this = c:PAN
		# hidden_trigger = {
			# c:GBR = {
				# is_subject_of = c:PAN
			# }
		# }
	}
}

i_didnt_vote_for_pedro = {
	possible = {
		always = no
		# has_variable = i_didnt_vote_for_pedro_ach_possible
	}
	happened = {
		always = no
		# exists = c:BRZ
		# this = c:BRZ
		# C:BRZ = {
			# OR = {
				# has_law = law_type:law_presidential_republic
				# has_law = law_type:law_parliamentary_republic
			# }
			# has_law = law_type:law_universal_suffrage
		# }
	}
}

go_west_young_man = {
	possible = {
		always = no
		# has_variable = go_west_young_man_ach_possible
	}
	happened = {
		always = no
		# exists = c:USA
		# this = c:USA
		# hidden_trigger = {
			# C:USA = {
				# s:STATE_CALIFORNIA= {
					# exists = region_state:USA
					# region_state:USA = {
						# is_split_state = no
						# state_population >= 250000
					# }
				# }
				# s:STATE_OREGON= {
					# exists = region_state:USA
					# region_state:USA = {
						# is_split_state = no
						# state_population >= 250000
					# }
				# }
				# s:STATE_WASHINGTON= {
					# exists = region_state:USA
					# region_state:USA = {
						# is_split_state = no
						# state_population >= 250000
					# }
				# }
			# }
		# }
	}
}

the_western_protectorate = {
	possible = {
		always = no
		# has_variable = the_western_protectorate_ach_possible
	}
	happened = {
		always = no
		# custom_tooltip = {
			# text = the_western_protectorate_tt
			# exists = c:CHI
			# this = c:CHI
			# c:CHI = {
				# french_treaty_ports = yes
				# german_treaty_ports = yes
				# british_treaty_ports = yes
				# italian_treaty_ports = yes
				# iberian_treaty_ports = yes
			# }
		# }
	}
}

the_paris_commune = {
	possible = {
		always = no
		# has_variable = the_paris_commune_ach_possible
	}
	happened = {
		always = no
		# exists = c:FRA
		# this = c:FRA
		# c:FRA = {
			# has_law = law_type:law_command_economy
			# has_law = law_type:law_council_republic
		# }
	}
}

barbarys_back = {
	possible = {
		has_variable = barbarys_back_ach_possible
	}
	happened = {
		exists = c:ALD
		this = c:ALD
		hidden_trigger = {
			c:ALD = {
				owns_entire_state_region = STATE_ALGIERS
				country_rank >= rank_value:major_power
			}
		}
	}
}

miners_and_minors = {
	possible = {
		always = no
		# has_variable = miners_and_minors_ach_possible
	}
	happened = {
		always = no
		# exists = c:LAN
		# this = c:LAN
		# hidden_trigger = {
			# c:LAN = {
				# owns_entire_state_region = STATE_EAST_BORNEO
				# any_scope_state = {
					# state_region = s:STATE_EAST_BORNEO
					# is_incorporated = yes
				# }
				# owns_entire_state_region = STATE_NORTH_BORNEO
				# any_scope_state = {
					# state_region = s:STATE_NORTH_BORNEO
					# is_incorporated = yes
				# }
				# owns_entire_state_region = STATE_WEST_BORNEO
				# any_scope_state = {
					# state_region = s:STATE_WEST_BORNEO
					# is_incorporated = yes
				# }
				# has_law = law_type:law_compulsory_primary_school
			# }
		# }
	}
}

healthy_man_of_europe = {
	possible = {
		always = no
		# has_variable = healthy_man_of_europe_ach_possible
	}
	happened = {
		always = no
		# exists = c:TUR
		# this = c:TUR
			# hidden_trigger = {
			# c:TUR = {
				# institution_investment_level = {
					# institution = institution_health_system
					# value = 5
				# }
				# global_country_ranking = 1
			# }
		# }
	}
}

habsburg_resurgence = {
	possible = {
		always = no
		# has_variable = habsburg_resurgence_ach_possible
	}
	happened = {
		always = no
		# exists = c:AUS
		# this = c:AUS
		# hidden_trigger = {
			# c:AUS = {
				# owns_entire_state_region = STATE_SILESIA
			# }
			# or = {
				# NOT = { 
					# c:PRU = {
						# is_country_alive = yes
					# }
				# }
				# c:PRU = { 
					# country_rank < rank_value:major_power 
				# }
			# }
		# }
	}
}

great_game = {
	possible = {
		always = no
		# has_variable = great_game_ach_possible
	}
	happened = {
		always = no
		# exists = c:RUS
		# this = c:RUS
		# hidden_trigger = {
			# c:RUS = {
				# owned_central_asia_region_states = yes
			# }
		# }
	}
}

bourbon_for_everyone = {
	possible = {
		always = no
		# has_variable = bourbon_for_everyone_ach_possible
	}
	happened = {
		always = no
		# exists = c:SPA
		# this = c:SPA
		# hidden_trigger = {
			# c:SPA = {
				# root.average_sol >= 20
				# has_law = law_type:law_monarchy
			# }
		# }
	}
}

manifest_mexico = {
	possible = {
		always = no
	}
	happened = {
		always = no
		# exists = c:MEX
		# this = c:MEX
		# c:MEX = {
			# owned_great_plains_region_states = yes
			# owned_pacific_coast_region_states = yes
			# country_rank >= rank_value:great_power
		# }
		# OR = {
			# NOT = {
				# c:USA = {
					# is_country_alive = yes 
				# }
			# }
			# c:USA = {
				# country_rank <= rank_value:major_power
			# }
		# }
	}
}

american_territory = {
	possible = {
		always = no
		# has_variable = american_territory_ach_possible
	}
	happened = {
		always = no
		# exists = c:SEQ
		# this = c:SEQ
		# exists = c:USA
		# c:USA ={
			# is_subject = c:SEQ
			# any_scope_state = {
				# count <= 3
			# }
		# }
	}
}

broken_promises = { 
	possible = {
		has_variable = broken_promises_ach_possible
	}
	happened = {
		exists = c:ITA
		this = c:ITA
		hidden_trigger = {
			c:ITA = {
				is_diplomatic_play_committed_participant = yes
				any_diplomatic_play = {
					NOT = {
						OR = {
							initiator_is = c:ITA
							target_is = c:ITA
						}
					}
					OR = {
						AND = {
							any_scope_initiator_ally = {
								this = c:ITA
							}
							any_scope_target_ally = {
								count >= 2
								any_scope_ally = {
									this = c:ITA
								}
							}
						}
						AND = {
							any_scope_target_ally = {
								this = c:ITA
							}
							any_scope_initiator_ally = {
								count >= 2
								any_scope_ally = {
									this = c:ITA
								}
							}
						}
					}
				}
			}
		}
	}
}

the_berlin_conference = {
	possible = {
		has_variable = the_berlin_conference_ach_possible
	}
	happened = {
		exists = c:GER
		this = c:GER
		hidden_trigger = {
			c:GER = {
				any_scope_state = {
					OR = {
						european_colonies_north_africa = yes
						european_colonies_west_africa = yes
						european_colonies_nile_basin = yes
						european_colonies_central_africa = yes
						european_colonies_east_africa = yes
						european_colonies_south_africa = yes
					}
					count = 10
					is_incorporated = no
				}
			}
		}
	}
}

belle_epoque = {
	possible = {
		always = no
		# has_variable = belle_epoque_ach_possible
	}
	happened = {
		always = no
		# exists = c:FRA
		# this = c:FRA
		# hidden_trigger = {
			# c:FRA = {
				# has_global_highest_gdp = yes
				# has_global_highest_innovation = yes
			# }
		# }
	}
}

deeds_not_words = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			has_law = law_type:law_womens_suffrage
		}
	}
}

first_flight = { 
	possible = {
	}
	happened = {
		hidden_trigger = {
			has_variable = first_flight_achievement_check
		}
	}
}

victorian_century = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			game_date > 1935.12.30
		}
	}
}

poor_huddled_masses = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			any_scope_state = {	
				is_mass_migration_target = yes 
			}
		}
	}
}

billionare = { 
	possible = {
	}
	happened = {
		hidden_trigger = {
			GDP >= 1000000000
		}
	}
}

serfs_up = { 
	possible = {
		has_variable = serfs_up_ach_possible
	}
	happened = {
		hidden_trigger = {
			has_law = law_type:law_worker_protections
		}
	}
}

risorgimento = {
	possible = {
		has_variable = risorgimento_ach_possible
	}
	happened = {
		exists = c:ITA
		this = c:ITA
	}
}

three_hurrahs = {
	possible = {
		has_variable = three_hurrahs_ach_possible
	}
	happened = {
		exists = c:GER
		this = c:GER
	}
}

solomons_quest = {
	possible = {
		always = no
		# has_variable = solomons_quest_ach_possible
	}
	happened = {
		always = no
		# exists = c:ETH
		# this = c:ETH
	}
}

i_am_a_scandinavian = {
	possible = {
		always = no
		# has_variable = i_am_a_scandinavian_ach_possible
	}
	happened = {
		always = no
		# exists = c:SCA
		# this = c:SCA
	}
}

enlightened_despot = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			has_law = law_type:law_autocracy 
			any_scope_state = {
				percent = 1
				is_production_method_active = {
					building_type = building_urban_center
					production_method = pm_electric_streetlights
				}
			}
		}
	}
}

mightier_than_the_sword = {
	possible = {
		NOT = { has_global_variable = achievement_mightier_than_the_sword }
	}
	happened = {
		hidden_trigger = {
			has_global_variable = achievement_mightier_than_the_sword
		}
	}
}

revolutionary = {
	possible = {
		NOT = { has_global_variable = achievement_revolutionary }
	}
	happened = {
		hidden_trigger = {
			has_global_variable = achievement_revolutionary
		}
	}
}

reading_campaign = {
	possible = {
		has_variable = reading_campaign_ach_possible
	}
	happened = {
		literacy_rate = 1
	}
}

we_are_not_amused = {
	possible = {
		always = no
		# has_variable = we_are_not_amused_ach_possible
	}
	happened = {
		always = no
		# exists = c:GBR
		# exists = c:FRA
		# this = c:GBR
		# NOT = {
			# c:FRA = {
				# relations:root < relations_threshold:cordial
			# }
		# }
		# root = { has_diplomats_expelled = c:FRA }
	}
}

institutional = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			or = {
				institution_investment_level = {
					institution = institution_police
					value = 5
				}
				institution_investment_level = {
					institution = institution_colonial_affairs
					value = 5
				}
				institution_investment_level = {
					institution = institution_social_security
					value = 5
				}
				institution_investment_level = {
					institution = institution_workplace_safety
					value = 5 
				}
				institution_investment_level = {
					institution = institution_schools
					value = 5
				}
				institution_investment_level = {
					institution = institution_health_system
					value = 5
				}
				institution_investment_level = {
					institution = institution_home_affairs
					value = 5
				}
			}
		}
	}
}

poppydock = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			any_scope_state = {
				has_building = building_port
				count >= 8
			}
			market = {
				mg:opium = {
					market_goods_exports >= 2500
				}
			}
		}
	}
}

grander_colombia = {
	possible = {
		always = no
	}
	happened = { 
		always = no
		# exists = c:GCO
		# this = c:GCO
		# c:GCO = {
			# custom_tooltip = {
				# text = own_all_gran_colombia_tt
				# owned_gran_colombia_region_states = yes
			# }
			# custom_tooltip = {
				# text = own_all_andes_tt
				# owned_andes_region_states = yes
			# }
			# custom_tooltip = {
				# text = own_all_la_plata_tt
				# owned_la_plata_region_states = yes
			# }
		# }
	}
}

inventive = {
	possible = {
	}
	happened = {
		hidden_trigger = {
			NOT = { 
				has_researchable_technology = yes 
			}
		}
	}
}

educated = { 
	possible = {
		has_objective = objective_tutorial
	}
	happened = {
		hidden_trigger = {
			is_objective_completed = yes
		}
	}
}

tycoon = { 
	possible = {
		has_objective = objective_economic_dominance
	}
	happened = {
		hidden_trigger = {
			is_objective_completed = yes
		}
	}
}

hegemon = {
	possible = {
		has_objective = objective_hegemon
	}
	happened = {
		hidden_trigger = {
			is_objective_completed = yes
		}
	}
}

caretaker = {
	possible = {
		has_objective = objective_egalitarian_society
	}
	happened = {
		hidden_trigger = {
			is_objective_completed = yes
		}
	}
}

star_swarmed_banner = {
	possible = {
		always = no
		# has_variable = star_swarmed_banner_ach_possible
	}
	happened = {
		always = no
		# custom_tooltip = {
			# text = star_swarmed_banner_tt
			# exists = c:USA
			# this = c:USA
			# c:USA = {
				# any_scope_state = {
					# hidden_trigger = {
						# state_region = { NOT = { has_variable = usa_state_flag_block } }
					# }
					# is_incorporated = yes
					# count = 100
				# }
				# has_law = law_type:law_presidential_republic
				# NOT = { has_law = law_type:law_autocracy }
			# }
		# }
	}
}