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.Tue, Sep 3, 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)