rq_bn_add = {
add_to_array = { rq_bnk = rq_nb_k }
add_to_array = { rq_bnv = rq_nb_v }
add_to_array = { rq_bna = rq_nb_a }
add_to_array = { rq_bnu = rq_nb_u }
add_to_array = { rq_bnq = 0 }
set_temp_variable = { rq_bn_for = -1 }
}
rq_bn_pass = {
if = {
limit = { NOT = { is_in_array = { array = rq_vanilla value = rq_t } } }
set_temp_variable = { rq_ps_t = rq_t }
set_temp_variable = { rq_ps_k = -1 }
rq_bn_at_find = yes
if = {
limit = { check_variable = { rq_ati > -1 } }
set_temp_variable = { rq_bn_real = 1 }
rq_bn_tkinds = yes
set_temp_variable = { rq_ps_v = rq_atv^rq_ati }
set_temp_variable = { rq_ps_a = rq_ata^rq_ati }
set_temp_variable = { rq_ps_i = -1 }
for_each_loop = {
array = rq_bnk
value = psv
index = psi
if = {
limit = {
check_variable = { rq_ps_i < 0 }
is_in_array = { array = rq_tk value = psv }
check_variable = { rq_bnv^psi = rq_ps_v }
check_variable = { rq_bna^psi = rq_ps_a }
check_variable = { rq_bnq^psi > 0 }
}
set_temp_variable = { rq_ps_i = psi }
set_temp_variable = { rq_ps_k = psv }
}
}
if = {
limit = { check_variable = { rq_ps_i > -1 } }
set_temp_variable = { rq_bu = rq_bnq^rq_ps_i }
subtract_from_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnq index = rq_ps_i }
if = { limit = { check_variable = { rq_ps_i < rq_bnq^num } } add_to_array = { array = rq_bnq value = rq_bu index = rq_ps_i } }
else = { add_to_array = { array = rq_bnq value = rq_bu } }
set_temp_variable = { rq_bu = rq_bnu^rq_ps_i }
add_to_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnu index = rq_ps_i }
if = { limit = { check_variable = { rq_ps_i < rq_bnu^num } } add_to_array = { array = rq_bnu value = rq_bu index = rq_ps_i } }
else = { add_to_array = { array = rq_bnu value = rq_bu } }
}
remove_from_array = { array = rq_atk index = rq_ati }
remove_from_array = { array = rq_atv index = rq_ati }
remove_from_array = { array = rq_ata index = rq_ati }
set_temp_variable = { rq_ag_i = -1 }
for_each_loop = {
array = rq_agk
value = agv
index = agi
if = {
limit = { check_variable = { agv = rq_ps_t } }
set_temp_variable = { rq_ag_i = agi }
}
}
if = {
limit = { check_variable = { rq_ag_i > -1 } }
set_temp_variable = { rq_t = rq_ps_t }
rq_q_find = yes
if = {
limit = { check_variable = { rq_qi > -1 } }
set_temp_variable = { rq_val = rq_qprog^rq_qi }
subtract_from_temp_variable = { rq_val = rq_agp^rq_ag_i }
clamp_temp_variable = { var = rq_val min = 0 }
rq_set_prog = yes
}
remove_from_array = { array = rq_agk index = rq_ag_i }
remove_from_array = { array = rq_agp index = rq_ag_i }
}
}
else = {
set_temp_variable = { rq_bn_real = 0 }
rq_bn_pick = yes
if = {
limit = { check_variable = { rq_bpi > -1 } }
set_temp_variable = { rq_ps_k = rq_bnk^rq_bpi }
}
}
set_temp_variable = { rq_t = rq_ps_t }
if = {
limit = { check_variable = { rq_ps_k > -1 } }
rq_q_find = yes
set_temp_variable = { rq_ps_q = rq_qi }
clear_temp_array = rq_ps_rm
set_temp_variable = { rq_bn_real = 1 }
for_each_loop = {
array = rq_bn_skip
value = psv
set_temp_variable = { rq_t = psv }
rq_q_find = yes
if = {
limit = { check_variable = { rq_qi > rq_ps_q } }
rq_bn_tkinds = yes
if = {
limit = { is_in_array = { array = rq_tk value = rq_ps_k } }
add_to_temp_array = { rq_ps_rm = psv }
}
}
}
for_each_loop = {
array = rq_ps_rm
value = psv
remove_from_array = { array = rq_bn_skip value = psv }
}
set_temp_variable = { rq_t = rq_ps_t }
if = {
limit = { NOT = { is_in_array = { array = rq_bn_skip value = rq_t } } }
add_to_array = { rq_bn_skip = rq_t }
}
}
set_temp_variable = { rq_bn_real = 0 }
set_temp_variable = { rq_bn_for = -1 }
set_variable = { rq_rfull = 1 }
rq_update = yes
}
}
rq_lim_build = {
set_temp_variable = { rq_ag_i = -1 }
for_each_loop = {
array = rq_agk
value = agv
index = agi
if = {
limit = { NOT = { is_in_array = { array = rq_atk value = agv } } }
set_temp_variable = { rq_ag_i = agi }
}
}
if = {
limit = { check_variable = { rq_ag_i > -1 } }
remove_from_array = { array = rq_agk index = rq_ag_i }
remove_from_array = { array = rq_agp index = rq_ag_i }
}
set_variable = { rq_lim_n = 0 }
clear_array = rq_lim_k
clear_array = rq_lim_u
clear_array = rq_lim_v
clear_array = rq_lim_a
for_each_loop = {
array = rq_bnk
value = lv
index = li
if = {
limit = { check_variable = { rq_bnu^li > 0 } }
add_to_variable = { rq_lim_n = rq_bnu^li }
add_to_array = { rq_lim_k = lv }
add_to_array = { rq_lim_u = rq_bnu^li }
add_to_array = { rq_lim_v = rq_bnv^li }
add_to_array = { rq_lim_a = rq_bna^li }
}
}
}
rq_bnx_build = {
set_temp_variable = { rq_xs = rq_bnk^num }
multiply_temp_variable = { rq_xs = 100 }
for_each_loop = {
array = rq_bnu
value = xv
index = xi
set_temp_variable = { rq_xw = xi }
add_to_temp_variable = { rq_xw = 1 }
multiply_temp_variable = { rq_xw = xv }
add_to_temp_variable = { rq_xs = rq_xw }
}
for_each_loop = {
array = rq_bnq
value = xv
index = xi
set_temp_variable = { rq_xw = xi }
add_to_temp_variable = { rq_xw = 1 }
multiply_temp_variable = { rq_xw = xv }
multiply_temp_variable = { rq_xw = 7 }
add_to_temp_variable = { rq_xs = rq_xw }
}
if = {
limit = { NOT = { check_variable = { rq_bnx_sig = rq_xs } } }
set_variable = { rq_bnx_sig = rq_xs }
set_temp_variable = { rq_xt0 = rq_t }
set_temp_variable = { rq_xk0 = rq_lbk }
clear_array = rq_bnx
clear_temp_array = rq_xc
for_each_loop = {
array = rq_bnk
value = xk
index = xi
if = {
limit = { check_variable = { rq_bnu^xi = 0 } check_variable = { rq_bnq^xi > 0 } }
set_temp_variable = { rq_lbk = xk }
rq_bnx_kt = yes
}
}
for_each_loop = {
array = rq_xc
value = xt
if = {
limit = { NOT = { is_in_array = { array = rq_bnx value = xt } } }
set_temp_variable = { rq_t = xt }
set_temp_variable = { rq_bn_real = 1 }
rq_bn_tkinds = yes
set_temp_variable = { rq_xg = -1 }
set_temp_variable = { rq_xr = -1 }
for_each_loop = {
array = rq_bnk
value = xk
index = xi
if = {
limit = { is_in_array = { array = rq_tk value = xk } }
set_temp_variable = { rq_xw = rq_bna^xi }
multiply_temp_variable = { rq_xw = 100 }
add_to_temp_variable = { rq_xw = rq_bnv^xi }
if = {
limit = { check_variable = { rq_bnu^xi > 0 } check_variable = { rq_xw > rq_xr } }
set_temp_variable = { rq_xr = rq_xw }
}
else_if = {
limit = { check_variable = { rq_bnu^xi = 0 } check_variable = { rq_bnq^xi > 0 } check_variable = { rq_xw > rq_xg } }
set_temp_variable = { rq_xg = rq_xw }
}
}
}
if = {
limit = { check_variable = { rq_xg > rq_xr } }
add_to_array = { rq_bnx = xt }
}
}
}
set_temp_variable = { rq_t = rq_xt0 }
set_temp_variable = { rq_lbk = rq_xk0 }
}
}
rq_ya_calc = {
if = {
limit = { check_variable = { rq_ya_for = rq_t } }
set_temp_variable = { rq_ya0 = rq_ya_c }
set_temp_variable = { rq_base_cost = rq_ya_bc }
set_temp_variable = { rq_start_months = rq_ya_sm }
}
else = {
rq_tech_data = yes
set_temp_variable = { rq_ya0 = rq_start_months }
divide_temp_variable = { rq_ya0 = 12 }
subtract_from_temp_variable = { rq_ya0 = rq_now_y }
set_temp_variable = { rq_domy = rq_now_doy }
divide_temp_variable = { rq_domy = 365 }
subtract_from_temp_variable = { rq_ya0 = rq_domy }
clamp_temp_variable = { var = rq_ya0 min = 0 }
set_temp_variable = { rq_ya_c = rq_ya0 }
set_temp_variable = { rq_ya_bc = rq_base_cost }
set_temp_variable = { rq_ya_sm = rq_start_months }
set_temp_variable = { rq_ya_for = rq_t }
}
}
rq_bn_pick = {
rq_bn_tkinds = yes
rq_ya_calc = yes
rq_tech_bonus = yes
set_temp_variable = { rq_bs = rq_speed_shown }
add_to_temp_variable = { rq_bs = rq_tb }
set_temp_variable = { rq_bpi = -1 }
set_temp_variable = { rq_lbv = 0 }
set_temp_variable = { rq_lba = 0 }
set_temp_variable = { rq_bh_any = 0 }
set_temp_variable = { rq_bbest = rq_ya0 }
multiply_temp_variable = { rq_bbest = rq_d_yaf }
add_to_temp_variable = { rq_bbest = 1 }
set_temp_variable = { rq_bsc = rq_bs }
divide_temp_variable = { rq_bsc = rq_bbest }
set_temp_variable = { rq_bbest = rq_bsc }
add_to_temp_variable = { rq_bbest = 0.0005 }
for_each_loop = {
array = rq_bnk
value = lb_v
index = lb_i
if = {
limit = {
is_in_array = { array = rq_tk value = lb_v }
OR = {
check_variable = { rq_bnu^lb_i > 0 }
AND = { check_variable = { rq_bn_real = 1 } check_variable = { rq_bnq^lb_i > 0 } }
}
}
set_temp_variable = { rq_bya = rq_ya0 }
subtract_from_temp_variable = { rq_bya = rq_bna^lb_i }
clamp_temp_variable = { var = rq_bya min = 0 }
multiply_temp_variable = { rq_bya = rq_d_yaf }
add_to_temp_variable = { rq_bya = 1 }
set_temp_variable = { rq_bsc = rq_bs }
add_to_temp_variable = { rq_bsc = rq_bnv^lb_i }
divide_temp_variable = { rq_bsc = rq_bya }
set_temp_variable = { rq_hold = 0 }
if = {
limit = { check_variable = { rq_bn_real = 0 } check_variable = { rq_bsc > rq_bbest } check_variable = { rq_ap_bnhf = 2 } }
set_temp_variable = { rq_h_bsc = rq_bsc }
rq_bn_hold = yes
set_temp_variable = { rq_bsc = rq_h_bsc }
if = {
limit = { check_variable = { rq_hold = 1 } }
set_temp_variable = { rq_bh_any = 1 }
set_temp_variable = { rq_bh_for = rq_h_for }
set_temp_variable = { rq_bh_v = rq_bnv^lb_i }
}
}
if = {
limit = { check_variable = { rq_bsc > rq_bbest } check_variable = { rq_hold = 0 } }
set_temp_variable = { rq_bbest = rq_bsc }
set_temp_variable = { rq_bpi = lb_i }
set_temp_variable = { rq_lbv = rq_bnv^lb_i }
set_temp_variable = { rq_lba = rq_bna^lb_i }
}
}
}
}
rq_bn_val = {
rq_bn_val_base = yes
rq_bn_val_tail = yes
}
rq_bn_val_base = {
rq_ya_calc = yes
rq_tech_bonus = yes
set_temp_variable = { rq_hs = rq_speed_shown }
add_to_temp_variable = { rq_hs = rq_tb }
clamp_temp_variable = { var = rq_hs min = rq_d_mins }
set_temp_variable = { rq_hx = rq_ya0 }
multiply_temp_variable = { rq_hx = rq_d_yaf }
add_to_temp_variable = { rq_hx = 1 }
divide_temp_variable = { rq_hx = rq_hs }
set_temp_variable = { rq_hw = rq_base_cost }
subtract_from_temp_variable = { rq_hw = rq_hp }
clamp_temp_variable = { var = rq_hw min = 0 }
}
rq_bn_val_tail = {
set_temp_variable = { rq_hy = rq_ya0 }
subtract_from_temp_variable = { rq_hy = rq_bna^rq_hb }
clamp_temp_variable = { var = rq_hy min = 0 }
multiply_temp_variable = { rq_hy = rq_d_yaf }
add_to_temp_variable = { rq_hy = 1 }
set_temp_variable = { rq_hs2 = rq_hs }
add_to_temp_variable = { rq_hs2 = rq_bnv^rq_hb }
divide_temp_variable = { rq_hy = rq_hs2 }
set_temp_variable = { rq_hv = rq_hx }
subtract_from_temp_variable = { rq_hv = rq_hy }
multiply_temp_variable = { rq_hv = rq_hw }
}
rq_bn_prep_do = {
if = {
limit = { check_variable = { rq_bpsel^num = 0 } }
clear_array = rq_tsv
clear_array = rq_tst
clear_array = rq_tsc
for_each_loop = {
array = rq_bnk
value = tsk
add_to_array = { rq_tsc = 0 }
set_temp_variable = { rq_tsx = 0 }
while_loop_effect = {
limit = { check_variable = { rq_tsx < 11 } }
add_to_array = { rq_tsv = 0 }
add_to_array = { rq_tst = 0 }
add_to_temp_variable = { rq_tsx = 1 }
}
}
}
else = {
for_each_loop = {
array = rq_bpsel
value = bsv
set_temp_variable = { rq_zi = bsv }
remove_from_array = { array = rq_tsc index = rq_zi }
if = { limit = { check_variable = { rq_zi < rq_tsc^num } } add_to_array = { array = rq_tsc value = 0 index = rq_zi } }
else = { add_to_array = { array = rq_tsc value = 0 } }
}
}
set_temp_variable = { rq_fany = 0 }
for_each_loop = {
array = rq_bnu
value = fu
break = rq_fany
if = {
limit = { check_variable = { fu > 0 } }
set_temp_variable = { rq_fany = 1 }
}
}
if = {
limit = { check_variable = { rq_fany = 1 } }
for_each_loop = {
array = rq_queue
value = hv
index = hi
if = {
limit = {
NOT = { is_in_array = { array = rq_vanilla value = hv } }
NOT = { is_in_array = { array = rq_atk value = hv } }
}
set_temp_variable = { rq_t = hv }
rq_bn_tkinds = yes
if = {
limit = { check_variable = { rq_tk^num > 0 } }
set_temp_variable = { rq_hp = rq_qprog^hi }
set_temp_variable = { rq_fbase = 0 }
for_each_loop = {
array = rq_bnk
value = fk
index = fi
if = {
limit = {
check_variable = { rq_bnu^fi > 0 }
is_in_array = { array = rq_tk value = fk }
OR = {
check_variable = { rq_bpsel^num = 0 }
is_in_array = { array = rq_bpsel value = fi }
}
}
if = {
limit = { check_variable = { rq_fbase = 0 } }
set_temp_variable = { rq_t = hv }
rq_bn_val_base = yes
set_temp_variable = { rq_fbase = 1 }
}
set_temp_variable = { rq_hb = fi }
rq_bn_val_tail = yes
set_temp_variable = { rq_ts0 = fi }
multiply_temp_variable = { rq_ts0 = 11 }
set_temp_variable = { rq_tsn = rq_tsc^fi }
set_temp_variable = { rq_tsr = 0 }
set_temp_variable = { rq_tsb = 0 }
while_loop_effect = {
limit = { check_variable = { rq_tsb = 0 } check_variable = { rq_tsr < rq_tsn } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_tsr }
if = {
limit = { check_variable = { rq_tsv^rq_tsx < rq_hv } }
set_temp_variable = { rq_tsb = 1 }
}
else = {
add_to_temp_variable = { rq_tsr = 1 }
}
}
if = {
limit = { check_variable = { rq_tsr < 11 } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = 10 }
remove_from_array = { array = rq_tsv index = rq_tsx }
remove_from_array = { array = rq_tst index = rq_tsx }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_tsr }
add_to_array = { array = rq_tsv value = rq_hv index = rq_tsx }
add_to_array = { array = rq_tst value = hv index = rq_tsx }
if = {
limit = { check_variable = { rq_tsn < 11 } }
add_to_temp_variable = { rq_tsn = 1 }
remove_from_array = { array = rq_tsc index = fi }
add_to_array = { array = rq_tsc value = rq_tsn index = fi }
}
}
}
}
}
}
}
}
rq_bn_thr = yes
}
rq_bn_thr = {
clear_array = rq_bt1
clear_array = rq_bt2
clear_array = rq_btt
clear_array = rq_btt2
for_each_loop = {
array = rq_bnk
value = bp_k
index = bp_i
set_temp_variable = { rq_p1 = 0 }
set_temp_variable = { rq_p2 = 0 }
set_temp_variable = { rq_pt1 = 0 }
set_temp_variable = { rq_pt2 = 0 }
if = {
limit = { check_variable = { rq_bnu^bp_i > 0 } }
set_temp_variable = { rq_ts0 = bp_i }
multiply_temp_variable = { rq_ts0 = 11 }
set_temp_variable = { rq_tsn = rq_tsc^bp_i }
set_temp_variable = { rq_pu = rq_bnu^bp_i }
clamp_temp_variable = { var = rq_pu max = 10 }
set_temp_variable = { rq_pu1 = rq_pu }
add_to_temp_variable = { rq_pu1 = 1 }
if = {
limit = { check_variable = { rq_tsn > 0 } }
set_temp_variable = { rq_pt1 = rq_tst^rq_ts0 }
}
if = {
limit = { check_variable = { rq_tsn > 1 } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = 1 }
set_temp_variable = { rq_pt2 = rq_tst^rq_tsx }
}
if = {
limit = { NOT = { check_variable = { rq_tsn < rq_pu } } check_variable = { rq_pu > 0 } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_pu }
subtract_from_temp_variable = { rq_tsx = 1 }
set_temp_variable = { rq_p1 = rq_tsv^rq_tsx }
}
if = {
limit = { NOT = { check_variable = { rq_tsn < rq_pu1 } } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_pu1 }
subtract_from_temp_variable = { rq_tsx = 1 }
set_temp_variable = { rq_p2 = rq_tsv^rq_tsx }
}
}
add_to_array = { rq_bt1 = rq_p1 }
add_to_array = { rq_bt2 = rq_p2 }
add_to_array = { rq_btt = rq_pt1 }
add_to_array = { rq_btt2 = rq_pt2 }
}
}
rq_bn_prep_upd = {
set_temp_variable = { rq_fany = 0 }
for_each_loop = {
array = rq_bnu
value = fu
break = rq_fany
if = {
limit = { check_variable = { fu > 0 } }
set_temp_variable = { rq_fany = 1 }
}
}
if = {
limit = { check_variable = { rq_fany = 1 } }
rq_qpos_build = yes
for_each_loop = {
array = rq_bdt
value = ut
set_temp_variable = { rq_t = ut }
rq_bn_tkinds = yes
if = {
limit = { check_variable = { rq_tk^num > 0 } }
set_temp_variable = { rq_ui = rq_qpos^ut }
set_temp_variable = { rq_uq = 0 }
if = {
limit = {
check_variable = { rq_ui > -1 }
NOT = { is_in_array = { array = rq_vanilla value = ut } }
NOT = { is_in_array = { array = rq_atk value = ut } }
}
set_temp_variable = { rq_uq = 1 }
set_temp_variable = { rq_hp = rq_qprog^rq_ui }
}
set_temp_variable = { rq_fbase = 0 }
for_each_loop = {
array = rq_bnk
value = fk
index = fi
if = {
limit = {
check_variable = { rq_bnu^fi > 0 }
is_in_array = { array = rq_tk value = fk }
}
set_temp_variable = { rq_ts0 = fi }
multiply_temp_variable = { rq_ts0 = 11 }
set_temp_variable = { rq_tsn = rq_tsc^fi }
set_temp_variable = { rq_ufull = 0 }
if = { limit = { check_variable = { rq_tsn > 10 } } set_temp_variable = { rq_ufull = 1 } }
set_temp_variable = { rq_uwas = 0 }
set_temp_variable = { rq_tsr = 0 }
while_loop_effect = {
limit = { check_variable = { rq_uwas = 0 } check_variable = { rq_tsr < rq_tsn } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_tsr }
if = {
limit = { check_variable = { rq_tst^rq_tsx = ut } }
set_temp_variable = { rq_uwas = 1 }
remove_from_array = { array = rq_tsv index = rq_tsx }
remove_from_array = { array = rq_tst index = rq_tsx }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = 10 }
if = { limit = { check_variable = { rq_tsx < rq_tsv^num } } add_to_array = { array = rq_tsv value = 0 index = rq_tsx } }
else = { add_to_array = { array = rq_tsv value = 0 } }
if = { limit = { check_variable = { rq_tsx < rq_tst^num } } add_to_array = { array = rq_tst value = 0 index = rq_tsx } }
else = { add_to_array = { array = rq_tst value = 0 } }
subtract_from_temp_variable = { rq_tsn = 1 }
remove_from_array = { array = rq_tsc index = fi }
if = { limit = { check_variable = { fi < rq_tsc^num } } add_to_array = { array = rq_tsc value = rq_tsn index = fi } }
else = { add_to_array = { array = rq_tsc value = rq_tsn } }
}
else = {
add_to_temp_variable = { rq_tsr = 1 }
}
}
set_temp_variable = { rq_tsr = 11 }
if = {
limit = { check_variable = { rq_uq = 1 } }
if = {
limit = { check_variable = { rq_fbase = 0 } }
set_temp_variable = { rq_t = ut }
rq_bn_val_base = yes
set_temp_variable = { rq_fbase = 1 }
}
set_temp_variable = { rq_hb = fi }
rq_bn_val_tail = yes
set_temp_variable = { rq_ts0 = fi }
multiply_temp_variable = { rq_ts0 = 11 }
set_temp_variable = { rq_tsn = rq_tsc^fi }
set_temp_variable = { rq_tsr = 0 }
set_temp_variable = { rq_tsb = 0 }
while_loop_effect = {
limit = { check_variable = { rq_tsb = 0 } check_variable = { rq_tsr < rq_tsn } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_tsr }
set_temp_variable = { rq_utp = rq_tst^rq_tsx }
set_temp_variable = { rq_utq = rq_qpos^rq_utp }
if = {
limit = {
OR = {
check_variable = { rq_tsv^rq_tsx < rq_hv }
AND = {
check_variable = { rq_tsv^rq_tsx = rq_hv }
check_variable = { rq_utq > rq_ui }
}
}
}
set_temp_variable = { rq_tsb = 1 }
}
else = {
add_to_temp_variable = { rq_tsr = 1 }
}
}
if = {
limit = { check_variable = { rq_tsr < 11 } }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = 10 }
remove_from_array = { array = rq_tsv index = rq_tsx }
remove_from_array = { array = rq_tst index = rq_tsx }
set_temp_variable = { rq_tsx = rq_ts0 }
add_to_temp_variable = { rq_tsx = rq_tsr }
add_to_array = { array = rq_tsv value = rq_hv index = rq_tsx }
add_to_array = { array = rq_tst value = ut index = rq_tsx }
if = {
limit = { check_variable = { rq_tsn < 11 } }
add_to_temp_variable = { rq_tsn = 1 }
remove_from_array = { array = rq_tsc index = fi }
add_to_array = { array = rq_tsc value = rq_tsn index = fi }
}
}
}
if = {
limit = {
check_variable = { rq_uwas = 1 }
check_variable = { rq_ufull = 1 }
check_variable = { rq_tsr > 9 }
}
add_to_temp_array = { rq_bpsel = fi }
}
}
}
}
}
}
if = {
limit = { check_variable = { rq_bpsel^num > 0 } }
rq_bn_prep_do = yes
}
else = {
rq_bn_thr = yes
}
}
rq_bn_mark = {
if = {
limit = { NOT = { is_in_array = { array = rq_bdt value = rq_bm_t } } }
add_to_array = { rq_bdt = rq_bm_t }
}
}
rq_bn_hold = {
set_temp_variable = { rq_hold = 0 }
set_temp_variable = { rq_h_t = rq_t }
set_temp_variable = { rq_h_ya0 = rq_ya0 }
set_temp_variable = { rq_h_bs = rq_bs }
set_temp_variable = { rq_h_tb = rq_tb }
set_temp_variable = { rq_h_bc = rq_base_cost }
set_temp_variable = { rq_h_sm = rq_start_months }
set_temp_variable = { rq_h_qi = rq_qi }
set_temp_variable = { rq_hb = lb_i }
set_temp_variable = { rq_hp = 0 }
if = {
limit = { check_variable = { rq_qpos_ok = 1 } }
set_temp_variable = { rq_qi = rq_qpos^rq_t }
}
else = {
rq_q_find = yes
}
if = {
limit = { check_variable = { rq_qi > -1 } }
set_temp_variable = { rq_hp = rq_qprog^rq_qi }
}
rq_bn_val = yes
set_temp_variable = { rq_h_mine = rq_hv }
multiply_temp_variable = { rq_h_mine = 1.05 }
set_temp_variable = { rq_h_thr = 0 }
set_temp_variable = { rq_h_for = 0 }
if = {
limit = { check_variable = { rq_hb < rq_bt1^num } }
set_temp_variable = { rq_h_thr = rq_bt1^rq_hb }
set_temp_variable = { rq_h_for = rq_btt^rq_hb }
if = {
limit = {
check_variable = { rq_qi > -1 }
NOT = { is_in_array = { array = rq_vanilla value = rq_h_t } }
NOT = { is_in_array = { array = rq_atk value = rq_h_t } }
NOT = { check_variable = { rq_hv < rq_h_thr } }
}
set_temp_variable = { rq_h_thr = rq_bt2^rq_hb }
}
if = {
limit = { check_variable = { rq_h_for = rq_h_t } }
set_temp_variable = { rq_h_for = rq_btt2^rq_hb }
}
}
if = {
limit = { check_variable = { rq_h_thr > rq_h_mine } }
set_temp_variable = { rq_hold = 1 }
}
set_temp_variable = { rq_t = rq_h_t }
rq_bn_tkinds = yes
set_temp_variable = { rq_ya0 = rq_h_ya0 }
set_temp_variable = { rq_bs = rq_h_bs }
set_temp_variable = { rq_tb = rq_h_tb }
set_temp_variable = { rq_base_cost = rq_h_bc }
set_temp_variable = { rq_start_months = rq_h_sm }
set_temp_variable = { rq_qi = rq_h_qi }
}
rq_bn_lanes = {
clear_array = rq_bhk
clear_array = rq_bhf
clear_array = rq_bhv
for_each_loop = {
array = rq_active
value = la_v
if = {
limit = { NOT = { is_in_array = { array = rq_atk value = la_v } } }
set_temp_variable = { rq_t = la_v }
set_temp_variable = { rq_bn_real = 0 }
rq_bn_activate = yes
if = {
limit = {
check_variable = { rq_bh_any = 1 }
NOT = { is_in_array = { array = rq_atk value = la_v } }
}
add_to_array = { rq_bhk = la_v }
add_to_array = { rq_bhf = rq_bh_for }
add_to_array = { rq_bhv = rq_bh_v }
}
}
}
}
rq_bn_at_find = {
set_temp_variable = { rq_ati = -1 }
for_each_loop = {
array = rq_atk
value = at_v
index = at_i
if = {
limit = { check_variable = { at_v = rq_t } }
set_temp_variable = { rq_ati = at_i }
}
}
}
rq_bn_activate = {
set_temp_variable = { rq_bnew = 0 }
rq_bn_at_find = yes
if = {
limit = { check_variable = { rq_ati = -1 } }
rq_bn_pick = yes
if = {
limit = { check_variable = { rq_bpi > -1 } }
add_to_array = { rq_atk = rq_t }
add_to_array = { rq_atv = rq_lbv }
add_to_array = { rq_ata = rq_lba }
set_temp_variable = { rq_bnew = 1 }
set_temp_variable = { rq_bpu = 0 }
if = {
limit = { check_variable = { rq_bnu^rq_bpi > 0 } }
set_temp_variable = { rq_bpu = 1 }
set_temp_variable = { rq_bu = rq_bnu^rq_bpi }
subtract_from_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnu index = rq_bpi }
if = { limit = { check_variable = { rq_bpi < rq_bnu^num } } add_to_array = { array = rq_bnu value = rq_bu index = rq_bpi } }
else = { add_to_array = { array = rq_bnu value = rq_bu } }
if = {
limit = { check_variable = { rq_bn_real = 0 } }
set_temp_variable = { rq_bu = rq_bnq^rq_bpi }
add_to_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnq index = rq_bpi }
if = { limit = { check_variable = { rq_bpi < rq_bnq^num } } add_to_array = { array = rq_bnq value = rq_bu index = rq_bpi } }
else = { add_to_array = { array = rq_bnq value = rq_bu } }
}
}
else = {
set_temp_variable = { rq_bu = rq_bnq^rq_bpi }
subtract_from_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnq index = rq_bpi }
if = { limit = { check_variable = { rq_bpi < rq_bnq^num } } add_to_array = { array = rq_bnq value = rq_bu index = rq_bpi } }
else = { add_to_array = { array = rq_bnq value = rq_bu } }
}
}
}
set_temp_variable = { rq_bn_for = -1 }
}
rq_bn_verify_tick = {
set_temp_variable = { rq_vvx = -1 }
set_temp_variable = { rq_vvdo = 0 }
for_each_loop = {
array = rq_vvt
value = vvv
index = vvj
if = {
limit = { check_variable = { rq_vvx < 0 } NOT = { is_in_array = { array = rq_vanilla value = vvv } } }
set_temp_variable = { rq_t = vvv }
rq_check_owned = yes
if = {
limit = { check_variable = { rq_owned = 0 } }
set_temp_variable = { rq_vvx = vvj }
}
else_if = {
limit = { check_variable = { rq_vvd^vvj < 1 } }
set_temp_variable = { rq_vvy = global.num_days }
add_to_temp_variable = { rq_vvy = 1 }
set_temp_variable = { rq_vvz = vvj }
remove_from_array = { array = rq_vvd index = rq_vvz }
if = { limit = { check_variable = { rq_vvz < rq_vvd^num } } add_to_array = { array = rq_vvd value = rq_vvy index = rq_vvz } }
else = { add_to_array = { array = rq_vvd value = rq_vvy } }
}
else_if = {
limit = { NOT = { check_variable = { global.num_days < rq_vvd^vvj } } }
set_temp_variable = { rq_vvx = vvj }
set_temp_variable = { rq_vvdo = 1 }
}
}
}
if = {
limit = { check_variable = { rq_vvx > -1 } }
if = {
limit = { check_variable = { rq_vvdo = 1 } }
set_temp_variable = { rq_bpi = rq_vvi^rq_vvx }
set_temp_variable = { rq_bpu = rq_vvu^rq_vvx }
rq_bn_verify = yes
}
remove_from_array = { array = rq_vvt index = rq_vvx }
remove_from_array = { array = rq_vvi index = rq_vvx }
remove_from_array = { array = rq_vvu index = rq_vvx }
remove_from_array = { array = rq_vvd index = rq_vvx }
}
}
rq_bn_verify = {
set_temp_variable = { rq_lbk = rq_bnk^rq_bpi }
rq_bn_vcheck = yes
set_temp_variable = { rq_vr = 0 }
for_each_loop = {
array = rq_bnk
value = vb_v
index = vb_i
if = {
limit = { is_in_array = { array = rq_vk value = vb_v } }
add_to_temp_variable = { rq_vr = rq_bnu^vb_i }
add_to_temp_variable = { rq_vr = rq_bnq^vb_i }
}
}
if = {
limit = { check_variable = { rq_lbp = 1 } check_variable = { rq_vr = 0 } }
if = {
limit = { check_variable = { rq_bpu = 1 } }
set_temp_variable = { rq_bu = rq_bnu^rq_bpi }
add_to_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnu index = rq_bpi }
if = { limit = { check_variable = { rq_bpi < rq_bnu^num } } add_to_array = { array = rq_bnu value = rq_bu index = rq_bpi } }
else = { add_to_array = { array = rq_bnu value = rq_bu } }
}
else = {
set_temp_variable = { rq_bu = rq_bnq^rq_bpi }
add_to_temp_variable = { rq_bu = 1 }
remove_from_array = { array = rq_bnq index = rq_bpi }
if = { limit = { check_variable = { rq_bpi < rq_bnq^num } } add_to_array = { array = rq_bnq value = rq_bu index = rq_bpi } }
else = { add_to_array = { array = rq_bnq value = rq_bu } }
}
set_temp_variable = { rq_bn_for = -1 }
}
}
rq_bonus_get = {
if = {
limit = { NOT = { check_variable = { rq_bn_for = rq_t } } }
set_temp_variable = { rq_bn_for = rq_t }
set_temp_variable = { rq_lbv = 0 }
set_temp_variable = { rq_lba = 0 }
rq_bn_at_find = yes
if = {
limit = { check_variable = { rq_ati > -1 } }
set_temp_variable = { rq_lbv = rq_atv^rq_ati }
set_temp_variable = { rq_lba = rq_ata^rq_ati }
}
else_if = {
limit = { NOT = { is_in_array = { array = rq_vanilla value = rq_t } } }
set_temp_variable = { rq_bn_real = 0 }
set_temp_variable = { rq_bn_t = rq_t }
rq_bn_pick = yes
set_temp_variable = { rq_t = rq_bn_t }
}
set_temp_variable = { rq_lbv_c = rq_lbv }
set_temp_variable = { rq_lba_c = rq_lba }
}
set_temp_variable = { rq_lbv = rq_lbv_c }
set_temp_variable = { rq_lba = rq_lba_c }
}
