# ============
# SCIENTIST TRAITS
# ============
scientist_trait_genius
# 	special_project_speed_factor = 0.1
#	scientist_breakthrough_bonus_factor = 0.05
#	scientist_research_bonus_factor = 0.05
scientist_trait_brilliant_theorist
#	special_project_speed_factor = 0.05
#	scientist_breakthrough_bonus_factor = 0.02
scientist_trait_gifted_engineer
#	special_project_speed_factor = 0.05
#	scientist_research_bonus_factor = 0.02
scientist_trait_bright
#	special_project_speed_factor = 0.05
#	scientist_xp_gain_factor = 0.05
scientist_trait_fast_learner
#	scientist_xp_gain_factor = 0.1
scientist_trait_resourceful
#	special_project_facility_supply_consumption_factor = -0.1

scientist_trait_aircraft_specialist
#	sp_tag_aircraft_speed_factor = 0.05
scientist_trait_rocketry_specialist
#	sp_tag_rocket_speed_factor = 0.05
scientist_trait_electronics_specialist
#	sp_tag_radar_speed_factor = 0.05
scientist_trait_helicopter_expert
#	sp_tag_helicopter_speed_factor = 0.15
scientist_trait_jet_expert
#	sp_tag_jet_speed_factor = 0.1
scientist_trait_bombs_expert
#	sp_tag_bomb_speed_factor = 0.1
scientist_trait_guidance_systems_expert
#	sp_tag_guided_bomb_speed_factor = 0.1

scientist_trait_armored_specialist
#	sp_tag_tank_speed_factor = 0.05
scientist_trait_artillery_specialist
#	sp_tag_artillery_speed_factor = 0.05

scientist_trait_submarine_specialist
#	sp_tag_submarine_speed_factor = 0.05
scientist_trait_surface_ship_specialist
#	sp_tag_surface_ship_speed_factor = 0.05

scientist_trait_nuclear_specialist
#	specialization_nuclear_speed_factor = 0.05
scientist_trait_nuclear_warfare_expert
#	sp_tag_nuclear_warfare_speed_factor = 0.1
scientist_trait_nuclear_power_expert
#	sp_tag_nuclear_power_speed_factor = 0.1

# ============
# SPECIAL PROJECT TAGS
# ============
# sp_tag_tank
# sp_tag_artillery
# sp_tag_surface_ship
# sp_tag_submarine
# sp_tag_nuclear_warfare
# sp_tag_nuclear_power
# sp_tag_aircraft
# sp_tag_rocket
# sp_tag_helicopter
# sp_tag_jet
# sp_tag_bomb
# sp_tag_guided_bomb
# sp_tag_radar

# ============
# AIR MODULE MISSION TYPES
# ============
# strategic_bomber
# port_strike
# naval_mines_sweeping
# naval_mines_planting
# naval_bomber
# naval_patrol
# interception
# air_superiority
# attack_logistics
# cas

# ============
# UNIT CATEGORIES
# ============
# category_tanks
# category_light_infantry
# category_front_line
# category_all_infantry
# category_support_battalions
# category_militia
# category_all_armor
# category_army
# category_line_artillery
# category_artillery
# category_fighter
# category_heavy_fighter
# category_cas
# category_special_forces
# category_nav_bomber
# category_tac_bomber
# category_strat_bomber
# category_scout_plane
# category_recon
# category_mountaineers
# category_paratroopers
# category_marines
# category_anti_air
# category_amphibious_tanks
# category_support_artillery
# category_cavalry
# category_bus
# category_vehicle_infantry
# category_special_forces_leg_infantry
# category_mobile_and_mobile_combat_sup
# category_infantry_and_bicycle
# category_self_propelled_artillery
# category_self_propelled_anti_air
# category_tank_destroyers
# category_helicopter_support_companies

