# Social democrats extremely attracted to this ideology
# Attracts weak leftists and liberals
# Available for Trade Unions pre-Socialism

social_democrat_party = {
	color = { 241 24 138 }
	name = {
		first_valid = {
			triggered_desc = {
				desc = party_diggers
				trigger = {
					country_has_primary_culture = cu:british
					NOT = { has_technology_researched = socialism }
				}
			}
			triggered_desc = {
				desc = party_labour_party
				trigger = {
					exists = c:GBR
					THIS = c:GBR
				}
			}
			triggered_desc = {
				desc = party_psoe
				trigger = {
					exists = c:SPA
					THIS = c:SPA
				}
			}
			triggered_desc = {
				desc = party_labour_party
				trigger = {
					exists = c:IRE
					THIS = c:IRE
				}
			}
			triggered_desc = {
				desc = party_portuguese_socialist_party
				trigger = {
					exists = c:POR
					THIS = c:POR
				}
			}
			triggered_desc = {
				desc = party_ftsf
				trigger = {
					exists = c:FRA
					THIS = c:FRA
				}
			}
			triggered_desc = {
				desc = party_menshevik_party
				trigger = {
					exists = c:RUS
					THIS = c:RUS
				}
			}
			triggered_desc = {
				desc = party_finnish_labor_party
				trigger = {
					exists = c:FIN
					THIS = c:FIN
				}
			}
			triggered_desc = {
				desc = party_belgian_workers_party
				trigger = {
					exists = c:BLC
					THIS = c:BLC
					# exists = c:BEL
					# THIS = c:BEL
				}
			}
			triggered_desc = {
				desc = party_sdapo
				trigger = {
					exists = c:AUS
					THIS = c:AUS
				}
			}
			triggered_desc = {
				desc = party_brsdp
				trigger = {
					exists = c:BUL
					THIS = c:BUL
				}
			}
			triggered_desc = {
				desc = party_mszdp
				trigger = {
					exists = c:HUN
					THIS = c:HUN
				}
			}
			triggered_desc = {
				desc = party_social_democratic_workers_party
				trigger = {
					exists = c:NET
					THIS = c:NET
				}
			}
			triggered_desc = {
				desc = party_common_peoples_party
				trigger = {
					exists = c:JAP
					THIS = c:JAP
				}
			}
			triggered_desc = {
				desc = party_democrat_party
				trigger = {
					exists = c:PER
					THIS = c:PER
				}
			}
			triggered_desc = {
				desc = party_socialist_workers_federation
				trigger = {
					exists = c:TUR
					THIS = c:TUR
				}
			}
			triggered_desc = {
				desc = party_laborist_party
				trigger = {
					exists = c:MEX
					THIS = c:MEX
				}
			}
			# triggered_desc = {
				# desc = party_confederate_socialist_party
				# trigger = {
					# exists = c:CSA
					# THIS = c:CSA
				# }
			# }
			triggered_desc = {
				desc = party_seke
				trigger = {
					exists = c:GRE
					THIS = c:GRE
				}
			}
			triggered_desc = {
				desc = party_labor_party
				trigger = {
					country_has_primary_culture = cu:scandinavian
				}
			}
			# triggered_desc = {
				# desc = party_socialist_labor_party
				# trigger = {
					# country_has_primary_culture = cu:anglo_canadian
				# }
			# }
			# triggered_desc = {
				# desc = party_labor_party
				# trigger = {
					# country_has_primary_culture = cu:franco_canadian
				# }
			# }
			triggered_desc = {
				desc = party_social_democratic_workers_party
				trigger = {
					country_has_primary_culture = cu:romanian
				}
			}
			triggered_desc = {
				desc = party_sdp
				trigger = {
					OR = {
						country_has_primary_culture = cu:north_german
						country_has_primary_culture = cu:south_german
						country_has_primary_culture = cu:rheinish #DVG
					}
				}
			}
			triggered_desc = {
				desc = party_psi
				trigger = {
					OR = {
						country_has_primary_culture = cu:north_italian
						country_has_primary_culture = cu:south_italian
						country_has_primary_culture = cu:central_italian #DVG
						country_has_primary_culture = cu:sardinian #DVG
						country_has_primary_culture = cu:venetian #DVG
					}
				}
			}
			# triggered_desc = {
				# desc = party_socialist_party_of_america
				# trigger = {
					# country_has_primary_culture = cu:yankee
				# }
			# }
			triggered_desc = {
				desc = party_social_democrats
				trigger = {
					always = yes
				}
			}
		}
	}
	
	icon = {
		default = "/gfx/interface/icons/political_parties/social_democrats.dds"
	}
	unlocking_technologies = {
		labor_movement
	}
	# THIS IS RUN ONLY ONCE AT GAME START
	valid_for_country = {
		always = yes
	}
	available_for_interest_group = {
		owner = {
			country_has_voting_franchise = yes
			OR = {
				any_interest_group = {
					is_marginal = no
					leader = {
						has_ideology = ideology_social_democrat
					}
				}
				ig:ig_trade_unions = {
					is_marginal = no
				}
			}
		}
		NOT = { # these ig's are inherently anti-worker
			is_interest_group_type = ig_landowners
			is_interest_group_type = ig_industrialists
		}
		leader = { # fascists and conservatives hate social democracy
			NOT = {
				has_ideology = ideology_fascist
				has_ideology = ideology_ethno_nationalist
				has_ideology = ideology_traditionalist
				has_ideology = ideology_royalist
				has_ideology = ideology_theocrat
			}
		}
	}
	    
    # Root - IG considering joining
    # scope:number - the number of IGs that would join this party before the root IG
	join_weight = {
		value = {
			value = -5
			desc = "base_value"
		}
		if = { # social democrats love social democracy
			limit = {
				leader = {
					has_ideology = ideology_social_democrat
				}
			}
			add = {	
				value = 5
				desc = from_social_democrat
			}
		}
		if = { # powerful social democrats love social democracy
			limit = {
				is_powerful = yes
				leader = {
					has_ideology = ideology_social_democrat
				}
			}
			add = {	
				value = 5
				desc = from_social_democrat_powerful
			}
		}
		if = { # social democrats will fall in line behind stronger leftists
			limit = {
				leader = {
					has_ideology = ideology_social_democrat
				}
				is_powerful = no
				owner = {
					any_interest_group = {
						is_powerful = yes
						leader = {
							OR = {
								has_ideology = ideology_communist
								has_ideology = ideology_vanguardist
								has_ideology = ideology_anarchist
							}
						}
					}
				}
			}
			add = {	
				value = 5
				desc = from_powerful_communists
			}
		}
		if = { # weak leftists will fall in line behind social democrats pre-revolution
			limit = {
				is_powerful = no
				leader = {
					OR = {
						has_ideology = ideology_communist
						has_ideology = ideology_vanguardist
						has_ideology = ideology_anarchist
					}
				}
				owner = {
					NOT = { has_law = law_type:law_council_republic }
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_social_democrat
						}
					}
				}
			}
			add = 6
			desc = from_weak_communists
		}
		# weak liberals might fall in line behind strong social democrats
		if = {
			limit = {
				is_powerful = no
				has_ideology = ideology_liberal
				owner = {
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_social_democrat
						}
					}
				}
			}
			add = {	
				value = 5
				desc = from_weak_liberals
			}
		}
		if = { # various progressives are inclined towards social democracy
			limit = {
				leader = {
					OR = {
						has_ideology = ideology_feminist
						has_ideology = ideology_abolitionist
						has_ideology = ideology_pacifist
						has_ideology = ideology_radical
						has_ideology = ideology_reformer
						has_ideology = ideology_republican_leader
						has_ideology = ideology_atheist
					}
				}
			}
			add = {	
				value = 5
				desc = from_progressivism_sd
			}
		}
		# market liberals not very inclined to join social democrats
		if = {
			limit = {
				leader = {
					has_ideology = ideology_market_liberal
				}
			}
			add = {	
				value = -5
				desc = from_marked_liberal_sd
			}
		}
		if = { # generic powerful trade unions party
			limit = {
				is_interest_group_type = ig_trade_unions
				is_powerful = yes
				leader = {
					NOR = {
						has_ideology = ideology_communist
						has_ideology = ideology_vanguardist
						has_ideology = ideology_anarchist
					}
				}
			}
			add = {	
				value = 5
				desc = from_powerful_unions
			}
		}
		if = { # anti-censorship
			limit = {
				OR = {
					has_ideology = ideology_liberal
					has_ideology = ideology_egalitarian
				}
				owner = {
					has_law = law_type:law_outlawed_dissent
				}
			}
			add = {
				value = 3
				desc = from_outlawed_dissent
			}
		}
		if = { # against land-based taxation
			limit = {
				OR = {
					has_ideology = ideology_meritocratic
					has_ideology = ideology_agrarian
					leader = {
						has_ideology = ideology_social_democrat
					}
				}
				owner = {
					has_law = law_type:law_land_based_taxation
				}
			}
			add = {
				value = 3
				desc = "from_land_tax"
			}
		}
		if = { # loyalists will join in when their issues are relevant
			limit = {
				has_ideology = ideology_loyalist
				owner = {
					has_law = law_type:law_consumption_based_taxation
				}
			}
			add = {
				value = 3
				desc = "from_loyalist"
			}
		}
		if = { # republican
			limit = {
				OR = {
					has_ideology = ideology_republican
					has_ideology = ideology_populist
					leader = {
						OR = {
							has_ideology = ideology_atheist
							has_ideology = ideology_republican_leader
							has_ideology = ideology_radical
						}
					}
				}
				owner = {
					OR = {
						has_law = law_type:law_monarchy
						has_law = law_type:law_theocracy
					}
				}
			}
			add = {
				value = 3
				desc = "from_republican"
			}
		}
		if = { # against illiteracy and religious education
			limit = {
				OR = {
					has_ideology = ideology_individualist
					has_ideology = ideology_proletarian
				}
				owner = {
					OR = {
						has_law = law_type:law_religious_schools
						has_law = law_type:law_no_schools
					}
				}
			}
			add = {
				value = 3
				desc = "from_no_or_religious_schools"
			}
		}
		if = { # against free trade - peasant/socialist alliance
			limit = {
				OR = {
					has_ideology = ideology_proletarian
					has_ideology = ideology_agrarian
					has_ideology = ideology_paternalistic
				}
				owner = {
					has_law = law_type:law_free_trade
				}
				NOT = {
					leader = {
						has_ideology = ideology_market_liberal
					}
				}
			}
			add = {
				value = 3
				desc = "from_anti_laissez_faire"
			}
		}
		if = { # against laissez-faire - peasant/socialist alliance
			limit = {
				OR = {
					has_ideology = ideology_proletarian
					has_ideology = ideology_agrarian
				}
				owner = {
					has_law = law_type:law_laissez_faire
				}
				NOT = {
					leader = {
						has_ideology = ideology_market_liberal
					}
				}
			}
			add = {
				value = 3
				desc = "from_anti_laissez_faire"
			}
		}
		if = { # loyalist-proletarian alliance for tax reform
			limit = {
				OR = {
					has_ideology = ideology_proletarian
					leader = {
						has_ideology = ideology_social_democrat
					}
					AND = {
						has_ideology = ideology_loyalist
						owner = {
							NOR = {
								has_law = law_type:law_proportional_taxation
								has_law = law_type:law_per_capita_based_taxation
							}
						}
					}
				}
				owner = {
					NOT = {
						has_law = law_type:law_graduated_taxation
					}
				}
			}
			add = {
				value = 3
				desc = "from_no_graduated_taxation"
			}
		}
		if = { # anti-serfdom
			limit = {
				owner = {
					has_law = law_type:law_serfdom
				}
				OR = {
					has_ideology = ideology_egalitarian
					has_ideology = ideology_anti_slavery
					has_ideology = ideology_laissez_faire
					has_ideology = ideology_particularist
					leader = {
						has_ideology = ideology_abolitionist
						has_ideology = ideology_social_democrat
						has_ideology = ideology_communist
					}
				}
			}
			add = {
				value = 5
				desc = "from_serfdom"
			}
		}
		if = { # general anti-slavery
			limit = {
				owner = {
					OR = {
						has_law = law_type:law_legacy_slavery
						has_law = law_type:law_slave_trade
					}
				}
				OR = {
					has_ideology = ideology_anti_slavery
					leader = {
						has_ideology = ideology_abolitionist
					}
				}
			}
			add = {
				value = 5
				desc = "from_slavery"
			}
		}
		if = {
            limit = {
                is_interest_group_type = ig_trade_unions
                is_powerful = yes
            }
            multiply = {
                value = 2
                desc = "from_archetype_party"
            }
        }
        if = {
            limit = {
                scope:number = 1
                is_powerful = no
                is_marginal = no
            }
            multiply = {
                value = 2
                desc = "from_influential_supporting_member"
            }
        }
        else_if = {
            limit = {
                scope:number = 2
            }
            multiply = {
                value = 0.5
                desc = "from_two_prior_members"
            }
        }
        else_if = {
            limit = {
                scope:number = 3
            }
            multiply = {
                value = 0.25
                desc = "from_three_prior_members"
            }
        }
        else_if = {
            limit = {
                scope:number > 3
            }
            multiply = {
                value = 0.1
                desc = "from_more_than_three_prior_members"
            }
        }
	}
}
