refactor speed shoes so they stack with dash floor/sand instead of overriding
This commit is contained in:
parent
e0004fb840
commit
b7cedc2426
11
js/game.js
11
js/game.js
@ -1567,12 +1567,15 @@ export class Level extends LevelInterface {
|
||||
// FIXME this feels clunky
|
||||
let goal_cell = this.get_neighboring_cell(actor.cell, direction);
|
||||
let terrain = goal_cell.get_terrain();
|
||||
if (actor.has_item('speed_boots')) {
|
||||
speed /= 2;
|
||||
}
|
||||
else if (terrain && terrain.type.speed_factor && ! actor.ignores(terrain.type.name) && !actor.slide_ignores(terrain.type.name)) {
|
||||
if (terrain && terrain.type.speed_factor && ! actor.ignores(terrain.type.name) && !actor.slide_ignores(terrain.type.name)) {
|
||||
speed /= terrain.type.speed_factor;
|
||||
}
|
||||
//speed boots speed us up UNLESS we're on terrain that speeds us up AND it has a slide mode AND we're sliding (so e.g. we gain 2x on teleports, ice + ice skates, force floors + suction boots, sand and dash floors, but we don't gain 2x sliding on ice or force floors unless it's the turn we're leaving them)
|
||||
if (actor.has_item('speed_boots')
|
||||
&& !(terrain.type.speed_factor && terrain.type.slide_mode && actor.slide_mode === terrain.type.slide_mode))
|
||||
{
|
||||
speed /= 2;
|
||||
}
|
||||
|
||||
let orig_cell = actor.cell;
|
||||
this._set_tile_prop(actor, 'previous_cell', orig_cell);
|
||||
|
||||
@ -2250,7 +2250,7 @@ const EDITOR_TILE_DESCRIPTIONS = {
|
||||
},
|
||||
dash_floor: {
|
||||
name: "Dash Floor",
|
||||
desc: "Anything walking on it moves at double speed.",
|
||||
desc: "Anything walking on it moves at double speed. Stacks with speed shoes!",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user