Skip to content

ScriptProperties

Divided by Zer0 edited this page Mar 9, 2022 · 12 revisions

ScriptProperties

Extends: Reference

Description

This class provides a library for constants which are used a key values in the Card Script Definition

It also provides a few static functions for comparing filters

Constants Descriptions

FILTER_CARD_COUNT

const FILTER_CARD_COUNT: String = "filter_card_count"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Executes the script, only if the specified counter has the requested value.

Requires a KEY_COUNTER_NAME and FILTER_COUNT specified. Optionally also KEY_COMPARISON Value Type: int.

Filter used for checking against the amount of cards found with FILTER_PER_TUTOR and FILTER_PER_BOARDSEEK and needs to be placed within those dictionaries

FILTER_CARD_NAME

const FILTER_CARD_NAME: String = "filter_card_name"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME

FILTER_CLASS

const FILTER_CLASS: String = "filter_class"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Executes the script, only if the specified counter has the requested value.

Requires a KEY_COUNTER_NAME and FILTER_COUNT specified. Optionally also KEY_COMPARISON Value Type: int.

Filter used for checking against the amount of cards found with FILTER_PER_TUTOR and FILTER_PER_BOARDSEEK and needs to be placed within those dictionaries Value Type: String.

Filter used for checking against the group the card or object belongs to Value Type: String.

Filter used for checking against the value of the get_class() of an object

FILTER_COUNT

const FILTER_COUNT: String = "filter_count"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state

FILTER_COUNT_DIFFERENCE

const FILTER_COUNT_DIFFERENCE: String = "filter_count_difference"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative

FILTER_DEGREES

const FILTER_DEGREES: String = "filter_degrees"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES

FILTER_DESTINATION

const FILTER_DESTINATION: String = "filter_destination"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION

FILTER_FACEUP

const FILTER_FACEUP: String = "filter_faceup"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP

FILTER_GROUP

const FILTER_GROUP: String = "filter_group"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Executes the script, only if the specified counter has the requested value.

Requires a KEY_COUNTER_NAME and FILTER_COUNT specified. Optionally also KEY_COMPARISON Value Type: int.

Filter used for checking against the amount of cards found with FILTER_PER_TUTOR and FILTER_PER_BOARDSEEK and needs to be placed within those dictionaries Value Type: String.

Filter used for checking against the group the card or object belongs to

FILTER_MODIFIED_PROPERTIES

const FILTER_MODIFIED_PROPERTIES: String = "filter_modified_properties"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange"

FILTER_MODIFIED_PROPERTY_NEW_VALUE

const FILTER_MODIFIED_PROPERTY_NEW_VALUE: String = "new_value"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE

FILTER_MODIFIED_PROPERTY_PREV_VALUE

const FILTER_MODIFIED_PROPERTY_PREV_VALUE: String = "previous_value"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE

FILTER_PARENT

const FILTER_PARENT: String = "filter_parent"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script. Value Type: Int (default: 0)

How many cards need to be selected from the selection window Value Type: String (default: 'min') How to evaluate SELECTION_COUNT before the player is allowed to proceed

  • 'min': The minimum amount of cards that need to be selected
  • 'equal': The exact amount of cards that need to be selected
  • 'max': The maximum amount of cards that need to be selected Value Type: Bool (default: False)

Marks a selection window as optional. This means the player can opt to select none of the possible choices. In which case, the underlying task will be considered invalid and if it is a cost, it will also abort further execution. Value Type: Bool (default: False)

Ignores the card executing the script from the selection window This is necessary in some instances where the selection encompases the scripting card, but this is unwanted. For example because the card is supposed to already be in a different pile but this will only technically happen as the last task. Value Type: Array

Initiates a new instance of the scripting engine Which runs through the specified task list using its own cost calculations Value Type: Int

Repeats the whole task this amount of times. Careful when adding it to a task with a target, as it will force the targeting the Value Type: Bool.

If true, then the script will be considered to have failed if any of the task filters fail. (Normally the task is merely skipped). This will cause an [KEY_IS_COST](#LEY_IS_COST] to abort all effects. Value Type: Bool.

Skips fancy anymation when spawning a new card and simply places it in its final destination immediately.

Filter Definition Keys

The below are all the possible dictionary keys that can be set in a filter definition. Most of them are only relevant for a specific task type

Value Type: Array

Filter used for checking against the Card state

The name of this key is left open ended, as the check can be run either against the trigger card, or the subjects card.

One of the following strings has to be appended at the end of this string:

  • "trigger": Will only filter cards triggering this effect via signals or cards triggering an alterant effect.
  • "subject": Will only filter cards that are looked up as targets for the effect.
  • "seek": Will only filter cards that are automatically sought on the board.
  • "tutor": Will only filter cards that are automaticaly sought in a pile.

see check_validity()

The content of this value has to be an array of dictionaries The different elements in the array act as an "OR" check. If any of the dictionary filters matches, then the card will be considered a valid target.

Each filter dictionary has to contain at least one of the various FILTER_ Keys All the FILTER_ keys act as an "AND" check. The Dictionary filter will only match, if all the filters requested match the card's state.

This allows a very high level of flexibility in filtering exactly the cards required.

Here's a particularly complex script example that can be achieved:

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": [
			{"filter_tokens": [
				{"filter_token_name": "void",
				"filter_token_count": 1,
				"comparison": "gt"},
				{"filter_token_name": "blood"}
			],
			"filter_properties": {"Type": "Barbarian"}},
			{"filter_properties": {"Type": "Soldier"}}
		],
		"degrees": 90}
	]
}

This example would roughly translate to the following ability: "Rotate to 90 degrees all barbarians with more than 1 void tokens and at least 1 blood token, as well as all soldiers." Value Type: Dictionary

Filter used for checking against the Card properties

Each value is a dictionary where the key is a card property, and the value is the desired property value to match on the filtered card.

If the card property is numerical, then the value can be a string. In that case it is assumed that the string is a counter name against which to compare the property value Value Type: String.

Filter used for checking against the parent node of a subject. Only used within the FILTER_STATE Dictionary

The value should be the name of a Card Container or "board"

FILTER_PER_BOARDSEEK

const FILTER_PER_BOARDSEEK: String = "filter_per_boardseek_count"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified

FILTER_PER_COUNTER

const FILTER_PER_COUNTER: String = "filter_per_counter"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified Value Type: Dictionary

