#handgonners = { # Vanilla added them to base lmao
#	type = archers
#	
#	damage = 50
#	toughness = 20
#	pursuit = 0
#	screen = 0
#	
#	
#	can_recruit = {
#		culture = { has_cultural_parameter = unlock_maa_handgonners }
#	}
#
#	terrain_bonus = {
#		hills = { damage = 10 }
#		plains = { toughness = -8 }
#		drylands = { toughness = -8 }
#		desert = { toughness = -8 }
#	}
#
#	counters = {
#		heavy_infantry = 1
#		heavy_cavalry = 1
#		archer_cavalry = 0.5
#	}
#
#	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
#
#	holy_order_fallback = yes
#
#	stack = 100
#	ai_quality = {
#		value = counter_synergy_ai_weight_archers
#	}
#	icon = handgonners
#}

redcoats = {
	type = gunpowder

	damage = 60
	toughness = 28
	pursuit = 0
	screen = 10

	can_recruit = {
		gunpowder_raise_limit_existing_gunpowder_units < gunpowder_raise_limit_existing_gunpowder_buildings	# one powder magazine must be owned to support three handgunner regiments, regardless of maa size
		culture = { has_cultural_parameter = unlock_late_medieval_gunpowder_units }
		valid_for_maa_trigger = { PARAMETER = unlock_maa_redcoats }
	}

	terrain_bonus = {
		wetlands = { damage = -10 }
		floodplains = { damage = -5 }
	}

	counters = {
		heavy_infantry = 1
		heavy_cavalry = 1
		pikemen = 1 
	}

	buy_cost = { gold = conrois_recruitment_cost }
	low_maintenance_cost = { gold = conrois_low_maint_cost }
	high_maintenance_cost = { gold = conrois_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate

	ai_quality = {
		value = counter_synergy_ai_weight_gunpowder
	}

	stack = 100

	icon = handgonne

}


ironsides = {
	type = heavy_cavalry
	
	damage = 110
	toughness = 50
	pursuit = 0
	screen = 10
	
	terrain_bonus = {
		plains = { damage = 30 toughness = 5 }
		drylands = { damage = 20 }
		hills = { damage = -10 }
		terraced_hills = { damage = -10 }
		mountains = { damage = -50 }
		desert_mountains = { damage = -50 }
		wetlands = { damage = -70 toughness = -15 pursuit = -10 }
		jungle = { damage = -80 toughness = -15 pursuit = -10 }
	}

	counters = {
		archers = 1
		heavy_infantry = 1
		heavy_cavalry = 1
	}

	winter_bonus = {
		normal_winter = { damage = -15 toughness = -5 }
		harsh_winter = { damage = -30 toughness = -10 }
	}
	
	can_recruit = {
		valid_for_maa_trigger = { PARAMETER = unlock_maa_ironsides }
	}

	buy_cost = { gold = tiefutu_recruitment_cost }
	low_maintenance_cost = { gold = tiefutu_low_maint_cost }
	high_maintenance_cost = { gold = tiefutu_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_bankrupting
	
	stack = 50
	ai_quality = { value = @cultural_maa_extra_ai_score }

	icon = tiefutu_cavalry
}


cuirassiers  = { #Copy pasted Conrois, need to think of how to make them unique later
	type = heavy_cavalry

	damage = 100
	toughness = 25
	pursuit = 10
	screen = 0

	terrain_bonus = {
		plains = { damage = 30 }
		drylands = { damage = 30 }
		farmlands = { damage = 30 }
		hills = { damage = -20 }
		mountains = { damage = -75 }
		desert_mountains = { damage = -75 }
		wetlands = { damage = -75 toughness = -10 pursuit = -10 }
		jungle = { damage = -75 toughness = -10 pursuit = -10 }
	}

	counters = {
		archers = 1
		light_cavalry = 1
	}

	can_recruit = {
		valid_for_maa_trigger = { PARAMETER = unlock_maa_cuirassiers }
	}

	winter_bonus = {
		normal_winter = { damage = -15 toughness = -5 }
		harsh_winter = { damage = -25 toughness = -10 }
	}

	buy_cost = { gold = conrois_recruitment_cost }
	low_maintenance_cost = { gold = conrois_low_maint_cost }
	high_maintenance_cost = { gold = conrois_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_cheap

	stack = 50
	ai_quality = { value = @[cultural_maa_extra_ai_score + 35 ] }
	icon = conrois
}

columneers = {
	type = archers
	can_recruit = {
		valid_for_maa_trigger = { PARAMETER = unlock_maa_columneers }
	}
	
	damage = 20
	toughness = 8
	pursuit = 0
	screen = 0
	
	terrain_bonus = {
		hills = { damage = 12 toughness = 4 }
	}

	counters = {
		skirmishers = 1
		heavy_infantry = 1
		peasant_militia = 1
		pikemen = 1
	}

	buy_cost = { gold = longbowmen_recruitment_cost }
	low_maintenance_cost = { gold = longbowmen_low_maint_cost }
	high_maintenance_cost = { gold = longbowmen_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate
	
	stack = 100
	ai_quality = { value = @cultural_maa_extra_ai_score }
	icon = bowmen
}

pioneers = {
	type = heavy_infantry

	damage = 40
	toughness = 32
	pursuit = 10
	screen = 10

	siege_value = 0.05

	terrain_bonus = {
		farmlands = { damage = 8 }
		plains = { damage = 8 toughness = 6 }
		forest = { damage = 8 toughness = 6 }
	}

	counters = {
		pikemen = 1
		peasant_militia = 2
		heavy_infantry = 1
		heavy_cavalry = 1
	}

	can_recruit = {
		valid_for_maa_trigger = { PARAMETER = unlock_maa_pioneers }
	}

	buy_cost = { gold = varangian_guards_recruitment_cost }
	low_maintenance_cost = { gold = varangian_guards_low_maint_cost }
	high_maintenance_cost = { gold = varangian_guards_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate

	stack = 100
	ai_quality = { value = @cultural_maa_extra_ai_score }
	icon = heavy_infantry
}


gardians = {
	type = light_cavalry
	
	damage = 20
	toughness = 20
	pursuit = 50
	screen = 30
	
	terrain_bonus = {
		forest = { damage = 15 }
		hills = { damage = 10 }
		mountains = { pursuit = -30 }
		desert_mountains = { damage = -15 pursuit = -30 }
		wetlands = { damage = -20 pursuit = -20 screen = -15 }
	}

	counters = {
		archers = 1
	}

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

	buy_cost = { gold = hobelar_recruitment_cost }
	low_maintenance_cost = { gold = hobelar_low_maint_cost }
	high_maintenance_cost = { gold = hobelar_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_cheap
	
	stack = 100
	ai_quality = { value = @cultural_maa_extra_ai_score }
	icon = light_cavalry
}

voltigeurs = {
	type = archers
	
	damage = 10
	toughness = 12
	pursuit = 15
	screen = 20
	siege_value = 0.1
	
	terrain_bonus = {
		hills = { damage = 4 toughness = 6 }
		mountains = { damage = 4 pursuit = 6 }
		forest = { damage = 4 toughness = 8 pursuit = 4 }
		wetlands = { damage = 4 pursuit = 6 }
	}

	counters = {
		heavy_infantry = 1
	}

	buy_cost = { gold = guanch_vaulter_recruitment_cost }
	low_maintenance_cost = { gold = guanch_vaulter_low_maint_cost }
	high_maintenance_cost = { gold = guanch_vaulter_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate
	
	
	stack = 100
	ai_quality = { value = culture_ai_weight_skirmishers }
	icon = crossbowmen
}

spahis = {
	type =  horse_archers
	
	damage = 22
	toughness = 15
	pursuit = 30
	screen = 30
	
	terrain_bonus = {
		drylands = { damage = 15 toughness = 3 }
		desert = { damage = 10 }
		oasis = { damage = 10 }
		desert_mountains = { pursuit = -10 }
		mountains = { pursuit = -20 }
		wetlands = { damage = -15 toughness = -10 pursuit = -30 screen = -30 }
	}

	counters = {
		skirmishers = 1
		heavy_infantry = 1
	}

	buy_cost = { gold = horse_archers_recruitment_cost }
	low_maintenance_cost = { gold = horse_archers_low_maint_cost }
	high_maintenance_cost = { gold = horse_archers_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_cheap
	
	stack = 100
	ai_quality = {
		value = @cultural_maa_extra_ai_score
		add = 60 #I mean... they're horse archers
	}
	icon = horse_archers
}