﻿namespace = loaa_duel_events

# Follow-up event.
loaa_duel_events.1 = {
	hidden = yes

	immediate = {
		# Fire the follow-up stuff; delay this by a day so the toasts appear _after_ the final event.
		trigger_event = {
			id = loaa_duel_events.3
			days = 1
		}
	}
}

# Invalidation event.
loaa_duel_events.2 = {
	hidden = yes

	immediate = {
		# Everyone puts their shirts back on.
		single_combat_clean_shirtlessness_effect = {
			ATTACKER = scope:actor
			DEFENDER = scope:recipient
		}
		# Inform both parties that the bout has invalidated.
		scope:actor = {
			send_interface_toast = {
				title = perk_interaction.0102.actor_toast.t
				left_icon = scope:actor
				right_icon = scope:recipient
				custom_tooltip = perk_interaction.0102.bout_invalidated.tt
			}
		}
		scope:recipient = {
			send_interface_toast = {
				title = perk_interaction.0102.recipient_toast.t
				left_icon = scope:recipient
				right_icon = scope:actor
				custom_tooltip = perk_interaction.0102.bout_invalidated.tt
			}
		}
	}
}

# Delayed mechanical working-out event.
loaa_duel_events.3 = {
	hidden = yes

	immediate = {
		# Everyone puts their shirts back on.
		single_combat_clean_shirtlessness_effect = {
			ATTACKER = scope:actor
			DEFENDER = scope:recipient
		}
		# Send out a toast to the victor.
		scope:sc_victor = {
			send_interface_toast = {
				title = perk_interaction.0101.victor_toast.t
				left_icon = scope:sc_victor
				right_icon = scope:sc_loser
				add_character_modifier = {
					modifier = loaa_duel_winner
					years = 5
				}
			}

		}
		# And to the loser.
		scope:sc_loser = {
			send_interface_toast = {
				title = perk_interaction.0101.loser_toast.t
				left_icon = scope:sc_loser
				right_icon = scope:sc_victor
				add_character_modifier = {
					modifier = loaa_duel_loser
					years = 5
				}
			}

		}

	}
}