Skip to content

ScriptObject

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

ScriptObject

Extends: Reference

Description

This is a parent class containing the methods for lookup of subjects and script properties.

It is typically never instanced directly.

Property Descriptions

owner

var owner

The object which owns this Task

subjects

var subjects: Array

The object which owns this Task The subjects is typically a Card object in the future might be other things

script_name

var script_name: String

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task

script_definition

var script_definition: Dictionary

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task Storage for all details of the task definition

is_primed

var is_primed: bool

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task Storage for all details of the task definition Used by the ScriptingEngine to know if the task has finished processing targetting and optional confirmations

is_valid

var is_valid: bool

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task Storage for all details of the task definition Used by the ScriptingEngine to know if the task has finished processing targetting and optional confirmations If true if this task is valid to run. A task is invalid to run if some filter does not match.

requested_subjects

var requested_subjects: int

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task Storage for all details of the task definition Used by the ScriptingEngine to know if the task has finished processing targetting and optional confirmations If true if this task is valid to run. A task is invalid to run if some filter does not match. The amount of subjects card the script requested to modify We use this to compare against costs during dry_runs

This is typically set during the _find_subjects() call

trigger_object

var trigger_object: Node

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task Storage for all details of the task definition Used by the ScriptingEngine to know if the task has finished processing targetting and optional confirmations If true if this task is valid to run. A task is invalid to run if some filter does not match. The amount of subjects card the script requested to modify We use this to compare against costs during dry_runs

This is typically set during the _find_subjects() call The card which triggered this script.

prev_subjects

var prev_subjects: Array

The object which owns this Task The subjects is typically a Card object in the future might be other things The name of the method to call in the ScriptingEngine to implement this task Storage for all details of the task definition Used by the ScriptingEngine to know if the task has finished processing targetting and optional confirmations If true if this task is valid to run. A task is invalid to run if some filter does not match. The amount of subjects card the script requested to modify We use this to compare against costs during dry_runs

This is typically set during the _find_subjects() call The card which triggered this script. Stores the subjects discovered by the task previous to this one

Method Descriptions

_init

func _init(_owner, script: Dictionary, _trigger_object = null) -> void

prepares the properties needed by the script to function.

get_property

func get_property(property: String, default = null)

Returns the specified property of the string. Also sets appropriate defaults when then property has not beend defined. A default value can also be passed directly, which is useful when ScriptingEngine has been extended by custom tasks.

sort_subjects

func sort_subjects(subject_list: Array) -> Array

Sorts the subjects list according to the directives in the following three keys

parse_replacements

func parse_replacements() -> void

Goes through the provided scripts and replaces certain keyword values with variables retireved from specified location.

This allows us for example to filter cards sought based on the properties of the card running the script.

count_per (static)

func count_per(per_seek: String, script_owner: Card, per_definitions: Dictionary, _trigger_object = null) -> int

Handles looking for intensifiers of a current effect via the board state

Returns the amount of things the script is trying to count.

Signals

  • signal primed(): Sent when the _init() method has completed warning-ignore:unused_signal