# ============
# TECHNOLOGY CATEGORIES
# ============
# light_air
# medium_air
# heavy_air
# armor
# cat_light_armor
# cat_medium_armor
# cat_heavy_armor
# artillery
# cat_anti_tank
# cat_anti_air
# naval_air
# infantry_weapons
# motorized_equipment
# cat_mechanized_equipment
# naval_equipment
# rocketry
# nuclear
# industry
# electronics
# cat_fortification
# land_doctrine
# air_doctrine
# naval_doctrine
# strategic_destruction_tree
# battlefield_support_tree
# operational_integrity_tree
# jet_technology
# trade_interdiction_tree
# convoy_defense_tree
# light_fighter
# cat_heavy_fighter
# tactical_bomber
# cat_strategic_bomber
# naval_bomber
# cas_bomber
# ship_modules_tech
# dd_tech
# cl_tech
# ca_tech
# cv_tech
# bc_tech
# bb_tech
# shbb_tech
# ss_tech
# tp_tech
# synth_resources
# fleet_in_being_tree
# encryption_tech
# decryption_tech
# computing_tech
# radar_tech
# infantry_tech
# marine_tech
# construction_tech
# excavation_tech
# submarine_doctrine
# air_equipment
# cat_mobile_warfare
# cat_superior_firepower
# cat_grand_battle_plan
# cat_mass_assault
# cat_base_strike
# cat_trade_interdiction
# cat_fleet_in_being
# cat_strategic_destruction
# cat_battlefield_support
# cat_operational_integrity
# night_vision
# base_strike_main
# mot_rockets
# support_tech
# para_tech
# engineers_tech
# recon_tech
# mountaineers_tech
# military_police_tech
# hospital_tech
# logistics_tech
# signal_company_tech
# maintenance_company_tech
# naval_mines
# concentrated_industry_category
# dispersed_industry_category
# asw_tech
# naval_minesweeping
# naval_minelaying
# cat_scout_plane
# train_tech
# cat_production
# cat_synth_rubber
# cat_synth_oil
# cat_armored_cars
# cat_special_forces_generic
# cat_torpedoes
# cat_ship_light_battery
# cat_ship_medium_battery
# cat_ship_heavy_battery
# air_equipment
# plane_modules_tech
# cat_air_guns
# cat_air_engine
# cat_air_bombs
# special_forces_doctrine
# cat_maritime_patrol
# cat_mountaineers_doctrine
# cat_marines_doctrine
# cat_paratroopers_doctrine
# naval_armor
# naval_artillery
# helicopter_tech
# pykrete_tech
# transport_planes_cat# 
# mio_cat_tech_all_armor_and_modules #Includes modules and chassis (DOES NOT INCLUDE ARMORED CARS)
# mio_cat_tech_light_armor_and_modules #Includes modules and stand-alone Amphibious Chassis
# mio_cat_tech_medium_armor_and_modules #Includes modules and Modern Tank
# mio_cat_tech_heavy_armor_and_modules #Includes modules and Super-Heavy Tank
# mio_cat_all_artillery_equipment #Includes Artillery, AT, AA and Rocket Artillery
# mio_cat_all_light_fighter_and_modules #Includes fighter-related modules and CV Fighter
# mio_cat_all_cas_and_modules #Includes CAS-related modules and CV CAS
# mio_cat_all_naval_bomber_and_modules #Includes naval bomber-related modules and CV Naval Bomber
# mio_cat_all_light_aircraft_and_modules #Includes all fighter, CAS and naval bomber -related modules. (DOES NOT INCLUDE CV AIRCRAFT)
# mio_cat_all_medium_aircraft_and_modules #Includes all modules
# mio_cat_all_heavy_aircraft_and_modules #Includes strategic bomber and maritime patrol -related modules
# mio_cat_tech_all_capital_ship_and_modules #Includes all BB (+ BC, SHBB, etc.), all CA (+ Coastal etc.) and all related modules
# mio_cat_tech_all_screen_ship_and_modules #Includes all DD, all CL (Torpedo Cruiser) and all related modules
# mio_cat_tech_all_submarine_and_modules #Includes all SS (Cruiser Sub and Midget Sub) and all related modules
# mio_cat_tech_all_carrier_and_modules #Includes CV and all related modules
# mio_cat_tech_all_cruiser_and_modules #Includes all CA (+ Coastal etc.), CL (Torpedo Cruiser) and all related modules
# mio_cat_tech_all_destroyer_and_modules #Includes all DD and all related modules
# mio_cat_tech_all_motorized_mechanized #Includes all Motorized (incl. Motorized Rocket Artillery) and Mechanized Equipment. (DOES NOT INCLUDE ARMORED CARS)
# mio_cat_artillery #Includes Artillery only (no AT, AA or Rocketry)


# ============
# LOCALIZATION MODIFIER VARIABLE
# ============
# $MODIFIER_ARMY_STRENGTH$: [?0.10|=-+%G0]
# [?0.05|=-+%G0]
# [?0.02|=+2]


