• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Triggering (referencing to) unit's base damage

Status
Not open for further replies.
Level 2
Joined
May 19, 2017
Messages
7
I'm sure this has been asked before, but I've tried searching for the last 25ish minutes and haven't found anything.

Is there a way to reference to a unit's base damage stat that is displayed above their armor stat when you click on them?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
the base damage (without the green + damage) can easily be stored for every unit type using a hashtable. You only have to take upgrades into consideration, as they are the only thing modifying the base damage.
Let us not also forget about hero stats, tomes, and chaos based unit morphs...

In StarCraft II one can compute such damage dynamically, especially thanks to the catalog natives.
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
Yes, for heroes it's a bit more complicated, but still not much of a problem.
You have to keep in mind that attribute bonus abilities, that grant the green + in their attribute still increase base damage, even though the damage from this attribute bonus is also displayed as green +.
So in the end you only have to know the primary attribute, which you can simply get with triggers. It does not matter if the attribute comes from an ability, item, tome or the hero itself, since all increase base damage.
and chaos based unit morphs...
Does chaos based morph not change the unit type?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Does chaos based morph not change the unit type?
No it is not a form based morph like raven form or whatever. It not only alters the unit type but also reapplies all base attribute modifications, eg tomes and hero stats, so that the resulting unit has different base stats. This is one of the reasons why chaos Hellscream was so powerful in the campaign as all stat modifiers were applied twice to him after the conversion so he had more health, damage and armor than he should have had.

Morph based unit type conversions just change the unit type, they do not apply an extra copy of the current base stat boost permanently like chaos does. This is why they are the only viable way to change unit type dynamically without upgrading the unit to a new type or replacing it with a different unit.
 
Status
Not open for further replies.
Top