*Choose Deck from List
*Draw cards from Deck and add into usr.contents
Here's what I have so far
Code:
obj
var
Name
Level = 1
Attribute = list("Light","Dark","Fire","Water","Earth","Wind","Divine")
Type = list("Aqua", "Beast", "Beast-Warrior", "Creator God", "Dinosaur", "Divine-Beast", "Dragon", "Fairy", "Fiend", "Fish", "Insect", "Machine", "Plant", "Psychic", "Pyro", "Reptile", "Rock", "Sea Serpent", "Spellcaster", "Thunder", "Warrior", "Winged Beast", "Zombie")
Monster_Type = list("Normal", "Effect", "Ritual", "Fusion", "Spell", "Trap", "Synchro", "XYZ", "Dark Synchro")
Spell_Type = list("Normal", "Continuous", "Field", "Equip", "Quick-Play", "Ritual", "Speed Spell")
Trap_Type = list("Normal", "Continuous", "Counter")
ATK = 0
DEF = 0
Pack = new/list()
Cards
LOB000
Name = "Tri-Horned Dragon"
Level = 8
Attribute = "Dark"
Type = "Dragon"
Monster_Type = "Normal"
ATK = 2850
DEF = 2350
Pack = "Legend of the Blue-Eyes White Dragon"
LOB001
Name = "Blue-Eyes White Dragon"
Level = 8
Attribute = "Light"
Type = "Dragon"
Monster_Type = "Normal"
ATK = 3000
DEF = 2500
Pack = "Legend of the Blue-Eyes White Dragon"
__________________________________________________
var/list/Decklist = list()
mob
proc
ChooseDeck()
usr = (input("Choose your deck",,) in list(Decklist))
Duel_Verbs
verb
Draw()
set category = "Duel Commands"
for(var/obj/Cards/C in world)
Decklist += C
I know it is not much, but I just can't seem to figure out the rest.
Instead of having the hand as the players contents (usr.contents) I made a new variable for the hand and I also made a variable for the main deck that the player is using.
And when the player draws I would remove the top most cards from the deck and add it to the hand. So my draw proc looks something like this.
This code takes the top most cards in the deck (the last one added to it) and removes it then adds it to the hand.
Now onto your other problem. To select a deck from the list it would be something like this.
What I have shown you is very basic and is in no way complete. For example the draw proc should check if there are no more cards left in the deck and end the duel.
Hopefully this starts you off, please post your progress and any other problems.