﻿# ============================================================
# Integration chain: province-scope bridge
# ============================================================
# province_integration_speed belongs to the *province* modifier category,
# while a building's own modifier block is location-scope only. So the
# province-wide bonus is maintained here, the same way
# cveg_monthly_integration_check maintains province_base: reconciled on the
# monthly country pulse, which keeps it correct when the building is
# destroyed, upgraded, or when the location stops being conquered and
# becomes a core.

rov_integration_buildings_monthly = {
	effect = {
		every_province = {
			if = {
				limit = {
					any_location_in_province = {
						has_building = building_type:integration_ministry
					}
				}
				rov_integration_clear_province_tier_effect = yes
				if = {
					limit = {
						NOT = { has_province_modifier = rov_integration_ministry_province }
					}
					add_province_modifier = {
						modifier = rov_integration_ministry_province
					}
				}
			}
			else_if = {
				limit = {
					any_location_in_province = {
						has_building = building_type:integration_chancery
					}
				}
				rov_integration_clear_province_tier_effect = yes
				if = {
					limit = {
						NOT = { has_province_modifier = rov_integration_chancery_province }
					}
					add_province_modifier = {
						modifier = rov_integration_chancery_province
					}
				}
			}
			else_if = {
				limit = {
					any_location_in_province = {
						has_building = building_type:integration_office
					}
				}
				rov_integration_clear_province_tier_effect = yes
				if = {
					limit = {
						NOT = { has_province_modifier = rov_integration_office_province }
					}
					add_province_modifier = {
						modifier = rov_integration_office_province
					}
				}
			}
			else = {
				rov_integration_clear_province_tier_effect = yes
			}
		}
	}
}
