﻿###########################
# Polish Events
###########################

add_namespace = poland

# Eastward Expansion (Danzig Ceded)
country_event = {
	id = poland.1
	title = poland.1.t
	desc = poland.1.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.1.a
		ai_chance = { factor = 10 }
		add_ideas = fascist_influence
		add_state_claim = 198
		add_state_claim = 199
		add_state_claim = 201
	}

	option = {
		name = poland.1.b
		ai_chance = { factor = 10 }
		add_opinion_modifier = { target = SOV modifier = medium_increase }
	}
}

# Soviet Union Demands the East
country_event = {
	id = poland.2
	title = poland.2.t
	desc = poland.2.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.2.a
		ai_chance = { 
			factor = 30 
			modifier = {
				factor = 0
				OR = {
					any_other_country = {
						is_major = yes
						OR = {
							is_in_faction_with = POL
							has_guaranteed = POL
						}
					}
					has_idea = anti_soviet_pact
				}
			}
		}
		effect_tooltip = {
			FROM = {
				if = {
					limit = { POL = { owns_state = 96 controls_state = 96 } is_in_faction_with = BLR }
					BLR = { transfer_state = 96 }
					else = {
					    transfer_state = 96
					}
				}
				if = {
					limit = { POL = { owns_state = 915 controls_state = 915 } is_in_faction_with = BLR }
					BLR = { transfer_state = 915 }
					else = {
					    transfer_state = 915
					}
				}
				if = {
					limit = { POL = { owns_state = 95 controls_state = 95 } is_in_faction_with = BLR }
					BLR = { transfer_state = 95 }
					else = {
					    transfer_state = 95
					}
				}
				if = {
					limit = { POL = { owns_state = 94 controls_state = 94 } is_in_faction_with = BLR }
					BLR = { transfer_state = 94 }
					else = {
					    transfer_state = 94
					}
				}
				if = {
					limit = { 
						POL = { owns_state = 93 controls_state = 93 } 
						is_in_faction_with = UKR
					}
					UKR = { transfer_state = 93 }
				}
				if = {
					limit = { 
						POL = { owns_state = 91 controls_state = 91 } 
						is_in_faction_with = UKR
					}
					UKR = { transfer_state = 91 }
				}
				if = {
					limit = { 
						POL = { owns_state = 89 controls_state = 89 } 
						is_in_faction_with = UKR
					}
					UKR = { transfer_state = 89 }
				}
				if = {
					limit = { POL = { owns_state = 97 controls_state = 97 } }
					transfer_state = 97
				}
				if = {
					limit = { POL = { owns_state = 784 controls_state = 784 } is_in_faction_with = BLR }
					BLR = { transfer_state = 784 }
					else = {
					    transfer_state = 784
					}
				}
			}
		}
		FROM = {country_event = { id = poland.3} }
	}

	option = {
		name = poland.2.b
		ai_chance = { 
			factor = 70 
			modifier = {
				factor = 0
				has_war_with = GER
			}
		}
		effect_tooltip = {
			FROM = {
				create_wargoal = {
					type = take_state_focus
					target = POL
					generator = { 96 95 94 93 91 89 97 784 915 }
				}
			}
		}
		FROM = { country_event = { id = poland.4 } }
	}
}

# Poland Cedes the East
country_event = {
	id = poland.3
	title = poland.3.t
	desc = poland.3.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.3.a
		if = {
			limit = { 
				POL = { 
					owns_state = 96
					controls_state = 96 
				}
			}
			transfer_state = 96
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 95
					controls_state = 95 
				}
			}
			transfer_state = 95
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 94
					controls_state = 94 
				}
			}
			transfer_state = 94
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 93
					controls_state = 93 
				}
				is_in_faction_with = UKR
			}
			UKR = { transfer_state = 93 }
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 940
					controls_state = 940 
				}
				is_in_faction_with = UKR
			}
			UKR = { transfer_state = 940 }
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 91
					controls_state = 91 
				}
				is_in_faction_with = UKR
			}
			UKR = { transfer_state = 91 }
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 89
					controls_state = 89 
				}
				is_in_faction_with = UKR
			}
			UKR = { transfer_state = 89 }
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 97
					controls_state = 97 
				}
			}
			transfer_state = 97
		}
		if = {
			limit = { 
				POL = { 
					owns_state = 784
					controls_state = 784 
				}
			}
			transfer_state = 784
		}
		hidden_effect = {
			news_event = { id = news.194 }
		}
	}
}

# Poland Refuses to Cede the East
country_event = {
	id = poland.4
	title = poland.4.t
	desc = poland.4.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.4.a
		create_wargoal = {
			type = take_state_focus
			target = POL
			generator = { 96 95 94 93 940 91 89 784 }
		}
	}
}