Executes the script, only if the specified counter has the requested value.

Requires a KEY_COUNTER_NAME and FILTER_COUNT specified. Optionally also KEY_COMPARISON

FILTER_PER_TUTOR

const FILTER_PER_TUTOR: String = "filter_per_tutor_count"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME Value Type: String

Filter used for checking against KEY_CARD_NAME Value Type: Dictionary

Requires similar input as KEY_PER_BOARDSEEK But also needs FILTER_CARD_COUNT specified

FILTER_PROPERTIES

const FILTER_PROPERTIES: String = "filter_properties"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script. Value Type: Int (default: 0)

How many cards need to be selected from the selection window Value Type: String (default: 'min') How to evaluate SELECTION_COUNT before the player is allowed to proceed

  • 'min': The minimum amount of cards that need to be selected
  • 'equal': The exact amount of cards that need to be selected
  • 'max': The maximum amount of cards that need to be selected Value Type: Bool (default: False)

Marks a selection window as optional. This means the player can opt to select none of the possible choices. In which case, the underlying task will be considered invalid and if it is a cost, it will also abort further execution. Value Type: Bool (default: False)

Ignores the card executing the script from the selection window This is necessary in some instances where the selection encompases the scripting card, but this is unwanted. For example because the card is supposed to already be in a different pile but this will only technically happen as the last task. Value Type: Array

Initiates a new instance of the scripting engine Which runs through the specified task list using its own cost calculations Value Type: Int

Repeats the whole task this amount of times. Careful when adding it to a task with a target, as it will force the targeting the Value Type: Bool.

If true, then the script will be considered to have failed if any of the task filters fail. (Normally the task is merely skipped). This will cause an [KEY_IS_COST](#LEY_IS_COST] to abort all effects. Value Type: Bool.

Skips fancy anymation when spawning a new card and simply places it in its final destination immediately.

Filter Definition Keys

The below are all the possible dictionary keys that can be set in a filter definition. Most of them are only relevant for a specific task type

Value Type: Array

Filter used for checking against the Card state

The name of this key is left open ended, as the check can be run either against the trigger card, or the subjects card.

One of the following strings has to be appended at the end of this string:

  • "trigger": Will only filter cards triggering this effect via signals or cards triggering an alterant effect.
  • "subject": Will only filter cards that are looked up as targets for the effect.
  • "seek": Will only filter cards that are automatically sought on the board.
  • "tutor": Will only filter cards that are automaticaly sought in a pile.

see check_validity()

The content of this value has to be an array of dictionaries The different elements in the array act as an "OR" check. If any of the dictionary filters matches, then the card will be considered a valid target.

Each filter dictionary has to contain at least one of the various FILTER_ Keys All the FILTER_ keys act as an "AND" check. The Dictionary filter will only match, if all the filters requested match the card's state.

This allows a very high level of flexibility in filtering exactly the cards required.

Here's a particularly complex script example that can be achieved:

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": [
			{"filter_tokens": [
				{"filter_token_name": "void",
				"filter_token_count": 1,
				"comparison": "gt"},
				{"filter_token_name": "blood"}
			],
			"filter_properties": {"Type": "Barbarian"}},
			{"filter_properties": {"Type": "Soldier"}}
		],
		"degrees": 90}
	]
}

This example would roughly translate to the following ability: "Rotate to 90 degrees all barbarians with more than 1 void tokens and at least 1 blood token, as well as all soldiers." Value Type: Dictionary

Filter used for checking against the Card properties

Each value is a dictionary where the key is a card property, and the value is the desired property value to match on the filtered card.

If the card property is numerical, then the value can be a string. In that case it is assumed that the string is a counter name against which to compare the property value

FILTER_SOURCE

const FILTER_SOURCE: String = "filter_source"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE

FILTER_STATE

const FILTER_STATE: String = "filter_state_"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script. Value Type: Int (default: 0)

How many cards need to be selected from the selection window Value Type: String (default: 'min') How to evaluate SELECTION_COUNT before the player is allowed to proceed

  • 'min': The minimum amount of cards that need to be selected
  • 'equal': The exact amount of cards that need to be selected
  • 'max': The maximum amount of cards that need to be selected Value Type: Bool (default: False)

Marks a selection window as optional. This means the player can opt to select none of the possible choices. In which case, the underlying task will be considered invalid and if it is a cost, it will also abort further execution. Value Type: Bool (default: False)

Ignores the card executing the script from the selection window This is necessary in some instances where the selection encompases the scripting card, but this is unwanted. For example because the card is supposed to already be in a different pile but this will only technically happen as the last task. Value Type: Array

Initiates a new instance of the scripting engine Which runs through the specified task list using its own cost calculations Value Type: Int

Repeats the whole task this amount of times. Careful when adding it to a task with a target, as it will force the targeting the Value Type: Bool.

If true, then the script will be considered to have failed if any of the task filters fail. (Normally the task is merely skipped). This will cause an [KEY_IS_COST](#LEY_IS_COST] to abort all effects. Value Type: Bool.

Skips fancy anymation when spawning a new card and simply places it in its final destination immediately.

Filter Definition Keys

The below are all the possible dictionary keys that can be set in a filter definition. Most of them are only relevant for a specific task type

Value Type: Array

Filter used for checking against the Card state

The name of this key is left open ended, as the check can be run either against the trigger card, or the subjects card.

One of the following strings has to be appended at the end of this string:

  • "trigger": Will only filter cards triggering this effect via signals or cards triggering an alterant effect.
  • "subject": Will only filter cards that are looked up as targets for the effect.
  • "seek": Will only filter cards that are automatically sought on the board.
  • "tutor": Will only filter cards that are automaticaly sought in a pile.

see check_validity()

The content of this value has to be an array of dictionaries The different elements in the array act as an "OR" check. If any of the dictionary filters matches, then the card will be considered a valid target.

Each filter dictionary has to contain at least one of the various FILTER_ Keys All the FILTER_ keys act as an "AND" check. The Dictionary filter will only match, if all the filters requested match the card's state.

This allows a very high level of flexibility in filtering exactly the cards required.

Here's a particularly complex script example that can be achieved:

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": [
			{"filter_tokens": [
				{"filter_token_name": "void",
				"filter_token_count": 1,
				"comparison": "gt"},
				{"filter_token_name": "blood"}
			],
			"filter_properties": {"Type": "Barbarian"}},
			{"filter_properties": {"Type": "Soldier"}}
		],
		"degrees": 90}
	]
}

This example would roughly translate to the following ability: "Rotate to 90 degrees all barbarians with more than 1 void tokens and at least 1 blood token, as well as all soldiers."

FILTER_TAGS

const FILTER_TAGS: String = "filter_tags"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition.

FILTER_TASK

const FILTER_TASK: String = "filter_task"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

Value Type: Dictionary.

Filter key used for checking against card_properties_modified details.

Checking for modified properties is a bit trickier than other filters A signal emited from modified properties, will include as values the property name changed, and its new and old values.

The filter specified in the card script definition, will have as the requested property filter, a dictionary inside the card_scripts with the key FILTER_MODIFIED_PROPERTIES.

Inside that dictionary will be another dictionary with one key per property. That key inside will (optionally) have yet another dictionary within, with specific values to filter. A sample filter script for triggering only if a specific property was modified would look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
	}],
	"filter_modified_properties":
		{
			"Type": {}
		},
	"trigger": "another"}
}

The above example will trigger only if the "Type" property of another card is modified. But it does not care to what value the Type property changed.

A more advanced trigger might look like this:

{"card_properties_modified": {
	"hand": [{
		"name": "flip_card",
		"subject": "self",
		"set_faceup": false
		}],
	"filter_modified_properties": {
		"Type": {
			"new_value": "Orange",
			"previous_value": "Green"
		}
	},
	"trigger": "another"}
}

The above example will only trigger on the "Type" property changing on another card, and only if it changed from "Green" to "Orange" Value Type: String.

Filter used for checking against TRIGGER_NEW_PROPERTY_VALUE Value Type: String.

Filter used for checking against TRIGGER_PREV_PROPERTY_VALUE Value Type: String or Array of Strings

A number of keywords to try and match against KEY_TAGS passed by the script or signal definition. Value Type: String

Filter used for checking against TRIGGER_TASK_NAME

FILTER_TOKENS

const FILTER_TOKENS: String = "filter_tokens"

Value Type: int.

Filter used in for checking against TRIGGER_DEGREES Value Type: bool.

Filter for checking against TRIGGER_FACEUP Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_SOURCE Value Type: String.

The value should be the name of a CardContainer or "board"

Filter for checking against TRIGGER_DESTINATION Value Type: int.

Filter used for checking against TRIGGER_NEW_COUNT and in check_state Value Type: String

Filter used to check if the modification is positive or negative Value Type: Dictionary

Filter used for checking in check_state It contains a list of dictionaries, each detailing a token state that is wished on this subject. If any of them fails to match, then the whole filter fails to match.

This allows us to check for multiple tokens at once. For example: "If target has a blood and a void token..."

The below sample script, will rotate all cards which have any number of void tokens and exactly 1 bio token, 90 degrees

"manual": {
	"hand": [
		{"name": "rotate_card",
		"subject": "boardseek",
		"subject_count": "all",
		"filter_state_seek": {
			"filter_tokens": [
				{"filter_token_name": "void"},
				{"filter_token_name": "bio",
				"filter_token_count": 1},
			]
		},
		"degrees": 90}
	]
}

KEY_ABORT_ON_COST_FAILURE

const KEY_ABORT_ON_COST_FAILURE: String = "abort_on_cost_failure"

Script Definition Keys

The below are all the possible dictionary keys that can be set in a task definition. Most of them are only relevant for a specific task type

Value Type: String

Determines which card, if any, this script will try to affect.

If key does not exist, we set value to [], thereogr assuming there's no card subjects needed for the task.

If you need to adjust the amount of cards modified by the script also use KEY_SUBJECT_COUNT If this is the value of the KEY_SUBJECT key, we initiate targetting from the owner card If this is the value of the KEY_SUBJECT key, then the task affects the owner card only. If this is the value of the KEY_SUBJECT key, during KEY_ALTERANTS scripts using KEY_PER then the script will check against trigger card only.

If this is the value of the KEY_SUBJECT key, during normal scripts tasks then the tasks that do not match the triggers will be skipped but the script will still pass its cost check This allows the same trigger, to have different tasks firing, depending on the trigger card. If this is the value of the KEY_SUBJECT key, then we search all cards on the table by node order, and return candidates equal to KEY_SUBJECT_COUNT that match the filters.

This allows us to make tasks which will affect more than 1 card at the same time (e.g. "All Soldiers") If this is the value of the KEY_SUBJECT key, then we search all cards on the specified pile by node order, and pick the first candidate that matches the filter

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we pick the card on the specified source pile by its index among other cards.

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we use the subject specified in the previous task Value Type: Bool (Default = False)

If this is set, the subjects found by this task, will not overwrite the previous subjects found by the previous task

This is important in case the current task uses a filter on the subjects, but when the previous subject doesn't march, we went to retain the previous subjects anyway for the next script in the line. Without this flag, the previous subjects will be wiped (set to an empty array) as the filters didn't match. Value Type: Bool (Default = False)

This is a special property for the KEY_PER dictionary in combination with a KEY_SUBJECT_V_PREVIOUS value. It specifies that the subject for the per seek should be the prev_subjects passed to the task which calls this KEY_PER. As opposed to a normal KEY_SUBJECT_V_PREVIOUS behaviour inside per, which will use the same subjects as the parent task. Value Type: Dynamic (Default = 1)

Used when we're seeking a card to limit the amount to retrieve to this amount.

Works with the following tasks and KEY_SUBJECT values:

Useful with the following values:

This key is used to mark a task as being a cost requirement before the rest of the defined tasks can execute.

If any tasks marked as costs will not be able to fulfil, then the whole script is not executed.

Likewise, if the script has a KEY_SUBJECT, and less than KEY_SUBJECT_COUNT are found, then the whole script is not executed.

Currently the following tasks support being set as costs:

This key is used to mark a task as requiring at least one valid subject for its smooth operation. While you can mark the task as cost to achieve a similar effect, this conflicts when the effect done is optional, but you still need to have selected a target to use with subsequent "previous" subjects.

This for example allows you to have a script which removes tokens from a target card but still continue to other subsequent tasks if the target has no tokens.

Like costs, these tasks are evaluated first. Along with the costs but unlike is_cost, these tasks do not care if the script called will perform any modifications. However, if any tasks marked as needing subjects cannot find enough subject to fulfil their KEY_SUBJECT_COUNT, then the whole script will abort, just like a failed cost.

