﻿#######################
# War Creation Events #
#######################
# Scripted by Mechano
#
# These events exist for AI reasons, AI with claims will actually justify war and create conflict.
add_namespace = war_creation
country_event = {
	id = war_creation.1
	title = war_creation.1.t
	desc = war_creation.1.d
	picture = GFX_report_event_border_conflict
	hidden = yes
	fire_only_once = no
	trigger = {
		elgible_wargoal_sender = yes
	}
	option = {
		name = war_creation.1.a
		random_neighbor_country = {
			limit = {
					elgible_wargoal_receiver = yes
			}
			country_event = {days = 1 id = war_creation.2}
		}
		if = {
			random_country = {
				limit = {
					elgible_wargoal_receiver = yes
					any_owned_state = {
						is_coastal = yes
						OR = {
							AND = {
								is_on_continent = europe
								ROOT = { any_owned_state = { is_on_continent = europe } }
							}
							AND = {
								is_on_continent = north_america
								ROOT = { any_owned_state = { is_on_continent = north_america } }
							}
							AND = {
								is_on_continent = south_america
								ROOT = { any_owned_state = { is_on_continent = south_america } }
							}
							AND = {
								is_on_continent = australia
								ROOT = { any_owned_state = { is_on_continent = australia } }
							}
							AND = {
								is_on_continent = africa
								ROOT = { any_owned_state = { is_on_continent = africa } }
							}
							AND = {
								is_on_continent = asia
								ROOT = { any_owned_state = { is_on_continent = asia } }
							}
							AND = {
								is_on_continent = middle_east
								ROOT = { any_owned_state = { is_on_continent = middle_east } }
							}
						}
					}
				}
				country_event = { id = war_creation.2 }
			}
			limit = {
				AND = {
					NOT = {
						any_neighbor_country = {
							elgible_wargoal_receiver = yes
						}
					}
					any_owned_state = {
						is_coastal = yes
					}
					num_of_naval_factories > 0
				}
			}
		}
	}
	mean_time_to_happen = {
		days = 8500 # 8500
		modifier = {
			factor = 0.6
			has_government = communist
		}
		modifier = {
			factor = 2.0
			is_major = yes
		}
		modifier = {
			factor = 0.8
			has_government = islamist
		}
		modifier = {
			factor = 0.7
			has_government = nationalist
		}
		modifier = {
			factor = 0.9
			has_government = conservative
		}
		modifier = {
			factor = 0.8
			has_government = reactionary
		}
		modifier = {
			factor = 2.0
			has_government = social_democrat
		}
		modifier = {
			factor = 1.4
			has_government = social_liberal
		}
		modifier = {
			factor = 0.1
			has_government = fascist
		}
		modifier = {
			factor = 0.5
			threat > 1.0
		}
		modifier = {
			factor = 0.5
			threat > 0.9
		}
		modifier = {
			factor = 0.6
			threat > 0.75
		}
		modifier = {
			factor = 0.75
			threat > 0.6
		}
		modifier = {
			factor = 0.75
			threat > 0.4
		}
		modifier = {
			factor = 0.75
			threat > 0.35
		}
		modifier = {
			factor = 0.75
			threat > 0.25
		}
		modifier = {
			factor = 0.75
			threat > 0.15
		}
		modifier = {
			factor = 2.0
			has_global_flag = halfwar
		}
		modifier = {
			factor = 0.5
			has_global_flag = doublewar
		}
		modifier = {
			factor = 0.25
			has_global_flag = quadruplewar
		}
	}
}

country_event = {
	id = war_creation.2
	title = war_creation.2.t
	desc = war_creation.2.d
	picture = GFX_report_event_border_conflict
	is_triggered_only = yes
	option = {
		name = war_creation.2.a
		custom_effect_tooltip = war_creation.2.a.tt
		FROM = { country_event = { id = war_creation.3 }}
	}
}

country_event = {
	id = war_creation.3
	title = war_creation.3.t
	desc = war_creation.3.d
	picture = GFX_report_event_border_conflict
	is_triggered_only = yes
	option = {
		name = war_creation.3.a
		FROM = {
			random_owned_state = {
				limit = {
					OR = {
						any_neighbor_state = {
							is_owned_by = ROOT
						}
						AND = {
							PREV = {
								all_owned_state = {
									any_neighbor_state = {
										NOT = { 
											is_owned_by = ROOT
										}
									}
								}
							}
							is_coastal = yes
						}
					}
				}
				add_claim_by = ROOT
			}
			#if = {
			#	limit = {
			#		all_owned_state = {
			#			any_neighbor_state = {
			#				NOT = { 
			#					is_owned_by = ROOT
			#				}
			#			}
			#		}
			#	}
			#	random_owned_state = {
			#		limit = {
			#			is_coastal = yes
			#		}
			#		add_claim_by = ROOT
			#	}
			#}
		}
	}
}

