Files
deepgrain-foundry/tools/scenes/bar-lift.js
T
2026-10-24 00:09:33 -04:00

18 lines
1008 B
JavaScript

// A mold drops copper bars onto a belt, through a screw lift and onto the upper belt.
money = 50000;
const bx = Math.floor((SX - 100) / BS), by = Math.floor((SY + 24) / BS);
for (let y = (by - 18) * BS; y < (by + 4) * BS; y++) for (let x = (bx - 3) * BS; x < (bx + 27) * BS; x++) {
bgm[y * W + x] = 0; setCell(y * W + x, EMPTY, AMB[y], 0);
}
for (let x = (bx - 3) * BS; x < (bx + 27) * BS; x++) surfY[x] = (by + 4) * BS;
const mo = addMold('ingot', bx, by - 4, RSTONE, true);
const beltY = Math.ceil((mo.y + mo.h) / BS) + 1;
for (let x = bx; x < bx + 9; x++) placeBlock(BP_BELT, 1, x, beltY, true);
for (let y = by - 11; y < beltY; y++) placeBlock(BP_TUBE, 0, bx + 9, y, true);
for (let x = bx + 9; x < bx + 16; x++) placeBlock(BP_TUBE, 1, x, by - 12, true);
for (let x = bx + 16; x < bx + 25; x++) placeBlock(BP_BELT, 1, x, by - 11, true);
placeBlock(BP_WALL, RSTONE, bx + 25, by - 12, true);
mo.cavs[0].forEach(i => setCell(i, MCU, 1090, 0));
window.CAM = [(bx + 12) * BS, (by - 6) * BS];
updateRoof();