ob/card_player
icon='suppchar.dmi'
icon_state="card"
verb/play()
set src in view(1)
var/randturn=rand(0,1)
if(!randturn)
usr.turn=1
src.turn=0
if(randturn)
usr.turn=0
src.turn=1
while(1)
var/oppcard=pick(src.hand)
var/mycard=input("Which card?") in usr.hand
view(5) << "[src] plays [oppcard] with attack of [oppcard.atk] and defense of [oppcard.def]"
view(5) << "[usr] plays [mycard] with attack of [mycard.atk] and defense of [mycard.def]"
sleep(1)
obj/punch_card
var/atk = 0
var/def = 0
icon='card.dmi'
New(a,b,i)
atk = a
def = b
icon_state="[i]"
Problem description:The computer randomly picks a card from the list called hand and I pick a card from my list also called hand but DM gives me an error when I input something like [mycard.atk] when it has an atk variable. How do I get around this?
This won't actually work if usr.hand doesn't contain any /obj/punch_card s