﻿# texture = filename								The icon that will show up in the Lens and on the map when this Focus is deployed
# modifier											The effects this Decree has on its state
# cost												The cost in AUT to set this Decree on a state (scales with Power Rank)
# unlocking_technologies							A list of technologies, at least one of which must be known to the country to use this Focus
# unlocking_laws									A list of laws, at least one which must be active in the country to use this Focus. If the country switches away from all unlocking laws the Focus will be removed
# country_trigger									A trigger in country context that determines if the Decree is permitted/shown in interface or not; should invalidate the Decree on a weekly basis if found invalid
# state_trigger										A trigger in state context that determines if the Decree is permitted or not; should invalidate the Decree on a weekly basis if found invalid
# ai_weight											Scripted value which determines the chance of getting the Decree by AI

decree_road_maintenance = {
	texture = "gfx/interface/icons/state_status_icons/incorporated_state.dds"
	modifier = {
		state_tax_capacity_add = 20
		state_tax_capacity_mult = 0.1
	}
	unlocking_technologies = {
		centralization
	}
	cost = 50

	ai_weight = {
		value = 0
	}
}

decree_violent_suppression = {
	texture = "gfx/interface/icons/decree/decree_violent_suppression.dds"

	unlocking_technologies = {
		standing_army
	}

	country_trigger = {
		NOT = { has_law = law_type:law_guaranteed_liberties }
	}
	state_trigger = {
		turmoil >= 0.25
	}
	modifier = {
		state_turmoil_effects_mult = -0.5
		state_mortality_turmoil_mult = 0.02
	}
	cost = 25

	ai_weight = {
		value = 100

		if = {
			limit = {
				turmoil >= 0.5

			}
			add = 100
		}
		if = {
			limit = {
				turmoil >= 0.75

			}
			add = 100
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_egalitarian_agenda
						has_strategy = ai_strategy_progressive_agenda
					}
				}
			}
			multiply = 0.5
		}
	}
}


decree_emergency_relief = {
	texture = "gfx/interface/icons/decree/decree_emergency_relief.dds"
	unlocking_technologies = {
		centralization
	}
	modifier = {
		state_welfare_payments_add = 0.5
		state_standard_of_living_add = 1
		state_food_security_add = 0.1
	}

	state_trigger = {
		OR = {
			has_famine = yes
			devastation > 0.2
			ROOT.state_region = {
				OR = {
					has_harvest_condition = flood
					has_harvest_condition = wildfire
					has_harvest_condition = drought
					has_harvest_condition = disease_outbreak
					has_harvest_condition = extreme_winds
				}
			}
			any_scope_pop = {
				percent >= 0.2
				is_in_starvation = yes
			}
		}
	}

	cost = 25

	ai_weight = {
		value = 0

		if = {
			limit = {
				average_sol < average_expected_sol
			}
			add = 100
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_nationalist_agenda
						has_strategy = ai_strategy_reactionary_agenda
					}
				}
			}
			multiply = 0.5
		}
	}
}

decree_promote_social_mobility = {
	texture = "gfx/interface/icons/decree/learning.dds"

	state_trigger = {
		NOT = {
			AND = {
				owner ?= {
					OR = {
						has_law = law_type:law_hindu_caste_enforced
						has_law = law_type:law_hindu_caste_codified
					}
				}
				religion_percent_state = {
					target = rel:hindu
					value >= 0.3
				}
			}
		}
	}

	modifier = {
		state_education_access_add = 0.1
		state_pop_qualifications_mult = 0.2
	}

	cost = 50

	ai_weight = {
		value = 0

		if = {
			limit = {
				literacy_rate < 0.25
			}
			add = 75
		}
		if = {
			limit = {
				literacy_rate < 0.5
			}
			add = 75
		}
		if = {
			limit = {
				literacy_rate < 0.75
			}
			add = 50
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_reactionary_agenda
						has_strategy = ai_strategy_conservative_agenda
						has_strategy = ai_strategy_maintain_mandate_of_heaven
					}
				}
			}
			multiply = 0.5
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_progressive_agenda
						has_strategy = ai_strategy_egalitarian_agenda
					}
				}
			}
			multiply = 1.5
		}
	}
}

decree_promote_national_values = {
	texture = "gfx/interface/icons/decree/decree_promote_national_values.dds"
	unlocking_technologies = {
		centralization
	}
	state_trigger = {
		OR = {
			has_assimilating_pops = yes
			has_converting_pops = yes
		}
	}
	modifier = {
		state_assimilation_mult = 1
		state_conversion_mult = 1
	}
	cost = 25

	ai_weight = {
		value = 0
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_reactionary_agenda
						has_strategy = ai_strategy_maintain_mandate_of_heaven
					}
				}
			}
			add = 100
		}
		if = {
			limit = {
				scope:country = {
					has_strategy = ai_strategy_nationalist_agenda
				}
			}
			add = 200
		}
		if = {
			limit = {
				state_population < 100000
			}
			multiply = 0
		}
		if = {
			limit = {
				state_population < 300000
			}
			multiply = 0.5
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_reactionary_agenda
						has_strategy = ai_strategy_conservative_agenda
						has_strategy = ai_strategy_maintain_mandate_of_heaven
					}
				}
			}
			multiply = 0.5
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_progressive_agenda
						has_strategy = ai_strategy_egalitarian_agenda
					}
				}
			}
			multiply = 1.5
		}
	}
}