# Soviet Union Offers Protection
country_event = {
	id = poland.5
	title = poland.5.t
	desc = poland.5.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.5.a
		ai_chance = {
			base = 40
			modifier = {
				factor = 0
				is_subject = yes
				NOT = { is_subject_of = FROM }
			}
		}
		effect_tooltip = {
			add_state_claim = 5
			add_state_claim = 63
			add_state_claim = 68
			add_state_claim = 66
			add_state_claim = 67
			custom_effect_tooltip = SOV_offer_poland_protection_tt
			FROM = {
				if = {
					limit = { POL = { owns_state = 96 controls_state = 96 } }
					transfer_state = 96
				}
				if = {
					limit = { POL = { owns_state = 95 controls_state = 95 } }
					transfer_state = 95
				}
				if = {
					limit = { POL = { owns_state = 94 controls_state = 94 } }
					transfer_state = 94
				}
				if = {
					limit = { POL = { owns_state = 93 controls_state = 93 } }
					transfer_state = 93
				}
				if = {
					limit = { POL = { owns_state = 940 controls_state = 940 } }
					transfer_state = 940
				}
				if = {
					limit = { POL = { owns_state = 91 controls_state = 91 } }
					transfer_state = 91
				}
				if = {
					limit = { POL = { owns_state = 89 controls_state = 89 } }
					transfer_state = 89
				}
				if = {
					limit = { POL = { owns_state = 784 controls_state = 784 } }
					transfer_state = 784
				}
			}
		}
		hidden_effect = {
			#SOV and POL more keen on cooperation
			add_ai_strategy = {
				type = alliance
				id = FROM		
				value = 10
			}
			add_ai_strategy = {
				type = befriend
				id = FROM		
				value = 5
			}
			FROM = {
				add_ai_strategy = {
					type = alliance
					id = ROOT		
					value = 10
				}
				add_ai_strategy = {
					type = befriend
					id = ROOT		
					value = 5
				}
			}
		}
		FROM = { country_event = { id = poland.6 } }
	}

	option = {
		name = poland.5.b
		ai_chance = {
			base = 60
			modifier = {
				factor = 0
				is_in_faction_with = FROM
				OR = {
					is_subject = no
					is_subject_of = FROM
				}
				is_faction_leader = no
			}
		}
		effect_tooltip = {
			FROM = {
				create_wargoal = {
					type = take_state_focus
					target = POL
					generator = { 96 95 94 93 940 91 89 784 }
				}
			}
		}
		FROM = { country_event = { id = poland.7 } }
	}
}

# Poland Accepts Protection
country_event = {
	id = poland.6
	title = poland.6.t
	desc = poland.6.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.6.a
		POL = {
			add_state_claim = 5
			add_state_claim = 63
			add_state_claim = 68
			add_state_claim = 66
			add_state_claim = 67
			set_country_flag = POL_accepted_soviet_protection
		}
		custom_effect_tooltip = SOV_offer_poland_protection_tt
		if = {
			limit = { POL = { owns_state = 96 } }
			transfer_state = 96
		}
		if = {
			limit = { POL = { owns_state = 95 } }
			transfer_state = 95
		}
		if = {
			limit = { POL = { owns_state = 94 } }
			transfer_state = 94
		}
		if = {
			limit = { POL = { owns_state = 93 } }
			transfer_state = 93
		}
		if = {
			limit = { POL = { owns_state = 940 } }
			transfer_state = 940
		}
		if = {
			limit = { POL = { owns_state = 91 } }
			transfer_state = 91
		}
		if = {
			limit = { POL = { owns_state = 89 } }
			transfer_state = 89
		}
		if = {
			limit = { POL = { owns_state = 784 } }
			transfer_state = 784
		}
		hidden_effect = {
			news_event = { id = news.194 }
		}
	}
}

# Poland Refuses Protection
country_event = {
	id = poland.7
	title = poland.7.t
	desc = poland.7.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.7.a
		create_wargoal = {
			type = take_state_focus
			target = POL
			generator = { 96 95 94 93 940 91 89 }
		}
	}
}

# Poland Granted Eastern Germany
country_event = {
	id = poland.8
	title = poland.8.t
	desc = poland.8.d
	picture = GFX_report_event_polish_tanks_01
	
	trigger = {
		POL = { has_country_flag = POL_accepted_soviet_protection }
		tag = POL
		SOV = {
			OR = {
				owns_state = 5
				owns_state = 63
				owns_state = 68
				owns_state = 66
				owns_state = 67
			}
		}
	}

	immediate = {
		clr_country_flag = POL_accepted_soviet_protection
	}

	fire_only_once = yes

	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = poland.8.a
		if = {
			limit = { SOV = { owns_state = 5 } }
			transfer_state = 5
		}
		if = {
			limit = { SOV = { owns_state = 63 } }
			transfer_state = 63
		}
		if = {
			limit = { SOV = { owns_state = 68 } }
			transfer_state = 68
		}
		if = {
			limit = { SOV = { owns_state = 66 } }
			transfer_state = 66
		}
		if = {
			limit = { SOV = { owns_state = 67 } }
			transfer_state = 67
		}
		SOV = { country_event = { id = poland.9 } }
	}
}