# ============
# LEADER TRAITS SPRITE TYPES
# ============
# 1 = Airplane
# 2 = Bomb
# 3 = Ancher
# 4 = Boat
# 5 = Helmet
# 6 = Jerry Can
# 7 = Sword
# 8 = Tank
# 9 = Shield
# 10 = Factory
# 11 = Empty
# 12 = Star
# 13 = Politic
# 14 = Gears
# 15 = Atom
# 16 = Artilley Gun
# 17 = Horse
# 18 = Salute

# ============
# EQUIPMENT CATEGORIES
# ============
# convoy
# train
# floating_harbor
# railway_gun
# armor
# motorized
# mechanized
# infantry
# capital_ship
# submarine
# screen_ship
# fighter
# heavy_fighter
# interceptor
# tactical_bomber
# strategic_bomber
# cas
# naval_bomber
# missile
# emplacement_gun_ammo
# ballistic_missile
# nuclear_missile
# sam_missile
# suicide
# scout_plane
# maritime_patrol_plane
# air_transport
# carrier
# missile_launcher
# support
# amphibious
# anti_air
# artillery
# anti_tank
# rocket
# flame
# land_cruiser

# ============
# BM CUSTOM GENERIC REWARDS
# ============
# bm_progress_reward_low
# bm_progress_reward_medium
# bm_progress_reward_high
# bm_progress_loss_low
# bm_progress_loss_medium
# bm_progress_loss_high

# === AIR ===
# bm_air_breakthrough_reward_low
# bm_air_breakthrough_reward_medium
# bm_air_breakthrough_reward_high
# bm_air_scientist_xp_reward_low
# bm_air_scientist_xp_reward_medium
# bm_air_scientist_xp_reward_high
# bm_air_scientist_xp_reward_very_high

# === LAND ===
# bm_land_breakthrough_reward_low
# bm_land_breakthrough_reward_medium
# bm_land_breakthrough_reward_high
# bm_land_scientist_xp_reward_low
# bm_land_scientist_xp_reward_medium
# bm_land_scientist_xp_reward_high
# bm_land_scientist_xp_reward_very_high

# === NAVY ===
# bm_naval_breakthrough_reward_low
# bm_naval_breakthrough_reward_medium
# bm_naval_breakthrough_reward_high
# bm_naval_scientist_xp_reward_low
# bm_naval_scientist_xp_reward_medium
# bm_naval_scientist_xp_reward_high
# bm_naval_scientist_xp_reward_very_high

# NUCLEAR
# bm_nuclear_breakthrough_reward_low
# bm_nuclear_breakthrough_reward_medium
# bm_nuclear_breakthrough_reward_high

# ====================================
#          SPECIAL PROJECTS
# ====================================
force_reward_if_available = yes/no
# When this reward becomes available it will have priority. If several available rewards have this set to true, the reward will be randomly chosen based on weight.

add_scientist_trait = trait_token

special_project_parent = {...}
# Project will appear only if all parents are completed

project_output = {...}
# Bonus given when the Project is fully researched (i.e. at the end of the last Prototyping phase)

unique_prototype_rewards = {...}
# Rewards for when one iteration in the prototype phase is completed.

generic_prototype_rewards = {...}
# "Generic rewards" are coming from the prototype reward DB and can be used in several projects.

ai_will_do = {
	base = 1
}
# AI weight modifier for this project.

empty_reward_weight = {
	base = 1
}
# The weight for the probability of the reward being empty.

resource_cost = {
 	resources = {...}
}
# Resources drained during basic research & prototyping phases.

blueprint_image = GFX_generic_tank_blueprint_background
# GFX key of the background texture of the project when it is being researched.

complexity = 10
# Amount of progress gained each prototype iteration.

prototype_time = 3
# Number of days needed to complete each phase.

breakthrough_cost = {
	specialization_token = 1
}
# Cost of breakthrough points to start project.

specialization = my_specialization_token
# Category of Special Projects containing this project.

unlock_module_tooltip = module_id
# New module for designer unlocked, will probably need a custom tooltip for that since it might be a common reward. (ROOT REQUIRED (ROOT = { unlock_module_tooltip = module_id })

unlock_building_tooltip = building_id
# New module for designer unlocked, will probably need a custom tooltip for that since it might be a common reward. (ROOT REQUIRED (ROOT = { unlock_building_tooltip = building_id })

country_effects = {...}

scientist_effects = {
	injure_scientist_for_days = 60
}

enable_subunits = {
	limit = {...}
	unit_token
}

enable_equipment_modules = {
	limit = {...}
	module_token
}

enable_equipments = {
	limit = { has_dlc = "dlc_token"} # Only accepts has_dlc
	equipment_token
}

