
#To use one of them, refer to them elsewhere in script via "value:<value>" e.g. value:example_value
#IMPORTANT NOTE: Be mindful of performance when using these in triggers that are checked often!

# example_value = {
# 	base = 10 #default: 0

# 	# List of valid mathematical operations:
# 	# 	Numerical (modifying by a number):
# 	# 	- set/weight (both do the same, replaces the current result with this value)
# 	# 	- add
# 	# 	- subtract
# 	# 	- factor/mult/multiply ("multiply" fits the name scheme of the rest better, but the other two were kept for historical reasons)
# 	# 	- divide
# 	# 	- modulo
# 	# 	- round_to (rounds to nearest of that value, e.g. 10.7 round_to 5 gives you 10)
# 	# 	- max (sets to specified value if currently above it)
# 	# 	- min (sets to specified value if currently below it)
# 	# 	- pow (value is multiplied by itself to the power of x; be careful, you can get overflows if you are not careful)
# 	# 	Simple (do not need a number, but just "yes", e.g. "round = yes")
# 	# 	- round (sets to nearest full number)
# 	# 	- ceiling (rounds up)
# 	# 	- floor (rounds down)
# 	# 	- abs (multiply by -1 if negative)
# 	# 	- square (multiply by itself)
# 	# 	- square_root

# 	#All mathematical operations except weight and factor can be used inline e.g.
# 	add = 100
# 	multiply = value:some_other_script_value
# 	round = yes
# 	#(Note: weight and factor will instead overwrite the base value - use set, mult or multiply instead)

# 	#They can also be used in modifier = {} fields, which lets you only apply them if triggers are true
# 	modifier = {
# 		max = owner.max_example_variable 					#Variable set by set_variable
# 		owner = { is_variable_set = max_example_variable }	#Only applied if this trigger is true
# 	}
# 	# What works for right hand side values of mathematical operations? See events/00_how_to_use_variables for full list.

# 	complex_trigger_modifier = { 	#This lets you get the value of a trigger that you can't use in one-liners because it uses {}
# 		trigger = count_owned_planet
# 		trigger_scope = owner 		#Lets you get the result of the trigger on a different scope. Default is "this"
# 		parameters = { 				#Stick any further information necessary in here, like you'd do within the {} of the trigger normally
# 			limit = { pop_amount > 1000 }
# 		}
# 		mode = add 					#Allows all numerical operations
# 		mult = 5 					#Multiplies the outcome by this. In this example, this means adding 5 for each planet with more than 1000 pops
# 	}
# }

# Final note: script_values use the same metascript system as scripted_triggers and scripted_effects
# This means that you can input parameters into them, in a similar fashion as described in scripted_effects/99_advanced_documentation.txt
# For format for doing so is value:my_value|PARAM1|value1|PARAM2|value2|.
# Then you can use $PARAM1$ in the script value and it will replace it with value1


#Calculate the Number of Fleets Ralis
f93_ralis_fleet_limit = {
	base = 3
	# Larger Galaxy mean more Fleets.
	complex_trigger_modifier = {
		trigger = check_galaxy_setup_value
		parameters = {
			setting = num_empires
		}
		mode = add
		mult = 0.1 # 1 Fleet for 10 Empires
	}
	#Ralis owning more Systems increases Fleet count. This might lead to a death spiral for the galaxy
	complex_trigger_modifier = {
		trigger = count_system
		parameters = {
			limit = { exists = space_owner space_owner = { is_same_value = event_target:f93_ralis_country } }
		}
		mode = add
		mult = 0.025 # 1 Fleet for 40 Systems
	}
	# Increase over Time
	complex_trigger_modifier = {
		trigger = years_passed
		mode = mult
		mult = 0.01 # 1 Fleet per 100 Years
	}
	# Difficulty Modifier
	modifier = { #easy
		has_global_flag = f82_button_3_1_on
		multiply = 0.5
	}
	modifier = { #default
		has_global_flag = f82_button_3_3_on
		multiply = 1
	}
	modifier = { #hard
		has_global_flag = f82_button_3_3_on
		multiply = 2
	}
	round = yes
}
#Subject Fleets, Send out randomly to random colonies
ralis_fleet_attack = {
	base = 1
	complex_trigger_modifier = {
		trigger = years_passed
		mode = add
		mult = 0.033 #every 30 years would increase base by 1
	}
	modifier = { #easy
		has_global_flag = f82_button_3_1_on
		multiply = 0.75
	}
	modifier = { #default
		has_global_flag = f82_button_3_3_on
		multiply = 1
	}
	modifier = { #hard
		has_global_flag = f82_button_3_3_on
		multiply = 3
	}
	round = yes
}
#subject defensive fleets, hang out around Ralis
fleet_limit_defense = {
	base = 1
	complex_trigger_modifier = {
		trigger = years_passed
		mode = add
		mult = 0.02 #every 50 years would increase base by 1
	}
	modifier = { #easy
		has_global_flag = f82_button_3_1_on
		multiply = 0.4
	}
	modifier = { #default
		has_global_flag = f82_button_3_3_on
		multiply = 1
	}
	modifier = { #hard
		has_global_flag = f82_button_3_3_on
		multiply = 3
	}
	round = yes
}

f93_expected_fleet_power = {
	base = 1500
	#Fleetpower increases with time
	complex_trigger_modifier = {
		trigger = years_passed
		mode = add
		mult = 100 #every 100 years would increase base by 10000
	}
	#Factors for Various Fleet Types
	modifier = {
		has_fleet_flag = ralis_fleet_gal_cro_occupier
		multiply = 2
	}
	modifier = {
		has_fleet_flag = ralis_fleet_defense
		multiply = 12
	}
	modifier = {
		has_fleet_flag = ralis_fleet_attack
		multiply = 8
	}
	modifier = {
		has_fleet_flag = ralis_fleet_attack_gal_cro
		multiply = 1
	}
	modifier = {
		has_fleet_flag = ralis_fleet_subject
		multiply = 0.25
	}
}

f93_ralis_power_buff = {
	base = 1
	complex_trigger_modifier = { #Crisis Strength
		trigger = check_galaxy_setup_value
		parameters = {
			setting = crisis_strength_scale
		}
		mode = mult
		mult = 1
	}
	#Difficulty Setting
	modifier = { #easy
		has_global_flag = f82_button_3_1_on
		multiply = 0.3
	}
	modifier = { #default
		has_global_flag = f82_button_3_3_on
		multiply = 1
	}
	modifier = { #hard
		has_global_flag = f82_button_3_3_on
		multiply = 2.5
	}
}
mid_game_day = {
	base = 1
	complex_trigger_modifier = {
		trigger = check_galaxy_setup_value
		parameters = {
			setting = mid_game_year
		}
		mode = mult
		mult = 360
	}
}