﻿
### Duchy office districts ###

governance_district = {
	primary_building = governance_district_01
	
	#East Asia
	background = {
		trigger = {
			culture ?= { has_graphical_east_asia_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/tgp_courtyard_asia.dds"
	}

	#Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/councilchamber.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		scope:holder = { government_has_flag = government_is_celestial }
		can_have_duchy_capital_building_trigger = yes
	}

	can_construct_potential = {
		scope:holder = { government_has_flag = government_is_celestial }
	}

	show_disabled = yes

	buildings = {
		examination_hall_01
		celestial_great_barracks_01
		state_granary_01
		dragon_kiln_01
		mining_office_01
		exchequer_01
		minting_court_01
		prerogative_chancery_01
		reckoning_school_01
		feodarys_circuit_01
	}
}

assay_district = {
	primary_building = assay_district_01
	

	#Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/gdp_smithy_workshop.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
	}

	can_construct_potential = {
		scope:holder = {
			NOT = { government_has_flag = government_is_celestial }
		}
	}

	show_disabled = yes

	buildings = {
		mining_office_01
		exchequer_01
		minting_court_01
		prerogative_chancery_01
		reckoning_school_01
		feodarys_circuit_01
	}
}

bailiwick_district = {
	primary_building = bailiwick_01
	
	#Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/fp1_steward_study.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
	}

	show_disabled = yes

	buildings = {
		survey_office_01
		verderers_hall_01
		colonization_office_01
		ducal_chase_01
		courts_of_commons_01
	}
}

### Unique duchy specials ###

theodosian_walls_01_district = {
	primary_building = theodosian_walls_01
	
	#Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/ep3_constantinople.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	buildings = {
		staple_court_01
		court_of_the_towns_01
		alnagers_office_01
		admiralty_court_01
		grain_exchange_01
		town_liberties_court_01
		dragon_kiln_01
	}
}

aurelian_walls_01_district = {
	primary_building = aurelian_walls_01
	
	#Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/ep3_city_gate.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	buildings = {
		staple_court_01
		court_of_the_towns_01
		alnagers_office_01
		admiralty_court_01
		grain_exchange_01
		town_liberties_court_01
		dragon_kiln_01
	}
}

