communist_party = {
	color = { 150 20 20 }
	name = {
		first_valid = {
			triggered_desc = {
				desc = party_bolsheviks
				trigger = {
					country_has_primary_culture = cu:russian
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_british_socialist_party
				trigger = {
					exists = c:GBR
					THIS = c:GBR
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_pcf
				trigger = {
					exists = c:FRA
					THIS = c:FRA
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_kps
				trigger = {
					exists = c:SWI
					THIS = c:SWI
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_nkp
				trigger = {
					exists = c:NOR
					THIS = c:NOR
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_dkp
				trigger = {
					exists = c:DEN
					THIS = c:DEN
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_skp
				trigger = {
					exists = c:SWE
					THIS = c:SWE
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_skp
				trigger = {
					exists = c:FIN
					THIS = c:FIN
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			# triggered_desc = {
				# desc = party_kpl
				# trigger = {
					# exists = c:LUX
					# THIS = c:LUX
					# any_interest_group = {
						# is_powerful = yes
						# leader = {
							# has_ideology = ideology_vanguardist
						# }
					# }
				# }
			# }
			triggered_desc = {
				desc = party_bkp
				trigger = {
					exists = c:BUL
					THIS = c:BUL
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_mkp
				trigger = {
					exists = c:HUN
					THIS = c:HUN
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_kpo
				trigger = {
					exists = c:AUS
					THIS = c:AUS
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_jcp
				trigger = {
					exists = c:JAP
					THIS = c:JAP
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_justice_party
				trigger = {
					exists = c:PER
					THIS = c:PER
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_socialist_workers_party
				trigger = {
					exists = c:MEX
					THIS = c:MEX
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_kke
				trigger = {
					exists = c:GRE
					THIS = c:GRE
					any_interest_group = {
						is_powerful = yes
						leader = {
							has_ideology = ideology_vanguardist
						}
					}
				}
			}
			triggered_desc = {
				desc = party_kpd
				trigger = {
					AND = {
						OR = {
							country_has_primary_culture = cu:north_german
							country_has_primary_culture = cu:south_german
							country_has_primary_culture = cu:rheinish #DVG
						}
						any_interest_group = {
							is_powerful = yes
							leader = {
								has_ideology = ideology_vanguardist
							}
						}
					}
				}
			}
			# triggered_desc = {
				# desc = party_workingmens_party
				# trigger = {
					# AND = {
						# OR = {
							# country_has_primary_culture = cu:yankee
							# country_has_primary_culture = cu:dixie
						# }
						# any_interest_group = {
							# is_powerful = yes
							# leader = {
								# has_ideology = ideology_vanguardist
							# }
						# }
					# }
				# }
			# }
			triggered_desc = {
				desc = party_cpc
				trigger = {
					AND = {
						OR = {
							country_has_primary_culture = cu:han
							country_has_primary_culture = cu:hakka
							country_has_primary_culture = cu:miao
							country_has_primary_culture = cu:min
							country_has_primary_culture = cu:zhuang
							country_has_primary_culture = cu:yi
							country_has_primary_culture = cu:yue
						}
						any_interest_group = {
							is_powerful = yes
							leader = {
								has_ideology = ideology_vanguardist
							}
						}
					}
				}
			}
			triggered_desc = {
				desc = party_communist
				trigger = {
					always = yes
				}
			}
		}
	}
	icon = {
		default = "/gfx/interface/icons/political_parties/communists.dds"
	}
	unlocking_technologies = {
		socialism
	}
	# THIS IS RUN ONLY ONCE AT GAME START
	valid_for_country = {
		always = yes
	}
	available_for_interest_group = {
		owner = {
			country_has_voting_franchise = yes
			any_interest_group = {
				leader = {
					OR = {
						has_ideology = ideology_communist
						has_ideology = ideology_vanguardist
						has_ideology = ideology_anarchist
					}
				}
			}
		}
		NOR = {
			is_interest_group_type = ig_industrialists
			is_interest_group_type = ig_landowners
		}
		leader = { # fascists, conservatives, and capitalists hate communism
			NOR = {
				has_ideology = ideology_fascist
				has_ideology = ideology_ethno_nationalist
				has_ideology = ideology_market_liberal
				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 = { # communists love communism
			limit = {
				leader = {
					OR = {
						has_ideology = ideology_communist
						has_ideology = ideology_vanguardist
						has_ideology = ideology_anarchist
					}
				}
			}
			add = {
				value = 10
				desc = "from_communism"
			}
		}
		if = { # communists love communism
			limit = {
				is_powerful = yes
				leader = {
					OR = {
						has_ideology = ideology_communist
						has_ideology = ideology_vanguardist
						has_ideology = ideology_anarchist
					}
				}
			}
			add = {
				value = 10
				desc = "from_communism_powerful"
			}
		}
		if = { # weak social democrats and radicals may side with strong communists
			limit = {
				is_powerful = no
				leader = {
					OR = {
						has_ideology = ideology_social_democrat
						has_ideology = ideology_radical
					}
				}
				owner = {
					any_interest_group = {
						is_powerful = yes
						leader = {
							OR = {
								has_ideology = ideology_communist
								has_ideology = ideology_vanguardist
								has_ideology = ideology_anarchist
							}
						}
					}
				}
			}
			add = {
				value = 6
				desc = "from_socdem_communism"
			}
		}
		if = { # post-revolution anarchists not excited about vanguard party
			limit = {
				leader = {
					has_ideology = ideology_anarchist
				}
				owner = {
					has_law = law_type:law_council_republic
					ruler = {
						has_ideology = ideology_vanguardist
					}
				}
			}
			add = {
				value = -10
				desc = "from_vanguard_anarchy"
			}
		}
		if = { # reactionary ig's don't like communism
			limit = {
				has_ideology = ideology_reactionary
			}
			add = {
				value = -3
				desc = "from_reactionaries"
			}
		}
		if = { # trade unions often enjoy communism
			limit = {
				is_interest_group_type = ig_trade_unions
			}
			add = {
				value = 2
				desc = "from_trade_unions"
			}
		}
		if = { # moderates are scared of radical politics
			limit = {
				leader = {
					has_ideology = ideology_moderate
				}
			}
			add = {
				value = -3
				desc = "from_moderate"
			}
		}
		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 = { # anticlerical
			limit = {
				OR = {
					has_ideology = ideology_anti_clerical
					leader = {
						has_ideology = ideology_atheist
					}
				}
				owner = {
					has_law = law_type:law_state_religion
				}
			}
			add = {
				value = 3
				desc = "from_anticlerical"
			}
		}
		if = { # against free trade - peasant/communist 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_free_trade"
			}
		}
		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 = { # 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 = {
            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"
            }
        }
	}
}