country_event = {
	id = poland.9
	title = poland.8.t
	desc = poland.8.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes
	
	option = {
		name = poland.9.a
		effect_tooltip = {
			if = {
				limit = {
					OR = {
						SOV = { owns_state = 5 }
						POL = { owns_state = 5 }
					}
				}
				POL = { transfer_state = 5 }
			}
			if = {
				limit = {
					OR = {
						SOV = { owns_state = 63 }
						POL = { owns_state = 63 }
					}
				}
				POL = { transfer_state = 63 }
			}
			if = {
				limit = {
					OR = {
						SOV = { owns_state = 68 }
						POL = { owns_state = 68 }
					}
				}
				POL = { transfer_state = 68 }
			}
			if = {
				limit = {
					OR = {
						SOV = { owns_state = 66 }
						POL = { owns_state = 66 }
					}
				}
				POL = { transfer_state = 66 }
			}
			if = {
				limit = {
					OR = {
						SOV = { owns_state = 67 }
						POL = { owns_state = 67 }
					}
				}
				POL = { transfer_state = 67 }
			}
		}
		hidden_effect = {
			news_event = { id = news.195 }
		}
	}
}


country_event = {
	id = poland.10
	title = poland.10.t
	desc = poland.10.d
	picture = GFX_report_event_romania_poland_visit
	
	is_triggered_only = yes

	option = {
		name = poland.10.a
	}
}


country_event = {
	id = poland.11
	title = poland.11.t
	desc = poland.11.d
	picture = GFX_report_event_polish_tanks_01
	
	is_triggered_only = yes

	option = {
		name = poland.11.a
		create_wargoal = {
			type = puppet_wargoal_focus
			target = FROM
		}
	}
}

country_event = {
	id = poland.12
	title = poland.12.t
	desc = poland.12.d
	picture = GFX_report_event_polish_tanks_01
	
	trigger = {
		tag = POL
		has_completed_focus = POL_artillery_modernisation
		has_government = neutrality
		has_war_with = ITA
		NOT = { is_in_faction_with = SOV }
		417 = {
			controller = {
				OR = {
					tag = POL
					is_in_faction_with = POL			
				}
				has_war_with = ITA
			}
		}
		OR = {
			divisions_in_state = {
				state = 162
				size > 0
			}
			divisions_in_state = {
				state = 157
				size > 0
			}
			divisions_in_state = {
				state = 2
				size > 0
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	fire_only_once = yes

	option = {
		name = poland.12.a
		custom_effect_tooltip = WOJTEK_COMMANDER
		hidden_effect = {
			set_country_flag = POL_vojtek_commander
		}
	}

}

#Poland wants to add Romania to the Allies
country_event = {
	id = poland.13
	title = poland.13.t
	desc = poland.13.d
	picture = GFX_report_event_romania_poland_visit
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.13.a
		ai_chance = {
			factor = 10
		}
		event_target:faction_invitee_target = {
			country_event = { id = poland.1301 }
		}
	}
	option = {
		name = poland.13.b
		ai_chance = {
			factor = 0
		}
		FROM = {
			country_event = { id = poland.1302 }
		}
	}
}

#Romania recieves invitation to the Allies
country_event = {
	id = poland.1301
	title = poland.1301.t
	desc = poland.1301.d
	picture = GFX_report_event_romania_poland_visit
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.1301.a
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				has_same_ideology = yes
			}
		}
		FROM = {
			add_to_faction = PREV
		}
		add_ai_strategy = {
			type = alliance
			id = ROOT
			value = 200
		}
	}
	option = {
		name = poland.1301.b
		ai_chance = {
			factor = 50
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value > 65
				}
			}
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value > 35
				}
			}
			
			modifier = {
				factor = 0.5
				has_opinion = {
					target = FROM
					value > 5
				}
			}
			
			modifier = {
				factor = 2.0
				has_opinion = {
					target = FROM
					value < 35
				}
			}
			
			modifier = {
				factor = 2.0
				has_opinion = {
					target = FROM
					value < 65
				}
			}
			
			modifier = {
				factor = 0.1
				has_war = yes
				FROM = {
					has_war = no
				}
			}
			
			modifier = {
				factor = 0.1
				FROM = {
					is_major = yes
				}
			}

			modifier = {
				factor = 10
				FROM = {
					OR = {
						is_subject = yes
						is_in_faction = yes
					}
				}
			}
		}
		FROM = {
			country_event = { id = poland.1303 }
		}
		if = {
			limit = {
				ROOT = { NOT = { tag = FROM } }
			}
			ROOT = {
				country_event = { id = poland.1303 }
			}
		}
	}
}

