###- Balance of Power (BOP) -###
PHI_elitist_small_effect = {
	if = {
		limit = { has_any_power_balance = yes }
		#Sucks but atm add power balance doesn't accept variables
		add_power_balance_value = {
			id = PHI_power_balance
			value = -0.05
			tooltip_side = PHI_elitist_anger_side
		}
	}
}

PHI_elitist_medium_effect = {
	if = {
		limit = { has_any_power_balance = yes }
		#Sucks but atm add power balance doesn't accept variables
		add_power_balance_value = {
			id = PHI_power_balance
			value = -0.15
			tooltip_side = PHI_elitist_anger_side
		}
	}
}

PHI_elitist_large_effect = {
	if = {
		limit = { has_any_power_balance = yes }
		#Sucks but atm add power balance doesn't accept variables
		add_power_balance_value = {
			id = PHI_power_balance
			value = -0.35
			tooltip_side = PHI_elitist_anger_side
		}
	}
}

PHI_populist_small_effect = {
	if = {
		limit = { has_any_power_balance = yes }
		#Sucks but atm add power balance doesn't accept variables
		add_power_balance_value = {
			id = PHI_power_balance
			value = 0.05
			tooltip_side = PHI_populist_anger_side
		}
	}
}

PHI_populist_medium_effect = {
	if = {
		limit = { has_any_power_balance = yes }
		#Sucks but atm add power balance doesn't accept variables
		add_power_balance_value = {
			id = PHI_power_balance
			value = 0.15
			tooltip_side = PHI_populist_anger_side
		}
	}
}

PHI_populist_large_effect = {
	if = {
		limit = { has_any_power_balance = yes }
		#Sucks but atm add power balance doesn't accept variables
		add_power_balance_value = {
			id = PHI_power_balance
			value = 0.35
			tooltip_side = PHI_populist_anger_side
		}
	}
}

PHI_ctr_bop_small_effect = {
	if = {
		limit = {
			#Conviction Side
			is_power_balance_in_range = {
				id = PHI_power_balance
				range > PHI_bop_elitist_tensions
			}
		}
		PHI_elitist_small_effect = yes
	}
	else = {
		#Cynicism Side
		PHI_populist_small_effect = yes
	}
}

PHI_ctr_bop_medium_effect = {
	if = {
		limit = {
			#Conviction Side
			is_power_balance_in_range = {
				id = PHI_power_balance
				range > PHI_bop_elitist_tensions
			}
		}
		PHI_elitist_medium_effect = yes
	}
	else = {
		#Cynicism Side
		PHI_populist_medium_effect = yes
	}
}

PHI_ctr_bop_large_effect = {
	if = {
		limit = {
			#Conviction Side
			is_power_balance_in_range = {
				id = PHI_power_balance
				range > PHI_bop_elitist_tensions
			}
		}
		PHI_elitist_large_effect = yes
	}
	else = {
		#Cynicism Side
		PHI_populist_large_effect = yes
	}
}

PHI_ext_bop_small_effect = {
	if = {
		limit = {
			#Conviction Side
			is_power_balance_in_range = {
				id = PHI_power_balance
				range > PHI_bop_elitist_tensions
			}
		}
		PHI_populist_small_effect = yes
	}
	else = {
		#Cynicism Side
		PHI_elitist_small_effect = yes
	}
}

PHI_ext_bop_medium_effect = {
	if = {
		limit = {
			#Conviction Side
			is_power_balance_in_range = {
				id = PHI_power_balance
				range > PHI_bop_elitist_tensions
			}
		}
		PHI_populist_medium_effect = yes
	}
	else = {
		#Cynicism Side
		PHI_elitist_medium_effect = yes
	}
}

PHI_ext_bop_large_effect = {
	if = {
		limit = {
			#Conviction Side
			is_power_balance_in_range = {
				id = PHI_power_balance
				range > PHI_bop_elitist_tensions
			}
		}
		PHI_populist_large_effect = yes
	}
	else = {
		#Cynicism Side
		PHI_elitist_large_effect = yes
	}
}

