﻿@maa_buy_cost = 150
@low_maintenance_cost = 1.0
@high_maintenance_cost = 5.0
@cultural_maa_extra_ai_score = 80 # Equivalent to having 8 extra regiments beyond what the code scoring would indicate (see NEGATIVE_SCORE_PER_EXISTING_REGIMENT)

@provisions_cost_infantry_cheap = 3
@provisions_cost_infantry_moderate = 7
@provisions_cost_infantry_expensive = 12
@provisions_cost_infantry_bankrupting = 15

@provisions_cost_cavalry_cheap = 7
@provisions_cost_cavalry_moderate = 15
@provisions_cost_cavalry_expensive = 21
@provisions_cost_cavalry_bankrupting = 30

@provisions_cost_special_cheap = 6
@provisions_cost_special_moderate = 12
@provisions_cost_special_expensive = 18
@provisions_cost_special_bankrupting = 24


dunmer_light_footmen = {   
	type = skirmishers
	
	damage = 10
	toughness = 16
	pursuit = 10
	screen = 16
	
	terrain_bonus = {
		forest = { damage = 4 toughness = 6 }
		taiga = { damage = 4 toughness = 6 }
		jungle = { damage = 4 toughness = 6 }
	}

	counters = {
		heavy_infantry = 1
	}		

	can_recruit = {
		culture = {
			OR = {
				this = culture:chuzei
				this = culture:marduhn_oad
				this = culture:gah_julan
				this = culture:chi_addun
				this = culture:armun_an
				any_parent_culture_or_above = {
				this = culture:chuzei
				this = culture:marduhn_oad
				this = culture:gah_julan
				this = culture:chi_addun
				this = culture:armun_an		
				}
			}	
		}	
	}	
	
	buy_cost = { gold = skirmisher_recruitment_cost }
	low_maintenance_cost = { gold = skirmisher_low_maint_cost }
	high_maintenance_cost = { gold = skirmisher_high_maint_cost }
	provision_cost = @provisions_cost_infantry_cheap

	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { has_cultural_pillar = heritage_dunmeri }
	}
	
	stack = 100
	ai_quality = { value = culture_ai_weight_skirmishers }
	icon = dunmer_skirmishers
}


dunmer_bowmen = {  
	type = archers
	
	damage = 25
	toughness = 10
	pursuit = 0
	screen = 0
	
	terrain_bonus = {
		hills = { damage = 10 toughness = 4 }
		forest = { toughness = 4 screen = 4 }
		taiga = { toughness = 4 screen = 4 }
	}
	
	counters = {
		skirmishers = 1
		mages = 1
	}
	
	can_recruit = {
		culture = {
			OR = {
				this = culture:chuzei
				this = culture:marduhn_oad
				this = culture:gah_julan
				this = culture:chi_addun
				###this = culture:armun_an
				any_parent_culture_or_above = {
				this = culture:chuzei
				this = culture:marduhn_oad
				this = culture:gah_julan
				this = culture:chi_addun
				###this = culture:armun_an		
				}
			}	
		}	
	}	
	
	buy_cost = { gold = bowmen_recruitment_cost }
	low_maintenance_cost = { gold = bowmen_low_maint_cost }
	high_maintenance_cost = { gold = bowmen_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate
	
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { has_cultural_pillar = heritage_dunmeri }
	}

	stack = 100
	ai_quality = { 
		value = culture_ai_weight_archers
		value = counter_synergy_ai_weight_archers
	}
	
	icon = dunmer_bowmen
}


