Game Development Community

Manually draining a player's energy

by Caleb · in Technical Issues · 05/15/2007 (4:53 pm) · 2 replies

I plan on adding a lot of special abilitys to my game, but the only problem is, I don't know how to drain the player's energy when he does a special attack. Anyone know what I should do?

Thanks.

#1
05/15/2007 (5:07 pm)
I would say:

%client.setEnergy(%client.getEnergy() - %amount);

just a guess.
#2
05/16/2007 (5:41 am)
Thanks Ron, I can't believe I didn't think of it before, but I used the %player.dump() command and found these functions: "setEnergyLevel()" and "getEnergyLevel()".

So going off of what you put, I'd do this:
%player.setEnergyLevel(%player.getEnergyLevel() - %amount);
Thanks Ron!