The way damage and healing works is this:
There are spider mines in a row for each player at the bottm spaced one square apart.
X O X O X O where X = mine O = space
the ilne is filled with mines and ones not owned by the player are owned by a neutral pc.
when the burrowed unit under a hero dies a DC is added for that player. Depending on the zone that player is in the amount of the DC added changes. For exmaple in a starting forest only 1 DC would be added whereas in a boss fight 4+ would be added.
When a player has suffered 3 deaths of this DC a location is centered on a mine that is owned by neutral in that specific player's life bar. The location used to center is 5x1 so that when it centers on a neutral mine it will have 1 player mine in it as well. So the trigger puts the location on the mine and removes one mine for the player in that location.
Healing works inversly. When a heal spell is cast another DC is added. Smaller spells add 1-2 DCs where as larger ones add more. when 3 of these DCs are accumulated the trigger centeres the location on a mine for neutral in that location and gives one mine for neutral to current player.
so damage will move the bar leftwards and healing will further it rightward.
Now to my problem. Overhealing. From staying at inns and people just casting big spells that heal past maximum hit points.
The amount of hp a player has is equaled to their STRENGTH + 2 (2 is base that everyone starts with).
to combat this i set up a system that fires and subtracts one DC for strength from the player, and gives one of his mines to a computer player (not the neutral one used above)(lets say player 8). When the player has zero deaths left of strength the trigger gives the mines that the current player still has to the neutral player (because those mines are obviously there due to overheal) and then a switch is set. When the switch is set the trigger gives a mine from the computer player 8 to the current player and adds one DC for strength back.
This system should cycle through and translate the mines to a temporary player, remove the excess and then give them back.
I have a few issues though.
1) It is ugly, i thought it would be almost instant but the units slide back and forth which is visible (and probably confusing to players)
2) I'm worried it might interfere with damage/healing. What if the transfer is in progress during a battle and the player gets enough damage DCs and a mine is removed from damage....whole system wrecks probably.
3) it just isn't working. It starts fine with them all moving to player 8 and then the system spazzes out and goes haywire and doesnt stop. I can't see why this is happening.
I'm attaching the map. There aren't that many triggers so it shouldn't be taht confusing.
The overheal removal is under player 1...and you'll notice it has a switch 1 set requiremtn. This switch is set when all players choose their class. so just pick a hero.
I'd appreciate if someone else's eyes could spot the issue i'm having. Or possibly does anyone know of a cleaner system?
so far in planning for this map I figured it would be a beast but so far on my notes the triggers required will be low because everthing is a one time trigger that works for multiple players and whatnot. I know that can change when it comes down to it but i'm trying to avoid tons of mindless trigger copying where i change a single number each time. blah blah.
Thanks gentlemen
Attachments:
None.