Skip to content

Deck Format

OldManAlpha edited this page Jul 16, 2023 · 3 revisions

When you create a deck with the createdeck command, you can find json data file for the deck in the decks folder in your server directory.

Currently, this is the format for the file:

{
  "version": 2, // The version of the file, do not touch unless you know what you're doing
  "requiredMods": [
    // Array of mod names that are required to be loaded for this deck to function
  ]
  "rules": {
    // The game rules of the deck
  },
  "cards": [
    // Array of all cards in the deck
  ]
}

Let's take a look at what the Debt Collector looks like in the cards array in a vanilla deck.

"cards": [
  {
    "type": "debtCollector", // The type of the card, typically the name of the card but in camelCase.
    "amount": 3 // The amount of this card in the deck
  }
]

As you can see, there is very little information here describing the Debt Collector, only the type and how many there are in the deck. There is default information about all card types stored internally in the code, so all the information about a Debt Collector can be extrapolated from that. However, if you wish, you can deviate from the defaults and modify many attributes of the card. Here is a fully expanded Debt Collector entry:

{
  "type": "debtCollector",
  "value": 3, // The monetary value of the card
  "name": "Debt Collector", // The name of the card when hovered over in-game
  "displayName": [ // The lines of the name shown on the graphics of the card
	"DEBT",
	"COLLECTOR"
  ],
  "description": ["Select a player and charge 5M against them."], // The description of the card that shows when hovered over in-game
  "playAnimation": "Normal", // Either "Normal" or "Important", Important animations are intended for more impactful cards
  "charge": 5, // The amount this card charges (Type-exclusive attribute)
  "chargesAll": false, // "true" indicates all players should be charged; "false" indicates only 1 player should be charged (Type-exclusive attribute)
  "consumeMovesStage": "RightBeforePlay", // The playing stage when the move cost should be deducted (Options: BeforePlay, RightBeforePlay, RightAfterPlay, AfterPlay, Manual)
  "clearsUndoableActions": false, // Whether the card should remove the ability to undo any previously played cards when played; Debt Collectors don't clear undoable actions when played because they're cleared after a player is targeted
  "displayOffsetY": 1, // The y offset of the display name
  "fontSize": 6, // The font size of the display name
  "moveCost": 1, // The amount of moves this card costs to play
  "moveStage": "BeforePlay", // The playing stage when the card should move to its destination, usually the discard pile (Options: BeforePlay, RightBeforePlay, RightAfterPlay, AfterPlay, Manual)
  "outerColor": "#FFFFFF", // The outer color of the card, "#" prefix indicates an RGB hex value; "$" prefix indicates to use monetary color(example: "$2"); "~" prefix indicates property color using label(example: "~DB"); There is also an invisible "innerColor" value that can be set
  "undoable": true, // Whether the card should be undoable; Debt Collectors are declared as undoable because undoable actions are cleared after a player is targeted
  "amount": 3 // Not an attribute, just indicates how many copies of this card should be in deck
},

You can pick and choose what attributes to override. For example, let's make a Debt Collector that is worth 5M, charges 10M, and costs 2 moves to play:

{
  "type": "debtCollector",
  "value": 5,
  "description": ["Select a player and charge 10M against them. This card costs 2 moves to play."],
  "charge": 10,
  "moveCost": 2
}

Property cards have a few special fields:

{
  "type": "property",
  "amount": 1,
  "value": 3,
  "name": "Kentucky Avenue",
  "colors": ["Red"], // An array of the colors of the card (Type-exclusive attribute)
  "base": true, // Whether the card can be used a foundation for a color (Type-exclusive attribute)
  "stealable": true // Whether the card can be stolen with Sly Deals and Forced Deals (Type-exclusive attribute)
}

Rent cards also contain the colors field like property cards. Rent cards set their name dynamically unless their name is overridden with the name field.

{
  "type": "rent",
  "value": 1,
  "colors": ["Green", "Dark Blue"] // The colors the rent card can rent on (Type-exclusive attribute)
  "chargesAll": false, // This is a hidden attribute, it should not be set unless you need this card to override the game rules (Type-exclusive attribute)
}
Clone this wiki locally