# intro menu
country_event = {
	id = war_creation.4
	title = war_creation.4.t
	desc = war_creation.4.d
	picture = GFX_report_event_iraq_war
	is_triggered_only = yes
	option = {
		name = war_creation.4.a
	}
	option = {
		name = war_creation.4.b
		country_event = war_creation.5
		trigger = {
			is_ai = no
		}
	}
}
# Main settings menu
country_event = {
	id = war_creation.5
	title = war_creation.5.t
	desc = war_creation.5.d
	picture = GFX_report_event_iraq_war7
	is_triggered_only = yes
	immediate = {
		hidden_effect = { remove_ideas = millennium_chaos_settings_idea }
	}
	option = {
		name = war_creation.5.a
		custom_effect_tooltip = war_creation.5.a.tt
	}
	option = {
		name = war_creation.5.b
		country_event = war_creation.7
		custom_effect_tooltip = war_creation.5.b.tt
	}
	option = {
		name = war_creation.5.c
		country_event = war_creation.9
		custom_effect_tooltip = war_creation.5.c.tt
	}
	option = {
		name = war_creation.5.dd
		country_event = war_creation.6
		custom_effect_tooltip = war_creation.5.d.tt
	}	
}
# War Frequency Settings
country_event = {
	id = war_creation.6
	title = war_creation.6.t
	desc = war_creation.6.dd
	picture = GFX_report_event_second_congo_war
	is_triggered_only = yes
	option = {
		name = war_creation.6.a
		country_event = war_creation.5
		set_global_flag = halfwar
		clr_global_flag = doublewar
		clr_global_flag = quadruplewar
		custom_effect_tooltip = war_creation.6.a.tt
	}
	
	option = {
		name = war_creation.6.b
		country_event = war_creation.5
		clr_global_flag = halfwar
		clr_global_flag = doublewar
		clr_global_flag = quadruplewar
		custom_effect_tooltip = war_creation.6.b.tt
	}
	
	option = {
		name = war_creation.6.c
		country_event = war_creation.5
		set_global_flag = doublewar
		clr_global_flag = halfwar
		clr_global_flag = quadruplewar
		custom_effect_tooltip = war_creation.6.c.tt
	}
	
	option = {
		name = war_creation.6.d
		country_event = war_creation.5
		clr_global_flag = doublewar
		set_global_flag = quadruplewar
		clr_global_flag = halfwar
		custom_effect_tooltip = war_creation.6.d.tt
	}
}

# Faction Settings
country_event = {
	id = war_creation.7
	title = war_creation.7.t
	desc = war_creation.7.dd
	picture = GFX_report_event_nato
	is_triggered_only = yes
	option = {
		name = war_creation.7.a
		country_event = war_creation.5
		custom_effect_tooltip = war_creation.7.a.tt
	}
	
	option = {
		name = war_creation.7.b
		country_event = { hours = 1 id = war_creation.7 }
		every_country = {
			dismantle_faction = yes
		}
		custom_effect_tooltip = war_creation.7.b.tt
	}
	
	option = {
		name = war_creation.7.c
		country_event = { hours = 1 id = war_creation.7 }
		every_country = {
			set_rule = { can_create_factions = no }
		}
		custom_effect_tooltip = war_creation.7.c.tt
	}
	
	option = {
		name = war_creation.7.d
		country_event = war_creation.8
		custom_effect_tooltip = war_creation.7.d.tt
	}
}

# Faction enter war creation system settings
country_event = {
	id = war_creation.8
	title = war_creation.8.t
	desc = war_creation.8.dd
	picture = GFX_report_event_iraq_war2
	is_triggered_only = yes
	option = {
		name = war_creation.8.a
		country_event = war_creation.7
		set_global_flag = faction_min_claim_temp_0
		clr_global_flag = faction_min_claim_temp_30
		clr_global_flag = faction_min_claim_temp_60
		custom_effect_tooltip = war_creation.8.a.tt
	}
	
	option = {
		name = war_creation.8.b
		country_event = war_creation.7
		clr_global_flag = faction_min_claim_temp_0
		set_global_flag = faction_min_claim_temp_30
		clr_global_flag = faction_min_claim_temp_60
		custom_effect_tooltip = war_creation.8.b.tt
	}
	
	option = {
		name = war_creation.8.c
		country_event = war_creation.7
		clr_global_flag = faction_min_claim_temp_0
		clr_global_flag = faction_min_claim_temp_30
		set_global_flag = faction_min_claim_temp_60
		custom_effect_tooltip = war_creation.8.c.tt
	}
	
	option = { # default
		name = war_creation.8.d
		country_event = war_creation.7
		clr_global_flag = faction_min_claim_temp_0
		clr_global_flag = faction_min_claim_temp_30
		clr_global_flag = faction_min_claim_temp_60
		custom_effect_tooltip = war_creation.8.d.tt
	}
}

# Misc settings menu
country_event = {
	id = war_creation.9
	title = war_creation.9.t
	desc = war_creation.9.dd
	picture = GFX_report_event_mend_rebels
	is_triggered_only = yes
	option = {
		name = war_creation.9.a
		country_event = war_creation.5
		custom_effect_tooltip = war_creation.9.a.tt
	}
	
	option = {
		name = war_creation.9.b
		every_country = {
			every_state = {
				remove_claim_by = PREV
			}
		}
		custom_effect_tooltip = war_creation.9.b.tt
	}
	
	option = {
		name = war_creation.9.c.1
		set_global_flag = remove_democratic_protections
		country_event = { hours = 1 id = war_creation.9 }
			custom_effect_tooltip = war_creation.9.c.tt
		trigger = {
			NOT = {
				has_global_flag = remove_democratic_protections
			}
		}
	}
	option = {
		name = war_creation.9.c.2
		clr_global_flag = remove_democratic_protections
		country_event = { hours = 1 id = war_creation.9 }
		custom_effect_tooltip = war_creation.9.c.tt
		trigger = {
			has_global_flag = remove_democratic_protections
		}
	}
	
	option = {
		name = war_creation.9.d
		country_event = war_creation.10
		custom_effect_tooltip = war_creation.9.d.tt
	}
}

# Cheat settings menu
country_event = {
	id = war_creation.10
	title = war_creation.10.t
	desc = war_creation.10.dd
	picture = GFX_report_event_terrorist_attack
	is_triggered_only = yes
	option = {
		name = war_creation.10.a
		country_event = war_creation.9
		custom_effect_tooltip = war_creation.10.a.tt
	}
	
	option = {
		name = war_creation.10.b
		country_event = { hours = 1 id = war_creation.10 }
		every_country = {
			add_threat = 100
		}
		custom_effect_tooltip = war_creation.10.b.tt
	}
	
	option = {
		name = war_creation.10.c
		every_country = {
				add_equipment_to_stockpile = { type = infantry_equipment_1 amount = 500000 }
				add_equipment_to_stockpile = { type = artillery_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = anti_tank_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = anti_air_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = motorized_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = support_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = heavy_tank_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = light_tank_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = modern_tank_equipment_1 amount = 100000 }
				add_equipment_to_stockpile = { type = jet_multirole_equipment  amount = 10000 }
				add_equipment_to_stockpile = { type = destroyer_1  amount = 10000 }
				add_equipment_to_stockpile = { type = convoy_1  amount = 10000 }
				add_equipment_to_stockpile = { type = infantry_fighting_vehicle_1 amount = 100000 }
		}
		country_event = { hours = 1 id = war_creation.10 }
		custom_effect_tooltip = war_creation.10.c.tt
	}
	
	option = {
		name = war_creation.10.d
		country_event = { hours = 1 id = war_creation.10 }
			every_country = {
				kill_country_leader = yes
				create_country_leader = {
					name = "Donald Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = right_wing_conservative
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Donald Trumpbama"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = liberalist
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Donald-Al-Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = islamic_republican
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Donald Von Drumpf"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = fascist_ideology
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Wall Building Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = proto_fascist
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "God King Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = pope
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Businessman	Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = oligarchist
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Third Party Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = libertarian
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Anti-Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = social_democrat_ideology
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Ecoterrorist Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = green 
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Bernald Trumpders"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = democratic_socialist_ideology
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
				create_country_leader = {
					name = "Commie Trump"
					picture = "gfx/leaders/USA/Donald_Trump.dds"
					ideology = stalinist
					
					traits = {
						enemy_of_china
						friend_of_russia
					}
				}
		}
		custom_effect_tooltip = war_creation.10.d.tt
	}
}