﻿ig_industrialists = {
	color = hsv{ 0.06 0.60 0.89 }
	texture = "gfx/interface/icons/ig_icons/industrialists.dds"
	layer = "revolution_dynamic_industrialists"
	index = 2

	ideologies = {
		ideology_plutocratic
		ideology_laissez_faire
		ideology_individualist
	}

	character_ideologies = {
		ideology_moderate
		ideology_market_liberal
		ideology_protectionist
	}

	enable = {
		always = yes
	}

	# Deprecated; use on_enable effect to assign traits instead
	traits = {
		ig_trait_job_creators
		ig_trait_engines_of_progress
		ig_trait_tax_avoidance
	}

	on_enable = {
		ig:ig_industrialists ?= {
			if = {
				limit = {
					owner = { c:JAP ?= this }
				}
				set_interest_group_name = ig_gosho
				remove_ideology = ideology_laissez_faire
				add_ideology = ideology_interventionist
				set_ig_trait = ig_trait:ig_trait_zaibatsu_withdrawal
				set_ig_trait = ig_trait:ig_trait_engines_of_progress
				set_ig_trait = ig_trait:ig_trait_zaibatsu_cooperation
			}
			else_if = {
				limit = {
					owner = { c:SWE ?= this }
				}
				set_ig_trait = ig_trait:ig_trait_tax_avoidance
				set_ig_trait = ig_trait:ig_trait_engines_of_progress
				set_ig_trait = ig_trait:ig_trait_kommerskollegium
			}
			else_if = {
				limit = {
					has_dlc_feature = ip3_content
					OR = {
						owner = { c:NOR ?= this }
						owner = { c:GRE ?= this }
					}
				}
				set_ig_trait = ig_trait:ig_trait_tax_avoidance
				set_ig_trait = ig_trait:ig_shipping_magnates
				set_ig_trait = ig_trait:ig_trait_job_creators
			}
			else_if = {
				limit = {
					has_dlc_feature = voice_of_the_people_content
					owner = { c:FRA ?= this }
				}
				set_ig_trait = ig_trait:ig_trait_tax_avoidance
				set_ig_trait = ig_trait:ig_trait_engines_of_progress
				set_ig_trait = ig_trait:ig_trait_ventilate_unify_beautify
			}
			else_if = {
				limit = {
					has_dlc_feature = rp1_content
					owner = { c:BRZ ?= this }
				}
				set_ig_trait = ig_trait:ig_trait_tax_avoidance
				set_ig_trait = ig_trait:ig_trait_the_goods_must_flow
				set_ig_trait = ig_trait:ig_trait_job_creators
			}
			# India
			else_if = {
				limit = {
					owner = {
						c:BIC ?= this
					}
				}
				set_interest_group_name = ig_east_india_company
				remove_ideology = ideology_laissez_faire
				add_ideology = ideology_colonialist
				remove_ideology = ideology_plutocratic
				add_ideology = ideology_enclavist
				remove_ideology = ideology_individualist
				add_ideology = ideology_malthusian

				set_ig_trait = ig_trait:ig_trait_wounded_honor
				set_ig_trait = ig_trait:ig_trait_stamped_and_signed
				set_ig_trait = ig_trait:ig_trait_responsible_government
			}
			else_if = {
				limit = {
					owner = {
						OR = {
							c:DEI ?= this
							c:ALK ?= this
							c:HBC ?= this
							is_country_type = company
						}
					}
				}
				remove_ideology = ideology_laissez_faire
				add_ideology = ideology_colonialist

				set_ig_trait = ig_trait:ig_trait_tax_avoidance
				set_ig_trait = ig_trait:ig_trait_engines_of_progress
				set_ig_trait = ig_trait:ig_trait_job_creators
			}
			else = {
				set_ig_trait = ig_trait:ig_trait_tax_avoidance
				set_ig_trait = ig_trait:ig_trait_engines_of_progress
				set_ig_trait = ig_trait:ig_trait_job_creators
			}
		}
		ig:ig_industrialists = {
			if = {
				limit = {
					owner = { c:USA ?= this }
				}
				remove_ideology = ideology_laissez_faire
				add_ideology = ideology_american_laissez_faire
			}
		}
	}

	on_disable = {}

	priority_cultures = { #Country scope
		rule = {
			trigger = {
				c:BIC ?= this
				any_primary_culture = {
					cu:british = this
				}
			}
			cultures = {
				british scottish irish
			}
		}
		rule = {
			trigger = {
				c:ZAN ?= this
				any_primary_culture = {
					cu:bedouin = this
				}
			}
			cultures = {
				bedouin swahili north_german british gujarati
			}
		}
		rule = {
			trigger = {
				c:HAW ?= this
				NOT = { has_variable = deported_americans }
			}
			cultures = {
				yankee dixie british hawaiian
			}
		}
		rule = {
			trigger = {
				c:PHI ?= this
				NOT = { has_variable = je_philippines_main_reliance_happened }
				NOT = { any_primary_culture = { cu:filipino = this } }
				NOT = { any_primary_culture = { cu:filipino_hispanophone = this } }
				any_primary_culture = { cu:spanish = this }
			}
			cultures = {
				spanish filipino_mestizo
			}
		}
		rule = {
			trigger = {
				c:PHI ?= this
				any_primary_culture = {
					AND = {
						cu:spanish = this
						cu:filipino_hispanophone = this
					}
				}
			}
			cultures = {
				spanish filipino_hispanophone
			}
		}
	}

	on_character_ig_membership = {
		if = {
			limit = {
				OR = {
					culture = cu:british
					culture = cu:north_german
				}
				owner = {
					c:ZAN ?= this
					any_primary_culture = {
						cu:bedouin = this
					}
				}
			}
			change_character_religion = rel:protestant
		}
		if = {
			limit = {
				culture = cu:gujarati
				owner = {
					c:ZAN ?= this
					any_primary_culture = {
						cu:bedouin = this
					}
				}
			}
			change_character_religion = rel:shiite
		}
	}

	pop_potential = {
		OR = {
			is_pop_type = capitalists
			is_pop_type = engineers
			is_pop_type = machinists
			is_pop_type = laborers
			is_pop_type = aristocrats
			is_pop_type = shopkeepers
			AND = {
				exists = c:BIC
				owner ?= c:BIC
				OR = {
					culture ?= {
						has_discrimination_trait_group = heritage_group_european
					}
					is_pop_type = bureaucrats
					is_pop_type = clerks
				}
			}
		}
	}

	pop_weight = {
		value = 0

		add = {
			desc = "WEALTH"
			if = {
				limit = { 
					wealth > 30
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = farmers }
					NOT = { is_pop_type = capitalists }
				}

				value = wealth
				subtract = 20
				multiply = 4
				max = 250

			}			
		}
	
		add = {
			desc = "POP_CAPITALISTS"
			if = {
				limit = {
					is_pop_type = capitalists
				}
				value = 250
				add = this.standard_of_living
			}
		}

		add = {
			desc = "POP_ENGINEERS"
			if = {
				limit = {
					is_pop_type = engineers
				}
				value = 50
				add = {
					value = this.standard_of_living
					multiply = 2
				}
			}
		}

		add = {
			desc = "POP_SHOPKEEPERS"
			if = {
				limit = {
					is_pop_type = shopkeepers
				}
				value = 50
				add = {
					value = this.standard_of_living
					multiply = 2
				}
			}
		}
		if = {
			limit = {
				owner = {
					c:BIC ?= this
				}
				culture = {
					has_discrimination_trait_group = heritage_group_european
				}
				OR = {
					strata = upper
					strata = middle
				}
				NOT = {
					is_pop_type = officers
				}
			}
			add = {
				desc = "POP_INDIA_EUROPEAN_ADMINISTRATORS"
				value = 250
			}
		}

		if = {
			limit = {
				owner = {
					c:BIC ?= this
				}
			}
			if = {
				limit = {
					NOT = {
						culture = {
							has_discrimination_trait_group = heritage_group_european
						}
					}
					OR = {
						is_pop_type = bureaucrats
						is_pop_type = clerks
					}
				}
				add = {
					desc = "POP_INDIA_NATIVE_ADMINISTRATORS"
					value = 25
				}
			}
			else_if = {
				limit = {
					NOT = {
						culture = {
							has_discrimination_trait_group = heritage_group_european
						}
					}
					NOR = {
						is_pop_type = bureaucrats
						is_pop_type = clerks
					}
				}
				multiply = {
					desc = "POP_INDIA_ADMINISTRATION_PRIVILEGES"
					value = 0.05
				}
			}
		}

		add = {
			desc = "POP_ARISTOCRATS"
			if = {
				limit = { 
					is_pop_type = aristocrats
				}
				value = 25
			}
		}

		add = { #Some workers supports the capitalists
			desc = "POP_MACHINISTS"
			if = {
				limit = { 
					is_pop_type = machinists
				}
				value = 5
			}
		}	

		add = { #Some workers supports the capitalists
			desc = "POP_LABORERS"
			if = {
				limit = { 
					is_pop_type = laborers
				}
				value = 5
			}
		}
		
		multiply = { # Boost to Facism to make it relevant
			desc = "ideology_fascist"
			value = 1.0
			if = {
				limit = {
					owner = {					
						ig:ig_industrialists = {
							leader = {
								has_ideology = ideology:ideology_fascist
							}
						}					
					}
				}
				value = 1.5
			}
		}

		multiply = { # extra boost to fascism for wealthy classes if powerful
			desc = "ideology_fascist"
			value = 1.0
			if = {
				limit = {
					owner = {					
						ig:ig_industrialists = {
							leader = {
								has_ideology = ideology:ideology_fascist
							}
							is_powerful = yes
						}					
					}
					OR = {
						is_pop_type = capitalists
						is_pop_type = aristocrats
					}
				}
				value = 2.0
			}
		}

		add = {
			desc = "SOL_25_30"
			if = {
				limit = {
					standard_of_living >= 25
					standard_of_living < 30
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = capitalists }
					NOT = { is_pop_type = farmers }
				}
				value = 10
			}
		}

		add = {
			desc = "SOL_30_35"
			if = {
				limit = {
					standard_of_living >= 30
					standard_of_living < 35
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = capitalists }
					NOT = { is_pop_type = farmers }
				}
				value = 20
			}
		}	

		add = {
			desc = "SOL_35_40"
			if = {
				limit = {
					standard_of_living >= 35
					standard_of_living < 40
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = capitalists }
					NOT = { is_pop_type = farmers }
				}
				value = 30
			}
		}

		add = {
			desc = "SOL_40_45"
			if = {
				limit = {
					standard_of_living >= 40
					standard_of_living < 45
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = capitalists }
					NOT = { is_pop_type = farmers }
				}
				value = 40
			}
		}

		add = {
			desc = "SOL_45_50"
			if = {
				limit = {
					standard_of_living >= 45
					standard_of_living < 50
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = capitalists }
					NOT = { is_pop_type = farmers }
				}
				value = 50
			}
		}

		add = {
			desc = "SOL_50_100"
			if = {
				limit = {
					standard_of_living >= 50
					NOT = { is_pop_type = aristocrats }
					NOT = { is_pop_type = capitalists }
					NOT = { is_pop_type = farmers }
				}
				value = 75
			}
		}

		multiply = {
			desc = "law_graduated_taxation"
			value = 1.0
			if = {
				limit = {
					owner = {
						has_law = law_type:law_graduated_taxation
					}
				}
				value = 1.1
			}
		}

		multiply = {
			desc = "law_traditionalism"
			value = 1.0
			if = {
				limit = {
					owner = {
						has_law = law_type:law_traditionalism
					}
				}
				value = 1.25
			}
		}

		multiply = {
			desc = "law_command_economy"
			value = 1.0
			if = {
				limit = {
					owner = {
						has_law = law_type:law_command_economy
					}
				}
				value = 1.25
			}
		}

		multiply = {
			desc = "law_isolationism"
			value = 1.0
			if = {
				limit = {
					owner = {
						has_law = law_type:law_isolationism
					}
				}
				value = 1.25
			}
		}

		multiply = {
			value = 1.0
			desc = "IG_EMPLOYED_MIC"

			if = {
				limit = {
					employed_in_military_industry = yes
				}
				value = 0.5
			}
		}	

		multiply = {
			desc = "IG_COUNCIL_REPUBLIC"
			value = 1.0

			if = {
				limit = {
					owner = {
						has_law = law_type:law_council_republic
					}
					NOT = {
						is_pop_type = capitalists
					}
				}
				value = 0
			}
		}

		add = {
			desc = "NON_SLAVE_STATE"
			if = {
				limit = {
					is_pop_type = aristocrats
					owner = {
						THIS = c:USA
						ig:ig_landowners = {
							has_ideology = ideology:ideology_pro_slavery
						}
					}
					state = { 
						is_slave_state = no
					}
				}
				value = 125
			}
		}

		multiply = {
			desc = "YANKEE"
			value = 1.0

			if = {
				limit = {
					owner = {
						c:USA = THIS
						NOT = {
							ig:ig_rural_folk = {
								leader = {
									has_ideology = ideology:ideology_jacksonian_democrat
								}
							}
						}
					}
					culture = cu:yankee
				}
				value = 2
			}
		}

		multiply = {
			desc = "ideology_jacksonian_democrat"
			value = 1.0
			if = {
				limit = {
					owner = {
						ig:ig_rural_folk = {
							leader = {
								has_ideology = ideology:ideology_jacksonian_democrat
							}
						}
					}
				}
				value = 0.75
			}
		}

		add = {
			desc = "GERMAN_CATHOLIC"
			if = {
				limit = {
					owner = { ig:ig_landowners = { has_ideology = ideology:ideology_junker_paternalistic }}
					is_pop_type = aristocrats
					has_state_religion = no
					religion = rel:catholic
				}
				value = 150
			}
		}

		add = {
			desc = "ideology_junker_paternalistic"
			if = {
				limit = { 
					is_pop_type = capitalists
					has_state_religion = yes
					religion = rel:protestant
					culture = cu:north_german
					owner = {
						ig:ig_landowners = {
							has_ideology = ideology:ideology_junker_paternalistic
						}
					}
				}
				value = -200
			}
		}

		multiply = { #Pops are less attracted to radical ideologies if they're not poor
			desc = "Radical Leader Ideology"
			value = 1.0
			if = {
				limit = {
					owner = {					
						ig:ig_industrialists = {
							leader = {
								has_ideology = ideology:ideology_radical
							}
						}						
					}
					NOT = {
						standard_of_living <= 20
					}
				}
				value = 0.50
			}
		}

		multiply = {
			desc = "WOMENVOTE"
			value = 1.0

			if = {
				limit = {
					owner = {
						has_law = law_type:law_womens_suffrage
					}
				}
				value = 0.9
			}
		}
		
		multiply = {
			desc = "LEADER_POPULARITY"
			scope:interest_group ?= {
				leader ?= {
					value = popularity
					multiply = 0.0025
					add = 1
					max = 1.25
					min = 0.75
				}
			}
		}

		multiply = {
			desc = "decentralized_power"
			value = 1.0

			if = {
				limit = {
					owner = {
						is_country_type = decentralized
					}
				}
				value = 0.0
			}
		}
		if = {
			limit = {
				scope:interest_group ?= {
					is_in_government = yes
				}
			}
			multiply = {
				desc = "IN_GOVERNMENT_ATTRACTION"
				value = 1
				add = scope:interest_group.modifier:interest_group_in_government_attraction_mult
				min = 0
			}
		}

		if = {
			limit = {
				scope:interest_group ?= {
					is_in_government = yes
				}
			}
			multiply = { # Multiplied by 1.25x max
				desc = "POP_LOYALISTS"
				value = pop_loyalist_fraction
				divide = 4
				add = 1
			}
		}
		if = {
			limit = {
				scope:interest_group ?= {
					is_in_government = no
				}
			}
			multiply = { # Multiplied by 1.25x max
				desc = "POP_RADICALS"
				value = pop_radical_fraction
				divide = 4
				add = 1
			}
		}
		
		multiply = {
			desc = "IG_IS_MARGINALIZED"
			value = 1.0
			
			scope:interest_group ?= {
				if = {
					limit = {
						ig_counts_as_marginal = yes
					}
					value = 0.75
				}
			}
		}
	}

	monarch_weight = {
		value = 1
		# Monarch is not likely to adopt a marginal IG
		if = {
			limit = {
				ig_counts_as_marginal = yes
			}
			multiply = {
				value = 0.1
			}
		}
		# Monarch is more likely to adopt a Powerful IG
		if = {
			limit = {
				is_powerful = yes
			}
			multiply = {
				value = 2
			}
		}
		# More likely with Wealth Voting or Oligarchy
		if = {
			limit = {
				owner = {
					OR = {
						has_law_or_variant = law_type:law_oligarchy
						has_law_or_variant = law_type:law_wealth_voting
					}
				}
			}
			multiply = {
				value = 2
			}
		}
		# Slightly more likely with LF
		if = {
			limit = {
				owner = {
					has_law_or_variant = law_type:law_laissez_faire
				}
			}
			multiply = {
				value = 1.25
			}
		}
		# Less likely before researching Mutual Funds
		if = {
			limit = {
				owner = {
					NOT = { has_technology_researched = mutual_funds }
				}
			}
			multiply = {
				value = 0.5
			}
		}
		# Impossible without Currency Standards
		if = {
			limit = {
				owner = {
					NOT = { has_technology_researched = currency_standards }
				}
			}
			multiply = {
				value = 0
			}
		}
	}

	agitator_weight = {
		# Agitators more likely to come from populist IG's rather than elitist
		value = 0.25
		# Agitators will never be part of a marginalized IG
		if = {
			limit = {
				owner.ig:ig_industrialists ?= {
					ig_counts_as_marginal = yes
				}
			}
			multiply = {
				value = 0
			}
		}
	}

	commander_weight = {
		value = 0.5
	}
	
	magnate_weight = {
		value = 2.0
	}	

	executive_weight = {
		value = 5.0
	}

	noble_chance = {
		value = 0.3
	}

	female_commander_chance = {
		value = 0.0
	}

	female_executive_chance = {
	value = 0.0
	}

	female_monarch_chance = {
		value = 0.05
	}

	female_politician_chance = {
		value = 0.0

		if = {
			limit = {
				owner = {
					has_law_or_variant = law_type:law_womens_suffrage
				}

			}
			add = {
				value = 0.025
			}
		}
	}

	female_agitator_chance = {
		value = 0.025

		if = {
			limit = {
				owner = {
					has_law_or_variant = law_type:law_women_own_property
				}

			}
			add = {
				value = 0.025
			}
		}

		if = {
			limit = {
				owner = {
					has_law_or_variant = law_type:law_women_in_the_workplace
				}

			}
			add = {
				value = 0.025
			}
		}

		if = {
			limit = {
				owner = {
					has_law_or_variant = law_type:law_womens_suffrage
				}

			}
			add = {
				value = 0.025
			}
		}
	}

	# Multiplier applied to the weight for an appropriate commander will be selected from the character pool to lead the IG
	# root = interest group
	commander_leader_weight = {
		value = 0.5
	}
	
	# Multiplier applied to the weight for an appropriate magnate will be selected from the character pool to lead the IG
	# root = interest group
	magnate_leader_weight = {
		value = 2.0
		if = {
			limit = {
				c:JAP ?= owner
				NOT = {
					has_variable = japan_restoration_complete
				}
			}
			add = 5
		}
	}

	# Multiplier applied to the weight for an appropriate executive will be selected from the character pool to lead the IG
	# root = interest group
	executive_leader_weight = {
		value = 3.0
	}
}