add_equipment_bonus = {
	name = bonus_name
	bonus = {
		equipment_name = {
			soft_attack = 0.10
			instant = yes
		}
	}
}

add_unit_bonus = {
	unit_token = {
		soft_attack = 0.1
	}
}

add_tech_bonus = {
	name = bonus_name
	bonus = 0.25
	uses = 1
	technology = technology_token
    category = category_token
}

add_design_template_bonus = {
	name = bonus_name	 
	uses = 1	 
	cost_factor = 0.5	 
	equipment = small_plane_airframe
}		

sub_unit_bonus = {
	unit_token = {
		soft_attack = 0.1
	}
}

equipment_bonus = {
	equipment_token = {
		soft_attack = 0.10
		instant = yes/no
	}
}

# Warning: if the project is completed via script, there may be no facility and this will be skipped.
# scope = state
# project = FROM
# var:facility_province_id - temporary variable with the province ID of the facility
facility_state_effects = {
 	add_province_modifier = {
 		static_modifiers = { modifiers }
 		province = var:facility_province_id
 	}
 
 	damage_building = {
 		damage_building = {
 			tags = facility
 			damage = 0.25
 			var:facility_province_id
 		}
 	}
 		
 	# can also run country stuff needing a state input here
 	FROM.owner = {
 		delete_unit = { state = ROOT }
 	}
}


# PROTOTYPE TIME - Affects the time it takes from start to finish of a prototype iteration, how long it takes per iteration in days.
sp_time.prototype.short = 45
sp_time.prototype.medium = 60
sp_time.prototype.long = 90
sp_time.prototype.very_long = 180

# COMPLEXITY - Amount of progress received by each iteration, influences how many iterations a project need.
sp_complexity.small = {
	min = 15
	max = 25
}
sp_complexity.medium = {
	min = 15
	max = 20
}
sp_complexity.large = {
	min = 10
	max = 15
}
sp_complexity.insane = {
	min = 5
	max = 10
}

#add_scientist_xp = {
#	experience = constant:sp_scientist_xp_gain.low
#	specialization = specialization_token
#}
constant:sp_scientist_xp_gain.low = 70
constant:sp_scientist_xp_gain.medium = 100
constant:sp_scientist_xp_gain.high = 150
constant:sp_scientist_xp_gain.very_high = 200

# FROM = { add_project_progress_ratio = constant:sp_progress.gain.low }
constant:sp_progress.gain.low = 0.05
constant:sp_progress.gain.medium = 0.1
constant:sp_progress.gain.high = 0.15
constant:sp_progress.loss.low = -0.05
constant:sp_progress.loss.medium = -0.1
constant:sp_progress.loss.high = -0.15

# army_experience = constant:sp_military_xp_gain.low
constant:sp_military_xp_gain.low = 15
constant:sp_military_xp_gain.medium = 30
constant:sp_military_xp_gain.high = 50

#add_breakthrough_progress = {
#	value = sp_breakthrough_progress.low
#	specialization = specialization_token
#}
sp_breakthrough_progress.low = 0.1
sp_breakthrough_progress.medium = 0.25
sp_breakthrough_progress.high = 0.5

# specialization_nuclear
# specialization_naval
# specialization_air
# specialization_land

# sp_tag_tank
# sp_tag_artillery
# sp_tag_surface_ship
# sp_tag_submarine
# sp_tag_nuclear_warfare
# sp_tag_nuclear_power
# sp_tag_aircraft
# sp_tag_rocket
# sp_tag_helicopter
# sp_tag_jet
# sp_tag_bomb
# sp_tag_guided_bomb
# sp_tag_radar

# aluminium
# rubber
# tungsten
# steel
# chromium


add_breakthrough_points = {
	specialization = air/land/naval/nuclear/all
	value = 1
}

add_breakthrough_progress = {
	specialization = air/land/naval/nuclear/all
	value = 1
}

add_project_progress_ratio = 0.1
add_project_progress_ratio = var:my_var

complete_prototype_reward_option = {
	prototype_reward = my_reward
	prototyp_reward_option = my_option
	show_modifiers = yes
}

set_project_flag = my_flag
set_project_flag = {
    flag = my_flag
    days = 123
    value = 1
}

clr_project_flag = my_flag

modify_mproject_flag = {
    flag = my_flag
    value = 3
}

random_scientist = {...}
any_scientist = {...}

has_scientist_level = {
	level > 0
	specialization_token
	is_active_scientist = yes/no
}

add_scientist_xp = {
	specialization = specialization_token
	experience = 5
}