#Faction leader says no
country_event = {
	id = poland.1302
	title = poland.1302.t
	desc = poland.1302.d
	picture = GFX_report_event_british_inspect_troops
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #Sad times
		name = poland.1302.a
		ai_chance = {
			factor = 100
		}
	}
}

#Romania says no
country_event = {
	id = poland.1303
	title = poland.1303.t
	desc = poland.1303.d
	picture = GFX_report_event_romania_poland_visit
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #Sad times
		name = poland.1303.a
		ai_chance = {
			factor = 100
		}
	}
}

#Poland asks for peace
country_event = {
	id = poland.14
	title = LIT_events.2.t
	desc = LIT_events.2.d
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes

	fire_only_once = yes

	option = { #Sure!
		name = LIT_events.2.a
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				has_same_ideology = yes
			}
		}
		diplomatic_relation = {
			country = POL
			relation = guarantee
			active = yes
		}
		POL = {
			diplomatic_relation = {
				country = LIT
				relation = guarantee
				active = yes
			}
		}
		hidden_effect = {
			POL = {
				country_event = { days = 10 id = LIT_events.201 }
			}
		}
	}
	
	option = { #Peace was never an option
		name = LIT_events.2.b
		ai_chance = {
			factor = 10
			modifier = {
				factor = 10
				has_same_ideology = no
				NOT = { has_government = neutrality }
			}
			modifier = {
				factor = 10
				has_government = fascism
			}
		}
		hidden_effect = {
			POL = {
				country_event = { days = 10 id = LIT_events.202 }
			}
		}
	}
}

#Poland demands Lithuanian annexation
country_event = {
	id = poland.15
	title = poland.15.t
	desc = {
		text = poland.15.d
		trigger = {
			tag = LIT
		}
	}
	desc = {
		text = poland.15.d.notlit
		trigger = {
			NOT = { tag = LIT }
		}
	}
	picture = GFX_report_event_lithuanian_ultimatum
	
	is_triggered_only = yes

	option = { #Sure!
		name = poland.15.a
		ai_chance = {
			base = 30
			modifier = {
				add = -25
				POL = { has_army_size = { size < 40 } }
			}
			modifier = {
				add = 100
				POL = { has_army_size = { size > 39 } }
			}
			modifier = {
				add = 20
				is_in_faction_with = POL
			}
			modifier = {
				factor = 0.1
				is_in_faction = yes
			}
		}
		POL = {
			country_event = { hours = 2 id = poland.1501 }
		}
		custom_effect_tooltip = GAME_OVER_TT
	}

	option = { #No thank you
		name = poland.15.b
		ai_chance = {
			base = 10
			modifier = {
				POL = { has_army_size = { size > 39 } }
				factor = 0.5
			}
			modifier = {
				add = 20
				POL = { has_army_size = { size < 30 } }
			}
			modifier = {
				factor = 2
				is_in_faction = yes
				NOT = { is_in_faction_with = POL }
			}
			modifier = {
				any_other_country = {
					has_guaranteed = LIT
				}
				factor = 5 #i've got friends
			}
			modifier = {
				any_other_country = {
					is_major = yes
					has_guaranteed = LIT
				}
				factor = 5 #i've got big friends
			}
		}
		POL = {
			add_opinion_modifier = { target = PREV modifier = POL_annexation_refused }
			country_event = { hours = 2 id = poland.1502 }
			if = { limit = { is_in_faction_with = LIT }
				remove_from_faction = LIT
			}
		}
	}
}

#Lithuania says yes
country_event = {
	id = poland.1501
	title = poland.1501.t
	desc = poland.1501.d
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes

	option = { #Awesome!
		name = poland.1501.a
		ai_chance = {
			base = 30
		}
		annex_country = { target = FROM transfer_troops = yes }
		FROM = {
			every_unit_leader = {
					limit = {
						has_unit_leader_flag = POL_monarchy_sympathies_flag
					}
					set_nationality = POL
				}
		}
	}
}

#Lithuania says no
country_event = {
	id = poland.1502
	title = poland.1502.t
	desc = poland.1502.d
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes

	option = { #How 'bout I do anyway
		name = poland.1502.a
		ai_chance = {
			base = 30
		}
		create_wargoal = {
			type = annex_everything
			target = FROM
		}
	}
}

