ID:168066
 
obj/Pack
icon_state = "Pack"
icon = 'Card Back.dmi'
verb/Open()
set src in usr
usr.overlays = 'Card Covers.dmi'
usr << "The pack reveals..."
sleep(5)
var/cards = pick(typesof(/obj/card/LOB/Normal))
var/obj/A = new cards
A.loc = usr
var/cards2 = pick(typesof(/obj/card/LOB/Normal))
var/obj/B = new cards2
B.loc = usr
var/cards3 = pick(typesof(/obj/card/LOB/Normal))
var/obj/C = new cards3
C.loc = usr
var/cards4 = pick(typesof(/obj/card/LOB/Normal))
var/obj/D = new cards4
D.loc = usr
var/cards5 = pick(typesof(/obj/card/LOB/Normal))
var/obj/E = new cards5
E.loc = usr
var/cards6 = pick(typesof(/obj/card/LOB/Normal))
var/obj/F = new cards6
F.loc = usr
var/cards7 = pick(typesof(/obj/card/LOB/Normal))
var/obj/G = new cards7
G.loc = usr
var/cards8 = pick(typesof(/obj/card/LOB/Normal))
var/obj/H = new cards8
H.loc = usr
var/cards9 = pick(typesof(/obj/card/LOB/Normal))
var/obj/I = new cards9
I.loc = usr
var/cards10 = pick(typesof(/obj/card/LOB/Rare))
var/obj/R = new cards10
R.loc = usr
del(src)
verb/Get()
set src in view(1)
loc = usr
New()
src.icon_state = "Pack"

obj/card/LOB/Normal/Monster
icon = 'Card Back.dmi'
icon_state = "Normal"
Hitotsu_Me_Giant
name = "Hitotsu-Me Giant"
Skull_Servant
Basic_Insect
//info="This legendary dragon is a powerful engine of destruction. Virtually invincible, very few have faced this awesome creature and lived to tell the tale."
obj/card/LOB/Rare/Monster
icon = 'Card Back.dmi'
icon_state = "Spell"
Tri_Horned_Dragon
name = "Tri-Horned Dragon"
Celtic_Guardian
Blue_Eyes_White_Dragon
Dark_Magician
Gaia_The_Fierce_Knight


It's all fine and dandy until sometimes I Open a booster pack and Normal, Rare, or Monster shows up, a potentially useless card with a blank name

What should I Do :(? Thanks
typesof() will always list the parent, all you have to do is something like:
typesof(/obj/my_obj)-/obj/my_obj
In response to Nadrew
Thanks bunches, Nadrew. :D!

I'm trying this right now

var/cards = pick(typesof(/obj/card/LOB/Normal) - /obj/card/LOB/Normal/Monster - /obj/card/LOB/Rare/Monster - /obj/card/LOB - obj/card/LOB/Normal - obj/card/LOB - Rare)


I think its working for now
In response to BarryC
BarryC wrote:
Thanks bunches, Nadrew. :D!

I'm trying this right now

var/cards = pick(typesof(/obj/card/LOB/Normal) - /obj/card/LOB/Normal/Monster - /obj/card/LOB/Rare/Monster - /obj/card/LOB - obj/card/LOB/Normal - obj/card/LOB - Rare)


I think its working for now

Spoke too soon, Now I'm getting around 80 errors ;P, can you show me a little more specific? I don't know how to do multiple removings of the root

I think I got it working now... tried a comma :P
In response to Nadrew
Argh...How do I remove two parent types?

I got this far and it removes everything except one thing

var/cards = pick(typesof(/obj/card/LOB/Normal/) - /obj/card/LOB/Normal)
var/obj/A = new cards
A.loc = usr

I still sometimes get /obj/card/LOB/Normal/Monster instead of a designated monster. Please help
In response to BarryC
Argh...How do I remove two parent types?

I got this far and it removes everything except one thing

var/cards = pick(typesof(/obj/card/LOB/Normal/) - /obj/card/LOB/Normal)
var/obj/A = new cards
A.loc = usr

I still sometimes get /obj/card/LOB/Normal/Monster instead of a designated monster. Please help.