Skip to content
Tomasz Bachmiński edited this page Jun 26, 2019 · 7 revisions

Table of Contents

 

Board

 

GetHighlighted

Signature: Point GetHighlighted()

Returns the current tile being highlighted by the mouse cursor. Returns nil if no tile is highlighted.

 

IsHighlighted

Signature: boolean IsHighlighted(Point)

Argument name Type Description
loc Point The tile we want to check

Returns true if the specified tile is currently highlighted by the mouse cursor. false otherwise.

 

IsMissionBoard

Signature: boolean IsMissionBoard(table)

Argument name Type Description
mission table Optional argument. If provided, the function will check whether this instance is the board used in the specified mission. Defaults to currently active mission.

Returns true if this Board is the main board used in the specified mission. false otherwise, or when no mission is currently active.

 

IsTipImage

Signature: boolean IsTipImage()

Returns true if this board is part of a tip image. false otherwise.

 

MovePawnsFromTile

Signature: table MovePawnsFromTile(Point)

Argument name Type Description
loc Point The location to move the pawns from

Moves all pawns on the specified tile off the board. Returns a list of all pawns that have been moved, in reverse order in which they have been placed on the tile

Use in conjunction with RestorePawnsToTile

Example:

local loc = Point(2,2)
local fx = SkillEffect()
fx:AddScript(string.format([[
	local loc = %s
	local pawnstack = Board:MovePawnsFromTile(loc)

	Board:DamageSpace(SpaceDamage(loc, 1))
	-- Tile will be damaged, but no pawns will be harmed

	Board:RestorePawnsToTile(loc, pawnstack)
]], loc:GetLuaString()))

Board:AddEffect(fx)

 

RestorePawnsToTile

Signature: void RestorePawnsToTile(Point, table)

Argument name Type Description
loc Point The location to restore the pawns to
pawnStack table List of all pawns that have been moved using MovePawnsFromTile

Restores all pawns in the list to the specified location, honoring the order in which they've been placed originally.

Use in conjunction with MovePawnsFromTile

 

SetFire

Signature: void SetFire(Point, boolean)

Argument name Type Description
loc Point The tile that will be affected
fire boolean Whether the tile should be set on fire, or extinguished

Sets the specified tile on fire if the second argument is true, or extinguishes it if it is false. Extinguishing the tile does not remove the Fire status from pawns standing on the tile.

 

SetShield

Signature: void SetShield(Point, boolean)

Argument name Type Description
loc Point The tile that will be affected
shield boolean Whether the tile should be shielded, or unshielded

Adds a shield to any pawn, building or mountain on the specified tile if the second argument is true, or removes any shield if it is false.

Clone this wiki locally