decree_encourage_manufacturing_industry = {
	texture = "gfx/interface/icons/decree/decree_encourage_manufacturing_industry.dds"
	unlocking_technologies = {
		manufacturies
	}
	modifier = {
		building_group_bg_manufacturing_throughput_add = 0.1
	}
	cost = 50

	ai_weight = {
		value = 0
		if = {
			limit = {
				any_scope_building = {
					is_building_group = bg_manufacturing
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_building_group = bg_manufacturing
					count >= 3
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_building_group = bg_manufacturing
					count >= 5
				}
			}
			add = 50
		}
		if = {
			limit = {
				scope:country = {
					has_strategy = ai_strategy_industrial_expansion
				}
			}
			multiply = 1.5
		}
	}
}

decree_encourage_agricultural_industry = {
	texture = "gfx/interface/icons/decree/decree_encourage_agricultural_industry.dds"
	unlocking_technologies = {
		enclosure
	}
	modifier = {
		building_group_bg_agriculture_throughput_add = 0.1
		building_group_bg_plantations_throughput_add = 0.1
		building_group_bg_ranching_throughput_add = 0.1
	}
	cost = 50

	ai_weight = {
		value = 0
		if = {
			limit = {
				any_scope_building = {
					OR = {
						is_building_group = bg_agriculture
						is_building_group = bg_ranching
						is_building_group = bg_plantations
					}
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					OR = {
						is_building_group = bg_agriculture
						is_building_group = bg_ranching
						is_building_group = bg_plantations
					}
					count >= 3
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					OR = {
						is_building_group = bg_agriculture
						is_building_group = bg_ranching
						is_building_group = bg_plantations
					}
					count >= 5
				}
			}
			add = 50
		}
		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_plantation_economy
						has_strategy = ai_strategy_agricultural_expansion
					}
				}
			}
			multiply = 1.5
		}
	}
}

decree_encourage_resource_industry = {
	texture = "gfx/interface/icons/decree/decree_encourage_resource_industry.dds"
	unlocking_technologies = {
		shaft_mining
	}
	modifier = {
		building_group_bg_extraction_throughput_add = 0.1
	}
	cost = 50

	ai_weight = {
		value = 0
		if = {
			limit = {
				any_scope_building = {
					OR = {
						is_building_group = bg_mining
						is_building_group = bg_logging
						is_building_group = bg_fishing
						is_building_group = bg_whaling
						is_building_group = bg_oil_extraction
					}
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					OR = {
						is_building_group = bg_mining
						is_building_group = bg_logging
						is_building_group = bg_fishing
						is_building_group = bg_whaling
						is_building_group = bg_oil_extraction
					}
					count >= 3
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					OR = {
						is_building_group = bg_mining
						is_building_group = bg_logging
						is_building_group = bg_fishing
						is_building_group = bg_whaling
						is_building_group = bg_oil_extraction
					}
					count >= 5
				}
			}
			add = 50
		}
		if = {
			limit = {
				scope:country = {
					has_strategy = ai_strategy_resource_expansion
				}
			}
			multiply = 1.5
		}
	}
}

decree_greener_grass_campaign = {
	texture = "gfx/interface/icons/decree/decree_greener_grass_campaign.dds"
	state_trigger = {
		is_isolated_from_market = no
	}
	modifier = {
		state_migration_pull_add = 20
		state_migration_pull_mult = 0.2
	}
	unlocking_technologies = {
		romanticism
	}
	cost = 25

	ai_weight = {
		value = 0
		if = {
			limit = {
				any_scope_building = {
					is_subsistence_building = yes
					occupancy < 0.75
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_subsistence_building = yes
					occupancy < 0.5
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_subsistence_building = yes
					occupancy < 0.25
				}
			}
			add = 50
		}
		if = {
			limit = {
				is_incorporated = no
				scope:country = { NOT = { has_law = law_type:law_colonial_resettlement } } # Already gives a hefty migration bonus
			}
			multiply = 2.0
		}
		if = {
			limit = {
				state_unemployment_rate >= 0.1
			}
			multiply = 0
		}
	}
}

decree_enlistment_efforts = {
	texture = "gfx/interface/icons/decree/decree_enlistment_efforts.dds"
	modifier = {
		state_conscription_rate_add = 0.2
		building_training_rate_mult = 0.2
	}
	unlocking_technologies = {
		mandatory_service
	}
	cost = 25

	ai_weight = {
		value = 0

		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_barracks
					count >= 5
				}
			}
			add = 25
		}
		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_barracks
					count >= 10
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_barracks
					count >= 25
				}
			}
			add = 75
		}

		if = {
			limit = {
				scope:country = {
					OR = {
						has_strategy = ai_strategy_unify_germany
						has_strategy = ai_strategy_unify_italy
					}
				}
			}
			multiply = 5.0
		}

		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_naval_base
					count >= 25
				}
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_naval_base
					count >= 50
				}
			}
			add = 50
		}
	}
}

decree_promote_health = {
	texture = "gfx/interface/icons/decree/health.dds"
	unlocking_technologies = {
		pharmaceuticals
	}
	modifier = {
		state_mortality_mult = -0.1
	}
	cost = 25
	ai_weight = {
		value = 0
	}
}