﻿do_relocation_math = {
	set_variable = { name = indian_states_pop_total value = 0 }
	set_variable = { name = indian_states_radicals_total value = 0 }
	every_scope_state = {
		limit = {
			#state_region = {
				OR = {
					region = sr:region_north_india
		    		region = sr:region_south_india
				}
			#}
		}
		set_variable = { name = indian_state_pop_radicals value = this.turmoil }
		change_variable = { name = indian_state_pop_radicals multiply = this.state_population }
		ROOT = {
			change_variable = { name = indian_states_pop_total add = prev.state_population }
			change_variable = { name = indian_states_radicals_total add = prev.var:indian_state_pop_radicals }
		}
	}
	set_variable = { name = indian_states_radicals_total_bar value = var:indian_states_radicals_total }
	change_variable = { name = indian_states_radicals_total_bar divide = var:indian_states_pop_total }
	change_variable = { name = indian_states_radicals_total_bar multiply = 100 }
}

do_sepoy_math = {
	set_variable = { name = indian_states_pop_total value = 0 }
	set_variable = { name = indian_states_radicals_total value = 0 }
	every_scope_state = {
		limit = {
			#state_region = {
				OR = {
					region = sr:region_north_india
		    		region = sr:region_south_india
				}
			#}
		}
		set_variable = { name = indian_state_pop_radicals value = this.turmoil }
		change_variable = { name = indian_state_pop_radicals multiply = this.state_population }
		ROOT = {
			change_variable = { name = indian_states_pop_total add = prev.state_population }
			change_variable = { name = indian_states_radicals_total add = prev.var:indian_state_pop_radicals }
		}
	}
	set_variable = { name = indian_states_radicals_total_bar value = var:indian_states_radicals_total }
	change_variable = { name = indian_states_radicals_total_bar divide = var:indian_states_pop_total }
	change_variable = { name = indian_states_radicals_total_bar multiply = 100 }
}
