egyptian_westernization = {
	available = {
		has_dlc = "King of Kings"
	}
	powers = {
		egyptian_westernization = {
			gui = egyptian_westernization_gov_mech
			show_before_interactions = yes
			max = 100
			reset_on_new_ruler = no
			base_monthly_growth = -0.05
			development_scaled_monthly_growth = 0
			scaled_modifier = {
				modifier = {
					technology_cost = -0.1
					idea_cost = -0.05
					yearly_innovativeness = 0.25
				}
			}
			reverse_scaled_modifier = {
				modifier = {
					all_estate_loyalty_equilibrium = 0.1
					stability_cost_modifier = -0.25
					tolerance_own = 1
				}
				start_value = 0
				end_value = 50
			}
			scaled_modifier = {
				modifier = {
					all_estate_loyalty_equilibrium = -0.1
					stability_cost_modifier = 0.25
					tolerance_own = -1
				}
				start_value = 50
				end_value = 100
			}
			is_good = yes
		}
	}
	interactions = {
		study_western_administration = {
			icon = GFX_study_western_administration
			gui = "egyptian_westernization_interaction_button"
			cost_type = egyptian_westernization
			cost = 30
			trigger = { 
				custom_trigger_tooltip = {
					tooltip = egyptian_westernization_trigger_tt
					NOT = { 
						check_variable = {
							which = egyptian_adm_westernization_var
							value = 5
						}
					}
				}
				if = {
					limit = { has_dlc = "Rule Britannia" }
					innovativeness = 3
				}
				adm_power = 100
            }
			effect = {
				if = {
					limit = { has_dlc = "Rule Britannia" }
					change_innovativeness = -3
				}
				add_adm_power = -100
				if = {
					limit = { 
						NOT = {
							check_variable = {
								which = egyptian_adm_westernization_var
								value = 1
							}
						}
					}
					custom_tooltip = egyptian_adm_counter_1_tt
					
					hidden_effect = {
						remove_country_modifier = egyptian_adm_westernization_4_modifier
						remove_country_modifier = egyptian_adm_westernization_3_modifier
						remove_country_modifier = egyptian_adm_westernization_5_modifier
						remove_country_modifier = egyptian_adm_westernization_2_modifier
						change_government_reform_progress = 100
						set_variable = {
							which = egyptian_adm_westernization_var
							value = 1
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_adm_westernization_var
							value = 1
						}
						NOT = { 
							check_variable = {
								which = egyptian_adm_westernization_var
								value = 2
							}
						}
					}
					custom_tooltip = egyptian_adm_counter_2_tt

					hidden_effect = {
						remove_country_modifier = egyptian_adm_westernization_4_modifier
						remove_country_modifier = egyptian_adm_westernization_3_modifier
						remove_country_modifier = egyptian_adm_westernization_5_modifier
						set_variable = {
							which = egyptian_adm_westernization_var
							value = 2
						}
					}
					
					add_country_modifier = {
						name = egyptian_adm_westernization_2_modifier
						duration = -1
						hidden = yes
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_adm_westernization_var
							value = 2
						}
						NOT = { 
							check_variable = {
								which = egyptian_adm_westernization_var
								value = 3
							}
						}
					}
					custom_tooltip = egyptian_adm_counter_3_tt
				
					hidden_effect = {
						remove_country_modifier = egyptian_adm_westernization_2_modifier
						remove_country_modifier = egyptian_adm_westernization_4_modifier
						remove_country_modifier = egyptian_adm_westernization_5_modifier
						set_variable = {
							which = egyptian_adm_westernization_var
							value = 3
						}
					}
					add_country_modifier = {
						name = egyptian_adm_westernization_3_modifier
						duration = -1
						hidden = yes
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_adm_westernization_var
							value = 3
						}
						NOT = { 
							check_variable = {
								which = egyptian_adm_westernization_var
								value = 4
							}
						}
					}
					custom_tooltip = egyptian_adm_counter_4_tt
	
					hidden_effect = {
						remove_country_modifier = egyptian_adm_westernization_2_modifier
						remove_country_modifier = egyptian_adm_westernization_3_modifier
						remove_country_modifier = egyptian_adm_westernization_5_modifier
						set_variable = {
							which = egyptian_adm_westernization_var
							value = 4
						}
					}
					add_country_modifier = {
						name = egyptian_adm_westernization_4_modifier
						duration = -1
						hidden = yes
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_adm_westernization_var
							value = 4
						}
						NOT = { 
							check_variable = {
								which = egyptian_adm_westernization_var
								value = 5
							}
						}
					}
					custom_tooltip = egyptian_adm_counter_5_tt
					
					hidden_effect = {
						remove_country_modifier = egyptian_adm_westernization_2_modifier
						remove_country_modifier = egyptian_adm_westernization_3_modifier
						remove_country_modifier = egyptian_adm_westernization_4_modifier
						set_variable = {
							which = egyptian_adm_westernization_var
							value = 5
						}
					}
					
					add_country_modifier = {
						name = egyptian_adm_westernization_5_modifier
						duration = -1
						hidden = yes 
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_adm_westernization_var
							value = 5
						}
					}
					custom_tooltip = egyptian_adm_counter_6_tt
				}
				if = {
					limit = { has_country_flag = egyptian_westernization_costs_less_flag }
					add_government_power = { 
						mechanic_type = egyptian_westernization
						power_type = egyptian_westernization
						value = 5
					} 
				}
			}
			ai_chance = {
				
			}
		}
		study_western_manufacturing = {
			icon = GFX_study_western_manufacturing
			gui = "egyptian_westernization_interaction_button"
			cost_type = egyptian_westernization
			cost = 30
			trigger = {
				custom_trigger_tooltip = {
					tooltip = egyptian_westernization_trigger_2_tt
					NOT = { 
						check_variable = {
							which = egyptian_dip_westernization_var
							value = 5
						}
					}
				}
				if = {
					limit = { has_dlc = "Rule Britannia" }
					innovativeness = 3
				}
				dip_power = 100
            }
			effect = {
				if = {
					limit = { has_dlc = "Rule Britannia" }
					change_innovativeness = -3
				}
				add_dip_power = -100
				if = {
					limit = { 
						NOT = {
							check_variable = {
								which = egyptian_dip_westernization_var
								value = 1
							}
						}
					}
					custom_tooltip = egyptian_dip_counter_1_tt
					
					hidden_effect = {
						set_variable = {
							which = egyptian_dip_westernization_var
							value = 1
						}
						remove_country_modifier = egyptian_dip_westernization_4_modifier
						remove_country_modifier = egyptian_dip_westernization_3_modifier
						remove_country_modifier = egyptian_dip_westernization_5_modifier
						remove_country_modifier = egyptian_dip_westernization_2_modifier
						change_government_reform_progress = 100
						set_variable = {
							which = egyptian_dip_westernization_var
							value = 1
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_dip_westernization_var
							value = 1
						}
						NOT = { 
							check_variable = {
								which = egyptian_dip_westernization_var
								value = 2
							}
						}
					}
					custom_tooltip = egyptian_dip_counter_2_tt

					hidden_effect = {
						remove_country_modifier = egyptian_dip_westernization_4_modifier
						remove_country_modifier = egyptian_dip_westernization_3_modifier
						remove_country_modifier = egyptian_dip_westernization_5_modifier
						set_variable = {
							which = egyptian_dip_westernization_var
							value = 2
						}
						add_country_modifier = {
							name = egyptian_dip_westernization_2_modifier
							duration = -1
							hidden = yes
						}
					}		
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_dip_westernization_var
							value = 2
						}
						NOT = { 
							check_variable = {
								which = egyptian_dip_westernization_var
								value = 3
							}
						}
					}
					custom_tooltip = egyptian_dip_counter_3_tt
				
					hidden_effect = {
						remove_country_modifier = egyptian_dip_westernization_2_modifier
						remove_country_modifier = egyptian_dip_westernization_4_modifier
						remove_country_modifier = egyptian_dip_westernization_5_modifier
						set_variable = {
							which = egyptian_dip_westernization_var
							value = 3
						}
						add_country_modifier = {
							name = egyptian_dip_westernization_3_modifier
							duration = -1
							hidden = yes
						}
					}
					
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_dip_westernization_var
							value = 3
						}
						NOT = { 
							check_variable = {
								which = egyptian_dip_westernization_var
								value = 4
							}
						}
					}
					custom_tooltip = egyptian_dip_counter_4_tt
	
					hidden_effect = {
						remove_country_modifier = egyptian_dip_westernization_2_modifier
						remove_country_modifier = egyptian_dip_westernization_3_modifier
						remove_country_modifier = egyptian_dip_westernization_5_modifier
						set_variable = {
							which = egyptian_dip_westernization_var
							value = 4
						}
						add_country_modifier = {
							name = egyptian_dip_westernization_4_modifier
							duration = -1
							hidden = yes
						}
					}
					
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_dip_westernization_var
							value = 4
						}
						NOT = { 
							check_variable = {
								which = egyptian_dip_westernization_var
								value = 5
							}
						}
					}
					custom_tooltip = egyptian_dip_counter_5_tt
					
					hidden_effect = {
						remove_country_modifier = egyptian_dip_westernization_2_modifier
						remove_country_modifier = egyptian_dip_westernization_3_modifier
						remove_country_modifier = egyptian_dip_westernization_4_modifier
						set_variable = {
							which = egyptian_dip_westernization_var
							value = 5
						}
						add_country_modifier = {
							name = egyptian_dip_westernization_5_modifier
							duration = -1
							hidden = yes 
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_dip_westernization_var
							value = 5
						}
					}
					custom_tooltip = egyptian_dip_counter_6_tt
				}
				if = {
					limit = { has_country_flag = egyptian_westernization_costs_less_flag }
					add_government_power = { 
						mechanic_type = egyptian_westernization
						power_type = egyptian_westernization
						value = 5
					} 
				}
			}
			ai_chance = {
				
			}
		}
		study_western_miltary = {
			icon = GFX_study_western_military
			gui = "egyptian_westernization_interaction_button"
			cost_type = egyptian_westernization
			cost = 30
			trigger = {
				custom_trigger_tooltip = {
					tooltip = egyptian_westernization_trigger_3_tt
					NOT = { 
						check_variable = {
							which = egyptian_mil_westernization_var
							value = 5
						}
					}
				}
				if = {
					limit = { has_dlc = "Rule Britannia" }
					innovativeness = 3
				}
				mil_power = 100
            }
			effect = {
				if = {
					limit = { has_dlc = "Rule Britannia" }
					change_innovativeness = -3
				}
				add_mil_power = -100
				if = {
					limit = { 
						NOT = {
							check_variable = {
								which = egyptian_mil_westernization_var
								value = 1
							}
						}
					}
					custom_tooltip = egyptian_mil_counter_1_tt
					
					hidden_effect = {
						set_variable = {
							which = egyptian_mil_westernization_var
							value = 1
						}
						remove_country_modifier = egyptian_mil_westernization_4_modifier
						remove_country_modifier = egyptian_mil_westernization_3_modifier
						
						remove_country_modifier = egyptian_mil_westernization_2_modifier
						add_army_tradition = 10
						set_variable = {
							which = egyptian_mil_westernization_var
							value = 1
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_mil_westernization_var
							value = 1
						}
						NOT = { 
							check_variable = {
								which = egyptian_mil_westernization_var
								value = 2
							}
						}
					}
					custom_tooltip = egyptian_mil_counter_2_tt

					hidden_effect = {
						remove_country_modifier = egyptian_mil_westernization_4_modifier
						remove_country_modifier = egyptian_mil_westernization_3_modifier
						
						set_variable = {
							which = egyptian_mil_westernization_var
							value = 2
						}
						add_country_modifier = {
							name = egyptian_mil_westernization_2_modifier
							duration = -1
							hidden = yes
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_mil_westernization_var
							value = 2
						}
						NOT = { 
							check_variable = {
								which = egyptian_mil_westernization_var
								value = 3
							}
						}
					}
					custom_tooltip = egyptian_mil_counter_3_tt
				
					hidden_effect = {
						remove_country_modifier = egyptian_mil_westernization_2_modifier
						remove_country_modifier = egyptian_mil_westernization_4_modifier
						
						set_variable = {
							which = egyptian_mil_westernization_var
							value = 3
						}
						add_country_modifier = {
							name = egyptian_mil_westernization_3_modifier
							duration = -1
							hidden = yes
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_mil_westernization_var
							value = 3
						}
						NOT = { 
							check_variable = {
								which = egyptian_mil_westernization_var
								value = 4
							}
						}
					}
					custom_tooltip = egyptian_mil_counter_4_tt
	
					hidden_effect = {
						remove_country_modifier = egyptian_mil_westernization_2_modifier
						remove_country_modifier = egyptian_mil_westernization_3_modifier
						
						set_variable = {
							which = egyptian_mil_westernization_var
							value = 4
						}
						add_country_modifier = {
							name = egyptian_mil_westernization_4_modifier
							duration = -1
							hidden = yes
						}
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_mil_westernization_var
							value = 4
						}
						NOT = { 
							check_variable = {
								which = egyptian_mil_westernization_var
								value = 5
							}
						}
					}
					custom_tooltip = egyptian_mil_counter_5_tt
					
					hidden_effect = {

						set_variable = {
							which = egyptian_mil_westernization_var
							value = 5
						}
						change_technology_group = western
						change_unit_type = western
					}
				}
				else_if = {
					limit = { 
						check_variable = {
							which = egyptian_mil_westernization_var
							value = 5
						}
					}
					custom_tooltip = egyptian_mil_counter_6_tt
				}
				if = {
					limit = { has_country_flag = egyptian_westernization_costs_less_flag }
					add_government_power = { 
						mechanic_type = egyptian_westernization
						power_type = egyptian_westernization
						value = 5
					} 
				}
			}
			ai_chance = {
				
			}
		}
	}
}