﻿# Picks the amount of martial lifestyle xp to grant as a side effect for
# task_sparring_partners.
#
# LIFESTYLE_XP_SCOPE = output flag scope which determines the type of lifestyle effect to apply
regula_task_sparring_partners_positive_pick_lifestyle_side_effect = {
	random_list = {
		60 = {
			save_temporary_scope_value_as = {
				name = $LIFESTYLE_XP_SCOPE$
				value = flag:medium
			}
		}
		30 = {
			save_temporary_scope_value_as = {
				name = $LIFESTYLE_XP_SCOPE$
				value = flag:major
			}
		}
		10 = {
			save_temporary_scope_value_as = {
				name = $LIFESTYLE_XP_SCOPE$
				value = flag:perk
			}
		}
	}
}

# Applies a lifestyle xp grant side effect for task_sparring_partners.
#
# LIFESTYLE_XP_SCOPE = the type of effect to apply
# scope = the character to apply lifestyle side effects to
regula_task_sparring_partners_apply_lifestyle_side_effect = {
	if = {
		limit = {
			exists = scope:$LIFESTYLE_XP_SCOPE$
		}
		switch = {
			trigger = scope:$LIFESTYLE_XP_SCOPE$
			flag:medium = {
				add_martial_lifestyle_xp = medium_lifestyle_xp
			}
			flag:major = {
				add_martial_lifestyle_xp = major_lifestyle_xp
			}
			flag:perk = {
				add_martial_lifestyle_perk_points = 1
			}
		}
	}
}
