HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Mana Shield?

06-17-2003, 03:35 PM#1
Electricall
I had the brilliant(?) idea of having mana as a shield. It would work like this:

Monster attacks Hero and deals 10 damage.
Hero has 20 mana points left.
Hero's mana shields him.
Hero has 10 mana points left.
Another Monster comes and both monster strike and deal 25 damage.
Hero hasn't enough mana to prevent all damage, but it's reduced to 15 damage.
Hero has 0 mana points.

Or something like that. I'm making a map were you have a tank and i thought that would be a cool ability they could have :)

// Electricall
06-17-2003, 03:38 PM#2
Dead-Inside
Yep, but you could just as well trigger it, and not use any visible valvue. You could have a "spalsh" message telling your shield current status when hit, and when fully charged after recharging, ect.
06-17-2003, 04:31 PM#3
playamarz
That would be a rather cool idea... Alot of work to it... But a cool idea. If there was a trigger of a way you could tell how much the enemy damages you by.. Then it could be easily done then.

Say... If the unit being attack has mana shield on.. Or if it's a passive ability. If it's been researched yet or whatever.

Code:
damage = dmg enemy hit for;

if manaleft > damage
manaleft = manaleft - damage;
else
damage = damage - manaleft;
manaleft = 0;
healthleft = healthleft - damage;
healthvar = healthleft;

That's if the system is nice enough to give us the damage that the enemy deals out. Which I doubt it does. In this case you'd have to do some sort of "checking" the health of the attackie formula.. Which can be pretty easy.

Code:
EVENT
Periodically check every second (or two seconds).
CONDITIONS
Player must be alive?
ACTIONS
healthvar = healthleft of unit

The healthvar will hold whatever health the person had before he was attacked. Then that healthvar will be updated every time the unit is attacked.

To get the damage this way then.. You'd just take the healthvar and subtract the health of the unit after being attacked.

Code:
damage = healthvar - health of unit after being attacked;

So the full equation if you can't gte a person's damage easily by the editor is.

Code:
damage = healthvar - health of unit after being attacked;

if manaleft > damage
manaleft = manaleft - damage;
else
damage = damage - manaleft;
manaleft = 0;
healthleft = healthleft - damage;
healthvar = healthleft;

It's tedious and looks like it is useless.. But the effects would be pretty cool. :ggani: