# 本文件定义「无限星球」起源使用的四座专属岗位建筑
# 说明：原先由 d_unlimited_planet 无条件按人口比例发放岗位，玩家无法关闭；
#       现改为由本文件的四座建筑分别提供，玩家可自行建造与拆除，从而随时开关这些岗位。
#
# 四座建筑按提供的岗位区分，互不重叠：
#   bd_unlimited_job_matrix_resource       资源采集：技工、矿工、农夫
#   bd_unlimited_job_matrix_manufacturing  工业制造：冶金师、工匠、商贩；稀有资源由工业岗位附带产出
#   bd_unlimited_job_matrix_research       科研行政：物理学家、生物学家、工程学家、官僚
#   bd_unlimited_job_matrix_military       军事防务：士兵 / 战斗子个体（附常驻合金加成）
#
# 集中度倍率：四座建筑各 planet_limit = 1，同一行星最多同时存在 4 座，
#   档位 = 本行星已建成的矩阵建筑总数（含自己），共 4 档：
#     只建 1 座 → 该类岗位 ×3
#     共 2 座   → 每类 ×1.5
#     共 3 座   → 每类 ×1
#     四类齐建 → 每类 ×0.75
#   四类建筑的「单建」岗位总量已拉平（资源 / 工业 / 军事 0.45，科研 0.60），
#   因此四类齐建 = 0.75 × (0.15 + 0.15 + 0.20 + 0.15) = 0.4875，与单建同量级。
#   ★ 上限由「虚拟」机制的正反馈决定：单建筑 k = 该类岗位键数 × t1 值，
#   任何已建成组合都必须 < 1，实际按 ≤ 0.6 留余量；
#   推导与当前取值见 common/scripted_variables/bd_job_matrix_values.txt 顶部说明。
#
# 每档的判定条件（「另外三座」的存在组合共 8 种）已封装进
#   common/scripted_triggers/bd_job_matrix_tiers.txt
# 本文件通过 bd_jm_<建筑>_t<档位> = yes 引用，不再重复书写组合判定。
#
# ★ 调数值只需要改一个文件：common/scripted_variables/bd_job_matrix_values.txt
#   （四档岗位量与军事防务的合金加成都在那里，本文件只是用 @变量 引用它们）
#
# ★ 建造列表页签：选建筑界面按建筑的 category 字段分页签（category 属于
#   enum[building_categories]，其顺序为
#   army → manufacturing → government → pop_assembly → resource → unity → research
#   → trade → amenity → planet_buildings → amenities）。
#   planet_buildings 是倒数第二个页签，把建筑放进去必然排在页面很后面，
#   且 position_priority 只能在该页签内部排序、无法提升页签本身的位置。
#   因此四座建筑按语义分到靠前页签：resource / manufacturing / research / army。
#
# ★ 注意：building_sets 只决定「能在哪些 Zone 建造」，CWT 注释为
#   "used to remove from construction lists"，它不参与建造列表的排序。

## 资源采集建筑：电力 / 矿物 / 食物（士兵岗位已拆到军事防务建筑）
bd_unlimited_job_matrix_resource = {
	icon = building_energy_nexus
	base_buildtime = 60
	category = resource
	building_sets = {
		government
		urban
	}
	can_build = yes
	planet_limit = 1

	potential = {
		has_planet_flag = pc_unlimited
	}

	# 常规帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_resource_t1 = yes
		}
		job_technician_per_pop = @bd_jm_resource_n_t1
		job_miner_per_pop = @bd_jm_resource_n_t1
		job_farmer_per_pop = @bd_jm_resource_n_t1
	}

	# 常规帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_resource_t2 = yes
		}
		job_technician_per_pop = @bd_jm_resource_n_t2
		job_miner_per_pop = @bd_jm_resource_n_t2
		job_farmer_per_pop = @bd_jm_resource_n_t2
	}

	# 常规帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_resource_t3 = yes
		}
		job_technician_per_pop = @bd_jm_resource_n_t3
		job_miner_per_pop = @bd_jm_resource_n_t3
		job_farmer_per_pop = @bd_jm_resource_n_t3
	}

	# 常规帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_resource_t4 = yes
		}
		job_technician_per_pop = @bd_jm_resource_n_t4
		job_miner_per_pop = @bd_jm_resource_n_t4
		job_farmer_per_pop = @bd_jm_resource_n_t4
	}

	# 格式塔帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_resource_t1 = yes
		}
		job_technician_drone_per_pop = @bd_jm_resource_g_t1
		job_mining_drone_per_pop = @bd_jm_resource_g_t1
		job_agri_drone_per_pop = @bd_jm_resource_g_t1
	}

	# 格式塔帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_resource_t2 = yes
		}
		job_technician_drone_per_pop = @bd_jm_resource_g_t2
		job_mining_drone_per_pop = @bd_jm_resource_g_t2
		job_agri_drone_per_pop = @bd_jm_resource_g_t2
	}

	# 格式塔帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_resource_t3 = yes
		}
		job_technician_drone_per_pop = @bd_jm_resource_g_t3
		job_mining_drone_per_pop = @bd_jm_resource_g_t3
		job_agri_drone_per_pop = @bd_jm_resource_g_t3
	}

	# 格式塔帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_resource_t4 = yes
		}
		job_technician_drone_per_pop = @bd_jm_resource_g_t4
		job_mining_drone_per_pop = @bd_jm_resource_g_t4
		job_agri_drone_per_pop = @bd_jm_resource_g_t4
	}

	ai_weight = {
		base = 100
	}
}

