- Open up
DBs/cards.json
- Observe the pattern and copy it.
- You may add ANY VARIABLE YOU WANT.
- Health? Damage? Size? Sprite? Weight? Cost?
- Whatever! Just add it! You can use it~!
Returns the big json of DBs/cards.json
Creates a new Card
, this method should not be used when possible
Returns Card
from DECK
based on ID
Card.findFromId(player.hand, 2)
Returns Card
from DECK
based on NAME
Card.findFromName(player.hand, "smite")
Returns a random Card
from DECK
Card.findFromRandom(player.hand)
Returns the index of a Card
in DECK
from ID
Card.findIndexFromId(player.hand, "smite")
Moves a Card
from INITIALDECK
to TARGETDECK
from ID
Returns nothing
Card.moveFromId(player.hand, player.discard, 3)
Makes a copy of a Card
from INITIALDECK
to TARGETDECK
from ID
Returns nothing
Card.copyFromId(game.allCards, player.main, 2)
Shuffles the Cards
in DECK
, randomizes each Card
position in DECK
Returns nothing
Card.shuffleDeck(player.hand)
This is where you put in functions to be used from cards.
Consult spec/test-spec.js
for calling functions based on strings
CardFunc[thisCard.function](thisCard.funcvar1)
For the previous example, it assumes funcvar1
is stated in cards.json
Creates a new Game object, try to only make 1 of these, and use it as a "master object"
Loads all the cards from ApiHelper.get()
and puts it in GAME.allCards
, this method should not be used when possible