Class engine.generator.interface.ActorProject
Handles actors projecting damage to zones/targets
Methods
engine.generator.interface.ActorProject:project (t, x, y, damtype, dam, particles)
Project damage to a distance
engine.generator.interface.ActorProject:canProject (t, x, y)
Can we project to this grid?
engine.generator.interface.ActorProject:getTargetLimited (t)
Calls :getTarget and :canProject to limit the results and returns the same as getTarget
engine.generator.interface.ActorProject:getTargetLimitedWallStop (t)
Calls :getTarget and :canProject to limit the results and returns the same as getTarget
engine.generator.interface.ActorProject:projectile (t, x, y, damtype, dam, particles)
Project damage to a distance using a moving projectile
engine.generator.interface.ActorProject:projectDoMove (typ, tgtx, tgty, x, y, srcx, srcy)
Do move
engine.generator.interface.ActorProject:projectDoAct (typ, tg, damtype, dam, particles, px, py, tmp)
projectDoAct
engine.generator.interface.ActorProject:projectDoStop (typ, tg, damtype, dam, particles, lx, ly, tmp, rx, ry, projectile)
projectDoStop
Methods
- engine.generator.interface.ActorProject:project (t, x, y, damtype, dam, particles)
-
Project damage to a distance
Parameters:
- t a type table describing the attack, passed to engine.Target:getType() for interpretation
- x target coords
- y target coords
- damtype a damage type ID from the DamageType class or a function to be called as damtype(px, py, t, self) on each grid
- dam damage to be done
- particles particles effect configuration, or nil
- engine.generator.interface.ActorProject:canProject (t, x, y)
-
Can we project to this grid?
This function can be used for either just the boolean, or to tell you where the projection stops.
Two sets of coordinates will be returned, one for where the projection stops (stopx, stopy) and one for where any radius effect should start from (radiusx, radiusy). The distinction is made because a projection should hit the wall, but explosions should start one tile back to avoid "leaking" through a one tile thick wall.Parameters:
- t table a type table describing the attack, passed to engine.Target:getType() for interpretation
- x number target coords
- y number target coords
Returns:
- can_project
- stop_x
- stop_y
- radius_x
- radius_y
- engine.generator.interface.ActorProject:getTargetLimited (t)
-
Calls :getTarget and :canProject to limit the results and returns the same as getTarget
Parameters:
- t
- engine.generator.interface.ActorProject:getTargetLimitedWallStop (t)
-
Calls :getTarget and :canProject to limit the results and returns the same as getTarget
Parameters:
- t
- engine.generator.interface.ActorProject:projectile (t, x, y, damtype, dam, particles)
-
Project damage to a distance using a moving projectile
Parameters:
- t a type table describing the attack, passed to engine.Target:getType() for interpretation
- x target coords
- y target coords
- damtype a damage type ID from the DamageType class
- dam damage to be done
- particles particles effect configuration, or nil
- engine.generator.interface.ActorProject:projectDoMove (typ, tgtx, tgty, x, y, srcx, srcy)
-
Do move
Parameters:
- typ a target type table
- tgtx the target's x-coordinate
- tgty the target's y-coordinate
- x the projectile's x-coordinate
- y the projectile's y-coordinate
- srcx the sourcs's x-coordinate
- srcy the source's y-coordinate
Returns:
- lx x-coordinate the projectile travels to next
- ly y-coordinate the projectile travels to next
- act should we call projectDoAct() (usually only for beam)
- stop is this the last (blocking) tile?
- engine.generator.interface.ActorProject:projectDoAct (typ, tg, damtype, dam, particles, px, py, tmp)
-
projectDoAct
Parameters:
- typ
- tg
- damtype
- dam
- particles
- px
- py
- tmp Now project on each grid, one type Call the projected method of the target grid if possible
- engine.generator.interface.ActorProject:projectDoStop (typ, tg, damtype, dam, particles, lx, ly, tmp, rx, ry, projectile)
-
projectDoStop
Parameters:
- typ
- tg
- damtype
- dam
- particles
- lx
- ly
- tmp
- rx
- ry
- projectile