#scmr_build_castle_tech	按科技建造城堡建筑
#scmr_build_temple_tech	按科技建造寺庙建筑
#scmr_build_city_tech	按科技建造城市建筑
#scmr_build_tb_tech		按科技建造部落建筑
#scmr_build_nd_tech		按科技建造游牧建筑
#scmr_build_fp_tech		按科技建造宫殿建筑
#scmr_build_hp_tech		按科技建造医院建筑
#scmr_build_fo_tech		按科技建造堡垒建筑
#scmr_build_tr_tech		按科技建造贸易站建筑


scmr_build_castle_tech = {
	#Holy Fury
	if = {
		limit = {
			holder_scope = {
				OR = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_blood_building 
					}
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_blood_building 
						}	
					}
				}
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		add_building = ca_oppressive_fortifications_1
		add_building = ca_oppressive_fortifications_2
		add_building = ca_oppressive_fortifications_3
		add_building = ca_oppressive_fortifications_4
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_armory }
		}
		add_building = ca_armory
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_bakehouse }
		}
		add_building = ca_bakehouse
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_barracks }
		}
		add_building = ca_barracks
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_curtain_walls }
		}
		add_building = ca_curtain_walls
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_dungeon }
		}
		add_building = ca_dungeon
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_escape_tunnel }
		}
		add_building = ca_escape_tunnel
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_flanking_towers }
		}
		add_building = ca_flanking_towers
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_forge }
		}
		add_building = ca_forge
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_great_chambers }
		}
		add_building = ca_great_chambers
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_judgement_hall }
		}
		add_building = ca_judgement_hall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_kitchens }
		}
		add_building = ca_kitchens
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_machicolations }
		}
		add_building = ca_machicolations
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_moat }
		}
		add_building = ca_moat
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_murder_holes }
		}
		add_building = ca_murder_holes
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_priest_house }
		}
		add_building = ca_priest_house
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_squire_hall }
		}
		add_building = ca_squire_hall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_stable }
		}
		add_building = ca_stable
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_stone_keep }
		}
		add_building = ca_stone_keep
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_storage }
		}
		add_building = ca_storage
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ca_training_fields }
		}
		add_building = ca_training_fields
	}
	refill_holding_levy = yes
}

scmr_build_city_tech = {
	if = {
		limit = {
			NOR = { 
				holder_scope = { religion_group = jewish_group } 
				location = { religion_group = jewish_group }
			}
		}
		add_building = ct_jewish_community_1
		add_building = ct_jewish_community_2
		add_building = ct_jewish_community_3
	}
	if = {
		limit = {
			holder_scope = {
				OR = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_architect 
					}
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_architect
						}	
					}
				}
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		add_building = ct_planned_infrastructure_1
		add_building = ct_planned_infrastructure_2
		add_building = ct_planned_infrastructure_3
		add_building = ct_planned_infrastructure_4
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_apothecary }
		}
		add_building = ct_apothecary
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_barber }
		}
		add_building = ct_barber
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_brewery }
		}
		add_building = ct_brewery
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_brothel }
		}
		add_building = ct_brothel
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_carpenter }
		}
		add_building = ct_carpenter
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_charcoal_maker }
		}
		add_building = ct_charcoal_maker
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_church }
		}
		add_building = ct_church
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_cobbler }
		}
		add_building = ct_cobbler
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_dockyard }
		}
		add_building = ct_dockyard
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_farmland }
		}
		add_building = ct_farmland
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_inn }
		}
		add_building = ct_inn
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_market_square }
		}
		add_building = ct_market_square
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_mason }
		}
		add_building = ct_mason
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_meadow }
		}
		add_building = ct_meadow
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_mill }
		}
		add_building = ct_mill
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_shipyard }
		}
		add_building = ct_shipyard
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_tavern }
		}
		add_building = ct_tavern
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_town_hall }
		}
		add_building = ct_town_hall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_university }
		}
		add_building = ct_university
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = ct_warehouse }
		}
		add_building = ct_warehouse
	}
	refill_holding_levy = yes
}

