So I'm making function that mixes potion effects as if i mix two potions in one. For example I have potion A with more than one effect and I have potion B with only one effect. And if I mix them as A and B it would be fine. But if I try to mix them as B and A there will be no output.
function combineEffects(a: objects, b: objects, p: player):
loop {_a::*}:
loop {_b::*}:
if type of loop-value-1 = type of loop-value-2:
if potion tier of loop-value-1 < potion tier of loop-value-2:
send "-" to {_p}
remove loop-value-1 from {_a::*}
if potion tier of loop-value-1 = potion tier of loop-value-2:
set {_type} to type of loop-value-2
set {_tier} to potion tier of loop-value-2
set {_tier} to {_tier} + 1
set {_dur} to potion duration of loop-value-2
set {_dur} to {_dur} + ({_dur}/2)
add potion effect of {_type} of tier {_tier} for {_dur} to {_pot::*}
if potion tier of loop-value-1 > potion tier of loop-value-2:
if {_pot::*} doesn't contain loop-value-1:
add loop-value-1 to {_pot::*}
remove loop-value-2 from {_b::*}
remove loop-value-1 from {_a::*}
if {_b::*} doesn't contain type of loop-value:
if {_pot::*} doesn't contain loop-value:
add loop-value to {_pot::*}
loop {_pot::*}:
send "%type of loop-value%<lime>[%potion tier of loop-value%]<light aqua>[%potion duration of loop-value%]" to {_p}