HomeWildfire Games

Easier introduction of new damage types.

Tags
None
Subscribers
Tokens
"Heartbreak" token, awarded by bb."Love" token, awarded by Angen.

Description

Easier introduction of new damage types.

rP20203 introduced a DamageTypes.js global script similar to the resources one. However, we never actually need to refer to this script since we can always use the damage types provided by the template/context/object we are looping over/...
There is one exception to this for AI weighting of damage types. However, since damage types are not stored in files, this is strictly equivalent to hardcoding them in the global script and was deemed acceptable.

Patch By: freagarach

Reviewed By: wraitii

Refs #4801 (by invalidating it for now, though such helper files might be useful in the future if damage types require more metadata).

Differential Revision: https://code.wildfiregames.com/D1938

Event Timeline

Angen awarded a token.Jul 22 2019, 8:41 PM
bb awarded a token.Jul 22 2019, 9:57 PM
bb added a subscriber: bb.

However, we never actually need to refer to this script since we can always use the damage types provided by the template/context/object we are looping over/...

That part is contested when/if we want to generalize damagetype to affect other components than just Health or if we want to set any other damageType specific value (i.e. one could think of making "crush" only work on building class units, setting immunities could work for this case too, but there might be other similar ideas)

/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
194

So we get a different GUI when we set a value to 0 or not define it, while the sim effect it the same? Awaiting bugreports coming in for that...

In rP22527#35319, @bb wrote:

However, we never actually need to refer to this script since we can always use the damage types provided by the template/context/object we are looping over/...

That part is contested when/if we want to generalize damagetype to affect other components than just Health

See D2092 - I stand by the opinion we don't want that.

or if we want to set any other damageType specific value (i.e. one could think of making "crush" only work on building class units, setting immunities could work for this case too, but there might be other similar ideas)

Can probably be done with armour or with attack-level thing. And if it can't , i'm not against reintroducing this helper.
It just isn't needed for now.

/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
194

Fiable in the GUI, irrelevant here. We'll see if we get bug reports.

elexis added a subscriber: elexis.Sep 3 2019, 11:16 AM
elexis added inline comments.
/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
154

Leaves damageTypes unused (I got a concern for leaving resources unused in rP18977)

elexis raised a concern with this commit.Sep 26 2019, 10:53 AM

As reported by ValihrAnt, in alpha 23 the order of armour and attack damage types was consistently Hack Pierce Crush. Now (at least with 22993) it's the same order in Attack tooltips but is Crush Hack Pierce for the armour tooltip, i.e. inconsistent.

/ps/trunk/binaries/data/mods/public/globalscripts/Templates.js
168

This changed the order of armour damage types. Prior to rP20203 the order was hardcoded, with rP20203 the order was determined in the DamageTypes object.

This commit now has outstanding concerns.Sep 26 2019, 10:53 AM
elexis added inline comments.Sep 26 2019, 11:38 AM
/ps/trunk/binaries/data/mods/public/globalscripts/DamageTypes.js
8

The strings are not translated anymore following this removal, since theyre not extracted anymore.

Nescio added a subscriber: Nescio.Sep 26 2019, 12:40 PM

Either restore the order to H-P-C or alphabetize it to C-H-P, but make sure it's consistent throughout the entire game.

wraitii requested verification of this commit.Wed, May 20, 8:10 PM
This commit now requires verification by auditors.Wed, May 20, 8:10 PM
elexis removed an auditor: elexis.Wed, May 20, 8:31 PM
This commit no longer requires audit.Wed, May 20, 8:31 PM