﻿# Regula MAA Regiments
@cultural_maa_extra_ai_score = 60 # Equivalent to having 6 extra regiments beyond what the code scoring would indicate (see NEGATIVE_SCORE_PER_EXISTING_REGIMENT)

# Must be synced between files with the values located at "# Provisions Costs #".
@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

# Basic Famuli MAA
# Sacerdos are weak physically, but counter all melee infantry and have good pursuit/screen stats
sacerdos = { # Holy Priestess Infantry (Used by Regula Holy Order)
	type = skirmishers
	icon = sacerdos

	can_recruit = {
		OR = {
			regula_maa_allowed_trigger = yes
			AND = {  # Holy Orders use the headquarters culture to determine tenets, base unit choice on religion instead
				primary_title = {
					is_holy_order = yes
				}
				is_regula_trigger = yes
			}
		}
	}

	damage = 5
	toughness = 5
	pursuit = 20
	screen = 20

	buy_cost = { gold = sacerdos_recruitment_cost }
	low_maintenance_cost = { gold = sacerdos_low_maint_cost }
	high_maintenance_cost = { gold = sacerdos_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate

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

	stack = 100
	ai_quality = { value = 100 }
}

infiltrator = { # Light Infantry with siege attack
	type = siege_weapon
	icon = infiltrator
	fights_in_main_phase = no
	allowed_in_hired_troops = no

	can_recruit = {
		regula_maa_allowed_trigger = yes
	}

	damage = 10
	toughness = 10

	siege_tier = 4
	siege_value = 0.2

	buy_cost = { gold = infiltrator_recruitment_cost }
	low_maintenance_cost = { gold = infiltrator_low_maint_cost }
	high_maintenance_cost = { gold = infiltrator_high_maint_cost }
	provision_cost = @provisions_cost_special_cheap

	stack = 25
}

# Special
virgo = { # Royal House Guard
	type = heavy_infantry
	icon = virgo

	can_recruit = {
		is_ai = no
		culture = {
			has_innovation = innovation_regula_virgo_training
		}
		regula_maa_magister_only_trigger = yes

		# At Exarch, we get the upgraded version
		has_trait_rank = {
			trait = magister_trait_group
			rank < 6
		}
	}

	damage = 48
	toughness = 38
	pursuit = 0
	screen = 24

	counters = {
		pikemen = 2
		archers = 2
		heavy_infantry = 1
	}

	buy_cost = { 
		piety = virgo_recruitment_cost_piety
	}
	low_maintenance_cost = { 
		piety = virgo_low_maint_cost_piety
	}
	high_maintenance_cost = { 
		piety = virgo_high_maint_cost_piety
	}
	provision_cost = @provisions_cost_special_expensive

	max_regiments = 1

	stack = 100
	ai_quality = { value = 350 } # High quality unit
}

# Regional
valkyrie = { # Northern Light Infantry
	type = skirmishers
	icon = valkyrie

	can_recruit = {
		regula_maa_allowed_trigger = yes
		culture = { has_innovation = innovation_regula_valkyries }
	}

	damage = 18
	toughness = 18
	pursuit = 15
	screen = 24

	terrain_bonus = {
		taiga = { damage = 10 toughness = 6 pursuit = 10 }
		mountains = { damage = 6 toughness = 4 pursuit = 6 }
		hills = { damage = 4 pursuit = 6 }
		farmlands = { damage = 4 pursuit = 6 }
		plains = { damage = 4 pursuit = 6 }
	}

	counters = {
		heavy_infantry = 1
		archers = 1
		light_cavalry = 1
	}

	winter_bonus = {
		normal_winter = { damage = 4 pursuit = 5 }
		harsh_winter = { damage = 4 pursuit = 5 }
	}

	buy_cost = { gold = valkyrie_recruitment_cost }
	low_maintenance_cost = { gold = valkyrie_low_maint_cost }
	high_maintenance_cost = { gold = valkyrie_high_maint_cost }
	provision_cost = @provisions_cost_infantry_cheap

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

gallowlasses = { # British Heavy Infantry
	type = heavy_infantry
	icon = gallowlasses

	can_recruit = {
		regula_maa_allowed_trigger = yes
		culture = { has_innovation = innovation_regula_gallowlasses }
	}

	damage = 50
	toughness = 25
	pursuit = 15
	screen = 0

	terrain_bonus = {
		hills = { damage = 4 pursuit = 6 }
		farmlands = { damage = 4 pursuit = 6 }
		plains = { damage = 4 pursuit = 6 }
	}

	counters = {
		heavy_infantry = 1
		archers = 1
		light_cavalry = 1
	}

	winter_bonus = {
		normal_winter = { damage = 4 pursuit = 5 }
	}

	buy_cost = { gold = gallowlasses_recruitment_cost }
	low_maintenance_cost = { gold = gallowlasses_low_maint_cost }
	high_maintenance_cost = { gold = gallowlasses_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate

	stack = 100
	ai_quality = { 
		value = @cultural_maa_extra_ai_score
		value = counter_synergy_ai_weight_heavy_infantry
	}
}

phylanx = { # Greek Amazon Pikemen
	type = pikemen
	icon = phylanx

	can_recruit = {
		regula_maa_allowed_trigger = yes
		culture = { has_innovation = innovation_regula_phylanx }
	}

	damage = 42
	toughness = 22
	pursuit = 0
	screen = 0

	terrain_bonus = {
		mountains = { toughness = 12 }
		desert_mountains = { toughness = 12 }
		hills = { toughness = 8 }
	}

	counters = {
		light_cavalry = 1
		heavy_cavalry = 1
		camel_cavalry = 1
		elephant_cavalry = 1
	}

	buy_cost = { gold = phylanx_recruitment_cost }
	low_maintenance_cost = { gold = phylanx_low_maint_cost }
	high_maintenance_cost = { gold = phylanx_high_maint_cost }
	provision_cost = @provisions_cost_infantry_expensive

	stack = 100
	ai_quality = {
		value = @cultural_maa_extra_ai_score
		value = counter_synergy_ai_weight_pikemen
	}
}

toxotai = { # Steppe Archer Cavalry
	type = archer_cavalry
	icon = toxotai

	damage = 54
	toughness = 16
	pursuit = 40
	screen = 30

	terrain_bonus = {
		steppe = { damage = 45 }
		plains = { damage = 20 }
		drylands = { damage = 20 }
		jungle = { damage = -20 pursuit = -20 }
		wetlands = { damage = -30 pursuit = -30 }
		mountains = { damage = -30 pursuit = -30 }
		desert_mountains = { damage = -30 pursuit = -30 }
	}

	counters = {
		skirmishers = 1
		heavy_infantry = 1
		heavy_cavalry = 1
	}

	can_recruit = {
		regula_maa_allowed_trigger = yes
		culture = { has_innovation = innovation_regula_toxotai }
	}

	buy_cost = { gold = toxotai_recruitment_cost }
	low_maintenance_cost = { gold = toxotai_low_maint_cost }
	high_maintenance_cost = { gold = toxotai_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_cheap

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

azraq = { # Arab Camel Riders
	type = camel_cavalry
	icon = azraq

	damage = 26
	toughness = 12
	pursuit = 20
	screen = 20

	terrain_bonus = {
		desert = { damage = 20 toughness = 8 }
		drylands = { damage = 15 toughness = 8 }
		oasis = { damage = 15 }
		floodplains = { damage = 5 }
		hills = { damage = -10 }
		desert_mountains = { damage = -10 pursuit = -10 }
		mountains = { damage = -15 pursuit = -20 }
		wetlands = { damage = -15 toughness = -10 pursuit = -20 screen = -20 }
	}

	counters = {
		light_cavalry = 1
	}

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

	can_recruit = {
		regula_maa_allowed_trigger = yes
		culture = { has_innovation = innovation_war_camels }
	}

	buy_cost = { gold = azraq_recruitment_cost }
	low_maintenance_cost = { gold = azraq_low_maint_cost }
	high_maintenance_cost = { gold = azraq_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_expensive

	stack = 100
	ai_quality = { value = culture_ai_weight_camels }
}

kunoichi = { # Japanese Ninjas
	type = archers
	icon = kunoichi
	allowed_in_hired_troops = no

	can_recruit = {
		regula_maa_allowed_trigger = yes

		# Temp, Easter egg unlock for now
		culture = { has_innovation = innovation_grenades }
	}

	damage = 30
	toughness = 20
	pursuit = 25
	screen = 0

	siege_tier = 4
	siege_value = 0.1

	terrain_bonus = {
		hills = { damage = 10 toughness = 4 }
		forest = { toughness = 4 screen = 4 }
		taiga = { toughness = 4 screen = 4 }
	}

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

	buy_cost = { gold = kunoichi_recruitment_cost }
	low_maintenance_cost = { gold = kunoichi_low_maint_cost }
	high_maintenance_cost = { gold = kunoichi_high_maint_cost }
	provision_cost = @provisions_cost_special_expensive

	stack = 50
}