Bowling balls still blow up actors when sliding

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-19 17:33:26 -07:00
parent 148beb7d74
commit aa0bb5cbc2
2 changed files with 13 additions and 7 deletions

View File

@ -809,15 +809,15 @@ export class Level extends LevelInterface {
let old_cell = actor.cell; let old_cell = actor.cell;
let success = this.attempt_step(actor, actor.decision); let success = this.attempt_step(actor, actor.decision);
if (! success && actor.type.on_blocked) {
actor.type.on_blocked(actor, this, actor.decision);
}
if (! success && actor.slide_mode === 'ice') { if (! success && actor.slide_mode === 'ice') {
this._handle_slide_bonk(actor); this._handle_slide_bonk(actor);
success = this.attempt_step(actor, actor.decision); success = this.attempt_step(actor, actor.decision);
} }
if (! success && actor.type.on_blocked) {
actor.type.on_blocked(actor, this, actor.decision);
}
// Track whether the player is blocked, for visual effect // Track whether the player is blocked, for visual effect
if (actor === this.player && actor.decision && ! success) { if (actor === this.player && actor.decision && ! success) {
this.sfx.play_once('blocked'); this.sfx.play_once('blocked');

View File

@ -2202,6 +2202,7 @@ const TILE_TYPES = {
has_inventory: true, has_inventory: true,
can_reveal_walls: true, can_reveal_walls: true,
// FIXME ??????? // FIXME ???????
// FIXME we need to hit the player also
collision_mask: COLLISION.block_cc2, collision_mask: COLLISION.block_cc2,
// FIXME do i start moving immediately when dropped, or next turn? // FIXME do i start moving immediately when dropped, or next turn?
movement_speed: 4, movement_speed: 4,
@ -2209,11 +2210,10 @@ const TILE_TYPES = {
return [me.direction]; return [me.direction];
}, },
on_blocked(me, level, direction) { on_blocked(me, level, direction) {
if (me.slide_mode)
return;
let cell = level.get_neighboring_cell(me.cell, direction); let cell = level.get_neighboring_cell(me.cell, direction);
let other;
if (cell) { if (cell) {
let other = cell.get_actor(); other = cell.get_actor();
if (other) { if (other) {
if (other.is_real_player) { if (other.is_real_player) {
level.fail(me.type.name); level.fail(me.type.name);
@ -2223,7 +2223,13 @@ const TILE_TYPES = {
} }
} }
} }
if (me.slide_mode && ! other) {
// Sliding bowling balls don't blow up if they hit a regular wall
return;
}
level.transmute_tile(me, 'explosion'); level.transmute_tile(me, 'explosion');
// Remove our slide mode so we don't attempt to bounce if on ice
level.make_slide(me, null);
}, },
}, },
xray_eye: { xray_eye: {