Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / HP problems

Author
Message
Proton blast
20
Years of Service
User Offline
Joined: 30th Nov 2004
Location: London ontario canada
Posted: 7th Dec 2004 00:58
i'm trying to make an RPG battle system, (it's posted int he 20 line challenge forum) and somone suggested that you shouldn't be able to heal above your max HP, which makes sence. But how would i do that?

also on the same lines how would i make it for an MP system, that it Uses the spell, But it checks if you have mp first
For example the each time you use a spell it uses 5 mp, and you have a max of 10 mp, so it checks to see if you have enough and if you do, then it does the spell. if you don't then it will stand by untill you choose another action (Refer to my topic in 20 line challenge to see my coding or try what i've got so far)

A one that is not cold is scarcely a one at all
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 7th Dec 2004 08:23
For the Hp problem, you can have a seperate variable of your person's full hp, then have another for the person's current hp.
When you heal, heal the current hp, and have it check the full hp variable to see if it went over. If it did, lower it.

For the mp, do the same thing. To see if there is enough, have it see if the current mp is equal or greater than the amount taken, which you said is 5.

Don't let life get you down, it will only get better.
Proton blast
20
Years of Service
User Offline
Joined: 30th Nov 2004
Location: London ontario canada
Posted: 7th Dec 2004 09:41
i'm really not sure how i would do that, i'm really new to Darkbasic

A one that is not cold is scarcely a one at all
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 7th Dec 2004 11:15
It's actually quite simple. Say your healing potion or whatever gives you 20 HP, but you don't want to heal over 100 HP.



Should work.

Login to post a reply

Server time is: 2025-05-24 08:14:46
Your offset time is: 2025-05-24 08:14:46