NAV
lua

Overview

This page is still a work-in-progress, documenting the various parts of the ONB API.

Gamefield Objects

Field

The Field is a representation of the area that the current combat is taking place on.

It is the object that manages all of the Tile and Entity objects from frame to frame.

The Field is divided up into eight columns and five rows.
The playable area starts at [1,1], and ends at [6,3]. Most of the action takes place in this area.

The leftmost/rightmost columns (x = 0 and x = 7), and the top/bottom rows (y = 0 and y = 4) are invisible tiles.
An Entity cannot stand on these under normal circumstances.

0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0
0,1 1,1 2,1 3,1 4,1 5,1 6,1 7,1
0,2 1,2 2,2 3,2 4,2 5,2 6,2 7,2
0,3 1,3 2,3 3,3 4,3 5,3 6,3 7,3
0,4 1,4 2,4 3,4 4,4 5,4 6,4 7,4

Field:tile_at()

function • v2.0

local top_left = field:tile_at( 1, 1 ) 
local bottom_right = field:tile_at( 6, 3 ) 

The above commands return a pointer to the top left and bottom right visible Tile.

This function retrieves a pointer to a Tile at a specific position in the grid.
 If there is a Tile at the requested position, this function returns that Tile otherwise nil

x can (by default) be any number between (and including) 0 ~ field:width() - 1 (defaults to 7).
y can (by default) be any number between (and including) 0 ~ field:height() - 1 (defaults to 4).
 Any values outside of those ranges will return nil instead.

Function Call

field:tile_at()

Parameters

number xThe column you want to retrieve the Tile from (from left to right).
number yThe row you want to retrieve the Tile from (from top to bottom).

Returns

Tile The Tile at the specified position, or nil.

Field:width()

function • v2.0

local field_width = field:width() 

This returns the width of the current battlefield in Tiles (including hidden tiles).

Function Call

field:width()

Returns

number The width of the battlefield in Tiles. (Default: 8)

Field:height()

function • v2.0

local field_height = field:height() 

This returns the height of the current battlefield in Tiles (including hidden tiles).

Function Call

field:height()

Returns

number

Field:spawn()

function • v2.0

Function Call

field:spawn()

Parameters

Entity entityThe Entity to spawn.
number spawn_xThe column to spawn the Entity in.
number spawn_yThe row to spawn the Entity in.

Returns

AddEntityStatus

Field:spawn()

function • v2.0

Function Call

field:spawn()

Parameters

Entity entityThe Entity to spawn.
Tile spawn_tileThe Tile to spawn the Entity on.

Returns

AddEntityStatus

Field:get_character()

function • v2.0

Returns a Character that has the ID unique_id.
If there are no Characters with that ID, or the Entity with that unique_id is not a Character, nil is returned instead.

Function Call

field:get_character()

Parameters

number unique_idThe ID of the Character you want to retrieve.

Returns

Character

Field:get_entity()

function • v2.0

This function returns an Entity with a specific ID.
If there is no Entity with the provided ID, nil is returned instead.

Function Call

field:get_entity()

Parameters

number unique_idThe ID of the Entity you want to retrieve.

Returns

Entity

Field:find_characters()

function • v2.0

local field -- example  

    -- first method 
local blue_team_filter = function( character ) 
    return character:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_characters = field:find_characters( blue_team_filter ) 

    -- second method 