###MIEDZYMORZE###
country_event = {
	id = poland.16
	title = poland.16.t
	desc = { # FROM and ROOT are Democratic
		text = generic.5.d.a
		trigger = {
			AND = {
				FROM = {
					has_government = democratic
				}
				has_government = democratic
			}
		}
	}
	desc = { # FROM and ROOT are Fascist
		text = generic.5.d.b
		trigger = {
			AND = {
				FROM = {
					has_government = fascism
				}
				has_government = fascism
			}
		}
	}
	desc = { # FROM and ROOT are Communist
		text = generic.5.d.c
		trigger = {
			AND = {
				FROM = {
					has_government = communism
				}
				has_government = communism
			}
		}
	}
	desc = { # FROM and ROOT are different ideologies
		text = generic.5.d.e
		trigger = {
			NOT = {
				AND = {
					FROM = {
						has_government = democratic
					}
					has_government = democratic
				}
				AND = {
					FROM = {
						has_government = fascism
					}
					has_government = fascism
				}
				AND = {
					FROM = {
						has_government = communism
					}
					has_government = communism
				}
			}
		}
	}
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes

	fire_only_once = no

	immediate = {
		hidden_effect = {
			save_event_target_as = alliance_applicant
			FROM = {
				save_event_target_as = alliance_inviter
			}
		}
	}

	option = {
		name = poland.16.a
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				has_same_ideology = yes
			}
			modifier = {
				factor = 200
				original_tag = SPR #Falangist International focus, Spain should usually say yes
			}
			modifier = {
				factor = 0.25
				original_tag = SWE
				FROM = {
					NOT = {
						AND = {
							is_in_faction_with = DEN
							is_in_faction_with = NOR
							is_in_faction_with = FIN
						}
					}
				}
			}
			modifier = {
				factor = 0.75
				original_tag = SWE
				FROM = {
					is_in_faction_with = DEN
					is_in_faction_with = NOR
					is_in_faction_with = FIN
				}
			}
			modifier = {
				factor = 4
				has_country_flag = delegation_recieved_flag
			}
			modifier = {
				factor = 0.1
				NOT = { FROM = { has_government = neutrality } }
				NOT = { has_government = neutrality }
				has_same_ideology = no
			}
			modifier = {
				factor = 0.1
				FROM = { has_government = fascism }
				has_same_ideology = no
			}
			modifier = {
				factor = 0.001
				original_tag = ITA
				has_government = fascism
				has_same_ideology = no
			}
		}

		trigger = {
			#Lone Wolf Finland can't join any factions
			FIN_is_lone_wolf_finland = no
		}

		hidden_effect = {
			set_country_flag = alliance_applicant@ROOT
			FROM = { set_country_flag = alliance_inviter@ROOT }
		}
		FROM = {
			add_to_faction = PREV
			country_event = { id = generic.6 hours = 6 }
			add_ai_strategy = {
				type = alliance
				id = FROM
				value = 200
			}
		}
		add_ai_strategy = {
			type = alliance
			id = POL
			value = 200
		}
		if = {
			limit = {
				original_tag = SPR
			}
			hidden_effect = {
				news_event = { id = news.289 hours = 12 }
			}
		}
	}
	option = {
		name = poland.16.b
		ai_chance = {
			factor = 50
			
			modifier = {
				factor = 200
				original_tag = ITA
				has_government = fascism
				has_same_ideology = no
			}
			
			modifier = {
				factor = 2
				FROM = { has_government = fascism }
				has_same_ideology = no
			}
			modifier = {
				factor = 2
				NOT = { FROM = { has_government = neutrality } }
				NOT = { has_government = neutrality }
				has_same_ideology = no
			}
			modifier = {
				add = -5
				has_opinion = {
					target = FROM
					value > 65
				}
			}
			
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value < 35
				}
			}
			
			modifier = {
				factor = 2
				has_opinion = {
					target = FROM
					value < 65
				}
			}
			
			modifier = {
				factor = 0.1
				has_war = yes
				FROM = {
					has_war = no
				}
			}
			
			modifier = {
				factor = 0.1
				FROM = {
					is_major = yes
				}
			}

			modifier = {
				factor = 10
				FROM = {
					OR = {
						is_subject = yes
						is_in_faction = yes
					}
				}
			}
		}

		#Lone Wolf Finland can't join any factions - Tooltip for player
		if = {
			limit = {	
				FIN_is_lone_wolf_finland = yes
			}
			custom_effect_tooltip = FIN_the_lone_wolf_no_faction_tt
		}
		
		hidden_effect = { set_country_flag = rejected_miedzymorze_flag }
		FROM = {
			country_event = { id = poland.1602 }
		}
	}
}
country_event = {
	id = poland.1602
	title = poland.11.t
	desc = poland.11.d
	picture = GFX_report_event_generic_sign_treaty1
	
	is_triggered_only = yes

	option = {
		name = poland.11.a
	}
}




