Disallow pulling unpushable blocks; play a sound on bowling ball collision

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-24 06:55:50 -07:00
parent 1a7dc3e737
commit d567a2553e
2 changed files with 5 additions and 1 deletions

View File

@ -1262,7 +1262,9 @@ export class Level extends LevelInterface {
if (behind_cell) {
let behind_actor = behind_cell.get_actor();
// FIXME something else happens during cooldown i think
if (behind_actor && ! behind_actor.movement_cooldown) {
if (behind_actor && ! behind_actor.movement_cooldown &&
actor.can_push(behind_actor, direction))
{
this._set_tile_prop(behind_actor, 'is_pulled', true);
this.attempt_out_of_turn_step(behind_actor, direction);
}

View File

@ -2258,6 +2258,7 @@ const TILE_TYPES = {
else {
level.transmute_tile(other, 'explosion');
}
level.sfx.play_once('bomb', me.cell);
level.transmute_tile(me, 'explosion');
},
on_blocked(me, level, direction) {
@ -2279,6 +2280,7 @@ const TILE_TYPES = {
// Sliding bowling balls don't blow up if they hit a regular wall
return;
}
level.sfx.play_once('bomb', me.cell);
level.transmute_tile(me, 'explosion');
// Remove our slide mode so we don't attempt to bounce if on ice
level.make_slide(me, null);