﻿# 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
# valid												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/decree/decree_road_maintenance.dds"
	valid = {
		owner = {
			is_player = yes
		}
	}	
	modifier = {
		state_infrastructure_mult = 0.25
		state_construction_mult = 0.10
	}
	unlocking_technologies = { 
		centralization
	}
	cost = 100

	ai_weight = {
		value = 25		
		
		if = {
			limit = { 
				OR = {
					relative_infrastructure < 1 
					AND = {
						has_decree = decree_road_maintenance
						relative_infrastructure < 1.25
					}
				}
			
			}
			add = 100
		}

		if = {
			limit = { 
				OR = {
					relative_infrastructure < 0.5
					AND = {
						has_decree = decree_road_maintenance
						relative_infrastructure < 0.75
					}
				}
			
			}
			add = 100
		}

		if = {
			limit = { 
				OR = {
					relative_infrastructure < 0.25 
					AND = {
						has_decree = decree_road_maintenance
						relative_infrastructure < 0.5
					}
				}
			
			}
			add = 100
		}		
		
		if = {
			limit = { 
				OR = {
					relative_infrastructure >= 1.25
					AND = {
						has_decree = decree_road_maintenance
						relative_infrastructure >= 1.5
					}
				}
			
			}
			multiply = 0
		}			
	}
}

decree_violent_suppression = {
	texture = "gfx/interface/icons/decree/decree_violent_suppression.dds"		
	
	unlocking_technologies = {
		standing_army
	}
	
	valid = {
		owner = {
			is_player = yes
		}
		owner = { NOT = { has_law = law_type:law_guaranteed_liberties } }
		turmoil >= 0.25	
	}
	modifier = {
		state_turmoil_effects_mult = -0.5
		state_mortality_turmoil_mult = 0.02
	}
	cost = 100
	
	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"
	valid = {
		owner = {
			is_player = yes
		}
	}	
	unlocking_technologies = {
		centralization
	}
	modifier = {
		state_welfare_payments_add = 0.5
	}
	cost = 100
	
	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/decree_promote_social_mobility.dds"
	valid = {
		owner = {
			is_player = yes
		}
	}
	unlocking_technologies = {
		school_farm
	}
	modifier = {
		state_education_access_add = 0.25
		state_pop_qualifications_mult = 0.25
	}
	cost = 100
	
	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
	}
	valid = {
		owner = {
			is_player = yes
		}
		OR = {
			has_assimilating_pops = yes
			has_converting_pops = yes
		}	
	}
	modifier = {
		state_assimilation_mult = 1
		state_conversion_mult = 1
	}
	cost = 100
	
	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
	}	
	valid = {
		owner = {
			is_player = yes
		}
		NOR = { 
			has_decree = decree_encourage_agricultural_industry
			has_decree = decree_encourage_resource_industry
		}
	}	
	modifier = {
		building_group_bg_manufacturing_throughput_mult = 0.2
		building_group_bg_service_throughput_mult = 0.2
	}
	cost = 100
	
	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
	}	
	valid = {
		owner = {
			is_player = yes
		}
		NOR = { 
			has_decree = decree_encourage_manufacturing_industry 
			has_decree = decree_encourage_resource_industry
		}
	}		
	modifier = {
		building_group_bg_agriculture_throughput_mult = 0.2
		building_group_bg_ranching_throughput_mult = 0.2
		building_group_bg_plantations_throughput_mult = 0.2
	}
	cost = 100
	
	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
	}	
	valid = {
		owner = {
			is_player = yes
		}
		NOR = { 
			has_decree = decree_encourage_manufacturing_industry 
			has_decree = decree_encourage_agricultural_industry
		}
	}		
	modifier = {
		building_group_bg_mining_throughput_mult = 0.2
		building_group_bg_logging_throughput_mult = 0.2
		building_group_bg_fishing_throughput_mult = 0.2
		building_group_bg_whaling_throughput_mult = 0.2
		building_group_bg_oil_extraction_throughput_mult = 0.2
	}
	cost = 100
	
	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"
	valid = {
		owner = {
			is_player = yes
		}
		is_isolated_from_market = no
	}
	modifier = {
		state_migration_pull_mult = 0.5
	}
	unlocking_technologies = { 
		romanticism
	}
	cost = 100

	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"		
	valid = {
		owner = {
			is_player = yes
		}
	}	
	modifier = {
		state_conscription_rate_add = 0.05
		building_training_rate_mult = 0.25
	}
	unlocking_technologies = {
		mandatory_service
	}
	cost = 100
	
	ai_weight = {
		value = 0	
		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_barracks
					count >= 25
				}				
			}
			add = 50
		}
		if = {
			limit = {
				any_scope_building = {
					is_building_type = building_barracks
					count >= 50
				}			
			}
			add = 50
		}
		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_tax_upgrade = {
	texture = "gfx/interface/icons/decree_tax.dds"			
	modifier = {
		state_tax_capacity_mult = 0.25
		state_bureaucracy_population_base_cost_factor_mult = -0.3
	}
	
	unlocking_technologies = {
		clerks_system
	}
	
	cost = 100
	
	ai_weight = {
		value = 1000
		if = {
			limit = { 
					tax_capacity_usage > tax_capacity
			}
			add = 10000
		}
	}
}

