lower_effects_of_unmilitarization = {
	if = {
		limit = { has_idea = BUL_legacy_of_militarization }
		custom_effect_tooltip = BUL_lower_effects_of_millitarization_legacy_tt
		swap_ideas = {
			remove_idea = BUL_legacy_of_militarization
			add_idea = BUL_legacy_of_militarization_2
		}
	}
	else_if = {
		limit = { has_idea = BUL_legacy_of_militarization_2 }
		custom_effect_tooltip = BUL_lower_effects_of_millitarization_legacy_tt
		swap_ideas = {
			remove_idea = BUL_legacy_of_militarization_2
			add_idea = BUL_legacy_of_militarization_3
		}
	}
	else_if = {
		limit = { has_idea = BUL_legacy_of_militarization_3 }
		custom_effect_tooltip = BUL_lower_effects_of_millitarization_legacy_tt
		swap_ideas = {
			remove_idea = BUL_legacy_of_militarization_3
			add_idea = BUL_legacy_of_militarization_4
		}
	}
	else_if = {
		limit = { has_idea = BUL_legacy_of_militarization_4 }
		custom_effect_tooltip = BUL_remove_effects_of_millitarization_legacy_tt
		remove_ideas = BUL_legacy_of_militarization_4
	}
}

lower_effects_of_GRN_uneducated_population = {
	if = {
		limit = { has_idea = GRN_uneducated_population }
		swap_ideas = {
			remove_idea = GRN_uneducated_population
			add_idea = GRN_uneducated_population_2
		}
	}
	else_if = {
		limit = { has_idea = GRN_uneducated_population_2 }

		swap_ideas = {
			remove_idea = GRN_uneducated_population_2
			add_idea = GRN_uneducated_population_3
		}
	}
	else_if = {
		limit = { has_idea = GRN_uneducated_population_3 }
		swap_ideas = {
			remove_idea = GRN_uneducated_population_3
			add_idea = GRN_uneducated_population_4
		}
	}
	else_if = {
		limit = { has_idea = GRN_uneducated_population_4 }
		remove_ideas = GRN_uneducated_population_4
	}
}

upgrade_GRN_army = {
	if = {
		limit = { NOT = { has_completed_focus = GRN_strenghten_Sirius_Dog_Sled_Patrol } }
		custom_effect_tooltip = GRN_army_upgrade_tt
	}
	else_if = {
		limit = { has_idea = GRN_Greenlandian_army }
		swap_ideas = {
			remove_idea = GRN_Greenlandian_army
			add_idea = GRN_Greenlandian_army_2
		}
	}
	else_if = {
		limit = { has_idea = GRN_Greenlandian_army_2 }

		swap_ideas = {
			remove_idea = GRN_Greenlandian_army_2
			add_idea = GRN_Greenlandian_army_3
		}
	}
	else_if = {
		limit = { has_idea = GRN_Greenlandian_army_3 }
		swap_ideas = {
			remove_idea = GRN_Greenlandian_army_3
			add_idea = GRN_Greenlandian_army_4
		}
	}
	else_if = {
		limit = { has_idea = GRN_Greenlandian_army_4 }
		swap_ideas = {
			remove_idea = GRN_Greenlandian_army_4
			add_idea = GRN_Greenlandian_army_5
		}
	}
	else_if = {
		limit = { has_idea = GRN_Greenlandian_army_5 }
		swap_ideas = {
			remove_idea = GRN_Greenlandian_army_5
			add_idea = GRN_Greenlandian_army_6
		}
	}
}

lower_effects_of_economic_crisis = {
	if = {
		limit = { has_idea = BUL_recovering_economy }
		swap_ideas = {
			remove_idea = BUL_recovering_economy
			add_idea = BUL_recovering_economy_2
		}
	}
	else_if = {
		limit = { has_idea = BUL_recovering_economy_2 }

		swap_ideas = {
			remove_idea = BUL_recovering_economy_2
			add_idea = BUL_recovering_economy_3
		}
	}
	else_if = {
		limit = { has_idea = BUL_recovering_economy_3 }
		swap_ideas = {
			remove_idea = BUL_recovering_economy_3
			add_idea = BUL_recovering_economy_4
		}
	}
	else_if = {
		limit = { has_idea = BUL_recovering_economy_4 }
		swap_ideas = {
			remove_idea = BUL_recovering_economy_4
			add_idea = BUL_recovering_economy_5
		}
	}
	else_if = {
		limit = { has_idea = BUL_recovering_economy_5 }
		remove_ideas = BUL_recovering_economy_5
	}

}

create_random_factory_CIV_1 = {
	random_owned_state = {
		limit = {
			free_building_slots = {
				building = industrial_complex
				size > 0
				include_locked = yes
			}
		}
		add_extra_state_shared_building_slots = 1
		add_building_construction = {
			type = industrial_complex
			level = 1
			instant_build = yes
		}
	}
}


create_random_factory_CIV_2 = {
	random_owned_state = {
		limit = {
			free_building_slots = {
				building = industrial_complex
				size > 1
				include_locked = yes
			}
		}
		add_extra_state_shared_building_slots = 1
		add_building_construction = {
			type = industrial_complex
			level = 2
			instant_build = yes
		}
	}
}

create_random_factory_MIL_1 = {
	random_owned_state = {
		limit = {
			free_building_slots = {
				building = arms_factory
				size > 0
				include_locked = yes
			}
		}
		add_extra_state_shared_building_slots = 1
		add_building_construction = {
			type = arms_factory
			level = 1
			instant_build = yes
		}
	}
}
create_random_factory_MIL_2 = {
	random_owned_state = {
		limit = {
			free_building_slots = {
				building = arms_factory
				size > 1
				include_locked = yes
			}
		}
		add_extra_state_shared_building_slots = 1
		add_building_construction = {
			type = arms_factory
			level = 2
			instant_build = yes
		}
	}
}