is_cost superceeded this effect, as it covers both eventualities (lacking subjects, lacking change) so it's superfluous to use them together Value Type: bool (Default = false).

This key is used on a task marked with KEY_IS_COST It means that its cost effects will not even be evaluated if previous costs have already failed. This is useful when there's more than 1 interactive cost, such as targeting or selection boxes To prevent them from popping up even when previous costs have already failed.

KEY_ADJUST_RETRIEVED_INTEGER

const KEY_ADJUST_RETRIEVED_INTEGER: String = "adjust_retrieved_integer"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1"

KEY_ALTERANTS

const KEY_ALTERANTS: String = "alterants"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined.

KEY_ALTERATION

const KEY_ALTERATION: String = "alteration"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table"

KEY_ASK_INTEGER_MAX

const KEY_ASK_INTEGER_MAX: String = "ask_int_max"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have

KEY_ASK_INTEGER_MIN

const KEY_ASK_INTEGER_MIN: String = "ask_int_min"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have

KEY_BOARD_POSITION

const KEY_BOARD_POSITION: String = "board_position"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap.

KEY_CARD_FILTERS

const KEY_CARD_FILTERS: String = "card_filters"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player.

KEY_CARD_NAME

const KEY_CARD_NAME: String = "card_name"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game.

KEY_COMPARISON

const KEY_COMPARISON: String = "comparison"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3"

KEY_COUNTER_NAME

const KEY_COUNTER_NAME: String = "counter_name"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task

KEY_COUNT_UNIQUE

const KEY_COUNT_UNIQUE: String = "count_unique"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card.

KEY_DEGREES

const KEY_DEGREES: String = "degrees"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated.

KEY_DEST_CONTAINER

const KEY_DEST_CONTAINER: String = "dest_container"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate

KEY_DEST_INDEX

const KEY_DEST_INDEX: String = "dest_index"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card

KEY_DIVIDER

const KEY_DIVIDER: String = "divider"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table"

KEY_EXEC_TRIGGER

const KEY_EXEC_TRIGGER: String = "exec_trigger"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run.

KEY_FAIL_COST_ON_SKIP

const KEY_FAIL_COST_ON_SKIP: String = "fail_cost_on_skip"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script. Value Type: Int (default: 0)

How many cards need to be selected from the selection window Value Type: String (default: 'min') How to evaluate SELECTION_COUNT before the player is allowed to proceed

  • 'min': The minimum amount of cards that need to be selected
  • 'equal': The exact amount of cards that need to be selected
  • 'max': The maximum amount of cards that need to be selected Value Type: Bool (default: False)

Marks a selection window as optional. This means the player can opt to select none of the possible choices. In which case, the underlying task will be considered invalid and if it is a cost, it will also abort further execution. Value Type: Bool (default: False)

Ignores the card executing the script from the selection window This is necessary in some instances where the selection encompases the scripting card, but this is unwanted. For example because the card is supposed to already be in a different pile but this will only technically happen as the last task. Value Type: Array

Initiates a new instance of the scripting engine Which runs through the specified task list using its own cost calculations Value Type: Int

Repeats the whole task this amount of times. Careful when adding it to a task with a target, as it will force the targeting the Value Type: Bool.