unique_prototype_rewards = {
	prototype_reward_token = {
		fire_only_once = yes/no

		threshold = {
			min = 0
			max = 100
		}

		weight = {
			base = 10
		}

		option = {
			token = token_here

			iteration_output = {

			}
		}
	}
}

# ============
# IDEA EXAMPLE
# ============
custom_effect_tooltip = idea_desc|my_idea
custom_effect_tooltip = idea_name|my_idea

add_ideas = my_idea
add_ideas = {
	my_idea_1
	my_idea_2
}

remove_ideas = my_idea
remove_ideas = {
	my_idea_1
	my_idea_2
}


add_timed_idea = {
	idea = my_idea
	days = 365
	months = 12
	years = 1
}


modify_timed_idea = {
	idea = my_idea
	days = 365
	months = 12
	years = 1
}

swap_ideas = {
    remove_idea = old_idea
    add_idea = new_idea
}

remove_ideas_with_trait = motorized_equipment_manufacturer

show_ideas_tooltip = my_idea

ideas = {
	hidden_ideas = {
 		idea_token_here = {
 			removal_cost = -1
 			picture = picture_here
 
 			allowed = {...}
			allowed_civil_war = {...}
 
 			on_add = {...}
 			on_remove = {...}
 			cancel = {...}
 
 			modifier = {...} 
 			targeted_modifier = {...}
 			research_bonus = {...} G
 			equipment_bonus = {...} 
 			rule = {...}
 		}
 	}
}

idea_token_here:0 "Name"
idea_token_here_desc:0 "Description"

spriteType = {
	name = "GFX_idea_name_here"
	texturefile = "PATH"
}

# ============
# DYNAMIC MODIFIER
# ============
icon = GFX_idea_unknown
enable = {...}
remove_trigger = {...}
attacker_modifier = yes/no

TEST_dynamic_modifier_token_here = {
	experience_gain_army_factor = TOKEN_HERE_experience_gain_army_factor
}

set_variable = {
	TOKEN_HERE_experience_gain_army_factor = 0.20
}

subtract_from_variable = {
	TOKEN_HERE_experience_gain_army_factor = 0.05
}

custom_effect_tooltip = TEST_modify_dynamic_modifier_token_here_intro
add_to_variable = {
	TOKEN_HERE_experience_gain_army_factor = 0.05
	tooltip = experience_gain_army_factor_tt
}

TEST_dynamic_modifier_token_here:0 "NAME"
TEST_dynamic_modifier_token_here_desc:0 "DESCRIPTION"
TEST_modify_dynamic_modifier_token_here_intro:0 "Modify §Y$TEST_dynamic_modifier_token_here$§! by"

# ============
# GENERATE SCIENTIST EXAMPLE
# ============
every_possible_country = {
	generate_character = {
		token_base = BM_SP_GENERIC_SCIENTIST_1
		gender = male
		portraits = {
			army = {
				large = GFX_token
			}
		}
		scientist = {
			traits = {
				scientist_trait_token
			}
			skills = {
				specialization_token = 1
			}
			visible = {
				always = yes
			}
		}
	}
}


# ============
# PROGRESS
# ============
# [X] BM_anti_aircraft_truck_project
# [X] BM_attack_helicopter_project
# [X] BM_blood_plasma_transfusion_project
# [X] BM_canines_project
# [X] BM_combat_drugs_project
# [X] BM_delta_wing_project
# [X] BM_explosive_reactive_armor_project
# [X] BM_gatling_autocannon_project
# [X] BM_gravitational_suit_project
# [X] BM_industry_efficiency_project
# [X] BM_infantry_fighting_vehicle_project
# [X] BM_jacketed_bullets_project
# [X] BM_manpads_project
# [X] BM_night_vision_project
# [X] BM_personal_body_armor_project
# [X] BM_pressurized_cabin_project
# [X] BM_stealth_jet_project
# [X] BM_streamline_locomotion_project
# [X] BM_swept_wing_project
# [X] BM_tracked_mine_project

# PRIORITY 1
# [X] BM_aa_missile_project
# [X] BM_anti_aircraft_system_project
# [X] BM_anti_ship_missile_project
# [X] BM_anti_tank_guided_missile_project
# [] BM_specialized_bombs_project

# PRIORITY 2
# [] BM_enhanced_cipher_project
# [] BM_hydraulic_fracturing_project
# [] BM_mobile_dockyard_project
# [] BM_packed_hanger_deck_project
# [] BM_penicillin_project
# [] BM_seismic_exploration_project