@base_reward_weight = 2 #Base Reward weight value
@reward_weight_factor_theme = 0.25 # Applied to factor - Used to reduce chances of repeating the same reward theme within the same project (ie. Failure 1 & Failure 2)



#Low Scientist XP gain
sp_land_generic_reward_scientist_xp_1 = {

	fire_only_once = yes

	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_scientist_xp_flag
		}
		modifier = {
			factor = 0
			var:scientist = {
				has_scientist_level = {
					level > 4
					specialization = specialization_land
				}
			}
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_scientist_xp
		
		iteration_output = {
			scientist_effects = {
				if = {
					limit = {
						
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
				FROM = { set_project_flag = sp_land_generic_reward_scientist_xp_flag }
			}
		}
	}
}

#Medium Scientist XP gain
sp_land_generic_reward_scientist_xp_2 = {

	fire_only_once = yes

	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_scientist_xp_flag
		}
		modifier = {
			factor = 0
			var:scientist = {
				has_scientist_level = {
					level > 4
					specialization = specialization_land
				}
			}
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_scientist_xp
		
		iteration_output = {
			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.medium
						specialization = specialization_land
					}
				}
				FROM = { set_project_flag = sp_land_generic_reward_scientist_xp_flag }
			}
		}
	}
}

#High Scientist XP gain
sp_land_generic_reward_scientist_xp_3 = {

	fire_only_once = yes

	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_scientist_xp_flag
		}
		modifier = {
			factor = 0
			var:scientist = {
				has_scientist_level = {
					level > 4
					specialization = specialization_land
				}
			}
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_scientist_xp
		
		iteration_output = {
			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.high
						specialization = specialization_land
					}
				}
				FROM = { set_project_flag = sp_land_generic_reward_scientist_xp_flag }
			}

			country_effects = {
				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}
			}
		}
	}
}

#Low Army XP
sp_land_generic_reward_army_xp_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_army_xp_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_army_xp
		
		iteration_output = {
			country_effects = {
				army_experience = constant:sp_military_xp_gain.low
				FROM = { set_project_flag = sp_land_generic_reward_army_xp_flag }
			}
		}
	}
}

#medium Army XP
sp_land_generic_reward_army_xp_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_army_xp_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_army_xp
		
		iteration_output = {
			country_effects = {
				army_experience = constant:sp_military_xp_gain.medium
				FROM = { set_project_flag = sp_land_generic_reward_army_xp_flag }
			}
		}
	}
}

#High Army XP
sp_land_generic_reward_army_xp_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_army_xp_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_army_xp
		
		iteration_output = {
			country_effects = {
				army_experience = constant:sp_military_xp_gain.high
				
				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}

				FROM = { set_project_flag = sp_land_generic_reward_army_xp_flag }
			}
		}
	}
}

#Low Extra Progress
sp_land_generic_reward_major_progress_1 = {
	fire_only_once = yes

	threshold = {
		min = 0
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_major_progress_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_major_breakthrough
		
		iteration_output = {
			country_effects = {
				FROM = {
					add_project_progress_ratio = constant:sp_progress.gain.low				
					
					set_project_flag = sp_land_generic_reward_major_progress_flag
				}
			}

			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
			}
		}
	}
}

#Medium Extra Progress
sp_land_generic_reward_major_progress_2 = {
	fire_only_once = yes

	threshold = {
		min = 0
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_major_progress_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_major_breakthrough
		
		iteration_output = {
			country_effects = {
				FROM = {
					add_project_progress_ratio = constant:sp_progress.gain.medium				
					
					set_project_flag = sp_land_generic_reward_major_progress_flag
				}
			}

			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
			}
		}
	}
}

#High Extra Progress
sp_land_generic_reward_major_progress_3 = {
	fire_only_once = yes

	threshold = {
		min = 0
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_major_progress_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_major_breakthrough
		
		iteration_output = {
			country_effects = {
				FROM = {
					add_project_progress_ratio = constant:sp_progress.gain.high				
					
					set_project_flag = sp_land_generic_reward_major_progress_flag
				}

				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}
			}

			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
			}
		}
	}
}

#Low Progress Loss
sp_land_generic_reward_test_failure_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 15 #Loss is 5
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_test_failure_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_test_failure
		
		iteration_output = {
			country_effects = { 
				FROM = {
					add_project_progress_ratio = constant:sp_progress.loss.low

					set_project_flag = sp_land_generic_reward_test_failure_flag
				}
			}

			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
			}
		}
	}
}

#Medium Progress Loss
sp_land_generic_reward_test_failure_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 30 #Loss is 10
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_test_failure_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_test_failure
		
		iteration_output = {
			country_effects = { 
				FROM = {
					add_project_progress_ratio = constant:sp_progress.loss.medium

					set_project_flag = sp_land_generic_reward_test_failure_flag
				}
			}

			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
			}
		}
	}
}

