﻿onager = {
	type = siege_weapon
	fights_in_main_phase = yes

	damage = 40
	toughness = 16
	pursuit = 5
	screen = 0

	terrain_bonus = {
		forest = { damage = -30 }              # leaves ~25% damage
		taiga  = { damage = -25 }
		jungle = { damage = -30 }

		hills = { damage = 5 }
		plains = { damage = 15 toughness = 2 }
		steppe = { damage = 15 toughness = 2 }
		drylands = { damage = 15 }
		desert = { damage = 15 }

		mountains = { damage = -10 }
		desert_mountains = { damage = -10 }
		wetlands = { toughness = -5 }
	}

	siege_tier = 1
	siege_value = 0.2

	can_recruit = {
		culture = { has_innovation = innovation_catapult }
		NOR = {
			government_has_flag = government_is_nomadic
			government_has_flag = government_is_herder
		}
	}
	should_show_when_unavailable = { government_allows = subject_men_at_arms }

	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

	stack = 10
	allowed_in_hired_troops = no
}

mangonel = {
	type = siege_weapon
	fights_in_main_phase = yes

	damage = 60
	toughness = 18
	pursuit = 5
	screen = 0

	terrain_bonus = {
		forest = { damage = -45 }              # leaves ~25% damage
		taiga  = { damage = -35 }
		jungle = { damage = -45 }

		hills = { damage = 10 }
		plains = { damage = 20 toughness = 2 }
		steppe = { damage = 20 toughness = 2 }
		drylands = { damage = 20 }
		desert = { damage = 20 }

		mountains = { damage = -20 }
		desert_mountains = { damage = -20 }
		wetlands = { toughness = -6 }
	}

	siege_tier = 2
	siege_value = 0.3

	can_recruit = {
		culture = { has_innovation = innovation_mangonel }
		NOR = {
			government_has_flag = government_is_nomadic
			government_has_flag = government_is_herder
		}
	}
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { has_cultural_era_or_later = culture_era_early_medieval }
	}

	buy_cost = { gold = mangonel_recruitment_cost }
	low_maintenance_cost = { gold = mangonel_low_maint_cost }
	high_maintenance_cost = { gold = mangonel_high_maint_cost }
	provision_cost = @provisions_cost_special_moderate

	stack = 10
	allowed_in_hired_troops = no
}

trebuchet = {
	type = siege_weapon
	fights_in_main_phase = yes

	damage = 95
	toughness = 22
	pursuit = 8
	screen = 0

	terrain_bonus = {
		# Practically unusable in dense woods
		forest = { damage = -95 toughness = -2 }
		taiga  = { damage = -95 toughness = -2 }
		jungle = { damage = -95 toughness = -2 }

		hills = { damage = 15 }
		plains = { damage = 30 toughness = 3 }
		steppe = { damage = 30 toughness = 3 }
		drylands = { damage = 30 }
		desert = { damage = 30 }

		mountains = { damage = -35 }
		desert_mountains = { damage = -35 }
		wetlands = { toughness = -8 }
	}

	siege_tier = 3
	siege_value = 0.4

	can_recruit = {
		culture = { has_innovation = innovation_trebuchet }
		NOR = {
			government_has_flag = government_is_nomadic
			government_has_flag = government_is_herder
		}
	}
	should_show_when_unavailable = {
		government_allows = subject_men_at_arms
		culture = { has_cultural_era_or_later = culture_era_high_medieval }
	}

	buy_cost = { gold = trebuchet_recruitment_cost }
	low_maintenance_cost = { gold = trebuchet_low_maint_cost }
	high_maintenance_cost = { gold = trebuchet_high_maint_cost }
	provision_cost = @provisions_cost_special_expensive

	stack = 10
	allowed_in_hired_troops = no
}

bombard = {
	type = siege_weapon
	fights_in_main_phase = yes

	damage = 150
	toughness = 24
	pursuit = 13
	screen = 0

	terrain_bonus = {
		# Heavy penalty in woods, but not zero — leaves ~25–30% output
		forest = { damage = -110 toughness = -2 }  # 150 - 110 = 40
		taiga  = { damage = -105 toughness = -2 }  # 150 - 105 = 45
		jungle = { damage = -110 toughness = -2 }

		hills = { damage = 20 }
		plains = { damage = 40 toughness = 4 }
		steppe = { damage = 40 toughness = 4 }
		drylands = { damage = 40 }
		desert = { damage = 40 }

		mountains = { damage = -50 }
		desert_mountains = { damage = -50 }
		wetlands = { toughness = -8 }
	}

	siege_tier = 4
	siege_value = 0.6

	can_recruit = {
		culture = {
			has_cultural_parameter = unlock_late_medieval_gunpowder_units
			NOR = {
				has_cultural_pillar = heritage_chinese
				has_cultural_pillar = heritage_korean
				has_cultural_pillar = heritage_japonic
			}
		}
		NOR = {
			government_has_flag = government_is_nomadic
			government_has_flag = government_is_herder
		}
	}

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

	buy_cost = { gold = bombard_recruitment_cost }
	low_maintenance_cost = { gold = bombard_low_maint_cost }
	high_maintenance_cost = { gold = bombard_high_maint_cost }
	provision_cost = @provisions_cost_special_bankrupting

	stack = 10
	allowed_in_hired_troops = no
}


# AUH


ballista = {
	type = siege_weapon
	fights_in_main_phase = yes

	damage = 35
	toughness = 12
	pursuit = 10
	screen = 0

	siege_tier = 1
	siege_value = 0.2

	can_recruit = {
		culture = {
			has_innovation = innovation_catapult
			OR = {
				has_cultural_pillar = heritage_chinese
				has_cultural_pillar = heritage_korean
				has_cultural_pillar = heritage_japonic
			}
		}
		NOR = {
			government_has_flag = government_is_nomadic
			government_has_flag = government_is_herder
		}
	}

	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
}


cannon = {
	type = siege_weapon
	fights_in_main_phase = yes

	damage = 150
	toughness = 24
	pursuit = 13
	screen = 0

	siege_tier = 4
	siege_value = 0.6

	can_recruit = {
		culture = {
			has_cultural_parameter = unlock_late_medieval_gunpowder_units
			OR = {
				has_cultural_pillar = heritage_chinese
				has_cultural_pillar = heritage_korean
				has_cultural_pillar = heritage_japonic
			}
		}
		NOR = {
			government_has_flag = government_is_nomadic
			government_has_flag = government_is_herder
		}
	}

	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
}