Every transport piece moves material at belt speed and capacity (t105)

This commit is contained in:
2026-10-30 03:34:39 -04:00
parent e605953661
commit 1740f598eb
20 changed files with 413 additions and 126 deletions
+61
View File
@@ -0,0 +1,61 @@
// Shared t105 measurement and screenshot layout. No generated terrain.
function transportFixture(kind, reverse = false) {
RS=7; nextPowerBuild=0; money=1e6; AMB.fill(20); temp.fill(20); hot.fill(0); weather.next=1e15;
const blocks=[];
const put=(c,v,x,y)=>blocks.push([c,v,x,y]);
const belt=(a,b,y)=>{for(let x=a;x<b;x++)put(BP_BELT,1,x,y);};
let inlet=24, outlet=24, start=[72,95], axis=0, sign=1, diagonal=false;
if(kind==='belt'||kind==='filter') {
belt(10,16,24);for(let x=16;x<26;x++)put(kind==='belt'?BP_BELT:BP_FILTER,kind==='belt'?1:128,x,24);belt(26,32,24);
} else if(kind==='uphill'||kind==='downhill'||kind==='screen') {
const g=kind==='uphill'?-1:1, by=g<0?34:20;
inlet=by+(g<0?1:0);outlet=by+9*g+(g>0?1:0);diagonal=true;
belt(10,16,inlet);for(let k=0;k<10;k++)put(kind==='screen'?BP_FILTER_DOWN:g<0?BP_BELT_UP:BP_BELT_DOWN,kind==='screen'?128:1,16+k,by+k*g);belt(26,32,outlet);
start=[72,beltFaceY(g<0?BP_BELT_UP:BP_BELT_DOWN,18,by+2*g,72)-1];
} else if(kind==='screw-right') {
inlet=25;outlet=25;belt(10,16,25);for(let x=16;x<26;x++)put(BP_SCREW,1,x,24);belt(26,32,25);start=[72,99];
} else if(kind==='screw-up'||kind==='screw-down') {
const up=kind==='screw-up';inlet=up?35:20;outlet=up?24:32;axis=1;sign=up?-1:1;
belt(10,16,inlet);for(let y=up?24:20;y<(up?35:31);y++)put(BP_SCREW,up?0:2,16,y);
for(let x=16;x<20;x++)put(BP_SCREW,1,x,up?23:31);belt(20,32,outlet);start=[65,up?128:88];
} else {
const up=kind==='screw-up-right';inlet=up?35:20;outlet=up?25:30;diagonal=true;
belt(10,16,inlet);for(let k=0;k<10;k++)put(BP_SCREW,up?4:5,16+k,(up?35:20)+k*(up?-1:1));belt(26,32,outlet);start=[72,up?133:89];
}
const shift=24-inlet;for(const b of blocks)b[3]+=shift;start[1]+=shift*4;outlet+=shift;inlet=24;
if(reverse)for(const b of blocks){b[2]=41-b[2];if(b[0]===BP_SCREW)b[1]=[0,3,2,1,7,6,5,4][b[1]];else {if(isSlopeBelt(b[0]))b[0]+=b[0]===BP_BELT_UP||b[0]===BP_FILTER_UP?1:-1;b[1]=isFilter(b[0])?0:0;}}
for(const [c,v,x,y] of blocks)placeBlock(c,v,x,y,true,{m:[CUORE],inv:0});
if(reverse)start[0]=167-start[0];
return {kind,reverse,inlet,outlet,start,axis,sign,diagonal,feedX:reverse?123:44,sink:reverse?40:128};
}
function transportFeed(s,depth) {
let added=0;
for(let l=1;l<=depth;l++){const i=(s.inlet*4-l)*W+s.feedX;if(mat[i]===EMPTY){setCell(i,SAND,20,0);added++;}}
return added;
}
function transportCollect(s) {
let out=0;
for(let y=0;y<H;y++)for(let x=s.reverse?0:s.sink;x<(s.reverse?s.sink:W);x++){const i=y*W+x;if(mat[i]===SAND){out++;setCell(i,EMPTY,20,0);}}
for(let j=flyers.length-1;j>=0;j--)if(flyers[j].m===SAND&&(s.reverse?flyers[j].x<s.sink:flyers[j].x>=s.sink)){out++;flyers.splice(j,1);}
return out;
}
function transportChainFixture() {
RS=7; nextPowerBuild=0; money=1e6; AMB.fill(20); temp.fill(20); hot.fill(0); weather.next=1e15;
const belt=(a,b,y)=>{for(let x=a;x<b;x++)placeBlock(BP_BELT,1,x,y,true);};
belt(10,16,48);
for(let k=0;k<6;k++)placeBlock(BP_BELT_UP,1,16+k,47-k,true);
belt(22,30,42);
for(let y=32;y<42;y++)placeBlock(BP_SCREW,0,30,y,true);
for(let x=30;x<34;x++)placeBlock(BP_SCREW,1,x,31,true);
belt(34,40,32);
for(let x=40;x<46;x++)placeBlock(BP_FILTER,128,x,32,true,{m:[CUORE],inv:0});
belt(46,52,32);
for(let k=0;k<6;k++)placeBlock(BP_SCREW,4,52+k,32-k,true);
belt(58,66,26);
return {kind:'chain',reverse:false,inlet:48,feedX:44,sink:264,
joins:[['sidewall',64,192],['top belt',88,168],['lift',120,168],['lift outlet',136,128],['filter',160,128],['filter outlet',184,128],['diagonal screw',208,128],['final belt',232,104]]};
}
function transportPiles(s) {
return s.joins.map(([name,x,y])=>[name,(()=>{let n=0;for(let yy=y-20;yy<y;yy++)for(let xx=x-8;xx<x+4;xx++)if(mat[yy*W+xx]===SAND)n++;return n;})()]);
}