﻿japan_administrative_government = { # Ritsuryo
	government_rules = {
		create_cadet_branches = yes
		rulers_should_have_dynasty = yes
		dynasty_named_realms = no
		administrative = yes
		legitimacy = yes
		landless_playable = yes
		use_as_base_on_landed = yes
		use_as_base_on_rank_up = yes
		inherit_from_dynastic_government = no
		sticky_government = yes
		house_aspirations = yes
		noble_families = yes
		deny_powerful_vassal = yes
	}

	royal_court = any

	domicile_type = japanese_manor
	main_administrative_tier = county
	min_appointment_tier = county
	minimum_provincial_maa_tier = duchy

	primary_holding = castle_holding
	primary_heritages = { heritage_japonic }
	valid_holdings = { city_holding temple_citadel_holding }
	required_county_holdings = { castle_holding city_holding church_holding }

	vassal_contract_group = japan_administrative_vassal

	character_modifier = {
		# LEVIES & TAXES
		japan_feudal_government_tax_contribution_mult = -0.5
		japan_feudal_government_levy_contribution_mult = -0.5
		garrison_size = -0.5
		# MEN-AT-ARMS
		men_at_arms_cap = -2
		men_at_arms_limit = -2
		# KNIGHTS
		knight_limit = -5
		# VASSALS
		vassal_limit = 50 # Kampaku
		# DOMAIN
		domain_limit_max = 1 # Raised further by manor
		domain_tax_mult = 0.3
	}

	can_get_government = {
		has_tgp_dlc_trigger = yes
		top_liege = {
			OR = {
				government_is_japanese_trigger = yes
				has_character_flag = tgp_japan_restore_japanese_government_flag
				culture = culture:japanese
				culture = {
					any_parent_culture_or_above = { this = culture:japanese }
				}
			}
		}
	}

	# The Regent always remains in the same place.
	can_move_realm_capital = {
		NOT = { primary_title ?= title:e_japan }
	}

	compatible_government_type_succession = { japan_feudal_government }

	# Use flags instead of has_government for moddability if possible (i.e., wherever not visible to the player).
	flags = {
		government_is_japan_administrative
		# These flags only exist for loc and in-game descriptions
		government_has_influence
		government_has_title_men_at_arms
		government_has_powerful_families
		government_has_county_tier_noble_families
		has_special_house_aspirations
		government_is_settled
		government_uses_domicile_but_not_adventurer
		has_unique_government_perks
		government_uses_admin_province_obligations
		government_has_house_blocs
	}

	color = { 250 90 150 }
	realm_mask_offset = { 0.02 0.072 }
	realm_mask_scale = { 0.88 0.88 }
}

japan_feudal_government = { # Soryo
	government_rules = {
		create_cadet_branches = yes
		rulers_should_have_dynasty = yes
		dynasty_named_non_independent_landed_rulers = yes
		landless_playable = yes
		legitimacy = yes
		house_aspirations = yes
		use_as_base_on_landed = yes
		use_as_base_on_rank_up = yes
		noble_families = yes
	}

	royal_court = any

	character_modifier = {
		# LEVIES & TAXES
		japan_administrative_government_tax_contribution_mult = -0.5
		japan_administrative_government_levy_contribution_mult = -0.5
		garrison_size = -0.5
		# VASSALS
		vassal_limit = 50 # Shogun
		# KNIGHTS
		knight_effectiveness_mult = 0.1
		knight_limit = 2
		# DOMAIN
		domain_limit_max = 2 # Raised further by manor
		# SAMURAI
		archer_cavalry_recruitment_cost_mult = -0.25
		heavy_infantry_recruitment_cost_mult = -0.25
	}

	domicile_type = japanese_manor

	primary_holding = castle_holding
	primary_heritages = { heritage_japonic }
	valid_holdings = { temple_citadel_holding }
	required_county_holdings = { castle_holding city_holding church_holding }

	vassal_contract_group = japan_feudal_vassal

	can_get_government = {
		has_tgp_dlc_trigger = yes
	}

	# The Regent always remains in the same place.
	can_move_realm_capital = {
		NOT = { primary_title ?= title:e_japan }
	}

	compatible_government_type_succession = { japan_administrative_government }

	ai = {
		use_legends = yes
	}

	# Use flags instead of has_government for moddability if possible (i.e., wherever not visible to the player).
	flags = {
		may_elevate_co_monarch
		government_is_japan_feudal
		government_has_county_tier_noble_families
		has_special_house_aspirations
		government_is_settled
		government_uses_domicile_but_not_adventurer
		has_unique_government_perks
		government_has_house_blocs
	}

	color = { 68 100 250 }
	realm_mask_offset = { 0.0 0.075 }
	realm_mask_scale = { 0.95 0.95 }
}