dunmer_pikemen_unit = { 
	type = pikemen
	
	damage = 22
	toughness = 24
	pursuit = 0
	screen = 0
	
	terrain_bonus = {
		mountains = { toughness = 12 }
		desert_mountains = { toughness = 12 }
		hills = { toughness = 8 }
		#EK ADDITIONS
		valenwood = { damage = -10}
		black_marsh = { toughness = -10 }
	}

	counters = {
		light_cavalry = 1
		heavy_cavalry = 1
		camel_cavalry = 1
		elephant_cavalry = 1
	}
	
	can_recruit = {
		culture = {
			OR = {
				this = culture:chuzei
				this = culture:marduhn_oad
				###this = culture:gah_julan
				this = culture:chi_addun
				this = culture:armun_an
				any_parent_culture_or_above = {
				this = culture:chuzei
				this = culture:marduhn_oad
				###this = culture:gah_julan
				this = culture:chi_addun
				this = culture:armun_an		
				}
			}	
		}	
	}	
	
	buy_cost = { gold = pikemen_recruitment_cost }
	low_maintenance_cost = { gold = pikemen_low_maint_cost }
	high_maintenance_cost = { gold = pikemen_high_maint_cost }
	provision_cost = @provisions_cost_infantry_expensive
	
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { has_cultural_pillar = heritage_dunmeri }
	}
	
	stack = 100
	ai_quality = {
		value = culture_ai_weight_pikemen
		value = counter_synergy_ai_weight_pikemen
	}
	icon = dunmer_pikemen
}


dunmer_armored_footmen = {
	type = heavy_infantry
	
	damage = 32
	toughness = 22
	pursuit = 0
	screen = 0
	
	# EK ADDITION
	terrain_bonus = {
		valenwood = { damage = -10 toughness = -10}
		drylands = { toughness = -5 }
		desert = { damage = -10 toughness = -15 }
		desert_mountains = { damage = -10 toughness = -15}
		black_marsh = { damage = -10 toughness = -15 }
	}
	
	counters = {
		pikemen = 1
		spellblades = 1 # EK ADDITION
	}
	
	buy_cost = { gold = heavy_infantry_recruitment_cost }
	low_maintenance_cost = { gold = heavy_infantry_low_maint_cost }
	high_maintenance_cost = { gold = heavy_infantry_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate 
	
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { 
			OR = {
				has_innovation = innovation_quilted_armor_dun
				has_innovation = innovation_hardened_chitin			
			}	
		}
	}
	
	stack = 100
	ai_quality = {
		value = culture_ai_weight_heavy_infantry
		value = counter_synergy_ai_weight_heavy_infantry
	}
	icon = dunmer_heavy_infantry
}

dunmer_onager = {
	type = siege_weapon
	fights_in_main_phase = no
	
	damage = 0
	toughness = 12
	
	siege_tier = 1
	siege_value = 0.2

	buy_cost = { gold = onager_recruitment_cost }
	low_maintenance_cost = { gold = onager_low_maint_cost }
	high_maintenance_cost = { gold = onager_high_maint_cost }
	provision_cost = @provisions_cost_special_cheap 
	
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { 
			has_innovation = innovation_catapult_dun
		}
	}
	
	stack = 10
	allowed_in_hired_troops = no
	icon = dunmer_onager
}


dunmer_armored_horsemen = {
	type = heavy_cavalry
	
	damage = 100
	toughness = 35
	pursuit = 20
	screen = 0
	
	terrain_bonus = {
		plains = { damage = 30 }
		drylands = { damage = 30 }
		hills = { damage = -20 }
		mountains = { damage = -75 }
		desert_mountains = { damage = -75 }
		wetlands = { damage = -75 toughness = -10 pursuit = -10 }
		#EK ADDITIONS
		forest = { damage = -20 toughness = -5 pursuit = -5 }
		taiga = { damage = -20 toughness = -5 pursuit = -5 }
		jungle = { damage = -20 toughness = -10 pursuit = -10 }
		valenwood = { damage = -75 toughness = -10 pursuit = -10 }
		desert = { toughness = -10 }
		black_marsh = { damage = -75 toughness = -10 pursuit = -10 }
	}

	counters = {
		archers = 1
		spellblades = 1
	}

	winter_bonus = {
		normal_winter = { damage = -10 toughness = -5 }
		harsh_winter = { damage = -20 toughness = -10 }
	}

	buy_cost = { gold = heavy_cavalry_recruitment_cost }
	low_maintenance_cost = { gold = heavy_cavalry_low_maint_cost }
	high_maintenance_cost = { gold = heavy_cavalry_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_expensive
	
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { 
			has_cultural_pillar = heritage_dunmeri 
			has_cultural_era_or_later = culture_era_early_medieval 	
		}
	}	
	
	stack = 50
	ai_quality = { value = culture_ai_weight_heavy_cavalry }
	icon = dunmer_heavy_cavalry
}

