Make fire block monsters; cleanup in prep for more CC2 nonsense
This commit is contained in:
parent
8097339886
commit
321641d8d8
@ -145,9 +145,6 @@ const TILE_ENCODING = {
|
|||||||
// 0x50: Steel wall :
|
// 0x50: Steel wall :
|
||||||
// 0x51: Time bomb : '#next'
|
// 0x51: Time bomb : '#next'
|
||||||
// 0x52: Helmet : '#next'
|
// 0x52: Helmet : '#next'
|
||||||
// 0x53: (Unused) : '#direction', '#next'
|
|
||||||
// 0x54: (Unused) :
|
|
||||||
// 0x55: (Unused) :
|
|
||||||
// 0x56: Melinda : '#direction', '#next'
|
// 0x56: Melinda : '#direction', '#next'
|
||||||
// 0x57: Timid teeth : '#direction', '#next'
|
// 0x57: Timid teeth : '#direction', '#next'
|
||||||
// 0x58: Explosion animation (unused in main levels) : '#direction', '#next'
|
// 0x58: Explosion animation (unused in main levels) : '#direction', '#next'
|
||||||
@ -155,7 +152,6 @@ const TILE_ENCODING = {
|
|||||||
// 0x5a: Male-only sign :
|
// 0x5a: Male-only sign :
|
||||||
// 0x5b: Female-only sign :
|
// 0x5b: Female-only sign :
|
||||||
// 0x5c: Inverter gate (N) : Modifier allows other gates, see below
|
// 0x5c: Inverter gate (N) : Modifier allows other gates, see below
|
||||||
// 0x5d: (Unused) : '#direction', '#next'
|
|
||||||
// 0x5e: Logic switch (ON) :
|
// 0x5e: Logic switch (ON) :
|
||||||
// 0x5f: Flame jet (OFF) :
|
// 0x5f: Flame jet (OFF) :
|
||||||
// 0x60: Flame jet (ON) :
|
// 0x60: Flame jet (ON) :
|
||||||
@ -165,25 +161,19 @@ const TILE_ENCODING = {
|
|||||||
// 0x64: Yellow tank button :
|
// 0x64: Yellow tank button :
|
||||||
// 0x65: Mirror Chip : '#direction', '#next'
|
// 0x65: Mirror Chip : '#direction', '#next'
|
||||||
// 0x66: Mirror Melinda : '#direction', '#next'
|
// 0x66: Mirror Melinda : '#direction', '#next'
|
||||||
// 0x67: (Unused) :
|
|
||||||
// 0x68: Bowling ball : '#next'
|
// 0x68: Bowling ball : '#next'
|
||||||
// 0x69: Rover : '#direction', '#next'
|
// 0x69: Rover : '#direction', '#next'
|
||||||
// 0x6a: Time penalty : '#next'
|
// 0x6a: Time penalty : '#next'
|
||||||
0x6b: ['#mod8?', ['floor_custom_green', 'floor_custom_pink', 'floor_custom_yellow', 'floor_custom_blue']],
|
0x6b: ['#mod8?', ['floor_custom_green', 'floor_custom_pink', 'floor_custom_yellow', 'floor_custom_blue']],
|
||||||
// 0x6c: (Unused) :
|
|
||||||
0x6d: ['#thinwall/canopy', '#next'],
|
0x6d: ['#thinwall/canopy', '#next'],
|
||||||
// 0x6e: (Unused) :
|
|
||||||
// 0x6f: Railroad sign : '#next'
|
// 0x6f: Railroad sign : '#next'
|
||||||
0x70: ['#mod8?', ['wall_custom_green', 'wall_custom_pink', 'wall_custom_yellow', 'wall_custom_blue']],
|
0x70: ['#mod8?', ['wall_custom_green', 'wall_custom_pink', 'wall_custom_yellow', 'wall_custom_blue']],
|
||||||
0x71: ['#mod8', 'floor_letter'],
|
0x71: ['#mod8', 'floor_letter'],
|
||||||
// 0x72: Purple toggle wall :
|
// 0x72: Purple toggle wall :
|
||||||
// 0x73: Purple toggle floor :
|
// 0x73: Purple toggle floor :
|
||||||
// 0x74: (Unused) :
|
|
||||||
// 0x75: (Unused) :
|
|
||||||
0x76: ['#mod8', '#next'],
|
0x76: ['#mod8', '#next'],
|
||||||
// 0x77: 16-bit Modifier (see Modifier section below) : 2 modifier bytes, Tile Specification for affected tile
|
// 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
|
// 0x78: 32-bit Modifier (see Modifier section below) : 4 modifier bytes, Tile Specification for affected tile
|
||||||
// 0x79: (Unused) : '#direction', '#next'
|
|
||||||
0x7a: ['score_10', '#next'],
|
0x7a: ['score_10', '#next'],
|
||||||
0x7b: ['score_100', '#next'],
|
0x7b: ['score_100', '#next'],
|
||||||
0x7c: ['score_1000', '#next'],
|
0x7c: ['score_1000', '#next'],
|
||||||
@ -195,8 +185,6 @@ const TILE_ENCODING = {
|
|||||||
// 0x82: Floor mimic : '#direction', '#next'
|
// 0x82: Floor mimic : '#direction', '#next'
|
||||||
0x83: ['green_bomb', '#next'],
|
0x83: ['green_bomb', '#next'],
|
||||||
0x84: ['green_chip', '#next'],
|
0x84: ['green_chip', '#next'],
|
||||||
// 0x85: (Unused) : '#next'
|
|
||||||
// 0x86: (Unused) : '#next'
|
|
||||||
// 0x87: Black button :
|
// 0x87: Black button :
|
||||||
// 0x88: ON/OFF switch (OFF) :
|
// 0x88: ON/OFF switch (OFF) :
|
||||||
// 0x89: ON/OFF switch (ON) :
|
// 0x89: ON/OFF switch (ON) :
|
||||||
@ -207,7 +195,6 @@ const TILE_ENCODING = {
|
|||||||
// 0x8e: Secret eye : '#next'
|
// 0x8e: Secret eye : '#next'
|
||||||
// 0x8f: Thief bribe : '#next'
|
// 0x8f: Thief bribe : '#next'
|
||||||
// 0x90: Speed boots : '#next'
|
// 0x90: Speed boots : '#next'
|
||||||
// 0x91: (Unused) :
|
|
||||||
// 0x92: Hook : '#next'
|
// 0x92: Hook : '#next'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
blocks(other, direction) {
|
blocks(other, direction) {
|
||||||
if (this.type.blocks)
|
if (this.type.blocks_all)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.type.thin_walls &&
|
if (this.type.thin_walls &&
|
||||||
@ -568,6 +568,8 @@ class Level {
|
|||||||
speed /= 2;
|
speed /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actor.ignores(tile.type.name))
|
||||||
|
continue;
|
||||||
if (! tile.blocks(actor, direction))
|
if (! tile.blocks(actor, direction))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@ -32,32 +32,32 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
wall: {
|
wall: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
wall_custom_green: {
|
wall_custom_green: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
wall_custom_pink: {
|
wall_custom_pink: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
wall_custom_yellow: {
|
wall_custom_yellow: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
wall_custom_blue: {
|
wall_custom_blue: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
wall_invisible: {
|
wall_invisible: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
// TODO cc2 seems to make these flicker briefly
|
// TODO cc2 seems to make these flicker briefly
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
wall_appearing: {
|
wall_appearing: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
level.transmute_tile(me, 'wall');
|
level.transmute_tile(me, 'wall');
|
||||||
},
|
},
|
||||||
@ -93,14 +93,14 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
fake_wall: {
|
fake_wall: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
level.transmute_tile(me, 'wall');
|
level.transmute_tile(me, 'wall');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fake_floor: {
|
fake_floor: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
level.transmute_tile(me, 'floor');
|
level.transmute_tile(me, 'floor');
|
||||||
},
|
},
|
||||||
@ -169,7 +169,7 @@ const TILE_TYPES = {
|
|||||||
// Locked doors
|
// Locked doors
|
||||||
door_red: {
|
door_red: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
if (other.type.has_inventory && other.take_item('key_red')) {
|
if (other.type.has_inventory && other.take_item('key_red')) {
|
||||||
level.transmute_tile(me, 'floor');
|
level.transmute_tile(me, 'floor');
|
||||||
@ -178,7 +178,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
door_blue: {
|
door_blue: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
if (other.type.has_inventory && other.take_item('key_blue')) {
|
if (other.type.has_inventory && other.take_item('key_blue')) {
|
||||||
level.transmute_tile(me, 'floor');
|
level.transmute_tile(me, 'floor');
|
||||||
@ -187,7 +187,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
door_yellow: {
|
door_yellow: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
if (other.type.has_inventory && other.take_item('key_yellow')) {
|
if (other.type.has_inventory && other.take_item('key_yellow')) {
|
||||||
level.transmute_tile(me, 'floor');
|
level.transmute_tile(me, 'floor');
|
||||||
@ -196,7 +196,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
door_green: {
|
door_green: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
if (other.type.has_inventory && other.take_item('key_green')) {
|
if (other.type.has_inventory && other.take_item('key_green')) {
|
||||||
level.transmute_tile(me, 'floor');
|
level.transmute_tile(me, 'floor');
|
||||||
@ -222,6 +222,7 @@ const TILE_TYPES = {
|
|||||||
// Hazards
|
// Hazards
|
||||||
fire: {
|
fire: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
|
blocks_monsters: true,
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
if (other.type.name === 'ice_block') {
|
if (other.type.name === 'ice_block') {
|
||||||
level.remove_tile(other);
|
level.remove_tile(other);
|
||||||
@ -398,7 +399,7 @@ const TILE_TYPES = {
|
|||||||
// Mechanisms
|
// Mechanisms
|
||||||
dirt_block: {
|
dirt_block: {
|
||||||
draw_layer: LAYER_ACTOR,
|
draw_layer: LAYER_ACTOR,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
is_actor: true,
|
is_actor: true,
|
||||||
is_block: true,
|
is_block: true,
|
||||||
ignores: new Set(['fire']),
|
ignores: new Set(['fire']),
|
||||||
@ -407,7 +408,7 @@ const TILE_TYPES = {
|
|||||||
clone_block: {
|
clone_block: {
|
||||||
draw_layer: LAYER_ACTOR,
|
draw_layer: LAYER_ACTOR,
|
||||||
// TODO is this in any way distinct from dirt block
|
// TODO is this in any way distinct from dirt block
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
is_actor: true,
|
is_actor: true,
|
||||||
is_block: true,
|
is_block: true,
|
||||||
ignores: new Set(['fire']),
|
ignores: new Set(['fire']),
|
||||||
@ -415,7 +416,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
ice_block: {
|
ice_block: {
|
||||||
draw_layer: LAYER_ACTOR,
|
draw_layer: LAYER_ACTOR,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
is_actor: true,
|
is_actor: true,
|
||||||
is_block: true,
|
is_block: true,
|
||||||
movement_speed: 4,
|
movement_speed: 4,
|
||||||
@ -428,7 +429,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
green_wall: {
|
green_wall: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
},
|
},
|
||||||
green_chip: {
|
green_chip: {
|
||||||
draw_layer: LAYER_ITEM,
|
draw_layer: LAYER_ITEM,
|
||||||
@ -456,7 +457,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
cloner: {
|
cloner: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
activate(me, level) {
|
activate(me, level) {
|
||||||
let cell = me.cell;
|
let cell = me.cell;
|
||||||
// Copy, so we don't end up repeatedly cloning the same object
|
// Copy, so we don't end up repeatedly cloning the same object
|
||||||
@ -783,7 +784,7 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
socket: {
|
socket: {
|
||||||
draw_layer: LAYER_TERRAIN,
|
draw_layer: LAYER_TERRAIN,
|
||||||
blocks: true,
|
blocks_all: true,
|
||||||
on_bump(me, level, other) {
|
on_bump(me, level, other) {
|
||||||
if (other.type.is_player && level.chips_remaining === 0) {
|
if (other.type.is_player && level.chips_remaining === 0) {
|
||||||
level.transmute_tile(me, 'floor');
|
level.transmute_tile(me, 'floor');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user