############## вече ага
#вплюс
zsl_veche_small_support = {
	custom_effect_tooltip = zsl_veche_small_support_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = 5 }
	add_to_variable = { zsl_veche_support = temp_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes
}

zsl_veche_medium_support = {
	custom_effect_tooltip = zsl_veche_medium_support_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = 10 }
	clamp_temp_variable = { var = temp_factor max = 10 min = 5 }
	add_to_variable = { zsl_veche_support = temp_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes
}

zsl_veche_large_support = {
	custom_effect_tooltip = zsl_veche_large_support_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = 30 }
	clamp_temp_variable = { var = temp_factor max = 30 min = 15 }
	add_to_variable = { zsl_veche_support = temp_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes
}

#опозишн

zsl_veche_small_opposition = {
	custom_effect_tooltip = zsl_veche_small_opposition_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = -4 }
	add_to_variable = { zsl_veche_support = temp_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes
}

zsl_veche_medium_opposition = {
	custom_effect_tooltip = zsl_veche_medium_opposition_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = -8 }
	clamp_temp_variable = { var = temp_factor max = -3 min = -8 }
	add_to_variable = { zsl_veche_support = temp_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes
}

zsl_veche_large_opposition = {
	custom_effect_tooltip = zsl_veche_large_opposition_tt
	set_temp_variable = { temp_factor = random }
	multiply_temp_variable = { temp_factor = -25 }
	clamp_temp_variable = { var = temp_factor max = -10 min = -25 }
	add_to_variable = { zsl_veche_support = temp_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes
}

####
zsl_veche_election_senate = {
	custom_effect_tooltip = zsl_veche_election_senate_tt
	set_temp_variable = { temp_1vibory_factor = random }
	multiply_temp_variable = { temp_1vibory_factor = 8 }
	clamp_temp_variable = { var = temp_1vibory_factor max = 16 min = 8 }
	set_temp_variable = { temp_2vibory_factor = random }
	multiply_temp_variable = { temp_2vibory_factor = 5 }
	clamp_temp_variable = { var = temp_2vibory_factor max = 10 min = 5 }
	add_to_temp_variable = { temp_1vibory_factor = temp_2vibory_factor }
	subtract_from_variable = { zsl_veche_support = temp_1vibory_factor }
	round_variable = zsl_veche_support
	clamp_variable = { var = zsl_veche_support max = 100 min = 0 }
	ZSL_recalc_veche_icon_frames = yes	
}



#рекалл
ZSL_recalc_veche_icon_frames = {	
	set_temp_variable = { zsl_vechetp_temp = zsl_veche_support }
	divide_temp_variable = { zsl_vechetp_temp = 100 }
	multiply_temp_variable = { zsl_vechetp_temp = 21 }
	if = {
		limit = { check_variable = { zsl_vechetp_temp > 0 } }
		clamp_temp_variable = {
			var = zsl_vechetp_temp
			min = 1
			max = 21
		}
	}
	else = {
		set_temp_variable = { zsl_vechetp_temp = 1 }
	}
	set_variable = { current_zsl_veche_icon_frame = zsl_vechetp_temp }	
}