If true, then the script will be considered to have failed if any of the task filters fail. (Normally the task is merely skipped). This will cause an [KEY_IS_COST](#LEY_IS_COST] to abort all effects.

KEY_GRID_NAME

const KEY_GRID_NAME: String = "grid_name"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation.

KEY_IMMEDIATE_PLACEMENT

const KEY_IMMEDIATE_PLACEMENT: String = "immediate_placement"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script. Value Type: Int (default: 0)

How many cards need to be selected from the selection window Value Type: String (default: 'min') How to evaluate SELECTION_COUNT before the player is allowed to proceed

  • 'min': The minimum amount of cards that need to be selected
  • 'equal': The exact amount of cards that need to be selected
  • 'max': The maximum amount of cards that need to be selected Value Type: Bool (default: False)

Marks a selection window as optional. This means the player can opt to select none of the possible choices. In which case, the underlying task will be considered invalid and if it is a cost, it will also abort further execution. Value Type: Bool (default: False)

Ignores the card executing the script from the selection window This is necessary in some instances where the selection encompases the scripting card, but this is unwanted. For example because the card is supposed to already be in a different pile but this will only technically happen as the last task. Value Type: Array

Initiates a new instance of the scripting engine Which runs through the specified task list using its own cost calculations Value Type: Int

Repeats the whole task this amount of times. Careful when adding it to a task with a target, as it will force the targeting the Value Type: Bool.

If true, then the script will be considered to have failed if any of the task filters fail. (Normally the task is merely skipped). This will cause an [KEY_IS_COST](#LEY_IS_COST] to abort all effects. Value Type: Bool.

Skips fancy anymation when spawning a new card and simply places it in its final destination immediately.

KEY_IS_COST

const KEY_IS_COST: String = "is_cost"

Script Definition Keys

The below are all the possible dictionary keys that can be set in a task definition. Most of them are only relevant for a specific task type

Value Type: String

Determines which card, if any, this script will try to affect.

If key does not exist, we set value to [], thereogr assuming there's no card subjects needed for the task.

If you need to adjust the amount of cards modified by the script also use KEY_SUBJECT_COUNT If this is the value of the KEY_SUBJECT key, we initiate targetting from the owner card If this is the value of the KEY_SUBJECT key, then the task affects the owner card only. If this is the value of the KEY_SUBJECT key, during KEY_ALTERANTS scripts using KEY_PER then the script will check against trigger card only.

If this is the value of the KEY_SUBJECT key, during normal scripts tasks then the tasks that do not match the triggers will be skipped but the script will still pass its cost check This allows the same trigger, to have different tasks firing, depending on the trigger card. If this is the value of the KEY_SUBJECT key, then we search all cards on the table by node order, and return candidates equal to KEY_SUBJECT_COUNT that match the filters.

This allows us to make tasks which will affect more than 1 card at the same time (e.g. "All Soldiers") If this is the value of the KEY_SUBJECT key, then we search all cards on the specified pile by node order, and pick the first candidate that matches the filter

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we pick the card on the specified source pile by its index among other cards.

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we use the subject specified in the previous task Value Type: Bool (Default = False)

If this is set, the subjects found by this task, will not overwrite the previous subjects found by the previous task

This is important in case the current task uses a filter on the subjects, but when the previous subject doesn't march, we went to retain the previous subjects anyway for the next script in the line. Without this flag, the previous subjects will be wiped (set to an empty array) as the filters didn't match. Value Type: Bool (Default = False)

This is a special property for the KEY_PER dictionary in combination with a KEY_SUBJECT_V_PREVIOUS value. It specifies that the subject for the per seek should be the prev_subjects passed to the task which calls this KEY_PER. As opposed to a normal KEY_SUBJECT_V_PREVIOUS behaviour inside per, which will use the same subjects as the parent task. Value Type: Dynamic (Default = 1)

Used when we're seeking a card to limit the amount to retrieve to this amount.

Works with the following tasks and KEY_SUBJECT values:

Useful with the following values:

This key is used to mark a task as being a cost requirement before the rest of the defined tasks can execute.

If any tasks marked as costs will not be able to fulfil, then the whole script is not executed.

Likewise, if the script has a KEY_SUBJECT, and less than KEY_SUBJECT_COUNT are found, then the whole script is not executed.

Currently the following tasks support being set as costs:

KEY_IS_ELSE

const KEY_IS_ELSE: String = "is_else"

Script Definition Keys

The below are all the possible dictionary keys that can be set in a task definition. Most of them are only relevant for a specific task type

Value Type: String

Determines which card, if any, this script will try to affect.

If key does not exist, we set value to [], thereogr assuming there's no card subjects needed for the task.

If you need to adjust the amount of cards modified by the script also use KEY_SUBJECT_COUNT If this is the value of the KEY_SUBJECT key, we initiate targetting from the owner card If this is the value of the KEY_SUBJECT key, then the task affects the owner card only. If this is the value of the KEY_SUBJECT key, during KEY_ALTERANTS scripts using KEY_PER then the script will check against trigger card only.

If this is the value of the KEY_SUBJECT key, during normal scripts tasks then the tasks that do not match the triggers will be skipped but the script will still pass its cost check This allows the same trigger, to have different tasks firing, depending on the trigger card. If this is the value of the KEY_SUBJECT key, then we search all cards on the table by node order, and return candidates equal to KEY_SUBJECT_COUNT that match the filters.

This allows us to make tasks which will affect more than 1 card at the same time (e.g. "All Soldiers") If this is the value of the KEY_SUBJECT key, then we search all cards on the specified pile by node order, and pick the first candidate that matches the filter

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we pick the card on the specified source pile by its index among other cards.

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we use the subject specified in the previous task Value Type: Bool (Default = False)

If this is set, the subjects found by this task, will not overwrite the previous subjects found by the previous task

This is important in case the current task uses a filter on the subjects, but when the previous subject doesn't march, we went to retain the previous subjects anyway for the next script in the line. Without this flag, the previous subjects will be wiped (set to an empty array) as the filters didn't match. Value Type: Bool (Default = False)

This is a special property for the KEY_PER dictionary in combination with a KEY_SUBJECT_V_PREVIOUS value. It specifies that the subject for the per seek should be the prev_subjects passed to the task which calls this KEY_PER. As opposed to a normal KEY_SUBJECT_V_PREVIOUS behaviour inside per, which will use the same subjects as the parent task. Value Type: Dynamic (Default = 1)

Used when we're seeking a card to limit the amount to retrieve to this amount.

Works with the following tasks and KEY_SUBJECT values:

Useful with the following values:

This key is used to mark a task as being a cost requirement before the rest of the defined tasks can execute.

If any tasks marked as costs will not be able to fulfil, then the whole script is not executed.

Likewise, if the script has a KEY_SUBJECT, and less than KEY_SUBJECT_COUNT are found, then the whole script is not executed.

Currently the following tasks support being set as costs:

This key is used to mark a task as requiring at least one valid subject for its smooth operation. While you can mark the task as cost to achieve a similar effect, this conflicts when the effect done is optional, but you still need to have selected a target to use with subsequent "previous" subjects.

This for example allows you to have a script which removes tokens from a target card but still continue to other subsequent tasks if the target has no tokens.

Like costs, these tasks are evaluated first. Along with the costs but unlike is_cost, these tasks do not care if the script called will perform any modifications. However, if any tasks marked as needing subjects cannot find enough subject to fulfil their KEY_SUBJECT_COUNT, then the whole script will abort, just like a failed cost.

is_cost superceeded this effect, as it covers both eventualities (lacking subjects, lacking change) so it's superfluous to use them together Value Type: bool (Default = false).

This key is used on a task marked with KEY_IS_COST It means that its cost effects will not even be evaluated if previous costs have already failed. This is useful when there's more than 1 interactive cost, such as targeting or selection boxes To prevent them from popping up even when previous costs have already failed. Value Type: bool (Default = false).

This key is used to mark a task to be executed only if the card costs cannot be paid. As such, they will never fire,unless the card also has an "is_cost" task.

KEY_IS_INVERTED

const KEY_IS_INVERTED: String = "is_inverted"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate

KEY_IS_OPTIONAL

const KEY_IS_OPTIONAL: String = "is_optional_"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled.

KEY_MODIFICATION

const KEY_MODIFICATION: String = "modification"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one

KEY_MODIFY_PROPERTIES

const KEY_MODIFY_PROPERTIES: String = "set_properties"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries

KEY_MULTIPLIER

const KEY_MULTIPLIER: String = "multiplier"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table"

KEY_NEEDS_SELECTION

const KEY_NEEDS_SELECTION: String = "needs_selection"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script.

KEY_NEEDS_SUBJECT

const KEY_NEEDS_SUBJECT: String = "needs_subject"

Script Definition Keys

The below are all the possible dictionary keys that can be set in a task definition. Most of them are only relevant for a specific task type

Value Type: String

Determines which card, if any, this script will try to affect.

If key does not exist, we set value to [], thereogr assuming there's no card subjects needed for the task.

If you need to adjust the amount of cards modified by the script also use KEY_SUBJECT_COUNT If this is the value of the KEY_SUBJECT key, we initiate targetting from the owner card If this is the value of the KEY_SUBJECT key, then the task affects the owner card only. If this is the value of the KEY_SUBJECT key, during KEY_ALTERANTS scripts using KEY_PER then the script will check against trigger card only.

If this is the value of the KEY_SUBJECT key, during normal scripts tasks then the tasks that do not match the triggers will be skipped but the script will still pass its cost check This allows the same trigger, to have different tasks firing, depending on the trigger card. If this is the value of the KEY_SUBJECT key, then we search all cards on the table by node order, and return candidates equal to KEY_SUBJECT_COUNT that match the filters.

This allows us to make tasks which will affect more than 1 card at the same time (e.g. "All Soldiers") If this is the value of the KEY_SUBJECT key, then we search all cards on the specified pile by node order, and pick the first candidate that matches the filter

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we pick the card on the specified source pile by its index among other cards.

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we use the subject specified in the previous task Value Type: Bool (Default = False)

If this is set, the subjects found by this task, will not overwrite the previous subjects found by the previous task

This is important in case the current task uses a filter on the subjects, but when the previous subject doesn't march, we went to retain the previous subjects anyway for the next script in the line. Without this flag, the previous subjects will be wiped (set to an empty array) as the filters didn't match. Value Type: Bool (Default = False)

This is a special property for the KEY_PER dictionary in combination with a KEY_SUBJECT_V_PREVIOUS value. It specifies that the subject for the per seek should be the prev_subjects passed to the task which calls this KEY_PER. As opposed to a normal KEY_SUBJECT_V_PREVIOUS behaviour inside per, which will use the same subjects as the parent task. Value Type: Dynamic (Default = 1)

Used when we're seeking a card to limit the amount to retrieve to this amount.

Works with the following tasks and KEY_SUBJECT values:

Useful with the following values:

This key is used to mark a task as being a cost requirement before the rest of the defined tasks can execute.

If any tasks marked as costs will not be able to fulfil, then the whole script is not executed.

Likewise, if the script has a KEY_SUBJECT, and less than KEY_SUBJECT_COUNT are found, then the whole script is not executed.

Currently the following tasks support being set as costs:

This key is used to mark a task as requiring at least one valid subject for its smooth operation. While you can mark the task as cost to achieve a similar effect, this conflicts when the effect done is optional, but you still need to have selected a target to use with subsequent "previous" subjects.

This for example allows you to have a script which removes tokens from a target card but still continue to other subsequent tasks if the target has no tokens.

Like costs, these tasks are evaluated first. Along with the costs but unlike is_cost, these tasks do not care if the script called will perform any modifications. However, if any tasks marked as needing subjects cannot find enough subject to fulfil their KEY_SUBJECT_COUNT, then the whole script will abort, just like a failed cost.

is_cost superceeded this effect, as it covers both eventualities (lacking subjects, lacking change) so it's superfluous to use them together

KEY_NESTED_TASKS

const KEY_NESTED_TASKS: String = "nested_tasks"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter. Value Type: String. One of the below:

  • "eq" (Defaut): Equal
  • "ne": Not equal
  • "gt": Greater than
  • "lt": Less than
  • "le": Less than or Equal
  • "ge": Geater than or equal

Key is used typically to do comparisons during filters involving numerical numbers. However the "eq" and "ne" can be used to compare strings as well.

I.e. it allows to write the script for something like: "Destroy all Monsters with cost equal or higher than 3" This is a versatile value that can be inserted into any various keys when a task needs to use a previously inputed integer provided with a ask_integer task or a KEY_STORE_INTEGER.

When detected ,the task will retrieve the stored number and use it as specified

The following keys support this value

A way to adjust the value of the VALUE_RETRIEVE_INTEGER Before using it. This happens after the [KEY_IS_INVERTED])(#KEY_IS_INVERTED) modification. While this functionality can also be done with an extra task after, using this variable Allows the script to also capture the complete change in its own KEY_STORE_INTEGER.

For example this allows effects like: "Pay 3 Research. Gain a number of coins equal to that amount + 1 and draw a number of cards equal to that amount + 1" This value can be inserted as the value in one of the following:

When this is done, the value in this field, will br replaced with the value in the relevant field from the card owning the script

This allows for comparison between the owner of the script and the potential subjects

Example

{
	"alterants": {
		"board": [
			{
				"filter_task": "get_counter",
				"filter_counter_name": "skill",
				"alteration": "per_boardseek",
				"filter_state_trigger": [
					{
						"filter_properties": {
							"Type": "Shader"
						},
					}
				],
				"per_boardseek": {
					"subject": "boardseek",
					"subject_count": "all",
					"filter_state_seek": [
						{
							"filter_properties": {
								"Name": "compare_with_trigger"
							}
						}
					]
				}
			},
		],
	},
},

The example above translates to "When installing a Shader, you have +1 skill for each other Shader with the same name you have installed" Same as VALUE_COMPARE_WITH_OWNER but compares against card that caused the script to trigger, rather than the owner of the script Value Type: bool (Default = false)

Specifies whether this script or task can be skipped by the owner.

If it is making a sigle task optional, you need to add "task" at the end and place it inside a single task definition Example:

"manual": {
	"board": [
		{"name": "rotate_card",
		"is_optional_task": true,
		"subject": "self",
		"degrees": 90},
	]}

If you need to make a whole state_exec optional, then you need to place it on the same level as the state_exec and append the state_exec name Example:

"card_flipped": {
	"is_optional_board": true,
	"board": [
		{"name": "rotate_card",
		"is_cost": true,
		"subject": "self",
		"degrees": 90}
	]}

When set to true, a confirmation window will appear to the player when this script/task is about to execute.

At the task level, it will ask the player before activating that task only If that task is a cost, it will also prevent subsequent tasks from firing

At the script level, the whole script if cancelled. Value Type: Bool (default: False)

If true, the script will popup a card selection window, among all the valid subjects detected for this script. Value Type: Int (default: 0)

How many cards need to be selected from the selection window Value Type: String (default: 'min') How to evaluate SELECTION_COUNT before the player is allowed to proceed

  • 'min': The minimum amount of cards that need to be selected
  • 'equal': The exact amount of cards that need to be selected
  • 'max': The maximum amount of cards that need to be selected Value Type: Bool (default: False)

Marks a selection window as optional. This means the player can opt to select none of the possible choices. In which case, the underlying task will be considered invalid and if it is a cost, it will also abort further execution. Value Type: Bool (default: False)

Ignores the card executing the script from the selection window This is necessary in some instances where the selection encompases the scripting card, but this is unwanted. For example because the card is supposed to already be in a different pile but this will only technically happen as the last task. Value Type: Array

Initiates a new instance of the scripting engine Which runs through the specified task list using its own cost calculations

KEY_OBJECT_COUNT

const KEY_OBJECT_COUNT: String = "object_count"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform.

KEY_ORIGINAL_PREVIOUS

const KEY_ORIGINAL_PREVIOUS: String = "original_previous"

Script Definition Keys

The below are all the possible dictionary keys that can be set in a task definition. Most of them are only relevant for a specific task type

Value Type: String

Determines which card, if any, this script will try to affect.

If key does not exist, we set value to [], thereogr assuming there's no card subjects needed for the task.

If you need to adjust the amount of cards modified by the script also use KEY_SUBJECT_COUNT If this is the value of the KEY_SUBJECT key, we initiate targetting from the owner card If this is the value of the KEY_SUBJECT key, then the task affects the owner card only. If this is the value of the KEY_SUBJECT key, during KEY_ALTERANTS scripts using KEY_PER then the script will check against trigger card only.

If this is the value of the KEY_SUBJECT key, during normal scripts tasks then the tasks that do not match the triggers will be skipped but the script will still pass its cost check This allows the same trigger, to have different tasks firing, depending on the trigger card. If this is the value of the KEY_SUBJECT key, then we search all cards on the table by node order, and return candidates equal to KEY_SUBJECT_COUNT that match the filters.

This allows us to make tasks which will affect more than 1 card at the same time (e.g. "All Soldiers") If this is the value of the KEY_SUBJECT key, then we search all cards on the specified pile by node order, and pick the first candidate that matches the filter

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we pick the card on the specified source pile by its index among other cards.

When this value is used KEY_SRC_CONTAINER has to also be used. If this is the value of the KEY_SUBJECT key, then we use the subject specified in the previous task Value Type: Bool (Default = False)

If this is set, the subjects found by this task, will not overwrite the previous subjects found by the previous task

This is important in case the current task uses a filter on the subjects, but when the previous subject doesn't march, we went to retain the previous subjects anyway for the next script in the line. Without this flag, the previous subjects will be wiped (set to an empty array) as the filters didn't match. Value Type: Bool (Default = False)

This is a special property for the KEY_PER dictionary in combination with a KEY_SUBJECT_V_PREVIOUS value. It specifies that the subject for the per seek should be the prev_subjects passed to the task which calls this KEY_PER. As opposed to a normal KEY_SUBJECT_V_PREVIOUS behaviour inside per, which will use the same subjects as the parent task.

KEY_PER_BOARDSEEK

const KEY_PER_BOARDSEEK: String = "per_boardseek"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified

KEY_PER_COUNTER

const KEY_PER_COUNTER: String = "per_counter"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal the number of cards on the board matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified Value Type: bool.

Used in combination with KEY_PER_BOARDSEEK or KEY_PER_TUTOR. It limits the count of items to only once per unique card. Value Type: String.

Holds the field type by which to sort the subjects.

  • node_index (default): This is the order Godot engine picked up the children nodes, which is their node index
  • property: Sort by the property specified in KEY_SORT_BY
  • token: Sort by the token specified in KEY_SORT_BY
  • random: Randomize the subjects Value Type: String.

When sort_by is not node_index or random, provides the name of the property or token to sort by.

Note that if this left empty when sort by properties or tokens is requested, then no resorting will be done. Value Type: bool (default: false).

If true, will invert the subject list sort order. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to the value of a counter.

KEY_PER_PROPERTY

const KEY_PER_PROPERTY: String = "per_property"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number.

KEY_PER_TOKEN

const KEY_PER_TOKEN: String = "per_token"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided

KEY_PER_TUTOR

const KEY_PER_TUTOR: String = "per_tutor"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that point in time. The value has to be appended with the type of seek to do to determine the amount. The full value has to match one of the following keys:

When this value is set, the relevant key must also exist in the Script definition. They key shall contain a dictionary which will Specify the subjects as well as the things to count.

Inside the per_ key, you again have to specify KEY_SUBJECT lookup which is relevant for the per search.

This allows us to calculate the effects of card scripts during runtime. For a complex example:

{"manual":
	{"hand": [
		{"name": "move_card_to_container",
		"subject": "index",
		"subject_count": "per_boardseek",
		"src_container": "deck",
		"dest_container": "hand",
		"subject_index": "top",
		"per_boardseek": {
			"subject": "boardseek",
			"subject_count": "all",
			"filter_state_seek": [
				{"filter_properties": {
					"Power": 0}
				}
			]
		}}
	]}
}

The above example can be tranlated to: "Draw 1 card for each card with 0 power on the board"

When used in modify_properties, the VALUE_PER can be appended by a plus sign as well

{"manual":
	{"board": [
		{
			"name": "modify_properties",
			"set_properties": {"Power": "+per_counter"},
			"subject": "self",
			"per_counter": {"counter_name": "research"}
		},
	]}
}

The above example can be tranlated to: "Increase this card's power by the amount of research you have"

Note using a minus-sign '-' in place of a plus-sign will not work as expected. Use KEY_IS_INVERTED instead Value Type: Float/Int

Used to multiply per results. This allows us to craft scripts like "Gain 2 Health per card on the table" Value Type: Float/Int

Used to divide per results. This allows us to craft scripts like "Gain 1 Health per two cards on the table" Value Type: String

This key is typically needed in combination with KEY_PER_PROPERTY to specify which property to base the per upon. When used this way, the property has to be a number.

Also used by Alterant filters, to specify which property to compare against When adjusting a property on-the-fly Value Type: String (Default = "manual").

This is used with the execute_scripts task to determine which execution trigger to run. Value Type: String

This is used with the execute_scripts task to limit execution, only to cards in the right state ("board","hand" or "pile)

If this is not defined, it will execute the specified exec_trigger of the state the card is currently in, if any exists for it. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the value of a counter by a specified amount.

The value has to be a Dictionary where each key is an counter's name and the value is the modification to use on that counter. Value Type: Dictionary

This key is used in execute_scripts to temporary alter the numerical properties the target card think is has, by a specified amount.

The value has to be a Dictionary where each key is an number property's name As defined in PROPERTIES_NUMBERS and the value is the modification to use on that number Value Type: Bool (Default = false)

Used in the per dictionary to specify that the amount of things counted should be returned negative. This allows to have costs based on the boardstate Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of tokens on the subject(s)

Other than the subject defintions the KEY_TOKEN_NAME has to also be provided Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a accumulated property on the subject(s)

Other than the subject defintions the KEY_PROPERTY_NAME has to also be provided. Obviously, the property specified has to be a number. Value Type: Dictionary

A VALUE_PER key for perfoming an effect equal to a number of cards in pile matching a filter.

Typically the KEY_SUBJECT_COUNT inside this dictionary would be set to KEY_SUBJECT_COUNT_V_ALL, but a FILTER_STATE should also be typically specified

KEY_PROPERTY_NAME

const KEY_PROPERTY_NAME: String = "property_name"

Value Type: int.

Used when a script is using the rotate_card task.

These are the degress in multiples of 90, that the subjects will be rotated. Value Type: bool.

  • true: The card will be set face-up
  • false: The card will be set face-down

Used when a script is using the flip_card task. Value Type: bool.

Used when a script is using the modify_properties task. The value is supposed to be a dictionary of "property name": value entries Value Type: String.

Used when a script is using one of the following tasks

When the following KEY_SUBJECT values are also used:

Specifies the source container to pick the card from Value Type: String.

Used when a script is using one of the following tasks

Specifies the destination container to manipulate Value Options (Default = 0):

Used when we're seeking a card inside a CardContainer(CardContainer) in one of the following tasks

Default is to seek card at index 0 Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the top "card" of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, explicitly looks for the "bottom" card of a pile Special entry to be used with KEY_SUBJECT_INDEX instead of an integer.

If specified, picks a random index in the container Value Type: Dynamic (Default = KEY_SUBJECT_INDEX_V_TOP)

Used when placing a card inside a [CardContainer] using the move_card_to_container task to specify which index inside the CardContainer to place the card Value Type: Vector2.

Used in the following tasks

It specfies the position of the board to place the subject or object of the task. If used in combination with KEY_SUBJECT_COUNT the task will attempt to place all subjects/objects in a way that they do not overlap. Value Type: String.

Used in the following tasks

For move_card_to_board and spawn_card, if specified, it will take priority over KEY_BOARD_POSITION The card will be placed to the specified grid on the board

For add_grid, if not specified, the grid will be keep the names defined in the scene. If specified, the node name and label will use the provided value

This task will not check that the grid exists or that the card's mandatory grid name matches the grid name. The game has to be developed to not cause this situation. Value Type: String.

Used with the mod_counter task to specify Which counter to modify with this task Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

It specifies if we're modifying the existing amount or setting it to the exact one Value Type: String

Used when a script is using the mod_tokens task.

It specifies the name of the token we're modifying Value Type: Dynamic

Used when a script is using one of the following tasks:

It specifies the amount we're setting/modifying or setting it to the exact one Value Type: bool (Default = false).

Used when a script is using one of the following tasks:

Stores the modification difference into an integer to be used in later tasks. Value Type: Dynamic (Default = 1).

specified how many of the "thing" done by the task, to perform. Value Type: String

Used in conjunction with the following tasks

This is the path to the scene we will add to the game. Value Type: String

Used in conjunction with the following tasks

This is name of the card that will be added to the game. Value Type: int

Used by the ask_integer task. Specifies the minimum value the number needs to have Value Type: int

Used by the ask_integer task. Specifies the maximum value the number needs to have Value Type: array

A list of dictionaries. Each dictionary providing a CardFilter properties which will be used to filter through the card base for finding cards which match. The different filters in the array are used as "AND" conditionals with each other

Used by spawn_card_to_container, when an explicit card name is not wanted. Instead uses the provided filter to go through the card library and find all cards which fit the filters. Then randomly chooses an amount of cards among those fitting the filters, equal to KEY_CARD_CHOICES_AMOUNT to show to the player. Value Type: int (Default: 1)

Used by KEY_CARD_FILTERS to know how many cards to show to the player. A value of 1 means the player get no choice, but instead gets a random card out of the possible options Any other value, means the player gets a selection among this amount of possible options. values lower than 1 are ignored. Value Type: Array of Strings All card manipulation Signals will send a list of tags marking the type of effect that triggered them.

By Default it's the tags sent is just ["Manual"] for manipulation via the core API methods. However when the manipulation is done via ScriptingEngine, the tags can be modified by the script defintion. The ScrptingEngine will always mark them as "Scripted" instead of "Manual" at the least.

With this key, you can specify a number of keywords you can assign to your script, which details what function it is serving. These can be hooked on by the AlterantEngine(AlterantEngine) to figure out if this script effects should be altered or triggered.

Tags specified with ScriptTasks will be injected along with list sent by the ScriptingEngine. So for example "tags": ["PlayCost"] will be sent as ["Scripted", "PlayCost"] by the ScriptingEngine.

A signal or script has to have all the tags a FILTER_TAGS task is looking for, in order to be considered. Value Type: Dictionary

Used in place of a trigger name (e.g. 'manual'). This key allows the card to be marked as an "Alterant". I.e. a card which will modify the values of other scripts or effects.

For example cards which reduce or increase costs, or cards which intensify the effect of other cards would be alterants.

The dictionary inside follows a similar format to a typical script, with the state_exec of the card being the next key, specifying when the alterant is active, and inside that, an array of mulitple alterants to check against.

A sample alterant definition might look like this

{"alterants": {
	"board": [
		{"filter_task": "mod_counter",
		"trigger": "another",
		"filter_tags": ["PlayCost"],
		"filter_counter_name": "research",
		"filter_state_trigger": [{
			"filter_properties": {"Type": "Science"}
		}],
		"alteration": -1}
	]
}}

The above would roughly translate to "Whenever you are playing a Science card reduce it's research cost by 1"

The main difference from other scripts being that triggers are checked inside each individual alterant task, rather than on the whole script. This allows the same card to modify different sort of cards and triggers, in different ways.

Currently the following tasks support being altered during runtime via alterants

When this is used KEY_ALTERATION also needs to be defined. Value Type: int

Used by the [AlterantEngine] to determine by how much it should modify the currently performed task.

It can accept a VALUE_PER value which allows one to script an effect like "Increase the cost by the number of Soldiers on the table" This is a versatile value that can be inserted into any various keys when a task needs to calculate the amount of subjects to look for or the number of things to do, based on the state of the board at that po

Clone this wiki locally