ID:1402109
 
(See the best response by Kaiochao.)
Code:
var/list/Monsters_on_Field = list()
var/Monsters_Played = 0
verb
Summon(obj/Cards/C as obj in usr.Hand)
if(C.Level==5||6)
for(var/obj/Cards/A in usr.Monsters_on_Field)
var/select = input(A, "What would you like to tribute?", "Tribute Monster") in list(usr.Monsters_on_Field)
if(select == "Monster")
usr.Monsters_on_Field -= A
usr.Monsters_Played --
del A
usr.Monsters_on_Field += C
usr.Monsters_Played ++
C.loc = A.loc


Problem description:

What I am trying to do is select a monster on the "field", delete that monster, and summon a monster of a higher level (5 or 6) from the "Hand" (statpanel contents list). For some reason, the input does not show up, and I am getting errors like crazy. Also, the monster does NOT appear on the field from the hand. Can someone help me with this?
if(C.Level==5||6)

If this was english this would be: If C's level is 5, or if 6.
That comma matters on what this is saying. It is pretty much two if statements: if(C.level==5) or if(6). You should probably have if(C.level==(5||6)), at least I'm pretty sure - technically you could just check if the level is level 5 or higher.

Also, you delete A and then try to read it's location. Try saving it's location before you delete into a var like var/a_loc=A.loc so you can call on it but not depend on A to be there.
also "input(A" need to be "input(src"

                        var/select = input(src, "What would you like to tribute?", "Tribute Monster") in list(usr.Monsters_on_Field)

Ah, missed that one.
In response to Jittai
C.level==(5||6) is equivalent to C.level == 5, as (5||6) evaluates to 5 (which is the original problem).
So it's better to just split it or go for a >= ?
In response to Jittai
Best response
There's a huge difference between "x==5 || x==6" and "x>=5", and it really depends on the context and what the creator's actual intentions are. It's not like one is a generally better choice than the other.
In this case he seems to be making/mimicing Duel Monsters, only reason I suggested >=.
if(C.level in 5 to 6) would work
if(C.Level in 5 to 6)
for(var/obj/Cards/A in usr.Monsters_on_Field)
var/a_loc = A.loc
var/select = input(src, "What would you like to tribute?", "Tribute Monster") as null | anything in src.Monsters_on_Field
if(!select || select == null) return
if(select == A)
src.Monsters_on_Field -= A
src.Monsters_Played --
del A
src.Monsters_on_Field += C
src.Monsters_Played ++
Hand.Remove(C)
C.dir = usr.dir
C.loc = a_loc


I figured it out, although, the input shows up again after I confirm my descision. Any ideas why this is happening?
In response to Yucide
Do you know what for() does and why you're using it?
It loops, so techincally, I am repeating the input process and that's why I am having my problem?
bump