﻿mbrxxx_game_rule_slots_effect = {
	if = { 
		limit = { has_game_rule = less_slots_limit }
		every_county = {
			every_county_province = {
				add_province_modifier = extra_building_slot
			}
		}
	}
	else_if = {
		limit = { has_game_rule = more_slots_limit }
		every_county = {
			every_county_province = {
				add_province_modifier = extra_building_slot
				add_province_modifier = extra_building_slot
			}
		}
	}
	else_if = {
		limit = { has_game_rule = extreme_slots_limit }
		every_county = {
			every_county_province = {
				add_province_modifier = extra_building_slot
				add_province_modifier = extra_building_slot
				add_province_modifier = extra_building_slot
			}
		}
	}
}

mbrxxx_civil_engineering_constructed_effect = {
	$PROVINCE$ = {
		add_province_modifier = extra_building_slot
	}

	remove_building = civil_engineering_01
}

mbrxxx_coach_house_04_constructed_effect = {
	save_scope_as = mbrxxx_this_province
	scope:mbrxxx_this_province = {
		if = {
			limit = {
				mbrxxx_coach_house_has_spy_trigger = yes
			}

			county = {
				holder = {
					set_variable = { name = mbrxxx_province_with_spy value = scope:mbrxxx_this_province }
					create_story = mbrxxx_story_spy
				}
			}

			if = {
				limit = {
					not = {
						is_target_in_global_variable_list = { name = mbrxxx_poi_province_list target = this }
					}
				}

				add_to_global_variable_list = { name = mbrxxx_poi_province_list target = this }
			}

			if = {
				limit = {
					not = { has_travel_point_of_interest = mbrxxx_poi }
				}

				add_travel_point_of_interest = mbrxxx_poi
			}
		}
	}
}

mbrxxx_coach_house_06_constructed_effect = {
	save_scope_as = mbrxxx_this_province
	scope:mbrxxx_this_province = {
		if = {
			limit = {
				mbrxxx_coach_house_has_gamekeeper_trigger = yes
			}
		}

		county = {
			holder = {
				set_variable = { name = mbrxxx_province_with_gamekeeper value = scope:mbrxxx_this_province }
				create_story = mbrxxx_story_gamekeeper
			}
		}
	}
}

mbrxxx_coach_house_08_constructed_effect = {
	save_scope_as = mbrxxx_this_province
	scope:mbrxxx_this_province = {
		if = {
			limit = {
				mbrxxx_coach_house_has_casino_trigger = yes
			}
		}

		county = {
			holder = {
				set_variable = { name = mbrxxx_province_with_casino value = scope:mbrxxx_this_province }
				create_story = mbrxxx_story_casino
			}
		}
	}
}

mbrxxx_warden_station_04_constructed_effect = {
	save_scope_as = mbrxxx_this_province
	scope:mbrxxx_this_province = {
		if = {
			limit = {
				mbrxxx_warden_station_has_blademaster_trigger = yes
			}

			county = {
				holder = {
					set_variable = { name = mbrxxx_province_with_blademaster value = scope:mbrxxx_this_province }
					create_story = mbrxxx_story_blademaster
				}
			}

			if = {
				limit = {
					not = {
						is_target_in_global_variable_list = { name = mbrxxx_poi_province_list target = this }
					}
				}

				add_to_global_variable_list = { name = mbrxxx_poi_province_list target = this }
			}

			if = {
				limit = {
					not = { has_travel_point_of_interest = mbrxxx_poi }
				}

				add_travel_point_of_interest = mbrxxx_poi
			}
		}
	}
}
