In my map, I have several abilities that reduce enemy armor, some of which are passive "on attack" effects. I ran into a problem, where armor can go negative with this, causing attacks to do bonus damage. I need to find a way to prevent this. I tried making a behavior for all units, that checks with a validator if armor is below 0, then periodically add a +1 armor buff that has the same validator for removal, but the validator didn't work. Does anyone have any ideas how to do this?
Apply the initial debuff as 10 stacks of -1 armor, each with a Validator to check for armor >=1, adjust any debuff-removing effects to also remove 10 stacks.
Apply the stacks periodically with a period of 1/16 second if you have to for the Validator to work.
It looks like the validator only looks at base armor, not any modifications that may have been applied, Shame I cant use math in validators, or i could just subtract the effect of each buff from the base armor to check it to see if it would go negative.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
In my map, I have several abilities that reduce enemy armor, some of which are passive "on attack" effects. I ran into a problem, where armor can go negative with this, causing attacks to do bonus damage. I need to find a way to prevent this. I tried making a behavior for all units, that checks with a validator if armor is below 0, then periodically add a +1 armor buff that has the same validator for removal, but the validator didn't work. Does anyone have any ideas how to do this?
Bump
I would probably go through it the long way and check individual unit types... But then again, I'm bad at this.
Have you tried doing it from the "attacker" end? I.E. in the reduce-armor effect, have it only apply to units with armor>=1?
I thought of that, But the problem is that the reduction amount is 10, and in that case, it would still go to -9 at most.
So make it require >= 10.
And if you have 6 armor, you would keep 6 armor, not go to 0 while the effect is supposed to be active.
Bump
Apply the initial debuff as 10 stacks of -1 armor, each with a Validator to check for armor >=1, adjust any debuff-removing effects to also remove 10 stacks.
Apply the stacks periodically with a period of 1/16 second if you have to for the Validator to work.
It looks like the validator only looks at base armor, not any modifications that may have been applied, Shame I cant use math in validators, or i could just subtract the effect of each buff from the base armor to check it to see if it would go negative.