Don't use "ignores" to override blocking; it breaks ice corners
This commit is contained in:
parent
16f87bf6e0
commit
582a875c52
21
js/game.js
21
js/game.js
@ -138,7 +138,6 @@ export class Cell extends Array {
|
||||
blocks_entering(actor, direction, level, ignore_pushables = false) {
|
||||
for (let tile of this) {
|
||||
if (tile.blocks(actor, direction, level) &&
|
||||
! actor.ignores(tile.type.name) &&
|
||||
! (ignore_pushables && actor.can_push(tile)))
|
||||
{
|
||||
return true;
|
||||
@ -660,6 +659,16 @@ export class Level {
|
||||
let has_slide_tile = false;
|
||||
let blocked_by_pushable = false;
|
||||
for (let tile of goal_cell) {
|
||||
if (tile.blocks(actor, direction, this)) {
|
||||
if (actor.can_push(tile)) {
|
||||
blocked_by_pushable = true;
|
||||
}
|
||||
else {
|
||||
blocked = true;
|
||||
// Don't break here, because we might still want to bump other tiles
|
||||
}
|
||||
}
|
||||
|
||||
if (actor.ignores(tile.type.name))
|
||||
continue;
|
||||
|
||||
@ -672,16 +681,6 @@ export class Level {
|
||||
if (tile.type.on_bump) {
|
||||
tile.type.on_bump(tile, this, actor);
|
||||
}
|
||||
|
||||
if (tile.blocks(actor, direction, this)) {
|
||||
if (actor.can_push(tile)) {
|
||||
blocked_by_pushable = true;
|
||||
}
|
||||
else {
|
||||
blocked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (has_slide_tile) {
|
||||
|
||||
@ -939,7 +939,6 @@ const TILE_TYPES = {
|
||||
blocks_blocks: true,
|
||||
movement_mode: 'turn-right',
|
||||
movement_speed: 4,
|
||||
ignores: new Set(['wall']),
|
||||
// TODO ignores /most/ walls. collision is basically completely different. has a regular inventory, except red key. good grief
|
||||
},
|
||||
floor_mimic: {
|
||||
@ -1079,6 +1078,7 @@ const TILE_TYPES = {
|
||||
is_tool: true,
|
||||
blocks_monsters: true,
|
||||
blocks_blocks: true,
|
||||
// FIXME this doesn't work any more, need to put it in railroad blocks impl
|
||||
item_ignores: new Set(['railroad']),
|
||||
},
|
||||
foil: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user