on_actions = {
    on_civil_war_end = {
        effect = {
            if = {
                limit = { 
                    ROOT = {
                        OR = {
                            has_government = totalist
                            has_government = syndicalist
                            has_government = radical_socialist
                        }  
                        NOT = { has_country_flag = has_win_cw }
                        OR = {
                            AND = {
                                original_tag = CHI
                                LEP = { exists = no }
                                ANQ = { exists = no }
                                SQI ={
                                    OR = {
                                        exists = No
                                        NOT = { has_war_with = CHI }
                                    }                               
                                }
                            } 
                            AND = {
                                original_tag = HND
                                RAJ = { exists = no }
                                PRF = { exists = no }
                            }
                            AND = {
                                original_tag = CSA
                                USA = { exists = no }
                                NEE = { exists = no }
                                TEX = { exists = no }
                                PSA = { exists = no }
                            }
                        }                  
                    }
                }
                FRA = {          
                    country_event = internvene.999 
                }
                ROOT = {
                    set_country_flag = has_win_cw
                }
            }
        }
    }
    on_daily_IMP = {
        effect = {
            if = {
                limit = {          
                    FRA_not_a_socialism_govern = yes
                    has_idea = CAN_quebec_in_flames_idea 
                    NOT = { has_global_flag = FRA_que_revo_CAN_in_flame }
                    FRA = {
                        has_country_flag = que_revo_start
                    }
                }
                FRA = {
                    country_event = internvene.2
                }
            }
            if = {
                limit = {          
                    FRA_not_a_socialism_govern = yes
                    has_completed_focus = CAN_suppress_quebecois         
                    NOT = { has_global_flag = FRA_que_revo_CAN_in_flame_more }
                    FRA = {
                        has_country_flag = que_revo_start
                    }
                }
                FRA = {
                    country_event = internvene.21
                }
            }
            if = {
                limit = {
                    has_war_with = QUE
                    QUE = {
                        has_full_control_of_state = 739
                    }
                }
                IMP = {
                    country_event = internvene.211
                }
            }
        }
    }
    on_daily_QUE = {
        effect = {
            if = {
                limit = {
                    is_puppet = no
                    NOT = { 
                        OR = {
                            has_war_with = CAN 
                            has_war_with = IMP
                        }
                    }
                    is_in_faction = no 
                }
                FRA = {
                    add_to_faction = QUE
                }
            }        
        }
    }
    on_daily_JAP = {
        effect = {
            if = {
                limit = {
                    FRA_not_a_socialism_govern = yes
                    has_stability < -0.25
                    KOR = {
                        exists = yes
                        has_war_with = JAP
                    }
                    524 = {
                        NOT = {
                            is_controlled_by = JAP
                        }
                    }
                }
                add_ideas = FRA_jap_collapse
                add_political_power = -500
				add_popularity = {
					ideology = syndicalist
					popularity = 0.05
				}
				add_popularity = {
					ideology = radical_socialist
					popularity = 0.1
				}
				add_popularity = {
					ideology = totalist
					popularity = 0.05
				}
                FRA = {
                    set_temp_variable = {
                        FRA_infulence_change = 100
                    }
                    add_to_variable = { FRA_infulence_asia = var:FRA_infulence_change }
                }
                every_other_country = {
                    limit = { has_war_with = JAP }
                    white_peace = JAP
                    set_truce = {
                        tag = JAP
                        days = 730
                    }
                }
                every_other_country = {
					limit = {
						owns_state = 716
					}
					transfer_state = 745
				}
            }        
        }
    }
    on_startup = {
        effect = {
            FRA = {
                country_event = frapoc.1
                country_event = frapoc.10
                add_dynamic_modifier = {
                    modifier = FRA_social_politic_situation
                }
                add_dynamic_modifier = {
                    modifier = FRA_politics_bill_effects
                }

                activate_mission = FRA_govern_buff_change
                
                set_variable = { govern_central_control = 48 }
                set_variable = { govern_bureaucrats_member = 65 }
                set_variable = { govern_bureaucrats_efficiency = 35 }
                set_variable = { govern_bureaucrats_corruption = 37 }
                set_variable = { govern_bureaucrats_stance = 50 }
                
                set_variable = { CGT_political_power_factor = -0.1 } 
	        	set_variable = { CGT_consumer_goods_factor = 0.05 }
		        set_variable = { CGT_war_support_factor = -0.025 }
		        set_variable = { CGT_production_factory_start_efficiency_factor = 0.05 } 
		        set_variable = { CGT_industrial_capacity_factory = 0.025 }
                set_variable = { CGT_stability_factor = 0.025 }

                set_variable = { DSE_stability_factor = 0.025 } 
                set_variable = { DSE_drift_defence_factor = 0.05 }
                set_variable = { DSE_required_garrison_factor = -0.025 }
                set_variable = { DSE_operation_outcome = 0.05 } 
                set_variable = { DSE_operative_slot = 1 }
                set_variable = { DSE_command_power_gain = -0.01 }
                set_variable = { DSE_army_org_factor = -0.025 }
                set_variable = { DSE_mobilization_speed = -0.05 } 
                set_variable = { DSE_political_power_factor = -0.05 }

                set_variable = { DA_stability_factor = -0.025 } 
                set_variable = { DA_political_power_factor = 0.05 }
                set_variable = { DA_research_speed_factor = 0.025 }
                set_variable = { DA_production_factory_efficiency_gain_factor = -0.025 } 

                set_variable = { DSP_political_power_factor = -0.05 }
                set_variable = { DSP_stability_factor = -0.025 } 
                set_variable = { DSP_war_support_factor = 0.05 }
                set_variable = { DSP_production_factory_max_efficiency_factor = 0.025 }
                set_variable = { DSP_drift_defence_factor = 0.05 }
                set_variable = { DSP_research_speed_factor = 0.01 }

                set_variable = { WR_stability_factor = -0.025 } 
                set_variable = { WR_political_power_factor = -0.05 }
                set_variable = { WR_conscription_factor = 0.05 } 
                set_variable = { WR_consumer_goods_factor = -0.05 }
                set_variable = { WR_industrial_capacity_factory = 0.025 } 

                set_country_flag = show_the_bill_buff

                set_variable = { frasoc_workers = 52 }
                set_variable = { frasoc_peasants = 34 }
                set_variable = { frasoc_merchants = 39 }
                set_variable = { frasoc_scholoars = 57 }
                set_variable = { frasoc_forces = 49 }
                set_variable = { frasoc_bureaucrats = 61 }
                set_variable = { frasoc_synd = 62 }
                set_variable = { frasoc_anar = 45 }
                set_variable = { frasoc_jaco = 42 }
                set_variable = { frasoc_sore = 49 }
                activate_mission = FRA_politics_change
                FRA_social_politic_situation_buff_change = yes

                set_variable = { seat_synd_trav = 147 }
                set_variable = { seat_synd_radi = 126 }
                set_variable = { seat_synd = 273 }
                set_variable = { seat_anar_parl = 93 }
                set_variable = { seat_anar_anar = 48 }
                set_variable = { seat_anar = 141 }
                set_variable = { seat_jaco_neos = 75 }
                set_variable = { seat_jaco_leni = 58 }
                set_variable = { seat_jaco = 133 }
                set_variable = { seat_sore_oldl = 47 }
                set_variable = { seat_sore_yout = 42 }
                set_variable = { seat_sore = 89 }
                set_variable = { seat_indenpent = 14 }              

                set_country_flag = original_CBGT_leader
                set_country_flag = original_CCSP_leader
                set_country_flag = original_DFA_leader
                set_country_flag = original_DED_leader
                set_country_flag = original_DIS_leader
                set_country_flag = original_DSRG_leader
                set_country_flag = original_CGSC_leader

                set_country_flag = original_FRA_soc_bill_CGT
                set_country_flag = original_FRA_soc_bill_DSE
                set_country_flag = original_FRA_soc_bill_DA
                set_country_flag = original_FRA_soc_bill_DSP
                set_country_flag = original_FRA_soc_bill_WR

                set_variable = { dominant_faction_synd = 4 }
                set_variable = { dominant_faction_anar = 3 }
                set_variable = { dominant_faction_jaco = 0 }
                set_variable = { dominant_faction_sore = 0 }

                set_country_flag = voting_time
                activate_mission = FRA_impeach_startup

                set_variable = { FRA_politics_points = 50 }

                set_variable = { agree_synd_trav = 51 }
              	set_variable = { agree_synd_radi = 84 }
            	set_variable = { agree_anar_parl = 71 }
              	set_variable = { agree_anar_anar = 48 }
               	set_variable = { agree_jaco_neos = 72 }
            	set_variable = { agree_jaco_leni = 58 }
	            set_variable = { agree_sore_oldl = 44 }
	            set_variable = { agree_sore_yout = 39 }
	            set_variable = { agree_indent = 10 }
                FRA_vote_base = yes
               
                random_list = {
                    1 = { set_country_flag = politic_mission_w1_enable }
                    1 = { set_country_flag = politic_mission_w2_enable }
                    1 = { set_country_flag = politic_mission_w3_enable }
                    1 = { set_country_flag = politic_mission_p1_enable }
                    1 = { set_country_flag = politic_mission_p2_enable }
                    1 = { set_country_flag = politic_mission_p3_enable }
                    1 = { set_country_flag = politic_mission_m1_enable }
                    1 = { set_country_flag = politic_mission_m2_enable }
                    1 = { set_country_flag = politic_mission_m3_enable }
                    1 = { set_country_flag = politic_mission_s1_enable }
                    1 = { set_country_flag = politic_mission_s2_enable }
                    1 = { set_country_flag = politic_mission_s3_enable }
                    1 = { set_country_flag = politic_mission_f1_enable }
                    1 = { set_country_flag = politic_mission_f2_enable }
                    1 = { set_country_flag = politic_mission_f3_enable }
                    1 = { set_country_flag = politic_mission_b1_enable }
                    1 = { set_country_flag = politic_mission_b2_enable }
                    1 = { set_country_flag = politic_mission_b3_enable }
                }
                

            }
        }
    }
    on_daily_FRA = {
        effect = {
            if = {
                limit = {          
                    FRA = {
                        has_country_flag = voting_time
                    }
                    OR = {
                        check_variable = { agree_synd_trav > var:FRA.seat_synd_trav }
                        check_variable = { agree_synd_radi > var:FRA.seat_synd_radi }
                        check_variable = { agree_anar_parl > var:FRA.seat_anar_parl }
                        check_variable = { agree_anar_anar > var:FRA.seat_anar_anar }
                        check_variable = { agree_jaco_neos > var:FRA.seat_jaco_neos }
                        check_variable = { agree_jaco_leni > var:FRA.seat_jaco_leni }
                        check_variable = { agree_sore_oldl > var:FRA.seat_sore_oldl }
                        check_variable = { agree_sore_yout > var:FRA.seat_sore_yout }
                        check_variable = { agree_indent > var:FRA.seat_indenpent }
                    }
                }
                clamp_variable = {
                    var = agree_synd_trav
                    max = var:FRA.seat_synd_trav
                    min = 0
                }
                clamp_variable = {
                    var = agree_synd_radi
                    max = var:FRA.seat_synd_radi
                    min = 0
                }
                clamp_variable = {
                    var = agree_anar_parl
                    max = var:FRA.seat_anar_parl
                    min = 0
                }
                clamp_variable = {
                    var = agree_anar_anar
                    max = var:FRA.seat_anar_anar
                    min = 0
                }
                clamp_variable = {
                    var = agree_jaco_neos
                    max = var:FRA.seat_jaco_neos
                    min = 0
                }
                clamp_variable = {
                    var = agree_jaco_leni
                    max = var:FRA.seat_jaco_leni
                    min = 0
                }
                clamp_variable = {
                    var = agree_sore_oldl
                    max = var:FRA.seat_sore_oldl
                    min = 0
                }
                clamp_variable = {
                    var = agree_sore_yout
                    max = var:FRA.seat_sore_yout
                    min = 0
                }
                clamp_variable = {
                    var = agree_indent
                    max = var:FRA.seat_indenpent
                    min = 0
                }
                set_variable = {
                    FRA_vote_agree = 0
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_synd_trav
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_synd_radi
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_anar_parl
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_anar_anar
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_jaco_neos
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_jaco_leni
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_sore_oldl
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_sore_yout
                }
                add_to_variable = {
                    FRA_vote_agree = var:FRA.agree_indent
                }
            }
        }
    }
}