Cycle an RFF after a failed override; move slide turnaround to move phase
This commit is contained in:
parent
e4ab7dde86
commit
a529414e42
19
js/game.js
19
js/game.js
@ -680,6 +680,11 @@ export class Level {
|
|||||||
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.slide_mode === 'ice') {
|
||||||
|
this._handle_slide_bonk(actor);
|
||||||
|
success = this.attempt_step(actor, 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');
|
||||||
@ -870,6 +875,8 @@ export class Level {
|
|||||||
if (actor.slide_mode === 'force' && ! open) {
|
if (actor.slide_mode === 'force' && ! open) {
|
||||||
actor.decision = actor.direction;
|
actor.decision = actor.direction;
|
||||||
this._set_tile_prop(actor, 'last_move_was_force', true);
|
this._set_tile_prop(actor, 'last_move_was_force', true);
|
||||||
|
// Be sure to invoke this hack if we're standing on an RFF
|
||||||
|
this._handle_slide_bonk(actor);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Otherwise this is 100% a conscious move so we lose our override power next tic
|
// Otherwise this is 100% a conscious move so we lose our override power next tic
|
||||||
@ -910,7 +917,8 @@ export class Level {
|
|||||||
let direction_preference;
|
let direction_preference;
|
||||||
if (actor.slide_mode) {
|
if (actor.slide_mode) {
|
||||||
// Actors can't make voluntary moves while sliding; they just, ah, slide.
|
// Actors can't make voluntary moves while sliding; they just, ah, slide.
|
||||||
direction_preference = [actor.direction];
|
actor.decision = actor.direction;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (actor.cell.some(tile => tile.type.traps && tile.type.traps(tile, actor))) {
|
else if (actor.cell.some(tile => tile.type.traps && tile.type.traps(tile, actor))) {
|
||||||
// An actor in a cloner or a closed trap can't turn
|
// An actor in a cloner or a closed trap can't turn
|
||||||
@ -952,15 +960,6 @@ export class Level {
|
|||||||
actor.decision = direction;
|
actor.decision = direction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actor.slide_mode && all_blocked) {
|
|
||||||
this._handle_slide_bonk(actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Non-players move instantly while sliding, without waiting for the movement pass
|
|
||||||
if (actor.slide_mode) {
|
|
||||||
this.attempt_step(actor, actor.direction);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME can probably clean this up a decent bit now
|
// FIXME can probably clean this up a decent bit now
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user