Skip to content

ScriptObject

Divided by Zer0 edited this page Feb 14, 2021 · 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_card

var owner_card: Card

The card which owns this Task

subjects

var subjects: Array

The subjects is typically a Card object in the future might be other things

script_name

var script_name: String

The name of the method to call in the ScriptingEngine to implement this task

script_definition

var script_definition: Dictionary

Storage for all details of the task definition

is_primed

var is_primed: bool

Used by the ScriptingEngine to know if the task has finished processing targetting and optional confirmations

is_valid

var is_valid: bool

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 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_card

var trigger_card: Card

The card which triggered this script.

Method Descriptions

_init

func _init(card: Card, script: Dictionary, _trigger_card = 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.

count_per (static)

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

Signals

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