scmr_build_temple_tech = {
	if = {
		limit = {
			location = {
				OR = {
					has_province_modifier = tomb_of_a_saint
					has_province_modifier = pillaged_tomb_of_a_saint
				}
			}
		}
		add_building = tp_saint_shrine
	}
	if = {
		limit = {
			holder_scope = {
				OR = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_monumental 
					}
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental				
						}	
					}
				}
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		add_building = tp_monumental_shrines_1
		add_building = tp_monumental_shrines_2
		add_building = tp_monumental_shrines_3
		add_building = tp_monumental_shrines_4
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_almonry }
		}
		add_building = tp_almonry
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_bishop_house }
		}
		add_building = tp_bishop_house
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_dormitory }
		}
		add_building = tp_dormitory
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_drawbridge }
		}
		add_building = tp_drawbridge
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_dry_moat }
		}
		add_building = tp_dry_moat
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_fishing_village }
		}
		add_building = tp_fishing_village
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_guest_house }
		}
		add_building = tp_guest_house
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_holy_barracks }
		}
		add_building = tp_holy_barracks
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_infirmary }
		}
		add_building = tp_infirmary
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_lay_brothers }
		}
		add_building = tp_lay_brothers
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_library }
		}
		add_building = tp_library
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_militia_barracks }
		}
		add_building = tp_militia_barracks
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_monastery }
		}
		add_building = tp_monastery
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_penance_cells }
		}
		add_building = tp_penance_cells
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_sacred_paths }
		}
		add_building = tp_sacred_paths
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_school }
		}
		add_building = tp_school
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_stalls }
		}
		add_building = tp_stalls
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_stone_wall }
		}
		add_building = tp_stone_wall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_tillage }
		}
		add_building = tp_tillage
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tp_winery }
		}
		add_building = tp_winery
	}
	refill_holding_levy = yes
}

scmr_build_tb_tech = {
    if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_arena }
		}
		add_building = tb_arena
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_armorsmith }
		}
		add_building = tb_armorsmith
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_arsenal }
		}
		add_building = tb_arsenal
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_chief_hall }
		}
		add_building = tb_chief_hall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_cultivated_land }
		}
		add_building = tb_cultivated_land
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_fishing_huts }
		}
		add_building = tb_fishing_huts
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_fletcher }
		}
		add_building = tb_fletcher
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_great_hall }
		}
		add_building = tb_great_hall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_horse_barn }
		}
		add_building = tb_horse_barn
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_hunting_lodge }
		}
		add_building = tb_hunting_lodge
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_kennel }
		}
		add_building = tb_kennel
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_mead_hall }
		}
		add_building = tb_mead_hall
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_military_wharf }
		}
		add_building = tb_military_wharf
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_motte_bailey }
		}
		add_building = tb_motte_bailey
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_practice_range }
		}
		add_building = tb_practice_range
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_shrine }
		}
		add_building = tb_shrine
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_war_camp }
		}
		add_building = tb_war_camp
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_weaponsmith }
		}
		add_building = tb_weaponsmith
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_wooden_keep }
		}
		add_building = tb_wooden_keep
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = tb_wooden_portcullis }
		}
		add_building = tb_wooden_portcullis
	}
	refill_holding_levy = yes
}

scmr_build_nd_tech = {
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_airag_brewer }
		}
		add_building = no_airag_brewer
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_armor_crafter }
		}
		add_building = no_armor_crafter
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_camp_fortifications }
		}
		add_building = no_camp_fortifications
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_cattle_pens }
		}
		add_building = no_cattle_pens
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_gathering_yurt }
		}
		add_building = no_gathering_yurt
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_goat_pens }
		}
		add_building = no_goat_pens
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_horse_breeder }
		}
		add_building = no_horse_breeder
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_horse_pens }
		}
		add_building = no_horse_pens
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_khan_yurt }
		}
		add_building = no_khan_yurt
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_meat_preserver }
		}
		add_building = no_meat_preserver
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_music_crafter }
		}
		add_building = no_music_crafter
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_ox_wagons }
		}
		add_building = no_ox_wagons
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_ritual_post }
		}
		add_building = no_ritual_post
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_sheep_pens }
		}
		add_building = no_sheep_pens
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_storage_yurt }
		}
		add_building = no_storage_yurt
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_totem_crafter }
		}
		add_building = no_totem_crafter
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_weapon_crafter }
		}
		add_building = no_weapon_crafter
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_wrestling_pit }
		}
		add_building = no_wrestling_pit
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_yam }
		}
		add_building = no_yam
	}
	if = {
		limit = {
			can_build_more_buildings = yes
			NOT = { has_building = no_yurts }
		}
		add_building = no_yurts
	}
	refill_holding_levy = yes
}

