﻿
DC_select_interstgroup_no_arguments_effect = {
	if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_armed_forces
		}
		$effect$ = {
			group = ig_armed_forces
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_devout
		}
		$effect$ = {
			group = ig_devout
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_industrialists
		}
		$effect$ = {
			group = ig_industrialists
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_intelligentsia
		}
		$effect$ = {
			group = ig_intelligentsia
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_landowners
		}
		$effect$ = {
			group = ig_landowners
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_petty_bourgeoisie
		}
		$effect$ = {
			group = ig_petty_bourgeoisie
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_rural_folk
		}
		$effect$ = {
			group = ig_rural_folk
		}
	}
	else_if = {
		limit = {
			has_variable = DC_MarkInterstGroup_ig_trade_unions
		}
		$effect$ = {
			group = ig_trade_unions
		}
	}
}


# Warning: while loop with no specified max aborted after executing 1000 times
Calculation_while_loop = {
	set_local_variable = {
		name = temp_loop_var
		value = 0
	}
	while = { # 10000 ~ 10000*1000
		limit = {
			$trigger$ > { value = local_var:temp_loop_var add = 10000 }
		}
		change_local_variable = {
			name = temp_loop_var
			add = 10000
		}
	}
	while = { # 1000 ~ 1000*1000
		limit = {
			$trigger$ > { value = local_var:temp_loop_var add = 1000 }
		}
		change_local_variable = {
			name = temp_loop_var
			add = 1000
		}
	}
	while = { # 1 ~ 1000
		limit = {
			$trigger$ > local_var:temp_loop_var
		}
		change_local_variable = {
			name = temp_loop_var
			add = 1
		}
	}
	set_variable = {
		name = $var$
		value = local_var:temp_loop_var
	}
}