#High Progress Loss
sp_land_generic_reward_test_failure_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 50 #Loss is 15
		max = 100
	}
	
	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_test_failure_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_test_failure
		
		iteration_output = {
			country_effects = { 
				FROM = {
					add_project_progress_ratio = constant:sp_progress.loss.high

					set_project_flag = sp_land_generic_reward_test_failure_flag
				}

				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}
			}

			scientist_effects = {
				if = {
					limit = {
						has_scientist_level = {
							level < 5
							specialization = specialization_land
						}
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.low
						specialization = specialization_land
					}
				}
			}
		}
	}
}

#Low Tech Bonus
sp_land_generic_reward_armor_tech_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_armor_tech_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_armor_tech
		
		iteration_output = {
			country_effects = { 
				add_tech_bonus = {
					name = sp_land_generic_reward_option_armor_tech_bonus_name
					bonus = 0.1
					uses = 1
					category = armor
				}

				FROM = { set_project_flag = sp_land_generic_reward_armor_tech_flag }
			}
		}
	}
}

#Medium Tech Bonus
sp_land_generic_reward_armor_tech_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_armor_tech_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_armor_tech
		
		iteration_output = {
			country_effects = { 
				add_tech_bonus = {
					name = sp_land_generic_reward_option_armor_tech_bonus_name
					bonus = 0.2
					uses = 1
					category = armor
				}

				FROM = { set_project_flag = sp_land_generic_reward_armor_tech_flag }
			}
		}
	}
}

#High Tech Bonus
sp_land_generic_reward_armor_tech_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_armor_tech_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_armor_tech
		
		iteration_output = {
			country_effects = { 
				add_tech_bonus = {
					name = sp_land_generic_reward_option_armor_tech_bonus_name
					bonus = 0.35
					uses = 1
					category = armor
				}

				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}

				FROM = { set_project_flag = sp_land_generic_reward_armor_tech_flag }
			}
		}
	}
}

#Low Tech Bonus
sp_land_generic_reward_artillery_tech_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_artillery_tech_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_artillery_tech
		
		iteration_output = {
			country_effects = {
				add_tech_bonus = {
					name = sp_land_generic_reward_option_artillery_tech_bonus_name
					bonus = 0.1
					uses = 1
					category = mio_cat_artillery
				}

				FROM = { set_project_flag = sp_land_generic_reward_artillery_tech_flag }
			}
		}
	}
}

#Medium Tech Bonus
sp_land_generic_reward_artillery_tech_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_artillery_tech_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_artillery_tech
		
		iteration_output = {
			country_effects = {
				add_tech_bonus = {
					name = sp_land_generic_reward_option_artillery_tech_bonus_name
					bonus = 0.2
					uses = 1
					category = mio_cat_artillery
				}

				FROM = { set_project_flag = sp_land_generic_reward_artillery_tech_flag }
			}
		}
	}
}

#High Tech Bonus
sp_land_generic_reward_artillery_tech_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 0
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_artillery_tech_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_artillery_tech
		
		iteration_output = {
			country_effects = {
				add_tech_bonus = {
					name = sp_land_generic_reward_option_artillery_tech_bonus_name
					bonus = 0.35
					uses = 1
					category = mio_cat_artillery
				}

				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}

				FROM = { set_project_flag = sp_land_generic_reward_artillery_tech_flag }
			}
		}
	}
}

#Armor Bonus
sp_land_generic_reward_armor_bonus_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_armor_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_armor_bonus
		
		iteration_output = {
			equipment_bonus = {
				armor = {
					armor_value = 0.02
				}
			}
			
			country_effects = {
				FROM = { set_project_flag = sp_land_generic_reward_armor_bonus_flag }
			}
		}
	}
}

#Hardness Bonus
sp_land_generic_reward_armor_bonus_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_armor_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_armor_bonus
		
		iteration_output = {
			equipment_bonus = {
				armor = {
					hardness = 0.02
				}
			}
			
			country_effects = {
				FROM = { set_project_flag = sp_land_generic_reward_armor_bonus_flag }
			}
		}
	}
}

#Armor + Hardness Bonus
sp_land_generic_reward_armor_bonus_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_armor_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_armor_bonus
		
		iteration_output = {
			equipment_bonus = {
				armor = {
					armor_value = 0.02
					hardness = 0.02
				}
			}
			
			country_effects = {
				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}

				FROM = { set_project_flag = sp_land_generic_reward_armor_bonus_flag }
			}
		}
	}
}

#Max Speed
sp_land_generic_reward_engine_bonus_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_engine_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_engine_bonus
		
		iteration_output = {
			equipment_bonus = {
				armor = {
					maximum_speed = 0.03
				}
			}

			country_effects = {
				FROM = { set_project_flag = sp_land_generic_reward_engine_bonus_flag }
			}
		}
	}
}

