- Build: 40220.0
The regenerating ability, used by the Technology Maghrabi Camels, can’t be edited to change the regenerating rate of a unit.
The attribute 109 is labelled as Regeneration Rate but actually acts as a simple toggle to start regenerating, the actual heal rate of units is edited completely differently.
Currently the amount of time t in seconds it takes to heal 1 HP is given by the formula t = 2* (Work_Rate + 1)
This doesn’t make sense for several reasons :
- Work rate is a multiplier. It has no business being used in an addition
- increasing the work rate of a unit, which is a good thing for every other ability, makes the unit heal slower because t increases.
- Units can’t heal faster than 1HP/2s because work rate can’t be negative.
- Editing the work rate of a unit affects several other key tasks, which makes changing the heal rate functionally impossible.
- Editing the work rate after the regeneration ability has been enabled doesn’t affect the heal rate, instead of updating dynamically.
Here’s how to reproduce the issue:
- Change the Work Rate of a Camel Archer to 10 via triggers
- Berbers and research Maghrabi Camels, and observe that the heal rate is now of 1 HP every 12 ( 2*(5+1) ) seconds.
- Use a trigger to change the Work Rate back to 1. Observe that the heal rate doesn’t change.
On UserPatch, regenerating is fully unhardcoded and is available to be modified on the fly for any unit, without requiring ID hardcoding nor Task additions. This is done by supporting an additional flag on Attribute 40 Hero Status (already present on DE), and adding a new attribute 45, Hero Heal Time.
New ATTR_HERO_STATUS #40 flags: 4: auto-heal
New ATTR_HERO_HEAL_TIME added as #45: set to the time to heal 1HP (default of 0 becomes 2s).