Make hook load, canopy work, and force floors reverse with gray button

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-03 17:48:24 -07:00
parent 411005eaa6
commit 0885bfc9d2
3 changed files with 23 additions and 4 deletions

View File

@ -672,10 +672,9 @@ const TILE_ENCODING = {
name: 'speed_boots',
has_next: true,
},
0x91: {
0x92: {
name: 'hook',
has_next: true,
error: "The hook is not yet implemented, sorry!",
},
};
const REVERSE_TILE_ENCODING = {};

View File

@ -105,7 +105,8 @@ export const CC2_TILESET_LAYOUT = {
chip: [11, 3],
bribe: [12, 3],
speed_boots: [13, 3],
// canopy, xray
canopy: [14, 3],
// canopy xray
// TODO lit
dynamite: [0, 4],
@ -552,6 +553,7 @@ export const CC2_TILESET_LAYOUT = {
dirt: [4, 31],
no_player2_sign: [5, 31],
no_player1_sign: [6, 31],
hook: [7, 31],
// misc other stuff
};
@ -848,7 +850,7 @@ export class Tileset {
_draw_letter(drawspec, tile, tic, blit) {
this._draw_standard(drawspec.base, tile, tic, blit);
let glyph = tile.overlaid_glyph;
let glyph = tile ? tile.overlaid_glyph : "?";
if (drawspec.letter_glyphs[glyph]) {
let [x, y] = drawspec.letter_glyphs[glyph];
// XXX size is hardcoded here, but not below, meh

View File

@ -640,6 +640,9 @@ const TILE_TYPES = {
on_arrive(me, level, other) {
level.set_actor_direction(other, 'north');
},
on_gray_button(me, level) {
level.transmute_tile(me, 'force_floor_s');
},
},
force_floor_e: {
draw_layer: DRAW_LAYERS.terrain,
@ -648,6 +651,9 @@ const TILE_TYPES = {
on_arrive(me, level, other) {
level.set_actor_direction(other, 'east');
},
on_gray_button(me, level) {
level.transmute_tile(me, 'force_floor_w');
},
},
force_floor_s: {
draw_layer: DRAW_LAYERS.terrain,
@ -656,6 +662,9 @@ const TILE_TYPES = {
on_arrive(me, level, other) {
level.set_actor_direction(other, 'south');
},
on_gray_button(me, level) {
level.transmute_tile(me, 'force_floor_n');
},
},
force_floor_w: {
draw_layer: DRAW_LAYERS.terrain,
@ -664,6 +673,9 @@ const TILE_TYPES = {
on_arrive(me, level, other) {
level.set_actor_direction(other, 'west');
},
on_gray_button(me, level) {
level.transmute_tile(me, 'force_floor_e');
},
},
force_floor_all: {
draw_layer: DRAW_LAYERS.terrain,
@ -1710,6 +1722,12 @@ const TILE_TYPES = {
is_tool: true,
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid,
},
hook: {
draw_layer: DRAW_LAYERS.item,
is_item: true,
is_tool: true,
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid,
},
// Progression
player: {