From 52bc2bdf8e12245aa9c2f3b320d7e2663f3b312d Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Fri, 12 Apr 2024 01:08:16 -0600 Subject: [PATCH] Show the entire blast radius of dynamite --- js/tiletypes.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/js/tiletypes.js b/js/tiletypes.js index 441a74d..d72a861 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -344,8 +344,8 @@ const TILE_TYPES = { } }, on_depart(me, level, other) { - // Inexplicable CC2 quirk: nothing happens if there's dynamite on us - // TODO compat? this makes no sense to me + // CC2 quirk: nothing happens if there's still an actor on us (i.e. dynamite) + // FIXME does this imply on_depart isn't called at all if we walk off dynamite? if (me.cell.has('dynamite_lit')) return; @@ -866,8 +866,7 @@ const TILE_TYPES = { layer: LAYERS.terrain, blocks_collision: COLLISION.ghost | COLLISION.fireball, on_depart(me, level, other) { - // Inexplicable CC2 quirk: nothing happens if there's dynamite on us - // TODO compat? this makes no sense to me + // CC2 quirk: nothing happens if there's still an actor on us (i.e. dynamite) if (me.cell.has('dynamite_lit')) return; @@ -2851,13 +2850,15 @@ const TILE_TYPES = { } } - if (removed_anything || actor) { - if (actor) { - level.kill_actor(actor, me, 'explosion'); - } - else { - level.spawn_animation(cell, cell.get_actor() ? 'explosion_nb' : 'explosion'); - } + if (actor) { + level.kill_actor(actor, me, 'explosion'); + } + else if (removed_anything && ! cell.get_actor()) { + level.spawn_animation(cell, 'explosion'); + } + else { + // Extension: Show the entire blast radius every time + level.spawn_animation(cell, 'explosion_nb'); } } }