###- Foreign Alignment Effects -###
PHI_update_pie_chart = {
	PHI = {
		clear_array = PHI_pie_chart_frames
		resize_array = { array = PHI_pie_chart_frames value = 3 size = 100 }

		### get the total of all alignment values
		set_temp_variable = { PHI_forpol_total_var = PHI_IND_alignment_var }
		add_to_temp_variable = { PHI_forpol_total_var = PHI_USA_alignment_var }
		add_to_temp_variable = { PHI_forpol_total_var = PHI_GEA_alignment_var }
		add_to_temp_variable = { PHI_forpol_total_var = PHI_CPS_alignment_var }

		### USA ###
		set_variable = { PHI_forpol_USA_percentage_var = PHI_USA_alignment_var }
		divide_variable = { PHI_forpol_USA_percentage_var = PHI_forpol_total_var }

		set_temp_variable = { PHI_piechart_USA = PHI_forpol_USA_percentage_var }
		multiply_temp_variable = { PHI_piechart_USA = 100 }
		round_temp_variable = PHI_piechart_USA

		set_temp_variable = { PHI_piechart_end = PHI_piechart_USA }
		for_loop_effect = {
			start = 0
			end = PHI_piechart_end
			set_variable = { PHI_pie_chart_frames^v = 1 }
		}
		set_temp_variable = { PHI_piechart_start = PHI_piechart_USA }

		### GEA ###
		set_variable = { PHI_forpol_GEA_percentage_var = PHI_GEA_alignment_var }
		divide_variable = { PHI_forpol_GEA_percentage_var = PHI_forpol_total_var }

		set_temp_variable = { PHI_piechart_GEA = PHI_forpol_GEA_percentage_var }
		multiply_temp_variable = { PHI_piechart_GEA = 100 }
		round_temp_variable = PHI_piechart_GEA

		add_to_temp_variable = { PHI_piechart_end = PHI_piechart_GEA }
		for_loop_effect = {
			start = PHI_piechart_start
			end = PHI_piechart_end
			set_variable = { PHI_pie_chart_frames^v = 2 }
		}
		add_to_temp_variable = { PHI_piechart_start = PHI_piechart_GEA }

		### CPS ###
		set_variable = { PHI_forpol_CPS_percentage_var = PHI_CPS_alignment_var }
		divide_variable = { PHI_forpol_CPS_percentage_var = PHI_forpol_total_var }

		set_temp_variable = { PHI_piechart_CPS = PHI_forpol_CPS_percentage_var }
		multiply_temp_variable = { PHI_piechart_CPS = 100 }
		round_temp_variable = PHI_piechart_CPS

		add_to_temp_variable = { PHI_piechart_end = PHI_piechart_CPS }
		for_loop_effect = {
			start = PHI_piechart_start
			end = PHI_piechart_end
			set_variable = { PHI_pie_chart_frames^v = 4 }
		}

		### IND ###
		set_temp_variable = { PHI_forpol_total_var = 1 }
		subtract_from_temp_variable = { PHI_forpol_total_var = PHI_forpol_USA_percentage_var }
		subtract_from_temp_variable = { PHI_forpol_total_var = PHI_forpol_CPS_percentage_var }
		subtract_from_temp_variable = { PHI_forpol_total_var = PHI_forpol_GEA_percentage_var }
		set_variable = { PHI_forpol_IND_percentage_var = PHI_forpol_total_var }

		set_variable_to_random = PHI_pie_chart_dirty
	}
}