country_event = {
	id = poland.17
	title = poland.17.t
	desc = poland.17.d
	picture = GFX_report_event_sanation_left_victory
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.17.a
		ai_chance = {
			factor = 50
		}
		set_cosmetic_tag = POL_SANATION
		set_politics = {
			ruling_party = neutrality
			elections_allowed = yes
			long_name = POL_POS_party_long
			name = POL_POS_party 
		}
		add_country_leader_role = {
			character = "POL_walery_slawek"
			country_leader = {
				ideology=oligarchism
				traits = { left_sanationist_minister }
				expire="1965.1.1.1"
			}
			promote_leader = yes
		}
	}
	option = {
		name = poland.17.b
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		effect_tooltip = {
			set_cosmetic_tag = POL_SANATION_democratic
		}
		hidden_effect = {
			set_cosmetic_tag = POL_SANATION
		}
		add_ruling_to_dem = yes
		set_politics = {
			ruling_party = democratic
			elections_allowed = yes
			long_name = POL_POS_party_long
			name = POL_POS_party 
		}
		add_country_leader_role = {			
			character = "POL_walery_slawek"
			country_leader = {
				ideology=socialism
				traits = { left_sanationist_minister }
				expire="1965.1.1.1"
			}
			promote_leader = yes
		}
		if = {
			limit = {
				has_idea = POL_april_constitution_4
			}
			swap_ideas = {
				add_idea = POL_april_constitution_dem
				remove_idea = POL_april_constitution_4
			}
		}
		if = {
			limit = {
				has_idea = POL_april_constitution_left
			}
			swap_ideas = {
				add_idea = POL_april_constitution_dem_left
				remove_idea = POL_april_constitution_left
			}
		}
		if = {
			limit = {
				has_idea = POL_april_constitution_right
			}
			swap_ideas = {
				add_idea = POL_april_constitution_dem_right
				remove_idea = POL_april_constitution_right
			}
		}
	}
}

country_event = {
	id = poland.18
	title = poland.18.t
	desc = poland.18.d
	picture = GFX_report_event_sanation_revolt
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.18.a
		ai_chance = {
			factor = 50
		}
		set_cosmetic_tag = POL_SANATION
		set_politics = {
			ruling_party = neutrality
			elections_allowed = no
			long_name = POL_OZON_party_long
			name = POL_OZON_party
		}
		add_country_leader_role = {
			character = "POL_edward_rydzsmigly"
			country_leader = {
				ideology=oligarchism
				traits = { sanation_militarist }
				expire="1965.1.1.1"
			}
			promote_leader = yes
		}
	}
	option = {
		name = poland.18.b
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		effect_tooltip = {
			set_cosmetic_tag = POL_SANATION_fascism
		}
		hidden_effect = {
			set_cosmetic_tag = POL_SANATION
		}
		add_ruling_to_fas = yes
		set_politics = {
			ruling_party = fascism
			elections_allowed = no
			long_name = POL_OZON_party_long
			name = POL_OZON_party
		}
		add_country_leader_role = {
			character = "POL_edward_rydzsmigly"
			country_leader = {
				ideology=falangism
				traits = { sanation_militarist_falangist }
				expire="1965.1.1.1"
			}
			promote_leader = yes
		}
		if = {
			limit = {
				has_idea = POL_april_constitution_4
			}
			swap_ideas = {
				add_idea = POL_april_constitution_fas
				remove_idea = POL_april_constitution_4
			}
		}
		if = {
			limit = {
				has_idea = POL_april_constitution_left
			}
			swap_ideas = {
				add_idea = POL_april_constitution_fas_left
				remove_idea = POL_april_constitution_left
			}
		}
		if = {
			limit = {
				has_idea = POL_april_constitution_right
			}
			swap_ideas = {
				add_idea = POL_april_constitution_fas_right
				remove_idea = POL_april_constitution_right
			}
		}
	}
}

country_event = {
	id = poland.19
	title = poland.19.t
	desc = poland.19.d
	picture = GFX_report_event_poland_funeral
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.19.a
		ai_chance = {
			factor = 50
		}
		add_stability = -0.2
		add_war_support = -0.1
		POL_sanation_left_opposition_remove = yes
		set_country_flag = walery_slawek_is_dead
	}
}

