cards
Module that handles all the inner mechanics of libarcomage.
Players. Supports more than 2. TODO to implement it.
Whether this turn is discard only.
Indicates whether the Queue is set up already.
Number of the player whose turn it is. This is an absolute value.
Number of the player who will go next.
Number of the player whose turn ended before.
Cards in the bank.
Countdown until a reshuffling is needed.
Defines functions and sends them over to Lua.
Shuffles the card queue using the Fisher-Yates algorithm
Pops and returns the next card in the queue and moves the ShuffleTimer down.
Pushes the card into the queue.
Changes the AI priority of the given card by looking at the general trends of the game. This is not specific to any card; card-specific code goes to Lua.
Bugs
Cards should use tags to denote which cards increase tower, which damage etc.
Return Value
Altered priority.
Check whether the card the payer is attempting to play is playable.
Functionality when playing a card.
Discussion
Plays the animation, handles the turn sequence, distributes resources
Parameters: CardPlace = The number of the card in the player's hand. Discarded = Whether this card is to be discarded.
Figures out what exactly the played card changed and writes it into StatChanges. Needed for the MArcomage card abilities.
Executes the card to get the number of the player that is supposed to move next.
Checks whether the card effect made us go out of bounds, and if it did, makes the values stay within acceptable limits.