[Vanilla] SpaceDamage - itb-community/ITB-ModLoader GitHub Wiki

SpaceDamage

A SpaceDamage is an object that describes a single action that affects the game board in some way. This may be actual damage; a move action by a pawn; or a change of terrain on a particular board tile. All damage in the game is specified as damage that happens at a board tile, which then also applies to any Pawn that happens to be standing at that tile.

Dealing damage to a Pawn without affecting the tile it is standing on (or vice versa) is possible with the use of helper functions/libraries, but the game does not provide anything for that out-of-the-box.

 

Table of Contents

Functions:

  • IsMovement
  • MoveEnd
  • MoveStart

Fields:

 

Functions

TODO

 

Fields:

 

bEvacuate

Type: boolean

Setting this field to true will cause it to evacuate civillians in the building at the tile specified by this SpaceDamage's loc field.

Evacuated buildings don't cause the player to lose grid when damaged, and don't reduce the "lives saved" score.

 

bHide

Type: boolean

Setting this field to true will prevent some of its effects from being previewed on the game board during targeting, or when its parent SkillEffect is queued.

 

bHidePath

Type: boolean

Unknown?

 

bSimpleMark

Type: boolean

Unknown?

 

fDelay

Type: float

Setting this to non-zero value will add that much delay (in seconds) after this SpaceDamage has been executed, holding the board in a busy state for a longer period of time, and delaying execution of further SpaceDamage instances.

It is also possible to specify negative values, which the game interprets in some way. For example, -1 supposedly waits until the board is no longer in a busy state.

 

iAcid

Type: integer

Setting this field either creates or removes Acid at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes only the following values:

  • EFFECT_REMOVE (-1) - removes the Acid
  • EFFECT_CREATE (1) - applies the Acid
  • 0 - does not change the Acid status in any way

 

iFire

Type: integer

Setting this field either creates or removes Fire at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes only the following values:

  • EFFECT_REMOVE (-1) - removes the Fire
  • EFFECT_CREATE (1) - applies the Fire
  • 0 - does not change the Fire status in any way

 

iFrozen

Type: integer

Setting this field either applies or removes Frozen status to the entity at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes only the following values:

  • EFFECT_REMOVE (-1) - removes the Frozen status
  • EFFECT_CREATE (1) - applies the Frozen status
  • 0 - does not change the Frozen status in any way

 

iShield

Type: integer

Setting this field either applies or removes Shield status to the entity at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes only the following values:

  • EFFECT_REMOVE (-1) - removes the Shield status
  • EFFECT_CREATE (1) - applies the Shield status
  • 0 - does not change the Shield status in any way

 

iSmoke

Type: integer

Setting this field either creates or removes Smoke at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes only the following values:

  • EFFECT_REMOVE (-1) - removes the Smoke
  • EFFECT_CREATE (1) - applies the Smoke
  • 0 - does not change the Smoke status in any way

 

iDamage

Type: integer

Specifies the amount of damage dealt at the tile specified by this SpaceDamage's loc field.

Can also set this to constants recognized by the game:

  • DAMAGE_ZERO - displays a 0 damage counter over the tile
  • DAMAGE_DEATH - displays a skull image over the tile

 

iPawnTeam

Type: integer

Changes the team of the pawn at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes the following constant values:

  • TEAM_ANY
  • TEAM_BOTS
  • TEAM_ENEMY
  • TEAM_ENEMY_MAJOR
  • TEAM_MECH
  • TEAM_NONE
  • TEAM_PLAYER

 

iPush

Type: integer

Adds a push effect at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes the following constant values, which define direction of the push:

  • DIR_UP (0) - pushes in north-east direction (⬈)
  • DIR_RIGHT (1) - pushes in south-east direction (⬊)
  • DIR_DOWN (2) - pushes in south-west direction (⬋)
  • DIR_LEFT (3) - pushes in north-west direction (⬉)

 

iTerrain

Type: integer

Changes the terrain at the tile specified by this SpaceDamage's loc field.

Technically an integer, but actually takes the following constant values, which define the type of terrain to change to:

  • TERRAIN_ACID
  • TERRAIN_BUILDING - creates a tile of 4 buildings at the specified tile
  • TERRAIN_FIRE
  • TERRAIN_FOREST
  • TERRAIN_HOLE
  • TERRAIN_ICE
  • TERRAIN_LAVA
  • TERRAIN_MOUNTAIN
  • TERRAIN_ROAD - creates a regular grassy tile
  • TERRAIN_RUBBLE - creates a destroyed mountain tile, if the tile was previously a mountain; or a destroyed building tile, for other tiles.
  • TERRAIN_SAND
  • TERRAIN_WATER

 

loc

Type: Point

Specifies the location at which this SpaceDamage's effects will occur. Defaults to Point(-1, -1).

 

sAnimation

Type: string

Unknown?

 

sImageMark

Type: string

Unknown?

 

sItem

Type: string

Creates an item of the specified type at the tile specified by this SpaceDamage's loc field.

This generally means things like mines etc. that will trigger a SpaceDamage instance once stepped on by a Pawn.

 

sPawn

Type: string

Spawns a pawn of the specified type at the tile specified by this SpaceDamage's loc field.

 

sScript

Type: string

Executes the lua script specified in the string.

The script is executed in a global scope, and does not have acces to any local variables. In order to pass parameters to the script, you need to use either global variables, or (if they have a stringified representation) pass them as strings.

Example of string-based parameter passing:

local d = SpaceDamage()
d.sScript = string.format([[
        local pawn = Board:GetPawn(%s)
        pawn:SetSpace(%s)
    ]],
    Point(4, 4):GetString(),
    Point(2, 2):GetString()
)

sSound

Type: string

Plays the sound at the specified path (inside the game's .bank sound files) when the SpaceDamage instance is executed.