country_event = {
	id = poland.20
	title = poland.20.t
	desc = { # Four Year Plan went poorly
		text = poland.20.desc.a
		trigger = {
			check_variable = { POL_investments_var < 6 }
		}
	}
	desc = { # Four Year Plan went okay
		text = poland.20.desc.b
		trigger = {
			check_variable = { POL_investments_var < 14 }
			check_variable = { POL_investments_var > 5 }
		}
	}
	desc = { # Four Year Plan went well
		text = poland.20.desc.c
		trigger = {
			check_variable = { POL_investments_var > 15 }
		}
	}
	picture = GFX_report_event_generic_factory
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.20.a
		trigger = {
			check_variable = { POL_investments_var < 6 }
		}
		ai_chance = {
			factor = 50
		}
		add_timed_idea = {
			idea = POL_four_year_plan_complete_1
			days = 1460
		}
	}

	option = {
		name = poland.20.b
		trigger = {
			check_variable = { POL_investments_var < 11 }
			check_variable = { POL_investments_var > 5 }
		}
		ai_chance = {
			factor = 50
		}
		add_timed_idea = {
			idea = POL_four_year_plan_complete_2
			days = 1460
		}
	}

	option = {
		name = poland.20.c
		trigger = {
			check_variable = { POL_investments_var < 14 }
			check_variable = { POL_investments_var > 10 }
		}
		ai_chance = {
			factor = 50
		}
		add_timed_idea = {
			idea = POL_four_year_plan_complete_3
			days = 1460
		}
	}

	option = {
		name = poland.20.d
		trigger = {
			#has_completed_focus = POL_complete_the_plan
			check_variable = { POL_investments_var > 15 }
		}
		ai_chance = {
			factor = 50
		}
		add_timed_idea = {
			idea = POL_four_year_plan_complete_4
			days = 1460
		}
	}

	option = {
		name = poland.20.e
		trigger = {
			#NOT = { #has_completed_focus = POL_complete_the_plan }
			check_variable = { POL_investments_var > 9 }
		}
		ai_chance = {
			factor = 50
		}
		add_timed_idea = {
			idea = POL_four_year_plan_complete_1
			days = 1460
		}
	}

	option = {
		name = poland.20.f
		trigger = {
			#NOT = { #has_completed_focus = POL_complete_the_plan }
			check_variable = { POL_investments_var < 10 }
		}
		ai_chance = {
			factor = 50
		}
		add_timed_idea = {
			idea = POL_four_year_plan_complete_bad
			days = 730
		}
	}
}

country_event = {
	id = poland.21
	title = poland.21.t
	desc = poland.21.d
	picture = GFX_report_event_danzig_joins_nazis
	
	trigger = {
		tag = GER
		has_government = fascism
		is_subject = no
		DNZ = {
			has_war_with = POL
		}
	}

	mean_time_to_happen = {
		days = 120
	}

	fire_only_once = yes

	option = {
		name = poland.21.a
		ai_chance = {
			factor = 50 #TODO
		}
		hidden_effect = {
			DNZ = {
				country_event = poland.2101
			}
		}
		effect_tooltip = {
			if = {
				limit = {
					has_dlc = "Death or Dishonor"
				}
				set_autonomy = {
					target = DNZ
					autonomy_state = autonomy_reichskommissariat
					end_wars = no
				}
			}
			else = {
				set_autonomy = {
					target = DNZ
					autonomy_state = autonomy_integrated_puppet
					end_wars = no
				}
			}
			add_to_faction = DNZ
			add_to_war = { 
				targeted_alliance = DNZ
				enemy = POL
				hostility_reason = asked_to_join
			}
		}
	}

	option = {
		name = poland.21.b
		ai_chance = {
			factor = 50 #TODO
		}
		hidden_effect = {
			news_event = {
				id = NSB_news.2
			}
			DNZ = {
				set_country_flag = rejected_germany_flag
			}
		}
	}
}

country_event = { #fallback event just in case Danzig is somehow a player
	id = poland.2101
	title = poland.2101.t
	desc = poland.2101.d
	picture = GFX_report_event_danzig_joins_nazis
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.2101.a
		ai_chance = {
			factor = 50
		}
		hidden_effect = {
			news_event = {
				id = NSB_news.1
			}
		}
		GER = {
			if = {
				limit = {
					has_dlc = "Death or Dishonor"
				}
				set_autonomy = {
					target = DNZ
					autonomy_state = autonomy_reichskommissariat
					end_wars = no
				}
			}
			else = {
				set_autonomy = {
					target = DNZ
					autonomy_state = autonomy_integrated_puppet
					end_wars = no
				}
			}
			add_to_faction = DNZ
			add_to_war = { 
				targeted_alliance = DNZ
				enemy = POL
				hostility_reason = asked_to_join
			}
		}
	}

	option = {
		name = poland.2101.b
		ai_chance = {
			factor = 0
		}
		hidden_effect = {
			news_event = {
				id = NSB_news.201
			}
			set_country_flag = rejected_germany_flag
		}
	}
}

country_event = { #Germany annexes Danzig
	id = poland.2102
	title = poland.2102.t
	desc = poland.2102.d
	picture = GFX_report_event_danzig_joins_nazis
	
	trigger = {
		tag = GER
		DNZ = { is_subject_of = GER }
	}

	mean_time_to_happen = {
		days = 30
	}

	fire_only_once = yes

	option = {
		name = poland.2102.a
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0
				DNZ = { is_ai = no }
			}
		}
		annex_country = {
			target = DNZ
			transfer_troops = yes
		}
		every_owned_state = {
			limit = {
				is_core_of = DNZ
			}
			add_core_of = GER
			remove_core_of = DNZ
		}
	}

	option = {
		name = poland.2102.b
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				DNZ = { is_ai = yes }
			}
		}
		trigger = {
			DNZ = { is_ai = no }
		}
		807 = {
			add_core_of = DNZ
		}
	}
}

