﻿#WHILE LOOP EFFECTS

#3 effects for managing while loops with counter:
#set_while_counter_variable_effect
#increase_while_counter_variable_effect
#remove_while_counter_variable_effect

#save_target_list_as_separate_scopes_effect - saves up to 6 members of a target_list in alphabetical scopes (can be expanded if needed)


#3 effects for managing while loops with counter
set_while_counter_variable_effect = {
	set_variable = {
		name = while_counter
		value = 0
	}
}

increase_while_counter_variable_effect = {
	change_variable = {
		name = while_counter
		add = 1
	}
	
}

remove_while_counter_variable_effect = {
	remove_variable = while_counter
}

#saves up to 6 members of a target_list in alphabetical scopes (can be expanded if needed)

#Needs the argument TARGET_LIST with the target_list name
save_target_list_as_separate_scopes_effect = {
	random_in_list = {
		list = $TARGET_LIST$
		save_scope_as = target_list_member_a
	}
	random_in_list = {
		list = $TARGET_LIST$
		limit = { scope:target_list_member_a != this }
		save_scope_as = target_list_member_b
	}
	random_in_list = {
		list = $TARGET_LIST$
		limit = {
			NOR = {
				scope:target_list_member_a = this
				scope:target_list_member_b = this
			}
		}
		save_scope_as = target_list_member_c
	}
	random_in_list = {
		list = $TARGET_LIST$
		limit = {
			NOR = {
				scope:target_list_member_a = this
				scope:target_list_member_b = this
				scope:target_list_member_c = this
			}
		}
		save_scope_as = target_list_member_d
	}
	random_in_list = {
		list = $TARGET_LIST$
		limit = {
			NOR = {
				scope:target_list_member_a = this
				scope:target_list_member_b = this
				scope:target_list_member_c = this
				scope:target_list_member_d = this
			}
		}
		save_scope_as = target_list_member_e
	}
	random_in_list = {
		list = $TARGET_LIST$
		limit = {
			NOR = {
				scope:target_list_member_a = this
				scope:target_list_member_b = this
				scope:target_list_member_c = this
				scope:target_list_member_d = this
			}
		}
		save_scope_as = target_list_member_f
	}
}