You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent tags are not working as intended. Hoping this writeup could be helpful in maybe @MathiasGruber coming up with a solution. I could try to help but I'm still fuzzy on the combat code, and you could probably come up with something better, faster. Will tinker around anyway.
Debuff and Buff Prevent
Both of these have a line that permanently sets the chance to trigger at 100% after successfully passing the check once.
const{ power }=getPower(effect);constmainCheck=Math.random()<power/100;if(mainCheck){constinfo=getInfo(target,effect,"cannot be debuffed");HERE-->effect.power=100;<--returninfo;
This check seems to happen at least once on each enemy action, like moving even though it wouldn't affect your debuffs.
In the example of the 40% chance to prevent debuff armor, it would work like this:
ROUND 1
Enemy Move, Check debuffPrevent() 40% chance, roll 70, fail
Enemy Move, Check debuffPrevent() 40% chance, roll 30, pass, set chance to 100%
Enemy Move, Check debuffPrevent() 100% chance, pass, set chance to 100%
ROUND 2
Enemy Debuff, Check preventCheck() 100% chance, fail to debuff
etc, always at 100% every round until the duration ends
Removing the effect.power = 100 would prevent this from having a near 100% chance, but still not have the desired effect @theeneon and @d3t0ur outlined in #154 because it would be the same as the other prevents (heal, flee, move, stun).
It seems the intent here was to provide temporary immunity for a round like they suggested, but instead it's permanent.
Other Prevents
The other xPrevent methods like stunPrevent don't effectively do anything other than print misleading messages because the other action methods like stun() refer to a preventCheck method that does the same % chance calculation again, which could potentially be different from the result of the check in stunPrevent. The results that come from preventCheck are the real results that determine whether the stun can go through (which it then has to pass its own stun % check, but unrelated).
These checks also seem to happen multiple times per action in different checks of the action and could give different results each time for the same prevent tag.
So currently to successfully prevent with these tags you must pass it per tag(?), per action, instead of the desired per round.
Potential Solution
I think setting the effect's power/chance like you did in buff/debuff prevent to 100% to start is good so they can have immunity, but
After the round is over, the power should reset to the original
This check should only happen once per round, not once per action. If there's 6 actions (3 per participant) in a round and you have a 40% chance to gain debuff immunity on all of them, by the last action you had an effective 95.3% chance 1-(1-p)^n
The text was updated successfully, but these errors were encountered:
Prevent tags are not working as intended. Hoping this writeup could be helpful in maybe @MathiasGruber coming up with a solution. I could try to help but I'm still fuzzy on the combat code, and you could probably come up with something better, faster. Will tinker around anyway.
Debuff and Buff Prevent
Both of these have a line that permanently sets the chance to trigger at 100% after successfully passing the check once.
This check seems to happen at least once on each enemy action, like moving even though it wouldn't affect your debuffs.
In the example of the 40% chance to prevent debuff armor, it would work like this:
Removing the
effect.power = 100
would prevent this from having a near 100% chance, but still not have the desired effect @theeneon and @d3t0ur outlined in #154 because it would be the same as the other prevents (heal, flee, move, stun).It seems the intent here was to provide temporary immunity for a round like they suggested, but instead it's permanent.
Other Prevents
The other xPrevent methods like stunPrevent don't effectively do anything other than print misleading messages because the other action methods like stun() refer to a preventCheck method that does the same % chance calculation again, which could potentially be different from the result of the check in stunPrevent. The results that come from preventCheck are the real results that determine whether the stun can go through (which it then has to pass its own stun % check, but unrelated).
These checks also seem to happen multiple times per action in different checks of the action and could give different results each time for the same prevent tag.
So currently to successfully prevent with these tags you must pass it per tag(?), per action, instead of the desired per round.
Potential Solution
I think setting the effect's power/chance like you did in buff/debuff prevent to 100% to start is good so they can have immunity, but
The text was updated successfully, but these errors were encountered: