﻿je_the_red_scare = {
    icon = "gfx/interface/icons/event_icons/event_protest.dds"

	group = je_group_crises

    is_shown_when_inactive = {
		has_global_variable = labour_movement_researched
    }
    possible = {
        custom_tooltip = {
            text = red_scare_unlock_tt
			any_in_global_list = {
                variable = aes_country_list
                has_diplomatic_relevance = root
                has_law = law_type:law_council_republic
            }
        }
        NOT = {
            has_law = law_type:law_council_republic
        }
    }
    immediate = {
        ordered_country = {
			limit = {
                has_diplomatic_relevance = root
				has_law = law_type:law_council_republic
			}
			order_by = country_rank

			save_scope_as = red_scare_target_nation
		}
        trigger_event = { id = red_scare.1 }
    }
    on_monthly_pulse = {
        random_events = {
            300 = 0
            10 = red_scare.2
            10 = red_scare.3
            10 = red_scare.4
            10 = red_scare.5
            10 = red_scare.6
            10 = red_scare.7
            10 = red_scare.8
            10 = red_scare.9
            10 = red_scare.10
            10 = red_scare.11
            10 = red_scare.12
            10 = red_scare.14
            10 = red_scare.15
        }
    }
    fail = {
        OR = {
            has_law = law_type:law_council_republic
            any_civil_war = {
                this.political_movement ?= {
                    any_influenced_interest_group = {
                        law_stance = {
                            law = law_type:law_council_republic
                            value > neutral
                        }
                    }
                }
                is_civil_war_type = revolution
                civil_war_progress >= 0.75
            }
        }
    }
    invalid = {
        NOT = {
			any_in_global_list = {
                variable = aes_country_list
                has_diplomatic_relevance = root
                has_law = law_type:law_council_republic
            }
        }
    }

    timeout = 3650

    on_timeout = {
        trigger_event = { id = red_scare.20 }
    }

    weight = 1000
    should_be_pinned_by_default = yes
}
