Attempt, unsuccessfully, to implement ice block melting

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-14 17:07:35 -07:00
parent efd25294ac
commit c34aaadf06
2 changed files with 13 additions and 0 deletions

View File

@ -1025,6 +1025,7 @@ export class Level {
// Bump tiles that we're even attempting to move into; this mostly reveals // Bump tiles that we're even attempting to move into; this mostly reveals
// invisible walls, blue floors, etc. // invisible walls, blue floors, etc.
// XXX how to guarantee this only happens once...
if (tile.type.on_bump) { if (tile.type.on_bump) {
tile.type.on_bump(tile, this, actor); tile.type.on_bump(tile, this, actor);
} }

View File

@ -892,6 +892,18 @@ const TILE_TYPES = {
ice_block: true, ice_block: true,
frame_block: true, frame_block: true,
}, },
on_bump(me, level, other) {
// Fireballs melt ice blocks on regular floor
// XXX what if i'm in motion?
if (other.type.name === 'fireball') {
let terrain = me.cell.get_terrain();
if (terrain.type.name === 'floor') {
level.remove_tile(me);
level.transmute_tile(terrain, 'water');
// FIXME splash?
}
}
},
}, },
frame_block: { frame_block: {
// TODO directional, obviously // TODO directional, obviously