| 12-29-2009, 09:49 PM | #1 |
Hey guys. I'm trying to make an ability that increases the health regeneration rate of a hero as the heroes health falls. But I'm not sure how to go about doing this, I thought I could figure it out but I'm just not getting very far. If anyone could help me out, point me in the right direction, I'd greatly appreciate it. Thanks in advance. |
| 12-29-2009, 11:46 PM | #2 |
You'd need a list of all units with this ability and then use a periodic trigger to increase their life based on their current life. |
| 12-30-2009, 01:02 AM | #3 |
As for the formula, you're making the rate of life regen inversely proportional to current life. So you could take the ratio of MaxLife/CurrentLife and multiply by some proportionality factor (probably between 0 and 1) to make the regen more reasonable. That's if you want a linear increase in regen, you can of course make it exponential (probably too cheap for the gameplay), or quadratic or such. |
