[solved] [engine] min_value for [resistance]

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
white_haired_uncle
Posts: 1226
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

[solved] [engine] min_value for [resistance]

Post by white_haired_uncle »

[resistance] takes a max_value, but does not have a min_value (or max_negative_value, which may be a little easier to understand).

LotI has an ability called adamant, which triples resistances, but only up max_value=80%. However, it also has a penetration special, which has an effect to lower resistance of adjacent units. Therefore, it is possible to lower an enemy's resistance to say -60 which would then be tripled to -180% if that unit had adamant. It seems to me only fair that it should at least be possible to cap negative resistance effect to -80% if you're going to cap positive resistance effect at 80%. Of course, the author may not want those to match, so IMO max and min should be separate arguments (as opposed to making max an absolute value such that max/min always match).
Last edited by white_haired_uncle on April 6th, 2024, 4:39 pm, edited 1 time in total.
Speak softly, and carry Doombringer.
User avatar
Ravana
Forum Moderator
Posts: 3018
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: [engine] min_value for [resistance]

Post by Ravana »

This is not about min_value, it is about order of operations. Even mainline steadfast will double weaknesses when weakness is caused by another ability.
white_haired_uncle
Posts: 1226
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: [engine] min_value for [resistance]

Post by white_haired_uncle »

I'm fine with multiplying weakness. That's not it this is about.

The issue is that the effect is capped on the positive side, but not the negative, hence min (max_negative) value.
Speak softly, and carry Doombringer.
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

Re: [engine] min_value for [resistance]

Post by newfrenchy83 »

i push a PR https://github.com/wesnoth/wesnoth/pull/8133 for use max_value and min_value attribute in all abilities or pecials who return numerical value
white_haired_uncle
Posts: 1226
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: [engine] min_value for [resistance]

Post by white_haired_uncle »

thank you
Speak softly, and carry Doombringer.
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

Re: [solved] [engine] min_value for [resistance]

Post by newfrenchy83 »

PR not yet commited, don't thanck me too fast
Post Reply