country_event = { #Event for independent Danzig winning the war
	id = poland.22
	title = poland.22.t
	desc = poland.22.d
	picture = GFX_report_event_generic_conference
	
	trigger = {
		tag = POL
		DNZ = {
			is_subject = no
			has_war_with = POL
			controls_state = 807
		}
		OR = {
			DNZ = { has_country_flag = rejected_germany_flag }
			GER = { has_completed_focus = GER_oppose_hitler }
		}
	}

	mean_time_to_happen = {
		days = 30
	}

	fire_only_once = yes

	option = {
		name = poland.22.a
		ai_chance = {
			factor = 50 #TODO
		}
		DNZ = { transfer_state = 807 }
		white_peace = DNZ
		GER = { country_event = { id = poland.2102 days = 7 } }
	}

	option = {
		name = poland.22.b
		ai_chance = {
			factor = 50 #TODO
		}
	}
}

state_event = { #Event for Polish sabotage
	id = poland.23
	title = poland.23.t
	desc = poland.23.d
	picture = GFX_report_event_generic_battle

	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			random_state = {
				limit = {
					NOT = { has_state_flag = already_sabotaged_flag }
					has_state_flag = poland_state_withdrawn
				}
				clr_state_flag = poland_state_withdrawn
				save_event_target_as = poland_state_withdrawn
			}
			event_target:poland_state_withdrawn = {
				damage_building = { type = industrial_complex damage = 2.5 }
				damage_building = { type = arms_factory damage = 2.5 }
				damage_building = { type = infrastructure damage = 2.5 }
				set_state_flag = already_sabotaged_flag
			}
		}
	}
	
	# Hey! That's a Russian tactic, you bastards!
	option = {
		name = poland.23.a
		effect_tooltip = {
			event_target:poland_state_withdrawn = {
				damage_building = { type = industrial_complex damage = 2.5 }
				damage_building = { type = arms_factory damage = 2.5 }
				damage_building = { type = infrastructure damage = 2.5 }
			}
		}
	}
}

country_event = { #Event to alert Poland of the Peasant's Strike beginning
	id = poland.24
	title = POL_peasants_strike
	desc = poland.24.d
	picture = GFX_report_event_peasant_revolt
	
	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = poland.24.a
		ai_chance = {
			factor = 50
		}
		effect_tooltip = {
			activate_mission = POL_peasants_strike
			swap_ideas = {
				remove_idea = POL_looming_peasants_strike
				add_idea = POL_great_peasants_strike
			}
		}
	}
}

country_event = { #Event to replace the Sanation government when Poland capitulates
	id = poland.25
	title = poland.25.t
	desc = poland.25.d
	picture = GFX_report_event_sanation_left_victory
	
	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			
		}
	}

	fire_only_once = yes

	option = {
		name = poland.25.a
		ai_chance = {
			factor = 50
		}
		if = {
			limit = {
				has_government = fascism
			}
			add_ruling_to_neu = yes
			set_politics = {
				ruling_party = neutrality
				elections_allowed = no
			}
		}
		promote_character = POL_wladyslaw_sikorski
	}

	option = {
		name = poland.25.b
		ai_chance = {
			factor = 50
		}
		if = {
			limit = {
				has_government = fascism
			}
			add_ruling_to_neu = yes
			set_politics = {
				ruling_party = neutrality
				elections_allowed = no
			}
		}
		promote_character = POL_boleslaw_wieniawa_glugoszowski
	}

	option = {
		name = poland.25.c
		ai_chance = {
			factor = 50
		}
		add_ruling_to_dem = yes
		set_politics = {
			ruling_party = democratic
			elections_allowed = yes
			long_name = POL_exile_democratic_party_long
			name = POL_exile_democratic_party 
		}
		promote_character = POL_wladyslaw_raczkiewicz
		if = {
			limit = {
				has_idea = POL_april_constitution_4
			}
			swap_ideas = {
				add_idea = POL_april_constitution_dem
				remove_idea = POL_april_constitution_4
			}
		}
		else_if = {
			limit = {
				has_idea = POL_april_constitution_right
			}
			swap_ideas = {
				add_idea = POL_april_constitution_dem_right
				remove_idea = POL_april_constitution_right
			}
		}
		else_if = {
			limit = {
				has_idea = POL_april_constitution_left
			}
			swap_ideas = {
				add_idea = POL_april_constitution_dem_left
				remove_idea = POL_april_constitution_left
			}
		}
		else = {
			hidden_effect = {
				remove_ideas = {
					POL_april_constitution_1
					POL_april_constitution_2
					POL_april_constitution_3
				}
			}
		}
	}
}

country_event = { #Event to alert Germany/Soviets of Warsaw Uprising potentially happening
	id = poland.26
	title = poland.26.t
	desc = poland.26.d
	picture = GFX_report_event_french_resistance_02
	
	is_triggered_only = yes

	option = {
		name = poland.26.a
		ai_chance = {
			factor = 50
		}
		custom_effect_tooltip = POL_keep_resistance_low_tt
	}
}