## 工业制造建筑：合金 / 消费品 / 贸易；稀有资源由工业岗位附带产出
bd_unlimited_job_matrix_manufacturing = {
	icon = building_nano_forge
	base_buildtime = 60
	category = manufacturing
	building_sets = {
		government
		urban
	}
	can_build = yes
	planet_limit = 1

	potential = {
		has_planet_flag = pc_unlimited
	}

	# 常规帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_manufacturing_t1 = yes
		}
		job_foundry_per_pop = @bd_jm_manufacturing_n_t1
		job_artisan_per_pop = @bd_jm_manufacturing_n_t1
		job_trader_per_pop = @bd_jm_manufacturing_n_t1
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t1
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t1
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t1
	}

	# 常规帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_manufacturing_t2 = yes
		}
		job_foundry_per_pop = @bd_jm_manufacturing_n_t2
		job_artisan_per_pop = @bd_jm_manufacturing_n_t2
		job_trader_per_pop = @bd_jm_manufacturing_n_t2
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t2
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t2
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t2
	}

	# 常规帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_manufacturing_t3 = yes
		}
		job_foundry_per_pop = @bd_jm_manufacturing_n_t3
		job_artisan_per_pop = @bd_jm_manufacturing_n_t3
		job_trader_per_pop = @bd_jm_manufacturing_n_t3
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t3
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t3
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t3
	}

	# 常规帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_manufacturing_t4 = yes
		}
		job_foundry_per_pop = @bd_jm_manufacturing_n_t4
		job_artisan_per_pop = @bd_jm_manufacturing_n_t4
		job_trader_per_pop = @bd_jm_manufacturing_n_t4
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t4
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t4
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t4
	}

	# 格式塔帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_manufacturing_t1 = yes
		}
		job_fabricator_per_pop = @bd_jm_manufacturing_g1_t1
		job_logistics_drone_per_pop = @bd_jm_manufacturing_g2_t1
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t1
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t1
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t1
	}

	# 格式塔帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_manufacturing_t2 = yes
		}
		job_fabricator_per_pop = @bd_jm_manufacturing_g1_t2
		job_logistics_drone_per_pop = @bd_jm_manufacturing_g2_t2
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t2
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t2
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t2
	}

	# 格式塔帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_manufacturing_t3 = yes
		}
		job_fabricator_per_pop = @bd_jm_manufacturing_g1_t3
		job_logistics_drone_per_pop = @bd_jm_manufacturing_g2_t3
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t3
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t3
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t3
	}

	# 格式塔帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_manufacturing_t4 = yes
		}
		job_fabricator_per_pop = @bd_jm_manufacturing_g1_t4
		job_logistics_drone_per_pop = @bd_jm_manufacturing_g2_t4
		industrial_jobs_rare_crystals_produces_add = @bd_jm_manufacturing_rare_t4
		industrial_jobs_exotic_gases_produces_add = @bd_jm_manufacturing_rare_t4
		industrial_jobs_volatile_motes_produces_add = @bd_jm_manufacturing_rare_t4
	}

	ai_weight = {
		base = 100
	}
}

