I would like to make a map where (damage) = (attack rating) - (armor), with a minimum of 1 damage per attack, as is found in most other RTS games including StarCraft.
Of course, the usual WarCraft 3 formula is (damage) = (attack rating)*[1-(0.06*armor)/(1+0.06*armor)].
I have thought of one way to do this: set the gameplay constant representing the 0.06 to 0, and then give every unit a modified version of Hardened Skin with the reduction set equal to the armor and the minimum damage set to 1, then hide the ability in a disabled Spellbook. This seems fine for most purposes, as armor upgrades can just level up the ability.
However, it will require very complex and annoying triggers to deal with any spells that increase armor, which I plan to have. Also, I can't think of any way at all to have this work with negative armor (and I also plan to have abilities that decrease armor).
Is this some way to do this through triggers? This would be needed for the WarCraft 2 recreation that is hosted on this site, so there must be a way. I would look at those campaigns to see how it is done; however, I can't open them without an error that crashes the Editor.
If I recall correctly, there is some Damage Detection system that will work. Please advise.
Of course, the usual WarCraft 3 formula is (damage) = (attack rating)*[1-(0.06*armor)/(1+0.06*armor)].
I have thought of one way to do this: set the gameplay constant representing the 0.06 to 0, and then give every unit a modified version of Hardened Skin with the reduction set equal to the armor and the minimum damage set to 1, then hide the ability in a disabled Spellbook. This seems fine for most purposes, as armor upgrades can just level up the ability.
However, it will require very complex and annoying triggers to deal with any spells that increase armor, which I plan to have. Also, I can't think of any way at all to have this work with negative armor (and I also plan to have abilities that decrease armor).
Is this some way to do this through triggers? This would be needed for the WarCraft 2 recreation that is hosted on this site, so there must be a way. I would look at those campaigns to see how it is done; however, I can't open them without an error that crashes the Editor.
If I recall correctly, there is some Damage Detection system that will work. Please advise.