staple_district = {
	primary_building = staple_district_01
	
	#East Asia
	background = {
		trigger = {
			culture ?= { has_graphical_east_asia_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/tgp_market_asia.dds"
	}
	#India & MENA
	background = {
		trigger = {
			OR = {
				culture ?= { has_graphical_india_culture_group_trigger = yes }
				culture ?= { has_graphical_mena_culture_group_trigger = yes }
				culture ?= { has_graphical_iranian_culture_group_trigger = yes }
				culture ?= { has_graphical_african_culture_group_trigger = yes }
			}
		}
		reference = "gfx/interface/illustrations/event_scenes/market_east.dds"
	}
	#Mediterranean
	background = {
		trigger = {
			culture ?= { has_graphical_mediterranean_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/gdp_italian_market.dds"
	}
	#Steppe & Norse
	background = {
		trigger = {
			OR = {
				culture ?= { has_graphical_steppe_culture_group_trigger = yes }
				culture ?= { has_graphical_norse_culture_group_trigger = yes }
			}
		}
		reference = "gfx/interface/illustrations/event_scenes/market_tribal.dds"
	}
	#Western Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/market_west.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
	}

	show_disabled = yes

	buildings = {
		staple_court_01
		court_of_the_towns_01
		alnagers_office_01
		admiralty_court_01
		grain_exchange_01
		town_liberties_court_01
		dragon_kiln_01
	}
}

endowment_district = {
	primary_building = endowment_district_01
	
	#Islamic
	background = {
		trigger = {
			faith ?= { religion = religion:islam_religion }
		}
		reference = "gfx/interface/illustrations/event_scenes/ep2_holysite_mena.dds"
	}

	#Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/ep2_holysite_western.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
	}

	show_disabled = yes

	buildings = {
		consistory_01
		almonry_general_01
		pilgrimage_office_01
		burial_site_01
		charnel_grounds_01
		great_megalith_01
		tower_of_silence_01
	}
}

military_duchy_capital_district = {
	primary_building = military_duchy_building_01
	
	#East Asia
	background = {
		trigger = {
			culture ?= { has_graphical_east_asia_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/tgp_camp_asia.dds"
	}

	#MENA
	background = {
		trigger = {
			OR = {
				culture ?= { has_graphical_mena_culture_group_trigger = yes }
				culture ?= { has_graphical_iranian_culture_group_trigger = yes }
				culture ?= { has_graphical_african_culture_group_trigger = yes }
			}
		}
		reference = "gfx/interface/illustrations/event_scenes/ep3_camp_arid_terrain.dds"
	}

	#Steppe
	background = {
		trigger = {
			culture ?= { has_graphical_steppe_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/mpo_camp_steppe.dds"
	}

	#Western Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/genericcamp.dds"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
	}

	show_disabled = yes

	buildings = {
		military_academy_01
		march_01
		siege_works_01
		royal_armory_01
		jousting_lists_01
		blacksmiths_01
		archery_ranges_01
	}
}

ducal_residence_district = {
	primary_building = ducal_residence_01
	
	#East Asia
	background = {
		trigger = {
			culture ?= { has_graphical_east_asia_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/tgp_relaxing_room_asia.dds"
	}

	#MENA
	background = {
		trigger = {
			OR = {
				culture ?= { has_graphical_mena_culture_group_trigger = yes }
				culture ?= { has_graphical_iranian_culture_group_trigger = yes }
				culture ?= { has_graphical_african_culture_group_trigger = yes }
			}
		}
		reference = "gfx/interface/illustrations/event_scenes/bp1_relaxing_room_mena.dds"
	}

	#Iberian
	background = {
		trigger = {
			culture ?= { has_graphical_iberian_culture_group_trigger = yes }
		}
		reference = "gfx/interface/illustrations/event_scenes/fp2_relaxing_room.dds"
	}

	#Western Fallback
	background = {
		reference = "gfx/interface/illustrations/event_scenes/ep3_relaxing_room.dds"
	}

	triggered_name = {
		trigger = { county.holder ?= { highest_held_title_tier >= tier_kingdom } }
		reference = "royal_residence_district"
	}

	type = duchy_capital
	
	can_be_replaced = yes

	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
		scope:holder = { household_government_trigger = yes }
	}

	show_disabled = yes

	can_construct_potential = {
		scope:holder = { household_government_trigger = yes }
	}

	buildings = {
		leisure_palace_01
		royal_garden_01
		royal_forest_01
		burial_site_01
		ducal_chase_01
		reception_rooms_1
	}
}

# NEOW original definitions, updated for CK3 1.21

# Additional NEOW duchy-capital districts, based on the existing vanilla 1.21 office system.
water_filter_mills_district = {
	primary_building = water_filter_mills_01
	background = { reference = "gfx/interface/illustrations/event_scenes/gdp_smithy_workshop.dds" }
	type = duchy_capital
	can_be_replaced = yes
	is_enabled = { can_have_duchy_capital_building_trigger = yes }
	show_disabled = yes
}

edenic_garden_district = {
	primary_building = edenic_garden_01
	background = { reference = "gfx/interface/illustrations/event_scenes/ep3_holysite_orthodox.dds" }
	type = duchy_capital
	can_be_replaced = yes
	is_enabled = { can_have_duchy_capital_building_trigger = yes }
	can_construct_potential = {
		scope:holder = { rite = { rite_has_parameter = can_build_edenic_garden } }
	}
	show_disabled = yes
}


# Thelemic pyramids: unique duchy-capital building unlocked by the rite.
thelemic_pyramids_district = {
	primary_building = thelemic_pyramids_01
	background = { reference = "gfx/interface/illustrations/event_scenes/councilchamber.dds" }
	type = duchy_capital
	can_be_replaced = yes
	can_construct_potential = {
		scope:holder = { rite = { rite_has_parameter = can_build_pyramids } }
	}
	is_enabled = {
		can_have_duchy_capital_building_trigger = yes
		county.rite = { rite_has_parameter = can_build_pyramids }
	}
	show_disabled = yes
}