PHI_add_IND_alignment_small_effect = {
	add_to_variable = {
		var = PHI.PHI_IND_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_add_IND_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_IND_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_IND_alignment_medium_effect = {
	add_to_variable = {
		var = PHI.PHI_IND_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_add_IND_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_IND_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_IND_alignment_large_effect = {
	add_to_variable = {
		var = PHI.PHI_IND_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_add_IND_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_IND_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_IND_alignment_small_effect = {
	subtract_from_variable = {
		var = PHI.PHI_IND_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_sub_IND_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_IND_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_IND_alignment_medium_effect = {
	subtract_from_variable = {
		var = PHI.PHI_IND_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_sub_IND_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_IND_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_IND_alignment_large_effect = {
	subtract_from_variable = {
		var = PHI.PHI_IND_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_sub_IND_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_IND_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_CPS_alignment_small_effect = {
	add_to_variable = {
		var = PHI.PHI_CPS_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_add_CPS_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_CPS_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_CPS_alignment_medium_effect = {
	add_to_variable = {
		var = PHI.PHI_CPS_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_add_CPS_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_CPS_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_CPS_alignment_large_effect = {
	add_to_variable = {
		var = PHI.PHI_CPS_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_add_CPS_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_CPS_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_CPS_alignment_small_effect = {
	subtract_from_variable = {
		var = PHI.PHI_CPS_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_sub_CPS_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_CPS_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_CPS_alignment_medium_effect = {
	subtract_from_variable = {
		var = PHI.PHI_CPS_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_sub_CPS_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_CPS_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_CPS_alignment_large_effect = {
	subtract_from_variable = {
		var = PHI.PHI_CPS_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_sub_CPS_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_CPS_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_GEA_alignment_small_effect = {
	add_to_variable = {
		var = PHI.PHI_GEA_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_add_GEA_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_GEA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_GEA_alignment_medium_effect = {
	add_to_variable = {
		var = PHI.PHI_GEA_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_add_GEA_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_GEA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_GEA_alignment_large_effect = {
	add_to_variable = {
		var = PHI.PHI_GEA_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_add_GEA_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_GEA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_GEA_alignment_small_effect = {
	subtract_from_variable = {
		var = PHI.PHI_GEA_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_sub_GEA_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_GEA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_GEA_alignment_medium_effect = {
	subtract_from_variable = {
		var = PHI.PHI_GEA_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_sub_GEA_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_GEA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_GEA_alignment_large_effect = {
	subtract_from_variable = {
		var = PHI.PHI_GEA_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_sub_GEA_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_GEA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_USA_alignment_small_effect = {
	add_to_variable = {
		var = PHI.PHI_USA_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_add_USA_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_USA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_USA_alignment_medium_effect = {
	add_to_variable = {
		var = PHI.PHI_USA_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_add_USA_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_USA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_add_USA_alignment_large_effect = {
	add_to_variable = {
		var = PHI.PHI_USA_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_add_USA_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_USA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_USA_alignment_small_effect = {
	subtract_from_variable = {
		var = PHI.PHI_USA_alignment_var
		value = PHI.PHI_size_small_var
		tooltip = PHI_sub_USA_alignment_small_tt
	}
	clamp_variable = {
		var = PHI.PHI_USA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_USA_alignment_medium_effect = {
	subtract_from_variable = {
		var = PHI.PHI_USA_alignment_var
		value = PHI.PHI_size_medium_var
		tooltip = PHI_sub_USA_alignment_medium_tt
	}
	clamp_variable = {
		var = PHI.PHI_USA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

PHI_sub_USA_alignment_large_effect = {
	subtract_from_variable = {
		var = PHI.PHI_USA_alignment_var
		value = PHI.PHI_size_large_var
		tooltip = PHI_sub_USA_alignment_large_tt
	}
	clamp_variable = {
		var = PHI.PHI_USA_alignment_var
		min = 0
	}
	PHI_update_pie_chart = yes
}

###- 1939 Election Outcome Effect -###

PHI_1939_election_outcome_effect = {
	#Truth is the game was rigged from the start - all the other game rules are basically purely cosmetic, the outcome is hard rigged.

	#Decide who wins the actual election first
	if = {
		limit = {
			PHI = {
				is_power_balance_in_range = {
					id = PHI_power_balance
					range < PHI_bop_elitist_tensions
				}
			}
		}
		#Roxas wins if the Elitists get too mad
		PHI = { country_event = PHI.political.300 } #Roxas and the Elite reassert Control
	}
	else_if = {
		limit = {
			PHI = {
				is_power_balance_in_range = {
					id = PHI_power_balance
					range > PHI_bop_populist_tensions
				}
			}
		}
		#Shitshow if Populists get too mad
		if = {
			limit = { PHI_GEA_alignment_wins_trigger = yes }
			PHI = { country_event = PHI.political.500 } #Recto Rallies Populist Forces
		}
		else_if = {
			limit = { PHI_CPS_alignment_wins_trigger = yes }
			PHI = { country_event = PHI.political.400 } #Aguinaldo Upsets the Establishment
		}
		else = {
			PHI = { country_event = PHI.political.600 } #Evangelista Leads a Socialist Revolution
		}
	}
	else = {
		#Manuel wins if everything remains balanced.
		PHI = { country_event = PHI.political.200 } #President Quezon Cruises to Reelection
	}

	#Decide Which Alignment PHI goes down a few days later - start with the game rules

	if = {
		limit = { PHI_GEA_alignment_wins_trigger = yes }
		GER = { country_event = { id = PHI.political.090 days = 3 } } #Our Triumph in Manila (GER Edition)
	}
	else_if = {
		limit = { PHI_CPS_alignment_wins_trigger = yes }
		JAP = { country_event = { id = PHI.political.110 days = 3 } } #Our Triumph in Manila (JAP Edition)
	}
	else_if = {
		limit = {
			PHI_USA_alignment_wins_trigger = yes
			OR = {
				AND = {
					#PHI and WCA are about to share an alignment.
					country_exists = WCA
					PHI = {
						is_power_balance_in_range = {
							id = PHI_power_balance
							range > PHI_bop_populist_tensions
						}
					}
				}
				NOT = {
					#If either of these are true and the above is false, then they will not have compatible alignments.
					country_exists = WCA
					PHI = {
						is_power_balance_in_range = {
							id = PHI_power_balance
							range > PHI_bop_populist_tensions
						}
					}
				}
			}
		}
		var:361.owner = { country_event = { id = PHI.political.130 days = 3 } } #Our Triumph in Manila (USA Edition)
	}
	else = {
		PHI = { country_event = { id = PHI.political.070 days = 3 } } #The Philippines Entrenches its Neutrality
	}
}

PHI_cleanup_elections_mechanic_effect = {
	remove_power_balance = { id = PHI_power_balance }
	PHI = { clr_country_flag = PHI_fight_for_the_philippines_active_flag }
}

###- Post-War Foreign Relations -###
PHI_hub_of_pacific_effect = {
	if = {
		limit = {
			is_in_faction_with = JAP
			JAP = { is_faction_leader = yes }
		}
		add_ideas = JAP_PHI_friendship_idea
	}
	else_if = {
		limit = {
			is_in_faction_with = GER
			GER = { is_faction_leader = yes }
		}
		add_ideas = GER_PHI_friendship_idea
	}
	else_if = {
		limit = {
			is_in_faction_with = USA
			USA = { is_faction_leader = yes }
		}
		add_ideas = USA_PHI_friendship_idea
	}
	else = {
		add_ideas = PHI_standing_our_grand_idea
	}
}
PHI_internationalist_outlook_effect = {
	if = {
		limit = {
			is_in_faction_with = INT
			INT = { is_faction_leader = yes }
		}
		add_ideas = INT_PHI_friendship_idea
	}
	else_if = {
		limit = {
			is_in_faction_with = CHI
			CHI = { is_faction_leader = yes }
		}
		add_ideas = CHI_PHI_friendship_idea
	}
	else_if = {
		limit = {
			is_in_faction_with = PRF
			PRF = { is_faction_leader = yes }
		}
		add_ideas = PRF_PHI_friendship_idea
	}
	else = {
		add_ideas = PHI_standing_our_grand_idea
	}
}

PHI_puppet_setup_leaders_effect = {
	if = {
		limit = { ROOT = { has_government = totalist } }
		set_popularities = {
			totalist = 10
			syndicalist = 11
			radical_socialist = 13
			social_democrat = 5
			social_liberal = 16
			market_liberal = 20
			social_conservative = 5
			authoritarian_democrat = 10
			paternal_autocrat = 5
			national_populist = 5
		}
		activate_advisor = PHI_guillermo_capadocia_sic
	}
	else_if = {
		limit = { ROOT = { has_government = syndicalist } }
		set_popularities = {
			totalist = 5
			syndicalist = 16
			radical_socialist = 13
			social_democrat = 5
			social_liberal = 16
			market_liberal = 20
			social_conservative = 5
			authoritarian_democrat = 10
			paternal_autocrat = 5
			national_populist = 5
		}
		activate_advisor = PHI_guillermo_capadocia_sic
	}
	else_if = {
		limit = { ROOT = { has_government = radical_socialist } }
		set_popularities = {
			totalist = 5
			syndicalist = 11
			radical_socialist = 18
			social_democrat = 5
			social_liberal = 16
			market_liberal = 20
			social_conservative = 5
			authoritarian_democrat = 10
			paternal_autocrat = 5
			national_populist = 5
		}
		activate_advisor = PHI_guillermo_capadocia_sic
	}
	else_if = {
		limit = { ROOT = { has_government = social_democrat } }
		set_popularities = {
			totalist = 5
			syndicalist = 11
			radical_socialist = 13
			social_democrat = 10
			social_liberal = 21
			market_liberal = 15
			social_conservative = 5
			authoritarian_democrat = 10
			paternal_autocrat = 5
			national_populist = 5
		}
		activate_advisor = PHI_norberto_nabong_sic
	}
	else_if = {
		limit = { ROOT = { has_government = social_liberal } }
		set_popularities = {
			totalist = 5
			syndicalist = 6
			radical_socialist = 13
			social_democrat = 10
			social_liberal = 26
			market_liberal = 15
			social_conservative = 5
			authoritarian_democrat = 10
			paternal_autocrat = 5
			national_populist = 5
		}
		activate_advisor = PHI_vicente_sotto_sic
	}
	else_if = {
		limit = { ROOT = { has_government = market_liberal } }
		set_popularities = {
			totalist = 5
			syndicalist = 6
			radical_socialist = 8
			social_democrat = 5
			social_liberal = 21
			market_liberal = 25
			social_conservative = 10
			authoritarian_democrat = 10
			paternal_autocrat = 5
			national_populist = 5
		}
		set_temp_variable = { coalition_partner_var = token:social_conservative }
		add_to_coalition = yes
	}
	else_if = {
		limit = { ROOT = { has_government = social_conservative } }
		set_popularities = {
			totalist = 5
			syndicalist = 6
			radical_socialist = 8
			social_democrat = 5
			social_liberal = 21
			market_liberal = 10
			social_conservative = 15
			authoritarian_democrat = 20
			paternal_autocrat = 5
			national_populist = 5
		}
		set_temp_variable = { coalition_partner_var = token:market_liberal }
		add_to_coalition = yes

	}
	else_if = {
		limit = { ROOT = { has_government = authoritarian_democrat } }
		set_popularities = {
			totalist = 5
			syndicalist = 6
			radical_socialist = 8
			social_democrat = 5
			social_liberal = 21
			market_liberal = 20
			social_conservative = 10
			authoritarian_democrat = 15
			paternal_autocrat = 5
			national_populist = 5
		}
		hidden_effect = {
			set_party_name = {
				ideology = authoritarian_democrat
				long_name = PHI_authoritarian_democrat_party_long
				name = PHI_authoritarian_democrat_party
			}
		}
	}
	else_if = {
		limit = { ROOT = { has_government = paternal_autocrat } }
		set_popularities = {
			totalist = 5
			syndicalist = 6
			radical_socialist = 8
			social_democrat = 5
			social_liberal = 6
			market_liberal = 10
			social_conservative = 10
			authoritarian_democrat = 30
			paternal_autocrat = 10
			national_populist = 10
		}
		activate_advisor = PHI_basilio_jose_valdes_sic
	}
	else_if = {
		limit = { ROOT = { has_government = national_populist } }
		set_popularities = {
			totalist = 5
			syndicalist = 6
			radical_socialist = 8
			social_democrat = 5
			social_liberal = 6
			market_liberal = 5
			social_conservative = 10
			authoritarian_democrat = 30
			paternal_autocrat = 10
			national_populist = 15
		}
		activate_advisor = PHI_celerino_tiongco_sic
	}
}

PHI_uncomplete_endgame_effect = {
	if = {
		limit = { has_completed_focus = PHI_nineteenthirtynine_elections }
		hidden_effect = {
			uncomplete_national_focus = {
				focus = PHI_nineteenthirtynine_elections
				uncomplete_children = yes
			}
			complete_national_focus = PHI_nineteenthirtynine_elections

			remove_ideas = {
				PHI_political_spirit_quezon_1_idea
				PHI_political_spirit_quezon_2_idea
				PHI_political_spirit_roxas_1_idea
				PHI_political_spirit_roxas_2_idea
				PHI_political_spirit_aguinaldo_1_idea
				PHI_political_spirit_aguinaldo_2_idea
				PHI_political_spirit_evangelista_1_idea
				PHI_political_spirit_evangelista_2_idea
				PHI_political_spirit_recto_1_idea
				PHI_political_spirit_recto_2_idea
				PHI_workers_rights_idea
				PHI_workers_revolution_idea
				PHI_cooperation_of_labour_and_capital_idea
				PHI_expel_subversives_idea
				PHI_women_suffrage_idea
				PHI_womens_revolution_idea
				PHI_mothers_of_the_nation_idea
				PHI_domestic_relations_and_probate_courts_idea
				PHI_model_of_filipino_womanhood_idea
				JAP_PHI_friendship_idea
				GER_PHI_friendship_idea
				USA_PHI_friendship_idea
				CHI_PHI_friendship_idea
				INT_PHI_friendship_idea
				PRF_PHI_friendship_idea
				PHI_standing_our_grand_idea
				PHI_pacific_vanguard
				PHI_break_up_the_haciendas_idea
				PHI_security_through_patronage_idea
				PHI_improve_working_class_housing_idea
				PHI_promote_welfare_idea
				PHI_pacific_socialist_vanguard
				PHI_the_unconquerable_faith_idea
				PHI_our_seat_at_the_table_idea
				PHI_the_glorious_republic_idea
			}
			if = {
				#Reset the political spirit
				limit = {
					NOT = {
						has_idea = PHI_political_spirit_1_idea
						has_idea = PHI_political_spirit_2_idea
						has_idea = PHI_political_spirit_3_idea
					}
				}
				add_ideas = PHI_political_spirit_3_idea
			}
		}
	}
}

########################################
########- Section 02: Economic -########
########################################
PHI_black_monday_effect = {
	if = {
		limit = { has_idea = PHI_black_monday_1 }
		swap_ideas = {
			remove_idea = PHI_black_monday_1
			add_idea = PHI_black_monday_2
		}
	}
	else_if = {
		limit = { has_idea = PHI_black_monday_2 }
		swap_ideas = {
			remove_idea = PHI_black_monday_2
			add_idea = PHI_black_monday_3
		}
	}
	else_if = {
		limit = { has_idea = PHI_black_monday_3 }
		remove_ideas = PHI_black_monday_3
	}
	else = {
		custom_effect_tooltip = PHI_black_monday_effect_tt
	}
}

PHI_land_reform_setup = {
	every_state = {
		limit = {
			OR = {
				is_core_of = PHI
				is_claimed_by = PHI
			}
		}
		ROOT = {
			activate_targeted_decision = { target = PREV decision = PHI_land_reform_decision }
		}
	}
}

########################################
########- Section 03: Military -########
########################################

PHI_spawn_irregulars_effect = {
	if = {
		limit = { NOT = { has_template = "Sandatahanes" } }
		division_template = {
			name = "Sandatahanes"
			division_names_group = PHI_INF_01
			regiments = {
				irregular_infantry = { x = 0 y = 0 }
				irregular_infantry = { x = 0 y = 1 }
				irregular_infantry = { x = 1 y = 0 }
				irregular_infantry = { x = 1 y = 1 }
			}
		}
	}
	327 = {
		create_unit = {
			division = "division_template = \"Sandatahanes\" start_experience_factor = 1.0 start_equipment_factor = 0.9"
			owner = controller
		}
	}
	327 = {
		create_unit = {
			division = "division_template = \"Sandatahanes\" start_experience_factor = 1.0 start_equipment_factor = 0.9"
			owner = controller
		}
	}
	327 = {
		create_unit = {
			division = "division_template = \"Sandatahanes\" start_experience_factor = 1.0 start_equipment_factor = 0.9"
			owner = controller
		}
	}
	327 = {
		create_unit = {
			division = "division_template = \"Sandatahanes\" start_experience_factor = 1.0 start_equipment_factor = 0.9"
			owner = controller
		}
	}
	327 = {
		create_unit = {
			division = "division_template = \"Sandatahanes\" start_experience_factor = 1.0 start_equipment_factor = 0.9"
			owner = controller
		}
	}

}
