ID:179492
 
Ok i am trying to make it so when you go into battle (with random combats)and if you have a certain spell and when you clik to use magice have it come up in a box showing the spells u have to use
I can do this with vars ,but i want to do it with the list()
here is what i have
This is part of the random combat code
if ("Magic")
attacker.magic += "Cancel"
var/action = input(attacker,"what spell will ya cast?","Magic") in magic
attacker.magic -= "Cancel"
switch(action)
if("Cancel")
maincombat(attacker,target)
if("Hurt")
Hurt(attacker,target)
npcattack1(attacker, target)
That is for when they click to use magic in the battle
here is the hurt proc
mob/proc/Hurt(mob/attacker as mob, mob/target as mob)
if(attacker.MP >= 3)
var/damage =rand(6,10)
target.HP -= damage
attacker.MP -= 3
attacker<<"You have casted a spell."
checklevel()
usr.klik=0
npcdeathcheck(attacker, target)
npcattack1(attacker, target)
else
usr<<"You need more MP."
usr.klik=0
/\
(not sure if this part was needed)
i have this as well
mob/var/magic=list()
and i have it to where when you gain a level
the usr.magic+="spell_name_here"
this is the problem
when i gain a level and i gain the spell i go inot combat and i click spells nothing happens
i cant figure out why ether


Thanx any one for any help the may have
SO i guess no one will help
In response to Greg
SO why did you bump your post...
In response to Stealth 2k
He did at least wait a couple of days... Ive seen them bumped after 15-20 minutes before.
In response to Flick
Flick wrote:
He did at least wait a couple of days... Ive seen them bumped after 15-20 minutes before.

I think it's fine to bump a post after a couple of days (and we're lucky when they bother to wait 15-20 minutes!)

Anyway it's a lot to read through for the request. I don't know what is stored in the magic list. If the magic list contains a set of spells stored as text names, it should work as is.

Or are the items in the list objects or what?