﻿# standard costs
@maa_buy_cost = 150
@maa_low_maintenance_cost = 1.0
@maa_high_maintenance_cost = 5.0
@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

emishi_horse_archers = {
	type = archer_cavalry

	damage = 28
	toughness = 12
	pursuit = 35
	screen = 30
	
	terrain_bonus = {
		forest = { damage = 12 pursuit = 12 }
		plains = { damage = 6 pursuit = 8 }
		hills = { damage = 6 pursuit = 8 }
		terraced_hills = { damage = 4 toughness = 6 }
		mountains = { damage = 4 pursuit = 6 }
	}

	counters = {
		heavy_infantry = 1
	}

	can_recruit = {
		culture ?= { has_cultural_parameter = unlock_emishi_horse_archers_units }
	}

	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 }
	provision_cost = @provisions_cost_cavalry_cheap
	
	stack = 100
	ai_quality = {
		value = @cultural_maa_extra_ai_score
		add = 100 #I mean... they're horse archers
	}
	icon = emishi_horse_archers
}

ballista = {
	type = siege_weapon
	fights_in_main_phase = no

	damage = 0
	toughness = 12

	siege_tier = 1
	siege_value = 0.2

	can_recruit = {
		culture ?= {
			has_innovation = innovation_catapult
			culture_uses_eastern_siege_weapons_trigger = yes
		}
		NOT = { government_has_flag = government_is_in_steppe }
	}

	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
	}

	buy_cost = { gold = ballista_recruitment_cost }
	low_maintenance_cost = { gold = ballista_low_maint_cost }
	high_maintenance_cost = { gold = ballista_high_maint_cost }
	provision_cost = @provisions_cost_special_cheap

	stack = 10
	allowed_in_hired_troops = no
	icon = ballista
}

cloud_ladder = {
	type = siege_weapon
	fights_in_main_phase = no

	damage = 0
	toughness = 12

	siege_tier = 2
	siege_value = 0.3

	can_recruit = {
		culture ?= {
			has_innovation = innovation_mangonel
			culture_uses_eastern_siege_weapons_trigger = yes
		}
		NOT = { government_has_flag = government_is_in_steppe }
	}

	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture ?= { has_cultural_era_or_later = culture_era_early_medieval }
	}

	buy_cost = { gold = cloud_ladder_recruitment_cost }
	low_maintenance_cost = { gold = cloud_ladder_low_maint_cost }
	high_maintenance_cost = { gold = cloud_ladder_high_maint_cost }
	provision_cost = @provisions_cost_special_moderate

	stack = 10
	allowed_in_hired_troops = no
	icon = cloud_ladder
}

siege_tower = {
	type = siege_weapon
	fights_in_main_phase = no

	damage = 0
	toughness = 12

	siege_tier = 3
	siege_value = 0.4

	can_recruit = {
		culture ?= {
			has_innovation = innovation_trebuchet
			culture_uses_eastern_siege_weapons_trigger = yes
		}
		NOT = { government_has_flag = government_is_in_steppe }
	}

	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture ?= { has_cultural_era_or_later = culture_era_high_medieval }
	}

	buy_cost = { gold = siege_tower_recruitment_cost }
	low_maintenance_cost = { gold = siege_tower_low_maint_cost }
	high_maintenance_cost = { gold = siege_tower_high_maint_cost }
	provision_cost = @provisions_cost_special_expensive

	stack = 10
	allowed_in_hired_troops = no
	icon = siege_tower
}

cannon = {
	type = siege_weapon
	fights_in_main_phase = no

	damage = 0
	toughness = 12

	siege_tier = 4
	siege_value = 0.6

	can_recruit = {
		culture ?= {
			has_cultural_parameter = unlock_late_medieval_gunpowder_units
			culture_uses_eastern_siege_weapons_trigger = yes
		}
		NOT = { government_has_flag = government_is_in_steppe }
	}

	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture ?= { has_cultural_era_or_later = culture_era_late_medieval }
	}

	buy_cost = { gold = cannon_recruitment_cost }
	low_maintenance_cost = { gold = cannon_low_maint_cost }
	high_maintenance_cost = { gold = cannon_high_maint_cost }
	provision_cost = @provisions_cost_special_bankrupting

	stack = 10
	allowed_in_hired_troops = no
	icon = cannon
}

