-
-
Notifications
You must be signed in to change notification settings - Fork 107
CFConst
Extends: Reference
Card Gaming Framework global Behaviour Constants
This class contains constants which handle how all the framework behaves.
Tweak the values to match your game requirements.
const ShuffleStyle: Dictionary = {"AUTO":0,"CORGI":3,"NONE":1,"OVERHAND":6,"RANDOM":2,"SNAP":5,"SPLASH":4}
Options for pile shuffle styles.
- auto: Will choose a shuffle animation depending on the amount of cards in the pile.
- none: No shuffle animation for this pile.
- random: Will choose a random shuffle style each time a shuffle is requested.
- corgi: Looks better on a small amount of cards (0 to 30)
- splash: Looks better on a moderate amount of cards (30+)
- snap: For serious people with no time to waste.
- overhand: Shuffles deck in 3 vertical raises. Best fit for massive amounts (60+)
const ReturnCode: Dictionary = {"CHANGED":1,"FAILED":2,"OK":0}
The possible return codes a function can return
- OK is returned when the function did not end up doing any changes
- CHANGE is returned when the function modified the card properties in some way
- FAILED is returned when the function failed to modify the card for some reason
const ARRAY_PROPERTY_JOIN: String = " - "
This is used when filling in card property labels in Card.setup() when the property is an array, the label will still display it as a string but will have to join its elements somehow.
const ATTACHMENT_OFFSET: Array = ["(-0.2, -0.2)","(0, -0.2)","(0.2, -0.2)","(0.2, 0)","(-0.2, 0)","(-0.2, 0.2)","(0, 0.2)","(0.2, 0.2)"]
Here you can adjust the amount of offset towards a side of their host card that attachments are placed.
This is a multiplier based on the card size.
You define which placement offset an attachment uses by setting the "attachment_offset" exported variable on the card scene
const BOTTOM_MARGIN_MULTIPLIER: float = 0.5
The margin towards the bottom of the viewport on which to draw the cards.
More than 0 and the card will appear hidden under the display area.
Less than 0 and it will float higher than the bottom of the viewport
const CARD_SCALE_WHILE_DRAGGING: Vector2 = "(0.4, 0.4)"
The below scales down cards down while being dragged.
if you don't want this behaviour, change it to Vector2(1,1)
const CARD_SET_NAME_PREPEND: String = "SetDefinition_"
The text which is prepended to files to signify the contain Card definitions for a specific set
const CARD_SIZE: Vector2 = "(150, 240)"
The card size you want your cards to have. This will also adjust all CardContainers to match If you modify this property, you must adjust the min_rect of the various control nodes inside the card front and back scenes.
const CostsState: Dictionary = {"DECREASED":"0.65,1.3,0,1.3","IMPOSSIBLE":"1.3,0,0,1.3","INCREASED":"1.3,0.65,0,1.3","OK":"1,1,1,1"}
The below const defines what string to put between these elements. Returns a color code to be used to mark the state of cost to pay for a card
- IMPOSSIBLE: The cost of the card cannot be paid.
- INCREASED: The cost of the card can be paid but is increased for some reason.
- DECREASED: The cost of the card can be paid and is decreased for some reason.
- OK: The cost of the card can be paid exactly.
const DECKS_PATH: String = "user://Decks/"
The location where this game will store deck files
const FANCY_MOVEMENT: bool = true
Switch this off to disable fancy movement of cards during draw/discard
const FOCUS_HOVER_COLOUR: Color = "1,1,1,1"
The colour to use when hovering over a card.
Reduce the multiplier to reduce glow effect or stop it altogether
const FOCUS_STYLE: int = 2
The focus style selected for this game. See enum FocusStyle
const HAND_USE_OVAL_SHAPE: bool = true
If set to true, the hand will be presented in the form of an oval shape If set to false, the hand will be presented with all cards horizontally aligned
If you allow the player to modify this with cfc.set_settings() Then that will always take priority
const HOST_HOVER_COLOUR: Color = "1,0.8,0,1"
The colour to use when hovering over a card with an attachment to signify a valid host.
We multiply it a bit to make it as bright as FOCUS_HOVER_COLOUR for the glow effect.
Reduce the multiplier to reduce glow effect or stop it altogether
const NEIGHBOUR_PUSH: float = 0.75
The amount of distance neighboring cards are pushed during card focus
It's based on the card width. Bigger percentage means larger push.
const PATH_ALTERANT_ENGINE: String = "res://src/core/AlterantEngine.gd"
This specifies the path to the Alterant Engine. If you wish to extend The alterant engine functionality with your own tasks, Point this to your own script file.
const PATH_ASSETS: String = "res://assets/"
The path where assets needed by this game are placed such as token images
const PATH_CARDS: String = "res://src/custom/cards/"
The path where card template scenes exist. These is usually one scene per type of card in the game
const PATH_CORE: String = "res://src/core/"
The path where the Card Game Framework core files exist. (i.e. mandatory scenes and scripts)
const PATH_CUSTOM: String = "res://src/custom/"
The path where scenes and scripts customized for this specific game exist (e.g. board, card back etc)
const PATH_DECKBUILDER: String = "res://src/core/DeckBuilder/DeckBuilder.tscn"
The location of the deckbuilder scene used by this game.
const PATH_MOUSE_POINTER: String = "res://src/core/MousePointer.tscn"
This specifies the path to the MousePointer. If you wish to extend The mouse pointer functionality with your own code, Point this to your own scene file with a scrip extending Mouse Pointer.
const PATH_SCRIPTING_ENGINE: String = "res://src/core/ScriptingEngine.gd"
This specifies the path to the Scripting Engine. If you wish to extend The scripting engine functionality with your own tasks, Point this to your own script file.
const PATH_SCRIPT_PER: String = "res://src/core/ScriptPer.gd"
This specifies the path to the ScriptPer class file. We don't reference is by class name to avoid cyclic dependencies And this also allows other developers to extend its functionality
const PATH_SETS: String = "res://src/custom/cards/sets/"
The path where the set definitions exist. This includes Card definition and card script definitions.
const PATH_TOKENS: String = "res://assets/tokens/"
This specifies the location of your token images. Tokens are always going to be seeked at this location
const PLAY_AREA_SCALE: Vector2 = "(0.8, 0.8)"
The scale of a card while on the play area
const SCRIPT_SET_NAME_PREPEND: String = "SetScripts_"
The text which is prepended to files to signify the contain script definitions for a specific set
const SETTINGS_FILENAME: String = "user://CGFSettings.json"
The location and name of the file into which to store game settings
const SHOW_TOKEN_BUTTONS: bool = false
If true, each token will have a convenient +/- button when expanded to allow the player to add a remove more of the same
const TARGETTING_ARROW_COLOUR: Color = "0,0.52,1.3,1.3"
The colour to use when hovering over a card with an targetting arrow to signify a valid target
We are using the same colour as the TARGET_HOVER_COLOUR since they they match purpose
You can change the colour to something else if you want however
const TARGETTING_ARROW_COLOUR: Color = "0,0.52,1.3,1.3"
The colour to use when hovering over a card with an targetting arrow to signify a valid target
We are using the same colour as the TARGET_HOVER_COLOUR since they they match purpose
You can change the colour to something else if you want however
const TOKENS_MAP: Dictionary = {"bio":"green.svg","blood":"red.svg","gold coin":"yellow.svg","industry":"grey.svg","magic":"purple.svg","plasma":"blue.svg","tech":"blue.svg","void":"black.svg"}
This dictionary contains your defined tokens for cards
The key is the name of the token as it will appear in your scene and labels Please use lowercase only for the key
The value is the filename which contains your token image. The full path will be constructed using the PATH_TOKENS variable
This allows us to reuse a token image for more than 1 token type
const TOKENS_ONLY_ON_BOARD: bool = true
If this is set to false, tokens on cards will not be removed when they exit the board