Make fire block monsters; cleanup in prep for more CC2 nonsense

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-08 14:52:23 -06:00
parent 8097339886
commit 321641d8d8
3 changed files with 23 additions and 33 deletions

View File

@ -145,9 +145,6 @@ const TILE_ENCODING = {
// 0x50: Steel wall :
// 0x51: Time bomb : '#next'
// 0x52: Helmet : '#next'
// 0x53: (Unused) : '#direction', '#next'
// 0x54: (Unused) :
// 0x55: (Unused) :
// 0x56: Melinda : '#direction', '#next'
// 0x57: Timid teeth : '#direction', '#next'
// 0x58: Explosion animation (unused in main levels) : '#direction', '#next'
@ -155,7 +152,6 @@ const TILE_ENCODING = {
// 0x5a: Male-only sign :
// 0x5b: Female-only sign :
// 0x5c: Inverter gate (N) : Modifier allows other gates, see below
// 0x5d: (Unused) : '#direction', '#next'
// 0x5e: Logic switch (ON) :
// 0x5f: Flame jet (OFF) :
// 0x60: Flame jet (ON) :
@ -165,25 +161,19 @@ const TILE_ENCODING = {
// 0x64: Yellow tank button :
// 0x65: Mirror Chip : '#direction', '#next'
// 0x66: Mirror Melinda : '#direction', '#next'
// 0x67: (Unused) :
// 0x68: Bowling ball : '#next'
// 0x69: Rover : '#direction', '#next'
// 0x6a: Time penalty : '#next'
0x6b: ['#mod8?', ['floor_custom_green', 'floor_custom_pink', 'floor_custom_yellow', 'floor_custom_blue']],
// 0x6c: (Unused) :
0x6d: ['#thinwall/canopy', '#next'],
// 0x6e: (Unused) :
// 0x6f: Railroad sign : '#next'
0x70: ['#mod8?', ['wall_custom_green', 'wall_custom_pink', 'wall_custom_yellow', 'wall_custom_blue']],
0x71: ['#mod8', 'floor_letter'],
// 0x72: Purple toggle wall :
// 0x73: Purple toggle floor :
// 0x74: (Unused) :
// 0x75: (Unused) :
0x76: ['#mod8', '#next'],
// 0x77: 16-bit Modifier (see Modifier section below) : 2 modifier bytes, Tile Specification for affected tile
// 0x78: 32-bit Modifier (see Modifier section below) : 4 modifier bytes, Tile Specification for affected tile
// 0x79: (Unused) : '#direction', '#next'
0x7a: ['score_10', '#next'],
0x7b: ['score_100', '#next'],
0x7c: ['score_1000', '#next'],
@ -195,8 +185,6 @@ const TILE_ENCODING = {
// 0x82: Floor mimic : '#direction', '#next'
0x83: ['green_bomb', '#next'],
0x84: ['green_chip', '#next'],
// 0x85: (Unused) : '#next'
// 0x86: (Unused) : '#next'
// 0x87: Black button :
// 0x88: ON/OFF switch (OFF) :
// 0x89: ON/OFF switch (ON) :
@ -207,7 +195,6 @@ const TILE_ENCODING = {
// 0x8e: Secret eye : '#next'
// 0x8f: Thief bribe : '#next'
// 0x90: Speed boots : '#next'
// 0x91: (Unused) :
// 0x92: Hook : '#next'
};

View File

@ -52,7 +52,7 @@ class Tile {
}
blocks(other, direction) {
if (this.type.blocks)
if (this.type.blocks_all)
return true;
if (this.type.thin_walls &&
@ -568,6 +568,8 @@ class Level {
speed /= 2;
}
if (actor.ignores(tile.type.name))
continue;
if (! tile.blocks(actor, direction))
continue;

View File

@ -32,32 +32,32 @@ const TILE_TYPES = {
},
wall: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
},
wall_custom_green: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
},
wall_custom_pink: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
},
wall_custom_yellow: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
},
wall_custom_blue: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
},
wall_invisible: {
draw_layer: LAYER_TERRAIN,
// TODO cc2 seems to make these flicker briefly
blocks: true,
blocks_all: true,
},
wall_appearing: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
level.transmute_tile(me, 'wall');
},
@ -93,14 +93,14 @@ const TILE_TYPES = {
},
fake_wall: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
level.transmute_tile(me, 'wall');
},
},
fake_floor: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
level.transmute_tile(me, 'floor');
},
@ -169,7 +169,7 @@ const TILE_TYPES = {
// Locked doors
door_red: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
if (other.type.has_inventory && other.take_item('key_red')) {
level.transmute_tile(me, 'floor');
@ -178,7 +178,7 @@ const TILE_TYPES = {
},
door_blue: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
if (other.type.has_inventory && other.take_item('key_blue')) {
level.transmute_tile(me, 'floor');
@ -187,7 +187,7 @@ const TILE_TYPES = {
},
door_yellow: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
if (other.type.has_inventory && other.take_item('key_yellow')) {
level.transmute_tile(me, 'floor');
@ -196,7 +196,7 @@ const TILE_TYPES = {
},
door_green: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
if (other.type.has_inventory && other.take_item('key_green')) {
level.transmute_tile(me, 'floor');
@ -222,6 +222,7 @@ const TILE_TYPES = {
// Hazards
fire: {
draw_layer: LAYER_TERRAIN,
blocks_monsters: true,
on_arrive(me, level, other) {
if (other.type.name === 'ice_block') {
level.remove_tile(other);
@ -398,7 +399,7 @@ const TILE_TYPES = {
// Mechanisms
dirt_block: {
draw_layer: LAYER_ACTOR,
blocks: true,
blocks_all: true,
is_actor: true,
is_block: true,
ignores: new Set(['fire']),
@ -407,7 +408,7 @@ const TILE_TYPES = {
clone_block: {
draw_layer: LAYER_ACTOR,
// TODO is this in any way distinct from dirt block
blocks: true,
blocks_all: true,
is_actor: true,
is_block: true,
ignores: new Set(['fire']),
@ -415,7 +416,7 @@ const TILE_TYPES = {
},
ice_block: {
draw_layer: LAYER_ACTOR,
blocks: true,
blocks_all: true,
is_actor: true,
is_block: true,
movement_speed: 4,
@ -428,7 +429,7 @@ const TILE_TYPES = {
},
green_wall: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
},
green_chip: {
draw_layer: LAYER_ITEM,
@ -456,7 +457,7 @@ const TILE_TYPES = {
},
cloner: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
activate(me, level) {
let cell = me.cell;
// Copy, so we don't end up repeatedly cloning the same object
@ -783,7 +784,7 @@ const TILE_TYPES = {
},
socket: {
draw_layer: LAYER_TERRAIN,
blocks: true,
blocks_all: true,
on_bump(me, level, other) {
if (other.type.is_player && level.chips_remaining === 0) {
level.transmute_tile(me, 'floor');