﻿@crown_authority_cooldown_years_3 = 1

tribal_raid_stance = {
	default = tribal_raid_stance_0
	cumulative = no
	flag = realm_law
	
	tribal_raid_stance_0 = {
		modifier = { 
			short_reign_duration_mult = -0.40
			tyranny_gain_mult = -0.15
			dread_gain_mult = 0.25
			monthly_county_control_growth_factor = 0.10
			county_opinion_add = -10

			stress_gain_mult = 0.05
			glory_hound_opinion = 5
			parochial_opinion = -5
		}

		can_keep = { 
			highest_held_title_tier	>= 2
			realm_law_use_tribal_raid_stance = yes
		}

		can_pass = {
			trigger_if = {
				limit = { 
					OR = {
						has_realm_law = tribal_raid_stance_1
						has_realm_law = tribal_raid_stance_2
						has_realm_law = tribal_raid_stance_3
					}
				}
				custom_tooltip = {
					subject = root
					text = "has_crown_authority_cooldown_3"
					NOT = {
						has_variable = crown_authority_cooldown_2
					}
				}
			}
		}

		pass_cost = { 
			prestige = {
				value = 0
				if = {
					limit = {
						is_ai = no
					}
					add = 50
				}
			} 
		}

		on_pass = {
			# Increment cooldown breaker tally, if appropriate.
			# calculate_authority_cooldown_break_effect = yes
			# Set regular cooldown.
			set_variable = {
				name = crown_authority_cooldown_3
				years = @crown_authority_cooldown_years_3
			}
		}

		ai_will_do = {
			if = {
				limit = {
					OR = {
						years_as_ruler <= 4
						dread <= 19
					}
				}
				value = 100
			}
		}
	}
	
	tribal_raid_stance_1 = {
		modifier = {
			monthly_piety_gain_mult = -0.1
			monthly_war_income_mult = 0.20
			character_capital_county_monthly_development_growth_add = 0.2
			cultural_head_fascination_mult = 0.10

			dread_loss_mult = -0.15
			stress_gain_mult = 0.10
			glory_hound_opinion = 10
			parochial_opinion = -10
			zealot_opinion = -5
			barons_and_minor_landholders_opinion = 5
		}

		can_keep = { 
			highest_held_title_tier	>= 2
			realm_law_use_tribal_raid_stance = yes
			dread >= 20
		}

		can_pass = {
			trigger_if = {
				limit = { 
					OR = {
						has_realm_law = tribal_raid_stance_0
						has_realm_law = tribal_raid_stance_2
						has_realm_law = tribal_raid_stance_3
					}
				}
				custom_tooltip = {
					subject = root
					text = "has_crown_authority_cooldown_3"
					NOT = {
						has_variable = crown_authority_cooldown_2
					}
				}
			}
		}
		
		pass_cost = { 
			prestige = {
				value = 0
				if = {
					limit = {
						is_ai = no
					}
					add = 100
				}
			} 
		}
		
		on_pass = {
			# Increment cooldown breaker tally, if appropriate.
			# calculate_authority_cooldown_break_effect = yes
			# Set regular cooldown.
			set_variable = {
				name = crown_authority_cooldown_3
				years = @crown_authority_cooldown_years_3
			}
		}

		ai_will_do = {
			if = {
				limit = {
					dread >= 21
					dread <= 39
					years_as_ruler >= 5
				}
				value = 100
			}
		}
	}
	
	tribal_raid_stance_2 = {
		modifier = {
			monthly_piety_gain_mult = -0.2
			monthly_prestige_gain_per_dread_mult = 0.004
			court_grandeur_baseline_add = 16
			accolade_glory_gain_mult = 0.25
			men_at_arms_recruitment_cost = -0.25
			independent_ruler_opinion = -10

			dread_loss_mult = -0.30
			stress_gain_mult = 0.15
			glory_hound_opinion = 15
			parochial_opinion = -15
			zealot_opinion = -10
			barons_and_minor_landholders_opinion = 10
			courtly_opinion = 5
			minority_opinion = -5
		}
		
		can_keep = { 
			highest_held_title_tier	>= 2
			realm_law_use_tribal_raid_stance = yes
			dread >= 40
		}
		
		can_pass = {
			trigger_if = {
				limit = { 
					OR = {
						has_realm_law = tribal_raid_stance_0
						has_realm_law = tribal_raid_stance_1
						has_realm_law = tribal_raid_stance_3
					}
				}
				custom_tooltip = {
					subject = root
					text = "has_crown_authority_cooldown_3"
					NOT = {
						has_variable = crown_authority_cooldown_2
					}
				}
			}
		}

		pass_cost = { 
			prestige = {
				value = 0
				if = {
					limit = {
						is_ai = no
					}
					add = 200
				}
			} 
		}
		
		on_pass = {
			# Increment cooldown breaker tally, if appropriate.
			# calculate_authority_cooldown_break_effect = yes
			# Set regular cooldown.
			set_variable = {
				name = crown_authority_cooldown_3
				years = @crown_authority_cooldown_years_3
			}
		}

		ai_will_do = {
			if = {
				limit = {
					dread >= 41
					dread <= 59
					years_as_ruler >= 5
				}
				value = 100
			}
		}
	}
	
	tribal_raid_stance_3 = {
		modifier = {
			monthly_piety_gain_mult = -0.3
			levy_attack = 4
			levy_toughness = 2
			levy_size = 0.25
			same_culture_mercenary_hire_cost_mult = -0.50
			independent_ruler_opinion = -20
			no_disembark_penalty = yes

			dread_loss_mult = -0.45
			stress_gain_mult = 0.20
			glory_hound_opinion = 20
			parochial_opinion = -20
			zealot_opinion = -15
			barons_and_minor_landholders_opinion = 15
			courtly_opinion = 10
			minority_opinion = -10

			ai_war_chance = 1
			ai_war_cooldown = -0.5
		}
		
		can_keep = { 
			highest_held_title_tier	>= 2
			realm_law_use_tribal_raid_stance = yes
			dread >= 60
		}
		
		can_pass = {
			trigger_if = {
				limit = { 
					OR = {
						has_realm_law = tribal_raid_stance_0
						has_realm_law = tribal_raid_stance_1
						has_realm_law = tribal_raid_stance_2
					}
				}
				custom_tooltip = {
					subject = root
					text = "has_crown_authority_cooldown_3"
					NOT = {
						has_variable = crown_authority_cooldown_2
					}
				}
			}
		}
		
		pass_cost = { 
			prestige = {
				value = 0
				if = {
					limit = {
						is_ai = no
					}
					add = 400
				}
			} 
		}
		
		on_pass = {
			# Increment cooldown breaker tally, if appropriate.
			# calculate_authority_cooldown_break_effect = yes
			# Set regular cooldown.
			set_variable = {
				name = crown_authority_cooldown_3
				years = @crown_authority_cooldown_years_3
			}
		}

		ai_will_do = {
			if = {
				limit = {
					dread >= 61
					years_as_ruler >= 5
				}
				value = 100
			}
		}
	}
}