scmr_build_fp_tech = {
	family_palace = {
		if = {
			limit = {
				NOT = { has_building = fp_administrative_office }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_administrative_office
		}
		if = {
			limit = {
				NOT = { has_building = fp_art_collection }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_art_collection
		}
		if = {
			limit = {
				NOT = { has_building = fp_chancellor }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_chancellor
		}
		if = {
			limit = {
				NOT = { has_building = fp_chaplain }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_chaplain
		}
		if = {
			limit = {
				NOT = { has_building = fp_crossbow_workshop }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_crossbow_workshop
		}
		if = {
			limit = {
				NOT = { has_building = fp_maze }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_maze
		}
		if = {
			limit = {
				NOT = { has_building = fp_mansion }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_mansion
		}
		if = {
			limit = {
				NOT = { has_building = fp_map_room }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_map_room
		}
		if = {
			limit = {
				NOT = { has_building = fp_marshal }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_marshal
		}
		if = {
			limit = {
				NOT = { has_building = fp_meditation_room }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_meditation_room
		}
		if = {
			limit = {
				NOT = { has_building = fp_mercenary_contractors }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_mercenary_contractors
		}
		if = {
			limit = {
				NOT = { has_building = fp_minter }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_minter
		}
		if = {
			limit = {
				NOT = { has_building = fp_poleaxe_workshop }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_poleaxe_workshop
		}
		if = {
			limit = {
				NOT = { has_building = fp_riding_grounds }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_riding_grounds
		}
		if = {
			limit = {
				NOT = { has_building = fp_royal_escorts }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_royal_escorts
		}
		if = {
			limit = {
				NOT = { has_building = fp_royal_guards }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_royal_guards
		}
		if = {
			limit = {
				NOT = { has_building = fp_spymaster }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_spymaster
		}
		if = {
			limit = {
				NOT = { has_building = fp_steward }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_steward
		}
		if = {
			limit = {
				NOT = { has_building = fp_vault }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_vault
		}
		if = {
			limit = {
				NOT = { has_building = fp_cellar }
				scmr_family_palace_can_build_more_buildings = yes
			}
			add_building = fp_cellar
		}
	}	
}

scmr_build_hp_tech = {
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_abomination_stand } 
		} 
		add_to_extra_holding = { type = hospital building = ho_abomination_stand }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_alchemist_hut } 
		} 
		add_to_extra_holding = { type = hospital building = ho_alchemist_hut }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_archive_room } 
		} 
		add_to_extra_holding = { type = hospital building = ho_archive_room }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_autopsy_room } 
		} 
		add_to_extra_holding = { type = hospital building = ho_autopsy_room }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_chapel } 
		} 
		add_to_extra_holding = { type = hospital building = ho_chapel }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_games_room } 
		} 
		add_to_extra_holding = { type = hospital building = ho_games_room }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_garden } 
		} 
		add_to_extra_holding = { type = hospital building = ho_garden }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_healer_quarters } 
		} 
		add_to_extra_holding = { type = hospital building = ho_healer_quarters }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_isolation_cells } 
		} 
		add_to_extra_holding = { type = hospital building = ho_isolation_cells }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_leper_colony } 
		} 
		add_to_extra_holding = { type = hospital building = ho_leper_colony }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_medical_academy } 
		} 
		add_to_extra_holding = { type = hospital building = ho_medical_academy }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_observatory } 
		} 
		add_to_extra_holding = { type = hospital building = ho_observatory }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_pilgrim_inn } 
		} 
		add_to_extra_holding = { type = hospital building = ho_pilgrim_inn }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_refugee_docks } 
		} 
		add_to_extra_holding = { type = hospital building = ho_refugee_docks }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_sick_house } 
		} 
		add_to_extra_holding = { type = hospital building = ho_sick_house }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_soup_kitchen } 
		} 
		add_to_extra_holding = { type = hospital building = ho_soup_kitchen }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_surgery_room } 
		} 
		add_to_extra_holding = { type = hospital building = ho_surgery_room }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_tailor_room } 
		} 
		add_to_extra_holding = { type = hospital building = ho_tailor_room }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_translation_house } 
		} 
		add_to_extra_holding = { type = hospital building = ho_translation_house }
	}
	if = {
		limit = {  
			hospital_can_build_more_buildings = yes
			NOT = { hospital_has_building = ho_well } 
		} 
		add_to_extra_holding = { type = hospital building = ho_well }
	}
}