## 科研行政建筑：物理 / 社会 / 工程研究，附带官僚或协调子个体
bd_unlimited_job_matrix_research = {
	icon = building_sensorium_1
	base_buildtime = 60
	category = research
	building_sets = {
		government
		urban
	}
	can_build = yes
	planet_limit = 1

	potential = {
		has_planet_flag = pc_unlimited
	}

	# 常规帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_research_t1 = yes
		}
		job_physicist_per_pop = @bd_jm_research_n_t1
		job_biologist_per_pop = @bd_jm_research_n_t1
		job_engineer_per_pop = @bd_jm_research_n_t1
		job_bureaucrat_per_pop = @bd_jm_research_n_t1
	}

	# 常规帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_research_t2 = yes
		}
		job_physicist_per_pop = @bd_jm_research_n_t2
		job_biologist_per_pop = @bd_jm_research_n_t2
		job_engineer_per_pop = @bd_jm_research_n_t2
		job_bureaucrat_per_pop = @bd_jm_research_n_t2
	}

	# 常规帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_research_t3 = yes
		}
		job_physicist_per_pop = @bd_jm_research_n_t3
		job_biologist_per_pop = @bd_jm_research_n_t3
		job_engineer_per_pop = @bd_jm_research_n_t3
		job_bureaucrat_per_pop = @bd_jm_research_n_t3
	}

	# 常规帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_research_t4 = yes
		}
		job_physicist_per_pop = @bd_jm_research_n_t4
		job_biologist_per_pop = @bd_jm_research_n_t4
		job_engineer_per_pop = @bd_jm_research_n_t4
		job_bureaucrat_per_pop = @bd_jm_research_n_t4
	}

	# 格式塔帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_research_t1 = yes
		}
		job_calculator_physicist_per_pop = @bd_jm_research_g_t1
		job_calculator_biologist_per_pop = @bd_jm_research_g_t1
		job_calculator_engineer_per_pop = @bd_jm_research_g_t1
		job_coordinator_per_pop = @bd_jm_research_g_t1
	}

	# 格式塔帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_research_t2 = yes
		}
		job_calculator_physicist_per_pop = @bd_jm_research_g_t2
		job_calculator_biologist_per_pop = @bd_jm_research_g_t2
		job_calculator_engineer_per_pop = @bd_jm_research_g_t2
		job_coordinator_per_pop = @bd_jm_research_g_t2
	}

	# 格式塔帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_research_t3 = yes
		}
		job_calculator_physicist_per_pop = @bd_jm_research_g_t3
		job_calculator_biologist_per_pop = @bd_jm_research_g_t3
		job_calculator_engineer_per_pop = @bd_jm_research_g_t3
		job_coordinator_per_pop = @bd_jm_research_g_t3
	}

	# 格式塔帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_research_t4 = yes
		}
		job_calculator_physicist_per_pop = @bd_jm_research_g_t4
		job_calculator_biologist_per_pop = @bd_jm_research_g_t4
		job_calculator_engineer_per_pop = @bd_jm_research_g_t4
		job_coordinator_per_pop = @bd_jm_research_g_t4
	}

	ai_weight = {
		base = 100
	}
}

## 军事防务建筑：士兵 / 战斗子个体
bd_unlimited_job_matrix_military = {
	icon = building_citadel_uplink
	base_buildtime = 60
	category = army
	building_sets = {
		government
		urban
	}
	can_build = yes
	planet_limit = 1

	potential = {
		has_planet_flag = pc_unlimited
	}

	# 每个士兵 / 战斗子个体岗位额外产出合金，正好抵消其维护费。
	# 该修饰符按岗位计、与下面的岗位数量倍率无关，因此放在常驻 planet_modifier 中。
	planet_modifier = {
		planet_soldiers_alloys_produces_add = @bd_jm_military_alloys
	}

	# 常规帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_military_t1 = yes
		}
		job_soldier_per_pop = @bd_jm_military_n_t1
	}

	# 常规帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_military_t2 = yes
		}
		job_soldier_per_pop = @bd_jm_military_n_t2
	}

	# 常规帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_military_t3 = yes
		}
		job_soldier_per_pop = @bd_jm_military_n_t3
	}

	# 常规帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = no }
			bd_jm_military_t4 = yes
		}
		job_soldier_per_pop = @bd_jm_military_n_t4
	}

	# 格式塔帝国：只建本类，×3
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_military_t1 = yes
		}
		job_warrior_drone_per_pop = @bd_jm_military_g_t1
	}

	# 格式塔帝国：共 2 座，×1.5
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_military_t2 = yes
		}
		job_warrior_drone_per_pop = @bd_jm_military_g_t2
	}

	# 格式塔帝国：共 3 座，×1
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_military_t3 = yes
		}
		job_warrior_drone_per_pop = @bd_jm_military_g_t3
	}

	# 格式塔帝国：四类齐建，×0.75
	triggered_planet_modifier = {
		potential = {
			exists = owner
			owner = { is_gestalt = yes }
			bd_jm_military_t4 = yes
		}
		job_warrior_drone_per_pop = @bd_jm_military_g_t4
	}

	ai_weight = {
		base = 100
	}
}
