Fix when we remember the player's move

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-16 01:14:49 -07:00
parent 1021f30fb8
commit a91d7f24a1

View File

@ -640,6 +640,16 @@ export class Level {
} }
finish_tic(p1_input) { 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 // SECOND PASS: actors decide their upcoming movement simultaneously
for (let i = this.actors.length - 1; i >= 0; i--) { for (let i = this.actors.length - 1; i >= 0; i--) {
let actor = this.actors[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 // 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 // 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? // necessary, either; maybe only do it every few tics?