@ucr_small = 20
@ucr_big = 35

BLR_recalc_parliament_icon_frames = { ### Always use this after adding value to the variable, updates the GFX 
	
	set_temp_variable = { parliament_temp = blr_parliament_support } ### Assigns the currrent parliament support to a temporary variable
	divide_temp_variable = { parliament_temp = blr_parliament_total } ### Divides the current support by the max value
	multiply_temp_variable = { parliament_temp = 10 } ### Set it to 10, 1 less than the max because the first frame of the GFX has 0 green seats
	add_to_temp_variable = { parliament_temp = 1 } ### Adding 1 to the variable in order to make all frames accessable
	if = {
		limit = { check_variable = { parliament_temp > 0 } }
		clamp_temp_variable = {
			var = parliament_temp
			min = 1
			max = 11
		}
	}
	else = {
		set_temp_variable = { parliament_temp = 1 }
	}
	set_variable = { BLR_current_parliament_icon_frame = parliament_temp } ### Sets the current frame number to the one caluclated
}


BLR_parliament_support_add5 = { ### Use this when adding 1-5 support
	custom_effect_tooltip = BLR_parliament_support_add5_tt ### Custom tooltip
	set_temp_variable = { temp_factor = random } ### Generates a random value between 0 and 1
	multiply_temp_variable = { temp_factor = 6 } ### Multiplies the value by 5 to get a value between 0 and 10
	clamp_temp_variable = { var = temp_factor max = 6 min = 2 } ### Is used to cap the variable, currently set that it can be at most 5 and at least 1
	add_to_variable = { blr_parliament_support = temp_factor } ### Increases the support by the value generated
	round_variable = blr_parliament_support ### Rounds the support to the nearest int
	clamp_variable = { var = blr_parliament_support max = blr_parliament_total min = 0 } ### Clamps the support value so it can't exceed the maximum
	BLR_recalc_parliament_icon_frames = yes
}

BLR_parliament_support_add3 = { ### Use this when adding 6-10 support
    custom_effect_tooltip = BLR_parliament_support_add3_tt ### Custom tooltip
    set_temp_variable = { temp_factor = random } ### Generates a random value between 0 and 1
    multiply_temp_variable = { temp_factor = 3 } ### Multiplies the value by 10 to get a value between 0 and 10
    clamp_temp_variable = { var = temp_factor max = 3 min = 1 } ### Is used to cap the variable, currently set that it can be at most 10 and at least 1
    add_to_variable = { blr_parliament_support  = temp_factor } ### Increases the support by the value generated
    round_variable = blr_parliament_support ### Rounds the support to the nearest int
    clamp_variable = { var = blr_parliament_support max = blr_parliament_total min = 0 } ### Clamps the support value so it can't exceed the maximum
    BLR_recalc_parliament_icon_frames = yes
}

BLR_parliament_small_opposition = {
	custom_effect_tooltip = blr_parliament_small_opposition_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = -5 }
	add_to_variable = { blr_parliament_support = temp_factor }
	round_variable = blr_parliament_support
	clamp_variable = { var = blr_parliament_support max = blr_parliament_total min = 0 }
	BLR_recalc_parliament_icon_frames = yes
}

BLR_parliament_big_opposition = {
	custom_effect_tooltip = blr_parliament_big_opposition_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = -10 }
	clamp_temp_variable = { var = temp_factor max = -5 min = -10 }
	add_to_variable = { blr_parliament_support = temp_factor }
	round_variable = blr_parliament_support
	clamp_variable = { var = blr_parliament_support max = blr_parliament_total min = 0 }
	BLR_recalc_parliament_icon_frames = yes
}

BLR_parliament_small_support = {
	custom_effect_tooltip = blr_parliament_small_support_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = 5 }
	add_to_variable = { blr_parliament_support = temp_factor }
	round_variable = blr_parliament_support
	clamp_variable = { var = blr_parliament_support max = blr_parliament_total min = 0 }
	BLR_recalc_parliament_icon_frames = yes
}



	