Get units current defence

HL.Clockwork

New Member
Reaction score
5
Just looking for a value like this.
Is there one? cannot find it.(only advanced, get defence bonus)

I wanne create a spell that deals damage based on the targets armor.
Custom value ist still inuse.

maybe use foodlimit?

thanks.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
If you go at it in a roundabout way you could find a units base armor. Set every units point value equal to their base armor and then you could detect that. With heroes you could do the agility calculations and add that to their base and if you applied a point value to all available items for their armor bonus, and set up a detection system for all armor buffs it could be done.
 

martix

There is no spoon
Reaction score
49
Stats are real values so you can make it mostly accurate.
For positive Armor, damage reduction =((armor)*0.06)/(1+0.06*(armor))
For negative Armor, it is damage increase = 2-0.94^(-armor) since you take more damage for negative armor scores.

So... my suggestion is, when you do the armor check, record units current hp, damage him for 10 points, record the new health, heal him to his previous hp. And with the new/old hp calculate the armor value using the above formulae...
You'll also have to introduce some failsaves that prevent the unit from dying from that damage or make sure you know if the unit has positive/negative armor so you use the correct formula.
Something else you should know - you either go JASS or make sure you can never get negative armor on any unit.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top