Make ghosts with fire boots erase fire and blobs not move between canopies
This commit is contained in:
parent
151f66a0fb
commit
42dd4b9ce6
@ -1372,6 +1372,13 @@ export class Level extends LevelInterface {
|
|||||||
// Also reset slide here, since slide mode is differently important for forced moves
|
// Also reset slide here, since slide mode is differently important for forced moves
|
||||||
this.make_slide(actor, null);
|
this.make_slide(actor, null);
|
||||||
|
|
||||||
|
// Let the actor perform any weird behavior of its own; note that this does NOT respect
|
||||||
|
// 'ignores' since it passes the whole cell in, which is good because ghosts use this to
|
||||||
|
// stamp out fire and dirt
|
||||||
|
if (actor.type.on_step_on) {
|
||||||
|
actor.type.on_step_on(actor, this, cell);
|
||||||
|
}
|
||||||
|
|
||||||
// Step on topmost things first -- notably, it's safe to step on water with flippers on top
|
// Step on topmost things first -- notably, it's safe to step on water with flippers on top
|
||||||
for (let tile of Array.from(cell).reverse()) {
|
for (let tile of Array.from(cell).reverse()) {
|
||||||
if (tile === actor)
|
if (tile === actor)
|
||||||
|
|||||||
@ -135,12 +135,6 @@ 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,
|
||||||
@ -321,8 +315,12 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
canopy: {
|
canopy: {
|
||||||
draw_layer: DRAW_LAYERS.overlay,
|
draw_layer: DRAW_LAYERS.overlay,
|
||||||
// TODO augh, blobs will specifically not move from one canopy to another
|
|
||||||
blocks_collision: COLLISION.bug | COLLISION.rover,
|
blocks_collision: COLLISION.bug | COLLISION.rover,
|
||||||
|
blocks(me, level, other, direction) {
|
||||||
|
// Blobs will specifically not move from one canopy to another
|
||||||
|
if (other.type.name === 'blob' && other.cell.has('canopy'))
|
||||||
|
return true;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Swivel doors
|
// Swivel doors
|
||||||
@ -612,12 +610,6 @@ const TILE_TYPES = {
|
|||||||
else if (other.type.is_real_player) {
|
else if (other.type.is_real_player) {
|
||||||
level.fail('burned');
|
level.fail('burned');
|
||||||
}
|
}
|
||||||
else if (other.type.name === 'ghost') {
|
|
||||||
if (other.has_item('fire_boots')) {
|
|
||||||
// ?????
|
|
||||||
level.transmute_tile(me, 'floor');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
level.remove_tile(other);
|
level.remove_tile(other);
|
||||||
}
|
}
|
||||||
@ -1873,7 +1865,19 @@ const TILE_TYPES = {
|
|||||||
decide_movement(me, level) {
|
decide_movement(me, level) {
|
||||||
// move completely at random
|
// move completely at random
|
||||||
let modifier = level.get_blob_modifier();
|
let modifier = level.get_blob_modifier();
|
||||||
return [['north', 'east', 'south', 'west'][(level.prng() + modifier) % 4]];
|
return [DIRECTION_ORDER[(level.prng() + modifier) % 4]];
|
||||||
|
},
|
||||||
|
on_step_on(me, level, cell) {
|
||||||
|
let terrain = cell.get_terrain();
|
||||||
|
if (! terrain)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (terrain.type.name === 'floor') {
|
||||||
|
// Blobs spread slime onto floor
|
||||||
|
if (me.previous_cell && me.previous_cell.has('slime')) {
|
||||||
|
level.transmute_tile(terrain, 'slime');
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
teeth: {
|
teeth: {
|
||||||
@ -1968,6 +1972,18 @@ const TILE_TYPES = {
|
|||||||
let d = DIRECTIONS[me.direction];
|
let d = DIRECTIONS[me.direction];
|
||||||
return [me.direction, d.left, d.right, d.opposite];
|
return [me.direction, d.left, d.right, d.opposite];
|
||||||
},
|
},
|
||||||
|
on_step_on(me, level, cell) {
|
||||||
|
let terrain = cell.get_terrain();
|
||||||
|
if (! terrain)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (terrain.type.name === 'fire') {
|
||||||
|
// Ghosts with fire boots erase fire
|
||||||
|
if (me.has_item('fire_boots')) {
|
||||||
|
level.transmute_tile(terrain, 'floor');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
floor_mimic: {
|
floor_mimic: {
|
||||||
draw_layer: DRAW_LAYERS.actor,
|
draw_layer: DRAW_LAYERS.actor,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user