﻿namespace = rcrl_perk_interaction

##################################################
# Rival Challenged to Bout
# by Ewan Cowhig Croft
# 0101 - 0120
##################################################
scripted_effect perk_interaction_0101_apply_effects_effect = {
	scope:sc_victor = { add_stress = major_stress_loss }
	scope:sc_loser = { add_stress = major_stress_gain }
}

#	Follow-up event.
rcrl_perk_interaction.0101 = {
	hidden = yes

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

#	Delayed mechanical working-out event.
rcrl_perk_interaction.0103 = {
	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
				show_as_tooltip = { perk_interaction_0101_apply_effects_effect = yes }
				imprison = {
					target = scope:sc_loser
					type = house_arrest
				}
			}
		}
		# 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
				show_as_tooltip = { perk_interaction_0101_apply_effects_effect = yes }
			}
		}
		# Then execute the actual effects.
		perk_interaction_0101_apply_effects_effect = yes
	}
}