﻿# Victory Prestige Experience Gain
historicinvasions_cb_prestige_experience_gain = 10
turkic_migration_war_prestige_experience_gain = 10

# Ally contribution prestige gain
historicinvasions_cb_ally_prestige = 100
turkic_migration_war_ally_prestige = 100

# Prestige gain
historicinvasions_cb_prestige_gain = 250
turkic_migration_war_prestige_gain = 250

# White peace prestige values
historicinvasions_cb_prestige_white_peace = -100
turkic_migration_war_prestige_white_peace = -100

war_enemy_total_strength_value = {
	value = 0
	#every_war_enemy = { add = max_military_strength } # incl. primary defender; doesn't consider enemies that join later
	add = { scope:defender = { value = current_military_strength } }
	add = {
		scope:defender = {
			every_ally = {
				limit = { NOT = { is_vassal_of = prev } }
				value = current_military_strength
			}
		}
	}
}

war_ally_total_strength_value = {
	value = 0
	add = { scope:attacker = { value = current_military_strength } } # invaders only declare war when 90% refreshed
	add = { scope:attacker = { every_war_ally = { value = current_military_strength } } } # doesn't count primary attacker; doesn't consider allies that join later
}

war_enemy_total_strength_difference_value = {
	value = 0
	add = war_enemy_total_strength_value
	subtract = war_ally_total_strength_value
	min = 0
}

invader_almost_full_military_strength_value = {
	value = 0
	add = max_military_strength
	multiply = 0.9
}

historicinvasions_spawn_army_multiplier_value = {
	# game rule adjustments
	if = {
		limit = { has_game_rule = historicinvasions_cb_levy_full }
		value = 1
	}
	else_if = {
		limit = { has_game_rule = historicinvasions_cb_levy_half }
		value = 0.5
	}
	else_if = {
		limit = { has_game_rule = historicinvasions_cb_levy_off }
		if = {
			limit = { scope:attacker = { is_landed = no } }
			value = 1
		}
		else = { value = 0 }
	}
	else_if = {
		limit = { has_game_rule = historicinvasions_cb_levy_triple }
		value = 3
	}
}