# standard costs
@maa_buy_cost = 150
@maa_low_maintenance_cost = 1.0
@maa_high_maintenance_cost = 5.0

light_footmen = {
	type = skirmishers
	
	damage = 10
	toughness = 16
	pursuit = 10
	screen = 16
	
	terrain_bonus = {
		forest = { damage = 4 toughness = 6 }
		flooded_forests = { damage = 2 toughness = 3 }
		taiga = { damage = 4 toughness = 6 }
		jungle = { damage = 4 toughness = 6 }
		deep_jungle = { damage = 2 toughness = 3 }
	}

	counters = {
		heavy_infantry = 1
	}

	buy_cost = { gold = skirmisher_recruitment_cost }
	low_maintenance_cost = { gold = skirmisher_low_maint_cost }
	high_maintenance_cost = { gold = skirmisher_high_maint_cost }
	
	holy_order_fallback = yes
	
	stack = 100
	ai_quality = { value = culture_ai_weight_skirmishers }
	icon = skirmishers
}

bowmen = {
	type = archers
	
	damage = 25
	toughness = 10
	pursuit = 0
	screen = 0
	
	terrain_bonus = {
		hills = { damage = 10 toughness = 4 }
		forest = { toughness = 4 screen = 4 }
		flooded_forests = { damage = 4 toughness = 6 }
		taiga = { toughness = 4 screen = 4 }
	}

	counters = {
		skirmishers = 1
	}

	buy_cost = { gold = bowmen_recruitment_cost }
	low_maintenance_cost = { gold = bowmen_low_maint_cost }
	high_maintenance_cost = { gold = bowmen_high_maint_cost }
	
	holy_order_fallback = yes
	
	stack = 100
	ai_quality = { 
		value = culture_ai_weight_archers
		value = counter_synergy_ai_weight_archers
	}
}

light_horsemen = {
	type = light_cavalry
	
	damage = 22
	toughness = 15
	pursuit = 30
	screen = 30
	
	terrain_bonus = {
		plains = { damage = 15 }
		drylands = { damage = 15 }
		salt_flats = { damage = 15 }
		hills = { damage = -5 }
		mountains = { damage = -10 pursuit = -20 }
		desert_mountains = { damage = -15 pursuit = -20 }
		wetlands = { damage = -15 toughness = -10 pursuit = -30 screen = -30 }
		flooded_forests = { damage = -15 toughness = -10 pursuit = -30 screen = -30 }
		tundra = { damage = -5 toughness = -5 screen = -5 }
		arctic = { damage = -15 toughness = -10 pursuit = -30 screen = -30 }
	}
	
	counters = {
		archers = 1
	}

	winter_bonus = {
		harsh_winter = { damage = -5 toughness = -2 }
	}

	buy_cost = { gold = light_cavalry_recruitment_cost }
	low_maintenance_cost = { gold = light_cavalry_low_maint_cost }
	high_maintenance_cost = { gold = light_cavalry_high_maint_cost }
	
	holy_order_fallback = yes
	
	stack = 100
	ai_quality = { 
		value = culture_ai_weight_light_cavalry
		value = counter_synergy_ai_weight_light_cavalry
	}
	icon = light_cavalry
}

pikemen_unit = {
	type = pikemen
	
	damage = 22
	toughness = 24
	pursuit = 0
	screen = 0
	
	terrain_bonus = {
		mountains = { toughness = 12 }
		desert_mountains = { toughness = 12 }
		hills = { toughness = 8 }
	}

	counters = {
		light_cavalry = 1
		heavy_cavalry = 1
	}

	buy_cost = { gold = pikemen_recruitment_cost }
	low_maintenance_cost = { gold = pikemen_low_maint_cost }
	high_maintenance_cost = { gold = pikemen_high_maint_cost }
	
	holy_order_fallback = yes
	
	stack = 100
	ai_quality = {
		value = culture_ai_weight_pikemen
		value = counter_synergy_ai_weight_pikemen
	}
	icon = pikemen
}



#Tribal Era
armored_footmen = {
	type = heavy_infantry
	
	damage = 32
	toughness = 22
	pursuit = 0
	screen = 0
	
	counters = {
		pikemen = 1
	}
	
	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 }
	
	holy_order_fallback = yes
	
	stack = 100
	ai_quality = {
		value = culture_ai_weight_heavy_infantry
		value = counter_synergy_ai_weight_heavy_infantry
	}
	icon = heavy_infantry
}

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 }
	
	stack = 10
	allowed_in_hired_troops = no
}

#Medieval Era
armored_horsemen = {
	type = heavy_cavalry
	
	damage = 100
	toughness = 35
	pursuit = 20
	screen = 0
	
	terrain_bonus = {
		plains = { damage = 30 }
		drylands = { damage = 30 }
		salt_flats = { damage = 15 }
		hills = { damage = -20 }
		mountains = { damage = -75 }
		desert_mountains = { damage = -75 }
		wetlands = { damage = -75 toughness = -10 pursuit = -10 }
		flooded_forests = { damage = -75 toughness = -10 pursuit = -10 }
		arctic = { damage = -10 toughness = -10 pursuit = -30 screen = -30 }
	}

	counters = {
		archers = 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 }
	
	stack = 50
	ai_quality = { value = culture_ai_weight_heavy_cavalry }
	icon = heavy_cavalry
}

mangonel = {
	type = siege_weapon
	fights_in_main_phase = no
	
	damage = 0
	toughness = 12
	
	siege_tier = 2
	siege_value = 0.3
	
	buy_cost = { gold = mangonel_recruitment_cost }
	low_maintenance_cost = { gold = mangonel_low_maint_cost }
	high_maintenance_cost = { gold = mangonel_high_maint_cost }
	
	stack = 10
	allowed_in_hired_troops = no
}

#High Medieval Era
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 }
		salt_flats = { damage = -8 }
	}

	counters = {
		heavy_infantry = 1
		heavy_cavalry = 1
	}

	buy_cost = { gold = crossbowmen_recruitment_cost }
	low_maintenance_cost = { gold = crossbowmen_low_maint_cost }
	high_maintenance_cost = { gold = crossbowmen_high_maint_cost }

	ai_quality = {
		value = counter_synergy_ai_weight_archers
	}
	
	holy_order_fallback = yes
	
	stack = 100
}

trebuchet = {
	type = siege_weapon
	fights_in_main_phase = no
	
	damage = 0
	toughness = 12
	
	siege_tier = 3
	siege_value = 0.4
	
	buy_cost = { gold = trebuchet_recruitment_cost }
	low_maintenance_cost = { gold = trebuchet_low_maint_cost }
	high_maintenance_cost = { gold = trebuchet_high_maint_cost }
	
	stack = 10
	allowed_in_hired_troops = no

}

#Late Medieval Era
bombard = {
	type = siege_weapon
	fights_in_main_phase = no
	
	damage = 0
	toughness = 12
	
	siege_tier = 4
	siege_value = 0.6
	
	buy_cost = { gold = bombard_recruitment_cost }
	low_maintenance_cost = { gold = bombard_low_maint_cost }
	high_maintenance_cost = { gold = bombard_high_maint_cost }
	
	stack = 10
	allowed_in_hired_troops = no
	
}

# Special
house_guard = {
	type = heavy_infantry
	can_recruit = {
		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 }
	
	max_sub_regiments = 5
	
	stack = 100
	ai_quality = { value = 100 }
}
