#	Example:
#
#	example_effect = {
#		add_political_power = 66
#		add_popularity = {
#			ideology = fascism
#			popularity = 0.33
#		}
#	}
#
#
#	In a script file:
#
#	effect = {
#		example_effect = yes
#	}
#

CPG_constitution_recalc = {
    add_to_variable = {
        cpg_approval = cpg_representation
    }
    set_temp_variable = {
        cpg_representation_temp = cpg_representation
    }
    set_temp_variable = {
        cpg_approval_temp = cpg_approval
    }
    set_temp_variable = {
        cpg_logistics_temp = cpg_logistics
    }
    set_temp_variable = {
        cpg_taxation_temp = cpg_taxation
    }
    divide_temp_variable = {
        cpg_logistics_temp = 10
    }
    add_to_temp_variable = {
        cpg_approval_temp = cpg_logistics_temp
    }
    subtract_from_temp_variable = {
        cpg_approval_temp = cpg_taxation
    }
    divide_variable = {
        cpg_approval_temp = 100
    }
    divide_temp_variable = {
        cpg_representation_temp = 100
    }
    set_temp_variable = {
        cpg_representation_mod = cpg_representation_temp
    }
    set_variable = {
        cpg_approval_mod = cpg_approval_temp
    }
    divide_variable = {
        cpg_logistics_temp = 100
    }
    set_variable = {
        cpg_logistics_mod = cpg_logistics_temp
    }
    divide_variable = {
        cpg_taxation_temp = 100
    }
    set_variable = {
        cpg_taxation_mod = cpg_taxation_temp
    }
    clamp_variable = {
        var = cpg_approval_mod
        min = 0
        max = 1
    }
}

CPG_massacre = {
	CPG = {
		set_country_flag = CPG_massacre_true
		if = {
			limit = {
				has_power_balance = {
					id = CPG_institute_threat
				}
			}
			remove_power_balance = {
				id = CPG_institute_threat
			}
		}
		kill_country_leader = yes
		promote_character = CPG_Hollis
		set_cosmetic_tag = CPG_MNM
		set_capital = { state = 1933 }
	}
    add_victory_points = {
        province = 19192
        value = 10
    }
    NCW = {
        set_country_flag = is_raider_nation
        set_politics = {
            ruling_party = ruler
            elections_allowed = no
        }
    }
    1934 = {
        transfer_state_to = GDN
        add_core_of = GDN
    }
    GDN = {
        load_oob = "GDN_startup"
    }
    1935 = {
        transfer_state_to = INS
        add_core_of = INS
    }
    INS = {
        load_oob = "INS_startup"
        puppet = FST
    }
    1937 = {
        transfer_state_to = DIA
        add_core_of = DIA
    }
    DIA = {
        load_oob = "DIA_startup"
    }
    1929 = {
        transfer_state_to = GNR
        add_core_of = GNR
    }
	1930 = {
		transfer_state_to = GNR
		add_core_of = GNR
	}
	if = {
		limit = {
			1926 = {
				is_owned_by = CPG
			}
		}
		1926 = {
			transfer_state_to = GNR
			add_core_of = GNR
		}
	}
	if = {
		limit = {
			1925 = {
				is_owned_by = CPG
			}
		}
		1925 = {
			transfer_state_to = GNR
			add_core_of = GNR
		}
	}
    GNR = {
        load_oob = "GNR_startup"
    }
    CPG_Clint = {
        set_nationality = GNR
    }
	CPG = {
		release = FST
		release = NCW
		release = RIL
		release = WHM
		release = CCA
	}
}