local all_red_characters 
    = field:find_characters( function( character ) return character:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_characters().

Iterates through all of the Characters on the battlefield, and returns a list of Characters that match a filter function.
 To include a Character in the final list, the filter function has to return true.
 If it returns false for a Character, it will not be included.

Function Call

field:find_characters()

Parameters

function search_functionA filter function that determines if the Character gets added to the list.

Returns

list<Character>

function search_function( character )
    return character:get_team() == Team.Red
end

When used with the above snippet, find_characters() returns all Characters that are currently on the Red team.

Field:find_nearest_characters()

function • v2.0

local field -- example  

    -- first method 
local blue_team_filter = function( character ) 
    return character:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_characters = field:find_nearest_characters( blue_team_filter ) 

    -- second method 
local all_red_characters 
    = field:find_nearest_characters( function( character ) return character:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_nearest_characters().

Iterates through all of the Characters, and returns a list of the closest valid Characters to a specified Character.
 To include a Character in the final list, the filter function has to return true.
 If it returns false for a Character, it will not be included.

Function Call

field:find_nearest_characters()

Parameters

Entity pivot_characterThe Character to start searching from.
function search_functionA filter function that determines if the Character gets added to the list.

Returns

list<Character>

function search_function( character )
    return character:get_team() == Team.Red
end

When used with the above snippet, find_characters() returns all Characters that are currently on the Red team.

Field:find_obstacles()

function • v2.0

local field -- example field 
    -- first method 
local blue_team_filter = function( obstacle ) 
    return obstacle:get_team() == Team.Blue 
end 
local all_blue_obstacles = field:find_obstacles( blue_team_filter ) 
    -- second method 
local all_red_obstacles = field:find_obstacles( function( obstacle ) return obstacle:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_obstacles().

Iterates through all of the Obstacles on the battlefield, and returns a list of Obstacles that match a filter function.
 To include a Obstacle in the final list, the filter function has to return true.
 If it returns false for a Obstacle, it will not be included.

Function Call

field:find_obstacles()

Parameters

function search_functionA filter function that determines if the Obstacle gets added to the list.

Returns

list<Obstacle>

function search_function( obstacle )
    return obstacle:get_team() == Team.Red
end

When used with the above snippet, find_obstacles() returns all Obstacles that are currently on the Red team.

Field:find_entities()

function • v2.0

local field -- example  

    -- first method 
local blue_team_filter = function( entity ) 
    return entity:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_entities = field:find_entities( blue_team_filter ) 

    -- second method 
local all_red_entities 
    = field:find_entities( function( entity ) return entity:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_entities().

Iterates through all of the Entity objects on the battlefield, and returns a list of Entitys that match a filter function.
 To include a Entity in the final list, the filter function has to return true.
 If it returns false for a Entity, it will not be included.

Function Call

field:find_entities()

Parameters

function search_functionA filter function that determines if the Entity gets added to the list.

Returns

list<Entity>

function search_function( entity )
    return entity:get_team() == Team.Red
end

When used with the above snippet, find_entities() returns all Entity objects that are currently on the Red team.

Field:find_tiles()

function • v2.0

local field -- example  

    -- first method 
local blue_team_filter = function( tile ) 
    return tile:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_tiles = field:find_tiles( blue_team_filter ) 

    -- second method 
local all_red_tiles 
    = field:find_tiles( function( tile ) return tile:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_tiles().

Iterates through all of the Tiles on the battlefield, and returns a list of Tiles that match a filter function.
 To include a Tile in the final list, the filter function has to return true.
 If it returns false for a Tile, it will not be included.

Function Call

field:find_tiles()

Parameters

function search_functionA filter function that determines if the Tile gets added to the list.

Returns

list<Tile>

function search_function( tile )
    return tile:get_team() == Team.Red
end

When used with the above snippet, find_tiles() returns all Tiles that are currently owned by the Red team.

Field:notify_on_delete()

function • v2.0

local target    -- Example target entity 
local observer  -- Example observing entity 
function onDelete( tar, obs ) 
    print( "Observer saw Target die." ) 
end 

field:notify_on_delete( target, observer, function( t, e ) print( "Observer saw Target die." ) end ) 
field:notify_on_delete( target, observer, onDelete ) 

This sets up a callback function that will be executed when the target is deleted/destroyed.
If the observer is deleted, the callback will not be executed.

Function Call

field:notify_on_delete()

Parameters

number target_idThe unique ID of the Entity that will trigger the callback on deletion.
number observer_idThe unique ID of the Entity that will be passed to the callback function.
function callback_functionThe function that will be called when the Entity with the ID targetID is deleted.

Returns

number

function callback_function( target )
    print( "Target died." )
end

Field:callback_on_delete()

function • v2.0

local target    -- Example target 
function onDelete( tar ) 
    print( "Target died." ) 
end 

field:callback_on_delete( target, function( t ) print( "Target died." ) end ) 
field:callback_on_delete( target, onDelete ) 

The above snippet shows two different ways to go about setting up a callback function.

This sets up a callback that will be executed when an Entity with a specific unique ID is deleted/destroyed.

Function Call

field:callback_on_delete()

Parameters

number target_idThe unique ID of the Entity that will trigger the callback on deletion.
function callback_functionThe function that will be called when the Entity with the ID targetID is deleted.

Returns

number

function callback_function( target, observer )
    print( "Target died." )
end

Tile

Tile:x()

function • v2.0

local tile  -- example Tile 
local tile_x = tile:x() 

Returns the column the Tile is located in, on the battlefield grid.

Function Call

tile:x()

Returns

number

Tile:y()

function • v2.0

local tile  -- example Tile 
local tile_y = tile:y() 

Returns the row the Tile is located in, on the battlefield grid.

Function Call

tile:y()

Returns

number

Tile:width()

function • v2.0

local tile  -- example Tile 
local width = tile:width() 

Returns the width of the Tile (in pixels).

Function Call

tile:width()

Returns

number The width of the Tile, in pixels.

Tile:height()

function • v2.0

local tile      -- example Tile 
local tile_height    = tile:height() 

Returns the height of the Tile (in pixels).

Function Call

tile:height()

Returns

number The height of the Tile, in pixels.

Tile:get_state()

function • v2.0

local tile      -- example Tile 
local tile_state = tile:get_state() 

Returns the current TileState of this Tile.

Function Call

tile:get_state()

Returns

TileState

Tile:set_state()

function • v2.0

local tile      -- example Tile 
tile:set_state( TileState.Broken ) 

Attempts to set this Tile to a specific TileState.
 If the Tile is Hidden, or one of the invisible edge tiles around the battlefield, this will fail.

Attempting to set a Tile to Broken will fail if the Tile has a Character present on it or reserving it.

Attempting to set a Tile to Cracked will fail if the Tile is currently Broken or Empty.
 Successfully setting a Tile to Broken will cause it to start its regeneration timer.

Function Call

tile:set_state()

Parameters

TileState state

Tile:is_edge()

function • v2.0

local tile      -- example Tile 
local is_edge_tile = tile:is_edge() 

Returns true if this Tile is one of the invisible Tiles surrounding the main battlefield.
 Otherwise, returns false.

Function Call

tile:is_edge()

Returns

boolean

Tile:is_cracked()

function • v2.0

local tile      -- example Tile 
local is_cracked_tile = tile:is_cracked() 

Returns true if this Tile's state is currently Cracked.
 Otherwise, returns false.

Function Call

tile:is_cracked()

Returns

boolean

Tile:is_hole()

function • v2.0

local tile      -- example Tile 
local is_hole_in_ground = tile:is_hole() 

Returns true if this Tile is a "hole" in some way: i.e. Broken, Hidden, or Empty.
 Otherwise, returns false.

Function Call

tile:is_hole()

Returns

boolean

Tile:is_walkable()

function • v2.0

local tile      -- example Tile 
local is_walkable_tile = tile:is_walkable() 

Causes the Tile to remove any Entity present on it with a specific unique ID.

Returns true if an Entity was removed.
Otherwise, returns false.

Function Call

tile:is_walkable()

Returns

boolean

Tile:is_hidden()

function • v2.0

local tile      -- example Tile 
local is_hidden_tile = tile:is_hidden() 

Returns true if this Tile's state is currently Hidden.
 Otherwise, returns false.

Function Call

tile:is_hidden()

Returns

boolean

Tile:is_reserved()

function • v2.0

local tile      -- example Tile 
local ignored_characters    -- list of Entity IDs to ignore 

local reserving_this_tile = tile:is_reserved( ignored_characters ) 

Queries if the Tile is reserved by a Entity.
 If a list of unique IDs is provided, any Entity with a unique ID contained in the list will not be included in the calculation.

Returns true if the Tile is marked as reserved by any Entity not on the provided list.
 Otherwise, returns false.

Function Call

tile:is_reserved()

Parameters

list<Character> excluded_charactersA list of Character objects to ignore.

Returns

boolean

Tile:get_team()

function • v2.0

local tile      -- example Tile 
local tile_team = tile:get_team() 

Returns the Team that currently owns this Tile

Function Call

tile:get_team()

Returns

Team

Tile:set_team()

function • v2.0

Function Call

tile:set_team()

Parameters

Team team

Tile:attack_entities()

function • v2.0

local tile      -- example Tile 
local spell -- example Spell 

tile:attack_entities( spell ) 

Queues up a Spell to affect any Entity present on this Tile.

Function Call

tile:attack_entities()

Parameters

Entity aggressor

Tile:get_distance_to_tile()

function • v2.0

local tile      -- example Tile 
local other_tile    -- example Tile 

local distance = tile:get_distance_to_tile( other_tile ) 

Returns the Manhattan distance between this Tile and another.

Function Call

tile:get_distance_to_tile()

Parameters

Tile other_tile

Returns

number The Tile you want to measure the distance to.

Tile:find_characters()

function • v2.0

local tile  -- example  

    -- first method 
local blue_team_filter = function( character ) 
    return character:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_characters = tile:find_characters( blue_team_filter ) 

    -- second method 
local all_red_characters 
    = tile:find_characters( function( character ) return character:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_characters().

Iterates through all of the Characters on this Tile, and returns a list of Characters that match a filter function.
 To include a Character in the final list, the filter function has to return true.
 If it returns false for a Character, it will not be included.

Function Call

tile:find_characters()

Parameters

function search_functionA filter function that determines if the Character gets added to the list.

Returns

list<Character>

function search_function( character )
    return character:get_team() == Team.Red
end

When used with the above snippet, find_characters() returns all Characters on this Tile that are currently on the Red team.

Tile:find_entities()

function • v2.0

local tile  -- example  

    -- first method 
local blue_team_filter = function( entity ) 
    return entity:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_entities = tile:find_entities( blue_team_filter ) 

    -- second method 
local all_red_entities 
    = tile:find_entities( function( entity ) return entity:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_entities().

Iterates through all of the Entitys on this Tile, and returns a list of Entitys that match a filter function.
 To include a Entity in the final list, the filter function has to return true.
 If it returns false for a Entity, it will not be included.

Function Call

tile:find_entities()

Parameters

function search_functionA filter function that determines if the Entity gets added to the list.

Returns

list<Entity>

function search_function( entity )
    return entity:get_team() == Team.Red
end

When used with the above snippet, find_entitys() returns all Entitys on this Tile that are currently on the Red team.

Tile:find_obstacles()

function • v2.0

local tile  -- example  

    -- first method 
local blue_team_filter = function( obstacle ) 
    return obstacle:get_team() == Team.Blue 
end 
    -- second method 
local all_blue_obstacles = tile:find_obstacles( blue_team_filter ) 

    -- second method 
local all_red_obstacles 
    = tile:find_obstacles( function( obstacle ) return obstacle:get_team() == Team.Red end ) 

The above snippet shows two ways of passing a function to find_obstacles().

Iterates through all of the Obstacles on this Tile, and returns a list of Obstacles that match a filter function.
 To include a Obstacle in the final list, the filter function has to return true.
 If it returns false for a Obstacle, it will not be included.

Function Call

tile:find_obstacles()

Parameters

function search_functionA filter function that determines if the Obstacle gets added to the list.

Returns

list<Obstacle>

function search_function( obstacle )
    return obstacle:get_team() == Team.Red
end

When used with the above snippet, find_obstacles() returns all Obstacles on this Tile that are currently on the Red team.

Tile:highlight()

function • v2.0

local tile      -- example Tile 
tile:highlight( Highlight.Solid ) 

Causes the Tile to be highlighted in a specific manner.

Function Call

tile:highlight()

Parameters

Highlight highlight_mode

Tile:get_tile()

function • v2.0

local tile  -- example Tile 
local tile_to_left = tile:get_tile( Direction.Left, 1 ) 

The above snippet returns a the Tile to the left of this one.

Returns a Tile offset in one direction from this Tile.
 If this offset goes out of bounds, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

tile:get_tile()

Parameters

Direction directionThe direction you want to retrieve the Tile from.
number distanceThe number of spaces (min: 0) in that direction you want to retrieve the Tile from.

Returns

Tile

Tile:contains_entity()

function • v2.0

local tile      -- example Tile 
local target    -- example Entity 

return tile:contains_entity( target ) 

Queries whether or not this Tile has a specific Entity present on it.
 Returns true if the Entity is present. Otherwise, returns false.

Function Call

tile:contains_entity()

Parameters

Entity entity

Returns

boolean

Tile:remove_entity_by_id()

function • v2.0

local tile      -- example Tile 
local entity_id -- example Entity ID 

tile:remove_entity_by_id( entity_id ) 

Causes the Tile to remove any Entity present on it with a specific unique ID.

Returns true if an Entity was removed.
Otherwise, returns false.

Function Call

tile:remove_entity_by_id()

Parameters

number entity_id

Returns

boolean true if something was removed from this Tile, otherwise false.

Tile:reserve_entity_by_id()

function • v2.0

local tile      -- example Tile 
local entity_id -- example Entity ID 

tile:reserve_entity_by_id( entity_id ) 

Causes the Tile to become reserved by a Entity with a specific unique ID.
An Entity reserving a Tile will stop it from being set to certain TileStates.

Function Call

tile:reserve_entity_by_id()

Parameters

number entity_idThe unique ID of the Entity that you want to mark as reserving this Tile.

Tile:add_entity()

function • v2.0

local tile      -- example Tile 
local entity    -- example Entity 

tile:spawn( entity ) 

Spawns an Entity on this Tile.

Function Call

tile:add_entity()

Parameters

Entity entity_to_add

TileState

NAME MEANING
Normal No special effects.
Cracked Turns into a Broken tile when an Entity moves off of it.
Broken Empty space, cannot be stood on normally.
It will automatically revert to a Normal Tile after a period of time.
Empty Entirely removed, and cannot be stood on normally.
It will not automatically revert to a Normal Tile.
Grass This Tile has grass growing on it.
Holy Reduces the damage that any Entity takes while standing on it.
Ice Causes any Entity that walks onto it to slip, and try to move again in the same direction.
Lava Damages any Entity that stands on it, then reverts to a Normal Tile.
Poison Gradually damages any Entity that stands on it.
Volcano
DirectionDown Aconveyor belt that will try to move any Entity that stands on it downwards.
DirectionUp A conveyor belt that will try to move any Entity that stands on it upwards.
DirectionLeft A conveyor belt that will try to move any Entity that stands on it to the left.
DirectionRight A conveyor belt that will try to move any Entity that stands on it to the right.
Hidden Entirely removed, and cannot be stood on normally.
It will not automatically revert to a Normal Tile.

Entity Objects

Entity

Entities are objects that are present on the battlefield.
There are a number of different types, each intended for different usages.

There are also different types to enable custom scripts to have additional behaviour.
This additional behaviour is only available in their source scripts.
Outside of their source scripts, any Entity object should be treated as if it didn't have custom scripting.

Entity Type Scripted Type Intended Usage

Character / ScriptedCharacter
Character type objects are objects with a health value, some have AI scripting.

Player / ScriptedPlayer
Player type objects are Character-type objects controlled by a player.

Obstacle / ScriptedObstacle
Obstacle type objects are Character-type objects that are spawned by another Entity.
 They are mostly static objects.

Artifact
Artifact type objects are purely visual objects. They do not interact with other Entity objects.

Spell / ScriptedSpell
Spell type objects are attacks and other effects that can influence Entity objects.

Character

Character:get_name()

function • v2.0

local character -- example character 
local character_name = character:get_name() 

Returns the name of this Character.

Function Call

character:get_name()

Returns

string The name of this Character.

Character:set_name()

function • v2.0

local character -- example character 
character:set_name( 'Example' ) 

Changes the name of this Character.

Function Call

character:set_name()

Parameters

string nameThe name you want to assign to this Character.

Character:get_rank()

function • v2.0

local character -- example character 
local character_rank = character:get_rank() 

Returns the Rank of this Character.

Function Call

character:get_rank()

Returns

Rank The Rank of this Character.

Character:get_element()

function • v2.0

local character -- example character 
local character_element = character:get_element() 

Returns the Element of this Character.

Function Call

character:get_element()

Returns

Element The Element of this Character.

Character:set_element()

function • v2.0

local character -- example character 
character:set_element( Element.None ) 

Changes the Element of this Character.

Function Call

character:set_element()

Parameters

Element elementThe Element you want to assign to this Character.

Character:get_id()

function • v2.0

local character -- example character 
local character_id = character:get_id() 

Returns the unique ID assigned to this Character.

Function Call

character:get_id()

Returns

number The unique ID assigned to this Character.

Character:get_health()

function • v2.0

local character -- example character 
local character_health = character:get_health() 

Returns the current HP of this Character.

Function Call

character:get_health()

Returns

number The current HP of this Character.

Character:set_health()

function • v2.0

local character -- example character 
character:set_health( 1 ) 

Sets the health of the Character to a specified value.
 This cannot exceed the Character's maximum health.

Function Call

character:set_health()

Parameters

number healthThe (integer) value to set the Character's health value to.

Character:get_max_health()

function • v2.0

local character -- example character 
local character_max_health = character:get_max_health() 

Returns the natural maximum HP of this Character, without modifiers.

Function Call

character:get_max_health()

Returns

number The natural maximum HP of this Character.

Character:get_facing()

function • v2.0

local character -- example character 
local character_facing = character:get_facing() 

Returns the Direction this Character is facing towards.

Function Call

character:get_facing()

Returns

Direction The Direction of this Character is facing towards.

Character:get_facing_away()

function • v2.0

local character -- example character 
local character_facing = character:get_facing_away() 

Returns the Direction this Character is facing away from.

Function Call

character:get_facing_away()

Returns

Direction The Direction of this Character is facing away from.

Character:set_facing()

function • v2.0

local character -- example character 
local character:set_facing( Direction.Up ) 

Returns the Direction this Character is facing towards.

Function Call

character:set_facing()

Parameters

Direction facingThe Direction you want this Character to face towards.

Character:get_team()

function • v2.0

local character -- example character 
local character_team = character:get_team() 

Returns the Team this Character is a member of.

Function Call

character:get_team()

Returns

Team The Team of this Character.

Character:set_team()

function • v2.0

local character -- example character 
character:set_team( Team.Red ) 

Changes the Team of this Character.

Function Call

character:set_team()

Parameters

Team nameThe Team you want to assign this Character to.

Character:is_team()

function • v2.0

local character -- example character 
local is_red = character:is_team( Team.Red ) 

Returns true if this Character is a member of the provided Team.
 Otherwise, returns false.

Function Call

character:is_team()

Returns

Team The Team of this Character.

Character:set_float_shoe()

function • v2.0

local character -- example character 
character:set_float_shoe( true )  

If true, puts whether this Character has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the Character has it.
While under the effects of FloatShoe, the Character does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

character:set_float_shoe()

Parameters

boolean has_effecttrue if you want this Character to have the FloatShoe effect. Otherwise false.

Character:set_air_shoe()

function • v2.0

local character -- example character 
character:set_air_shoe( true )  

If true, puts whether this Character has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the Character has it.
While under the effects of AirShoe, the Character is able to move over Broken Tiles.

Function Call

character:set_air_shoe()

Parameters

boolean has_effecttrue if you want this Character to have the AirShoe effect. Otherwise false.

Character:set_height()

function • v2.0

local character -- example character 
character:set_height( 100 ) 

Changes the height of this Character.
The height of a Character determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

character:set_height()

Parameters

number heightThe height of this Character.

Character:get_height()

function • v2.0

local character -- example character 
local character_height = character:get_height() 

Returns the height of this Character.

Function Call

character:get_height()

Returns

number The height of this Character.

Character:get_elevation()

function • v2.0

local character -- example character 
local character_elevation = character:get_elevation() 

Returns the elevation of this Character.

Function Call

character:get_elevation()

Returns

number The elevation of this Character.

Character:set_elevation()

function • v2.0

local character -- example character 
character:set_elevation( 100 )  

Changes how high above the battlefield this Character will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

character:set_elevation()

Parameters

number heightThe height of this Character.

Character:get_offset()

function • v2.0

local character -- example character 
local character_offset = character:get_offset() 

Returns the offset of this Character from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

character:get_offset()

Returns

Vector2 The offset of this Character.
  X : horizontal offset
  Y : vertical offset.

Character:set_offset()

function • v2.0

local character -- example character 
character:set_offset( 100, 50 ) 

The above snippet moves the Character100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this Character from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

character:set_offset()

Parameters

number XThe horizontal offset of this Character.
number YThe vertical offset of this Character.

Character:get_tile_offset()

function • v2.0

local character -- example character 
local character_tile_offset = character:get_tile_offset() 

Returns the physical offset of this Character from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

character:get_tile_offset()

Returns

Vector2 The offset of this Character. X : horizontal offset, Y : vertical offset.

Character:get_color()

function • v2.0

Function Call

character:get_color()

Returns

Color

Character:set_color()

function • v2.0

local sprite_node       -- example Character 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this Character to pure black.

This tints the Character with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

character:set_color()

Parameters

Color color_tintThe color you want to tint this Character with.

Character:sprite()

function • v2.0

Function Call

character:sprite()

Returns

SpriteNode

Character:is_passthrough()

function • v2.0

Function Call

character:is_passthrough()

Returns

boolean

Character:is_deleted()

function • v2.0

Function Call

character:is_deleted()

Returns

boolean

Character:erase()

function • v2.0

Immediately removes this Character from the battle.
 This does not cause the Character to call its delete_func().

Function Call

character:erase()

Character:delete()

function • v2.0

Destroys the target Character, making it explode, and removes it from the battlefield afterwards.
 This does cause the Character to call its delete_func().

Function Call

character:delete()

Character:will_erase_eof()

function • v2.0

Function Call

character:will_erase_eof()

Returns

boolean

Character:get_texture()

function • v2.0

Function Call

character:get_texture()

Returns

Texture

Character:set_texture()

function • v2.0

Function Call

character:set_texture()

Parameters

Texture textureThe texture you want to assign to the Character.

Character:set_animation()

function • v2.0

Makes the Character play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the Character will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

character:set_animation()

Parameters

string animation_nameThe name of the animation you want the Character to play.

Character:get_animation()

function • v2.0

Returns the Animation component in charge of the Character's animations.
This does not return the animation the Character currently is playing.

Function Call

character:get_animation()

Returns

Animation The Animation component for the Character.

Character:create_node()

function • v2.0

Creates a new SpriteNode, parented to the Character.

Function Call

character:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Character:get_context()

function • v2.0

Function Call

character:get_context()

Character:get_current_palette()

function • v2.0

Function Call

character:get_current_palette()

Returns

Texture

Character:set_palette()

function • v2.0

Function Call

character:set_palette()

Parameters

Texture palette

Character:get_base_palette()

function • v2.0

Function Call

character:get_base_palette()

Returns

Texture

Character:store_base_palette()

function • v2.0

Function Call

character:store_base_palette()

Parameters

Texture palette

Character:input_has()

function • v2.0

Function Call

character:input_has()

Parameters

InputEvent key_code

Returns

boolean

Character:card_action_event()

function • v2.0

Function Call

character:card_action_event()

Parameters

CardAction card_action
ActionOrder action_order

Character:ignore_common_aggressor()

function • v2.0

Function Call

character:ignore_common_aggressor()

Character:get_field()

function • v2.0

local character -- example character 
local current_field = character:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

character:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Character:get_tile()

function • v2.0

local character     -- example character 
local facing_direction = character:get_facing() 
local tile_in_front = character:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the Character.

Returns a handle to the Tile offset in one direction from this Character.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

character:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Character:get_current_tile()

function • v2.0

local character -- example character 
local tile_in_front = character:get_current_tile() 

Returns a handle to the Tile this Character is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

character:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Character:share_tile()

function • v2.0

local character -- example character 
character:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this Character.
 (default : false)

Function Call

character:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this Character.

Character:slide()

function • v2.0

local character -- example character 
local target_tile   -- The tile you want to move to 
character:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the Character to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the Character to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

character:slide()

Parameters

Tile target_tileThe Tile the Character will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Character:jump()

function • v2.0

local character -- example character 
local target_tile   -- The tile you want to move to 
character:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the Character to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the Character to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

character:jump()

Parameters

Tile target_tileThe Tile the Character will be trying to move towards.
number heightThe height (in pixels) above the field the Character will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Character:teleport()

function • v2.0

local character -- example character 
local target_tile   -- The tile you want to move to 
character:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the Character to teleport to.

Attempts to queue up a movement comand for the Character to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

character:teleport()

Parameters

Tile target_tileThe Tile the Character will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Character:raw_move_event()

function • v2.0

local character -- example character 
local move_event        -- example MoveEvent 
character:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the Character to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the Character.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

character:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the Character will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Character:is_sliding()

function • v2.0

local character -- example character 
local is_sliding = character:is_sliding() 

Returns true if this Character is currently sliding.
 Otherwise, returns false.

Function Call

character:is_sliding()

Returns

boolean Whether this Character is sliding or not.

Character:is_jumping()

function • v2.0

local character -- example character 
local is_jumping = character:is_jumping() 

Returns true if this Character is currently jumping.
 Otherwise, returns false.

Function Call

character:is_jumping()

Returns

boolean Whether this Character is jumping or not.

Character:is_teleporting()

function • v2.0

local character -- example character 
local is_teleporting = character:is_teleporting() 

Returns true if this Character is currently teleporting.
 Otherwise, returns false.

Function Call

character:is_teleporting()

Returns

boolean Whether this Character is teleporting or not.

Character:is_moving()

function • v2.0

local character -- example character 
local is_moving = character:is_moving() 

Returns true if this Character is currently moving in any fashion.
 Otherwise, returns false.

Function Call

character:is_moving()

Returns

boolean Whether this Character is currently moving or not.

Character:hide()

function • v2.0

local character -- example character 
character:hide() 

Hides the graphics for this Character and all of its child objects.

Function Call

character:hide()

Character:reveal()

function • v2.0

local character -- example character 
character:reveal() 

Forces the graphics for this Character and all of its child objects to be drawn again.

Function Call

character:reveal()

Character:show_shadow()

function • v2.0

local character -- example character 
character:show_shadow( true ) 

If true, causes the shadow for this Character to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

character:show_shadow()

Parameters

boolean should_showWhether or not this Character's shadow should be drawn or not.

Character:set_shadow()

function • v2.0

local character -- example character 
character:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this Character.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

character:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this Character.

Character:copy_hit_props()

function • v2.0

local character -- example character 
local hit_props = character:copy_hit_props() 

Returns the HitProps associated with this Character.

Function Call

character:copy_hit_props()

Returns

HitProps The HitProps of this Character.

Character:set_hit_props()

function • v2.0

local character -- example character 
local hit_props -- example HitProps 
character:set_hit_props( hit_props ) 

Defines the basic properties used for when this Character attacks other Entity objects.

Function Call

character:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this Character's attacks.

Character:toggle_hitbox()

function • v2.0

local character -- example character 
character:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

character:toggle_hitbox()

Parameters

boolean enabledtrue, if this Character should be able to be affected by Spells.

Character:toggle_counter()

function • v2.0

local character -- example character 
character:toggle_counter( true ) 

If true, forces this Character to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

character:toggle_counter()

Parameters

boolean counterabletrue, if this Character should be able to be counter-hit. Otherwise false.

Character:add_defense_rule()

function • v2.0

local character -- example character 
local example_rule  -- example DefenseRule 
character:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) Character.
DefenseRules allow the Character to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

character:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Character:remove_defense_rule()

function • v2.0

local character -- example character 
local example_rule  -- example DefenseRule 
character:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) Character.

Function Call

character:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Character:never_flip()

function • v2.0

local character -- example character 
character:never_flip( true )  

If true, stops this Character from flipping direction (graphically) based on its Team.

Function Call

character:never_flip()

Parameters

boolean disable_fliptrue, if this Character should not flip direction (graphically).

Character:highlight_tile()

function • v2.0

local character -- example character 
character:highlight_tile( Highlight.Flash ) 

Causes this Character to highlight the Tile it is currently on.

Function Call

character:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Character:register_component()

function • v2.0

local character -- example character 
local example_component -- example ScriptedComponent 
character:register_component( example_component )  

Registers a Component to this Character.

Function Call

character:register_component()

Parameters

Component componentThe Component you want to register to this Character.

Character:shake_camera()

function • v2.0

local character -- example character 
character:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

character:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Character:register_status_callback()

function • v2.0

local character -- example 'character 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
character:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the Character is hit by an attack with the Stun flag.

Registers a function to the Character that will be called when it is hit by any attack that has a matching property.

Function Call

character:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

Character . battle_start_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

Character actor
The Character.

Description

local character -- example character

character.battle_start_func = function( actor )
    print( "battle begin." )
end

This function will be called if the the Character is alive at the start of battle.

Character . on_spawn_func

callback • v2.0

Callback Signature

function( actor, tile )

Return Value

nil

Parameters

Character actor
The Character being spawned in.

Tile tile
The Tile it is being spawned on (currently for Character objects only).

Description

This function will be called when the Character initially spawns in.
Additionally, Character objects will receive a second Tile argument.

Character . battle_end_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

Character actor
The Character.

Description

local character -- example character

character.battle_end_func = function( actor )
    print( "I LIVED!" )
end

This function that will be called if the Character is alive when the battle ends.

Character . can_move_to_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, target_tile )

Return Value

boolean
true if the Character can move to target Tile, otherwise false.

Parameters

Character actor
The Character trying to move to another Tile.

Tile target_tile
The Tile that the Character wants to move to.

Description

local character -- example character

character.can_move_to_func = function( actor, next_tile )
    return next_tile:get_team() == actor:get_team()
end

This function is called whenever the Character wants to move to a different Tile.
 If it returns true, the Character can move to that Tile. If false, it cannot.

Character . attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, other )

Return Value

nil

Parameters

Character actor
The Character that will be executing the CardAction.

Entity other
The Entity that was hit by this Character.

Description

local character -- example character

character.attack_func = function( actor, other )
    print( "successful hit on another actor " )
end

This function will be called when the Character interacts with another Entity and registers a successful hit.
Note that this is only for direct interaction.
 i.e. If an Entity hits another with a Spell, the Spell will call its attack_func.

Character . collision_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, other )

Return Value

nil

Parameters

Character actor
The Character that will be executing the CardAction.

Entity other
The Entity that collided with this Character.

Description

local character -- example character

character.collision_func = function( actor, other )
    print( "collided with another actor" )
end

This function will be called when the Character collides with another Entity.

Character . on_countered

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

Character actor
The Character being counter-hit.

Description

local character -- example character

character.on_countered = function( actor )
    print( "That wasn't the best time to use that." )
end

This function will be called when the Character is counter-hit while using an attack.

Character . update_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, elapsed )

Return Value

nil

Parameters

Character actor
The Character being updated.

number elapsed
The amount of time elapsed since the last time update_func was called.

Description

local character -- example character

character.update_func = function( actor, elapsed )
    print( "update executed." )
end

This function will be called every frame while the Character is alive.
update_func does not get called during time freeze or while the card menu is open.

Character . delete_func

callback • v2.0

Callback Signature

function( actor )

Return Value

nil

Parameters

Character actor
The Character being deleted.

Description

This function will be called when the Character is deleted.

Character . normal_attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

CardAction
The CardAction that will be executed for the uncharged normal attack.

Parameters

Character actor
The Character that will be executing the CardAction.

Description

local character -- example character

character.normal_attack_func = function( actor )
    return Battle.Buster.new( actor, false, 1 )
end

This function will be called when the Character uses an uncharged normal attack.

Character . charged_attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

CardAction
The CardAction that will be executed for the charged normal attack.

Parameters

Character actor
The Character that will be executing the CardAction.

Description

local character -- example character

character.charged_attack_func = function( actor )
    return Battle.Buster.new( actor, true, 10 )
end

This function will be called when the Character uses a charged normal attack.

Character . special_attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

CardAction
The CardAction that will be executed for the special attack.

Parameters

Character actor
The Character that will be executing the CardAction.

Description

local character -- example character

character.special_attack_func = function( actor ) return Battle.Buster.new( actor, true, 10 ) end

This function will be called when the Character uses a special attack.

ScriptedCharacter

Character:new()

function • v2.0

local scripted_character = Battle.Character.new( Team.Red, Rank.V1 ) 

Creates a new ScriptedCharacter object.

Function Call

scripted_character:new()

Parameters

Team team
Rank rank

Character:from()

function • v2.0

Casts an Entity-based type to be a (non-scripted) Character instead.
Exception: If it is already a ScriptedCharacter, it is returned as a ScriptedCharacter object instead.

Function Call

scripted_character:from()

Parameters

Entity entityThe Entity you want to cast to a ScriptedCharacter.

Character:from_package()

function • v2.0

Creates a ScriptedCharacter using data from a package.

Function Call

scripted_character:from_package()

Parameters

string package_nameThe package name of the ScriptedCharacter you want to load.
Team teamThe Team you want this ScriptedCharacter to belong to.
Rank rankThe Rank you want this ScriptedCharacter.

Character:get_name()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_name = scripted_character:get_name() 

Returns the name of this ScriptedCharacter.

Function Call

scripted_character:get_name()

Returns

string The name of this ScriptedCharacter.

Character:set_name()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_name( 'Example' ) 

Changes the name of this ScriptedCharacter.

Function Call

scripted_character:set_name()

Parameters

string nameThe name you want to assign to this ScriptedCharacter.

Character:get_rank()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_rank = scripted_character:get_rank() 

Returns the Rank of this ScriptedCharacter.

Function Call

scripted_character:get_rank()

Returns

Rank The Rank of this ScriptedCharacter.

Character:get_element()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_element = scripted_character:get_element() 

Returns the Element of this ScriptedCharacter.

Function Call

scripted_character:get_element()

Returns

Element The Element of this ScriptedCharacter.

Character:set_element()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_element( Element.None ) 

Changes the Element of this ScriptedCharacter.

Function Call

scripted_character:set_element()

Parameters

Element elementThe Element you want to assign to this ScriptedCharacter.

Character:get_id()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_id = scripted_character:get_id() 

Returns the unique ID assigned to this ScriptedCharacter.

Function Call

scripted_character:get_id()

Returns

number The unique ID assigned to this ScriptedCharacter.

Character:get_health()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_health = scripted_character:get_health() 

Returns the current HP of this ScriptedCharacter.

Function Call

scripted_character:get_health()

Returns

number The current HP of this ScriptedCharacter.

Character:set_health()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_health( 1 ) 

Sets the health of the ScriptedCharacter to a specified value.
 This cannot exceed the ScriptedCharacter's maximum health.

Function Call

scripted_character:set_health()

Parameters

number healthThe (integer) value to set the ScriptedCharacter's health value to.

Character:get_max_health()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_max_health = scripted_character:get_max_health() 

Returns the natural maximum HP of this ScriptedCharacter, without modifiers.

Function Call

scripted_character:get_max_health()

Returns

number The natural maximum HP of this ScriptedCharacter.

Character:get_facing()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_facing = scripted_character:get_facing() 

Returns the Direction this ScriptedCharacter is facing towards.

Function Call

scripted_character:get_facing()

Returns

Direction The Direction of this ScriptedCharacter is facing towards.

Character:get_facing_away()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_facing = scripted_character:get_facing_away() 

Returns the Direction this ScriptedCharacter is facing away from.

Function Call

scripted_character:get_facing_away()

Returns

Direction The Direction of this ScriptedCharacter is facing away from.

Character:set_facing()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character:set_facing( Direction.Up ) 

Returns the Direction this ScriptedCharacter is facing towards.

Function Call

scripted_character:set_facing()

Parameters

Direction facingThe Direction you want this ScriptedCharacter to face towards.

Character:get_team()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_team = scripted_character:get_team() 

Returns the Team this ScriptedCharacter is a member of.

Function Call

scripted_character:get_team()

Returns

Team The Team of this ScriptedCharacter.

Character:set_team()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_team( Team.Red ) 

Changes the Team of this ScriptedCharacter.

Function Call

scripted_character:set_team()

Parameters

Team nameThe Team you want to assign this ScriptedCharacter to.

Character:is_team()

function • v2.0

local scripted_character    -- example scripted_character 
local is_red = scripted_character:is_team( Team.Red ) 

Returns true if this ScriptedCharacter is a member of the provided Team.
 Otherwise, returns false.

Function Call

scripted_character:is_team()

Returns

Team The Team of this ScriptedCharacter.

Character:set_float_shoe()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_float_shoe( true )  

If true, puts whether this ScriptedCharacter has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the ScriptedCharacter has it.
While under the effects of FloatShoe, the ScriptedCharacter does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

scripted_character:set_float_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedCharacter to have the FloatShoe effect. Otherwise false.

Character:set_air_shoe()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_air_shoe( true )  

If true, puts whether this ScriptedCharacter has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the ScriptedCharacter has it.
While under the effects of AirShoe, the ScriptedCharacter is able to move over Broken Tiles.

Function Call

scripted_character:set_air_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedCharacter to have the AirShoe effect. Otherwise false.

Character:set_height()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_height( 100 ) 

Changes the height of this ScriptedCharacter.
The height of a ScriptedCharacter determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

scripted_character:set_height()

Parameters

number heightThe height of this ScriptedCharacter.

Character:get_height()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_height = scripted_character:get_height() 

Returns the height of this ScriptedCharacter.

Function Call

scripted_character:get_height()

Returns

number The height of this ScriptedCharacter.

Character:get_elevation()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_elevation = scripted_character:get_elevation() 

Returns the elevation of this ScriptedCharacter.

Function Call

scripted_character:get_elevation()

Returns

number The elevation of this ScriptedCharacter.

Character:set_elevation()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_elevation( 100 )  

Changes how high above the battlefield this ScriptedCharacter will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

scripted_character:set_elevation()

Parameters

number heightThe height of this ScriptedCharacter.

Character:get_offset()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_offset = scripted_character:get_offset() 

Returns the offset of this ScriptedCharacter from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_character:get_offset()

Returns

Vector2 The offset of this ScriptedCharacter.
  X : horizontal offset
  Y : vertical offset.

Character:set_offset()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_offset( 100, 50 ) 

The above snippet moves the ScriptedCharacter100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this ScriptedCharacter from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_character:set_offset()

Parameters

number XThe horizontal offset of this ScriptedCharacter.
number YThe vertical offset of this ScriptedCharacter.

Character:get_tile_offset()

function • v2.0

local scripted_character    -- example scripted_character 
local scripted_character_tile_offset = scripted_character:get_tile_offset() 

Returns the physical offset of this ScriptedCharacter from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

scripted_character:get_tile_offset()

Returns

Vector2 The offset of this ScriptedCharacter. X : horizontal offset, Y : vertical offset.

Character:get_color()

function • v2.0

Function Call

scripted_character:get_color()

Returns

Color

Character:set_color()

function • v2.0

local sprite_node       -- example ScriptedCharacter 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this ScriptedCharacter to pure black.

This tints the ScriptedCharacter with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

scripted_character:set_color()

Parameters

Color color_tintThe color you want to tint this ScriptedCharacter with.

Character:sprite()

function • v2.0

Function Call

scripted_character:sprite()

Returns

SpriteNode

Character:is_passthrough()

function • v2.0

Function Call

scripted_character:is_passthrough()

Returns

boolean

Character:is_deleted()

function • v2.0

Function Call

scripted_character:is_deleted()

Returns

boolean

Character:erase()

function • v2.0

Immediately removes this ScriptedCharacter from the battle.
 This does not cause the ScriptedCharacter to call its delete_func().

Function Call

scripted_character:erase()

Character:delete()

function • v2.0

Destroys the target ScriptedCharacter, making it explode, and removes it from the battlefield afterwards.
 This does cause the ScriptedCharacter to call its delete_func().

Function Call

scripted_character:delete()

Character:will_erase_eof()

function • v2.0

Function Call

scripted_character:will_erase_eof()

Returns

boolean

Character:get_texture()

function • v2.0

Function Call

scripted_character:get_texture()

Returns

Texture

Character:set_texture()

function • v2.0

Function Call

scripted_character:set_texture()

Parameters

Texture textureThe texture you want to assign to the ScriptedCharacter.

Character:set_animation()

function • v2.0

Makes the ScriptedCharacter play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the ScriptedCharacter will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

scripted_character:set_animation()

Parameters

string animation_nameThe name of the animation you want the ScriptedCharacter to play.

Character:get_animation()

function • v2.0

Returns the Animation component in charge of the ScriptedCharacter's animations.
This does not return the animation the ScriptedCharacter currently is playing.

Function Call

scripted_character:get_animation()

Returns

Animation The Animation component for the ScriptedCharacter.

Character:create_node()

function • v2.0

Creates a new SpriteNode, parented to the ScriptedCharacter.

Function Call

scripted_character:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Character:get_context()

function • v2.0

Function Call

scripted_character:get_context()

Character:get_current_palette()

function • v2.0

Function Call

scripted_character:get_current_palette()

Returns

Texture

Character:set_palette()

function • v2.0

Function Call

scripted_character:set_palette()

Parameters

Texture palette

Character:get_base_palette()

function • v2.0

Function Call

scripted_character:get_base_palette()

Returns

Texture

Character:store_base_palette()

function • v2.0

Function Call

scripted_character:store_base_palette()

Parameters

Texture palette

Character:input_has()

function • v2.0

Function Call

scripted_character:input_has()

Parameters

InputEvent key_code

Returns

boolean

Character:get_target()

function • v2.0

Function Call

scripted_character:get_target()

Returns

Character

Character:card_action_event()

function • v2.0

Function Call

scripted_character:card_action_event()

Parameters

CardAction card_action
ActionOrder action_order

Character:ignore_common_aggressor()

function • v2.0

Function Call

scripted_character:ignore_common_aggressor()

Character:get_field()

function • v2.0

local scripted_character    -- example scripted_character 
local current_field = scripted_character:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

scripted_character:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Character:get_tile()

function • v2.0

local scripted_character        -- example scripted_character 
local facing_direction = scripted_character:get_facing() 
local tile_in_front = scripted_character:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the ScriptedCharacter.

Returns a handle to the Tile offset in one direction from this ScriptedCharacter.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_character:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Character:get_current_tile()

function • v2.0

local scripted_character    -- example scripted_character 
local tile_in_front = scripted_character:get_current_tile() 

Returns a handle to the Tile this ScriptedCharacter is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_character:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Character:share_tile()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this ScriptedCharacter.
 (default : false)

Function Call

scripted_character:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this ScriptedCharacter.

Character:slide()

function • v2.0

local scripted_character    -- example scripted_character 
local target_tile   -- The tile you want to move to 
scripted_character:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the ScriptedCharacter to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the ScriptedCharacter to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_character:slide()

Parameters

Tile target_tileThe Tile the ScriptedCharacter will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Character:jump()

function • v2.0

local scripted_character    -- example scripted_character 
local target_tile   -- The tile you want to move to 
scripted_character:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedCharacter to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedCharacter to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_character:jump()

Parameters

Tile target_tileThe Tile the ScriptedCharacter will be trying to move towards.
number heightThe height (in pixels) above the field the ScriptedCharacter will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Character:teleport()

function • v2.0

local scripted_character    -- example scripted_character 
local target_tile   -- The tile you want to move to 
scripted_character:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedCharacter to teleport to.

Attempts to queue up a movement comand for the ScriptedCharacter to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_character:teleport()

Parameters

Tile target_tileThe Tile the ScriptedCharacter will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Character:raw_move_event()

function • v2.0

local scripted_character    -- example scripted_character 
local move_event        -- example MoveEvent 
scripted_character:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the ScriptedCharacter to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedCharacter.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_character:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the ScriptedCharacter will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Character:is_sliding()

function • v2.0

local scripted_character    -- example scripted_character 
local is_sliding = scripted_character:is_sliding() 

Returns true if this ScriptedCharacter is currently sliding.
 Otherwise, returns false.

Function Call

scripted_character:is_sliding()

Returns

boolean Whether this ScriptedCharacter is sliding or not.

Character:is_jumping()

function • v2.0

local scripted_character    -- example scripted_character 
local is_jumping = scripted_character:is_jumping() 

Returns true if this ScriptedCharacter is currently jumping.
 Otherwise, returns false.

Function Call

scripted_character:is_jumping()

Returns

boolean Whether this ScriptedCharacter is jumping or not.

Character:is_teleporting()

function • v2.0

local scripted_character    -- example scripted_character 
local is_teleporting = scripted_character:is_teleporting() 

Returns true if this ScriptedCharacter is currently teleporting.
 Otherwise, returns false.

Function Call

scripted_character:is_teleporting()

Returns

boolean Whether this ScriptedCharacter is teleporting or not.

Character:is_moving()

function • v2.0

local scripted_character    -- example scripted_character 
local is_moving = scripted_character:is_moving() 

Returns true if this ScriptedCharacter is currently moving in any fashion.
 Otherwise, returns false.

Function Call

scripted_character:is_moving()

Returns

boolean Whether this ScriptedCharacter is currently moving or not.

Character:hide()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:hide() 

Hides the graphics for this ScriptedCharacter and all of its child objects.

Function Call

scripted_character:hide()

Character:reveal()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:reveal() 

Forces the graphics for this ScriptedCharacter and all of its child objects to be drawn again.

Function Call

scripted_character:reveal()

Character:show_shadow()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:show_shadow( true ) 

If true, causes the shadow for this ScriptedCharacter to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

scripted_character:show_shadow()

Parameters

boolean should_showWhether or not this ScriptedCharacter's shadow should be drawn or not.

Character:set_shadow()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this ScriptedCharacter.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

scripted_character:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this ScriptedCharacter.

Character:copy_hit_props()

function • v2.0

local scripted_character    -- example scripted_character 
local hit_props = scripted_character:copy_hit_props() 

Returns the HitProps associated with this ScriptedCharacter.

Function Call

scripted_character:copy_hit_props()

Returns

HitProps The HitProps of this ScriptedCharacter.

Character:set_hit_props()

function • v2.0

local scripted_character    -- example scripted_character 
local hit_props -- example HitProps 
scripted_character:set_hit_props( hit_props ) 

Defines the basic properties used for when this ScriptedCharacter attacks other Entity objects.

Function Call

scripted_character:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this ScriptedCharacter's attacks.

Character:toggle_hitbox()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

scripted_character:toggle_hitbox()

Parameters

boolean enabledtrue, if this ScriptedCharacter should be able to be affected by Spells.

Character:toggle_counter()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:toggle_counter( true ) 

If true, forces this ScriptedCharacter to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

scripted_character:toggle_counter()

Parameters

boolean counterabletrue, if this ScriptedCharacter should be able to be counter-hit. Otherwise false.

Character:add_defense_rule()

function • v2.0

local scripted_character    -- example scripted_character 
local example_rule  -- example DefenseRule 
scripted_character:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) ScriptedCharacter.
DefenseRules allow the ScriptedCharacter to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

scripted_character:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Character:remove_defense_rule()

function • v2.0

local scripted_character    -- example scripted_character 
local example_rule  -- example DefenseRule 
scripted_character:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) ScriptedCharacter.

Function Call

scripted_character:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Character:never_flip()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:never_flip( true )  

If true, stops this ScriptedCharacter from flipping direction (graphically) based on its Team.

Function Call

scripted_character:never_flip()

Parameters

boolean disable_fliptrue, if this ScriptedCharacter should not flip direction (graphically).

Character:highlight_tile()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:highlight_tile( Highlight.Flash ) 

Causes this ScriptedCharacter to highlight the Tile it is currently on.

Function Call

scripted_character:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Character:register_component()

function • v2.0

local scripted_character    -- example scripted_character 
local example_component -- example ScriptedComponent 
scripted_character:register_component( example_component )  

Registers a Component to this ScriptedCharacter.

Function Call

scripted_character:register_component()

Parameters

Component componentThe Component you want to register to this ScriptedCharacter.

Character:shake_camera()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

scripted_character:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Character:set_explosion_behavior()

function • v2.0

local scripted_character    -- example scripted_character 
scripted_character:set_explosion_behavior( number, speed, is_boss ) 

Defines the behavior of the explosions that happen when this ScriptedCharacter is destroyed.

Function Call

scripted_character:set_explosion_behavior()

Parameters

number numberThe number of explosions that happen on deletion.
number speedThe rate at which the explosions happen.
boolean is_bossWhether this is considered a "boss-type" ScriptedCharacter.

Character:register_status_callback()

function • v2.0

local scripted_character    -- example 'scripted_character 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
scripted_character:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the ScriptedCharacter is hit by an attack with the Stun flag.

Registers a function to the ScriptedCharacter that will be called when it is hit by any attack that has a matching property.

Function Call

scripted_character:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

Character . battle_start_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedCharacter actor
The ScriptedCharacter.

Description

local scripted_character    -- example scripted_character

scripted_character.battle_start_func = function( actor )
    print( "battle begin." )
end

This function will be called if the the ScriptedCharacter is alive at the start of battle.

Character . on_spawn_func

callback • v2.0

Callback Signature

function( actor, tile )

Return Value

nil

Parameters

ScriptedCharacter actor
The ScriptedCharacter being spawned in.

Tile tile
The Tile it is being spawned on (currently for Character objects only).

Description

This function will be called when the ScriptedCharacter initially spawns in.
Additionally, Character objects will receive a second Tile argument.

Character . battle_end_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedCharacter actor
The ScriptedCharacter.

Description

local scripted_character    -- example scripted_character

scripted_character.battle_end_func = function( actor )
    print( "I LIVED!" )
end

This function that will be called if the ScriptedCharacter is alive when the battle ends.

Character . can_move_to_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, target_tile )

Return Value

boolean
true if the ScriptedCharacter can move to target Tile, otherwise false.

Parameters

ScriptedCharacter actor
The ScriptedCharacter trying to move to another Tile.

Tile target_tile
The Tile that the ScriptedCharacter wants to move to.

Description

local scripted_character    -- example scripted_character

scripted_character.can_move_to_func = function( actor, next_tile )
    return next_tile:get_team() == actor:get_team()
end

This function is called whenever the ScriptedCharacter wants to move to a different Tile.
 If it returns true, the ScriptedCharacter can move to that Tile. If false, it cannot.

Character . on_countered

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedCharacter actor
The ScriptedCharacter being counter-hit.

Description

local scripted_character    -- example scripted_character

scripted_character.on_countered = function( actor )
    print( "That wasn't the best time to use that." )
end

This function will be called when the ScriptedCharacter is counter-hit while using an attack.

Character . update_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, elapsed )

Return Value

nil

Parameters

ScriptedCharacter actor
The ScriptedCharacter being updated.

number elapsed
The amount of time elapsed since the last time update_func was called.

Description

local scripted_character    -- example scripted_character

scripted_character.update_func = function( actor, elapsed )
    print( "update executed." )
end

This function will be called every frame while the ScriptedCharacter is alive.
update_func does not get called during time freeze or while the card menu is open.

Character . delete_func

callback • v2.0

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedCharacter actor
The ScriptedCharacter being deleted.

Description

This function will be called when the ScriptedCharacter is deleted.

Player

Player:get_name()

function • v2.0

local player    -- example player 
local player_name = player:get_name() 

Returns the name of this Player.

Function Call

player:get_name()

Returns

string The name of this Player.

Player:set_name()

function • v2.0

local player    -- example player 
player:set_name( 'Example' ) 

Changes the name of this Player.

Function Call

player:set_name()

Parameters

string nameThe name you want to assign to this Player.

Player:get_element()

function • v2.0

local player    -- example player 
local player_element = player:get_element() 

Returns the Element of this Player.

Function Call

player:get_element()

Returns

Element The Element of this Player.

Player:set_element()

function • v2.0

local player    -- example player 
player:set_element( Element.None ) 

Changes the Element of this Player.

Function Call

player:set_element()

Parameters

Element elementThe Element you want to assign to this Player.

Player:get_attack_level()

function • v2.0

local player    -- example player 
local player_attack = player:get_attack_level() 

Returns the attack level of this Player.

Function Call

player:get_attack_level()

Returns

number The attack level of this Player.

Player:set_attack_level()

function • v2.0

local player    -- example player 
player:set_attack_level(5) 

Sets the attack level of this Player.
 Valid values are any value between 1 and 5 (inclusive).

Function Call

player:set_attack_level()

Parameters

number attackThe attack value you want this Player to have.

Player:get_charge_level()

function • v2.0

local player    -- example player 
local player_charge = player:get_charge_level() 

Returns the charge level of this Player.
 Valid values are any value between 1 and 5 (inclusive).
 A higher charge level also allows you to use your charge shot faster.

Function Call

player:get_charge_level()

Returns

number The charge level of this Player.

Player:set_charge_level()

function • v2.0

local player    -- example player 
player:set_charge_level( 5 ) 

The above snippet sets the Player's charge level to maximum.

Returns the charge level of this Player.
 Valid values are any value between 1 and 5 (inclusive).
 A higher charge level also allows you to use your charge shot faster.

Function Call

player:set_charge_level()

Returns

number The charge level of this Player.

Player:set_fully_charged_color()

function • v2.0

local player    -- example player 
local example_color = Color.new( 255, 0, 0, 255 ) 
player:set_fully_charged_color( example_color ) 

The above snippet makes the Player's particles glow red when fully charged.

Changes the color of the particle effect when the Player has a charge attack ready.

Function Call

player:set_fully_charged_color()

Parameters

Color colorThe Color you want this Player to glow using.

Player:set_charge_position()

function • v2.0

local player    -- example player 
player:set_charge_position( 100, 50 ) 

Changes the position of this Player's charge particles.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

player:set_charge_position()

Parameters

number XThe horizontal offset you want to give this Player's charge particles.
number XThe horizontal offset you want to give this Player's charge particles.

Player:get_id()

function • v2.0

local player    -- example player 
local player_id = player:get_id() 

Returns the unique ID assigned to this Player.

Function Call

player:get_id()

Returns

number The unique ID assigned to this Player.

Player:get_health()

function • v2.0

local player    -- example player 
local player_health = player:get_health() 

Returns the current HP of this Player.

Function Call

player:get_health()

Returns

number The current HP of this Player.

Player:set_health()

function • v2.0

local player    -- example player 
player:set_health( 1 ) 

Sets the health of the Player to a specified value.
 This cannot exceed the Player's maximum health.

Function Call

player:set_health()

Parameters

number healthThe (integer) value to set the Player's health value to.

Player:get_max_health()

function • v2.0

local player    -- example player 
local player_max_health = player:get_max_health() 

Returns the natural maximum HP of this Player, without modifiers.

Function Call

player:get_max_health()

Returns

number The natural maximum HP of this Player.

Player:mod_max_health()

function • v2.0

local player    -- example player 
player:mod_max_health( 100 )  

Changes the modifier that affects the maximum health of this Player.
This is intended to be used by external systems affecting the Player, not the Player itself.

Function Call

player:mod_max_health()

Parameters

number mod_hpThe amount you want to affect the Player's maximum HP by.

Player:get_max_health_mod()

function • v2.0

local player    -- example player 
local player_max_health = player:get_max_health_mod() 

Returns the maximum HP of this Player, including modifiers.

Function Call

player:get_max_health_mod()

Returns

number The maximum HP of this Player, including modifiers.

Player:get_facing()

function • v2.0

local player    -- example player 
local player_facing = player:get_facing() 

Returns the Direction this Player is facing towards.

Function Call

player:get_facing()

Returns

Direction The Direction of this Player is facing towards.

Player:get_facing_away()

function • v2.0

local player    -- example player 
local player_facing = player:get_facing_away() 

Returns the Direction this Player is facing away from.

Function Call

player:get_facing_away()

Returns

Direction The Direction of this Player is facing away from.

Player:set_facing()

function • v2.0

local player    -- example player 
local player:set_facing( Direction.Up ) 

Returns the Direction this Player is facing towards.

Function Call

player:set_facing()

Parameters

Direction facingThe Direction you want this Player to face towards.

Player:get_team()

function • v2.0

local player    -- example player 
local player_team = player:get_team() 

Returns the Team this Player is a member of.

Function Call

player:get_team()

Returns

Team The Team of this Player.

Player:set_team()

function • v2.0

local player    -- example player 
player:set_team( Team.Red ) 

Changes the Team of this Player.

Function Call

player:set_team()

Parameters

Team nameThe Team you want to assign this Player to.

Player:is_team()

function • v2.0

local player    -- example player 
local is_red = player:is_team( Team.Red ) 

Returns true if this Player is a member of the provided Team.
 Otherwise, returns false.

Function Call

player:is_team()

Returns

Team The Team of this Player.

Player:set_float_shoe()

function • v2.0

local player    -- example player 
player:set_float_shoe( true )  

If true, puts whether this Player has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the Player has it.
While under the effects of FloatShoe, the Player does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

player:set_float_shoe()

Parameters

boolean has_effecttrue if you want this Player to have the FloatShoe effect. Otherwise false.

Player:set_air_shoe()

function • v2.0

local player    -- example player 
player:set_air_shoe( true )  

If true, puts whether this Player has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the Player has it.
While under the effects of AirShoe, the Player is able to move over Broken Tiles.

Function Call

player:set_air_shoe()

Parameters

boolean has_effecttrue if you want this Player to have the AirShoe effect. Otherwise false.

Player:slide_when_moving()

function • v2.0

local player    -- example player 
player:slide_when_moving( true ) 

If true, makes this Player slide along the ground when moving between Tiles.
Otherwise, they will warp to the Tile.

Function Call

player:slide_when_moving()

Parameters

boolean has_effecttrue if you want this Player to have the FloatShoe effect. Otherwise false.

Player:set_height()

function • v2.0

local player    -- example player 
player:set_height( 100 ) 

Changes the height of this Player.
The height of a Player determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

player:set_height()

Parameters

number heightThe height of this Player.

Player:get_height()

function • v2.0

local player    -- example player 
local player_height = player:get_height() 

Returns the height of this Player.

Function Call

player:get_height()

Returns

number The height of this Player.

Player:get_elevation()

function • v2.0

local player    -- example player 
local player_elevation = player:get_elevation() 

Returns the elevation of this Player.

Function Call

player:get_elevation()

Returns

number The elevation of this Player.

Player:set_elevation()

function • v2.0

local player    -- example player 
player:set_elevation( 100 )  

Changes how high above the battlefield this Player will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

player:set_elevation()

Parameters

number heightThe height of this Player.

Player:get_offset()

function • v2.0

local player    -- example player 
local player_offset = player:get_offset() 

Returns the offset of this Player from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

player:get_offset()

Returns

Vector2 The offset of this Player.
  X : horizontal offset
  Y : vertical offset.

Player:set_offset()

function • v2.0

local player    -- example player 
player:set_offset( 100, 50 ) 

The above snippet moves the Player100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this Player from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

player:set_offset()

Parameters

number XThe horizontal offset of this Player.
number YThe vertical offset of this Player.

Player:get_tile_offset()

function • v2.0

local player    -- example player 
local player_tile_offset = player:get_tile_offset() 

Returns the physical offset of this Player from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

player:get_tile_offset()

Returns

Vector2 The offset of this Player. X : horizontal offset, Y : vertical offset.

Player:get_color()

function • v2.0

Function Call

player:get_color()

Returns

Color

Player:set_color()

function • v2.0

local sprite_node       -- example Player 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this Player to pure black.

This tints the Player with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

player:set_color()

Parameters

Color color_tintThe color you want to tint this Player with.

Player:sprite()

function • v2.0

Function Call

player:sprite()

Returns

SpriteNode

Player:is_passthrough()

function • v2.0

Function Call

player:is_passthrough()

Returns

boolean

Player:is_deleted()

function • v2.0

Function Call

player:is_deleted()

Returns

boolean

Player:erase()

function • v2.0

Immediately removes this Player from the battle.
 This does not cause the Player to call its delete_func().

Function Call

player:erase()

Player:delete()

function • v2.0

Destroys the target Player, making it explode, and removes it from the battlefield afterwards.
 This does cause the Player to call its delete_func().

Function Call

player:delete()

Player:will_erase_eof()

function • v2.0

Function Call

player:will_erase_eof()

Returns

boolean

Player:get_texture()

function • v2.0

Function Call

player:get_texture()

Returns

Texture

Player:set_texture()

function • v2.0

Function Call

player:set_texture()

Parameters

Texture textureThe texture you want to assign to the Player.

Player:set_animation()

function • v2.0

Makes the Player play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the Player will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

player:set_animation()

Parameters

string animation_nameThe name of the animation you want the Player to play.

Player:get_animation()

function • v2.0

Returns the Animation component in charge of the Player's animations.
This does not return the animation the Player currently is playing.

Function Call

player:get_animation()

Returns

Animation The Animation component for the Player.

Player:create_node()

function • v2.0

Creates a new SpriteNode, parented to the Player.

Function Call

player:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Player:get_context()

function • v2.0

Function Call

player:get_context()

Player:get_current_palette()

function • v2.0

Function Call

player:get_current_palette()

Returns

Texture

Player:set_palette()

function • v2.0

Function Call

player:set_palette()

Parameters

Texture palette

Player:get_base_palette()

function • v2.0

Function Call

player:get_base_palette()

Returns

Texture

Player:store_base_palette()

function • v2.0

Function Call

player:store_base_palette()

Parameters

Texture palette

Player:input_has()

function • v2.0

Function Call

player:input_has()

Parameters

InputEvent key_code

Returns

boolean

Player:card_action_event()

function • v2.0

Function Call

player:card_action_event()

Parameters

CardAction card_action
ActionOrder action_order

Player:create_sync_node()

function • v2.0

Function Call

player:create_sync_node()

Parameters

string attachment_point

Returns

SyncNode

Player:remove_sync_node()

function • v2.0

Function Call

player:remove_sync_node()

Parameters

SyncNode sync_node

Player:ignore_common_aggressor()

function • v2.0

Function Call

player:ignore_common_aggressor()

Player:get_field()

function • v2.0

local player    -- example player 
local current_field = player:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

player:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Player:get_tile()

function • v2.0

local player        -- example player 
local facing_direction = player:get_facing() 
local tile_in_front = player:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the Player.

Returns a handle to the Tile offset in one direction from this Player.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

player:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Player:get_current_tile()

function • v2.0

local player    -- example player 
local tile_in_front = player:get_current_tile() 

Returns a handle to the Tile this Player is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

player:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Player:share_tile()

function • v2.0

local player    -- example player 
player:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this Player.
 (default : false)

Function Call

player:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this Player.

Player:slide()

function • v2.0

local player    -- example player 
local target_tile   -- The tile you want to move to 
player:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the Player to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the Player to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

player:slide()

Parameters

Tile target_tileThe Tile the Player will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Player:jump()

function • v2.0

local player    -- example player 
local target_tile   -- The tile you want to move to 
player:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the Player to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the Player to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

player:jump()

Parameters

Tile target_tileThe Tile the Player will be trying to move towards.
number heightThe height (in pixels) above the field the Player will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Player:teleport()

function • v2.0

local player    -- example player 
local target_tile   -- The tile you want to move to 
player:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the Player to teleport to.

Attempts to queue up a movement comand for the Player to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

player:teleport()

Parameters

Tile target_tileThe Tile the Player will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Player:raw_move_event()

function • v2.0

local player    -- example player 
local move_event        -- example MoveEvent 
player:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the Player to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the Player.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

player:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the Player will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Player:is_sliding()

function • v2.0

local player    -- example player 
local is_sliding = player:is_sliding() 

Returns true if this Player is currently sliding.
 Otherwise, returns false.

Function Call

player:is_sliding()

Returns

boolean Whether this Player is sliding or not.

Player:is_jumping()

function • v2.0

local player    -- example player 
local is_jumping = player:is_jumping() 

Returns true if this Player is currently jumping.
 Otherwise, returns false.

Function Call

player:is_jumping()

Returns

boolean Whether this Player is jumping or not.

Player:is_teleporting()

function • v2.0

local player    -- example player 
local is_teleporting = player:is_teleporting() 

Returns true if this Player is currently teleporting.
 Otherwise, returns false.

Function Call

player:is_teleporting()

Returns

boolean Whether this Player is teleporting or not.

Player:is_moving()

function • v2.0

local player    -- example player 
local is_moving = player:is_moving() 

Returns true if this Player is currently moving in any fashion.
 Otherwise, returns false.

Function Call

player:is_moving()

Returns

boolean Whether this Player is currently moving or not.

Player:hide()

function • v2.0

local player    -- example player 
player:hide() 

Hides the graphics for this Player and all of its child objects.

Function Call

player:hide()

Player:reveal()

function • v2.0

local player    -- example player 
player:reveal() 

Forces the graphics for this Player and all of its child objects to be drawn again.

Function Call

player:reveal()

Player:show_shadow()

function • v2.0

local player    -- example player 
player:show_shadow( true ) 

If true, causes the shadow for this Player to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

player:show_shadow()

Parameters

boolean should_showWhether or not this Player's shadow should be drawn or not.

Player:set_shadow()

function • v2.0

local player    -- example player 
player:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this Player.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

player:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this Player.

Player:copy_hit_props()

function • v2.0

local player    -- example player 
local hit_props = player:copy_hit_props() 

Returns the HitProps associated with this Player.

Function Call

player:copy_hit_props()

Returns

HitProps The HitProps of this Player.

Player:set_hit_props()

function • v2.0

local player    -- example player 
local hit_props -- example HitProps 
player:set_hit_props( hit_props ) 

Defines the basic properties used for when this Player attacks other Entity objects.

Function Call

player:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this Player's attacks.

Player:toggle_hitbox()

function • v2.0

local player    -- example player 
player:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

player:toggle_hitbox()

Parameters

boolean enabledtrue, if this Player should be able to be affected by Spells.

Player:toggle_counter()

function • v2.0

local player    -- example player 
player:toggle_counter( true ) 

If true, forces this Player to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

player:toggle_counter()

Parameters

boolean counterabletrue, if this Player should be able to be counter-hit. Otherwise false.

Player:add_defense_rule()

function • v2.0

local player    -- example player 
local example_rule  -- example DefenseRule 
player:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) Player.
DefenseRules allow the Player to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

player:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Player:remove_defense_rule()

function • v2.0

local player    -- example player 
local example_rule  -- example DefenseRule 
player:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) Player.

Function Call

player:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Player:never_flip()

function • v2.0

local player    -- example player 
player:never_flip( true )  

If true, stops this Player from flipping direction (graphically) based on its Team.

Function Call

player:never_flip()

Parameters

boolean disable_fliptrue, if this Player should not flip direction (graphically).

Player:highlight_tile()

function • v2.0

local player    -- example player 
player:highlight_tile( Highlight.Flash ) 

Causes this Player to highlight the Tile it is currently on.

Function Call

player:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Player:register_component()

function • v2.0

local player    -- example player 
local example_component -- example ScriptedComponent 
player:register_component( example_component )  

Registers a Component to this Player.

Function Call

player:register_component()

Parameters

Component componentThe Component you want to register to this Player.

Player:shake_camera()

function • v2.0

local player    -- example player 
player:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

player:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Player:register_status_callback()

function • v2.0

local player    -- example 'player 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
player:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the Player is hit by an attack with the Stun flag.

Registers a function to the Player that will be called when it is hit by any attack that has a matching property.

Function Call

player:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

ScriptedPlayer

Player:from()

function • v2.0

Casts an Entity-based type to be a (non-scripted) Player instead.
Exception: If it is already a ScriptedPlayer, it is returned as a ScriptedPlayer object instead.

Function Call

scripted_player:from()

Parameters

Entity entityThe Entity you want to cast to a ScriptedPlayer.

Player:get_name()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_name = scripted_player:get_name() 

Returns the name of this ScriptedPlayer.

Function Call

scripted_player:get_name()

Returns

string The name of this ScriptedPlayer.

Player:set_name()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_name( 'Example' ) 

Changes the name of this ScriptedPlayer.

Function Call

scripted_player:set_name()

Parameters

string nameThe name you want to assign to this ScriptedPlayer.

Player:get_element()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_element = scripted_player:get_element() 

Returns the Element of this ScriptedPlayer.

Function Call

scripted_player:get_element()

Returns

Element The Element of this ScriptedPlayer.

Player:set_element()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_element( Element.None ) 

Changes the Element of this ScriptedPlayer.

Function Call

scripted_player:set_element()

Parameters

Element elementThe Element you want to assign to this ScriptedPlayer.

Player:get_attack_level()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_attack = scripted_player:get_attack_level() 

Returns the attack level of this ScriptedPlayer.

Function Call

scripted_player:get_attack_level()

Returns

number The attack level of this ScriptedPlayer.

Player:set_attack_level()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_attack_level(5) 

Sets the attack level of this ScriptedPlayer.
 Valid values are any value between 1 and 5 (inclusive).

Function Call

scripted_player:set_attack_level()

Parameters

number attackThe attack value you want this ScriptedPlayer to have.

Player:get_charge_level()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_charge = scripted_player:get_charge_level() 

Returns the charge level of this ScriptedPlayer.
 Valid values are any value between 1 and 5 (inclusive).
 A higher charge level also allows you to use your charge shot faster.

Function Call

scripted_player:get_charge_level()

Returns

number The charge level of this ScriptedPlayer.

Player:set_charge_level()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_charge_level( 5 ) 

The above snippet sets the ScriptedPlayer's charge level to maximum.

Returns the charge level of this ScriptedPlayer.
 Valid values are any value between 1 and 5 (inclusive).
 A higher charge level also allows you to use your charge shot faster.

Function Call

scripted_player:set_charge_level()

Returns

number The charge level of this ScriptedPlayer.

Player:set_fully_charged_color()

function • v2.0

local scripted_player   -- example scripted_player 
local example_color = Color.new( 255, 0, 0, 255 ) 
scripted_player:set_fully_charged_color( example_color ) 

The above snippet makes the ScriptedPlayer's particles glow red when fully charged.

Changes the color of the particle effect when the ScriptedPlayer has a charge attack ready.

Function Call

scripted_player:set_fully_charged_color()

Parameters

Color colorThe Color you want this ScriptedPlayer to glow using.

Player:set_charge_position()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_charge_position( 100, 50 ) 

Changes the position of this ScriptedPlayer's charge particles.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_player:set_charge_position()

Parameters

number XThe horizontal offset you want to give this ScriptedPlayer's charge particles.
number XThe horizontal offset you want to give this ScriptedPlayer's charge particles.

Player:get_id()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_id = scripted_player:get_id() 

Returns the unique ID assigned to this ScriptedPlayer.

Function Call

scripted_player:get_id()

Returns

number The unique ID assigned to this ScriptedPlayer.

Player:get_health()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_health = scripted_player:get_health() 

Returns the current HP of this ScriptedPlayer.

Function Call

scripted_player:get_health()

Returns

number The current HP of this ScriptedPlayer.

Player:set_health()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_health( 1 ) 

Sets the health of the ScriptedPlayer to a specified value.
 This cannot exceed the ScriptedPlayer's maximum health.

Function Call

scripted_player:set_health()

Parameters

number healthThe (integer) value to set the ScriptedPlayer's health value to.

Player:get_max_health()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_max_health = scripted_player:get_max_health() 

Returns the natural maximum HP of this ScriptedPlayer, without modifiers.

Function Call

scripted_player:get_max_health()

Returns

number The natural maximum HP of this ScriptedPlayer.

Player:mod_max_health()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:mod_max_health( 100 )  

Changes the modifier that affects the maximum health of this ScriptedPlayer.
This is intended to be used by external systems affecting the ScriptedPlayer, not the ScriptedPlayer itself.

Function Call

scripted_player:mod_max_health()

Parameters

number mod_hpThe amount you want to affect the ScriptedPlayer's maximum HP by.

Player:get_max_health_mod()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_max_health = scripted_player:get_max_health_mod() 

Returns the maximum HP of this ScriptedPlayer, including modifiers.

Function Call

scripted_player:get_max_health_mod()

Returns

number The maximum HP of this ScriptedPlayer, including modifiers.

Player:get_facing()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_facing = scripted_player:get_facing() 

Returns the Direction this ScriptedPlayer is facing towards.

Function Call

scripted_player:get_facing()

Returns

Direction The Direction of this ScriptedPlayer is facing towards.

Player:get_facing_away()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_facing = scripted_player:get_facing_away() 

Returns the Direction this ScriptedPlayer is facing away from.

Function Call

scripted_player:get_facing_away()

Returns

Direction The Direction of this ScriptedPlayer is facing away from.

Player:set_facing()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player:set_facing( Direction.Up ) 

Returns the Direction this ScriptedPlayer is facing towards.

Function Call

scripted_player:set_facing()

Parameters

Direction facingThe Direction you want this ScriptedPlayer to face towards.

Player:get_team()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_team = scripted_player:get_team() 

Returns the Team this ScriptedPlayer is a member of.

Function Call

scripted_player:get_team()

Returns

Team The Team of this ScriptedPlayer.

Player:set_team()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_team( Team.Red ) 

Changes the Team of this ScriptedPlayer.

Function Call

scripted_player:set_team()

Parameters

Team nameThe Team you want to assign this ScriptedPlayer to.

Player:is_team()

function • v2.0

local scripted_player   -- example scripted_player 
local is_red = scripted_player:is_team( Team.Red ) 

Returns true if this ScriptedPlayer is a member of the provided Team.
 Otherwise, returns false.

Function Call

scripted_player:is_team()

Returns

Team The Team of this ScriptedPlayer.

Player:set_float_shoe()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_float_shoe( true )  

If true, puts whether this ScriptedPlayer has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the ScriptedPlayer has it.
While under the effects of FloatShoe, the ScriptedPlayer does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

scripted_player:set_float_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedPlayer to have the FloatShoe effect. Otherwise false.

Player:set_air_shoe()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_air_shoe( true )  

If true, puts whether this ScriptedPlayer has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the ScriptedPlayer has it.
While under the effects of AirShoe, the ScriptedPlayer is able to move over Broken Tiles.

Function Call

scripted_player:set_air_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedPlayer to have the AirShoe effect. Otherwise false.

Player:slide_when_moving()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:slide_when_moving( true ) 

If true, makes this ScriptedPlayer slide along the ground when moving between Tiles.
Otherwise, they will warp to the Tile.

Function Call

scripted_player:slide_when_moving()

Parameters

boolean has_effecttrue if you want this ScriptedPlayer to have the FloatShoe effect. Otherwise false.

Player:set_height()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_height( 100 ) 

Changes the height of this ScriptedPlayer.
The height of a ScriptedPlayer determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

scripted_player:set_height()

Parameters

number heightThe height of this ScriptedPlayer.

Player:get_height()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_height = scripted_player:get_height() 

Returns the height of this ScriptedPlayer.

Function Call

scripted_player:get_height()

Returns

number The height of this ScriptedPlayer.

Player:get_elevation()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_elevation = scripted_player:get_elevation() 

Returns the elevation of this ScriptedPlayer.

Function Call

scripted_player:get_elevation()

Returns

number The elevation of this ScriptedPlayer.

Player:set_elevation()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_elevation( 100 )  

Changes how high above the battlefield this ScriptedPlayer will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

scripted_player:set_elevation()

Parameters

number heightThe height of this ScriptedPlayer.

Player:get_offset()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_offset = scripted_player:get_offset() 

Returns the offset of this ScriptedPlayer from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_player:get_offset()

Returns

Vector2 The offset of this ScriptedPlayer.
  X : horizontal offset
  Y : vertical offset.

Player:set_offset()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_offset( 100, 50 ) 

The above snippet moves the ScriptedPlayer100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this ScriptedPlayer from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_player:set_offset()

Parameters

number XThe horizontal offset of this ScriptedPlayer.
number YThe vertical offset of this ScriptedPlayer.

Player:get_tile_offset()

function • v2.0

local scripted_player   -- example scripted_player 
local scripted_player_tile_offset = scripted_player:get_tile_offset() 

Returns the physical offset of this ScriptedPlayer from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

scripted_player:get_tile_offset()

Returns

Vector2 The offset of this ScriptedPlayer. X : horizontal offset, Y : vertical offset.

Player:get_color()

function • v2.0

Function Call

scripted_player:get_color()

Returns

Color

Player:set_color()

function • v2.0

local sprite_node       -- example ScriptedPlayer 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this ScriptedPlayer to pure black.

This tints the ScriptedPlayer with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

scripted_player:set_color()

Parameters

Color color_tintThe color you want to tint this ScriptedPlayer with.

Player:sprite()

function • v2.0

Function Call

scripted_player:sprite()

Returns

SpriteNode

Player:is_passthrough()

function • v2.0

Function Call

scripted_player:is_passthrough()

Returns

boolean

Player:is_deleted()

function • v2.0

Function Call

scripted_player:is_deleted()

Returns

boolean

Player:erase()

function • v2.0

Immediately removes this ScriptedPlayer from the battle.
 This does not cause the ScriptedPlayer to call its delete_func().

Function Call

scripted_player:erase()

Player:delete()

function • v2.0

Destroys the target ScriptedPlayer, making it explode, and removes it from the battlefield afterwards.
 This does cause the ScriptedPlayer to call its delete_func().

Function Call

scripted_player:delete()

Player:will_erase_eof()

function • v2.0

Function Call

scripted_player:will_erase_eof()

Returns

boolean

Player:get_texture()

function • v2.0

Function Call

scripted_player:get_texture()

Returns

Texture

Player:set_texture()

function • v2.0

Function Call

scripted_player:set_texture()

Parameters

Texture textureThe texture you want to assign to the ScriptedPlayer.

Player:set_animation()

function • v2.0

Makes the ScriptedPlayer play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the ScriptedPlayer will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

scripted_player:set_animation()

Parameters

string animation_nameThe name of the animation you want the ScriptedPlayer to play.

Player:get_animation()

function • v2.0

Returns the Animation component in charge of the ScriptedPlayer's animations.
This does not return the animation the ScriptedPlayer currently is playing.

Function Call

scripted_player:get_animation()

Returns

Animation The Animation component for the ScriptedPlayer.

Player:create_node()

function • v2.0

Creates a new SpriteNode, parented to the ScriptedPlayer.

Function Call

scripted_player:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Player:get_context()

function • v2.0

Function Call

scripted_player:get_context()

Player:get_current_palette()

function • v2.0

Function Call

scripted_player:get_current_palette()

Returns

Texture

Player:set_palette()

function • v2.0

Function Call

scripted_player:set_palette()

Parameters

Texture palette

Player:get_base_palette()

function • v2.0

Function Call

scripted_player:get_base_palette()

Returns

Texture

Player:store_base_palette()

function • v2.0

Function Call

scripted_player:store_base_palette()

Parameters

Texture palette

Player:input_has()

function • v2.0

Function Call

scripted_player:input_has()

Parameters

InputEvent key_code

Returns

boolean

Player:create_form()

function • v2.0

local scripted_player   -- example scripted_player 
local new_form = scripted_player:create_form() 

Function Call

scripted_player:create_form()

Returns

FormMeta

Player:create_sync_node()

function • v2.0

Function Call

scripted_player:create_sync_node()

Parameters

string attachment_point

Returns

SyncNode

Player:remove_sync_node()

function • v2.0

Function Call

scripted_player:remove_sync_node()

Parameters

SyncNode sync_node

Player:ignore_common_aggressor()

function • v2.0

Function Call

scripted_player:ignore_common_aggressor()

Player:get_field()

function • v2.0

local scripted_player   -- example scripted_player 
local current_field = scripted_player:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

scripted_player:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Player:get_tile()

function • v2.0

local scripted_player       -- example scripted_player 
local facing_direction = scripted_player:get_facing() 
local tile_in_front = scripted_player:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the ScriptedPlayer.

Returns a handle to the Tile offset in one direction from this ScriptedPlayer.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_player:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Player:get_current_tile()

function • v2.0

local scripted_player   -- example scripted_player 
local tile_in_front = scripted_player:get_current_tile() 

Returns a handle to the Tile this ScriptedPlayer is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_player:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Player:share_tile()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this ScriptedPlayer.
 (default : false)

Function Call

scripted_player:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this ScriptedPlayer.

Player:slide()

function • v2.0

local scripted_player   -- example scripted_player 
local target_tile   -- The tile you want to move to 
scripted_player:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the ScriptedPlayer to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the ScriptedPlayer to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_player:slide()

Parameters

Tile target_tileThe Tile the ScriptedPlayer will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Player:jump()

function • v2.0

local scripted_player   -- example scripted_player 
local target_tile   -- The tile you want to move to 
scripted_player:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedPlayer to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedPlayer to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_player:jump()

Parameters

Tile target_tileThe Tile the ScriptedPlayer will be trying to move towards.
number heightThe height (in pixels) above the field the ScriptedPlayer will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Player:teleport()

function • v2.0

local scripted_player   -- example scripted_player 
local target_tile   -- The tile you want to move to 
scripted_player:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedPlayer to teleport to.

Attempts to queue up a movement comand for the ScriptedPlayer to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_player:teleport()

Parameters

Tile target_tileThe Tile the ScriptedPlayer will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Player:raw_move_event()

function • v2.0

local scripted_player   -- example scripted_player 
local move_event        -- example MoveEvent 
scripted_player:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the ScriptedPlayer to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedPlayer.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_player:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the ScriptedPlayer will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Player:is_sliding()

function • v2.0

local scripted_player   -- example scripted_player 
local is_sliding = scripted_player:is_sliding() 

Returns true if this ScriptedPlayer is currently sliding.
 Otherwise, returns false.

Function Call

scripted_player:is_sliding()

Returns

boolean Whether this ScriptedPlayer is sliding or not.

Player:is_jumping()

function • v2.0

local scripted_player   -- example scripted_player 
local is_jumping = scripted_player:is_jumping() 

Returns true if this ScriptedPlayer is currently jumping.
 Otherwise, returns false.

Function Call

scripted_player:is_jumping()

Returns

boolean Whether this ScriptedPlayer is jumping or not.

Player:is_teleporting()

function • v2.0

local scripted_player   -- example scripted_player 
local is_teleporting = scripted_player:is_teleporting() 

Returns true if this ScriptedPlayer is currently teleporting.
 Otherwise, returns false.

Function Call

scripted_player:is_teleporting()

Returns

boolean Whether this ScriptedPlayer is teleporting or not.

Player:is_moving()

function • v2.0

local scripted_player   -- example scripted_player 
local is_moving = scripted_player:is_moving() 

Returns true if this ScriptedPlayer is currently moving in any fashion.
 Otherwise, returns false.

Function Call

scripted_player:is_moving()

Returns

boolean Whether this ScriptedPlayer is currently moving or not.

Player:hide()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:hide() 

Hides the graphics for this ScriptedPlayer and all of its child objects.

Function Call

scripted_player:hide()

Player:reveal()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:reveal() 

Forces the graphics for this ScriptedPlayer and all of its child objects to be drawn again.

Function Call

scripted_player:reveal()

Player:show_shadow()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:show_shadow( true ) 

If true, causes the shadow for this ScriptedPlayer to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

scripted_player:show_shadow()

Parameters

boolean should_showWhether or not this ScriptedPlayer's shadow should be drawn or not.

Player:set_shadow()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this ScriptedPlayer.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

scripted_player:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this ScriptedPlayer.

Player:copy_hit_props()

function • v2.0

local scripted_player   -- example scripted_player 
local hit_props = scripted_player:copy_hit_props() 

Returns the HitProps associated with this ScriptedPlayer.

Function Call

scripted_player:copy_hit_props()

Returns

HitProps The HitProps of this ScriptedPlayer.

Player:set_hit_props()

function • v2.0

local scripted_player   -- example scripted_player 
local hit_props -- example HitProps 
scripted_player:set_hit_props( hit_props ) 

Defines the basic properties used for when this ScriptedPlayer attacks other Entity objects.

Function Call

scripted_player:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this ScriptedPlayer's attacks.

Player:toggle_hitbox()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

scripted_player:toggle_hitbox()

Parameters

boolean enabledtrue, if this ScriptedPlayer should be able to be affected by Spells.

Player:toggle_counter()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:toggle_counter( true ) 

If true, forces this ScriptedPlayer to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

scripted_player:toggle_counter()

Parameters

boolean counterabletrue, if this ScriptedPlayer should be able to be counter-hit. Otherwise false.

Player:add_defense_rule()

function • v2.0

local scripted_player   -- example scripted_player 
local example_rule  -- example DefenseRule 
scripted_player:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) ScriptedPlayer.
DefenseRules allow the ScriptedPlayer to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

scripted_player:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Player:remove_defense_rule()

function • v2.0

local scripted_player   -- example scripted_player 
local example_rule  -- example DefenseRule 
scripted_player:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) ScriptedPlayer.

Function Call

scripted_player:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Player:never_flip()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:never_flip( true )  

If true, stops this ScriptedPlayer from flipping direction (graphically) based on its Team.

Function Call

scripted_player:never_flip()

Parameters

boolean disable_fliptrue, if this ScriptedPlayer should not flip direction (graphically).

Player:highlight_tile()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:highlight_tile( Highlight.Flash ) 

Causes this ScriptedPlayer to highlight the Tile it is currently on.

Function Call

scripted_player:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Player:register_component()

function • v2.0

local scripted_player   -- example scripted_player 
local example_component -- example ScriptedComponent 
scripted_player:register_component( example_component )  

Registers a Component to this ScriptedPlayer.

Function Call

scripted_player:register_component()

Parameters

Component componentThe Component you want to register to this ScriptedPlayer.

Player:shake_camera()

function • v2.0

local scripted_player   -- example scripted_player 
scripted_player:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

scripted_player:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Player:register_status_callback()

function • v2.0

local scripted_player   -- example 'scripted_player 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
scripted_player:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the ScriptedPlayer is hit by an attack with the Stun flag.

Registers a function to the ScriptedPlayer that will be called when it is hit by any attack that has a matching property.

Function Call

scripted_player:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

Player . battle_start_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedPlayer actor
The ScriptedPlayer.

Description

local scripted_player   -- example scripted_player

scripted_player.battle_start_func = function( actor )
    print( "battle begin." )
end

This function will be called if the the ScriptedPlayer is alive at the start of battle.

Player . battle_end_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedPlayer actor
The ScriptedPlayer.

Description

local scripted_player   -- example scripted_player

scripted_player.battle_end_func = function( actor )
    print( "I LIVED!" )
end

This function that will be called if the ScriptedPlayer is alive when the battle ends.

Player . update_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, elapsed )

Return Value

nil

Parameters

ScriptedPlayer actor
The ScriptedPlayer being updated.

number elapsed
The amount of time elapsed since the last time update_func was called.

Description

local scripted_player   -- example scripted_player

scripted_player.update_func = function( actor, elapsed )
    print( "update executed." )
end

This function will be called every frame while the ScriptedPlayer is alive.
update_func does not get called during time freeze or while the card menu is open.

Player . normal_attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

CardAction
The CardAction that will be executed for the uncharged normal attack.

Parameters

ScriptedPlayer actor
The ScriptedPlayer that will be executing the CardAction.

Description

local scripted_player   -- example scripted_player

scripted_player.normal_attack_func = function( actor )
    return Battle.Buster.new( actor, false, 1 )
end

This function will be called when the ScriptedPlayer uses an uncharged normal attack.

Player . charged_attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

CardAction
The CardAction that will be executed for the charged normal attack.

Parameters

ScriptedPlayer actor
The ScriptedPlayer that will be executing the CardAction.

Description

local scripted_player   -- example scripted_player

scripted_player.charged_attack_func = function( actor )
    return Battle.Buster.new( actor, true, 10 )
end

This function will be called when the ScriptedPlayer uses a charged normal attack.

Player . special_attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

CardAction
The CardAction that will be executed for the special attack.

Parameters

ScriptedPlayer actor
The ScriptedPlayer that will be executing the CardAction.

Description

local scripted_player   -- example scripted_player

scripted_player.special_attack_func = function( actor ) return Battle.Buster.new( actor, true, 10 ) end

This function will be called when the ScriptedPlayer uses a special attack.

ScriptedSpell

Spell:new()

function • v2.0

local scripted_spell = Battle.Spell.new( Team.Red ) 

Creates a new ScriptedSpell object.

Function Call

scripted_spell:new()

Parameters

Team team

Spell:get_name()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_name = scripted_spell:get_name() 

Returns the name of this ScriptedSpell.

Function Call

scripted_spell:get_name()

Returns

string The name of this ScriptedSpell.

Spell:set_name()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_name( 'Example' ) 

Changes the name of this ScriptedSpell.

Function Call

scripted_spell:set_name()

Parameters

string nameThe name you want to assign to this ScriptedSpell.

Spell:get_element()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_element = scripted_spell:get_element() 

Returns the Element of this ScriptedSpell.

Function Call

scripted_spell:get_element()

Returns

Element The Element of this ScriptedSpell.

Spell:set_element()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_element( Element.None ) 

Changes the Element of this ScriptedSpell.

Function Call

scripted_spell:set_element()

Parameters

Element elementThe Element you want to assign to this ScriptedSpell.

Spell:get_id()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_id = scripted_spell:get_id() 

Returns the unique ID assigned to this ScriptedSpell.

Function Call

scripted_spell:get_id()

Returns

number The unique ID assigned to this ScriptedSpell.

Spell:get_health()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_health = scripted_spell:get_health() 

Returns the current HP of this ScriptedSpell.

Function Call

scripted_spell:get_health()

Returns

number The current HP of this ScriptedSpell.

Spell:set_health()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_health( 1 ) 

Sets the health of the ScriptedSpell to a specified value.
 This cannot exceed the ScriptedSpell's maximum health.

Function Call

scripted_spell:set_health()

Parameters

number healthThe (integer) value to set the ScriptedSpell's health value to.

Spell:get_max_health()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_max_health = scripted_spell:get_max_health() 

Returns the natural maximum HP of this ScriptedSpell, without modifiers.

Function Call

scripted_spell:get_max_health()

Returns

number The natural maximum HP of this ScriptedSpell.

Spell:get_facing()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_facing = scripted_spell:get_facing() 

Returns the Direction this ScriptedSpell is facing towards.

Function Call

scripted_spell:get_facing()

Returns

Direction The Direction of this ScriptedSpell is facing towards.

Spell:get_facing_away()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_facing = scripted_spell:get_facing_away() 

Returns the Direction this ScriptedSpell is facing away from.

Function Call

scripted_spell:get_facing_away()

Returns

Direction The Direction of this ScriptedSpell is facing away from.

Spell:set_facing()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell:set_facing( Direction.Up ) 

Returns the Direction this ScriptedSpell is facing towards.

Function Call

scripted_spell:set_facing()

Parameters

Direction facingThe Direction you want this ScriptedSpell to face towards.

Spell:get_team()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_team = scripted_spell:get_team() 

Returns the Team this ScriptedSpell is a member of.

Function Call

scripted_spell:get_team()

Returns

Team The Team of this ScriptedSpell.

Spell:set_team()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_team( Team.Red ) 

Changes the Team of this ScriptedSpell.

Function Call

scripted_spell:set_team()

Parameters

Team nameThe Team you want to assign this ScriptedSpell to.

Spell:is_team()

function • v2.0

local scripted_spell    -- example scripted_spell 
local is_red = scripted_spell:is_team( Team.Red ) 

Returns true if this ScriptedSpell is a member of the provided Team.
 Otherwise, returns false.

Function Call

scripted_spell:is_team()

Returns

Team The Team of this ScriptedSpell.

Spell:set_float_shoe()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_float_shoe( true )  

If true, puts whether this ScriptedSpell has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the ScriptedSpell has it.
While under the effects of FloatShoe, the ScriptedSpell does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

scripted_spell:set_float_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedSpell to have the FloatShoe effect. Otherwise false.

Spell:set_air_shoe()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_air_shoe( true )  

If true, puts whether this ScriptedSpell has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the ScriptedSpell has it.
While under the effects of AirShoe, the ScriptedSpell is able to move over Broken Tiles.

Function Call

scripted_spell:set_air_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedSpell to have the AirShoe effect. Otherwise false.

Spell:set_height()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_height( 100 ) 

Changes the height of this ScriptedSpell.
The height of a ScriptedSpell determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

scripted_spell:set_height()

Parameters

number heightThe height of this ScriptedSpell.

Spell:get_height()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_height = scripted_spell:get_height() 

Returns the height of this ScriptedSpell.

Function Call

scripted_spell:get_height()

Returns

number The height of this ScriptedSpell.

Spell:get_elevation()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_elevation = scripted_spell:get_elevation() 

Returns the elevation of this ScriptedSpell.

Function Call

scripted_spell:get_elevation()

Returns

number The elevation of this ScriptedSpell.

Spell:set_elevation()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_elevation( 100 )  

Changes how high above the battlefield this ScriptedSpell will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

scripted_spell:set_elevation()

Parameters

number heightThe height of this ScriptedSpell.

Spell:get_offset()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_offset = scripted_spell:get_offset() 

Returns the offset of this ScriptedSpell from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_spell:get_offset()

Returns

Vector2 The offset of this ScriptedSpell.
  X : horizontal offset
  Y : vertical offset.

Spell:set_offset()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_offset( 100, 50 ) 

The above snippet moves the ScriptedSpell100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this ScriptedSpell from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_spell:set_offset()

Parameters

number XThe horizontal offset of this ScriptedSpell.
number YThe vertical offset of this ScriptedSpell.

Spell:get_tile_offset()

function • v2.0

local scripted_spell    -- example scripted_spell 
local scripted_spell_tile_offset = scripted_spell:get_tile_offset() 

Returns the physical offset of this ScriptedSpell from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

scripted_spell:get_tile_offset()

Returns

Vector2 The offset of this ScriptedSpell. X : horizontal offset, Y : vertical offset.

Spell:get_color()

function • v2.0

Function Call

scripted_spell:get_color()

Returns

Color

Spell:set_color()

function • v2.0

local sprite_node       -- example ScriptedSpell 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this ScriptedSpell to pure black.

This tints the ScriptedSpell with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

scripted_spell:set_color()

Parameters

Color color_tintThe color you want to tint this ScriptedSpell with.

Spell:sprite()

function • v2.0

Function Call

scripted_spell:sprite()

Returns

SpriteNode

Spell:is_passthrough()

function • v2.0

Function Call

scripted_spell:is_passthrough()

Returns

boolean

Spell:is_deleted()

function • v2.0

Function Call

scripted_spell:is_deleted()

Returns

boolean

Spell:erase()

function • v2.0

Immediately removes this ScriptedSpell from the battle.
 This does not cause the ScriptedSpell to call its delete_func().

Function Call

scripted_spell:erase()

Spell:delete()

function • v2.0

Destroys the target ScriptedSpell, making it explode, and removes it from the battlefield afterwards.
 This does cause the ScriptedSpell to call its delete_func().

Function Call

scripted_spell:delete()

Spell:will_erase_eof()

function • v2.0

Function Call

scripted_spell:will_erase_eof()

Returns

boolean

Spell:get_texture()

function • v2.0

Function Call

scripted_spell:get_texture()

Returns

Texture

Spell:set_texture()

function • v2.0

Function Call

scripted_spell:set_texture()

Parameters

Texture textureThe texture you want to assign to the ScriptedSpell.

Spell:set_animation()

function • v2.0

Makes the ScriptedSpell play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the ScriptedSpell will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

scripted_spell:set_animation()

Parameters

string animation_nameThe name of the animation you want the ScriptedSpell to play.

Spell:get_animation()

function • v2.0

Returns the Animation component in charge of the ScriptedSpell's animations.
This does not return the animation the ScriptedSpell currently is playing.

Function Call

scripted_spell:get_animation()

Returns

Animation The Animation component for the ScriptedSpell.

Spell:create_node()

function • v2.0

Creates a new SpriteNode, parented to the ScriptedSpell.

Function Call

scripted_spell:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Spell:get_context()

function • v2.0

Function Call

scripted_spell:get_context()

Spell:get_current_palette()

function • v2.0

Function Call

scripted_spell:get_current_palette()

Returns

Texture

Spell:set_palette()

function • v2.0

Function Call

scripted_spell:set_palette()

Parameters

Texture palette

Spell:get_base_palette()

function • v2.0

Function Call

scripted_spell:get_base_palette()

Returns

Texture

Spell:store_base_palette()

function • v2.0

Function Call

scripted_spell:store_base_palette()

Parameters

Texture palette

Spell:input_has()

function • v2.0

Function Call

scripted_spell:input_has()

Parameters

InputEvent key_code

Returns

boolean

Spell:ignore_common_aggressor()

function • v2.0

Function Call

scripted_spell:ignore_common_aggressor()

Spell:get_field()

function • v2.0

local scripted_spell    -- example scripted_spell 
local current_field = scripted_spell:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

scripted_spell:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Spell:get_tile()

function • v2.0

local scripted_spell        -- example scripted_spell 
local facing_direction = scripted_spell:get_facing() 
local tile_in_front = scripted_spell:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the ScriptedSpell.

Returns a handle to the Tile offset in one direction from this ScriptedSpell.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_spell:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Spell:get_current_tile()

function • v2.0

local scripted_spell    -- example scripted_spell 
local tile_in_front = scripted_spell:get_current_tile() 

Returns a handle to the Tile this ScriptedSpell is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_spell:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Spell:share_tile()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this ScriptedSpell.
 (default : false)

Function Call

scripted_spell:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this ScriptedSpell.

Spell:slide()

function • v2.0

local scripted_spell    -- example scripted_spell 
local target_tile   -- The tile you want to move to 
scripted_spell:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the ScriptedSpell to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the ScriptedSpell to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_spell:slide()

Parameters

Tile target_tileThe Tile the ScriptedSpell will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Spell:jump()

function • v2.0

local scripted_spell    -- example scripted_spell 
local target_tile   -- The tile you want to move to 
scripted_spell:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedSpell to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedSpell to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_spell:jump()

Parameters

Tile target_tileThe Tile the ScriptedSpell will be trying to move towards.
number heightThe height (in pixels) above the field the ScriptedSpell will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Spell:teleport()

function • v2.0

local scripted_spell    -- example scripted_spell 
local target_tile   -- The tile you want to move to 
scripted_spell:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedSpell to teleport to.

Attempts to queue up a movement comand for the ScriptedSpell to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_spell:teleport()

Parameters

Tile target_tileThe Tile the ScriptedSpell will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Spell:raw_move_event()

function • v2.0

local scripted_spell    -- example scripted_spell 
local move_event        -- example MoveEvent 
scripted_spell:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the ScriptedSpell to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedSpell.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_spell:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the ScriptedSpell will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Spell:is_sliding()

function • v2.0

local scripted_spell    -- example scripted_spell 
local is_sliding = scripted_spell:is_sliding() 

Returns true if this ScriptedSpell is currently sliding.
 Otherwise, returns false.

Function Call

scripted_spell:is_sliding()

Returns

boolean Whether this ScriptedSpell is sliding or not.

Spell:is_jumping()

function • v2.0

local scripted_spell    -- example scripted_spell 
local is_jumping = scripted_spell:is_jumping() 

Returns true if this ScriptedSpell is currently jumping.
 Otherwise, returns false.

Function Call

scripted_spell:is_jumping()

Returns

boolean Whether this ScriptedSpell is jumping or not.

Spell:is_teleporting()

function • v2.0

local scripted_spell    -- example scripted_spell 
local is_teleporting = scripted_spell:is_teleporting() 

Returns true if this ScriptedSpell is currently teleporting.
 Otherwise, returns false.

Function Call

scripted_spell:is_teleporting()

Returns

boolean Whether this ScriptedSpell is teleporting or not.

Spell:is_moving()

function • v2.0

local scripted_spell    -- example scripted_spell 
local is_moving = scripted_spell:is_moving() 

Returns true if this ScriptedSpell is currently moving in any fashion.
 Otherwise, returns false.

Function Call

scripted_spell:is_moving()

Returns

boolean Whether this ScriptedSpell is currently moving or not.

Spell:hide()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:hide() 

Hides the graphics for this ScriptedSpell and all of its child objects.

Function Call

scripted_spell:hide()

Spell:reveal()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:reveal() 

Forces the graphics for this ScriptedSpell and all of its child objects to be drawn again.

Function Call

scripted_spell:reveal()

Spell:show_shadow()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:show_shadow( true ) 

If true, causes the shadow for this ScriptedSpell to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

scripted_spell:show_shadow()

Parameters

boolean should_showWhether or not this ScriptedSpell's shadow should be drawn or not.

Spell:set_shadow()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this ScriptedSpell.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

scripted_spell:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this ScriptedSpell.

Spell:copy_hit_props()

function • v2.0

local scripted_spell    -- example scripted_spell 
local hit_props = scripted_spell:copy_hit_props() 

Returns the HitProps associated with this ScriptedSpell.

Function Call

scripted_spell:copy_hit_props()

Returns

HitProps The HitProps of this ScriptedSpell.

Spell:set_hit_props()

function • v2.0

local scripted_spell    -- example scripted_spell 
local hit_props -- example HitProps 
scripted_spell:set_hit_props( hit_props ) 

Defines the basic properties used for when this ScriptedSpell attacks other Entity objects.

Function Call

scripted_spell:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this ScriptedSpell's attacks.

Spell:toggle_hitbox()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

scripted_spell:toggle_hitbox()

Parameters

boolean enabledtrue, if this ScriptedSpell should be able to be affected by Spells.

Spell:toggle_counter()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:toggle_counter( true ) 

If true, forces this ScriptedSpell to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

scripted_spell:toggle_counter()

Parameters

boolean counterabletrue, if this ScriptedSpell should be able to be counter-hit. Otherwise false.

Spell:add_defense_rule()

function • v2.0

local scripted_spell    -- example scripted_spell 
local example_rule  -- example DefenseRule 
scripted_spell:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) ScriptedSpell.
DefenseRules allow the ScriptedSpell to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

scripted_spell:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Spell:remove_defense_rule()

function • v2.0

local scripted_spell    -- example scripted_spell 
local example_rule  -- example DefenseRule 
scripted_spell:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) ScriptedSpell.

Function Call

scripted_spell:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Spell:never_flip()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:never_flip( true )  

If true, stops this ScriptedSpell from flipping direction (graphically) based on its Team.

Function Call

scripted_spell:never_flip()

Parameters

boolean disable_fliptrue, if this ScriptedSpell should not flip direction (graphically).

Spell:highlight_tile()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:highlight_tile( Highlight.Flash ) 

Causes this ScriptedSpell to highlight the Tile it is currently on.

Function Call

scripted_spell:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Spell:register_component()

function • v2.0

local scripted_spell    -- example scripted_spell 
local example_component -- example ScriptedComponent 
scripted_spell:register_component( example_component )  

Registers a Component to this ScriptedSpell.

Function Call

scripted_spell:register_component()

Parameters

Component componentThe Component you want to register to this ScriptedSpell.

Spell:shake_camera()

function • v2.0

local scripted_spell    -- example scripted_spell 
scripted_spell:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

scripted_spell:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Spell:register_status_callback()

function • v2.0

local scripted_spell    -- example 'scripted_spell 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
scripted_spell:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the ScriptedSpell is hit by an attack with the Stun flag.

Registers a function to the ScriptedSpell that will be called when it is hit by any attack that has a matching property.

Function Call

scripted_spell:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

Spell . battle_start_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell.

Description

local scripted_spell    -- example scripted_spell

scripted_spell.battle_start_func = function( actor )
    print( "battle begin." )
end

This function will be called if the the ScriptedSpell is alive at the start of battle.

Spell . on_spawn_func

callback • v2.0

Callback Signature

function( actor, tile )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell being spawned in.

Tile tile
The Tile it is being spawned on (currently for Character objects only).

Description

This function will be called when the ScriptedSpell initially spawns in.
Additionally, Character objects will receive a second Tile argument.

Spell . battle_end_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell.

Description

local scripted_spell    -- example scripted_spell

scripted_spell.battle_end_func = function( actor )
    print( "I LIVED!" )
end

This function that will be called if the ScriptedSpell is alive when the battle ends.

Spell . can_move_to_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, target_tile )

Return Value

boolean
true if the ScriptedSpell can move to target Tile, otherwise false.

Parameters

ScriptedSpell actor
The ScriptedSpell trying to move to another Tile.

Tile target_tile
The Tile that the ScriptedSpell wants to move to.

Description

local scripted_spell    -- example scripted_spell

scripted_spell.can_move_to_func = function( actor, next_tile )
    return next_tile:get_team() == actor:get_team()
end

This function is called whenever the ScriptedSpell wants to move to a different Tile.
 If it returns true, the ScriptedSpell can move to that Tile. If false, it cannot.

Spell . attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, other )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell that will be executing the CardAction.

Entity other
The Entity that was hit by this ScriptedSpell.

Description

local scripted_spell    -- example scripted_spell

scripted_spell.attack_func = function( actor, other )
    print( "successful hit on another actor " )
end

This function will be called when the ScriptedSpell interacts with another Entity and registers a successful hit.
Note that this is only for direct interaction.
 i.e. If an Entity hits another with a Spell, the Spell will call its attack_func.

Spell . collision_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, other )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell that will be executing the CardAction.

Entity other
The Entity that collided with this ScriptedSpell.

Description

local scripted_spell -- example scripted_spell

scripted_spell.collision_func = function( actor, other )
    print( "collided with another actor" )
end

This function will be called when the ScriptedSpell collides with another Entity.

Spell . update_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, elapsed )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell being updated.

number elapsed
The amount of time elapsed since the last time update_func was called.

Description

local scripted_spell    -- example scripted_spell

scripted_spell.update_func = function( actor, elapsed )
    print( "update executed." )
end

This function will be called every frame while the ScriptedSpell is alive.
update_func does not get called during time freeze or while the card menu is open.

Spell . delete_func

callback • v2.0

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedSpell actor
The ScriptedSpell being deleted.

Description

This function will be called when the ScriptedSpell is deleted.

ScriptedObstacle

Obstacle:new()

function • v2.0

local scripted_obstacle = Battle.Obstacle.new( Team.Red ) 

Creates a new ScriptedObstacle object.

Function Call

scripted_obstacle:new()

Parameters

Team team

Obstacle:from()

function • v2.0

Casts an Entity-based type to be a (non-scripted) Obstacle instead.
Exception: If it is already a ScriptedObstacle, it is returned as a ScriptedObstacle object instead.

Function Call

scripted_obstacle:from()

Parameters

Entity entityThe Entity you want to cast to a ScriptedObstacle.

Obstacle:get_name()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_name = scripted_obstacle:get_name() 

Returns the name of this ScriptedObstacle.

Function Call

scripted_obstacle:get_name()

Returns

string The name of this ScriptedObstacle.

Obstacle:set_name()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_name( 'Example' ) 

Changes the name of this ScriptedObstacle.

Function Call

scripted_obstacle:set_name()

Parameters

string nameThe name you want to assign to this ScriptedObstacle.

Obstacle:get_element()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_element = scripted_obstacle:get_element() 

Returns the Element of this ScriptedObstacle.

Function Call

scripted_obstacle:get_element()

Returns

Element The Element of this ScriptedObstacle.

Obstacle:set_element()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_element( Element.None ) 

Changes the Element of this ScriptedObstacle.

Function Call

scripted_obstacle:set_element()

Parameters

Element elementThe Element you want to assign to this ScriptedObstacle.

Obstacle:get_id()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_id = scripted_obstacle:get_id() 

Returns the unique ID assigned to this ScriptedObstacle.

Function Call

scripted_obstacle:get_id()

Returns

number The unique ID assigned to this ScriptedObstacle.

Obstacle:get_health()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_health = scripted_obstacle:get_health() 

Returns the current HP of this ScriptedObstacle.

Function Call

scripted_obstacle:get_health()

Returns

number The current HP of this ScriptedObstacle.

Obstacle:set_health()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_health( 1 ) 

Sets the health of the ScriptedObstacle to a specified value.
 This cannot exceed the ScriptedObstacle's maximum health.

Function Call

scripted_obstacle:set_health()

Parameters

number healthThe (integer) value to set the ScriptedObstacle's health value to.

Obstacle:get_max_health()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_max_health = scripted_obstacle:get_max_health() 

Returns the natural maximum HP of this ScriptedObstacle, without modifiers.

Function Call

scripted_obstacle:get_max_health()

Returns

number The natural maximum HP of this ScriptedObstacle.

Obstacle:get_facing()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_facing = scripted_obstacle:get_facing() 

Returns the Direction this ScriptedObstacle is facing towards.

Function Call

scripted_obstacle:get_facing()

Returns

Direction The Direction of this ScriptedObstacle is facing towards.

Obstacle:get_facing_away()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_facing = scripted_obstacle:get_facing_away() 

Returns the Direction this ScriptedObstacle is facing away from.

Function Call

scripted_obstacle:get_facing_away()

Returns

Direction The Direction of this ScriptedObstacle is facing away from.

Obstacle:set_facing()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle:set_facing( Direction.Up ) 

Returns the Direction this ScriptedObstacle is facing towards.

Function Call

scripted_obstacle:set_facing()

Parameters

Direction facingThe Direction you want this ScriptedObstacle to face towards.

Obstacle:get_team()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_team = scripted_obstacle:get_team() 

Returns the Team this ScriptedObstacle is a member of.

Function Call

scripted_obstacle:get_team()

Returns

Team The Team of this ScriptedObstacle.

Obstacle:set_team()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_team( Team.Red ) 

Changes the Team of this ScriptedObstacle.

Function Call

scripted_obstacle:set_team()

Parameters

Team nameThe Team you want to assign this ScriptedObstacle to.

Obstacle:is_team()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local is_red = scripted_obstacle:is_team( Team.Red ) 

Returns true if this ScriptedObstacle is a member of the provided Team.
 Otherwise, returns false.

Function Call

scripted_obstacle:is_team()

Returns

Team The Team of this ScriptedObstacle.

Obstacle:set_float_shoe()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_float_shoe( true )  

If true, puts whether this ScriptedObstacle has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the ScriptedObstacle has it.
While under the effects of FloatShoe, the ScriptedObstacle does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

scripted_obstacle:set_float_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedObstacle to have the FloatShoe effect. Otherwise false.

Obstacle:set_air_shoe()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_air_shoe( true )  

If true, puts whether this ScriptedObstacle has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the ScriptedObstacle has it.
While under the effects of AirShoe, the ScriptedObstacle is able to move over Broken Tiles.

Function Call

scripted_obstacle:set_air_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedObstacle to have the AirShoe effect. Otherwise false.

Obstacle:set_height()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_height( 100 ) 

Changes the height of this ScriptedObstacle.
The height of a ScriptedObstacle determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

scripted_obstacle:set_height()

Parameters

number heightThe height of this ScriptedObstacle.

Obstacle:get_height()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_height = scripted_obstacle:get_height() 

Returns the height of this ScriptedObstacle.

Function Call

scripted_obstacle:get_height()

Returns

number The height of this ScriptedObstacle.

Obstacle:get_elevation()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_elevation = scripted_obstacle:get_elevation() 

Returns the elevation of this ScriptedObstacle.

Function Call

scripted_obstacle:get_elevation()

Returns

number The elevation of this ScriptedObstacle.

Obstacle:set_elevation()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_elevation( 100 )  

Changes how high above the battlefield this ScriptedObstacle will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

scripted_obstacle:set_elevation()

Parameters

number heightThe height of this ScriptedObstacle.

Obstacle:get_offset()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_offset = scripted_obstacle:get_offset() 

Returns the offset of this ScriptedObstacle from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_obstacle:get_offset()

Returns

Vector2 The offset of this ScriptedObstacle.
  X : horizontal offset
  Y : vertical offset.

Obstacle:set_offset()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_offset( 100, 50 ) 

The above snippet moves the ScriptedObstacle100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this ScriptedObstacle from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_obstacle:set_offset()

Parameters

number XThe horizontal offset of this ScriptedObstacle.
number YThe vertical offset of this ScriptedObstacle.

Obstacle:get_tile_offset()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local scripted_obstacle_tile_offset = scripted_obstacle:get_tile_offset() 

Returns the physical offset of this ScriptedObstacle from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

scripted_obstacle:get_tile_offset()

Returns

Vector2 The offset of this ScriptedObstacle. X : horizontal offset, Y : vertical offset.

Obstacle:get_color()

function • v2.0

Function Call

scripted_obstacle:get_color()

Returns

Color

Obstacle:set_color()

function • v2.0

local sprite_node       -- example ScriptedObstacle 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this ScriptedObstacle to pure black.

This tints the ScriptedObstacle with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

scripted_obstacle:set_color()

Parameters

Color color_tintThe color you want to tint this ScriptedObstacle with.

Obstacle:sprite()

function • v2.0

Function Call

scripted_obstacle:sprite()

Returns

SpriteNode

Obstacle:is_passthrough()

function • v2.0

Function Call

scripted_obstacle:is_passthrough()

Returns

boolean

Obstacle:is_deleted()

function • v2.0

Function Call

scripted_obstacle:is_deleted()

Returns

boolean

Obstacle:erase()

function • v2.0

Immediately removes this ScriptedObstacle from the battle.
 This does not cause the ScriptedObstacle to call its delete_func().

Function Call

scripted_obstacle:erase()

Obstacle:delete()

function • v2.0

Destroys the target ScriptedObstacle, making it explode, and removes it from the battlefield afterwards.
 This does cause the ScriptedObstacle to call its delete_func().

Function Call

scripted_obstacle:delete()

Obstacle:will_erase_eof()

function • v2.0

Function Call

scripted_obstacle:will_erase_eof()

Returns

boolean

Obstacle:get_texture()

function • v2.0

Function Call

scripted_obstacle:get_texture()

Returns

Texture

Obstacle:set_texture()

function • v2.0

Function Call

scripted_obstacle:set_texture()

Parameters

Texture textureThe texture you want to assign to the ScriptedObstacle.

Obstacle:set_animation()

function • v2.0

Makes the ScriptedObstacle play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the ScriptedObstacle will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

scripted_obstacle:set_animation()

Parameters

string animation_nameThe name of the animation you want the ScriptedObstacle to play.

Obstacle:get_animation()

function • v2.0

Returns the Animation component in charge of the ScriptedObstacle's animations.
This does not return the animation the ScriptedObstacle currently is playing.

Function Call

scripted_obstacle:get_animation()

Returns

Animation The Animation component for the ScriptedObstacle.

Obstacle:create_node()

function • v2.0

Creates a new SpriteNode, parented to the ScriptedObstacle.

Function Call

scripted_obstacle:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Obstacle:get_context()

function • v2.0

Function Call

scripted_obstacle:get_context()

Obstacle:get_current_palette()

function • v2.0

Function Call

scripted_obstacle:get_current_palette()

Returns

Texture

Obstacle:set_palette()

function • v2.0

Function Call

scripted_obstacle:set_palette()

Parameters

Texture palette

Obstacle:get_base_palette()

function • v2.0

Function Call

scripted_obstacle:get_base_palette()

Returns

Texture

Obstacle:store_base_palette()

function • v2.0

Function Call

scripted_obstacle:store_base_palette()

Parameters

Texture palette

Obstacle:input_has()

function • v2.0

Function Call

scripted_obstacle:input_has()

Parameters

InputEvent key_code

Returns

boolean

Obstacle:ignore_common_aggressor()

function • v2.0

Function Call

scripted_obstacle:ignore_common_aggressor()

Obstacle:get_field()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local current_field = scripted_obstacle:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

scripted_obstacle:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Obstacle:get_tile()

function • v2.0

local scripted_obstacle     -- example scripted_obstacle 
local facing_direction = scripted_obstacle:get_facing() 
local tile_in_front = scripted_obstacle:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the ScriptedObstacle.

Returns a handle to the Tile offset in one direction from this ScriptedObstacle.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_obstacle:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Obstacle:get_current_tile()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local tile_in_front = scripted_obstacle:get_current_tile() 

Returns a handle to the Tile this ScriptedObstacle is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_obstacle:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Obstacle:share_tile()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this ScriptedObstacle.
 (default : false)

Function Call

scripted_obstacle:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this ScriptedObstacle.

Obstacle:slide()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local target_tile   -- The tile you want to move to 
scripted_obstacle:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the ScriptedObstacle to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the ScriptedObstacle to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_obstacle:slide()

Parameters

Tile target_tileThe Tile the ScriptedObstacle will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Obstacle:jump()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local target_tile   -- The tile you want to move to 
scripted_obstacle:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedObstacle to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedObstacle to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_obstacle:jump()

Parameters

Tile target_tileThe Tile the ScriptedObstacle will be trying to move towards.
number heightThe height (in pixels) above the field the ScriptedObstacle will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Obstacle:teleport()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local target_tile   -- The tile you want to move to 
scripted_obstacle:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedObstacle to teleport to.

Attempts to queue up a movement comand for the ScriptedObstacle to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_obstacle:teleport()

Parameters

Tile target_tileThe Tile the ScriptedObstacle will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Obstacle:raw_move_event()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local move_event        -- example MoveEvent 
scripted_obstacle:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the ScriptedObstacle to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedObstacle.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_obstacle:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the ScriptedObstacle will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Obstacle:is_sliding()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local is_sliding = scripted_obstacle:is_sliding() 

Returns true if this ScriptedObstacle is currently sliding.
 Otherwise, returns false.

Function Call

scripted_obstacle:is_sliding()

Returns

boolean Whether this ScriptedObstacle is sliding or not.

Obstacle:is_jumping()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local is_jumping = scripted_obstacle:is_jumping() 

Returns true if this ScriptedObstacle is currently jumping.
 Otherwise, returns false.

Function Call

scripted_obstacle:is_jumping()

Returns

boolean Whether this ScriptedObstacle is jumping or not.

Obstacle:is_teleporting()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local is_teleporting = scripted_obstacle:is_teleporting() 

Returns true if this ScriptedObstacle is currently teleporting.
 Otherwise, returns false.

Function Call

scripted_obstacle:is_teleporting()

Returns

boolean Whether this ScriptedObstacle is teleporting or not.

Obstacle:is_moving()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local is_moving = scripted_obstacle:is_moving() 

Returns true if this ScriptedObstacle is currently moving in any fashion.
 Otherwise, returns false.

Function Call

scripted_obstacle:is_moving()

Returns

boolean Whether this ScriptedObstacle is currently moving or not.

Obstacle:hide()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:hide() 

Hides the graphics for this ScriptedObstacle and all of its child objects.

Function Call

scripted_obstacle:hide()

Obstacle:reveal()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:reveal() 

Forces the graphics for this ScriptedObstacle and all of its child objects to be drawn again.

Function Call

scripted_obstacle:reveal()

Obstacle:show_shadow()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:show_shadow( true ) 

If true, causes the shadow for this ScriptedObstacle to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

scripted_obstacle:show_shadow()

Parameters

boolean should_showWhether or not this ScriptedObstacle's shadow should be drawn or not.

Obstacle:set_shadow()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this ScriptedObstacle.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

scripted_obstacle:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this ScriptedObstacle.

Obstacle:copy_hit_props()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local hit_props = scripted_obstacle:copy_hit_props() 

Returns the HitProps associated with this ScriptedObstacle.

Function Call

scripted_obstacle:copy_hit_props()

Returns

HitProps The HitProps of this ScriptedObstacle.

Obstacle:set_hit_props()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local hit_props -- example HitProps 
scripted_obstacle:set_hit_props( hit_props ) 

Defines the basic properties used for when this ScriptedObstacle attacks other Entity objects.

Function Call

scripted_obstacle:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this ScriptedObstacle's attacks.

Obstacle:toggle_hitbox()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

scripted_obstacle:toggle_hitbox()

Parameters

boolean enabledtrue, if this ScriptedObstacle should be able to be affected by Spells.

Obstacle:toggle_counter()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:toggle_counter( true ) 

If true, forces this ScriptedObstacle to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

scripted_obstacle:toggle_counter()

Parameters

boolean counterabletrue, if this ScriptedObstacle should be able to be counter-hit. Otherwise false.

Obstacle:add_defense_rule()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local example_rule  -- example DefenseRule 
scripted_obstacle:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) ScriptedObstacle.
DefenseRules allow the ScriptedObstacle to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

scripted_obstacle:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Obstacle:remove_defense_rule()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local example_rule  -- example DefenseRule 
scripted_obstacle:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) ScriptedObstacle.

Function Call

scripted_obstacle:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Obstacle:never_flip()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:never_flip( true )  

If true, stops this ScriptedObstacle from flipping direction (graphically) based on its Team.

Function Call

scripted_obstacle:never_flip()

Parameters

boolean disable_fliptrue, if this ScriptedObstacle should not flip direction (graphically).

Obstacle:highlight_tile()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:highlight_tile( Highlight.Flash ) 

Causes this ScriptedObstacle to highlight the Tile it is currently on.

Function Call

scripted_obstacle:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Obstacle:register_component()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
local example_component -- example ScriptedComponent 
scripted_obstacle:register_component( example_component )  

Registers a Component to this ScriptedObstacle.

Function Call

scripted_obstacle:register_component()

Parameters

Component componentThe Component you want to register to this ScriptedObstacle.

Obstacle:shake_camera()

function • v2.0

local scripted_obstacle -- example scripted_obstacle 
scripted_obstacle:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

scripted_obstacle:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Obstacle:register_status_callback()

function • v2.0

local scripted_obstacle -- example 'scripted_obstacle 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
scripted_obstacle:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the ScriptedObstacle is hit by an attack with the Stun flag.

Registers a function to the ScriptedObstacle that will be called when it is hit by any attack that has a matching property.

Function Call

scripted_obstacle:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

Obstacle . battle_start_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle.

Description

local scripted_obstacle -- example scripted_obstacle

scripted_obstacle.battle_start_func = function( actor )
    print( "battle begin." )
end

This function will be called if the the ScriptedObstacle is alive at the start of battle.

Obstacle . on_spawn_func

callback • v2.0

Callback Signature

function( actor, tile )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle being spawned in.

Tile tile
The Tile it is being spawned on (currently for Character objects only).

Description

This function will be called when the ScriptedObstacle initially spawns in.
Additionally, Character objects will receive a second Tile argument.

Obstacle . battle_end_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle.

Description

local scripted_obstacle -- example scripted_obstacle

scripted_obstacle.battle_end_func = function( actor )
    print( "I LIVED!" )
end

This function that will be called if the ScriptedObstacle is alive when the battle ends.

Obstacle . can_move_to_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, target_tile )

Return Value

boolean
true if the ScriptedObstacle can move to target Tile, otherwise false.

Parameters

ScriptedObstacle actor
The ScriptedObstacle trying to move to another Tile.

Tile target_tile
The Tile that the ScriptedObstacle wants to move to.

Description

local scripted_obstacle -- example scripted_obstacle

scripted_obstacle.can_move_to_func = function( actor, next_tile )
    return next_tile:get_team() == actor:get_team()
end

This function is called whenever the ScriptedObstacle wants to move to a different Tile.
 If it returns true, the ScriptedObstacle can move to that Tile. If false, it cannot.

Obstacle . attack_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, other )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle that will be executing the CardAction.

Entity other
The Entity that was hit by this ScriptedObstacle.

Description

local scripted_obstacle -- example scripted_obstacle

scripted_obstacle.attack_func = function( actor, other )
    print( "successful hit on another actor " )
end

This function will be called when the ScriptedObstacle interacts with another Entity and registers a successful hit.
Note that this is only for direct interaction.
 i.e. If an Entity hits another with a Spell, the Spell will call its attack_func.

Obstacle . collision_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, other )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle that will be executing the CardAction.

Entity other
The Entity that collided with this ScriptedObstacle.

Description

local scripted_obstacle -- example scripted_obstacle

scripted_obstacle.collision_func = function( actor, other )
    print( "collided with another actor" )
end

This function will be called when the ScriptedObstacle collides with another Entity.

Obstacle . update_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, elapsed )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle being updated.

number elapsed
The amount of time elapsed since the last time update_func was called.

Description

local scripted_obstacle -- example scripted_obstacle

scripted_obstacle.update_func = function( actor, elapsed )
    print( "update executed." )
end

This function will be called every frame while the ScriptedObstacle is alive.
update_func does not get called during time freeze or while the card menu is open.

Obstacle . delete_func

callback • v2.0

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedObstacle actor
The ScriptedObstacle being deleted.

Description

This function will be called when the ScriptedObstacle is deleted.

ScriptedArtifact

Artifact:new()

function • v2.0

local scripted_artifact = Battle.Artifact.new() 

Creates a new ScriptedArtifact object.

Function Call

scripted_artifact:new()

Artifact:get_name()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_name = scripted_artifact:get_name() 

Returns the name of this ScriptedArtifact.

Function Call

scripted_artifact:get_name()

Returns

string The name of this ScriptedArtifact.

Artifact:set_name()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_name( 'Example' ) 

Changes the name of this ScriptedArtifact.

Function Call

scripted_artifact:set_name()

Parameters

string nameThe name you want to assign to this ScriptedArtifact.

Artifact:get_element()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_element = scripted_artifact:get_element() 

Returns the Element of this ScriptedArtifact.

Function Call

scripted_artifact:get_element()

Returns

Element The Element of this ScriptedArtifact.

Artifact:set_element()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_element( Element.None ) 

Changes the Element of this ScriptedArtifact.

Function Call

scripted_artifact:set_element()

Parameters

Element elementThe Element you want to assign to this ScriptedArtifact.

Artifact:get_id()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_id = scripted_artifact:get_id() 

Returns the unique ID assigned to this ScriptedArtifact.

Function Call

scripted_artifact:get_id()

Returns

number The unique ID assigned to this ScriptedArtifact.

Artifact:get_health()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_health = scripted_artifact:get_health() 

Returns the current HP of this ScriptedArtifact.

Function Call

scripted_artifact:get_health()

Returns

number The current HP of this ScriptedArtifact.

Artifact:set_health()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_health( 1 ) 

Sets the health of the ScriptedArtifact to a specified value.
 This cannot exceed the ScriptedArtifact's maximum health.

Function Call

scripted_artifact:set_health()

Parameters

number healthThe (integer) value to set the ScriptedArtifact's health value to.

Artifact:get_max_health()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_max_health = scripted_artifact:get_max_health() 

Returns the natural maximum HP of this ScriptedArtifact, without modifiers.

Function Call

scripted_artifact:get_max_health()

Returns

number The natural maximum HP of this ScriptedArtifact.

Artifact:get_facing()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_facing = scripted_artifact:get_facing() 

Returns the Direction this ScriptedArtifact is facing towards.

Function Call

scripted_artifact:get_facing()

Returns

Direction The Direction of this ScriptedArtifact is facing towards.

Artifact:get_facing_away()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_facing = scripted_artifact:get_facing_away() 

Returns the Direction this ScriptedArtifact is facing away from.

Function Call

scripted_artifact:get_facing_away()

Returns

Direction The Direction of this ScriptedArtifact is facing away from.

Artifact:set_facing()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact:set_facing( Direction.Up ) 

Returns the Direction this ScriptedArtifact is facing towards.

Function Call

scripted_artifact:set_facing()

Parameters

Direction facingThe Direction you want this ScriptedArtifact to face towards.

Artifact:get_team()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_team = scripted_artifact:get_team() 

Returns the Team this ScriptedArtifact is a member of.

Function Call

scripted_artifact:get_team()

Returns

Team The Team of this ScriptedArtifact.

Artifact:set_team()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_team( Team.Red ) 

Changes the Team of this ScriptedArtifact.

Function Call

scripted_artifact:set_team()

Parameters

Team nameThe Team you want to assign this ScriptedArtifact to.

Artifact:is_team()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local is_red = scripted_artifact:is_team( Team.Red ) 

Returns true if this ScriptedArtifact is a member of the provided Team.
 Otherwise, returns false.

Function Call

scripted_artifact:is_team()

Returns

Team The Team of this ScriptedArtifact.

Artifact:set_float_shoe()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_float_shoe( true )  

If true, puts whether this ScriptedArtifact has the effects of FloatShoe.
Otherwise, removes the effect of FloatShoe if the ScriptedArtifact has it.
While under the effects of FloatShoe, the ScriptedArtifact does not get affected by negative Tile affects.
They also do not break Cracked Tiles.

Function Call

scripted_artifact:set_float_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedArtifact to have the FloatShoe effect. Otherwise false.

Artifact:set_air_shoe()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_air_shoe( true )  

If true, puts whether this ScriptedArtifact has the effects of AirShoe.
Otherwise, removes the effect of AirShoe if the ScriptedArtifact has it.
While under the effects of AirShoe, the ScriptedArtifact is able to move over Broken Tiles.

Function Call

scripted_artifact:set_air_shoe()

Parameters

boolean has_effecttrue if you want this ScriptedArtifact to have the AirShoe effect. Otherwise false.

Artifact:set_height()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_height( 100 ) 

Changes the height of this ScriptedArtifact.
The height of a ScriptedArtifact determines where various objects will show up.
e.g. Impact graphical effects, any Cards held in hand, etc.

Function Call

scripted_artifact:set_height()

Parameters

number heightThe height of this ScriptedArtifact.

Artifact:get_height()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_height = scripted_artifact:get_height() 

Returns the height of this ScriptedArtifact.

Function Call

scripted_artifact:get_height()

Returns

number The height of this ScriptedArtifact.

Artifact:get_elevation()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_elevation = scripted_artifact:get_elevation() 

Returns the elevation of this ScriptedArtifact.

Function Call

scripted_artifact:get_elevation()

Returns

number The elevation of this ScriptedArtifact.

Artifact:set_elevation()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_elevation( 100 )  

Changes how high above the battlefield this ScriptedArtifact will be drawn.
Positive values move it upwards, negative values move it downasidewards

Function Call

scripted_artifact:set_elevation()

Parameters

number heightThe height of this ScriptedArtifact.

Artifact:get_offset()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_offset = scripted_artifact:get_offset() 

Returns the offset of this ScriptedArtifact from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_artifact:get_offset()

Returns

Vector2 The offset of this ScriptedArtifact.
  X : horizontal offset
  Y : vertical offset.

Artifact:set_offset()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_offset( 100, 50 ) 

The above snippet moves the ScriptedArtifact100 pixels to the right, and 50 pixels down, from the center of the Tile.

Changes the offset of this ScriptedArtifact from the center of the Tile they're standing on.
Positive X values move it to the right, negative X values move it to the left.
Positive Y values move it downwards, negative Y values move it upwards.

Function Call

scripted_artifact:set_offset()

Parameters

number XThe horizontal offset of this ScriptedArtifact.
number YThe vertical offset of this ScriptedArtifact.

Artifact:get_tile_offset()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local scripted_artifact_tile_offset = scripted_artifact:get_tile_offset() 

Returns the physical offset of this ScriptedArtifact from the center of the Tile they're standing on.
Positive X values mean it has been moved to the right, negative X values mean it has been moved to the left.
Positive Y values mean it has been moved downwards, negative Y values mean it has been moved upwards.

Function Call

scripted_artifact:get_tile_offset()

Returns

Vector2 The offset of this ScriptedArtifact. X : horizontal offset, Y : vertical offset.

Artifact:get_color()

function • v2.0

Function Call

scripted_artifact:get_color()

Returns

Color

Artifact:set_color()

function • v2.0

local sprite_node       -- example ScriptedArtifact 
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this ScriptedArtifact to pure black.

This tints the ScriptedArtifact with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

scripted_artifact:set_color()

Parameters

Color color_tintThe color you want to tint this ScriptedArtifact with.

Artifact:sprite()

function • v2.0

Function Call

scripted_artifact:sprite()

Returns

SpriteNode

Artifact:is_passthrough()

function • v2.0

Function Call

scripted_artifact:is_passthrough()

Returns

boolean

Artifact:is_deleted()

function • v2.0

Function Call

scripted_artifact:is_deleted()

Returns

boolean

Artifact:erase()

function • v2.0

Immediately removes this ScriptedArtifact from the battle.
 This does not cause the ScriptedArtifact to call its delete_func().

Function Call

scripted_artifact:erase()

Artifact:delete()

function • v2.0

Destroys the target ScriptedArtifact, making it explode, and removes it from the battlefield afterwards.
 This does cause the ScriptedArtifact to call its delete_func().

Function Call

scripted_artifact:delete()

Artifact:will_erase_eof()

function • v2.0

Function Call

scripted_artifact:will_erase_eof()

Returns

boolean

Artifact:get_texture()

function • v2.0

Function Call

scripted_artifact:get_texture()

Returns

Texture

Artifact:set_texture()

function • v2.0

Function Call

scripted_artifact:set_texture()

Parameters

Texture textureThe texture you want to assign to the ScriptedArtifact.

Artifact:set_animation()

function • v2.0

Makes the ScriptedArtifact play an animation from its associated animation file.
 If there is no animation in the file with an exactly-matching name exists, the ScriptedArtifact will be stuck in an undefined state until it is forced into another state from an external source (e.g. getting hit).

Function Call

scripted_artifact:set_animation()

Parameters

string animation_nameThe name of the animation you want the ScriptedArtifact to play.

Artifact:get_animation()

function • v2.0

Returns the Animation component in charge of the ScriptedArtifact's animations.
This does not return the animation the ScriptedArtifact currently is playing.

Function Call

scripted_artifact:get_animation()

Returns

Animation The Animation component for the ScriptedArtifact.

Artifact:create_node()

function • v2.0

Creates a new SpriteNode, parented to the ScriptedArtifact.

Function Call

scripted_artifact:create_node()

Returns

SpriteNode The newly-created SpriteNode.

Artifact:get_context()

function • v2.0

Function Call

scripted_artifact:get_context()

Artifact:get_current_palette()

function • v2.0

Function Call

scripted_artifact:get_current_palette()

Returns

Texture

Artifact:set_palette()

function • v2.0

Function Call

scripted_artifact:set_palette()

Parameters

Texture palette

Artifact:get_base_palette()

function • v2.0

Function Call

scripted_artifact:get_base_palette()

Returns

Texture

Artifact:store_base_palette()

function • v2.0

Function Call

scripted_artifact:store_base_palette()

Parameters

Texture palette

Artifact:input_has()

function • v2.0

Function Call

scripted_artifact:input_has()

Parameters

InputEvent key_code

Returns

boolean

Artifact:ignore_common_aggressor()

function • v2.0

Function Call

scripted_artifact:ignore_common_aggressor()

Artifact:get_field()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local current_field = scripted_artifact:get_field() 

Returns a handle to the Field the battle is taking place on.

Function Call

scripted_artifact:get_field()

Returns

Field The handle to the Field the battle is taking place on.

Artifact:get_tile()

function • v2.0

local scripted_artifact     -- example scripted_artifact 
local facing_direction = scripted_artifact:get_facing() 
local tile_in_front = scripted_artifact:get_tile( facing_direction, 1 ) 

