Ok, I have an object called Thunder which is a spell,
I have a statpanel called ("Spells/Items",usr.contents) which holds Items AND spells, you buy spells and they go in usr.contents, Items also go in usr.contents! can someone help me so I may have a statpanel for Spells and a seperate one for Items? I would really appreciate it.
ID:178914
Mar 19 2002, 7:39 pm
|
|
mob
var/list/spells = list()
Entered(O)
/* this method assumes you use Move() to get items.
when something is Move()ed into a mob's contents
mob/Entered() is automatically called. */
..() // do any other Entered() routines you've defined
if(istype(O,/obj/spell) // if a spell just entered the mob's inventory
spells += O // add it to the spells list. It is still in contents too!
Exited(O)
/* When something is Move()ed out of mob's contents
mob/Exited() is automatically called. */
..() // do any other Exited() routines you've defined
if(istype(O,/obj/spell) // if a spell just left the mob's inventory
spells -= O // remove it from the spells list
Stat()
statpanel("Items",(contents-spells))
// (contents-spells) means a list of anything in the contents list that is not in the spells list
statpanel("Spells",spells)