rq_vs_wk = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_k^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_k^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_k index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_k^num } }
add_to_array = { array = rq_vs_k value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_k value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_k value = rq_vs_v } }
}
rq_vs_wg = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_g^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_g^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_g index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_g^num } }
add_to_array = { array = rq_vs_g value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_g value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_g value = rq_vs_v } }
}
rq_vs_wl = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_l^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_l^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_l index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_l^num } }
add_to_array = { array = rq_vs_l value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_l value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_l value = rq_vs_v } }
}
rq_vs_wb = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_b^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_b^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_b index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_b^num } }
add_to_array = { array = rq_vs_b value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_b value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_b value = rq_vs_v } }
}
rq_vs_wc = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_c^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_c^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_c index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_c^num } }
add_to_array = { array = rq_vs_c value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_c value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_c value = rq_vs_v } }
}
rq_vs_wt = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_t^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_t^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_t index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_t^num } }
add_to_array = { array = rq_vs_t value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_t value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_t value = rq_vs_v } }
}
rq_vs_wj = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_j^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_j^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_j index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_j^num } }
add_to_array = { array = rq_vs_j value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_j value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_j value = rq_vs_v } }
}
rq_vs_wy = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_y^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_y^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_y index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_y^num } }
add_to_array = { array = rq_vs_y value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_y value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_y value = rq_vs_v } }
}
rq_vs_wm = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_m^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_m^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_m index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_m^num } }
add_to_array = { array = rq_vs_m value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_m value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_m value = rq_vs_v } }
}
rq_vs_ws = {
if = {
limit = { check_variable = { rq_vs_w < rq_vs_s^num } }
if = {
limit = { NOT = { check_variable = { rq_vs_s^rq_vs_w = rq_vs_v } } }
remove_from_array = { array = rq_vs_s index = rq_vs_w }
if = {
limit = { check_variable = { rq_vs_w < rq_vs_s^num } }
add_to_array = { array = rq_vs_s value = rq_vs_v index = rq_vs_w }
}
else = { add_to_array = { array = rq_vs_s value = rq_vs_v } }
}
}
else = { add_to_array = { array = rq_vs_s value = rq_vs_v } }
}
rq_vs_place = {
set_temp_variable = { rq_vs_w = -1 }
set_temp_variable = { rq_vs_g0 = 1 }
if = {
limit = { check_variable = { rq_vs_e > -1 } }
set_temp_variable = { rq_vs_w = rq_vs_e }
set_temp_variable = { rq_vs_g0 = 0 }
set_temp_variable = { rq_vs_e = -1 }
set_variable = { rq_vs_sel = 0 }
}
else = {
for_each_loop = {
array = rq_vs_fr
value = rq_vs_fv
if = {
limit = { check_variable = { rq_vs_w < 0 } check_variable = { rq_vs_k^rq_vs_fv = 0 } }
set_temp_variable = { rq_vs_w = rq_vs_fv }
set_temp_variable = { rq_vs_g0 = 0 }
}
}
}
set_temp_variable = { rq_vs_i = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_w < 0 } check_variable = { rq_vs_i < rq_vs_n } }
if = {
limit = { check_variable = { rq_vs_k^rq_vs_i = 0 } NOT = { check_variable = { rq_vs_i = rq_vs_e } } }
set_temp_variable = { rq_vs_w = rq_vs_i }
}
add_to_temp_variable = { rq_vs_i = 1 }
}
if = {
limit = { check_variable = { rq_vs_w > -1 } }
rq_vs_wk = yes
set_temp_variable = { rq_vs_v = rq_vs_g0 }
rq_vs_wg = yes
}
}
rq_vs_guess = {
set_temp_variable = { rq_vs_w = -1 }
set_temp_variable = { rq_vs_i = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_w < 0 } check_variable = { rq_vs_i < rq_vs_n } }
if = {
limit = { check_variable = { rq_vs_k^rq_vs_i = 0 } NOT = { check_variable = { rq_vs_i = rq_vs_e } } }
set_temp_variable = { rq_vs_w = rq_vs_i }
}
add_to_temp_variable = { rq_vs_i = 1 }
}
if = {
limit = { check_variable = { rq_vs_w < 0 } check_variable = { rq_vs_e > -1 } }
set_temp_variable = { rq_vs_w = rq_vs_e }
set_temp_variable = { rq_vs_e = -1 }
set_variable = { rq_vs_sel = 0 }
}
if = {
limit = { check_variable = { rq_vs_w > -1 } }
rq_vs_wk = yes
set_temp_variable = { rq_vs_v = 1 }
rq_vs_wg = yes
}
}
rq_vs_data = {
set_temp_variable = { rq_vs_q = -1 }
set_temp_variable = { rq_vs_j0 = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_q < 0 } check_variable = { rq_vs_j0 < rq_queue^num } }
if = {
limit = { check_variable = { rq_queue^rq_vs_j0 = rq_vs_l0 } }
set_temp_variable = { rq_vs_q = rq_vs_j0 }
}
add_to_temp_variable = { rq_vs_j0 = 1 }
}
if = {
limit = { check_variable = { rq_vs_q > -1 } }
set_temp_variable = { rq_t = rq_vs_l0 }
set_temp_variable = { rq_mq = rq_qmio^rq_vs_q }
set_temp_variable = { rq_vs_mq = rq_mq }
rq_compute_cost = yes
set_temp_variable = { rq_p = rq_qprog^rq_vs_q }
set_temp_variable = { rq_vs_bw = rq_p }
divide_temp_variable = { rq_vs_bw = rq_base_cost }
clamp_temp_variable = { var = rq_vs_bw min = 0 max = 1 }
multiply_temp_variable = { rq_vs_bw = rq_d_vsb }
round_temp_variable = rq_vs_bw
set_temp_variable = { rq_vs_yr = rq_start_months }
divide_temp_variable = { rq_vs_yr = 12 }
subtract_from_temp_variable = { rq_vs_yr = 0.4999 }
round_temp_variable = rq_vs_yr
set_temp_variable = { rq_mb = 0 }
if = {
limit = { check_variable = { rq_vs_mq > 0 } }
rq_mio_bonus = yes
}
set_temp_variable = { rq_r = rq_base_cost }
subtract_from_temp_variable = { rq_r = rq_p }
rq_tech_speed = yes
set_temp_variable = { rq_spd = rq_tspd }
add_to_temp_variable = { rq_spd = rq_mb }
set_temp_variable = { rq_vs_age = global.num_days }
subtract_from_temp_variable = { rq_vs_age = rq_vsc_d^rq_vs_i }
if = {
limit = {
check_variable = { rq_vsc_t^rq_vs_i = rq_vs_l0 }
check_variable = { rq_vsc_s^rq_vs_i = rq_spd }
check_variable = { rq_vs_age > -1 }
check_variable = { rq_vs_age < 7 }
}
set_temp_variable = { rq_x = rq_vsc_x^rq_vs_i }
subtract_from_temp_variable = { rq_x = rq_vs_age }
clamp_temp_variable = { var = rq_x min = 1 }
}
else = {
set_temp_variable = { rq_vdl = 0 }
rq_days_left = yes
add_to_temp_variable = { rq_x = 0.499 }
round_temp_variable = rq_x
clamp_temp_variable = { var = rq_x min = 1 }
set_temp_variable = { rq_vs_cw = rq_vs_l0 }
remove_from_array = { array = rq_vsc_t index = rq_vs_i }
if = { limit = { check_variable = { rq_vs_i < rq_vsc_t^num } } add_to_array = { array = rq_vsc_t value = rq_vs_cw index = rq_vs_i } }
else = { add_to_array = { array = rq_vsc_t value = rq_vs_cw } }
set_temp_variable = { rq_vs_cw = rq_spd }
remove_from_array = { array = rq_vsc_s index = rq_vs_i }
if = { limit = { check_variable = { rq_vs_i < rq_vsc_s^num } } add_to_array = { array = rq_vsc_s value = rq_vs_cw index = rq_vs_i } }
else = { add_to_array = { array = rq_vsc_s value = rq_vs_cw } }
set_temp_variable = { rq_vs_cw = global.num_days }
remove_from_array = { array = rq_vsc_d index = rq_vs_i }
if = { limit = { check_variable = { rq_vs_i < rq_vsc_d^num } } add_to_array = { array = rq_vsc_d value = rq_vs_cw index = rq_vs_i } }
else = { add_to_array = { array = rq_vsc_d value = rq_vs_cw } }
remove_from_array = { array = rq_vsc_x index = rq_vs_i }
if = { limit = { check_variable = { rq_vs_i < rq_vsc_x^num } } add_to_array = { array = rq_vsc_x value = rq_x index = rq_vs_i } }
else = { add_to_array = { array = rq_vsc_x value = rq_x } }
}
set_temp_variable = { rq_vs_jg = 0 }
set_temp_variable = { rq_vs_j0 = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_jg = 0 } check_variable = { rq_vs_j0 < rq_jga^num } }
if = {
limit = { check_variable = { rq_jga^rq_vs_j0 = rq_vs_l0 } }
set_temp_variable = { rq_vs_jg = 1 }
set_temp_variable = { rq_x = rq_jgx^rq_vs_j0 }
}
add_to_temp_variable = { rq_vs_j0 = 1 }
}
set_temp_variable = { rq_vs_w = rq_vs_l0 }
set_temp_variable = { rq_vs_v = rq_vs_bw }
rq_vs_wb = yes
subtract_from_temp_variable = { rq_vs_v = rq_d_vsb }
rq_vs_wc = yes
set_temp_variable = { rq_vs_v = rq_x }
rq_vs_wt = yes
set_temp_variable = { rq_vs_v = rq_vs_jg }
rq_vs_wj = yes
set_temp_variable = { rq_vs_v = rq_vs_yr }
rq_vs_wy = yes
set_temp_variable = { rq_vs_v = rq_vs_mq }
rq_vs_wm = yes
set_temp_variable = { rq_vs_v = rq_vs_i }
add_to_temp_variable = { rq_vs_v = 1 }
rq_vs_ws = yes
}
}
rq_vs_toggle = {
set_variable = { rq_vs_sel = 0 }
if = {
limit = { has_country_flag = rq_sov }
clr_country_flag = rq_sov
}
else = {
set_country_flag = rq_sov
rq_update = yes
}
}
rq_vs_fix = {
if = {
limit = { check_variable = { rq_vs_w > -1 } check_variable = { rq_vs_w < rq_vs_k^num } check_variable = { rq_vs_k^rq_vs_w = 0 } }
set_temp_variable = { rq_vs_f = -1 }
set_temp_variable = { rq_vs_i = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_i < rq_vs_g^num } }
if = {
limit = { check_variable = { rq_vs_g^rq_vs_i = 1 } }
set_temp_variable = { rq_vs_f = rq_vs_i }
}
add_to_temp_variable = { rq_vs_i = 1 }
}
if = {
limit = { check_variable = { rq_vs_f > -1 } }
set_temp_variable = { rq_vs_v = rq_vs_k^rq_vs_f }
rq_vs_wk = yes
set_temp_variable = { rq_vs_v = 0 }
rq_vs_wg = yes
set_temp_variable = { rq_vs_w = rq_vs_f }
rq_vs_wk = yes
rq_vs_wg = yes
}
}
}
rq_sov_toggle = {
rq_vs_toggle = yes
}
rq_vs_track = {
set_temp_variable = { rq_vs_n = rq_slots }
clamp_temp_variable = { var = rq_vs_n min = 0 max = 99 }
clear_temp_array = rq_vs_ok
clear_temp_array = rq_vs_og
clear_temp_array = rq_vs_ol
for_each_loop = { array = rq_vs_k value = rq_vs_av add_to_temp_array = { rq_vs_ok = rq_vs_av } }
for_each_loop = { array = rq_vs_g value = rq_vs_av add_to_temp_array = { rq_vs_og = rq_vs_av } }
for_each_loop = { array = rq_vs_l value = rq_vs_av add_to_temp_array = { rq_vs_ol = rq_vs_av } }
clear_array = rq_vs_k
clear_array = rq_vs_g
clear_array = rq_vs_l
clear_temp_array = rq_vs_fr
set_temp_variable = { rq_vs_i = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_i < rq_vs_n } }
set_temp_variable = { rq_vs_x = 0 }
set_temp_variable = { rq_vs_g0 = 0 }
set_temp_variable = { rq_vs_l0 = 0 }
if = {
limit = { check_variable = { rq_vs_i < rq_vs_ok^num } check_variable = { rq_vs_i < rq_vs_og^num } check_variable = { rq_vs_i < rq_vs_ol^num } }
set_temp_variable = { rq_vs_x = rq_vs_ok^rq_vs_i }
set_temp_variable = { rq_vs_g0 = rq_vs_og^rq_vs_i }
set_temp_variable = { rq_vs_l0 = rq_vs_ol^rq_vs_i }
}
if = {
limit = { check_variable = { rq_vs_x > 0 } NOT = { is_in_array = { array = rq_vanilla value = rq_vs_x } } }
set_temp_variable = { rq_vs_x = 0 }
set_temp_variable = { rq_vs_g0 = 0 }
add_to_temp_array = { rq_vs_fr = rq_vs_i }
}
add_to_array = { rq_vs_k = rq_vs_x }
add_to_array = { rq_vs_g = rq_vs_g0 }
add_to_array = { rq_vs_l = rq_vs_l0 }
add_to_temp_variable = { rq_vs_i = 1 }
}
set_temp_variable = { rq_vs_e = rq_vs_sel }
subtract_from_temp_variable = { rq_vs_e = 1 }
if = {
limit = { NOT = { check_variable = { rq_vs_e < rq_vs_n } } }
set_temp_variable = { rq_vs_e = -1 }
set_variable = { rq_vs_sel = 0 }
}
for_each_loop = {
array = rq_vanilla
value = rq_vs_av
if = {
limit = { NOT = { is_in_array = { array = rq_vs_k value = rq_vs_av } } }
set_temp_variable = { rq_vs_v = rq_vs_av }
rq_vs_place = yes
}
}
for_each_loop = {
array = rq_vanilla
value = rq_vs_av
if = {
limit = { NOT = { is_in_array = { array = rq_vs_k value = rq_vs_av } } }
set_temp_variable = { rq_vs_v = rq_vs_av }
rq_vs_guess = yes
}
}
if = {
limit = { check_variable = { rq_vs_sel > 0 } NOT = { check_variable = { rq_vs_seld = global.num_days } } }
set_temp_variable = { rq_vs_e = -1 }
set_variable = { rq_vs_sel = 0 }
}
}
rq_sov_sync = {
if = {
limit = { check_variable = { rq_vs_b^num < rq_d_vssz } }
set_temp_variable = { rq_vs_nb = rq_d_vsb }
multiply_temp_variable = { rq_vs_nb = -1 }
resize_array = { array = rq_vs_b value = 0 size = rq_d_vssz }
resize_array = { array = rq_vs_c value = rq_vs_nb size = rq_d_vssz }
resize_array = { array = rq_vs_t value = 0 size = rq_d_vssz }
resize_array = { array = rq_vs_j value = 0 size = rq_d_vssz }
resize_array = { array = rq_vs_y value = 0 size = rq_d_vssz }
resize_array = { array = rq_vs_m value = 0 size = rq_d_vssz }
resize_array = { array = rq_vs_s value = 0 size = rq_d_vssz }
}
while_loop_effect = {
limit = { check_variable = { rq_vsc_t^num < rq_vs_n } }
add_to_array = { rq_vsc_t = 0 }
add_to_array = { rq_vsc_s = 0 }
add_to_array = { rq_vsc_d = 0 }
add_to_array = { rq_vsc_x = 0 }
}
set_temp_variable = { rq_vs_kept = 0 }
if = {
limit = { check_variable = { rq_vs_e > -1 } check_variable = { rq_vs_e < rq_vs_l^num } }
set_temp_variable = { rq_vs_kept = rq_vs_l^rq_vs_e }
if = {
limit = { NOT = { is_in_array = { array = rq_active value = rq_vs_kept } } }
set_temp_variable = { rq_vs_kept = 0 }
}
}
clear_array = rq_vs_l
set_temp_variable = { rq_vs_i = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_i < rq_vs_n } }
add_to_array = { rq_vs_l = 0 }
add_to_temp_variable = { rq_vs_i = 1 }
}
if = {
limit = { check_variable = { rq_vs_kept > 0 } }
set_temp_variable = { rq_vs_w = rq_vs_e }
set_temp_variable = { rq_vs_v = rq_vs_kept }
rq_vs_wl = yes
}
set_temp_variable = { rq_vs_i = 0 }
for_each_loop = {
array = rq_active
value = rq_vs_av
if = {
limit = { NOT = { check_variable = { rq_vs_av = rq_vs_kept } } }
set_temp_variable = { rq_t = rq_vs_av }
rq_check_owned = yes
if = {
limit = { check_variable = { rq_owned = 0 } }
while_loop_effect = {
limit = {
check_variable = { rq_vs_i < rq_vs_n }
OR = {
check_variable = { rq_vs_k^rq_vs_i > 0 }
check_variable = { rq_vs_i = rq_vs_e }
}
}
add_to_temp_variable = { rq_vs_i = 1 }
}
if = {
limit = { check_variable = { rq_vs_i < rq_vs_n } }
set_temp_variable = { rq_vs_w = rq_vs_i }
set_temp_variable = { rq_vs_v = rq_vs_av }
rq_vs_wl = yes
add_to_temp_variable = { rq_vs_i = 1 }
}
}
}
}
clear_array = rq_vs_d
clear_array = rq_vs_d2
set_temp_variable = { rq_vs_i = 0 }
while_loop_effect = {
limit = { check_variable = { rq_vs_i < rq_vs_n } }
set_temp_variable = { rq_vs_l0 = rq_vs_l^rq_vs_i }
if = {
limit = { check_variable = { rq_vs_k^rq_vs_i > 0 } }
add_to_array = { rq_vs_d = rq_d_vsv }
}
else_if = {
limit = { check_variable = { rq_vs_i = rq_vs_e } }
add_to_array = { rq_vs_d = rq_d_vss }
if = {
limit = { check_variable = { rq_vs_l0 > 0 } }
rq_vs_data = yes
while_loop_effect = {
limit = { check_variable = { rq_vs_d2^num < rq_vs_i } }
add_to_array = { rq_vs_d2 = 0 }
}
add_to_array = { rq_vs_d2 = rq_vs_l0 }
}
}
else_if = {
limit = { check_variable = { rq_vs_l0 > 0 } }
add_to_array = { rq_vs_d = rq_vs_l0 }
rq_vs_data = yes
}
else = {
set_temp_variable = { rq_vs_x = rq_vs_i }
add_to_temp_variable = { rq_vs_x = rq_d_vse }
add_to_array = { rq_vs_d = rq_vs_x }
}
add_to_temp_variable = { rq_vs_i = 1 }
}
}