tarkhan = {
	type = heavy_cavalry
	
	damage = 110
	toughness = 30
	pursuit = 30
	screen = 10
	
	terrain_bonus = {
		oasis = { damage = 30 }
		drylands = { damage = 25 }
		desert = { damage = 10 pursuit = 10 }
		mountains = { damage = -30 }
		wetlands = { damage = -80 toughness = -15 pursuit = -20 }
	}

	counters = {
		heavy_infantry = 1
		heavy_cavalry = 0.5
		gunpowder = 1
	}

	winter_bonus = {
		normal_winter = { damage = -10 toughness = -5 }
		harsh_winter = { damage = -20 toughness = -5 }
	}
	
	can_recruit = {
		OR = {
			AND = {
				has_government = landless_adventurer_government
				has_perk = planned_cultivation_perk
				location.culture ?= { has_cultural_parameter = unlock_maa_tarkhan }
			}
			culture ?= { has_cultural_parameter = unlock_maa_tarkhan }
		}
		NOT = {
			culture ?= { has_cultural_parameter = strength_in_numbers_heavy_maa_ban }
		}
	}

	buy_cost = { gold = cataphract_recruitment_cost }
	low_maintenance_cost = { gold = cataphract_low_maint_cost }
	high_maintenance_cost = { gold = cataphract_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_expensive
	
	stack = 50
	ai_quality = { value = @[cultural_maa_extra_ai_score + 60] }
	icon = tarkhan

}

zupin_warrior = {
	type = pikemen
	
	damage = 16
	toughness = 16
	pursuit = 0
	screen = 10
	
	can_recruit = {
		OR = {
			AND = {
				has_government = landless_adventurer_government
				has_perk = planned_cultivation_perk
				location.culture ?= { has_cultural_parameter = unlock_maa_zupin_warrior }
			}
			culture ?= { has_cultural_parameter = unlock_maa_zupin_warrior }
		}
	}
	
	terrain_bonus = {
		mountains = { toughness = 12 }
		desert_mountains = { toughness = 12 }
		hills = { damage = 4 toughness = 8 }
		forest = { damage = 4 toughness = 8 pursuit = 4 }
	}

	counters = {
		heavy_cavalry = 0.5
		heavy_infantry = 1
		light_cavalry = 1
	}

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

	buy_cost = { gold = bondi_recruitment_cost }
	low_maintenance_cost = { gold = bondi_low_maint_cost }
	high_maintenance_cost = { gold = bondi_high_maint_cost }
	provision_cost = @provisions_cost_infantry_moderate
	
	stack = 100
	ai_quality = { value = @[cultural_maa_extra_ai_score + 20] }
	icon = zupin_spearmen
}

tawashi = {
	type = light_cavalry
	
	damage = 25
	toughness = 15
	pursuit = 30
	screen = 30
	
	terrain_bonus = {
		plains = { damage = 10 }
		drylands = { damage = 10 }
		hills = { damage = 10 }
		mountains = { damage = 10 pursuit = 10 }
		desert_mountains = { damage = 10 pursuit = 10 }
		wetlands = { damage = -15 toughness = -10 pursuit = -30 screen = -30 }
	}

	counters = {
		archers = 1
		heavy_infantry = 1
		gunpowder = 1
	}

	can_recruit = {
		OR = {
			AND = {
				has_government = landless_adventurer_government
				has_perk = planned_cultivation_perk
				location.culture ?= { has_cultural_parameter = unlock_maa_tawashi }
			}
			culture ?= { has_cultural_parameter = unlock_maa_tawashi }
		}
	}

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

	buy_cost = { gold = tawashi_recruitment_cost }
	low_maintenance_cost = { gold = tawashi_low_maint_cost }
	high_maintenance_cost = { gold = tawashi_high_maint_cost }
	provision_cost = @provisions_cost_cavalry_moderate

	stack = 100
	ai_quality = { value = @[cultural_maa_extra_ai_score + 40] }
	icon = tawashi
}