Attempt, unsuccessfully, to implement ice block melting
This commit is contained in:
parent
efd25294ac
commit
c34aaadf06
@ -1025,6 +1025,7 @@ export class Level {
|
||||
|
||||
// Bump tiles that we're even attempting to move into; this mostly reveals
|
||||
// invisible walls, blue floors, etc.
|
||||
// XXX how to guarantee this only happens once...
|
||||
if (tile.type.on_bump) {
|
||||
tile.type.on_bump(tile, this, actor);
|
||||
}
|
||||
|
||||
@ -892,6 +892,18 @@ const TILE_TYPES = {
|
||||
ice_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: {
|
||||
// TODO directional, obviously
|
||||
|
||||
Loading…
Reference in New Issue
Block a user