Make blobs spread slime onto floor

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

No files matched your search

+1 -1
View File
@@ -195,7 +195,7 @@ export class Cell extends Array {
}
has(name) {
return this.some(tile => tile.name === name);
return this.some(tile => tile.type.name === name);
}
try_leaving(actor, direction) {
+6
View File
@@ -135,6 +135,12 @@ const TILE_TYPES = {
// Floors and walls
floor: {
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: {
draw_layer: DRAW_LAYERS.terrain,