ID:148440
 
Well I have both Potion and Ether codes and they work so i thought of combining them:
obj/items/Elixer
icon = 'items.dmi'
icon_state = "elixer"
density = 1
verb
Use_Elixer()
set category = "Items"
set src in usr
if(usr.HP < usr.MAXHP)
usr << "Your health have been restored."
usr << "Your magic points have been restored."
usr.HP += 100
usr.MP += 100
if(usr.HP > usr.MAXHP)
usr.HP = usr.MAXHP
if(usr.MP > usr.MAXMP)
usr.MP = usr.MAXMP
del src

else
usr << "No need to use this now"

------------------------------------------------------------
well that only if your hp is lower... what i need help with is 1)Is there a way to define a variable like var/hpmp = usr.HP + usr.MP I know that doesn't work but is a way of defining a variable like that? Is it possible?
------------------------------------------------------------
My summon code partially works. But the summon won't delete:

Summon(mob/attacker as mob, mob/target as mob, obj/Ifrit as obj)
if(usr.MP < 30)
usr << "You don't have enough Magic Points (MP)!"
else
flick("summon",attacker)
attacker << "You chose to summon the beast on [src]"
new /obj/Ifrit(locate(usr.x-3,usr.y+1,usr.z))
sleep(5)
summondamage(attacker, target)
del Ifrit


But my summoned beast stays........... whats wrong????

Cloudiroth wrote:
well that only if your hp is lower... what i need help with is 1)Is there a way to define a variable like var/hpmp = usr.HP + usr.MP I know that doesn't work but is a way of defining a variable like that? Is it possible?


What you have there works fine with my game. And instead of having this:

usr.HP += 100
usr.MP += 100
if(usr.HP > usr.MAXHP)
usr.HP = usr.MAXHP
if(usr.MP > usr.MAXMP)
usr.MP = usr.MAXMP
you can simply do this:

usr.HP = usr.MaxHP
usr.MP = usr.MaxMp


In response to SSChicken
Except that doesn't have the same effect.
In response to Garthor
Sorry, but my plan was, at least if you can do this, somehow have an if statement: if(usr.hp + usr.mp = usr.maxhp + usr.maxmp)

but you can't do that so i thought what if you could store usr.hp + usr.mp into a variable so i could simplify it:
if(hpmp = maxhpmaxmp)

just saying if thoughs var. were it. but you can't define a variable like that, not to my knowledge at least (but I'm not the greatest coder around, im not even close to been good!) So i thought maybe some good guru or something would know a way. though right know my biggest problem is the summon(i know i wrote it out of order) because if it doesnt work the materia and battle system don't work to there fullest.