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

Table of Contents

 

SkillEffect

 

GetMetadata

Signature: table GetMetadata()

Extracts metadata from the skill effect's damage list instance and returns it as a list of tables. Each index in the list corresponds to a SpaceDamage instance in the skill effect's damage list. If the damage list is empty (skill effect consists only of queued attacks), the metadata list is also be empty.

Shared metadata table fields:

  • type - type of the SpaceDamage
  • source - location of the pawn using the skill effect, or nil if not available. Not sure how it'll behave when used via Board:AddEffect.
  • target - location of the SpaceDamage instance (SpaceDamage.loc)

Currently, metadata is only available for SpaceDamage instances added via the following methods (and their queued variants):

  • SkillEffect:AddGrapple
    • anim - third argument passed to AddGrapple function, assuming it specifies the grappling animation
  • SkillEffect:AddProjectile
    • projectileArt - sprite used for the projectile
  • SkillEffect:AddArtillery
    • projectileArt - sprite used for the projectile

Example:

local fx -- the skill effect
local metadata = fx:GetMetadata()

if #metadata == 0 then
    -- table is empty, the skill effect only has queued entries
end

for i, v in ipairs(metadata) do
    -- each index in the metadata table corresponds to a SpaceDamage instance in the skill effect
    if v then
        -- we have metadata available for this index
        LOG(i, save_table(v)) -- print it to the console for inspection
    end
end

 

GetQueuedMetadata

Signature: table GetQueuedMetadata()

See GetMetadata - this does the same thing, except for queued SpaceDamage instances.

 

AddSafeDamage

Signature: void AddSafeDamage(SpaceDamage)

Argument name Type Description
spaceDamage SpaceDamage The space damage instance describing the damage to deal

Adds the specified damage instance to this SkillEffect in a way that deals damage only to pawns at the specified location, without causing any side effects to the board.

One exception to this is fire: if the pawn happens to be standing on a forest tile, the tile will also be set on fire, since the game propagates the Fire status from the pawn onto the tile.

This function does nothing if the space damage's location points to a building, since there's no way to avoid damaging the buildings without affecting the board in other ways.

Example:

local pawn = Board:GetPawn(0)
Board:SetTerrain(pawn:GetSpace(), TERRAIN_FOREST)

local fx = SkillEffect()
fx:AddSafeDamage(SpaceDamage(1))
Board:AddEffect(fx)

-- The pawn will be damaged, but the forest it is standing on will not be set on fire

 

AddQueuedSafeDamage

Signature: void AddQueuedSafeDamage(SpaceDamage)

See AddSafeDamage - this does the same thing, except for queued SpaceDamage instances.

 

AddQueuedAirStrike

Adds a queued air strike to the skill effect.

 

AddQueuedAnimation

Adds a queued animation to the skill effect.

 

AddQueuedBoardshake

Adds a queued board shake to the skill effect.

 

AddQueuedBounce

Adds a queued bounce to the skill effect.

 

AddQueuedDelay

Adds a queued delay to the skill effect.

 

AddQueuedDropper

Adds a queued dropper to the skill effect.

 

AddQueuedEmitter

Adds a queued emitter to the skill effect.

 

AddQueuedGrapple

Adds a queued grappling attack to the skill effect.

 

AddQueuedLeap

Adds a queued leap to the skill effect.

 

AddQueuedSound

Adds a queued sound to the skill effect.

 

Clone this wiki locally