From a91d7f24a14fd3eb276163224a13082280e8e22a Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Wed, 16 Dec 2020 01:14:49 -0700 Subject: [PATCH] Fix when we remember the player's move --- js/game.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/js/game.js b/js/game.js index 4348467..97528bf 100644 --- a/js/game.js +++ b/js/game.js @@ -640,6 +640,16 @@ export class Level { } finish_tic(p1_input) { + // After cooldowns but before the decision phase, remember the player's /current/ direction, + // which may be affected by sliding. This will affect the behavior of doppelgangers earlier + // in the actor order than the player. + if (this.player.movement_cooldown > 0) { + this.remember_player_move(this.player.direction); + } + else { + this.remember_player_move(this.player.decision); + } + // SECOND PASS: actors decide their upcoming movement simultaneously for (let i = this.actors.length - 1; i >= 0; i--) { let actor = this.actors[i]; @@ -718,13 +728,6 @@ export class Level { } } - // In the event that the player is sliding (and thus not deliberately moving) or has - // stopped, remember their current movement direction here, too. - // This is hokey, and doing it here is even hokier, but it seems to match CC2 behavior. - if (this.player.movement_cooldown > 0) { - this.remember_player_move(this.player.direction); - } - // Strip out any destroyed actors from the acting order // FIXME this is O(n), where n is /usually/ small, but i still don't love it. not strictly // necessary, either; maybe only do it every few tics?