scmr_build_fo_tech = {
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_arrow_maker } 
		} 
		add_to_extra_holding = { type = fort building = fo_arrow_maker }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_brimstones } 
		} 
		add_to_extra_holding = { type = fort building = fo_brimstones }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_caltrops } 
		} 
		add_to_extra_holding = { type = fort building = fo_caltrops }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_command_tent } 
		} 
		add_to_extra_holding = { type = fort building = fo_command_tent }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_common_tents } 
		} 
		add_to_extra_holding = { type = fort building = fo_common_tents }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_forager_huts } 
		} 
		add_to_extra_holding = { type = fort building = fo_forager_huts }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_hitching_post } 
		} 
		add_to_extra_holding = { type = fort building = fo_hitching_post }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_oil_pits } 
		} 
		add_to_extra_holding = { type = fort building = fo_oil_pits }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_outer_palisade } 
		} 
		add_to_extra_holding = { type = fort building = fo_outer_palisade }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_quartermaster } 
		} 
		add_to_extra_holding = { type = fort building = fo_quartermaster }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_ramparts } 
		} 
		add_to_extra_holding = { type = fort building = fo_ramparts }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_reinforced_walls } 
		} 
		add_to_extra_holding = { type = fort building = fo_reinforced_walls }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_senior_tents } 
		} 
		add_to_extra_holding = { type = fort building = fo_senior_tents }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_spear_bracing_spots } 
		} 
		add_to_extra_holding = { type = fort building = fo_spear_bracing_spots }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_spike_traps } 
		} 
		add_to_extra_holding = { type = fort building = fo_spike_traps }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_stakes } 
		} 
		add_to_extra_holding = { type = fort building = fo_stakes }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_supply_tent } 
		} 
		add_to_extra_holding = { type = fort building = fo_supply_tent }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_training_dummies } 
		} 
		add_to_extra_holding = { type = fort building = fo_training_dummies }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_watchtower } 
		} 
		add_to_extra_holding = { type = fort building = fo_watchtower }
	}
	if = {
		limit = {  
			fort_can_build_more_buildings = yes
			NOT = { fort_has_building = fo_wooden_barbican } 
		} 
		add_to_extra_holding = { type = fort building = fo_wooden_barbican }
	}
}

scmr_build_tr_tech = {
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_bank } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_bank }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_camp } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_camp }
	}
	if = {
		limit = {  
			trade_post_can_build_more_buildings = yes
			NOT = { trade_post_has_building = tr_custom_house } 
		} 
		add_to_extra_holding = { type = trade_post building = tr_custom_house }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_depot } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_depot }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_farm } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_farm }
	}
	if = {
		limit = {  
			trade_post_can_build_more_buildings = yes
			NOT = { trade_post_has_building = tr_fishery } 
		} 
		add_to_extra_holding = { type = trade_post building = tr_fishery }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_guild_enclave } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_guild_enclave }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_guild_garrison } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_guild_garrison }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_lumber_mill } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_lumber_mill }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_mercenary_garrison } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_mercenary_garrison }
	}
	if = {
		limit = {  
			trade_post_can_build_more_buildings = yes
			NOT = { trade_post_has_building = tr_mine } 
		} 
		add_to_extra_holding = { type = trade_post building = tr_mine }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_pasture } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_pasture }
	}
	if = {
		limit = {  
			trade_post_can_build_more_buildings = yes
			NOT = { trade_post_has_building = tr_paved_roads } 
		} 
		add_to_extra_holding = { type = trade_post building = tr_paved_roads }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_plantation } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_plantation }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_quarry } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_quarry }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_realm_garrison } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_realm_garrison }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_smuggler_cove } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_smuggler_cove }
	}
	if = {
		limit = {  
			trade_post_can_build_more_buildings = yes
			NOT = { trade_post_has_building = tr_toll_booth } 
		} 
		add_to_extra_holding = { type = trade_post building = tr_toll_booth }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_trade_office } 
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_trade_office }
	}
	if = {
		limit = {  
			NOT = { trade_post_has_building = tr_trade_port }
			trade_post_can_build_more_buildings = yes
		} 
		add_to_extra_holding = { type = trade_post building = tr_trade_port }
	}
}