#Potion effect coparsion

1 messages · Page 1 of 1 (latest)

distant sparrow
#

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}
distant sparrow
#

Potion effect coparsion

distant sparrow
#

👋

distant sparrow
#

I need someone to look into this since I've put too much time to this and cannot look from another point.

dusty wind
#

Well problem is, a lot of people here are mid level at skript, so something like that is normally by high level developers with years of experience, and requires a lot of debuging and testing, and since it such a specific thing there aren't to many people that can say "I did it by using XYZ", most likely no one gonna be able to help you to much here, I recommend try asking in the skript help channel and see if anyone can help or try requesting someone to test it out and fix it

#

Since I've read thru this code and really can't see any massive or really any issues