dunmer_crossbowmen = {
	type = archers
	
	damage = 42
	toughness = 18
	pursuit = 0
	screen = 0
	
	terrain_bonus = {
		hills = { damage = 10 }
		plains = { toughness = -8 }
		drylands = { toughness = -8 }
		desert = { toughness = -8 }
		#EK ADDITIONS
		valenwood = { damage = -4 toughness = -4}
		black_marsh = { damage -4 toughness = -4}
	}

	counters = {
		heavy_infantry = 1
		heavy_cavalry = 1
		archer_cavalry = 0.5
		mages = 1 #EK EDIT
	}

	buy_cost = { gold = crossbowmen_recruitment_cost }
	low_maintenance_cost = { gold = crossbowmen_low_maint_cost }
	high_maintenance_cost = { gold = crossbowmen_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate
	
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { 
			has_cultural_pillar = heritage_dunmeri 
			has_cultural_era_or_later = culture_era_high_medieval 	
		}
	}
	
	ai_quality = {
		value = counter_synergy_ai_weight_archers
	}

	stack = 100
	icon = dunmer_crossbowmen
}


dunmer_house_guard = {
	type = heavy_infantry

	can_recruit = {
		culture = {
			OR = {
				this = culture:chuzei
				this = culture:marduhn_oad
				this = culture:gah_julan
				this = culture:chi_addun
				this = culture:armun_an
				any_parent_culture_or_above = {
				this = culture:chuzei
				this = culture:marduhn_oad
				this = culture:gah_julan
				this = culture:chi_addun
				this = culture:armun_an		
				}
			}
		}			
		exists = dynasty
		dynasty = {
			has_dynasty_perk = warfare_legacy_5
		}
	}			
	
	damage = 40
	toughness = 32
	pursuit = 0
	screen = 24
	
	counters = {
		pikemen = 2
		archers = 2
	}

	buy_cost = { gold = 50 }
	low_maintenance_cost = { gold = 0 }
	high_maintenance_cost = { gold = 1 }
	provision_cost = @provisions_cost_infantry_expensive
	
	max_sub_regiments = 1
	
	stack = 100
	ai_quality = { value = 100 }
	icon = dunmer_house_guard
}


dunmer_spellswords = { 
	type = spellblades
	
	damage = 25
	toughness = 22
	pursuit = 10
	screen = 10
	
	counters = {
		mages = 1
		archers = 1
		skirmishers = 1
	}

	buy_cost = { gold = spellblades_recruitment_cost }
	low_maintenance_cost = { gold = spellblades_low_maint_cost }
	high_maintenance_cost = { gold = spellblades_high_maint_cost }
	provision_cost = @provisions_cost_special_moderate
	
	stack = 50
	ai_quality = { value = culture_ai_weight_spellblades }
	icon = dunmer_spellswords
}

dunmer_war_mages = {
	type = mages
	
	damage = 35
	toughness = 10
	pursuit = 5
	screen = 20
	
	siege_tier = 1
	siege_value = 0.1
	
	counters = {
		heavy_infantry = 1
		pikemen = 1
	}

	buy_cost = { gold = mages_recruitment_cost }
	low_maintenance_cost = { gold = mages_low_maint_cost }
	high_maintenance_cost = { gold = mages_high_maint_cost }
	provision_cost = @provisions_cost_special_moderate
	
	stack = 50
	ai_quality = { value = culture_ai_weight_mages }
	icon = dunmer_mages
}

