Make actors bonk on ice even if they weren't already sliding

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-29 10:16:10 -07:00
parent a32b29976e
commit 819a2e2203

View File

@ -923,11 +923,15 @@ export class Level extends LevelInterface {
if (! success) { if (! success) {
let terrain = actor.cell.get_terrain(); let terrain = actor.cell.get_terrain();
if (terrain && ( if (terrain && (
(terrain.type.slide_mode === 'ice' || terrain.type.name === 'force_floor_all') && // Actors bonk on ice even if they're not already sliding (whether because they
(actor.slide_mode && ! actor.ignores(terrain.type.name)) || // started on ice or dropped boots on ice)
// TODO weird cc2 quirk/bug: ghosts bonk on ice even though they don't slide on it // TODO weird cc2 quirk/bug: ghosts bonk on ice even though they don't slide on it
// FIXME and if they have cleats, they get stuck instead (?!) // FIXME and if they have cleats, they get stuck instead (?!)
(actor.type.name === 'ghost' && terrain.type.slide_mode === 'ice'))) (terrain.type.slide_mode === 'ice' && (
! actor.ignores(terrain.type.name) || actor.type.name === 'ghost')) ||
// But they only bonk on a force floor if it affects them
(terrain.type.name === 'force_floor_all' &&
actor.slide_mode && ! actor.ignores(terrain.type.name))))
{ {
// Turn the actor around (so ice corners bonk correctly), pretend they stepped on // Turn the actor around (so ice corners bonk correctly), pretend they stepped on
// the tile again (so RFFs roll again), and try moving again // the tile again (so RFFs roll again), and try moving again