From f1408047134395799c9112efd98538ea975c73f5 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Wed, 10 Apr 2024 18:15:35 -0600 Subject: [PATCH] Don't on_stand() on arrival; fix the CC1 force-floor compat flag --- js/defs.js | 13 +++++++------ js/game.js | 6 ------ js/tiletypes.js | 37 ++++++++++++++++--------------------- 3 files changed, 23 insertions(+), 33 deletions(-) diff --git a/js/defs.js b/js/defs.js index 8648aea..f8d3f0c 100644 --- a/js/defs.js +++ b/js/defs.js @@ -160,7 +160,7 @@ export const COMPAT_FLAGS = [ rulesets: new Set(['steam', 'steam-strict']), }, { key: 'player_moves_last', - label: "Player always moves last", + label: "Players always move last", rulesets: new Set(['lynx', 'ms']), }, { key: 'player_protected_by_items', @@ -197,11 +197,11 @@ export const COMPAT_FLAGS = [ rulesets: new Set(['ms']), }, { key: 'no_backwards_override', - label: "Player can't override backwards on a force floor", + label: "Players can't override backwards on a force floor", rulesets: new Set(['lynx']), }, { - key: 'force_floors_inert_on_first_tic', - label: "Force floors don't trigger on the first tic", + key: 'force_floors_on_arrive', + label: "Force floors trigger on arrival", rulesets: new Set(['lynx', 'ms']), }, { key: 'traps_like_lynx', @@ -239,7 +239,8 @@ export const COMPAT_FLAGS = [ // Blocks { key: 'no_early_push', - label: "Pushing blocks happens at move time", + label: "Pushing blocks happens at move time (block slapping is disabled)", + // XXX wait but the DEFAULT behavior allows block slapping, which lynx has, so why is lynx listed here? rulesets: new Set(['lynx', 'ms']), }, { key: 'use_legacy_hooking', @@ -272,7 +273,7 @@ export const COMPAT_FLAGS = [ // TODO what does ms do when a tank is on ice or a ff? wiki's description is wacky // TODO yellow tanks seem to have memory too?? key: 'tanks_always_obey_button', - label: "Blue tanks always obey blue buttons", + label: "Blue tanks on cloners obey blue buttons", rulesets: new Set(['steam-strict']), }, { key: 'tanks_ignore_button_while_moving', diff --git a/js/game.js b/js/game.js index 11f8f5a..2222daa 100644 --- a/js/game.js +++ b/js/game.js @@ -2017,12 +2017,6 @@ export class Level extends LevelInterface { tile.type.on_arrive(tile, this, actor); } - if (tile.type.on_stand && !actor.slide_ignores(tile.type.name)) { - // XXX according to notcc, cc2 also has actors "stand" on tiles immediately upon - // arrival, even though they'll do it anyway on their idle phase - tile.type.on_stand(tile, this, actor); - } - if (tile.type.slide_automatically) { // This keeps a player on force floor consistently using their sliding pose, even if // drawn between moves. It also simplifies checks elsewhere, so that's nice diff --git a/js/tiletypes.js b/js/tiletypes.js index 909b779..a8e4169 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -58,16 +58,16 @@ function _define_force_floor(direction, opposite_type) { speed_factor: 2, slide_automatically: true, allow_player_override: true, - on_stand(me, level, other) { - level.schedule_actor_slide(other, direction); - // FIXME i think it's really that in lynx these push on arrival; try that and see if - // it's better - /* - if (level.compat.force_floors_inert_on_first_tic && level.tic_counter === 0) { - // Lynx: Force floors don't push on the first tic - return null; + on_arrive(me, level, other) { + if (level.compat.force_floors_on_arrive) { + // Lynx: Force floors activate when stepped on, not when stood on + level.schedule_actor_slide(other, direction); + } + }, + on_stand(me, level, other) { + if (! level.compat.force_floors_on_arrive) { + level.schedule_actor_slide(other, direction); } - */ }, activate(me, level) { level.transmute_tile(me, opposite_type); @@ -985,21 +985,16 @@ const TILE_TYPES = { return (level.compat.rff_blocks_monsters && (other.type.collision_mask & COLLISION.monster_typical)); }, - on_stand(me, level, other) { - // XXX this check is necessary because of step_on_cell and then the idle phase causing - // us to be called twice. who is correct?? is the step_on_cell call supposed to be - // there? - if (! other.is_pending_slide) { + on_arrive(me, level, other) { + if (level.compat.force_floors_on_arrive) { + // Lynx: Force floors activate when stepped on, not when stood on level.schedule_actor_slide(other, level.get_force_floor_direction()); } - // FIXME i think it's really that in lynx these push on arrival; try that and see if - // it's better - /* - if (level.compat.force_floors_inert_on_first_tic && level.tic_counter === 0) { - // Lynx: Force floors don't push on the first tic - return null; + }, + on_stand(me, level, other) { + if (! level.compat.force_floors_on_arrive) { + level.schedule_actor_slide(other, level.get_force_floor_direction()); } - */ }, }, slime: {