What I have is this:
- A Dialog of 25 width, and 300 height.
- A unit which starts on 120 hitpoints (the maximum value can change over time)
- An item which increases current hitpoints by 25.
So, basically a health bar which represents my hero units currentl hitpoints.
This works perfectly fine when I am doing the following
- Events
- Hero unit takes non-fatal any damage (from any effects)
- Hero unit takes non-fatal any damage (from any effects)
- local variables
- damage taken = real, default value 0.0
- factor = real, default value 0.0
- damage taken = real, default value 0.0
- Conditions (none)
- Actions
- Set Variable (factor) = (300 / (Hero Unit's Maximum Life (Current))
- Set Variable (damage taken) = ((Triggering Damage Amount) * Factor)
- Dialog - set Health Bar size to (25, ((Height of Health Bar) - (Integer(damage taken)) for (All Players)
- Set Variable (factor) = (300 / (Hero Unit's Maximum Life (Current))
But, the problem arises when I want my Hero unit to be able to heal himself through a) items and b) sleeping/fountain type scenarios. Since there is no event for 'Unit takes Healing effect' - I tried using Unit Property Changes but this conflicts with the (already working) unit takes damage event.
Any hints, clues, tips?
None.