#Reliability
sp_land_generic_reward_engine_bonus_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_engine_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_engine_bonus
		
		iteration_output = {
			equipment_bonus = {
				armor = {
					reliability = 0.03
				}
			}

			country_effects = {
				FROM = { set_project_flag = sp_land_generic_reward_engine_bonus_flag }
			}
		}
	}
}

#Max Speed + Reliability
sp_land_generic_reward_engine_bonus_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_engine_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_engine_bonus
		
		iteration_output = {
			equipment_bonus = {
				armor = {
					maximum_speed = 0.03
					reliability = 0.03
				}
			}

			country_effects = {
				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}

				FROM = { set_project_flag = sp_land_generic_reward_engine_bonus_flag }
			}
		}
	}
}

#Arty Soft Attack
sp_land_generic_reward_artillery_bonus_1 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_artillery_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_artillery_bonus
		
		iteration_output = {
			equipment_bonus = {
				artillery = {
					soft_attack = 0.02
				}
			}

			country_effects = {
				FROM = { set_project_flag = sp_land_generic_reward_artillery_bonus_flag }
			}
		}
	}
}

#AT Hard Attack + AA Air Attack
sp_land_generic_reward_artillery_bonus_2 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_artillery_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_artillery_bonus
		
		iteration_output = {
			equipment_bonus = {
				anti_tank = {
					hard_attack = 0.02
				}
				anti_air = {
					air_attack = 0.02
				}
			}

			country_effects = {
				FROM = { set_project_flag = sp_land_generic_reward_artillery_bonus_flag }
			}
		}
	}
}

#Arty Soft Attack + AT Hard Attack + AA Air Attack
sp_land_generic_reward_artillery_bonus_3 = {
	fire_only_once = yes
	
	threshold = {
		min = 50
		max = 100
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = @base_reward_weight
		modifier = {
			factor = @reward_weight_factor_theme
			has_project_flag = sp_land_generic_reward_artillery_bonus_flag
		}
	}
	
	option = {
		token = sp_land_generic_reward_option_artillery_bonus
		
		iteration_output = {
			equipment_bonus = {
				artillery = {
					soft_attack = 0.02
				}
				anti_tank = {
					hard_attack = 0.02
				}
				anti_air = {
					air_attack = 0.02
				}
			}

			country_effects = {
				add_breakthrough_progress = {
					specialization = specialization_land
					value = sp_breakthrough_progress.medium
				}

				FROM = { set_project_flag = sp_land_generic_reward_artillery_bonus_flag }
			}
		}
	}
}

sp_land_generic_reward_resource_scarcity = {
	fire_only_once = yes
	
	threshold = {
		min = 25
		max = 80
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = 0.5
	}
	
	option = {
		token = sp_land_generic_reward_option_resource_scarcity
		
		iteration_output = {
			country_effects = { 
				FROM = { add_project_progress_ratio = constant:sp_progress.loss.low }
			}

			scientist_effects = {
				add_scientist_xp = {
					experience = constant:sp_scientist_xp_gain.low
					specialization = specialization_land
				}
			}
		}
	}
}

sp_land_generic_reward_critical_failure = {
	fire_only_once = yes
	
	threshold = {
		min = 25
		max = 80
	}

	# ROOT is the project
	# FROM is the Country
	# var:facility_state is the State where the facility is (ensured to be set in this case)
	# var:facility_province_id is the province ID where the facility is (ensured to be set in this case)
	# var:scientist is the Scientist (ensured to be set in this case)
	weight = {
		base = 0.25
	}
	
	option = {
		token = sp_land_generic_reward_option_critical_failure
		
		iteration_output = {
			country_effects = { 
				FROM = { add_project_progress_ratio = constant:sp_progress.loss.medium }
			}

			scientist_effects = {
				add_scientist_xp = {
					experience = constant:sp_scientist_xp_gain.low
					specialization = specialization_land
				}
				injure_scientist_for_days = 30
			}

			facility_state_effects = {
				damage_building = {
					tags = facility
					damage = 0.25
					province = var:facility_province_id
				}
			}
		}
	}
}


#OBSOLETE translated strings: 
#sp_land_generic_reward_scientist_xp_1_desc
#sp_land_generic_reward_army_xp_1_desc
#sp_land_generic_reward_major_progress_1_desc
#sp_land_generic_reward_test_failure_1_desc
#sp_land_generic_reward_resource_scarcity_desc

#sp_land_generic_reward_armor_tech_1_desc
#sp_land_generic_reward_armor_bonus_1_desc
#sp_land_generic_reward_engine_bonus_1_desc

#sp_land_generic_reward_artillery_tech_1_desc