#Flavour decisions linked to power projection and prestige

eoanb_category_world_fairs = {

	#Hold a World Fair
	eoanb_decision_hold_world_fair = {
		icon = generic_form_nation

		available = {
			NOT = { has_global_flag = eoanb_world_fair_held_flag }
			NOT = { has_idea = pre_industrial_era }
			NOT = { has_idea = closed_economy }
			OR = {
				AND = {
					is_great_power = yes
					has_political_power > 200
				}
				AND = {
					is_secondary_power = yes
					has_political_power > 300
				}
			}
		}

		fire_only_once = no

		custom_cost_trigger = {
			if = {
				limit = { is_great_power = yes }
				has_political_power > 199.9
			}
			else = {
				has_political_power > 299.9
			}
		}

		custom_cost_text = eoanb_decision_hold_world_fair_cost_tt

		complete_effect = {
			custom_effect_tooltip = eoanb_tt_hold_world_fair
			hidden_effect = {
				country_event = eoanbworldfair.1
				set_variable = { world_fair_preparation_var = 0 }
				set_global_flag = eoanb_world_fair_held_flag
				if = {
					limit = { is_great_power = yes }
					add_political_power = -200
				}
				else = {
					add_political_power = -300
				}
			}
		}

		ai_will_do = {
			base = 1
			modifier = {
				factor = 0.1
				has_political_power < 500
			}
			modifier = {
				factor = 0
				has_national_crisis = yes
			}
			modifier = {
				factor = 0
				tag = PRS
				NOT = { PRS_trigger_formed_germany = yes }
			}
			modifier = {
				factor = 0
				tag = PIE
				NOT = { has_country_flag = is_literally_italy }
			}
			modifier = {
				factor = 0
				tag = TUS
				NOT = { has_country_flag = is_literally_italy }
			}
		}
	}

	#World Fair preparations counter
	eoanb_decision_hold_world_fair_counter = {

		icon = generic_decision

		activation = {
			has_country_flag = eoanb_flag_hold_world_fair_preparations
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = eoanb_tt_world_fair_preparation_done
				has_country_flag = eoanb_flag_hold_world_fair_preparations_reviewbudget
				has_country_flag = eoanb_flag_hold_world_fair_preparations_invite_participants
				has_country_flag = eoanb_flag_hold_world_fair_preparations_mainbuildings
			}
		}

        days_mission_timeout = 150

		fire_only_once = no

        timeout_effect = {
            hidden_effect = {
				country_event = { id = eoanbworldfair.8 days = 30 }
            }
        }
		complete_effect = {
            hidden_effect = {
                country_event = eoanbworldfair.2
            }
		}

		ai_will_do = {
			base = 1
		}
	}

	#Review the budget
	eoanb_decision_hold_world_fair_review_budget = {

		icon = generic_decision

		available = {
		}

		visible = {
			has_country_flag = eoanb_flag_hold_world_fair_preparations
			NOT = {
			    has_country_flag = eoanb_flag_hold_world_fair_preparations_reviewbudget
			}
		}

		fire_only_once = no

		cost = 0

		complete_effect = {
			custom_effect_tooltip = eoanb_tt_hold_world_fair_review_budget
			hidden_effect = {
			    country_event = eoanbworldfair.4
			}
		}

		ai_will_do = {
			base = 1
		}
	}

	#Invite Participants
	eoanb_decision_hold_world_fair_invite_attendees = {

		icon = generic_decision

		available = {
		}

		visible = {
			has_country_flag = eoanb_flag_hold_world_fair_preparations
			NOT = {
			    has_country_flag = eoanb_flag_hold_world_fair_preparations_invite_participants
			}
		}

		fire_only_once = no

		cost = 100

		complete_effect = {
			custom_effect_tooltip = eoanb_tt_hold_world_fair_invite_attendees
			# hidden_effect = {
			    every_country = {
				    limit = {
					    OR = {
				            is_great_power = yes
		            		is_secondary_power = yes
						}
						NOT = { tag = ROOT }
					}
			        country_event = eoanbworldfair.5
				}
				set_country_flag = eoanb_flag_hold_world_fair_preparations_invite_participants
			# }
		}

		ai_will_do = {
			base = 1
		}
	}

	#Main Buildings
	eoanb_decision_hold_world_fair_main_buildings = {

		icon = generic_decision

		available = {
		}

		visible = {
			has_country_flag = eoanb_flag_hold_world_fair_preparations
			NOT = {
			    has_country_flag = eoanb_flag_hold_world_fair_preparations_mainbuildings
			}
		}

		fire_only_once = no

		cost = 0

		complete_effect = {
			custom_effect_tooltip = eoanb_tt_hold_world_fair_main_buildings
			hidden_effect = {
			    country_event = eoanbworldfair.6
			}
		}

		ai_will_do = {
			base = 1
		}
	}
}