﻿namespace = ep2_decision_events

#Tournament Training
ep2_decision_events.0001 = { #by Veronica Pazos
	type = character_event
	title = ep2_decision_events.0001.t
	desc = ep2_decision_events.0001.desc
	theme = martial
	override_background = { reference = courtyard }
	left_portrait = {
		character = scope:training_ruler
		animation = aggressive_sword
	}
	right_portrait = {
		character = scope:marshal
		animation = war_attacker
	}

	immediate = {
		play_music_cue = "mx_cue_positive_effect"
		scope:training_ruler = {
			add_character_flag = wear_armor
		}
		scope:marshal = {
			add_character_flag = wear_armor
		}
	}

	option = { #get prowess
		name = ep2_decision_events.0001.a
		scope:marshal = {
			duel = {
				skill = prowess
				value = decent_skill_rating
				10 = { #Get trait
					desc = ep2_decision_events.0001.a.crit_success
					trigger = {
						root.prowess >= 16
					}
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = ep2_decision_events.0001.a.crit_success
							left_icon = root
							add_trait = strong
							add_prowess_skill = 1
						}
					}
				}
				40 = { #Prowess
					desc = ep2_decision_events.0001.a.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
					}
					root = {
						send_interface_toast = {
							title = ep2_decision_events.0001.a.success
							left_icon = root
							add_prowess_skill = 1
						}
					}
				}
				50 = { #regular PtV modifier
					desc = ep2_decision_events.0001.a.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = ep2_decision_events.0001.a.failure
							left_icon = root
							add_character_modifier = { #we add a modifier so you can see it on your character
								modifier = tournament_training_decision_modifier
								years = 10
							}
						}
					}
				}
				25 = { #wounded
					desc = ep2_decision_events.0001.a.crit_failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
					}
					root = {
						send_interface_toast = {
							title = ep2_decision_events.0001.a.crit_failure
							left_icon = root
							increase_wounds_effect = { REASON = accident }
						}
					}
				}
			}
		}
		every_knight = {
			custom = custom.every_knight
			scope:marshal = {
				duel = {
					skill = prowess
					value = decent_skill_rating
					25 = { #Prowess
						desc = ep2_decision_events.0001.a.failure
						compare_modifier = {
							value = scope:duel_value
							multiplier = 3.5
						}
						prev = { add_prowess_skill = 1 }
					}
					75 = { #regular PtV modifier
						desc = ep2_decision_events.0001.a.knight_fail
						compare_modifier = {
							value = scope:duel_value
							multiplier = -3.5
						}
					}
				}
			}
		}
	}
	
	option = { #get sparring tradition
		name = ep2_decision_events.0001.b
		trigger = {
			NOT = {
				culture = { has_cultural_tradition = tradition_chivalry }
				has_variable = tradition_chivalry_tournament_discount
			}
			culture = { #and you can get it
				OR = {
					has_cultural_pillar = heritage_brythonic
					has_cultural_pillar = heritage_central_germanic
					has_cultural_pillar = heritage_frankish
					has_cultural_pillar = heritage_goidelic
					has_cultural_pillar = heritage_iberian
					has_cultural_pillar = heritage_latin
					has_cultural_pillar = heritage_west_germanic
				}
			}
		}
		custom_tooltip = ep2_decision_events.0001.b.tt
		set_variable = tradition_chivalry_tournament_discount
		add_prestige = major_prestige_loss
		stress_impact = {
			base = major_stress_impact_gain
			gallant = medium_stress_impact_loss
		}
		ai_chance = {
			base = 0
		}
	}
	after = {
		scope:training_ruler = {
			remove_character_flag = wear_armor
		}
		scope:marshal = {
			remove_character_flag = wear_armor
		}
	}
}
