Allow only players, ice blocks, directional blocks, and rovers to reveal walls

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-15 00:32:24 -06:00
parent 6d26362cb0
commit 325960b609
2 changed files with 16 additions and 3 deletions

View File

@ -790,6 +790,7 @@ const EDITOR_PALETTE = [{
tiles: [ tiles: [
'bomb', 'bomb',
'dirt_block', 'dirt_block',
'ice_block',
'button_blue', 'button_blue',
'button_red', 'cloner', 'button_red', 'cloner',
'button_brown', 'trap', 'button_brown', 'trap',

View File

@ -65,7 +65,9 @@ const TILE_TYPES = {
draw_layer: LAYER_TERRAIN, draw_layer: LAYER_TERRAIN,
blocks_all: true, blocks_all: true,
on_bump(me, level, other) { on_bump(me, level, other) {
level.transmute_tile(me, 'wall'); if (other.type.can_reveal_walls) {
level.transmute_tile(me, 'wall');
}
}, },
}, },
popwall: { popwall: {
@ -101,14 +103,18 @@ const TILE_TYPES = {
draw_layer: LAYER_TERRAIN, draw_layer: LAYER_TERRAIN,
blocks_all: true, blocks_all: true,
on_bump(me, level, other) { on_bump(me, level, other) {
level.transmute_tile(me, 'wall'); if (other.type.can_reveal_walls) {
level.transmute_tile(me, 'wall');
}
}, },
}, },
fake_floor: { fake_floor: {
draw_layer: LAYER_TERRAIN, draw_layer: LAYER_TERRAIN,
blocks_all: true, blocks_all: true,
on_bump(me, level, other) { on_bump(me, level, other) {
level.transmute_tile(me, 'floor'); if (other.type.can_reveal_walls) {
level.transmute_tile(me, 'floor');
}
}, },
}, },
popdown_wall: { popdown_wall: {
@ -506,6 +512,7 @@ const TILE_TYPES = {
blocks_all: true, blocks_all: true,
is_actor: true, is_actor: true,
is_block: true, is_block: true,
can_reveal_walls: true,
movement_speed: 4, movement_speed: 4,
pushes: { pushes: {
ice_block: true, ice_block: true,
@ -521,6 +528,7 @@ const TILE_TYPES = {
blocks_all: true, blocks_all: true,
is_actor: true, is_actor: true,
is_block: true, is_block: true,
can_reveal_walls: true,
load(me, template) { load(me, template) {
me.arrows = template.directional_block_arrows; me.arrows = template.directional_block_arrows;
}, },
@ -956,11 +964,13 @@ const TILE_TYPES = {
}, },
rover: { rover: {
// TODO this guy is a nightmare // TODO this guy is a nightmare
// TODO pushes blocks apparently??
draw_layer: LAYER_ACTOR, draw_layer: LAYER_ACTOR,
is_actor: true, is_actor: true,
is_monster: true, is_monster: true,
blocks_monsters: true, blocks_monsters: true,
blocks_blocks: true, blocks_blocks: true,
can_reveal_walls: true,
movement_mode: 'random', movement_mode: 'random',
movement_speed: 4, movement_speed: 4,
}, },
@ -1095,6 +1105,7 @@ const TILE_TYPES = {
is_actor: true, is_actor: true,
is_player: true, is_player: true,
has_inventory: true, has_inventory: true,
can_reveal_walls: true,
movement_speed: 4, movement_speed: 4,
pushes: { pushes: {
dirt_block: true, dirt_block: true,
@ -1111,6 +1122,7 @@ const TILE_TYPES = {
is_actor: true, is_actor: true,
is_player: true, is_player: true,
has_inventory: true, has_inventory: true,
can_reveal_walls: true,
movement_speed: 4, movement_speed: 4,
ignores: new Set(['ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se']), ignores: new Set(['ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se']),
pushes: { pushes: {