-
Notifications
You must be signed in to change notification settings - Fork 17
SkillEffect
- AddQueuedAirStrike
- AddQueuedAnimation
- AddQueuedBoardshake
- AddQueuedBounce
- AddQueuedDelay
- AddQueuedDropper
- AddQueuedEmitter
- AddQueuedGrapple
- AddQueuedLeap
- AddQueuedSound
- GetMetadata
- GetQueuedMetadata
- AddSafeDamage
- AddQueuedSafeDamage
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 theSpaceDamage
-
source
- location from which the projetile/artillery originated, or nil if not available. -
target
- location of theSpaceDamage
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 toAddGrapple
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
Signature: table GetQueuedMetadata()
See GetMetadata
- this does the same thing, except for queued SpaceDamage
instances.
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
Signature: void AddQueuedSafeDamage(SpaceDamage)
See AddSafeDamage
- this does the same thing, except for queued SpaceDamage
instances.
Adds a queued air strike to the skill effect.
Adds a queued animation to the skill effect.
Adds a queued board shake to the skill effect.
Adds a queued bounce to the skill effect.
Adds a queued delay to the skill effect.
Adds a queued dropper to the skill effect.
Adds a queued emitter to the skill effect.
Adds a queued grappling attack to the skill effect.
Adds a queued leap to the skill effect.
Adds a queued sound to the skill effect.