The above snippet returns a handle to the Tile directly in front of the ScriptedArtifact.

Returns a handle to the Tile offset in one direction from this ScriptedArtifact.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_artifact:get_tile()

Parameters

Direction directionThe Direction you want to get select from.
number offsetThe number of spaces in that direction you want to select a Tile at.

Returns

Tile A handle to the Tile, or nil.

Artifact:get_current_tile()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local tile_in_front = scripted_artifact:get_current_tile() 

Returns a handle to the Tile this ScriptedArtifact is currently standing on.
If this offset goes out of the bounds of the battlefield, or is to an otherwise invalid Tile, it returns nil instead.

Function Call

scripted_artifact:get_current_tile()

Returns

Tile A handle to the Tile, or nil.

Artifact:share_tile()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:share_tile( true )  

If true, allows other objects to inhabit the same Tile as this ScriptedArtifact.
 (default : false)

Function Call

scripted_artifact:share_tile()

Parameters

boolean sharetrue, if other objects should be allowed to inhabit the same tile as this ScriptedArtifact.

Artifact:slide()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local target_tile   -- The tile you want to move to 
scripted_artifact:slide( target_tile, frames(60), frames(20), ActionOrder.Voluntary, nil )  

The above snippet causes the ScriptedArtifact to slide to a tile over 60 frames, and wait for 20 frames before being able to act again.

Attempts to queue up a movement comand for the ScriptedArtifact to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_artifact:slide()

Parameters

Tile target_tileThe Tile the ScriptedArtifact will be trying to move towards.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Artifact:jump()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local target_tile   -- The tile you want to move to 
scripted_artifact:jump( target_tile, 50, frames(60), frames(20), ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedArtifact to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedArtifact to slide to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_artifact:jump()

Parameters

Tile target_tileThe Tile the ScriptedArtifact will be trying to move towards.
number heightThe height (in pixels) above the field the ScriptedArtifact will reach at the apex of their jump.
frame_time movement_timeHow long (in frames) the movement action will take.
frame_time end_lagHow long (in frames) the recovery period after the movement will last.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Artifact:teleport()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local target_tile   -- The tile you want to move to 
scripted_artifact:tile( target_tile, ActionOrder.Voluntary, nil ) 

The above snippet causes the ScriptedArtifact to teleport to.

Attempts to queue up a movement comand for the ScriptedArtifact to teleport to a specified tile.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_artifact:teleport()

Parameters

Tile target_tileThe Tile the ScriptedArtifact will be trying to move towards.
ActionOrder action_orderThe priority this action will have vs other movement actions.
function on_beginA function to trigger if/when the movement action starts.

Artifact:raw_move_event()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local move_event        -- example MoveEvent 
scripted_artifact:raw_move_event( target_tile, move_event, ActionOrder.Voluntary ) 

The above snippet causes the ScriptedArtifact to jump to a tile over 60 frames, and wait for 20 frames before being able to act again. They will reach a height of 50px at the apex of their jump.

Attempts to queue up a movement comand for the ScriptedArtifact.
 Returns true if the movement was possible at the time it was called, otherwise returns false.

Function Call

scripted_artifact:raw_move_event()

Parameters

MoveEvent move_eventThe MoveEvent describing how the ScriptedArtifact will be trying to move.
ActionOrder action_orderThe priority this action will have vs other movement actions.

Returns

boolean true if the movement was possible when the function was called, otherwise false.

Artifact:is_sliding()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local is_sliding = scripted_artifact:is_sliding() 

Returns true if this ScriptedArtifact is currently sliding.
 Otherwise, returns false.

Function Call

scripted_artifact:is_sliding()

Returns

boolean Whether this ScriptedArtifact is sliding or not.

Artifact:is_jumping()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local is_jumping = scripted_artifact:is_jumping() 

Returns true if this ScriptedArtifact is currently jumping.
 Otherwise, returns false.

Function Call

scripted_artifact:is_jumping()

Returns

boolean Whether this ScriptedArtifact is jumping or not.

Artifact:is_teleporting()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local is_teleporting = scripted_artifact:is_teleporting() 

Returns true if this ScriptedArtifact is currently teleporting.
 Otherwise, returns false.

Function Call

scripted_artifact:is_teleporting()

Returns

boolean Whether this ScriptedArtifact is teleporting or not.

Artifact:is_moving()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local is_moving = scripted_artifact:is_moving() 

Returns true if this ScriptedArtifact is currently moving in any fashion.
 Otherwise, returns false.

Function Call

scripted_artifact:is_moving()

Returns

boolean Whether this ScriptedArtifact is currently moving or not.

Artifact:hide()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:hide() 

Hides the graphics for this ScriptedArtifact and all of its child objects.

Function Call

scripted_artifact:hide()

Artifact:reveal()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:reveal() 

Forces the graphics for this ScriptedArtifact and all of its child objects to be drawn again.

Function Call

scripted_artifact:reveal()

Artifact:show_shadow()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:show_shadow( true ) 

If true, causes the shadow for this ScriptedArtifact to be drawn.
 Otherwise, causes the shadow to not be drawn.

Function Call

scripted_artifact:show_shadow()

Parameters

boolean should_showWhether or not this ScriptedArtifact's shadow should be drawn or not.

Artifact:set_shadow()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:set_shadow( Shadow.Small )  

Defines the shadow that will be drawn for this ScriptedArtifact.
This function can take either an enum ShadowType value for pre-defined shadows,
 or it can take a previously-loaded Texture for a custom shadow.

Function Call

scripted_artifact:set_shadow()

Parameters

ShadowType or Texture shadowThe shadow you want to be drawn under this ScriptedArtifact.

Artifact:copy_hit_props()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local hit_props = scripted_artifact:copy_hit_props() 

Returns the HitProps associated with this ScriptedArtifact.

Function Call

scripted_artifact:copy_hit_props()

Returns

HitProps The HitProps of this ScriptedArtifact.

Artifact:set_hit_props()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local hit_props -- example HitProps 
scripted_artifact:set_hit_props( hit_props ) 

Defines the basic properties used for when this ScriptedArtifact attacks other Entity objects.

Function Call

scripted_artifact:set_hit_props()

Parameters

HitProps hit_propsThe basic properties used for this ScriptedArtifact's attacks.

Artifact:toggle_hitbox()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:toggle_hitbox( true )  

If true, allows this Tile to be hit by Spells.
 Otherwise, it cannot be affected by any Spells.
 (default : true)

Function Call

scripted_artifact:toggle_hitbox()

Parameters

boolean enabledtrue, if this ScriptedArtifact should be able to be affected by Spells.

Artifact:toggle_counter()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:toggle_counter( true ) 

If true, forces this ScriptedArtifact to enter a "counter-able" state.
 Otherwise, forces it to leave the "counter-able" state.
TODO : Nail down exactly what happens when hit by counters.

Function Call

scripted_artifact:toggle_counter()

Parameters

boolean counterabletrue, if this ScriptedArtifact should be able to be counter-hit. Otherwise false.

Artifact:add_defense_rule()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local example_rule  -- example DefenseRule 
scripted_artifact:add_defense_rule( example_rule ) 

Adds a DefenseRule to a(n) ScriptedArtifact.
DefenseRules allow the ScriptedArtifact to change/ignore certain properties of attacks that affect them.
TODO : Get an actually good explanation of what they do.

Function Call

scripted_artifact:add_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Artifact:remove_defense_rule()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local example_rule  -- example DefenseRule 
scripted_artifact:remove_defense_rule( example_rule )  

Removes a DefenseRule from a(n) ScriptedArtifact.

Function Call

scripted_artifact:remove_defense_rule()

Parameters

DefenseRule defense_ruleTODO

Artifact:never_flip()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:never_flip( true )  

If true, stops this ScriptedArtifact from flipping direction (graphically) based on its Team.

Function Call

scripted_artifact:never_flip()

Parameters

boolean disable_fliptrue, if this ScriptedArtifact should not flip direction (graphically).

Artifact:highlight_tile()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:highlight_tile( Highlight.Flash ) 

Causes this ScriptedArtifact to highlight the Tile it is currently on.

Function Call

scripted_artifact:highlight_tile()

Parameters

Highlight highlight_typeThe Highlight describing how you want the Tile to be highlighted.

Artifact:register_component()

function • v2.0

local scripted_artifact -- example scripted_artifact 
local example_component -- example ScriptedComponent 
scripted_artifact:register_component( example_component )  

Registers a Component to this ScriptedArtifact.

Function Call

scripted_artifact:register_component()

Parameters

Component componentThe Component you want to register to this ScriptedArtifact.

Artifact:shake_camera()

function • v2.0

local scripted_artifact -- example scripted_artifact 
scripted_artifact:shake_camera( power, duration ) 

Causes the camera to shake.

Function Call

scripted_artifact:shake_camera()

Parameters

number powerThe severity of the shakes.
number durationThe length of time (in seconds) the shaking will persist for.

Artifact:register_status_callback()

function • v2.0

local scripted_artifact -- example 'scripted_artifact 
local example_callback = function() print( "status triggered" ) end  -- example callback function 
scripted_artifact:register_status_callback( Hit.Stun, example_callback ) 

The above snippet registers a callback to be called when the ScriptedArtifact is hit by an attack with the Stun flag.

Registers a function to the ScriptedArtifact that will be called when it is hit by any attack that has a matching property.

Function Call

scripted_artifact:register_status_callback()

Parameters

HitProps status_flagThe HitProps you want to trigger the function on.
function callback_functionThe function you want to trigger.

Artifact . battle_start_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedArtifact actor
The ScriptedArtifact.

Description

local scripted_artifact -- example scripted_artifact

scripted_artifact.battle_start_func = function( actor )
    print( "battle begin." )
end

This function will be called if the the ScriptedArtifact is alive at the start of battle.

Artifact . on_spawn_func

callback • v2.0

Callback Signature

function( actor, tile )

Return Value

nil

Parameters

ScriptedArtifact actor
The ScriptedArtifact being spawned in.

Tile tile
The Tile it is being spawned on (currently for Character objects only).

Description

This function will be called when the ScriptedArtifact initially spawns in.
Additionally, Character objects will receive a second Tile argument.

Artifact . battle_end_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedArtifact actor
The ScriptedArtifact.

Description

local scripted_artifact -- example scripted_artifact

scripted_artifact.battle_end_func = function( actor )
    print( "I LIVED!" )
end

This function that will be called if the ScriptedArtifact is alive when the battle ends.

Artifact . can_move_to_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, target_tile )

Return Value

boolean
true if the ScriptedArtifact can move to target Tile, otherwise false.

Parameters

ScriptedArtifact actor
The ScriptedArtifact trying to move to another Tile.

Tile target_tile
The Tile that the ScriptedArtifact wants to move to.

Description

local scripted_artifact -- example scripted_artifact

scripted_artifact.can_move_to_func = function( actor, next_tile )
    return next_tile:get_team() == actor:get_team()
end

This function is called whenever the ScriptedArtifact wants to move to a different Tile.
 If it returns true, the ScriptedArtifact can move to that Tile. If false, it cannot.

Artifact . update_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( actor, elapsed )

Return Value

nil

Parameters

ScriptedArtifact actor
The ScriptedArtifact being updated.

number elapsed
The amount of time elapsed since the last time update_func was called.

Description

local scripted_artifact -- example scripted_artifact

scripted_artifact.update_func = function( actor, elapsed )
    print( "update executed." )
end

This function will be called every frame while the ScriptedArtifact is alive.
update_func does not get called during time freeze or while the card menu is open.

Artifact . delete_func

callback • v2.0

Callback Signature

function( actor )

Return Value

nil

Parameters

ScriptedArtifact actor
The ScriptedArtifact being deleted.

Description

This function will be called when the ScriptedArtifact is deleted.

SpriteNode

SpriteNode:get_texture()

function • v2.0

local sprite_node       -- example  
local texture = sprite_node:get_texture() 

Returns a handle to the Texture assigned to this .

Function Call

sprite_node:get_texture()

Returns

Texture The handle to the Texture for this .

SpriteNode:set_texture()

function • v2.0

local sprite_node       -- example  
local example_texture       -- example Texture 

sprite_node:set_texture( example_texture ) 
print( width ) 

Assigns a new Texture to the .

Function Call

sprite_node:set_texture()

Parameters

Texture textureThe new texture for the

SpriteNode:show()

function • v2.0

local sprite_node       -- example  

sprite_node:show() 

Forces this and all its children to be rendered.

Function Call

sprite_node:show()

SpriteNode:hide()

function • v2.0

local sprite_node       -- example  

sprite_node:hide() 

Forces this and all its children to not be rendered.

Function Call

sprite_node:hide()

SpriteNode:set_layer()

function • v2.0

local sprite_node       -- example  

sprite_node:set_layer( 1 ) 

Sets the (integer) layer number setting the order the is drawn in relative to parent/all objects? on the tile.
The layers are ordered in ascending/descending? order (default 0).
TODO: Test how layer sorting works.

Function Call

sprite_node:set_layer()

Parameters

number layer

SpriteNode:get_layer()

function • v2.0

local sprite_node       -- example  

local layer_num = sprite_node:get_layer() 
print( layer_num ) 

The above snippet prints the layer number the is on.

Returns the (integer) layer number that this is on.
Layers are sorted in ascending/descending? order.
TODO: Test how layers are sorted.

Function Call

sprite_node:get_layer()

SpriteNode:create_node()

function • v2.0

local sprite_node       -- example  

local child_node = sprite_node:create_node() 

Creates a new , as a child of this .

Function Call

sprite_node:create_node()

SpriteNode:remove_node()

function • v2.0

local sprite_node       -- example  
local child_node        -- child  

sprite_node:remove_node( child_node ) 

The above snippet removes child_node from the list of sprite_node's child nodes.

Removes a specific node from the list of child nodes.
 If the provided node is not a child node of this , nothing happens.

Function Call

sprite_node:remove_node()

Parameters

node_to_removeThe to remove.

SpriteNode:add_tags()

function • v2.0

local sprite_node       -- example  

sprite_node:add_tags( "arm" ) 

The above snippet adds the arm tag to the , if it's not already present.

Adds one or more string tags to a .
 This allows it to interact with the has_tag() and find_child_nodes_with_tags() functions.

Function Call

sprite_node:add_tags()

Parameters

list< string > tag_listA list of tags you want to apply to this .

SpriteNode:remove_tags()

function • v2.0

local sprite_node       -- example  

sprite_node:remove_tags( "arm" ) 

The above snippet removes the "arm" tag from the tag list, if it's present.

Removes the provided tags from the 's tag list, (if present).

Function Call

sprite_node:remove_tags()

Parameters

list< string > tags_to_removeThe list of tags to remove from the tag list (if present).

SpriteNode:has_tag()

function • v2.0

local sprite_node       -- example  

return sprite_node:has_tag( "arm" ) 

The above snippet returns true if the has the "arm" tag, otherwise returns false.

Returns true if this has the provided tag in its tag list.
 Otherwise, returns false.

Function Call

sprite_node:has_tag()

Parameters

list< string > tags_to_findThe tag to search this 's tag list for.

Returns

boolean true if the requested tag is in the tag list, otherwise false

SpriteNode:find_child_nodes_with_tags()

function • v2.0

local sprite_node       -- example  

local list_of_nodes = sprite_node:find_child_nodes_with_tags( "arm", "leg" ) 

The above snippet returns a list of all the children of sprite_node that have either the tag arm or leg.

Returns a list of all the child nodes attached to this that have any of the provided tags.

Function Call

sprite_node:find_child_nodes_with_tags()

Parameters

list< string > tag_listThe list of tags to search for.

Returns

list< > The list of all child nodes that have any of the provided tags.

SpriteNode:add_tags()

function • v2.0

local sprite_node       -- example  

local offset = sprite_node:get_offset() 
print( "offset is", offset.X, offset.Y ) 

The above snippet prints out the coordinates for the 's offset.

Returns the offset for the (default [0, 0]).

Function Call

sprite_node:add_tags()

Returns

Vector2 The offset for this .
  X : horizontal offset
  Y : vertical offset.

SpriteNode:set_offset()

function • v2.0

local sprite_node       -- example  

sprite_node:set_offset( 50, 100 ) 

The above snippet offsets the by 50 pixels horizontally and 100 pixels vertically from its original position.

Assigns a new offset for the (default [0, 0]).
 This does not move it relative to its current position, it resets it to its original position, then moves it relative to that.

Function Call

sprite_node:set_offset()

Parameters

number xThe new horizontal offset.
number yThe new vertical offset.

SpriteNode:get_origin()

function • v2.0

local sprite_node       -- example  

local origin = sprite_node:get_origin() 
print( "origin is", origin.X, origin.Y ) 

The above snippet prints out the coordinates for the 's origin.

Returns the origin for the (default [0, 0]).
This is relative to the top-left of the .

Function Call

sprite_node:get_origin()

Returns

Vector2 The origin of this .
  X : horizontal offset
  Y : vertical offset.

SpriteNode:set_origin()

function • v2.0

local sprite_node       -- example  

sprite_node:set_origin( 50, 100 ) 

The above snippet sets the origin of the to 50 pixels to the left, and 100 pixels down.

Assigns a new origin for the (default [0, 0]).
 TODO: Needs testing on what happens with different origins.

Function Call

sprite_node:set_origin()

Parameters

number xThe horizontal offset of the new origin.
number yThe vertical offset of the new origin.

SpriteNode:get_width()

function • v2.0

local sprite_node       -- example  

local width = sprite_node:get_width() 
print( width ) 

The above snippet prints the width of the , in pixels.

Returns the width of the , in pixels.

Function Call

sprite_node:get_width()

Returns

number The width of the , in pixels.

SpriteNode:set_width()

function • v2.0

local sprite_node       -- example  

sprite_node:set_width( 50 ) 

The above snippet will make the become 50 pixels wide.

Scales the horizontally so it matches the desired width.

Function Call

sprite_node:set_width()

Parameters

number widthThe new width (in pixels) for the

SpriteNode:get_height()

function • v2.0

local sprite_node       -- example  

local height = sprite_node:get_height() 
print( height ) 

The above snippet prints the height of the , in pixels.

Returns the height of the , in pixels.

Function Call

sprite_node:get_height()

Returns

number The height of the , in pixels.

SpriteNode:set_height()

function • v2.0

local sprite_node       -- example  

sprite_node:set_height( 50 ) 

The above snippet will make the become 50 pixels tall.

Scales the vertically so it matches the desired height.

Function Call

sprite_node:set_height()

Parameters

number heightThe new height for the .

SpriteNode:get_color()

function • v2.0

local sprite_node       -- example  

local tint_color = sprite_node:get_color() 
print( "R:", tint_color.r ) 
print( "G:", tint_color.g ) 
print( "B:", tint_color.b ) 
print( "A:", tint_color.a ) 

The above snippet prints the values of the different components of the tint affecting the .

Returns the color of the tint currently applied to the .

Function Call

sprite_node:get_color()

Returns

Color The color of the tint currently affecting the .

SpriteNode:set_color()

function • v2.0

local sprite_node       -- example  
local full_dark = Color.new( 0, 0, 0, 255 ) 

sprite_node:set_color( full_dark ) 

The above snippet sets the tint for this to pure black.

This tints the with a specific color (default (255, 255, 255, 255)).
 How this affects the actual color of the object depends on its ColorMode.

Function Call

sprite_node:set_color()

Parameters

Color color_tintThe color you want to tint this with.

SpriteNode:get_color_mode()

function • v2.0

local sprite_node       -- example  

local color_mode = sprite_node:get_color_mode() 
print( "Additive", color_mode == ColorMode.Additive ) 
print( "Multiply", color_mode == ColorMode.Multiply ) 

The above snippet prints a list of ColorModes, and whether or not it matches the 's ColorMode.

Returns the ColorMode of this .

Function Call

sprite_node:get_color_mode()

Returns

ColorMode The ColorMode describing how tinting this affects its color.

SpriteNode:set_color_mode()

function • v2.0

local sprite_node       -- example  

sprite_node:set_color_mode( ColorMode.Additive ) 

The above snippet sets the 's ColorMode to Additive, causing any tint to make it become lighter.

Sets the 's ColorMode to a specified mode (default Multiply).

Function Call

sprite_node:set_color_mode()

SpriteNode:unwrap()

function • v2.0

local sprite_node       -- example  

return sprite_node:unwrap() 

Returns a handle to this .

Function Call

sprite_node:unwrap()

SpriteNode:enable_parent_shader()

function • v2.0

local sprite_node       -- example  

sprite_node:enable_parent_shader( false ) 

The above snippet forces the to use its own shader when rendering.

This forces this to use its parent's shader during rendering.

Function Call

sprite_node:enable_parent_shader()

Parameters

boolean use_parent_shadertrue if you want this to use its parent's shader instead of its own, otherwise false.

ScriptedComponent

ScriptedComponent:eject()

function • v2.0

Function Call

component:eject()

ScriptedComponent:get_id()

function • v2.0

Function Call

component:get_id()

Returns

number The unique ID of this Component.

ScriptedComponent:is_injected()

function • v2.0

Function Call

component:is_injected()

Returns

boolean Whether or not this Component is attached to something.

ScriptedComponent:get_owner()

function • v2.0

Function Call

component:get_owner()

Returns

Entity The Entity this Component is attached to (if any).

ScriptedComponent . update_func

callback • v2.0

Callback Signature

function( component, elapsed_time )

Parameters

Component component

number elapsed_time
The amount of time (in seconds) elapsed since the last update().

Description

ScriptedComponent . scene_inject_func

callback • v2.0

Callback Signature

function( component )

Parameters

Component component

Description

Lifetimes

NAME MEANING
Local This Component's update() loop happens following the associated Entity's update().
Battlestep This Component's update() loop happens every battle scene update().
Scene This Component's update() loop happens every application update().

CardAction Objects

CardAction

CardAction:from_card()

function • v2.0

Function Call

card_action:from_card()

CardAction:set_lockout()

function • v2.0

Function Call

card_action:set_lockout()

Parameters

LockoutProps lockout_properties

CardAction:set_lockout_group()

function • v2.0

Function Call

card_action:set_lockout_group()

Parameters

LockoutGroup lockout_group

CardAction:override_animation_frames()

function • v2.0

Function Call

card_action:override_animation_frames()

Parameters

list framedata

CardAction:add_attachment()

function • v2.0

Function Call

card_action:add_attachment()

Parameters

string attachment_point

Returns

CardActionAttachment

CardAction:add_anim_action()

function • v2.0

Function Call

card_action:add_anim_action()

Parameters

number frame_indexThe index in the animation data to trigger action_func on.
function action_funcThe function to execute when you reach the specified index in the animation.

function()
        -- code goes here
end

CardAction:add_step()

function • v2.0

Adds another CardActionStep in the sequence that this CardAction will play.
The individual CardActionSteps are executed in the order they were added.

Function Call

card_action:add_step()

Parameters

CardActionStep next_step

CardAction:end_action()

function • v2.0

Ends the execution of the current CardAction sequence.

Function Call

card_action:end_action()

CardAction:get_actor()

function • v2.0

Function Call

card_action:get_actor()

Returns

Character The Character (or 'stunt double') that's executing the current CardAction.

CardAction:set_metadata()

function • v2.0

Function Call

card_action:set_metadata()

Parameters

CardProps card_properties

CardAction:copy_metadata()

