Skip to content
Snippets Groups Projects

Target and Projection Update

Merged Hachem_Muche requested to merge Hachem_Muche/t-engine4:Target/ProjectionUpdate into master
2 files
+ 124
51
Compare changes
  • Side-by-side
  • Inline
Files
2
  • Updated targeting table interpretation (by default target type functions) to be consistent for different targeting types and improve AoE targeting. (Default behavior is unchanged.)
    
    Target.defaults.block_path updated to handle blocking by actors using a new actorblock (default:true) parameter in conjunction with the friendlyblock (default:nil, controls if specified) parameter to allow projection to be selectively blocked by all types of actors (based on reaction: all, none, friendly only, hostile only) as required.
    
    Updated Target.defaults.block_radius to handle the same blocking parameters as Target.defaults.block_path (stop_block, pass_terrain, actorblock, friendlyblock).  This allows AoE projection to be blocked by non-terrain entities.  In ToME, this will allow certain (mostly projectile) talents to be significantly simplified (Fan of Knives, The Shotgonne, several others), as well as allowing projection to stop at friends.
    
    A targeting table may specify display_line_step = false to prevent targeting path highlight from overlapping AoE highlights.
    
    Fixed a bug where engine.Actor:canMove was not passing the actor to Map:checkEntity.
@@ -268,7 +268,7 @@ end
function _M:canMove(x, y, terrain_only)
if not game.level.map:isBound(x, y) then return false end
if terrain_only then
return not game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move")
return not game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move", self)
else
return not game.level.map:checkAllEntities(x, y, "block_move", self)
end
Loading