Reveal popdown floors when there's an item on them, too

This commit is contained in:
Eevee (Evelyn Woods) 2021-01-08 15:01:30 -07:00
parent 67c53f97dd
commit 560fd93c8b
2 changed files with 13 additions and 3 deletions

View File

@ -163,6 +163,8 @@ export const CC2_TILESET_LAYOUT = {
hidden: [12, 5], hidden: [12, 5],
revealed: [13, 5], revealed: [13, 5],
}, },
// FIXME this should just be a visual_state really, but it would need to be able to nest with
// perception and that is not currently possible
popdown_floor_visible: [13, 5], popdown_floor_visible: [13, 5],
no_sign: [14, 5], no_sign: [14, 5],
frame_block: { frame_block: {

View File

@ -336,8 +336,15 @@ const TILE_TYPES = {
popdown_floor: { popdown_floor: {
layer: LAYERS.terrain, layer: LAYERS.terrain,
blocks_collision: COLLISION.block_cc1 | COLLISION.block_cc2, blocks_collision: COLLISION.block_cc1 | COLLISION.block_cc2,
// FIXME get rid of popdown_floor_visible and use visual_state for this, but requires some
// changes to the tileset stuff
on_ready(me, level) {
// Start out as a visible floor if there's an actor or item on us
if (me.cell.get_item() || me.cell.get_actor()) {
me.type = TILE_TYPES.popdown_floor_visible;
}
},
on_approach(me, level, other) { on_approach(me, level, other) {
// FIXME could probably do this with state? or, eh
level.transmute_tile(me, 'popdown_floor_visible'); level.transmute_tile(me, 'popdown_floor_visible');
}, },
}, },
@ -345,8 +352,9 @@ const TILE_TYPES = {
layer: LAYERS.terrain, layer: LAYERS.terrain,
blocks_collision: COLLISION.block_cc1 | COLLISION.block_cc2, blocks_collision: COLLISION.block_cc1 | COLLISION.block_cc2,
on_depart(me, level, other) { on_depart(me, level, other) {
// FIXME possibly changes back too fast, not even visible for a tic for me (much like stepping on a button oops) if (! me.cell.get_item()) {
level.transmute_tile(me, 'popdown_floor'); level.transmute_tile(me, 'popdown_floor');
}
}, },
}, },
no_player1_sign: { no_player1_sign: {