Make blobs spread slime onto floor
This commit is contained in:
parent
b0aeee6ff0
commit
151f66a0fb
@ -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) {
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user