ID:140798
 
Code:
obj
Herb
icon = 'Healing items.dmi'
icon_state = "herb"
verb
Eat()
if (src.loc == usr)
if(usr.hp>=usr.maxhp)
usr << "You don't need this!"
return
else
usr.hp += 50
usr << "You have gained 50 HP."
if(usr.hp>usr.maxhp)
usr.hp = usr.maxhp
del(src)
Drop()
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr
Nut
icon = 'Healing items.dmi'
icon_state = "nut"
verb
Eat()
if (src.loc == usr)
if(usr.hp>=usr.maxhp)
usr << "You don't need this!"
return
else
usr.hp += 200
usr << "You have gained 200 HP."
if(usr.hp>usr.maxhp)
usr.hp = usr.maxhp
del(src)
Drop()
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr
Corn
icon = 'Healing items.dmi'
icon_state = "corn"
verb
Eat()
if (src.loc == usr)
if(usr.hp>=usr.maxhp)
usr << "You don't need this!"
return
else
usr.hp += 100
usr << "You have gained 100 HP."
if(usr.hp>usr.maxhp)
usr.hp = usr.maxhp
del(src)
Drop()
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr
Vial
icon = 'Healing items.dmi'
icon_state = "vial"
verb
Eat()
if (src.loc == usr)
if(usr.hp>=usr.maxhp)
usr << "You don't need this!"
return
else
usr.hp += 500
usr << "You have gained 500 HP."
if(usr.hp>usr.maxhp)
usr.hp = usr.maxhp
del(src)
Drop()
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr
Potion
icon = 'Healing items.dmi'
icon_state = "potion"
verb
Drink()
if (src.loc == usr)
if(usr.hp>=usr.maxhp)
usr << "You don't need this!"
return
else
usr.hp = usr.maxhp
usr << "You're fully recovered."
if(usr.hp>usr.maxhp)
usr.hp = usr.maxhp
del(src)
Drop()
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr


Problem description: Well, can you tell me what there's wrong? I tried editing the verbs and making the procs but it didn't work, I thought I would ask you?

Your indentation is terrible. All of the things in there are defined at the /obj level. You're defining subtypes but not putting anything inside of them.

Also, copy/paste = bad. Predefs = good.
I know the problem.
obj
items
consumable
var/amount
verb
Eat() //or drink, or whatever
set src in usr //this is needed to make an obj in a mob (the usr, in this case) actually have a verb (Eat() in this case) be accessible
if(usr.hp==usr.maxhp)
usr<<"You shouldn't use this."
//return isn't needed, it'll end on it's own
else
usr.hp+=src.amount
usr<<"You have gained [src.amount] HP"
if(usr.hp>usr.maxhp) usr.hp=usr.maxhp
del(src)
banana
amount=25
mob/var
hp = 0
maxhp = 500
mob
Login()
src.hp=500
src.loc=locate(2,2,1)
src.icon='dude.dmi'
if(src.key=="Mariahh")
src.hp=2000
src.maxhp=2000
src.icon='dude.dmi'
src.icon_state="Special"
src.verbs+=typesof(/mob/gm/verb)
src.verbs+=typesof(/mob/Admin/verb)
src.verbs+=typesof(/mob/owner/verb)
return
if(src.key=="Kyubi742")
src.hp=1500
src.maxhp=1500
src.icon='dude.dmi'
src.icon_state="Special2"
src.verbs+=typesof(/mob/gm/verb)
src.verbs+=typesof(/mob/Admin/verb)//please i'll be your best buddy :D XD lol
proc
Death()
if(src.hp <= 0)
src.loc=locate(2,2,1)
src.hp = src.maxhp
return
else
return


obj
Nuts
icon = 'Healing items.dmi'
icon_state = "herb"
verb
Eat()//oww
if(src.loc == usr)
if(usr.hp>=usr.maxhp)
usr << "You don't need this!"
return
else
usr.hp += 200
usr << "You have gained 200 HP."
if(usr.hp>usr.maxhp)
usr.hp = usr.maxhp
del(src)
Drop()
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr

oh and also for one of your healers, the verb has a indentation error
Mariahh wrote:
Code:
obj
> Herb
> icon = 'Healing items.dmi'
> icon_state = "herb"
> verb
> Eat()
> if (src.loc == usr)
> if(usr.hp>=usr.maxhp)
> usr << "You don't need this!"
> return
> else
> usr.hp += 50
> usr << "You have gained 50 HP."
> if(usr.hp>usr.maxhp)
> usr.hp = usr.maxhp
> del(src)
> Drop()
> src.loc=locate(usr.x,usr.y,usr.z)
> Get()
> set src in oview(1)
> src.loc = usr

you screwed up the indentation here
In response to Kyubi742
Ignore everything Kyubi742 has said, it's apparent he doesn't know how to fix it either.

I would advise [link], though.
In response to Kyubi742
...What does all that other code have to do with the objs?
In response to Warlord Fred
idk i get bored XD
In response to Kaiochao
Kaiochao wrote:
Your indentation is terrible. All of the things in there are defined at the /obj level. You're defining subtypes but not putting anything inside of them.

Also, copy/paste = bad. Inheritance = good.

fix'd? >_>
sorry, perfectionist