Make blobs spread slime onto floor

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-21 00:05:12 -07:00
parent b0aeee6ff0
commit 151f66a0fb
2 changed files with 7 additions and 1 deletions

View File

@ -195,7 +195,7 @@ export class Cell extends Array {
} }
has(name) { has(name) {
return this.some(tile => tile.name === name); return this.some(tile => tile.type.name === name);
} }
try_leaving(actor, direction) { try_leaving(actor, direction) {

View File

@ -135,6 +135,12 @@ const TILE_TYPES = {
// Floors and walls // Floors and walls
floor: { floor: {
draw_layer: DRAW_LAYERS.terrain, draw_layer: DRAW_LAYERS.terrain,
on_arrive(me, level, other) {
if (other.type.name === 'blob' && other.previous_cell && other.previous_cell.has('slime')) {
// Blobs spread slime onto floor
level.transmute_tile(me, 'slime');
}
},
}, },
floor_letter: { floor_letter: {
draw_layer: DRAW_LAYERS.terrain, draw_layer: DRAW_LAYERS.terrain,