function • v2.0

Function Call

card_action:copy_metadata()

Returns

CardProps

CardActionAttachment

Attachment:add_attachment()

function • v2.0

Creates another CardActionAttachment and adds it to this as a child node.

Function Call

attachment:add_attachment()

Parameters

string attachment_point

Returns

CardActionAttachment The newly-created CardActionAttachment.

Attachment:sprite()

function • v2.0

Function Call

attachment:sprite()

Returns

SpriteNode The SpriteNode associated with this CardActionAttachment.

Attachment:get_animation()

function • v2.0

Function Call

attachment:get_animation()

Returns

Animation The Animation object associated with this CardActionAttachment.

CardActionStep

Step:complete_step()

function • v2.0

Ends the execution of this CardActionStep and moves onto the next (if any).

Function Call

step:complete_step()

Step . update_func

callback • v2.0

Callback Signature

function( elapsed_time )

Parameters

number elapsed_time
The amount of time elapsed (in seconds) since the last update() step.

Description

Step . draw_func

callback • v2.0

Callback Signature

function( back_buffer )

Parameters

Texture back_buffer

Description

Lockout

Each CardAction is assigned to one Lockout group (and only one).
This allows scripts to control what actions are available to a player.

NAME MEANING
Weapons
Cards
Abilities

Locktype

NAME MEANING
Animation You cannot use actions with this LockoutGroup group again until the animation completes.
Async You cannot use actions with this LockoutGroup group again for a period of time after the animation completes.
Sequence This action has several Steps that happen in sequence, no action will be possible until the full sequence completes or is interrupted.

Defense Rules

Every Character has an list of DefenseRules attached, ordered by priority (starting at 0, and increasing).

When a ScriptedSpell attempts to affect a Character, it checks each DefenseRule attached to that Character in order.
Each attached DefenseRule will then try to modify the effects of the ScriptedSpell.
 (You can block the damage from the ScriptedSpell, remove status flags, or even add them.)

DefenseRule

DefenseRule:is_replaced()

function • v2.0

A DefenseRule being added to a Character will replace any existing DefenseRule that has an equal priority level.
This function lets you know if it has been replaced by another.

Function Call

defense_rule:is_replaced()

Returns

boolean true if this DefenseRule has been replaced, otherwise false.

DefenseRule . filter_statuses_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( hit_props )

Return Value

HitProps
The HitProps after being changed by the DefenseRule.

Parameters

HitProps hit_props
The properties of the incoming attack.

Description

local cannot_drag_rule      -- Example DefenseRule

cannot_drag_rule.filter_statuses_func = function( hit_props )
    hit_props.flags = hit_props.flags & (~Hit.Drag)

    if( hit_props.element == Element.Fire )
        hit_props.damage = hit_props.damage * 2
    end

    return hit_props
end

The above snippet shows code for a DefenseRule that stops an Entity from being affected by Drag effects, but doubles damage from Fire attacks.

This function is called when something successfully affects an Entity.
 You can alter the properties for attacks affecting this Entity.

You do not have to define this function if this DefenseRule won't alter incoming attacks.

DefenseRule . can_block_func

callback • v2.0

This data for this function is up-to-date, but may be missing some information on uses/restrictions.

Callback Signature

function( defense_judge, attacker, target )

Parameters

DefenseFrameStateJudge defense_judge
The DefenseFrameStateJudge processing the current hit on the target Entity
Entity attacker
The Entity attempting to affect another.

Entity target
The target Entity that's being affected.

Description

local invisibility_rule     -- Example DefenseRule

invisibility_rule.can_block_func = function( defense_judge, attacker, target ) attack_props = attacker:copy_hit_props() if( attack_props.flags & Hit.Pierce ~= Hit.Pierce ) defense_judge:block_damage() defense_judge:block_impact() end end

The above snippet shows code for a DefenseRule that will block all effects from anything that doesn't have the Hit.Pierce flag.

This function is called when something attempts to affect an Entity.
  e.g. a ScriptedSpell hitting a target, contact damage when running into an enemy Entity, etc.

If this DefenseRule blocks damage, it will stop the attacker from damaging the target Entity.
If this DefenseRule blocks impact, it will stop the attacker from making physical contact with the target Entity.

DefenseOrder

NAME MEANING
Always
CollisionOnly

DefenseFrameStateJudge

DefenseFrameStateJudge:block_damage()

function • v2.0

If this function is called, then the attack will not damage a target Entity.
 Lower-priority DefenseRules can also attempt to block damage, but cannot force a move to do damage after it's blocked.

Function Call

defense_frame_state_judge:block_damage()

DefenseFrameStateJudge:block_impact()

function • v2.0

If this function is called, then the attack will not make contact with a target Entity.
 Lower-priority DefenseRules can also attempt to block contact, but cannot force a move to make contact after it's blocked.

Function Call

defense_frame_state_judge:block_impact()

DefenseFrameStateJudge:is_damage_blocked()

function • v2.0

Returns true if damage was blocked by this DefenseRule, or by one of higher priority.
  Otherwise, returns false.

Function Call

defense_frame_state_judge:is_damage_blocked()

Returns

boolean

DefenseFrameStateJudge:is_impact_blocked()

function • v2.0

Returns true if contact was blocked by this DefenseRule, or by one of higher priority.
  Otherwise, returns false.

Function Call

defense_frame_state_judge:is_impact_blocked()

Returns

boolean

DefenseFrameStateJudge:signal_defense_was_pierced()

function • v2.0

This function is used for special cases where any triggered effects of a DefenseRule will be turned off for a frame.
e.g. Breaking through a "Guard"-style effect will disable its counterattack for this frame.

Function Call

defense_frame_state_judge:signal_defense_was_pierced()

Utility Objects

Animation

Animation:load()

function • v2.0

Loads a specified .animation file into the Animation object.

Function Call

animation:load()

Parameters

string file_path

Animation:update()

function • v2.0

Function Call

animation:update()

Parameters

number elapsed_timeThe amount of time (in seconds) you want to advance the animation by (or zero).
SpriteNode sprite_nodeThe SpriteNode you want to advance the animation of.

Animation:set_playback_speed()

function • v2.0

Sets the playback speed for any animations controlled by this Animation object.

Function Call

animation:set_playback_speed()

Parameters

number speed

Animation:get_playback_speed()

function • v2.0

Returns the playback speed multiplier for this Animation.

Function Call

animation:get_playback_speed()

Returns

number

Animation:refresh()

function • v2.0

Refreshes the target SpriteNode.

Function Call

animation:refresh()

Parameters

SpriteNode sprite_nodeThe SpriteNode you want to refresh.

Animation:copy_from()

function • v2.0

local empty_animator            -- Example Animation Handler 
local animator_to_copy_from     -- Example Animation Handler 

empty_animator:copy_from( animator_to_copy_from ) 

Creates a separate, deep copy of another Animation object.

Function Call

animation:copy_from()

Parameters

Animation other_animation

Animation:set_state()

function • v2.0

Makes the Animation object play a specific animation.

Function Call

animation:set_state()

Parameters

string state_name

Animation:get_state()

function • v2.0

Function Call

animation:get_state()

Returns

string The name of the animation this object is currently playing.

Animation:has_state()

function • v2.0

Queries whether or not the Animation has a specific animation defined.
 e.g. To check to see whether an entity is able to play a specific animation.

Function Call

animation:has_state()

Parameters

string state_nameThe animation state's name.

Returns

boolean true if this Animation has a definition for the provided animation state. Otherwise false.

Animation:point()

function • v2.0

Gets the current offset for a specific named point.

Function Call

animation:point()

Parameters

string point_name

Returns

Vector2

Animation:set_playback()

function • v2.0

Function Call

animation:set_playback()

Parameters

Playback playback_mode

Animation:on_complete()

function • v2.0

function complete_func() 
    -- code to execute 
end 

Assigns a function to be executed when the animation completes.

Function Call

animation:on_complete()

Parameters

function complete_func

local animation     -- Example Animation Handler
function complete_func( )
    print( "animation interrupted!" )
end

animation.on_complete = complete_func

Animation:on_frame()

function • v2.0

function on_frame_func() 
    -- code to execute 
end 

Assigns a function to be executed at a specific point in the animation.
on_frame() triggers don't happen after a specific amount of game-time frames (1/60th of a second),
  instead they happen when the animation moves to the next entry in its list for an animation.

e.g. If an animation named EXAMPLE_ANIMATION has 8 states that last 1/6th of a second each:
on_frame(1) will trigger when starting the animation, on_frame(2) will trigger 1/6th of a second later, etc.

Function Call

animation:on_frame()

Parameters

function on_frame_func

local animation     -- Example Animation Handler
function on_frame_func( )
    print( "animation interrupted!" )
end

animation.on_frame = on_frame_func

Animation:on_interrupt()

function • v2.0

function interrupt_func() 
    -- code to execute 
end 

Assigns a function to be executed if the animation is interrupted.

Function Call

animation:on_interrupt()

Parameters

function interrupt_func

local animation     -- Example Animation Handler
function interrupt_func( )
    print( "animation interrupted!" )
end

animation.on_interrupt = interrupt_func

Color

Color . r

property • v2.0

Property Type

number

Color . g

property • v2.0

Property Type

number

Color . b

property • v2.0

Property Type

number

Color . a

property • v2.0

Property Type

number

Color:new()

function • v2.0

Function Call

color:new()

Parameters

number r
number g
number b
number a

MoveEvent

MoveEvent . delta_frames

property • v2.0

Property Type

number

The number of frames the movement takes to complete.

MoveEvent . delay_frames

property • v2.0

Property Type

number

The number of frames before the Entity actually moves.

MoveEvent . endlag_frames

property • v2.0

Property Type

number

The number of frames the Entity has to wait after the movement completes.

MoveEvent . height

property • v2.0

Property Type

number

The maximum height the Entity will reach during the movement.

MoveEvent . dest_tile

property • v2.0

Property Type

Tile

The Tile the Entity is attempting to move to.

MoveEvent . on_begin_func

callback • v2.0

Callback Signature

function( )

Description

HitProps

HitProps . aggressor

property • v2.0

Property Type

number

The unique ID of the Entity that spawned this.

HitProps . damage

property • v2.0

Property Type

number

HitProps . drag

property • v2.0

Property Type

Drag

HitProps . element

property • v2.0

Property Type

Element

HitProps . flags

property • v2.0

Property Type

Hit

Drag

Drag . direction

property • v2.0

Property Type

Direction

The Direction an Entity will be moved.

Drag . count

property • v2.0

Property Type

number

The number of spaces an Entity will be moved.

Drag:None()

function • v2.0

Returns a pre-built Direction, with Direction.None and 0.

Function Call

drag:None()

Returns

Direction

Mob

Mob:create_spawner()

function • v2.0

Function Call

mob:create_spawner()

Parameters

string enemy_package_id
Rank enemy_rank

Returns

ScriptedSpawner

Mob:set_background()

function • v2.0

Function Call

mob:set_background()

Parameters

string texture_path
string animation_path
number x_velocity
number y_velocity

Mob:stream_music()

function • v2.0

Function Call

mob:stream_music()

Parameters

string file_path
number loop_startThe time (in ms)
number loop_end

Mob:get_field()

function • v2.0

Function Call

mob:get_field()

Returns

Field

Mob:enable_freedom_mission()

function • v2.0

Function Call

mob:enable_freedom_mission()

Parameters

number turn_count
boolean can_player_flip

Mob:spawn_player()

function • v2.0

Sets the spawn point for Player #player_id to the specified Tile.

Function Call

mob:spawn_player()

Parameters

number player_id
number tile_x
number tile_y

Spawner

Spawner:spawn_at()

function • v2.0

Function Call

spawner:spawn_at()

Parameters

number x
number y

SpawnMutator

SpawnMutator . mutate

callback • v2.0

Callback Signature

function( character )

Parameters

Character character

Description

MoveEvent

MoveEvent . delta_frames

property • v2.0

Property Type

number

The number of frames the movement takes to complete.

MoveEvent . delay_frames

property • v2.0

Property Type

number

The number of frames before the Entity actually moves.

MoveEvent . endlag_frames

property • v2.0

Property Type

number

The number of frames the Entity has to wait after the movement completes.

MoveEvent . height

property • v2.0

Property Type

number

The maximum height the Entity will reach during the movement.

MoveEvent . dest_tile

property • v2.0

Property Type

Tile

The Tile the Entity is attempting to move to.

MoveEvent . on_begin_func

callback • v2.0

Callback Signature

function( )

Description

Vector2

Vector2 . x

property • v2.0

Property Type

number

Vector2 . y

property • v2.0

Property Type

number

Metadata Files

PlayerMeta

PlayerMeta:declare_package_id()

function • v2.0

Function Call

player_meta:declare_package_id()

Parameters

string package_id

PlayerMeta:set_special_description()

function • v2.0

Function Call

player_meta:set_special_description()

Parameters

string special_description

PlayerMeta:set_attack()

function • v2.0

Function Call

player_meta:set_attack()

Parameters

number attack_value

PlayerMeta:set_charged_attack()

function • v2.0

Function Call

player_meta:set_charged_attack()

Parameters

number charged_value

PlayerMeta:set_speed()

function • v2.0

Function Call

player_meta:set_speed()

Parameters

number speed_multiplier

PlayerMeta:set_health()

function • v2.0

Function Call

player_meta:set_health()

Parameters

number health_value

PlayerMeta:set_uses_sword()

function • v2.0

Function Call

player_meta:set_uses_sword()

Parameters

boolean has_sword

PlayerMeta:set_overworld_animation_path()

function • v2.0

Function Call

player_meta:set_overworld_animation_path()

Parameters

string file_path

PlayerMeta:set_overworld_texture_path()

function • v2.0

Function Call

player_meta:set_overworld_texture_path()

Parameters

string file_path

PlayerMeta:set_mugshot_animation_path()

function • v2.0

Function Call

player_meta:set_mugshot_animation_path()

Parameters

string file_path

PlayerMeta:set_mugshot_texture_path()

function • v2.0

Function Call

player_meta:set_mugshot_texture_path()

Parameters

string file_path

PlayerMeta:set_emotions_texture_path()

function • v2.0

Function Call

player_meta:set_emotions_texture_path()

Parameters

string file_path

PlayerMeta:set_preview_texture()

function • v2.0

Function Call

player_meta:set_preview_texture()

Parameters

string file_path

PlayerMeta:set_icon_texture()

function • v2.0

Function Call

player_meta:set_icon_texture()

Parameters

string file_path

BlockMeta

BlockMeta:declare_package_id()

function • v2.0

Function Call

block_meta:declare_package_id()

Parameters

string package_id

BlockMeta:set_description()

function • v2.0

Function Call

block_meta:set_description()

Parameters

string description

BlockMeta:set_name()

function • v2.0

Function Call

block_meta:set_name()

Parameters

string name

BlockMeta:set_color()

function • v2.0

Function Call

block_meta:set_color()

Parameters

BlockColor block_color

BlockMeta:as_program()

function • v2.0

Function Call

block_meta:as_program()

BlockMeta:set_mutator()

function • v2.0

Function Call

block_meta:set_mutator()

Parameters

function mutator_function

BlockColor

NAME MEANING
White
Red
Green
Blue
Pink
Yellow

CardMeta

CardMeta:declare_package_id()

function • v2.0

Function Call

card_meta:declare_package_id()

Parameters

string package_id

CardMeta:get_card_props()

function • v2.0

Function Call

card_meta:get_card_props()

Returns

CardProps

CardMeta:set_preview_texture()

function • v2.0

Function Call

card_meta:set_preview_texture()

Parameters

Texture texture

CardMeta:set_icon_texture()

function • v2.0

Function Call

card_meta:set_icon_texture()

Parameters

Texture icon

CardMeta:set_codes()

function • v2.0

Function Call

card_meta:set_codes()

Parameters

list code_listA list of single characters to use for the chip code.

CardMeta . filter_hand_step

callback • v2.0

Callback Signature

function( card_props, adjacent_cards )

Parameters

CardProps card_props

AdjacentCards adjacent_cards

Description

CardProperties

CardProperties . action

property • v2.0

Property Type

string

CardProperties . can_boost

property • v2.0

Property Type

boolean

CardProperties . card_class

property • v2.0

Property Type

CardClass

CardProperties . damage

property • v2.0

Property Type

number

CardProperties . description

property • v2.0

Property Type

string

CardProperties . element

property • v2.0

Property Type

Element

CardProperties . limit

property • v2.0

Property Type

number

CardProperties . meta_classes

property • v2.0

Property Type

list

CardProperties . secondary_element

property • v2.0

Property Type

Element

CardProperties . shortname

property • v2.0

Property Type

string

CardProperties . time_freeze

property • v2.0

Property Type

boolean

CardProperties . skip_time_freeze_intro

property • v2.0

Property Type

boolean

CardProperties . long_description

property • v2.0

Property Type

string

CardProperties:from_card()

function • v2.0

Function Call

card_props:from_card()

Parameters

string package_id

Returns

CardProps

CardClass

NAME MEANING
Standard Most common type, able to use many copies in a folder.
Mega Uncommon, stronger chips that have an additional limitation:
 Only five Mega Chips total are allowed in a folder.
Giga Strongest class of chip. Only one Giga Chip is allowed in a folder.
Dark These are the "fun" ones. Your friends will love them.

AdjacentCards

AdjacentCards . left_card

property • v2.0

Property Type

CardProps

AdjacentCards . right_card

property • v2.0

Property Type

CardProps

AdjacentCards:has_card_to_left()

function • v2.0

Function Call

adjacent_cards:has_card_to_left()

Returns

boolean

AdjacentCards:has_card_to_right()

function • v2.0

Function Call

adjacent_cards:has_card_to_right()

Returns

boolean

AdjacentCards:discard_left()

function • v2.0

Function Call

adjacent_cards:discard_left()

AdjacentCards:discard_right()

function • v2.0

Function Call

adjacent_cards:discard_right()

AdjacentCards:discard_incoming()

function • v2.0

Function Call

adjacent_cards:discard_incoming()

LuaLibraryMeta

LuaLibraryMeta:declare_package_id()

function • v2.0

Function Call

lua_library_meta:declare_package_id()

Parameters

string package_id

MobMeta

MobMeta:declare_package_id()

function • v2.0

Function Call

mob_meta:declare_package_id()

Parameters

string package_id

MobMeta:set_description()

function • v2.0

Function Call

mob_meta:set_description()

Parameters

string description

MobMeta:set_name()

function • v2.0

Function Call

mob_meta:set_name()

Parameters

string name

MobMeta:set_preview_texture_path()

function • v2.0

Function Call

mob_meta:set_preview_texture_path()

Parameters

string preview_path

MobMeta:set_speed()

function • v2.0

Function Call

mob_meta:set_speed()

Parameters

number speed_multiplier

MobMeta:set_attack()

function • v2.0

Function Call

mob_meta:set_attack()

Parameters

number attack_value

MobMeta:set_health()

function • v2.0

Function Call

mob_meta:set_health()

Parameters

number health_value

Enums

ActionOrder

NAME MEANING
Immediate Highest priority, immediately move the affected Entity.
Involuntary Medium priority.
Voluntary Lowest priority. Move only when the Entity is able to move by itself.

AudioPriority

NAME MEANING
Lowest
Low
High
Highest

ColorMode

NAME MEANING
Multiply Any tint applied to this SpriteNode will darken it.
Additive Any tint applied to this SpriteNode will brighten it.

Direction

NAME MEANING
None
Up
Down
Left
Right
UpLeft
UpRight
DownLeft
DownRight

Direction:flip_x()

function • v2.0

local facing = Direction.UpLeft 

local flipped = Direction.flip_x( facing ) 
local also_flipped = facing.flip_x() 

The above snippet will return Direction.UpRight.

This returns a Direction with the same vertical component, but opposite horizontal component of the input Direction.

Function Call

direction:flip_x()

Parameters

Direction input_directionThe Direction you want to flip the horizontal component of.

Returns

Direction

Direction:flip_y()

function • v2.0

local facing = Direction.UpLeft 

local flipped = Direction.flip_y( facing ) 
local also_flipped = facing.flip_y() 

The above snippet will return Direction.DownLeft.

This returns a Direction with the same horizontal component, but opposite vertical component of the input Direction.

Function Call

direction:flip_y()

Parameters

Direction input_directionThe Direction you want to flip the vertical component of.

Returns

Direction

Direction:reverse()

function • v2.0

local facing = Direction.UpLeft 

local flipped = Direction.reverse( facing ) 
local also_flipped = facing.reverse() 

The above snippet will return Direction.DownRight.

This returns a Direction with the opposite vertical and horizontal components of the input Direction.

Function Call

direction:reverse()

Parameters

Direction input_directionThe Direction you want to flip.

Returns

Direction

Direction:join()

function • v2.0

local comp1 = Direction.Up 
local comp2 = Direction.Left 

local joined = Direction.join( comp1, comp2 ) 
local also_joined = comp1.join( comp2 ) 

The above snippet will return Direction.UpLeft.

This returns the closest normalized Direction to the result of adding the two component Directions like vectors.
 e.g. Adding Up to UpLeft, would produce UpLeft.

Function Call

direction:join()

Parameters

Direction input_a
Direction input_b

Returns

Direction

Element

NAME MEANING
Fire
Aqua
Elec
Wood
Sword
Wind
Cursor
Summon
Plus
Break
None

EntityStatus

NAME MEANING
Queued The Entity was not spawned immediately, and is queued to spawn at the end of frame.
Added The Entity was successfully spawned straight away.
Failed The Entity could not be spawned.

Highlight

NAME MEANING
Solid The top of this Tile will have a yellow overlay.
Flash The top of this Tile will alternate between having a yellow overlay, and having none.
None The top of this Tile will not change.

Hit

NAME MEANING
None No special properties.
Flinch Forces any Entity hit to play a "hurt" animation TODO find which one
Flash Any hit Entity will temporarily be unable to be hit by attacks that need to make physical contact.
 (i.e. the attack has Hit.Impact)
Stun Any hit Entity will turn yellow and become unable to move for a period of time.
(Default duration is 180 frames/3 seconds)
Root Any hit Entity will be temporarily rooted in place and unable to move.
Impact This attack requires physical contact to be able to hit an Entity.
 There may be some unintentional behaviour if you accidentally don't include this flag.
Shake Any hit Entity will temporarily shake.
Pierce This attack ignores any 'invisibilty'/'invulnerability' effects on targets.
Retangible This attack removes any 'invisibilty'/'invulnerability' effects on targets.
Breaking This attack ignores any 'blocking' effects an on targets. (e.g. Guard chips)
Bubble This attack traps any hit Entity in a bubble trap.
Freeze This attack traps any hit Entity in an ice trap.
Drag This attack will attempt to force any hit Entity to move.
If this flag is not included, the Entity will not be moved by this attack.

Input

The Input table is divided up into two portions:
 The first entry is the state for a key.
 The second entry is the key being pressed.

i.e. Input.Pressed.Up checks for if the Up key is Pressed.

NAME MEANING
Pressed
Held
Released

NAME MEANING
Up
Left
Right
Down
Use
Special
Shoot

Rank

NAME MEANING
V1
V2
V3
SP
EX
Rare1
Rare2
NM

Team

NAME MEANING
Red
Blue
Other

lua