Initial commit

This commit is contained in:
Ваше имя
2026-10-17 14:54:36 +03:00
commit f80644285e
526 changed files with 99561 additions and 0 deletions
@@ -0,0 +1,159 @@
ai_monthly_house_construction_effect = {
if = {
limit = {
is_ai = yes
monthly_balance > 20
# --- УМНЫЙ КУЛДАУН НА СТРАНУ ---
# Проверяем, что в стране НЕТ ни одного Town_holl, который сейчас строится.
# Если здание уже построено, его location_building_level > 0.
# Если оно строится, его уровень = 0.
NOT = {
any_owned_location = {
any_buildings_in_location = {
building_type = building_type:Town_holl
NOT = { location_building_level > 0 } # Здание есть, но еще не достроено
}
}
}
}
every_owned_location = {
limit = {
# Проверяем, что в провинции вообще есть это здание
any_buildings_in_location = {
building_type = building_type:Town_holl
}
# ПРОВЕРКА ДОСТАНОВЛЯЕМОСТИ
# Так как само здание дает +30, порог ставим 40.
proximity > 65
}
# Команда на снос здания
remove_building = building_type:Town_holl
}
# --- ПОИСК ПОДХОДЯЩЕЙ ПРОВИНЦИИ ---
random_owned_location = {
limit = {
is_ownable = yes
# Только города
location_rank = location_rank:city
is_capital = no
# Досягаемость менее 50
local_proximity_source < 50
# Проверка культуры
owner = {
has_primary_or_accepted_culture = prev.dominant_culture
}
# --- ЛОКАЛЬНАЯ ПРОВЕРКА ПРОВИНЦИИ ---
# В этой провинции вообще не должно быть Town_holl (ни строящегося, ни готового)
NOT = {
any_buildings_in_location = {
building_type = building_type:Town_holl
}
}
}
# --- СТРОИМ ЗДАНИЕ ---
construct_building = {
building_type = building_type:Town_holl
}
# Переменные кулдауна больше не нужны, логика полностью динамическая!
}
}
}
ai_monthly_proximity_house_construction_effect = {
if = {
limit = { is_ai = yes }
# ====================================================================
# ЧАСТЬ 1: УДАЛЕНИЕ ЗДАНИЙ С ИЗБЫТОЧНОЙ ДОСТАНОВЛЯЕМОСТЬЮ (PROXIMITY)
# ====================================================================
# ИИ проверяет все свои локации. Если там есть Proximity_house, а досягаемость > 40, здание сносится.
every_owned_location = {
limit = {
# Проверяем, что в провинции вообще есть это здание
any_buildings_in_location = {
building_type = building_type:Proximity_house
}
# ПРОВЕРКА ДОСТАНОВЛЯЕМОСТИ
# Так как само здание дает +30, порог ставим 40.
proximity > 40
}
# Команда на снос здания
remove_building = building_type:Proximity_house
# АЛЬТЕРНАТИВА (если remove_building не сработает):
# change_building_level_in_location = { building = building_type:Proximity_house value = -1 }
}
# ====================================================================
# ЧАСТЬ 2: ПОСТРОЙКА НОВЫХ ЗДАНИЙ (СТРОГО ПО ОДНОМУ ЗА РАЗ)
# ====================================================================
# Строим только если в стране НЕТ ни одного Proximity_house в процессе стройки
if = {
limit = {
# УМНЫЙ КУЛДАУН:
# Если здание уже построено, его location_building_level > 0.
# Если оно строится, его уровень = 0. Мы блокируем постройку новых, пока есть строящиеся.
NOT = {
any_owned_location = {
any_buildings_in_location = {
building_type = building_type:Proximity_house
NOT = { location_building_level > 0 }
}
}
}
}
# Ищем ОДНУ случайную подходящую провинцию (random, а не every!)
random_owned_location = {
limit = {
is_ownable = yes
# ⚠️ ВАЖНО: Proximity_house строится ТОЛЬКО в поселках (town)!
location_rank = location_rank:town
is_capital = no
# Физическая дистанция до столицы менее 50
distance_to_capital < 50
# Проверка культуры
owner = {
has_primary_or_accepted_culture = prev.dominant_culture
}
# Здания еще нет
NOT = {
any_buildings_in_location = {
building_type = building_type:Proximity_house
}
}
# ⚠️ ЗАЩИТА ОТ ЦИКЛА "ПОСТРОИЛ-СНЕС":
# Разрешаем строить только если текущая досягаемость в провинции <= 40.
proximity <= 40
}
# Строим
construct_building = {
building_type = building_type:Proximity_house
}
}
}
}
}
@@ -0,0 +1,17 @@
# Strips every tier of the integration-chain province modifier from the
# scoped province. Used before granting the tier that currently matches, so
# a province never carries two tiers at once.
rov_integration_clear_province_tier_effect = {
if = {
limit = { has_province_modifier = rov_integration_office_province }
remove_province_modifier = rov_integration_office_province
}
if = {
limit = { has_province_modifier = rov_integration_chancery_province }
remove_province_modifier = rov_integration_chancery_province
}
if = {
limit = { has_province_modifier = rov_integration_ministry_province }
remove_province_modifier = rov_integration_ministry_province
}
}