Resistance property

Moderator: GZDoom Developers

Post Reply
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Resistance property

Post by Amuscaria »

I'm hoping for a features that's similar to damagefactor, but based on a set value rather than a percentage. Something like this:

Resistance damagetype (string) int (value).

Say a monster has "Resistance Fire 15". Any damage that is of type "fire" will have 15 damage subtracted from the damage. If the damage value is lower than the resistance, then 0 damage will be dealt.
User avatar
Lord Misfit
Posts: 227
Joined: Wed Dec 27, 2006 8:13 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: Canton, OH
Contact:

Re: Resistance property

Post by Lord Misfit »

If I recall, I think I suggested something along this line a year or so ago because I wanted to do a system with armor items that had more of an RPG feel where they constantly deducted a specfic amount of damage as opposed to a percentage. It seemed to get no'd for some reason which I forget, probably one I would consider ridiculous too. x.x

I also seemed to remember I had also asked for an option to allow 'scratch damage' to get through if the damage would normally be reduced to 0. ["Scratch Damage" is a term in RPGs that means you always take at least 1 damage no matter how high you get your defenses up from a specfic attack.]
User avatar
Enjay
 
 
Posts: 26979
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Resistance property

Post by Enjay »

I suppose there are a few possibilities here:

The request as presented: "resistance" value is subtracted from damage dealt.
Something like what Lord Misfit wants: "resistance" value is subtracted but a specifiable value always gets through.
A threshold method: Damage doesn't get dealt unless the "resistance" value is less than the value being dealt but, if it is, the full value of the attack gets through.

Of course, I have no idea how feasible any of these are. I'm also not sure what should happen to any values that get through. Should they be subject to the usual armour calculation, for example, or should they be deemed to have bypassed armour? Should that be settable too?
User avatar
cypherphage
Posts: 213
Joined: Sun Feb 27, 2011 2:54 am

Re: Resistance property

Post by cypherphage »

I could definately get behind such things...
Or, if actors had some sort of state (0 duration?) that they jumped to (without interrupting their current state) each time they were hit, these things would be could be done on a mod by mod basis assuming a few extra decorate expressions were added to check such things as lastDamageRype, lastDamageAmount, etc.

Or, maybe you could use a custom inventory hack? Whenever a player/monster would get hit, you have the puff/a_radiusgive give them X damage items plus a custominventory that could run all the required computation/needed scripts. Wow, now that I think about that, I really need to find time to try this.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: Resistance property

Post by Amuscaria »

Could add a third value for the minimum damage for that particular damagetype. I.e.: Resistance Fire 15 1 (will always at least take 1 damage from fire, instead of 0). Where as Resistance Fire 15 0 (or just without the 0 by default) will take 0 damage if the damage dealt is less than the resistance value.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Resistance property

Post by XutaWoo »

I think DamageReduction would be a more appropriate name here.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: Resistance property

Post by Zippy »

Monsters can have armor, so would it be possible to use armor for this purpose? I don't recall offhand if you can make armor that only absorbs certain kind of damages.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Resistance property

Post by NeuralStunner »

You can't, no, you can only adjust damage factors of unabsorbed damage. If you want per-type resistances, there'd have to be a way to change that.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Resistance property

Post by FDARI »

To cover such diverse processings of damage, I think I would prefer a [WFDS]customizable "Damage event handler"[/WFDS]; perhaps a reference to a doomscript function that accepts damagetype and amount, returning a modified amount of damage. It would process per actor after processing existing damage modifiers on the same actor, and before damage is actually applied. (process Powerup, process Armour, process victim, apply damage)

That would handle another thing people have been requesting at times as well. All functions have access to the type of the damage, and the function on the victim actually gets to know/set the exact amount of damage that will be dealt by each individual source.
User avatar
cypherphage
Posts: 213
Joined: Sun Feb 27, 2011 2:54 am

Re: Resistance property

Post by cypherphage »

In the mean time, I whipped up a simple example to show how this can be hacked around: http://forum.zdoom.org/viewtopic.php?f=3&t=34089
Such damage items could be given by 0 damage attacks by their puff, and is affected by regular armor and could be extended to handle damage types etc. If anyone is interested in this, I can do a bit more work on this workaround.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”