SpaceDamage - itb-community/ITB-ModLoader GitHub Wiki

Table of Contents

 

SpaceDamage

To inspect or manipulate a SpaceDamage instance, you can use memedit functions.

 

Clone

Signature: SpaceDamage Clone()

Copies this SpaceDamage instance and returns a new one, that holds the exact same data.

Example:

local dmg1 = SpaceDamage(Point(0, 0), 1)
local dmg2 = dmg1:Clone()
dmg2.iDamage = 2
Board:DamageSpace(dmg1)
Board:DamageSpace(dmg2)
-- 3 damage total to Point(0, 0)

 

ListFields

Signature: table ListFields()

Lists all fields a SpaceDamage can hold. Useful for iterating.

Example:

local spaceDamage = SpaceDamage()
for _, k in ipairs(spaceDamage:ListFields()) do
    LOG(k)
end

 

ToTable

Signature: table ToTable()

Converts this SpaceDamage to a table.

Example:

local spaceDamage = SpaceDamage(Point(1, 2), 3)
local table = spaceDamage:ToTable()
LOG(table.loc, table.iDamage)