Hey everyone, I've been trying to work this out for days but to no avail!! Please help!
I am trying to build a deckbuilder (think games like Dominion etc) where each player has a deck of cards that they can draw. Once their deck has "run out" they shuffle their "discard pile" and that becomes their new deck.
The problem is detecting what cards they are currently holding so they don't redraw them as the new pool of cards to draw from should only be cards they've played / discarded previously.
Any help or ideas would be appreciated.
[INIT] - "Setting up my variables"
EVENTS : Map initialization
EVENTS : Player types a chat message containing DRAW
I am trying to build a deckbuilder (think games like Dominion etc) where each player has a deck of cards that they can draw. Once their deck has "run out" they shuffle their "discard pile" and that becomes their new deck.
The problem is detecting what cards they are currently holding so they don't redraw them as the new pool of cards to draw from should only be cards they've played / discarded previously.
Any help or ideas would be appreciated.
[INIT] - "Setting up my variables"
EVENTS : Map initialization
-
Set P1_DeckSize = 6
-
Set P1_DeckRemaining = 6
-
Set P1_Decklist[1] = Claws of Attack +15
-
Set P1_Decklist[2] = Crown of Kings +5
-
Set P1_Decklist[3] = Kelen's Dagger of Escape
-
Set P1_Decklist[4] = Mask of Death
-
Set P1_Decklist[5] = Orb of Frost
-
Set P1_Decklist[6] = Ring of Protection +5
EVENTS : Player types a chat message containing DRAW
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
P1_DeckRemaining Greater than 0
-
-
Then - Actions
-
Set P1_DeckCardIndex = (Random integer number between 1 and P1_DeckRemaining)
-
Set P1_CardChosen = P1_Decklist[P1_DeckCardIndex]
-
-------- --------
-
Set P1_Decklist[P1_DeckCardIndex] = P1_Decklist[P1_DeckRemaining]
-
Set P1_Decklist[P1_DeckRemaining] = P1_CardChosen
-
-------- --------
-
Set P1_DeckRemaining = (P1_DeckRemaining - 1)
-
Hero - Create P1_CardChosen and give it to Paladin 0000 <gen>
-
-
Else - Actions
-
Trigger - Run Shuffle Discard <gen> (checking conditions)
-
-
-
Set P1_DeckRemaining = P1_DeckSize
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
For each (Integer B) from 1 to P1_DeckSize, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item carried by Paladin 0000 <gen> in slot (Integer A))) Equal to P1_Decklist[(Integer B)]
-
-
Then - Actions
-
Set P1_CardChosen = P1_Decklist[(Integer B)]
-
-------- --------
-
Set P1_Decklist[(Integer B)] = P1_Decklist[P1_DeckRemaining]
-
Set P1_Decklist[P1_DeckRemaining] = P1_CardChosen
-
-------- --------
-
Set P1_DeckRemaining = (P1_DeckRemaining - 1)
-
-
Else - Actions
-
-
-
-
-