New LL tile: circuit block, which overrides any wiring below it

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-09 20:23:27 -07:00
parent 235cc79e8b
commit b2ff27f241
3 changed files with 29 additions and 2 deletions

View File

@ -753,9 +753,9 @@ class WireOperation extends DrawOperation {
}
let cell = this.cell(x, y);
for (let tile of cell) {
for (let tile of Array.from(cell).reverse()) {
// TODO probably a better way to do this
if (['floor', 'steel', 'button_pink', 'button_black', 'teleport_blue', 'teleport_red', 'light_switch_on', 'light_switch_off'].indexOf(tile.type.name) < 0)
if (['floor', 'steel', 'button_pink', 'button_black', 'teleport_blue', 'teleport_red', 'light_switch_on', 'light_switch_off', 'circuit_block'].indexOf(tile.type.name) < 0)
continue;
tile.wire_directions = tile.wire_directions ?? 0;
@ -768,6 +768,7 @@ class WireOperation extends DrawOperation {
tile.wire_directions |= DIRECTIONS[wire_direction].bit;
}
// TODO this.editor.mark_tile_dirty(tile);
break;
}
prevqx = qx;
@ -1250,6 +1251,7 @@ const EDITOR_PALETTE = [{
'purple_floor',
'purple_wall',
'button_gray',
'circuit_block/xxx',
],
}];
@ -1272,6 +1274,7 @@ const SPECIAL_PALETTE_ENTRIES = {
'logic_gate/latch-cw': { name: 'logic_gate', direction: 'north', gate_type: 'latch-cw' },
'logic_gate/latch-ccw': { name: 'logic_gate', direction: 'north', gate_type: 'latch-ccw' },
'logic_gate/counter': { name: 'logic_gate', direction: 'north', gate_type: 'counter', memory: 0 },
'circuit_block/xxx': { name: 'circuit_block', direction: 'south', wire_directions: 0xf },
};
const _RAILROAD_ROTATED_LEFT = [3, 0, 1, 2, 5, 4];
const _RAILROAD_ROTATED_RIGHT = [1, 2, 3, 0, 5, 4];
@ -1366,6 +1369,11 @@ const SPECIAL_PALETTE_BEHAVIOR = {
}
},
},
circuit_block: {
pick_palette_entry(tile) {
return 'circuit_block/xxx';
},
},
};
// Fill in some special behavior that boils down to rotating tiles which happen to be encoded as
// different tile types

View File

@ -851,6 +851,11 @@ export const LL_TILESET_LAYOUT = Object.assign({}, CC2_TILESET_LAYOUT, {
// Custom tiles
popwall2: [9, 32],
bestowal_bow: [10, 32],
circuit_block: {
base: [13, 32],
wired: [11, 32],
wired_cross: [12, 32],
},
// Blob and walker in all four directions
blob: {

View File

@ -1537,6 +1537,15 @@ const TILE_TYPES = {
level.transmute_tile(me, 'light_switch_off');
},
},
// LL tile: circuit block, overrides the wiring on the floor below (if any)
circuit_block: {
draw_layer: DRAW_LAYERS.actor,
collision_mask: COLLISION.block_cc2,
blocks_collision: COLLISION.all,
is_actor: true,
is_block: true,
movement_speed: 4,
},
// Time alteration
stopwatch_bonus: {
@ -1664,6 +1673,7 @@ const TILE_TYPES = {
dirt_block: true,
ice_block: true,
directional_block: true,
circuit_block: true,
},
movement_speed: 4,
},
@ -1979,6 +1989,7 @@ const TILE_TYPES = {
dirt_block: true,
ice_block: true,
directional_block: true,
circuit_block: true,
},
infinite_items: {
key_green: true,
@ -2000,6 +2011,7 @@ const TILE_TYPES = {
dirt_block: true,
ice_block: true,
directional_block: true,
circuit_block: true,
},
infinite_items: {
key_yellow: true,
@ -2020,6 +2032,7 @@ const TILE_TYPES = {
dirt_block: true,
ice_block: true,
directional_block: true,
circuit_block: true,
},
infinite_items: {
key_green: true,
@ -2049,6 +2062,7 @@ const TILE_TYPES = {
dirt_block: true,
ice_block: true,
directional_block: true,
circuit_block: true,
},
infinite_items: {
key_yellow: true,