Can I make a unit get stronger as it takes damage?

luei333

Warlord
Joined
May 25, 2014
Messages
185
As the title. I'm looking for a way for a unit to gain strength as it becomes more and more damaged. Now, I've tried every way I can think of using the Modifiers system, but I'm fairly certain it's just not possible. There's a modifier that the Samurai uses that sets the unit to ignore damage penalties, but has no arguments. There's a modifier that a policy uses that causes the unit to ignore a percentage of the penalties, based on its argument, but it doesn't overflow on a value over 100% (and also, I think, doesn't have any effect with a negative value). There's a requirement for a unit being over a certain threshold of damage, but as far as I can find it only works in a unit combat context, and as far as I can tell can only check the opponent's damage, instead of the owner's.

So, all that and nothing to show for it. At best, I guess, you could make a leader where the enemy units technically get a penalty to their strength based on how damaged your unit is, that might work, but it's still kind of a let down.

If anyone has any wizardry they can work to get that effect working, or if it would be possible with a bit of lua, please let me know, I'd kill to have this effect available for my designs.
 
Strength added. Like, the opposite of the wounded effect, the unit gets +1 strength for every 10 damage it has, up to +10 on the brink of death, kind of thing. The numbers aren't really important, as long as it works.
 
I dont know if you got to this reqs, maybe something there:

PLAYER_IS_DEFENDER_REQUIREMENTS
PLAYER_IS_ATTACKER_REQUIREMENTS

----

This Effect does the opposite right to what you want...right?
EFFECT_ADJUST_UNIT_STRENGTH_REDUCTION_FOR_DAMAGE_MODIFIER

-----

Maybe by Lua

Unit:GetDamage is easy

As for combat strength I think you must use events.combat but what I find is not straight forward:


(...)
local attacker = m_combatResults[CombatResultParameters.ATTACKER];
local defender = m_combatResults[CombatResultParameters.DEFENDER];
local iAttackerCombatStrength = attacker[CombatResultParameters.COMBAT_STRENGTH];
local iDefenderCombatStrength = defender[CombatResultParameters.COMBAT_STRENGTH];
local iAttackerBonus = attacker[CombatResultParameters.STRENGTH_MODIFIER];
local iDefenderBonus = defender[CombatResultParameters.STRENGTH_MODIFIER];
(...)
 
@LeeS, that's kind of what I thought. And for the requirements, it can only detect the damage of the other unit, not the one with the modifier. The effects that adjust the combat penalties don't work, one is just an on/off, and the other doesn't have the desired effect outside of the 0%-100% range.
 
Top Bottom