@korial29/tiny-fps 1.4.5 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{Dt as e,F as t,St as n,_n as r,bt as i,gn as a,gt as o,hn as s,pn as c,tt as l,vn as u,wt as d}from"./brick-D5SJVjYo.js";var f=125,[p,m]=l,{METAL:h,STEEL:g,PAINT:_,WOOD:v,STONE:y,GRATE:b}=c,x=[1,.42,.08],S={sea:0,shore:30,trees:90,east:110,cape:-6,water:0},C={east:S.trees+5,cape:S.cape-4},w={r:7,sunk:2,sections:[[6,36],[44,74],[82,106]],axis:[4,6.25,7.5],spine:2.5,skin:.85},T=e=>{let t=Math.max(1-e*e/(w.r*w.r),0);return Math.max(w.r*Math.sqrt(Math.sqrt(t*Math.sqrt(t))),e>0?w.spine:0)},E=[-4,-2.05,-1.75,0,1.95,2.25,3.6,5,5.5,6,6.5,7],D=[-1.75,2.25,w.r],O=(E.map(e=>[e,T(e)]),[{cut:[[6,7,.7,9],[7,13,.76],[13,20,.9],[20,36,1]],floor:-4.75,holes:[[0,14,20,3],[1,24,29,9],[2,13,18.5,2.3]],tears:[[21,30,-1.75,1.95],[31,36,2.25,5]],fair:[[30,36,3]],crates:[[18.3,-1],[24.2,0],[16.8,1]]},{cut:[[44,74,1]],floor:-5,holes:[[0,51.5,56,3.2],[0,67,70.5,9],[1,44,48,9],[1,60.5,65.5,3],[2,44,47,9],[2,53,58,2.2]],tears:[[57.5,60.5,-5,-2.05],[47.5,55,-1.75,1.95],[64,71,2.25,5]],fair:[[44,47.5,3.2],[55,71,4.4],[71,74,3]],crates:[[54.3,-1],[60.7,0],[56.3,1]]},{cut:[[82,90,1],[90,97,.85]],floor:-5,holes:[[0,86.5,90,3],[1,82,85,9],[2,87.5,91.5,2]],tears:[[84.5,91,-1.75,1.95]],fair:[[82,84.5,2.7],[91,95,1.5]],crates:[[88.3,-1],[83.3,0],[87.7,1]]}]),k={floor:w.axis[1]+O[1].floor,ceil:w.axis[1]+E[1],half:4.525,x:w.sections[1],door:O[1].tears[0],lintel:E[1]-O[1].floor,walls:[],way:2.4},A={root:[45,71],lead:[[71,0],[69,8],[64,18],[61.5,26],[60,26],[59,38],[60.5,38],[59,42],[57.5,46.5],[54,47.5]],trail:[[45,0],[46.5,10],[50,30],[52.5,44],[54,47.5]],span:.78,pieces:[[0,14,0,8.5,6.4,0],[16,30,2,6.8,3.6,.17],[32,47.5,4,3.3,1.6,-.2]],rails:[53.5,58]},j=[[38.5,150.3,2.7,19,.78],[4.5,137,2.5,9]],M=[60,219,4],ee=1.25,te=[[38,237,3.5,2.6,1],[57,242,3,2.2,2],[47,251,4,3,3],[66,254,4.5,3.6,4],[78,241,4,3.4,5],[33,256,2.8,1.8,6],[87,250,5.5,5,7],[97,243,6,6.5,8],[100,256,7.5,9,9],[89,262,7,7,10]],ne=(e,n,i)=>{let o=t=>a(e,t,151),s=2*o(1)-1,[c,l]=[(1-s*s)/(1+s*s),2*s/(1+s*s)],u=i-t(i),[d,f]=[n*(.85+.3*o(2)),n*(.6+.3*o(3))],p=t(i)+.7*i,m=[4,8].map(e=>{let[t,n,r]=[2*o(e)-1,.35*o(e+1),2*o(e+2)-1],i=Math.sqrt(t*t+n*n+r*r);return[t/i,n/i,r/i,.7+.2*o(e+3)]}),h=e=>{let t=(e[0]*c+e[2]*l)/d,n=(e[2]*c-e[0]*l)/f,r=e[1]/u,[i,a,o]=[t*t*t*t,r*r*r*r,n*n*n*n];return .25/Math.sqrt(Math.sqrt(i+a+o))+.75/Math.sqrt(Math.sqrt(Math.sqrt(i*i+a*a+o*o)))},g=t=>{if(t[1]<0){let e=Math.sqrt(t[0]*t[0]+t[2]*t[2]);return e<1e-6?p:Math.min(g([t[0]/e,0,t[2]/e])/e,p/-t[1])}let n=h(t);for(let[e,r,i,a]of m){let o=t[0]*e+t[1]*r+t[2]*i;if(o>.001){let t=a*h([e,r,i])/o,s=Math.max(.2-Math.abs(n-t),0)/.2;n=Math.min(n,t)-.05*s*s}}return n*(.95+.08*r(1.3*t[0]+e,1.3*t[2]+1.1*t[1],e+3))};return{reach:g}},re=Array.from({length:28},(e,t)=>[S.trees+3*a(t,1,7),134+4*t+2*a(t,2,7),.22+.1*a(t,3,7)]),N=e=>Math.min(Math.max(e,0),1),P=e=>N(e)*N(e)*(3-2*N(e)),ie=(e,t)=>Math.sqrt(e*e+t*t),ae=[[57,132,61,138,k.floor-.25],[56,171,66,175,1.3],[44,209,76,229,ee]],oe=[1.5,1.2],se=(e,t)=>{let n=Math.abs(t-f),{shore:i,trees:a}=S,o=e>i?2.5*(e-i)/(a-i):(e-i)/10;o+=.9*P((e-46)/24)*(r(e/13,n/13,5)-.45)*P((n-14)/10),o+=P((e-i)/14)*(1-P((e-102)/8))*(oe[1]*N(1-Math.abs(n-12)/5)-oe[0]*(1-P((n-2)/7))),o+=1.8*N(1-ie(e-110,n)/9);for(let[t,r,i,a,s]of ae){let c=ie(Math.max(t-e,e-i,0),Math.max(r-f-n,f+n-a,0));o=s+(o-s)*P((c-6)/6)}return o},F=(e,t)=>{let[n,r]=[Math.floor(e/4),Math.floor((t-1)/4)],[i,a]=[e/4-n,(t-1)/4-r],o=(e,t)=>Math.fround(se(4*(n+e),1+4*(r+t))),[s,c]=[o(0,0),o(1,1)];return i>=a?s+(o(1,0)-s)*i+(c-o(1,0))*a:s+(o(0,1)-s)*a+(c-o(0,1))*i},I=(e,t,n,r,i,a,o,s)=>({min:[e,t,n],max:[r,i,a],top:o,side:o,...s?{tint:s}:{}}),L=e=>({...e,ghost:!0}),ce=e=>({...e,min:[e.min[0],e.min[1],250-e.max[2]],max:[e.max[0],e.max[1],250-e.min[2]],...e.tint?{tint:e.tint===p?m:e.tint}:{}}),le=([e,t,n])=>[e,t,250-n],R=(e,...t)=>[...e,...e.map(le),...t],z=[],B=[],V=(e,t,n)=>(e.push({kind:t,min:n.min,max:n.max}),L(n)),H=(e,t,n,r)=>{let i=[0,.25,.5,.75,1].flatMap(i=>[0,.25,.5,.75,1].map(a=>F(e+(n-e)*i,t+(r-t)*a)));return[Math.max(...i),Math.min(...i)]},U=(e,t,n,r,i,a,o,s)=>{let[c,l]=H(t,n,r,i);return V(z,e,I(t,l-.5,n,r,Math.round(32*(c+a))/32,i,o,s))},W=e=>[(e.min[0]+e.max[0])/2,e.max[1],(e.min[2]+e.max[2])/2],G=(e,t,n,r,i,a,o,s=0)=>{let c=[],l=t,u=(o,s,l)=>{let[u,d]=[Math.max(o,t),Math.min(s,n)];if(d>u&&l<a)for(let[t,n]of l>0?[[-a,-l],[l,a]]:[[-a,a]])c.push(V(B,e,I(u,r,f+t,d,i,f+n,e==`deck`?b:h)))};for(let[e,t,r]of[...o,[n,n,0]])u(l,e,s),u(e,t,r),l=Math.max(l,t);return c},ue=w.axis.map(e=>e+w.r),de=[40,78].map(e=>{let[t,n]=H(e-1.5,123.5,e+1.5,126.5),r=Math.round(32*(Math.max(t,S.water)+.4))/32;return{x:e,top:r,heap:I(e-1.5,n-.5,123.5,e+1.5,r,126.5,g,x)}}),fe=[36,74].flatMap(e=>{let[t,n]=H(e,128,e+1.2,130.5),r=I(e,n-.5,128,e+1.2,Math.round(32*(t+1.4))/32,130.5,g);return[r,ce(r)]}),pe=I(.5,-.3,121,5,.4,129,h),me=[...O.flatMap(({cut:e,floor:t,holes:n,tears:r,fair:i,crates:a},o)=>{let s=w.axis[o],c=[t,...E.filter(e=>e>t+.5)];return[...e.flatMap(([e,a,o,l=w.skin])=>{let u=e=>Math.round(16*o*T(e))/16;return[...G(`deck`,e,a,s-w.r,s+t,u(t),[]),...c.slice(1).flatMap((d,f)=>{let p=c[f],m=D.indexOf(d),h=d<w.r?u(m<0?(p+d)/2:d):o*w.spine,g=p<D[0]?t:p<D[1]?D[0]:D[1];return[...m<0?G(`skin`,e,a,s+p,s+d,h,r.filter(e=>e[2]<=p&&e[3]>=d).map(([e,t])=>[e,t,99]),Math.min(u(d),u(g))-l):G(`deck`,e,a,s+p,s+d,h,n.filter(e=>e[0]==m).map(([,e,t,n])=>[e,t,Math.min(n,h-l)])),...p>=0&&d<=D[1]?i.flatMap(([t,n,r])=>G(`fairing`,Math.max(t,e),Math.min(n,a),s+p,s+d,w.r+r,[],h)):[]]})]}),...a.map(([e,n])=>{let r=s+(D[n]??t);return V(B,`crate`,I(e,r,124.25,e+1.5,r+[1,1.4,2][n+1],125.75,v))})]}),...de.map(e=>V(B,`heap`,e.heap)),...fe.map(e=>V(B,`frame`,e)),V(B,`raft`,pe),L(I(C.east,-10,C.cape-2,C.east+2,40,250-C.cape+2,y))],he=e=>.6-.45*e/47.5,ge=(e,t)=>{let n=e.findIndex(e=>e[1]>t),[r,i]=[e[n-1],e[n]];return r[0]+(i[0]-r[0])*(t-r[1])/(i[1]-r[1])},_e=Array.from({length:6},(e,t)=>{let[n,r,i,,a]=j[0],o=n-7.5+2.5*t,s=r+a*(o+1.25-n);return U(`fallen`,o,s-i-.2,o+2.5,s+i+.2,3.5,h,t?void 0:x)}),ve=[...[W(_e[3]),[j[1][0]-1.5,1.3,j[1][1]+3.5]].flatMap(([e,t,n])=>[[e,t,n,42,1.3,7],[e,t,250-n,42,1.3,7]]),...w.sections.flatMap(([e,t],n)=>[n&&e-.6,n<2&&t+.6].filter(e=>e).map(e=>[+e,w.axis[n]+4.2,125,28,.9,4]))],ye=[.55,2.3],be=(()=>{let[e,t,n,r]=j[1];return V(z,`engine`,I(e-n,-5,t-r/2,e+n,1.4,t+r/2,h,x))})(),K=[V(z,`float`,I(16,-1.6,141,22,.35,144,h)),V(z,`float`,I(10,-.2,138,13,.5,141,h)),V(z,`float`,I(23,-1.6,132.6,26,.2,135,h))],xe=V(z,`pod`,I(M[0]-3,.75,M[1]-3,M[0]+3,4.25,M[1]+3,h)),Se=V(z,`dais`,I(M[0]-2,.75,M[1]-10,M[0]+2,1.3,M[1]-6,_,p)),q=(e,t,n=.4,r)=>U(`crate`,e-1.5,t-1.5,e+1.5,t+1.5,n,v,r),Ce=(e,t)=>[I(e-2.6,3.85,t-2.1,e+2.6,4,t+2.1,_,p),...[-1,1].flatMap(n=>[-1,1].map(r=>I(e+2.5*n-.1,.75,t+2*r-.1,e+2.5*n+.1,3.85,t+2*r+.1,g)))].map(e=>V(z,`shelter`,e)),[we,Te]=[q(49,221),q(71,221)],[Ee,De]=[q(84,185,.4,p),q(33,153,.4,p)],Oe=U(`panel`,67,184.5,70.5,188,.65,h),ke=U(`container`,68.5,176,71.1,182,1.875,h,x),Ae=U(`gear`,68.6,170.6,71,173,2.9,g,[.95,.75,.1]),je=U(`container`,64,164.5,67.5,168,2.6,h,x),Me=U(`gear`,67.6,169.6,72,170.6,1.2,g),J={camp:[q(76,213),q(40,217)],west:[U(`panel`,44.5,191.5,47.5,194.5,.5,h),U(`container`,33,173.7,39,176.3,2.2,h,x),U(`panel`,41,163.5,44,166.5,.4,h),U(`panel`,25.5,159.5,28.5,162.5,.5,h),U(`panel`,50.5,139.5,53.5,142.5,.4,h),U(`container`,49.5,132.4,52.5,135,2.6,h,x)],east:[U(`panel`,62.5,145.5,65.5,148.5,.4,h),q(80,171),q(85.5,165),q(84,153),U(`panel`,84.5,135.5,87.5,138.5,.4,h)],cover:[U(`panel`,78,156.6,83,157,2.6,h),U(`panel`,30,166.6,35,167,2.2,h),U(`container`,76,190,82,192.6,2.6,h,x)]},Ne=(e,n,r,i,a,o)=>{let{reach:s}=ne(a,r,i),c=H(e-.8*r,n-.8*r,e+.8*r,n+.8*r),l=F(e,n)+t(i),u=l+s([0,1,0])-.1,d=(e,t,n)=>{let r=Math.sqrt(e*e+t*t+n*n)||1;return r<=s([e/r,t/r,n/r])},f=(e,t)=>{if(!d(e,t,0))return;let n=n=>{let[i,a]=[0,1.6*r];for(let r=0;r<9;r++){let r=(i+a)/2;d(e,t,n*r)?i=r:a=r}return n*i};return[n(-1),n(1)]},p=[],[m,h]=[r<5?1:r<8?2:3,i<5?1:i<12?2:3];for(let t=c[1]-.5;t<u-.3;t+=h){let i=Math.min(t+h,u);for(let a=-1.5*r;a<1.5*r;a+=m){let r=[.1,.5,.9].flatMap(e=>[Math.max(t,c[1])+.05,i].map(t=>f(a+m*e,t-l)));if(r.every(e=>e)){let s=n+Math.max(...r.map(e=>e[0])),c=Math.min(n+Math.min(...r.map(e=>e[1])),o);c-s>.4&&p.push([e+a,t,s,e+a+m,i,c])}}}return p},Y=te.map(([e,t,n,r,i])=>({at:[e,F(e,t),t],R:n,H:r,s:i,parts:Ne(e,t,n,r,i,250-C.cape)})),Pe=[...A.pieces.flatMap(([e,t,n,r,i,a],o)=>{let s=(e,t=n)=>f+w.r+O[1].fair[1][2]+A.span*e+t,c=Math.ceil((s(t)-s(e))/1.4),l=Math.max(c,Math.ceil((r-i)/.15-1e-9)+1),u=A.pieces[o-1];return[...Array.from({length:l},(n,o)=>{let u=e+(t-e)*(o+.5)/l,d=a*c*((o+.5)/l-.5),[f,p]=[A.trail,A.lead].map(e=>Math.round(8*(ge(e,u)+d))/8),[m,g]=[o,o+1].map(n=>s(e+(t-e)*n/l)),_=r+(i-r)*o/(l-1),v=_-he(u),[y,b]=H(f,m,p,g);return V(z,`wingpiece`,I(f,v-y<2.2?b-.5:v,m,p,_,g,h))}),...u?A.rails.map(t=>{let n=Math.min(u[4],r);return V(z,`rail`,I(t-.225,n-.45,s(u[1],u[2]),t+.225,n,s(e),g))}):[]]}),..._e,be,...K,xe,Se,we,Te,...Ce(49,221),...Ce(71,221),Ee,De,Oe,ke,Ae,Me,je,...Object.values(J).flat(),...re.map(([e,t,n])=>{let r=F(e,t);return L(I(e-n,r-1,t-n,e+n,r+9,t+n,v))}),...Y.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>L(I(e,t,n,r,i,a,y))),L(I(-60,-10,250-C.cape,C.east+2,40,250-C.cape+2,y))],Fe={hull:w.sections.map(([e,t],n)=>[e,t,w.axis[n]]),pieces:[...B,...z,...z.map(({kind:e,min:t,max:n})=>({kind:e,min:[t[0],t[1],250-n[2]],max:[n[0],n[1],250-t[2]]}))],crags:[...Y,...Y.map(e=>({...e,at:[e.at[0],e.at[1],250-e.at[2]],parts:e.parts.map(([e,t,n,r,i,a])=>[e,t,250-a,r,i,250-n])}))]},Ie=[46,54,62,70].flatMap(e=>[[e,ee,226,0],[e+4,ee,229,0]]),Le=e=>{let t=t=>e?t:le(t);return{base:t(W(Se)),spawns:e?Ie:Ie.map(([e,t,n])=>[e,t,250-n,Math.PI]),rack:t(W(we)),blade:t(W(Te)),rifle:t(W(Ee)),rail:t(W(De))}},Re=[70.5,w.axis[1]+D[1],128],ze={armor:!0,name:`Landfall`,tag:`Beach · wreck`,lore:`A ship came down across a Caribbean beach, its tail in the lagoon and its nose in the trees. The survivors camp at either end of the sand and fight over the wreck between them.`,brushes:[...Pe,...Pe.map(ce),...me],teams:[Le(!0),Le(!1)],packs:R([W(J.camp[0]),W(J.west[2]),W(J.west[4]),W(K[0]),W(J.east[3])],...de.map(({x:e,top:t})=>[e,t,f])),ammo:R([W(Oe),W(ke),W(Ae),W(J.west[0]),W(J.west[1]),W(J.west[3]),W(J.east[0]),W(J.east[1]),W(J.east[4])],[51,k.floor,f],[67,k.floor,f]),cells:R([W(J.camp[1]),W(je),W(K[1]),W(J.east[2]),Re],[59,k.floor,f]),vests:R([W(be)],[63,ue[1],f]),floor:-1.4,water:S.water,fires:ve.map(([e,t,n,,r])=>[e,t,n,.6*r+ye[0],ye[1]]),relief:{hole:[0,0,0,0],bound:[56,f,100,185],cell:4,origin:[0,1],at:se},sun:{dir:[-.47,.83,.3],color:[3.2,3,2.6]},sky:[[.1,.32,.75],[.55,.75,.9]],fog:[.6,.78,.9,.0012],scenery:`beach`},Be=-1.09,X=[16,48,120,280,600,1100],[Ve,He]=[.08,-40],[Ue,We]=[[.64,.59,.48],[.3,.25,.15]],Z=[.1,.2,.12],Q=(e,t,n)=>Math.min(Math.max(e,t),n),Ge=i(d([[0,-1],[1,0],[0,1]],4),[1,1,1]),[Ke,qe]=[72,17],Je=/* @__PURE__ */ new WeakMap,Ye=t=>{let i=Je.get(t);if(i)return i;let c=t.relief&&u(t.relief),[l,d,f,p,m]=c?[c.x0,c.z0,c.cell,c.nx,c.nz]:[S.sea,0,10,(S.east-S.sea)/10+1,26],h=X.length,g=(e,t)=>[...X.map(t=>e-t).reverse(),...Array.from({length:t},(t,n)=>e+n*f),...X.map(n=>e+(t-1)*f+n)],[_,v]=[g(l,p),g(d,m)],[y,b]=[_.length,v.length],x=new Float64Array(y*b);for(let e=0;e<b;e++)for(let t=0;t<y;t++){let[n,r]=[Q(t-h,0,p-1),Q(e-h,0,m-1)],i=c?c.h[n+r*p]:S.water+.1*(l+n*f-S.shore);x[t+e*y]=Math.max(i-Ve*Math.max(l-_[t],0),He)}let C=(e,t)=>x[Q(e,0,y-1)+Q(t,0,b-1)*y],T=[],E=[];for(let t=0;t<b;t++)for(let n=0;n<y;n++){let[i,a,o]=[_[n],v[t],C(n,t)],[s,l]=[Math.max(n-1,0),Math.min(n+1,y-1)],[u,d]=[Math.max(t-1,0),Math.min(t+1,b-1)],f=c?e([(C(s,t)-C(l,t))/(_[l]-_[s]),1,(C(n,u)-C(n,d))/(v[d]-v[u])]):[0,1,0],p=.92+.16*r(i/11,a/11,5),m=Q((i-S.trees-2)/14,0,1),h=Ue.map((e,t)=>(e+(We[t]-e)*m)*p);T.push([i,c?o:S.water-.02,a,...f,h[0],h[1],-1.09,h[2]]),E.push([i,S.water+.05,a,0,1,0,S.water+.05-o,0,-5,0])}let D=[[],[]],O=c?.hole??[0,0,0,0];for(let e=0;e<b-1;e++)for(let t=0;t<y-1;t++){let[n,r,i,a]=[t+e*y,t+1+e*y,t+1+(e+1)*y,t+(e+1)*y];_[t]>=O[0]&&_[t+1]<=O[2]&&v[e]>=O[1]&&v[e+1]<=O[3]||D[0].push(...T[n],...T[i],...T[r],...T[n],...T[a],...T[i]),Math.min(x[n],x[r],x[i],x[a])<S.water+.05&&D[1].push(...E[n],...E[i],...E[r],...E[n],...E[a],...E[i])}if((e=>{let[t,n,i,a]=[28,S.sea-840,125,560],o=e=>{let n=e/t;return 70*(4*n*(1-n))**.7*(.45+.75*r(5*n,3,9))},s=(e,r)=>[n-60*r,r?o(e):S.water-1,i+(e/t-.5)*a,.6,.8,0,Z[0],Z[1],-1,Z[2]];for(let n=0;n<t;n++)e.push(...s(n,0),...s(n+1,0),...s(n+1,1),...s(n,0),...s(n+1,1),...s(n,1))})(D[0]),c){let e={relief:c};((e,t)=>{let[r,i]=[S.shore+4,w.sections[2][1]];for(let s=0;s<Ke;s++){let c=e=>a(s,e,31),[l,u]=[r+(i-r)*c(1),3+(qe-3)*c(2)*c(2)];if(u<w.r+1.5&&w.sections.some(([e,t])=>l>e&&l<t))continue;let[d,f,p]=[125+(c(3)<.5?u:-u),.12+.3*c(4)*c(4),.03+.04*c(5)];n(e,Ge,[l,t(l,d)+.2*f,d],o(7*c(5),0),[0,0,0],[f*(.6+c(6)),.7*f,f],[p,p,p])}})(D[0],(t,n)=>s(e,t,n))}return Je.set(t,D),D},Xe=e=>Ye(e)[0],Ze=e=>Ye(e)[1],Qe=`0.05+0.05*sin(T*.55+q.y*.13+4.*vn(q*.05))`,$e=`if(d.y>0.){vec2 q=d.xz/(d.y+.1)*2.+T*.003;float f=vn(q)+.5*vn(q*2.3+5.)+.25*vn(q*5.1);
1
+ import{Dt as e,F as t,St as n,_n as r,bt as i,gn as a,gt as o,hn as s,pn as c,tt as l,vn as u,wt as d}from"./brick-KajeVVVE.js";var f=125,[p,m]=l,{METAL:h,STEEL:g,PAINT:_,WOOD:v,STONE:y,GRATE:b}=c,x=[1,.42,.08],S={sea:0,shore:30,trees:90,east:110,cape:-6,water:0},C={east:S.trees+5,cape:S.cape-4},w={r:7,sunk:2,sections:[[6,36],[44,74],[82,106]],axis:[4,6.25,7.5],spine:2.5,skin:.85},T=e=>{let t=Math.max(1-e*e/(w.r*w.r),0);return Math.max(w.r*Math.sqrt(Math.sqrt(t*Math.sqrt(t))),e>0?w.spine:0)},E=[-4,-2.05,-1.75,0,1.95,2.25,3.6,5,5.5,6,6.5,7],D=[-1.75,2.25,w.r],O=(E.map(e=>[e,T(e)]),[{cut:[[6,7,.7,9],[7,13,.76],[13,20,.9],[20,36,1]],floor:-4.75,holes:[[0,14,20,3],[1,24,29,9],[2,13,18.5,2.3]],tears:[[21,30,-1.75,1.95],[31,36,2.25,5]],fair:[[30,36,3]],crates:[[18.3,-1],[24.2,0],[16.8,1]]},{cut:[[44,74,1]],floor:-5,holes:[[0,51.5,56,3.2],[0,67,70.5,9],[1,44,48,9],[1,60.5,65.5,3],[2,44,47,9],[2,53,58,2.2]],tears:[[57.5,60.5,-5,-2.05],[47.5,55,-1.75,1.95],[64,71,2.25,5]],fair:[[44,47.5,3.2],[55,71,4.4],[71,74,3]],crates:[[54.3,-1],[60.7,0],[56.3,1]]},{cut:[[82,90,1],[90,97,.85]],floor:-5,holes:[[0,86.5,90,3],[1,82,85,9],[2,87.5,91.5,2]],tears:[[84.5,91,-1.75,1.95]],fair:[[82,84.5,2.7],[91,95,1.5]],crates:[[88.3,-1],[83.3,0],[87.7,1]]}]),k={floor:w.axis[1]+O[1].floor,ceil:w.axis[1]+E[1],half:4.525,x:w.sections[1],door:O[1].tears[0],lintel:E[1]-O[1].floor,walls:[],way:2.4},A={root:[45,71],lead:[[71,0],[69,8],[64,18],[61.5,26],[60,26],[59,38],[60.5,38],[59,42],[57.5,46.5],[54,47.5]],trail:[[45,0],[46.5,10],[50,30],[52.5,44],[54,47.5]],span:.78,pieces:[[0,14,0,8.5,6.4,0],[16,30,2,6.8,3.6,.17],[32,47.5,4,3.3,1.6,-.2]],rails:[53.5,58]},j=[[38.5,150.3,2.7,19,.78],[4.5,137,2.5,9]],M=[60,219,4],ee=1.25,te=[[38,237,3.5,2.6,1],[57,242,3,2.2,2],[47,251,4,3,3],[66,254,4.5,3.6,4],[78,241,4,3.4,5],[33,256,2.8,1.8,6],[87,250,5.5,5,7],[97,243,6,6.5,8],[100,256,7.5,9,9],[89,262,7,7,10]],ne=(e,n,i)=>{let o=t=>a(e,t,151),s=2*o(1)-1,[c,l]=[(1-s*s)/(1+s*s),2*s/(1+s*s)],u=i-t(i),[d,f]=[n*(.85+.3*o(2)),n*(.6+.3*o(3))],p=t(i)+.7*i,m=[4,8].map(e=>{let[t,n,r]=[2*o(e)-1,.35*o(e+1),2*o(e+2)-1],i=Math.sqrt(t*t+n*n+r*r);return[t/i,n/i,r/i,.7+.2*o(e+3)]}),h=e=>{let t=(e[0]*c+e[2]*l)/d,n=(e[2]*c-e[0]*l)/f,r=e[1]/u,[i,a,o]=[t*t*t*t,r*r*r*r,n*n*n*n];return .25/Math.sqrt(Math.sqrt(i+a+o))+.75/Math.sqrt(Math.sqrt(Math.sqrt(i*i+a*a+o*o)))},g=t=>{if(t[1]<0){let e=Math.sqrt(t[0]*t[0]+t[2]*t[2]);return e<1e-6?p:Math.min(g([t[0]/e,0,t[2]/e])/e,p/-t[1])}let n=h(t);for(let[e,r,i,a]of m){let o=t[0]*e+t[1]*r+t[2]*i;if(o>.001){let t=a*h([e,r,i])/o,s=Math.max(.2-Math.abs(n-t),0)/.2;n=Math.min(n,t)-.05*s*s}}return n*(.95+.08*r(1.3*t[0]+e,1.3*t[2]+1.1*t[1],e+3))};return{reach:g}},re=Array.from({length:28},(e,t)=>[S.trees+3*a(t,1,7),134+4*t+2*a(t,2,7),.22+.1*a(t,3,7)]),N=e=>Math.min(Math.max(e,0),1),P=e=>N(e)*N(e)*(3-2*N(e)),ie=(e,t)=>Math.sqrt(e*e+t*t),ae=[[57,132,61,138,k.floor-.25],[56,171,66,175,1.3],[44,209,76,229,ee]],oe=[1.5,1.2],se=(e,t)=>{let n=Math.abs(t-f),{shore:i,trees:a}=S,o=e>i?2.5*(e-i)/(a-i):(e-i)/10;o+=.9*P((e-46)/24)*(r(e/13,n/13,5)-.45)*P((n-14)/10),o+=P((e-i)/14)*(1-P((e-102)/8))*(oe[1]*N(1-Math.abs(n-12)/5)-oe[0]*(1-P((n-2)/7))),o+=1.8*N(1-ie(e-110,n)/9);for(let[t,r,i,a,s]of ae){let c=ie(Math.max(t-e,e-i,0),Math.max(r-f-n,f+n-a,0));o=s+(o-s)*P((c-6)/6)}return o},F=(e,t)=>{let[n,r]=[Math.floor(e/4),Math.floor((t-1)/4)],[i,a]=[e/4-n,(t-1)/4-r],o=(e,t)=>Math.fround(se(4*(n+e),1+4*(r+t))),[s,c]=[o(0,0),o(1,1)];return i>=a?s+(o(1,0)-s)*i+(c-o(1,0))*a:s+(o(0,1)-s)*a+(c-o(0,1))*i},I=(e,t,n,r,i,a,o,s)=>({min:[e,t,n],max:[r,i,a],top:o,side:o,...s?{tint:s}:{}}),L=e=>({...e,ghost:!0}),ce=e=>({...e,min:[e.min[0],e.min[1],250-e.max[2]],max:[e.max[0],e.max[1],250-e.min[2]],...e.tint?{tint:e.tint===p?m:e.tint}:{}}),le=([e,t,n])=>[e,t,250-n],R=(e,...t)=>[...e,...e.map(le),...t],z=[],B=[],V=(e,t,n)=>(e.push({kind:t,min:n.min,max:n.max}),L(n)),H=(e,t,n,r)=>{let i=[0,.25,.5,.75,1].flatMap(i=>[0,.25,.5,.75,1].map(a=>F(e+(n-e)*i,t+(r-t)*a)));return[Math.max(...i),Math.min(...i)]},U=(e,t,n,r,i,a,o,s)=>{let[c,l]=H(t,n,r,i);return V(z,e,I(t,l-.5,n,r,Math.round(32*(c+a))/32,i,o,s))},W=e=>[(e.min[0]+e.max[0])/2,e.max[1],(e.min[2]+e.max[2])/2],G=(e,t,n,r,i,a,o,s=0)=>{let c=[],l=t,u=(o,s,l)=>{let[u,d]=[Math.max(o,t),Math.min(s,n)];if(d>u&&l<a)for(let[t,n]of l>0?[[-a,-l],[l,a]]:[[-a,a]])c.push(V(B,e,I(u,r,f+t,d,i,f+n,e==`deck`?b:h)))};for(let[e,t,r]of[...o,[n,n,0]])u(l,e,s),u(e,t,r),l=Math.max(l,t);return c},ue=w.axis.map(e=>e+w.r),de=[40,78].map(e=>{let[t,n]=H(e-1.5,123.5,e+1.5,126.5),r=Math.round(32*(Math.max(t,S.water)+.4))/32;return{x:e,top:r,heap:I(e-1.5,n-.5,123.5,e+1.5,r,126.5,g,x)}}),fe=[36,74].flatMap(e=>{let[t,n]=H(e,128,e+1.2,130.5),r=I(e,n-.5,128,e+1.2,Math.round(32*(t+1.4))/32,130.5,g);return[r,ce(r)]}),pe=I(.5,-.3,121,5,.4,129,h),me=[...O.flatMap(({cut:e,floor:t,holes:n,tears:r,fair:i,crates:a},o)=>{let s=w.axis[o],c=[t,...E.filter(e=>e>t+.5)];return[...e.flatMap(([e,a,o,l=w.skin])=>{let u=e=>Math.round(16*o*T(e))/16;return[...G(`deck`,e,a,s-w.r,s+t,u(t),[]),...c.slice(1).flatMap((d,f)=>{let p=c[f],m=D.indexOf(d),h=d<w.r?u(m<0?(p+d)/2:d):o*w.spine,g=p<D[0]?t:p<D[1]?D[0]:D[1];return[...m<0?G(`skin`,e,a,s+p,s+d,h,r.filter(e=>e[2]<=p&&e[3]>=d).map(([e,t])=>[e,t,99]),Math.min(u(d),u(g))-l):G(`deck`,e,a,s+p,s+d,h,n.filter(e=>e[0]==m).map(([,e,t,n])=>[e,t,Math.min(n,h-l)])),...p>=0&&d<=D[1]?i.flatMap(([t,n,r])=>G(`fairing`,Math.max(t,e),Math.min(n,a),s+p,s+d,w.r+r,[],h)):[]]})]}),...a.map(([e,n])=>{let r=s+(D[n]??t);return V(B,`crate`,I(e,r,124.25,e+1.5,r+[1,1.4,2][n+1],125.75,v))})]}),...de.map(e=>V(B,`heap`,e.heap)),...fe.map(e=>V(B,`frame`,e)),V(B,`raft`,pe),L(I(C.east,-10,C.cape-2,C.east+2,40,250-C.cape+2,y))],he=e=>.6-.45*e/47.5,ge=(e,t)=>{let n=e.findIndex(e=>e[1]>t),[r,i]=[e[n-1],e[n]];return r[0]+(i[0]-r[0])*(t-r[1])/(i[1]-r[1])},_e=Array.from({length:6},(e,t)=>{let[n,r,i,,a]=j[0],o=n-7.5+2.5*t,s=r+a*(o+1.25-n);return U(`fallen`,o,s-i-.2,o+2.5,s+i+.2,3.5,h,t?void 0:x)}),ve=[...[W(_e[3]),[j[1][0]-1.5,1.3,j[1][1]+3.5]].flatMap(([e,t,n])=>[[e,t,n,42,1.3,7],[e,t,250-n,42,1.3,7]]),...w.sections.flatMap(([e,t],n)=>[n&&e-.6,n<2&&t+.6].filter(e=>e).map(e=>[+e,w.axis[n]+4.2,125,28,.9,4]))],ye=[.55,2.3],be=(()=>{let[e,t,n,r]=j[1];return V(z,`engine`,I(e-n,-5,t-r/2,e+n,1.4,t+r/2,h,x))})(),K=[V(z,`float`,I(16,-1.6,141,22,.35,144,h)),V(z,`float`,I(10,-.2,138,13,.5,141,h)),V(z,`float`,I(23,-1.6,132.6,26,.2,135,h))],xe=V(z,`pod`,I(M[0]-3,.75,M[1]-3,M[0]+3,4.25,M[1]+3,h)),Se=V(z,`dais`,I(M[0]-2,.75,M[1]-10,M[0]+2,1.3,M[1]-6,_,p)),q=(e,t,n=.4,r)=>U(`crate`,e-1.5,t-1.5,e+1.5,t+1.5,n,v,r),Ce=(e,t)=>[I(e-2.6,3.85,t-2.1,e+2.6,4,t+2.1,_,p),...[-1,1].flatMap(n=>[-1,1].map(r=>I(e+2.5*n-.1,.75,t+2*r-.1,e+2.5*n+.1,3.85,t+2*r+.1,g)))].map(e=>V(z,`shelter`,e)),[we,Te]=[q(49,221),q(71,221)],[Ee,De]=[q(84,185,.4,p),q(33,153,.4,p)],Oe=U(`panel`,67,184.5,70.5,188,.65,h),ke=U(`container`,68.5,176,71.1,182,1.875,h,x),Ae=U(`gear`,68.6,170.6,71,173,2.9,g,[.95,.75,.1]),je=U(`container`,64,164.5,67.5,168,2.6,h,x),Me=U(`gear`,67.6,169.6,72,170.6,1.2,g),J={camp:[q(76,213),q(40,217)],west:[U(`panel`,44.5,191.5,47.5,194.5,.5,h),U(`container`,33,173.7,39,176.3,2.2,h,x),U(`panel`,41,163.5,44,166.5,.4,h),U(`panel`,25.5,159.5,28.5,162.5,.5,h),U(`panel`,50.5,139.5,53.5,142.5,.4,h),U(`container`,49.5,132.4,52.5,135,2.6,h,x)],east:[U(`panel`,62.5,145.5,65.5,148.5,.4,h),q(80,171),q(85.5,165),q(84,153),U(`panel`,84.5,135.5,87.5,138.5,.4,h)],cover:[U(`panel`,78,156.6,83,157,2.6,h),U(`panel`,30,166.6,35,167,2.2,h),U(`container`,76,190,82,192.6,2.6,h,x)]},Ne=(e,n,r,i,a,o)=>{let{reach:s}=ne(a,r,i),c=H(e-.8*r,n-.8*r,e+.8*r,n+.8*r),l=F(e,n)+t(i),u=l+s([0,1,0])-.1,d=(e,t,n)=>{let r=Math.sqrt(e*e+t*t+n*n)||1;return r<=s([e/r,t/r,n/r])},f=(e,t)=>{if(!d(e,t,0))return;let n=n=>{let[i,a]=[0,1.6*r];for(let r=0;r<9;r++){let r=(i+a)/2;d(e,t,n*r)?i=r:a=r}return n*i};return[n(-1),n(1)]},p=[],[m,h]=[r<5?1:r<8?2:3,i<5?1:i<12?2:3];for(let t=c[1]-.5;t<u-.3;t+=h){let i=Math.min(t+h,u);for(let a=-1.5*r;a<1.5*r;a+=m){let r=[.1,.5,.9].flatMap(e=>[Math.max(t,c[1])+.05,i].map(t=>f(a+m*e,t-l)));if(r.every(e=>e)){let s=n+Math.max(...r.map(e=>e[0])),c=Math.min(n+Math.min(...r.map(e=>e[1])),o);c-s>.4&&p.push([e+a,t,s,e+a+m,i,c])}}}return p},Y=te.map(([e,t,n,r,i])=>({at:[e,F(e,t),t],R:n,H:r,s:i,parts:Ne(e,t,n,r,i,250-C.cape)})),Pe=[...A.pieces.flatMap(([e,t,n,r,i,a],o)=>{let s=(e,t=n)=>f+w.r+O[1].fair[1][2]+A.span*e+t,c=Math.ceil((s(t)-s(e))/1.4),l=Math.max(c,Math.ceil((r-i)/.15-1e-9)+1),u=A.pieces[o-1];return[...Array.from({length:l},(n,o)=>{let u=e+(t-e)*(o+.5)/l,d=a*c*((o+.5)/l-.5),[f,p]=[A.trail,A.lead].map(e=>Math.round(8*(ge(e,u)+d))/8),[m,g]=[o,o+1].map(n=>s(e+(t-e)*n/l)),_=r+(i-r)*o/(l-1),v=_-he(u),[y,b]=H(f,m,p,g);return V(z,`wingpiece`,I(f,v-y<2.2?b-.5:v,m,p,_,g,h))}),...u?A.rails.map(t=>{let n=Math.min(u[4],r);return V(z,`rail`,I(t-.225,n-.45,s(u[1],u[2]),t+.225,n,s(e),g))}):[]]}),..._e,be,...K,xe,Se,we,Te,...Ce(49,221),...Ce(71,221),Ee,De,Oe,ke,Ae,Me,je,...Object.values(J).flat(),...re.map(([e,t,n])=>{let r=F(e,t);return L(I(e-n,r-1,t-n,e+n,r+9,t+n,v))}),...Y.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>L(I(e,t,n,r,i,a,y))),L(I(-60,-10,250-C.cape,C.east+2,40,250-C.cape+2,y))],Fe={hull:w.sections.map(([e,t],n)=>[e,t,w.axis[n]]),pieces:[...B,...z,...z.map(({kind:e,min:t,max:n})=>({kind:e,min:[t[0],t[1],250-n[2]],max:[n[0],n[1],250-t[2]]}))],crags:[...Y,...Y.map(e=>({...e,at:[e.at[0],e.at[1],250-e.at[2]],parts:e.parts.map(([e,t,n,r,i,a])=>[e,t,250-a,r,i,250-n])}))]},Ie=[46,54,62,70].flatMap(e=>[[e,ee,226,0],[e+4,ee,229,0]]),Le=e=>{let t=t=>e?t:le(t);return{base:t(W(Se)),spawns:e?Ie:Ie.map(([e,t,n])=>[e,t,250-n,Math.PI]),rack:t(W(we)),blade:t(W(Te)),rifle:t(W(Ee)),rail:t(W(De))}},Re=[70.5,w.axis[1]+D[1],128],ze={armor:!0,name:`Landfall`,tag:`Beach · wreck`,lore:`A ship came down across a Caribbean beach, its tail in the lagoon and its nose in the trees. The survivors camp at either end of the sand and fight over the wreck between them.`,brushes:[...Pe,...Pe.map(ce),...me],teams:[Le(!0),Le(!1)],packs:R([W(J.camp[0]),W(J.west[2]),W(J.west[4]),W(K[0]),W(J.east[3])],...de.map(({x:e,top:t})=>[e,t,f])),ammo:R([W(Oe),W(ke),W(Ae),W(J.west[0]),W(J.west[1]),W(J.west[3]),W(J.east[0]),W(J.east[1]),W(J.east[4])],[51,k.floor,f],[67,k.floor,f]),cells:R([W(J.camp[1]),W(je),W(K[1]),W(J.east[2]),Re],[59,k.floor,f]),vests:R([W(be)],[63,ue[1],f]),floor:-1.4,water:S.water,fires:ve.map(([e,t,n,,r])=>[e,t,n,.6*r+ye[0],ye[1]]),relief:{hole:[0,0,0,0],bound:[56,f,100,185],cell:4,origin:[0,1],at:se},sun:{dir:[-.47,.83,.3],color:[3.2,3,2.6]},sky:[[.1,.32,.75],[.55,.75,.9]],fog:[.6,.78,.9,.0012],scenery:`beach`},Be=-1.09,X=[16,48,120,280,600,1100],[Ve,He]=[.08,-40],[Ue,We]=[[.64,.59,.48],[.3,.25,.15]],Z=[.1,.2,.12],Q=(e,t,n)=>Math.min(Math.max(e,t),n),Ge=i(d([[0,-1],[1,0],[0,1]],4),[1,1,1]),[Ke,qe]=[72,17],Je=/* @__PURE__ */ new WeakMap,Ye=t=>{let i=Je.get(t);if(i)return i;let c=t.relief&&u(t.relief),[l,d,f,p,m]=c?[c.x0,c.z0,c.cell,c.nx,c.nz]:[S.sea,0,10,(S.east-S.sea)/10+1,26],h=X.length,g=(e,t)=>[...X.map(t=>e-t).reverse(),...Array.from({length:t},(t,n)=>e+n*f),...X.map(n=>e+(t-1)*f+n)],[_,v]=[g(l,p),g(d,m)],[y,b]=[_.length,v.length],x=new Float64Array(y*b);for(let e=0;e<b;e++)for(let t=0;t<y;t++){let[n,r]=[Q(t-h,0,p-1),Q(e-h,0,m-1)],i=c?c.h[n+r*p]:S.water+.1*(l+n*f-S.shore);x[t+e*y]=Math.max(i-Ve*Math.max(l-_[t],0),He)}let C=(e,t)=>x[Q(e,0,y-1)+Q(t,0,b-1)*y],T=[],E=[];for(let t=0;t<b;t++)for(let n=0;n<y;n++){let[i,a,o]=[_[n],v[t],C(n,t)],[s,l]=[Math.max(n-1,0),Math.min(n+1,y-1)],[u,d]=[Math.max(t-1,0),Math.min(t+1,b-1)],f=c?e([(C(s,t)-C(l,t))/(_[l]-_[s]),1,(C(n,u)-C(n,d))/(v[d]-v[u])]):[0,1,0],p=.92+.16*r(i/11,a/11,5),m=Q((i-S.trees-2)/14,0,1),h=Ue.map((e,t)=>(e+(We[t]-e)*m)*p);T.push([i,c?o:S.water-.02,a,...f,h[0],h[1],-1.09,h[2]]),E.push([i,S.water+.05,a,0,1,0,S.water+.05-o,0,-5,0])}let D=[[],[]],O=c?.hole??[0,0,0,0];for(let e=0;e<b-1;e++)for(let t=0;t<y-1;t++){let[n,r,i,a]=[t+e*y,t+1+e*y,t+1+(e+1)*y,t+(e+1)*y];_[t]>=O[0]&&_[t+1]<=O[2]&&v[e]>=O[1]&&v[e+1]<=O[3]||D[0].push(...T[n],...T[i],...T[r],...T[n],...T[a],...T[i]),Math.min(x[n],x[r],x[i],x[a])<S.water+.05&&D[1].push(...E[n],...E[i],...E[r],...E[n],...E[a],...E[i])}if((e=>{let[t,n,i,a]=[28,S.sea-840,125,560],o=e=>{let n=e/t;return 70*(4*n*(1-n))**.7*(.45+.75*r(5*n,3,9))},s=(e,r)=>[n-60*r,r?o(e):S.water-1,i+(e/t-.5)*a,.6,.8,0,Z[0],Z[1],-1,Z[2]];for(let n=0;n<t;n++)e.push(...s(n,0),...s(n+1,0),...s(n+1,1),...s(n,0),...s(n+1,1),...s(n,1))})(D[0]),c){let e={relief:c};((e,t)=>{let[r,i]=[S.shore+4,w.sections[2][1]];for(let s=0;s<Ke;s++){let c=e=>a(s,e,31),[l,u]=[r+(i-r)*c(1),3+(qe-3)*c(2)*c(2)];if(u<w.r+1.5&&w.sections.some(([e,t])=>l>e&&l<t))continue;let[d,f,p]=[125+(c(3)<.5?u:-u),.12+.3*c(4)*c(4),.03+.04*c(5)];n(e,Ge,[l,t(l,d)+.2*f,d],o(7*c(5),0),[0,0,0],[f*(.6+c(6)),.7*f,f],[p,p,p])}})(D[0],(t,n)=>s(e,t,n))}return Je.set(t,D),D},Xe=e=>Ye(e)[0],Ze=e=>Ye(e)[1],Qe=`0.05+0.05*sin(T*.55+q.y*.13+4.*vn(q*.05))`,$e=`if(d.y>0.){vec2 q=d.xz/(d.y+.1)*2.+T*.003;float f=vn(q)+.5*vn(q*2.3+5.)+.25*vn(q*5.1);
2
2
  f=smoothstep(1.05,1.4,f)*smoothstep(0.,.05,d.y)*(1.-smoothstep(.12,.4,d.y));
3
3
  s=mix(s,vec3(1.22,1.2,1.17)*(.8+.3*max(dot(d,O),0.)),f*.9);}`,et=e=>`{vec2 q=P.xz;float d=C.x-(${Qe});if(d<0.)discard;\nfloat ds=length(P-E),pf=length(fwidth(q)),fz=${e},fo;vec3 V=(E-P)/ds;\nvec2 w=q+1.5*vn(q*.09+T*.04),gd=vec2(0);\nfor(int i=0;i<(ds<18.?7:5);i++){float k=.6*exp(.66*float(i)),a=(float(i)-2.)*.8;vec2 dr=vec2(cos(a),sin(a));\ngd+=dr*cos(k*dot(dr,w)-T*sqrt(k)*1.3+a*5.)*(1.-smoothstep(.15,.6,k*pf))*(i<5?.055:.04-.04*smoothstep(6.,18.,ds));}\ngd*=.35+.65*smoothstep(0.,.6,d);\nvec3 n=normalize(vec3(-gd.x,1,-gd.y));float fr=.02+.6*pow(clamp(1.-dot(n,V),0.,1.),5.);\nfloat fn=vn(q*1.7+vec2(T*.12,0))*vn(q*5.-vec2(T*.2,T*.07));\nfo=smoothstep(.03+.06*fn,0.,d)+smoothstep(.3,.55,fn+.3*sin(d*14.+T*.8+3.*vn(q*.3)))*(1.-smoothstep(.05,.4,d));\nfo=min(fo,1.)*(1.-smoothstep(.3,1.2,pf)*.5);\nvec3 tr=exp(-vec3(.42,.07,.055)*d*2.4);\nif(Z>1.5){o=vec4(tr*(1.-fr)*(1.-fo)*(1.-fz),1);return;}\nvec4 sq=W*vec4(P,1);sq.xyz=sq.xyz*.5+.5;\nfloat sv=mix(texture(D,vec4(sq.xy,0,sq.z-.0004)),1.,smoothstep(.8,1.,max(max(abs(sq.x-.5),abs(sq.y-.5)),abs(sq.z-.5))*2.));\nvec3 lw=e(X*max(O.y,0.)*sv+H[0]),r=reflect(-V,n);r.y=abs(r.y)+.25;r=normalize(r);\nvec3 sc=mix(vec3(.02,.42,.5),vec3(.004,.09,.3),1.-exp(-d*.18))*lw*(1.-tr.g*tr.g);\nvec3 c=(sc*(1.-fr)+(K1(r,0.)+sv*X*2.*pow(max(dot(n,nz(O+V)),0.),600.))*fr)*(1.-fo)+fo*.9*lw;\nc=mix(c,F.rgb,fz);if(Vn>0)c=hv(c);o=vec4(c,1);return;}`,$=[(w.sections[1][0]+w.sections[1][1])/2,w.sections[2][1]-2],tt=`{vec2 q=P.xz;float y=P.y-${S.water}.,f1=1.-smoothstep(.3,1.,pw*9.),f2=1.-smoothstep(.3,1.,pw*2.5),f3=1.-smoothstep(.3,1.,pw*80.);\nbw=1.-smoothstep(.08,.3+.12*vn(q*.4),y);\nfloat rp=sin((dot(q,vec2(.95,.3))+1.2*vn(q*.3))*18.)*smoothstep(.3,.7,vn(q*.07+5.))*f1*(1.-.6*bw);\nfloat dr=dot(q,vec2(.27,.86))+2.5*vn(q*.04);\nh+=smoothstep(.4,1.6,y)*(.24*(sin(dr)+.35*sin(2.*dr))*smoothstep(.2,.7,vn(q*.025+7.))+.9*vn(q*.06))+.018*rp+f2*.04*(vn(q*2.2)-.5)+f1*.012*(vn(q*6.+3.)-.5)+(1.-smoothstep(.3,1.,pw*40.))*.006*(vn(q*28.)-.5);\nc*=(.88+.24*vn(q*.13+9.))*(1.+.05*rp+f3*.16*(vn(q*170.)-.5)+f1*.07*(vn(q*37.)-.5));\nc*=mix(vec3(1),vec3(.52,.47,.4),bw);\nif(y<0.){vec2 u=q*3.+vn(q*.8)*2.;float ca=vn(u+T*.3)-vn(u+7.-T*.25);c*=1.+.45*f2*pow(max(1.-abs(ca)*2.5,0.),6.)*smoothstep(0.,-.3,y);}\nfloat wl=0.05-(${Qe});bw*=.35+.65*smoothstep(wl+.12,wl,y);float cz=abs(q.y-125.);if(cz<40.){\nfloat ht=max(max(1.-abs(q.x-${$[0]}.)/26.,1.-abs(q.x-${$[1]}.)/14.),0.),\nwd=cz/(1.+1.2*smoothstep(${$[1]-14}.,${$[1]+6}.,q.x))+6.*vn(vec2(q.x*.06,q.y*.15))+30.\n-30.*smoothstep(8.,20.,q.x)*(1.-smoothstep(${$[1]+8}.,${$[1]+26}.,q.x))-3.*ht;\nc*=mix(vec3(1),vec3(.13,.09,.07),(1.-smoothstep(18.,29.,wd))*(.7+.3*vn(q*.7)));\nif(wd<19.){vec2 u=q*2.5+2.*vn(q*.3),ic=floor(u),fc=fract(u);float d1=9.,d2=9.,id=0.;\nfor(int j=0;j<9;j++){vec2 g=vec2(j%3,j/3)-1.,o=ic+g,pt=g+vec2(h3(vec3(o,1)),h3(vec3(o,2)))-fc;float d=dot(pt,pt);\nif(d<d1){d2=d1;d1=d;id=h3(vec3(o,3));}else if(d<d2)d2=d;}\nfloat fk=1.-smoothstep(.3,1.,pw*8.),e=sqrt(d2)-sqrt(d1),fe=fk*min(19.-wd,1.),ck=mix(1.,smoothstep(0.,.1,e),fe),cb=mix(1.,smoothstep(0.,.25,e),fe),a=step(wd+1.5*id,18.),gl=a*smoothstep(.8,.86,vn(q*.3));\nh=cb*mix(h,.02+f2*.012*vn(q*5.),a)*(1.-gl);c*=.4+.6*ck;\nc=mix(c,vec3(1,.94,.88)*(.03+.05*id+.2*ck*vn(q*2.5)*vn(q*9.))*ck*(1.-.7*gl)+vec3(2.,.4,.05)*(1.-ck)*fk*ht*step(.75,id)*smoothstep(9.,4.,cz),a);\nbw=mix(bw,gl,a);}}}`,nt=`c+=bw*k*(.02+.3*fr);`,rt=-1.05,it=`{vec2 q=vec2(P.x,abs(n.y)>.7?P.z:P.y*1.3)*.5,d=abs(fract(q)-.5);hk=smoothstep(.25,.55,C.x);
4
4
  c*=1.-.4*hk*smoothstep(.006+pw,.006,min(d.x,d.y))*(1.-smoothstep(.02,.09,pw));if(dot(n,E-P)<0.){c*=.18;hk=0.;}}`,at=e=>`{float ds=length(P-E),fz=${e};vec3 V=(E-P)/ds,n=normalize(N)*sign(dot(N,V));float fr=.07+.8*pow(max(1.-abs(dot(n,V)),0.),4.);\nif(Z>1.5){o=vec4(vec3(.56,.7,.68)*(1.-fr)*(1.-fz),1);return;}\nvec3 c=(K1(reflect(-V,n),0.)+X*3.*pow(max(dot(n,nz(O+V)),0.),300.))*fr;c=mix(c,F.rgb,fz);if(Vn>0)c=hv(c);o=vec4(c,1);return;}`,ot=`c+=hk*(mix(vec3(.8,.72,.56),k,smoothstep(-.3,.05,r.y))*(.15+.6*fr)+vec3(.3,.27,.21)*clamp(.5-m.y,0.,1.));`;export{A as C,he as D,T as E,re as S,ge as T,w as _,tt as a,te as b,et as c,Xe as d,ze as f,S as g,ve as h,it as i,nt as l,j as m,ot as n,Be as o,D as p,rt as r,$e as s,at as t,Ze as u,Fe as v,ne as w,O as x,E as y};
package/dist/room.js CHANGED
@@ -1 +1 @@
1
- export { n as MAPS, r as RULES, t as Room } from "./assets/room-CPp_hgii.js";
1
+ export { n as MAPS, r as RULES, t as Room } from "./assets/room-RIvmKR68.js";
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Room } from "./assets/room-CPp_hgii.js";
1
+ import { t as Room } from "./assets/room-RIvmKR68.js";
2
2
  import { WebSocketServer } from "ws";
3
3
  // src/server/index.ts
4
4
  /** `/demo` → "demo", `/` → "default". Undecodable paths are kept as is. */
@@ -1 +1 @@
1
- import{Dt as e,Et as t,pn as n,r}from"./brick-D5SJVjYo.js";var i=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),a=[1,2,3,4,6].map(t=>{let n=(1+Math.sqrt(5))/2,r=[[-1,n,0],[1,n,0],[-1,-n,0],[1,-n,0],[0,-1,n],[0,1,n],[0,-1,-n],[0,1,-n],[n,0,-1],[n,0,1],[-n,0,-1],[-n,0,1]].map(t=>e(t));return[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]].map(e=>e.map(e=>r[e])).flatMap(([n,r,i])=>{let a=(a,o)=>e(n.map((e,n)=>e+((r[n]-e)*a+(i[n]-e)*o)/t)),o=[];for(let e=0;e<t;e++)for(let n=0;e+n<t;n++)o.push([a(e,n),a(e+1,n),a(e,n+1)]),e+n<t-1&&o.push([a(e+1,n),a(e+1,n+1),a(e,n+1)]);return o})}),o=(o,s,c,l,u,d,f,p)=>{let m=/* @__PURE__ */ new Map,h=(typeof s==`number`?a[s-1]:s).map(e=>e.map(e=>{let t=(e=>e.map(e=>Math.round(1e4*e)).join())(e),n=m.get(t);if(!n){let r=c(e);n={p:r,n:[0,0,0],low:!!p&&r[1]<p(r[0],r[2])-.05},m.set(t,n)}return n}));for(let e of h){let n=r(t(e[1].p,e[0].p),t(e[2].p,e[0].p));e.forEach(e=>e.n=[e.n[0]+n[0],e.n[1]+n[1],e.n[2]+n[2]])}for(let a of h){if(a.every(e=>e.low))continue;let s=r(t(a[1].p,a[0].p),t(a[2].p,a[0].p)),c=Math.abs(s[1])>Math.max(Math.abs(s[0]),Math.abs(s[2])),p=Math.abs(s[0])>Math.abs(s[2]);for(let{p:t,n:r}of a){let a=Math.hypot(...r)>1e-12?e(r):[0,1,0];o.push(...t,...a,...c?[t[0],t[2]]:p?[t[2]+3*d,t[1]]:[t[0]+3*d,t[1]],n.ROCK,.85*f*(.55+.45*i((t[1]-l)/(.3*(u-l)))))}}};export{o as t};
1
+ import{Dt as e,Et as t,pn as n,r}from"./brick-KajeVVVE.js";var i=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),a=[1,2,3,4,6].map(t=>{let n=(1+Math.sqrt(5))/2,r=[[-1,n,0],[1,n,0],[-1,-n,0],[1,-n,0],[0,-1,n],[0,1,n],[0,-1,-n],[0,1,-n],[n,0,-1],[n,0,1],[-n,0,-1],[-n,0,1]].map(t=>e(t));return[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]].map(e=>e.map(e=>r[e])).flatMap(([n,r,i])=>{let a=(a,o)=>e(n.map((e,n)=>e+((r[n]-e)*a+(i[n]-e)*o)/t)),o=[];for(let e=0;e<t;e++)for(let n=0;e+n<t;n++)o.push([a(e,n),a(e+1,n),a(e,n+1)]),e+n<t-1&&o.push([a(e+1,n),a(e+1,n+1),a(e,n+1)]);return o})}),o=(o,s,c,l,u,d,f,p)=>{let m=/* @__PURE__ */ new Map,h=(typeof s==`number`?a[s-1]:s).map(e=>e.map(e=>{let t=(e=>e.map(e=>Math.round(1e4*e)).join())(e),n=m.get(t);if(!n){let r=c(e);n={p:r,n:[0,0,0],low:!!p&&r[1]<p(r[0],r[2])-.05},m.set(t,n)}return n}));for(let e of h){let n=r(t(e[1].p,e[0].p),t(e[2].p,e[0].p));e.forEach(e=>e.n=[e.n[0]+n[0],e.n[1]+n[1],e.n[2]+n[2]])}for(let a of h){if(a.every(e=>e.low))continue;let s=r(t(a[1].p,a[0].p),t(a[2].p,a[0].p)),c=Math.abs(s[1])>Math.max(Math.abs(s[0]),Math.abs(s[2])),p=Math.abs(s[0])>Math.abs(s[2]);for(let{p:t,n:r}of a){let a=Math.hypot(...r)>1e-12?e(r):[0,1,0];o.push(...t,...a,...c?[t[0],t[2]]:p?[t[2]+3*d,t[1]]:[t[0]+3*d,t[1]],n.ROCK,.85*f*(.55+.45*i((t[1]-l)/(.3*(u-l)))))}}};export{o as t};
@@ -1 +1 @@
1
- import{pn as e}from"./brick-D5SJVjYo.js";var t,n=Object.keys(e).length,r=(e,t,n)=>{let r=Math.imul(e,374761393)+Math.imul(t,668265263)+Math.imul(n,144665)|0;return r=Math.imul(r^r>>>13,1274126177),((r^r>>>16)>>>0)/4294967296},i=(e,t,n,i)=>{let[a,o]=[Math.floor(e),Math.floor(t)],[s,c]=[e-a,t-o].map(e=>e*e*(3-2*e)),l=(e,t)=>r((a+e)%n,(o+t)%n,i);return(l(0,0)*(1-s)+l(1,0)*s)*(1-c)+(l(0,1)*(1-s)+l(1,1)*s)*c},a=(e,t,n,r,a)=>{let[o,s]=[0,.5];for(let c=0;c<r;c++,s/=2)o+=s*i(e*(1<<c),t*(1<<c),n<<c,a+c);return o/(1-2*s)},o=(e,t,n)=>e.map((e,r)=>e+(t[r]-e)*n),s=(e,t)=>e.map(e=>e*t),c=e=>Math.min(Math.max(e,0),1),l=2*Math.PI,u=[];u[e.BRICK]=(e,t)=>{let n=Math.floor(8*t),a=4*e+.5*(1&n),[o,l,u]=[Math.floor(a)%4,a%1,8*t%1],d=i(16*e,16*t,16,5),f=.8+.4*d;return l<.05||u<.1?[s([165,160,150],.7+.3*f),.1+.1*d]:[s([170,78,56],(.8+.4*r(o,n,1))*f*(.85+.15*u)),.7+.2*d+.1*c(12*Math.min(l-.05,u-.1))]},u[e.TILE]=(e,t)=>{let[n,a]=[Math.floor(4*e),Math.floor(4*t)],[o,l]=[4*e%1,4*t%1],u=i(16*e,16*t,16,7),d=.9+.2*u;return o<.05||l<.05?[s([85,85,80],d),.1]:[s([196,190,172],d*(.88+.08*(n+a&1)+.1*r(n,a,2))),.8+.1*u+.1*c(14*(Math.min(o,l)-.05))]},u[e.LAVA]=(e,t)=>{let n=a(4*e,4*t,4,4,11),r=Math.max(0,1-7*Math.abs(n-.5))**2;return[o(o([55,8,4],[230,70,8],n),[255,215,90],r),.5]},u[e.STONE]=(e,t)=>{let n=a(8*e,8*t,8,4,3);return[s([128,124,120],.45+.7*(1.3*n+.1*r(Math.floor(128*e),Math.floor(128*t),4))),c(1.4*n-.2)]},u[e.METAL]=(e,t)=>{let[n,a,l,u]=[Math.floor(2*e),Math.floor(2*t),2*e%1,2*t%1],d=c(6*(i(8*e,8*t,8,13)-.68)),f=e=>.4*Math.min(Math.max(Math.round((e-.1)/.4),0),2)+.1,[p,m]=[f(l),f(u)],h=p==m&&p==.5?1:Math.hypot(l-p,u-m),g=c(1-h/.07),_=s([98,108,124],(.9+.2*i(32*e,32*t,32,9)+.12*r(n,a,6))*(1+.3*g)*(.65+.35*c((h-.06)/.04)));return Math.min(l,u,1-l,1-u)<.03?[s([40,44,50],1+d),.05]:[o(_,[105,68,45],.7*d),.5+.1*(1-d)+.4*g]},u[e.WOOD]=(e,t)=>{let n=Math.floor(8*t),a=2*e+2*r(n,0,8),[s,u,d]=[Math.floor(a)%2,a%1,8*t%1],f=r(n,s,3),p=.5+.5*Math.sin(l*(40*t+2.5*i(4*e,4*t,4,21)+7*f));return d<.08||u<.015?[[28,18,10],.05]:[o([92,58,32],[158,106,62],.6*p+.35*f),.7+.15*p+.15*c(15*(d-.08))]},u[e.MOSS]=(e,t)=>{let n=Math.floor(4*t),l=2*e+.5*(1&n),[u,d,f]=[Math.floor(l)%2,l%1,4*t%1],p=Math.min(d,1-d,.5*(f<.5?f:1-f)),m=d<.04||f<.06,h=c(12*(.3*a(12*e,12*t,12,3,17)-.03-p)),g=i(64*e,64*t,64,19),_=s([128,126,118],(.7+.4*r(u,n,5))*(.7+.5*i(16*e,16*t,16,15)));return[o(m?s(_,.45):_,o([52,100,34],[96,148,56],g),h),m?.1+.6*h*g:.6+.2*c(30*p)+.2*h*g]},u[e.GRATE]=(e,t)=>{let[n,r]=[8*e%1,8*t%1],a=Math.max(Math.abs(n-.5),Math.abs(r-.5)),l=Math.min(Math.abs(n-.5),Math.abs(r-.5))>.43,u=i(16*e,16*t,16,23);return a<.36?[[9,9,12],0]:[s(o([104,108,116],[96,80,68],c(4*(u-.55))),(l?1.25:1)-2.2*(.5-a)+.2*u),l?1:.6+.4*c(12*(a-.36))]},u[e.CONCRETE]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],o=a(4*e,4*t,4,3,41),c=r(Math.floor(128*e),Math.floor(128*t),43)>.992,l=Math.hypot(n%.5-.25,i%.5-.25)<.02,u=(.94+.1*o+.03*r(Math.floor(2*e),Math.floor(2*t),44))*(c||l?.9:1);return n<.015||i<.015?[s([160,164,172],u),.3]:[s([206,209,214],u),l?.5:.8+.2*o-(c?.15:0)]},u[e.GLASS]=(e,t)=>{let n=2*e%1,r=((n+.7*t)%1-.5)/.12,i=Math.exp(-r*r);return n<.03||t<.03?[s([150,158,170],1-.3*n),.9]:[o(o([7,20,44],[48,88,136],t**2),[120,160,200],.18*i),.4]},u[e.STEEL]=(e,t)=>{let n=Math.floor(128*t),a=.5*r(n,3,31)+.5*i(8*e,0,8,n+7),o=4*e%1;return o<.03?[[60,66,76],.1]:[s([176,184,196],.8+.35*a+(o>.97?.15:0)),.6+.2*a]},u[e.PAINT]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],a=r(Math.floor(128*e),Math.floor(128*t),47);return n<.02||i<.02?[[200,200,206],.3]:[s([246,246,248],.96+.06*a),.85+.04*a]},u[e.ROCK]=(e,t)=>{let n=a(4*e,4*t,4,4,21),l=c(8*(i(2*e,2*t,2,24)-.55))*Math.max(0,1-110*Math.abs(a(2*e,2*t,2,3,23)-.5)),[u,d]=[Math.floor(64*e),Math.floor(64*t)],[f,p]=[64*e%1-.5,64*t%1-.5],m=r(u,d,25),h=m<.06?c(1-Math.hypot(f,p)/(.2+3*m)):0,g=m>.96?.35:0;return[o(o(o(s([84,82,79],.65+.6*n+.1*r(Math.floor(128*e),Math.floor(128*t),27)),[150,146,140],g),[30,29,28],.7*h),[26,25,24],.7*l),c(.35+.5*n-.3*h-.25*l)]};var d,f,p=()=>t??=m(),m=()=>{let e=new Uint8ClampedArray(128*n*128*4);return u.forEach((t,n)=>{for(let r=0;r<16384;r++){let[i,a]=t(r%128/128,Math.floor(r/128)/128);e.set([...i,255*a],4*(128*n*128+r))}}),e},[h,g]=[6,16],_=()=>{for(;v(););return d},v=()=>{if(d)return!1;let e=(f??=function*(){let e=h,t=e*g,n=3,r=Float64Array.from({length:e*e*e*3},()=>.1+.8*(n=16807*n%2147483647)/2147483647),i=new Uint8Array(t*t*t);for(let n=0;n<t;n++){n%8==7&&(yield);let a=(n+.5)/g,o=Math.floor(a);for(let s=0;s<t;s++){let c=(s+.5)/g,l=Math.floor(c);for(let u=0;u<t;u++){let d=(u+.5)/g,f=Math.floor(d),p=9,m=9;for(let t=o-1;t<=o+1;t++)for(let n=l-1;n<=l+1;n++)for(let i=f-1;i<=f+1;i++){let o=3*((i+e)%e+(n+e)%e*e+(t+e)%e*e*e),s=d-i-r[o],l=c-n-r[o+1],u=a-t-r[o+2],f=s*s+l*l+u*u;f<p?(m=p,p=f):f<m&&(m=f)}i[u+(s+n*t)*t]=255*Math.min(Math.sqrt(m)-Math.sqrt(p),1)}}}return i}()).next();return e.done&&([d,f]=[e.value,void 0]),!e.done};export{_ as a,r as i,h as n,v as o,g as r,p as s,n as t};
1
+ import{pn as e}from"./brick-KajeVVVE.js";var t,n=Object.keys(e).length,r=(e,t,n)=>{let r=Math.imul(e,374761393)+Math.imul(t,668265263)+Math.imul(n,144665)|0;return r=Math.imul(r^r>>>13,1274126177),((r^r>>>16)>>>0)/4294967296},i=(e,t,n,i)=>{let[a,o]=[Math.floor(e),Math.floor(t)],[s,c]=[e-a,t-o].map(e=>e*e*(3-2*e)),l=(e,t)=>r((a+e)%n,(o+t)%n,i);return(l(0,0)*(1-s)+l(1,0)*s)*(1-c)+(l(0,1)*(1-s)+l(1,1)*s)*c},a=(e,t,n,r,a)=>{let[o,s]=[0,.5];for(let c=0;c<r;c++,s/=2)o+=s*i(e*(1<<c),t*(1<<c),n<<c,a+c);return o/(1-2*s)},o=(e,t,n)=>e.map((e,r)=>e+(t[r]-e)*n),s=(e,t)=>e.map(e=>e*t),c=e=>Math.min(Math.max(e,0),1),l=2*Math.PI,u=[];u[e.BRICK]=(e,t)=>{let n=Math.floor(8*t),a=4*e+.5*(1&n),[o,l,u]=[Math.floor(a)%4,a%1,8*t%1],d=i(16*e,16*t,16,5),f=.8+.4*d;return l<.05||u<.1?[s([165,160,150],.7+.3*f),.1+.1*d]:[s([170,78,56],(.8+.4*r(o,n,1))*f*(.85+.15*u)),.7+.2*d+.1*c(12*Math.min(l-.05,u-.1))]},u[e.TILE]=(e,t)=>{let[n,a]=[Math.floor(4*e),Math.floor(4*t)],[o,l]=[4*e%1,4*t%1],u=i(16*e,16*t,16,7),d=.9+.2*u;return o<.05||l<.05?[s([85,85,80],d),.1]:[s([196,190,172],d*(.88+.08*(n+a&1)+.1*r(n,a,2))),.8+.1*u+.1*c(14*(Math.min(o,l)-.05))]},u[e.LAVA]=(e,t)=>{let n=a(4*e,4*t,4,4,11),r=Math.max(0,1-7*Math.abs(n-.5))**2;return[o(o([55,8,4],[230,70,8],n),[255,215,90],r),.5]},u[e.STONE]=(e,t)=>{let n=a(8*e,8*t,8,4,3);return[s([128,124,120],.45+.7*(1.3*n+.1*r(Math.floor(128*e),Math.floor(128*t),4))),c(1.4*n-.2)]},u[e.METAL]=(e,t)=>{let[n,a,l,u]=[Math.floor(2*e),Math.floor(2*t),2*e%1,2*t%1],d=c(6*(i(8*e,8*t,8,13)-.68)),f=e=>.4*Math.min(Math.max(Math.round((e-.1)/.4),0),2)+.1,[p,m]=[f(l),f(u)],h=p==m&&p==.5?1:Math.hypot(l-p,u-m),g=c(1-h/.07),_=s([98,108,124],(.9+.2*i(32*e,32*t,32,9)+.12*r(n,a,6))*(1+.3*g)*(.65+.35*c((h-.06)/.04)));return Math.min(l,u,1-l,1-u)<.03?[s([40,44,50],1+d),.05]:[o(_,[105,68,45],.7*d),.5+.1*(1-d)+.4*g]},u[e.WOOD]=(e,t)=>{let n=Math.floor(8*t),a=2*e+2*r(n,0,8),[s,u,d]=[Math.floor(a)%2,a%1,8*t%1],f=r(n,s,3),p=.5+.5*Math.sin(l*(40*t+2.5*i(4*e,4*t,4,21)+7*f));return d<.08||u<.015?[[28,18,10],.05]:[o([92,58,32],[158,106,62],.6*p+.35*f),.7+.15*p+.15*c(15*(d-.08))]},u[e.MOSS]=(e,t)=>{let n=Math.floor(4*t),l=2*e+.5*(1&n),[u,d,f]=[Math.floor(l)%2,l%1,4*t%1],p=Math.min(d,1-d,.5*(f<.5?f:1-f)),m=d<.04||f<.06,h=c(12*(.3*a(12*e,12*t,12,3,17)-.03-p)),g=i(64*e,64*t,64,19),_=s([128,126,118],(.7+.4*r(u,n,5))*(.7+.5*i(16*e,16*t,16,15)));return[o(m?s(_,.45):_,o([52,100,34],[96,148,56],g),h),m?.1+.6*h*g:.6+.2*c(30*p)+.2*h*g]},u[e.GRATE]=(e,t)=>{let[n,r]=[8*e%1,8*t%1],a=Math.max(Math.abs(n-.5),Math.abs(r-.5)),l=Math.min(Math.abs(n-.5),Math.abs(r-.5))>.43,u=i(16*e,16*t,16,23);return a<.36?[[9,9,12],0]:[s(o([104,108,116],[96,80,68],c(4*(u-.55))),(l?1.25:1)-2.2*(.5-a)+.2*u),l?1:.6+.4*c(12*(a-.36))]},u[e.CONCRETE]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],o=a(4*e,4*t,4,3,41),c=r(Math.floor(128*e),Math.floor(128*t),43)>.992,l=Math.hypot(n%.5-.25,i%.5-.25)<.02,u=(.94+.1*o+.03*r(Math.floor(2*e),Math.floor(2*t),44))*(c||l?.9:1);return n<.015||i<.015?[s([160,164,172],u),.3]:[s([206,209,214],u),l?.5:.8+.2*o-(c?.15:0)]},u[e.GLASS]=(e,t)=>{let n=2*e%1,r=((n+.7*t)%1-.5)/.12,i=Math.exp(-r*r);return n<.03||t<.03?[s([150,158,170],1-.3*n),.9]:[o(o([7,20,44],[48,88,136],t**2),[120,160,200],.18*i),.4]},u[e.STEEL]=(e,t)=>{let n=Math.floor(128*t),a=.5*r(n,3,31)+.5*i(8*e,0,8,n+7),o=4*e%1;return o<.03?[[60,66,76],.1]:[s([176,184,196],.8+.35*a+(o>.97?.15:0)),.6+.2*a]},u[e.PAINT]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],a=r(Math.floor(128*e),Math.floor(128*t),47);return n<.02||i<.02?[[200,200,206],.3]:[s([246,246,248],.96+.06*a),.85+.04*a]},u[e.ROCK]=(e,t)=>{let n=a(4*e,4*t,4,4,21),l=c(8*(i(2*e,2*t,2,24)-.55))*Math.max(0,1-110*Math.abs(a(2*e,2*t,2,3,23)-.5)),[u,d]=[Math.floor(64*e),Math.floor(64*t)],[f,p]=[64*e%1-.5,64*t%1-.5],m=r(u,d,25),h=m<.06?c(1-Math.hypot(f,p)/(.2+3*m)):0,g=m>.96?.35:0;return[o(o(o(s([84,82,79],.65+.6*n+.1*r(Math.floor(128*e),Math.floor(128*t),27)),[150,146,140],g),[30,29,28],.7*h),[26,25,24],.7*l),c(.35+.5*n-.3*h-.25*l)]};var d,f,p=()=>t??=m(),m=()=>{let e=new Uint8ClampedArray(128*n*128*4);return u.forEach((t,n)=>{for(let r=0;r<16384;r++){let[i,a]=t(r%128/128,Math.floor(r/128)/128);e.set([...i,255*a],4*(128*n*128+r))}}),e},[h,g]=[6,16],_=()=>{for(;v(););return d},v=()=>{if(d)return!1;let e=(f??=function*(){let e=h,t=e*g,n=3,r=Float64Array.from({length:e*e*e*3},()=>.1+.8*(n=16807*n%2147483647)/2147483647),i=new Uint8Array(t*t*t);for(let n=0;n<t;n++){n%8==7&&(yield);let a=(n+.5)/g,o=Math.floor(a);for(let s=0;s<t;s++){let c=(s+.5)/g,l=Math.floor(c);for(let u=0;u<t;u++){let d=(u+.5)/g,f=Math.floor(d),p=9,m=9;for(let t=o-1;t<=o+1;t++)for(let n=l-1;n<=l+1;n++)for(let i=f-1;i<=f+1;i++){let o=3*((i+e)%e+(n+e)%e*e+(t+e)%e*e*e),s=d-i-r[o],l=c-n-r[o+1],u=a-t-r[o+2],f=s*s+l*l+u*u;f<p?(m=p,p=f):f<m&&(m=f)}i[u+(s+n*t)*t]=255*Math.min(Math.sqrt(m)-Math.sqrt(p),1)}}}return i}()).next();return e.done&&([d,f]=[e.value,void 0]),!e.done};export{_ as a,r as i,h as n,v as o,g as r,p as s,n as t};
@@ -1 +1 @@
1
- import{$ as e,A as t,Ct as n,D as r,Dt as i,E as a,Et as o,F as s,G as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,St as y,Tt as b,U as x,W as S,X as C,Y as ee,Z as te,a as w,at as ne,bt as T,d as re,hn as ie,ht as ae,i as E,j as D,jt as O,kt as oe,lt as k,n as A,o as se,pn as j,q as ce,r as M,t as le,u as ue,un as de,vn as fe,wt as N,xt as pe,yt as me}from"./brick-D5SJVjYo.js";import{i as P}from"./textures-ry-qPiMg.js";import{t as he}from"./stone-CnnB3DM5.js";var ge=[.8,.82,.86],_e=[.35,.36,.4],ve=x.filter(e=>e.min[1]===2.48&&e.max[1]===4),[F,I]=S,L=[F,0,I],R=22.4,ye=[-.6,.6,.53],be=[[2,1],[0,2],[0,1]],xe=[1.25,1.3,1.4],Se=[.56,.48,.28],Ce=[.04,.04,.05],{CONCRETE:we,METAL:Te,PAINT:Ee}=j,De=(e,t,n,r=1,[i,a]=be[1])=>{for(let o of[0,1,2,0,2,3])e.push(...t[o],...ye),typeof n==`number`?e.push(t[o][i],t[o][a],n,r):e.push(n[0],n[1],-2,n[2])},z=(e,t,n,r,i,a,o)=>De(e,[[0,0],[1,0],[1,1],[0,1]].map(([e,a])=>{let o=[0,0,0],[s,c]=[(t+1)%3,(t+2)%3];return[o[t],o[s],o[c]]=[n,(e?i:r)[s],(a?i:r)[c]],o}),a,o,be[t]),Oe=(e,{min:t,max:n,top:r,side:i},a=0)=>{for(let o=0;o<3;o++)z(e,o,t[o],t,n,i,a+(o==1?.4:1.25-.15*o)),z(e,o,n[o],t,n,o==1?r:i,a+(o==1?1.85:1.25-.15*o))},ke=(e,t)=>{let n=e.length;t();let r=oe(e,0);for(let t=n;t<e.length;t+=10){if(r[t+8]==-1){let e=2.2*(.72+.28*r[t+4]-.12*Math.abs(r[t+3]));r[t+6]*=e,r[t+7]*=e,r[t+9]*=e}[r[t+3],r[t+4],r[t+5]]=ye}},[B,Ae,V,H,je,Me]=[[.86,.87,.9],[.55,.57,.6],[.32,.33,.36],[.07,.075,.085],[.42,.52,.66],[.2,.13,.08]],[U,W,G,Ne,Pe,Fe]=[[.3,.8,1],[.35,1,.5],[1,.7,.25],[1,.2,.15],[.7,.35,1],[1,.35,.85]],Ie=[[-1,96.2,242.65,98.6,242.7,1,2.3,3],[-1,96.2,229.3,98.6,229.35,1,2.3,1],[-1,61.4,242.65,63.8,242.7,1,2.3,3],[-1,61.4,229.3,63.8,229.35,1,2.3,1],[-1,73.3,252.4,73.35,255.4,4.3,5.5,0],[-1,86.65,252.4,86.7,255.4,4.3,5.5,2],[-1,73.3,216.6,73.35,219.6,1,2.3,0],[-1,86.65,216.6,86.7,219.6,1,2.3,2]],Le=(e,t,n,r,i,a)=>{for(let[o,s,c]of[[r,r+.1,0],[i-.1,i,0],[r,i,a-.1]])z(e,t,n,[o,c,o],[s,a,s],xe)},Re=(e,t,n,r,i,a,o,s=[])=>{[...s,[i,i,0]].forEach(([i,c,l],u)=>{let[d,f]=[[0,0,0],[0,a,0]];[d[2-t],f[2-t]]=[u?s[u-1][1]:r,i],z(e,t,n,d,f,Ee,o),c>i&&([d[1],d[2-t],f[2-t]]=[l,i,c],z(e,t,n,d,f,Ee,o))})},ze=[[-O/4-Math.asin(te[0][2]/R),-O/4+Math.asin(te[0][2]/R),te[0][3]],[-Math.acos((_[1].min[0]-F)/R),Math.asin((_[0].max[2]-I)/R),te[1][3]]],Be=e=>e.filter((t,n)=>{let r=n-n%30;return Math.max(e[r],e[r+10],e[r+20])>-.49}),Ve=Be(T(N([[1,0],[1,1]],12),ge)),He=Be(T(N([[1.06,0],[1.06,.3]],12),_e)),[K,Ue]=S,We=22.4,q=O/48,Ge=[.4,.42,.46],Ke=[.27,.29,.33],[J,qe,Je,Ye,Xe,Ze,Qe]=[[.16,.17,.2],[.6,.62,.66],[1,.8,.45],[.7,.9,1],[1,.6,.2],[1,.12,.08],[.35,1,.5]],$e=[.6,.64,.48],et=T(N([[1,0],[1,1]],6),[1,1,1]),tt=T(N([[0,-1],[1,0],[0,1]],6),[1,1,1]),nt=T(N([[0,0],[1,.4],[.93,.42],[0,.12]],12),[.82,.84,.88]),rt=(e,t,r,i,a=qe)=>n(e,et,t,r,$e,1,i,a),it=(e,t,n,r,i=2.2)=>{let a=e.length;y(e,tt,t,le,[0,0,0],n,r),i&&ue(e,a,i)},at=(e,t,n)=>w(e,1.8,()=>E(e,[[t-.15,.03,n-.15],[t+.15,.03,n-.15],[t+.15,.03,n+.15],[t-.15,.03,n+.15]],Ye,[t,-5,n])),ot=e=>[We*Math.cos(e*O/40),12*Math.sin(e*O/40)],Y=(e,t,n=.02)=>{let r=Math.max(t-5,0),a=Math.floor(r),[o,s]=[ot(a),ot(a+1)],[c,l]=[o[0]+(s[0]-o[0])*(r-a),o[1]+(s[1]-o[1])*(r-a)],u=i([c/We/We,l/144,0]),d=c*Math.cos(q/2)/Math.cos((e%q+q)%q-q/2)+n*u[0];return[K+d*Math.cos(e),Math.min(t,5)+l+n*u[1],Ue+d*Math.sin(e)]},st=ze.map(([e,t])=>[e-.03,t+.03]),ct=e=>!st.some(([t,n])=>[e,e-O].some(e=>e>t&&e<n)),lt=[...Array.from({length:35},(e,t)=>(2*t+1)*O/70).filter(e=>ct(e-.03)&&ct(e+.03)).map(e=>{let[t,n]=[Math.cos(e),Math.sin(e)];return[K+22.419999999999998*t,4.02,Ue+22.419999999999998*n,t,n,.38,0]}),...C.flatMap(({min:e,max:t})=>[-1,1].flatMap(n=>[-2,2].map(r=>[(n>0?t[0]:e[0])+.02*n,3.1,(e[2]+t[2])/2+r,n,0,.45,1]))).filter(([e,,t])=>!_.some(n=>e>n.min[0]-.5&&e<n.max[0]+.5&&t>n.min[2]-.6&&t<n.max[2]+.6))],ut=(e,[t,n,r,i,a],o,s,c)=>E(e,Array.from({length:12},(e,c)=>{let l=o*Math.cos(c*O/12);return[t+s*i-a*l,n+o*Math.sin(c*O/12),r+s*a+i*l]}),c,[t-i,n,r-a]),[dt,ft]=[160,280],pt=[80,0,140],mt=pt,ht=i([.3,.62,-.75]),X=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),Z=(e,t,n)=>{let[r,i]=[Math.floor(e),Math.floor(t)],[a,o]=[e-r,t-i].map(e=>e*e*(3-2*e)),s=(e,t)=>P(r+e,i+t,n);return(s(0,0)*(1-a)+s(1,0)*a)*(1-o)+(s(0,1)*(1-a)+s(1,1)*a)*o},gt=(e,t,n)=>.55*Z(e,t,n)+.3*Z(2*e,2*t,n+1)+.15*Z(4*e,4*t,n+2),_t=T(N([[1,0],[1,1]],6),[.5,.52,.56]),vt=T(N([[0,-1],[1,0],[0,1]],6),[1,1,1]),yt=T(N([[0,0],[.5,1.6],[.85,3.5],[1,6],[1,10],[.8,12.5],[.55,14],[0,14]],12),[.9,.9,.92]),bt=T(N([[0,0],[2.2,.6],[0,.9]],12),[.8,.82,.86]),xt=(e,t,n)=>{let r=e=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]-n,a=[],o=e.map(e=>{let t=[];return e.forEach((n,i)=>{let o=e[(i+1)%e.length],[s,c]=[r(n),r(o)];if(s<=0&&t.push(n),s*c<0){let e=s/(s-c),r=[n[0]+(o[0]-n[0])*e,n[1]+(o[1]-n[1])*e,n[2]+(o[2]-n[2])*e];t.push(r),a.some(e=>Math.abs(e[0]-r[0])+Math.abs(e[1]-r[1])+Math.abs(e[2]-r[2])<1e-9)||a.push(r)}}),t}).filter(e=>e.length>2);if(a.length>2){let e=a.reduce((e,t)=>e.map((e,n)=>e+t[n]/a.length),[0,0,0]),n=i(M(t,Math.abs(t[1])<.9?[0,1,0]:[1,0,0])),r=M(t,n),s=t=>{let i=[t[0]-e[0],t[1]-e[1],t[2]-e[2]];return Math.atan2(i[0]*r[0]+i[1]*r[1]+i[2]*r[2],i[0]*n[0]+i[1]*n[1]+i[2]*n[2])};o.push(a.sort((e,t)=>s(e)-s(t)))}return o},St=[0,1,2].flatMap(e=>[-1,1].map(t=>[[-1,-1],[1,-1],[1,1],[-1,1]].map(([n,r])=>{let i=[0,0,0];return i[e]=1.2*t,i[(e+1)%3]=1.2*n,i[(e+2)%3]=1.2*r,i}))),Ct=(e,t,[n,r,a],o,s,c=!0)=>{let l=(e,t)=>P(e,t,o),u=xt(St,[0,-1,0],.35),d=(e,t,n)=>{let r=Math.sqrt(1-e*e);u=xt(u,[r*Math.cos(t),e,r*Math.sin(t)],n)};d(.92+.08*l(0,1),O*l(0,2),.72+.15*l(0,3));for(let[e,t,n,r,i,a]of[[7,-.4,.2,.62,.2,0],[8,-.05,.25,.74,.18,.3],[6,.45,.3,.6,.2,.6],[c?14:0,-.22,.2,.78,.1,.5],[c?12:0,.24,.2,.76,.1,.15],[c?9:0,.66,.2,.74,.1,.4]])for(let o=0;o<e;o++){let s=10*e+o;d(t+n*l(s,1),O*((o+a+.45*l(s,2))/e),r+i*l(s,3))}let[f,p]=[.8+.4*P(o,1,9),O*P(o,2,9)],[m,h]=[Math.cos(p),Math.sin(p)],g=([e,i,o])=>{let[s,c]=[e*n*f,o*a*(2-f)];return[t[0]+s*m-c*h,t[1]+i*r,t[2]+s*h+c*m]};u.forEach((n,r)=>{let a=n.map(g).filter((e,t,n)=>Math.hypot(...e.map((e,r)=>e-n[(t+n.length-1)%n.length][r]))>1e-5);if(a.length<3)return;let o=i(M([a[1][0]-a[0][0],a[1][1]-a[0][1],a[1][2]-a[0][2]],[a[2][0]-a[0][0],a[2][1]-a[0][1],a[2][2]-a[0][2]]));o[0]*(a[0][0]-t[0])+o[1]*(a[0][1]-t[1])+o[2]*(a[0][2]-t[2])<0&&(a.reverse(),o.forEach((e,t)=>o[t]=-e));let c=i(M(o,Math.abs(o[1])<.9?[0,1,0]:[1,0,0])),u=M(o,c),d=.85*s*(.88+.24*l(r,7))*(.8+.2*Math.sqrt(Math.max(o[1]+1,0)/2)),f=e=>[...e,...o,e[0]*c[0]+e[1]*c[1]+e[2]*c[2]+7*l(0,5),e[0]*u[0]+e[1]*u[1]+e[2]*u[2]+7*l(0,6),j.ROCK,d];for(let t=1;t<a.length-1;t++)e.push(...f(a[0]),...f(a[t]),...f(a[t+1]))})},wt=(e,t,n,r,a,s,c)=>{let l=M(o(t[1],t[0]),o(t[2],t[0]));if(Math.hypot(...l)<1e-9)return;l=i(l),me(l,o(t[0],n))<0&&(t.reverse(),l=l.map(e=>-e));let u=(t[0][1]+t[1][1]+t[2][1])/3,d=.85*c*(.86+.28*P(e.length,s,7))*(.55+.45*X((u-r)/(.3*(a-r))))*(.82+.18*Math.max(l[1],0));for(let n of t)e.push(...n,...l,...Math.abs(l[1])>.7?[n[0],n[2]]:Math.abs(l[0])>Math.abs(l[2])?[n[2]+3*s,n[1]]:[n[0]+3*s,n[1]],j.ROCK,d)},Tt=(e,t,n,r,i,a)=>{let[o,s,c,l,u,d]=t[0],f=[(o+l)/2,n+.3*(u-n),(c+d)/2],[p,m]=[(i>1?.54:.5)*(l-o),(i>1?.54:.5)*(d-c)];he(e,i>2?5:i>1?3:l-o>1.4?2:1,e=>{let t=e[1]>0?u-f[1]:f[1]-s,n=[e[0]/p,e[1]/t,e[2]/m].map(e=>e*e),a=i>1?1/Math.sqrt(Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2])):1/Math.sqrt(n[0]+n[1]+n[2]),o=a*(.93+.14*Z(1.3*e[0]+r,1.3*e[2]+e[1],r));return[f[0]+e[0]*o,Math.min(f[1]+e[1]*a,u),f[2]+e[2]*o]},n,u,r,a)},Et=(e,t,n)=>{y(e,T(N([[13,0],[13,.27],[0,.27]],32),[.13,.13,.15]),[t,0,n],le,[0,0,0],1),re(e,[t,.29,n],7.6,8,[.8,.8,.82]);for(let r=0;r<24;r++){let i=r*O/24,[a,o]=[t+11.6*Math.cos(i),n+11.6*Math.sin(i)],s=(e,t)=>[a+e,.31,o+t];w(e,1.8,()=>E(e,[s(-.25,-.25),s(.25,-.25),s(.25,.25),s(-.25,.25)],r%3?[1,.95,.8]:[1,.45,.1],[a,-5,o]))}},Dt=(e,t,n,r,i=10,a=[1,.93,.75])=>{y(e,_t,[t,r,n],le,[0,0,0],[.2,.2,i]),y(e,_t,[t,r,n],le,[0,0,0],[.5,.5,.5]),w(e,se,()=>y(e,vt,[t,r+i+.4,n],le,[0,0,0],[.55,.55,.45],a))},Ot=(e,t)=>{let n=(n,r)=>{let[i,a]=[t[n],O*(r+.5*n)/e];return[Math.sqrt(1-i*i)*Math.cos(a),i,Math.sqrt(1-i*i)*Math.sin(a)]},r=[];for(let i=0;i<e;i++){r.push([[0,1,0],n(0,i+1),n(0,i)]);for(let e=0;e+1<t.length;e++)r.push([n(e,i),n(e,i+1),n(e+1,i)],[n(e+1,i),n(e,i+1),n(e+1,i+1)])}return r},kt=[Ot(6,[-.35]),Ot(5,[.45,-.35]),Ot(9,[.62,.1,-.35])],At=[.08,.2,.45],jt=(e,t,n,r,i,a,o)=>{Tt(e,[[t,a-4,n,r,a,i]],a-3.4,o,3,.9),Tt(e,[[t+.15,-17,n+.15,r-.15,a-3,i-.15]],-15,o+9,2,.5)},Mt=[[0,.02,.6],[.55,.04,.72],[.88,.2,1.05],[1,.24,1.12],[1.4,.015,1]],Nt=({brushes:e},t,n,r)=>!e.some(e=>e.max[1]>0&&Math.hypot(Math.max(e.min[0]-t,t-e.max[0],0),Math.max(e.min[2]-n,n-e.max[2],0))<r+.5)&&[0,1,2,3,4].every(i=>{let[a,o]=i?[t+r*Math.cos(1.57*i),n+r*Math.sin(1.57*i)]:[t,n];return Math.abs(a-pt[0])<=pt[0]-.5&&Math.abs(o-pt[2])<=pt[2]-.5&&e.some(e=>e.max[1]==0&&a>e.min[0]&&a<e.max[0]&&o>e.min[2]&&o<e.max[2])}),Pt=(e,t)=>{let n=[0,20,40,60,80,120,160,200,240];return[...n.map(t=>e-t).reverse(),...Array.from({length:(t-e)/20-1},(t,n)=>e+20*(n+1)),...n.map(e=>t+e)]},Ft=[[0,0,0,1],[-.6,-.25,0,.9],[-3,-.2,.7,.95],[-7,.1,.9,.85],[-7.4,.8,.9,.5],[-14,1,1.2,.55],[-14.5,1.7,1.2,.3],[-22,2.1,1.5,.34],[-30,5.6,1.5,.12]],It=(()=>{let e=e=>h[Math.min(Math.max(e,0),h.length-1)],t=[[0,140]];for(let n=0;n<=h.length;n++){let[r,i]=[e(n-1),e(n)];Math.abs(r-i)>.5?t.push([n,148+r],[n,148+i]):t.push([n,148+Math.min(r,i)-.12*P(n,1,71)])}return[...t,[h.length,140]]})(),Lt=[[640,75,4,.17,.02,3],[690,95,3,.16,.03,5],[740,115,3,.15,.04,8]],Rt=(e,t,n,r)=>{let i=(i,a)=>Z(e*n/i+7*r,t*n/i-3*r,r+a),a=n=>{let i=O*P(r,n,97);return e*Math.cos(i)+t*Math.sin(i)},o=Math.max(X((a(1)-.93)/.07),.8*X((a(2)-.95)/.05)),s=Math.max(X((a(3)-.985)/.015),X((a(4)-.985)/.015)),c=1-Math.abs(2*i(150,2)-1);return(.42+.2*i(520,1)+.14*c*c+.24*o)*(1-.5*s)+.1*(i(60,3)-.5)+.04*(i(24,4)-.5)};function*zt(u){let f=[];(t=>{(t=>{(e=>{let t=Array.from({length:9},(e,t)=>{let n=(t+1)/10*(O/4);return[R*Math.cos(n),5+12*Math.sin(n)]}),n=[];y(n,T(N([[R,0],[R,5],...t,[0,17]],48),ge),[F,0,I],le,[0,0,0],1);let r=(e,t)=>(t?Math.ceil:Math.floor)(e*48/O)*O/48;for(let t=0;t<n.length;t+=30){let[i,a,o]=[t,t+10,t+20],s=Math.atan2(n[i+2]+n[a+2]+n[o+2]-3*I,n[i]+n[a]+n[o]-3*F);if(Math.max(n[i+1],n[a+1],n[o+1])>5.01||!ze.some(([e,t])=>s>r(e,0)&&s<r(t,1)))for(let r=t;r<t+30;r++)e.push(n[r])}let i=(e,t)=>[F+R*Math.cos(e),t,I+R*Math.sin(e),Math.cos(e),0,Math.sin(e),ge[0],ge[1],-1,ge[2]];for(let[t,n,a]of ze){let o=[r(t,0),t];for(let e=Math.ceil(t*48/O);e*O/48<n;e++)o.push(e*O/48);o.push(n,r(n,1)),o.slice(1).forEach((t,n)=>{let r=o[n],s=n&&n<o.length-2?a:0;e.push(...i(r,s),...i(t,s),...i(t,5),...i(r,s),...i(t,5),...i(r,5))})}let a=(e,t,n)=>[F+(R+n)*Math.cos(e),t,I+(R+n)*Math.sin(e)];for(let t=0;t<70;t++){let n=t*O/70,r=n>O/2?n-O:n;if(ze.some(([e,t])=>r>e-.04&&r<t+.04))continue;let i=(e,t,r,i)=>[[-e,t],[e,t],[e,r],[-e,r]].map(([e,t])=>a(n+e/R,t,i));E(e,i(.72,1.5,2.9,.04),[.06,.06,.08],[F,2.2,I]),w(e,.56,()=>E(e,i(.6,1.7,2.7,.07),[1,.85,.5],[F,2.2,I]))}let[,o,s,c,l]=te[0],u=I+o-l;for(let[t,n,r]of[[-s-.3,-s-.02,0],[s+.02,s+.3,0],[-s-.3,s+.3,c]])A(e,[F+t,r,u-.1],[F+n,c+.3,u+.5],_e),z(e,2,u-.12,[F+t+.09,r+.09,0],[F+n-.09,c+.21,0],xe)})(t),(e=>{let t=[...d,...d.map(([e,t])=>[t,e]).reverse()];for(let[n,r]of t)z(e,1,.02,[F-n,0,I-r],[F+n,0,I+r],we,1.85);let n=t.flatMap(([e,n],r)=>[[e,n],...t[r+1]?[[t[r+1][0],n]]:[]]),r=[...n,...n.map(([e,t])=>[-e,t]).reverse(),...n.map(([e,t])=>[-e,-t]),...n.map(([e,t])=>[e,-t]).reverse()];r.forEach((t,n)=>{let i=r[(n+1)%r.length],a=t[0]==i[0]?0:2,o=2-a,[s,c]=[L[a]+t[a/2],Math.sign(t[a/2])],[l,u]=[t[o/2],i[o/2]].sort((e,t)=>e-t),d=te.find(e=>e[a/2]==t[a/2]&&e[o/2]>l&&e[o/2]<u),[f,p,m,h]=d?[d[o/2],d[2],d[3],d[4]]:[l,0,0,0],g=(t,n,r,i,l,u=0,d=0)=>{let[f,p]=[[0,r,0],[0,i,0]];[f[o],p[o]]=[L[o]+t,L[o]+n],z(e,a,s-c*d,f,p,l,u)};Re(e,a,s,L[o]+l,L[o]+u,8,1.7,d&&[[L[o]+f-p,L[o]+f+p,m]]),g(l,u,0,.25,Ce,0,.02),g(l,u,7.4,7.6,xe,0,.03);let _=u-l>6?Math.floor((u-l)/2.4):0;for(let e=0;e<_;e++){let t=l+(u-l)*(e+.5)/_;for(let e of[1.5,4.9])(e>m||Math.abs(t-f)>p+.8)&&(g(t-.72,t+.72,e,e+1.4,Ce,0,.02),g(t-.6,t+.6,e+.2,e+1.2,Se,0,.04))}let v=Math.ceil((u-l)/4.2);for(let n=0;n<v;n++){let r=(e,n)=>{let r=[0,8,0];[r[a],r[o]]=[t[a/2],l+(u-l)*e/v];let i=n?21.55/Math.hypot(r[0],r[2]):1;return[F+r[0]*i,8,I+r[2]*i]};De(e,[r(n,0),r(n+1,0),r(n+1,1),r(n,1)],we,1)}if(d){let[t,n]=[[0,0,0],[0,m,0]];[t[a],n[a]]=[s,s+c*h].sort((e,t)=>e-t),[t[o],n[o]]=[L[o]+f-p,L[o]+f+p],z(e,o,t[o],t,n,Ee,1.4),z(e,o,n[o],t,n,Ee,1.4),z(e,1,m,t,n,Ee,.9),z(e,1,.02,t,n,we,1.85),Le(e,a,s-.03*c,t[o],n[o],m)}});let[i,a,o]=[32,6,Math.asin(3/11.7)],s=(e,t)=>{let[n,r]=[o+(O/4-o)*t/a,e*O/i],s=22.099999999999998*Math.cos(n);return[F+s*Math.cos(r),5+11.7*Math.sin(n),I+s*Math.sin(r)]};for(let t=0;t<a;t++)for(let n=0;n<i;n++){let r=.31-.028*t-.018*(n+t&1);De(e,[s(n,t),s(n+1,t),s(n+1,t+1),s(n,t+1)],[r,r,1.06*r])}for(let t=0;t<16;t+=2){let n=e=>[F+3*Math.cos(e*O/16),16.2,I+3*Math.sin(e*O/16)];De(e,[[F,16.2,I],n(t),n(t+1),n(t+2)],xe)}c.forEach(t=>Oe(e,t))})(t),(t=>{_.forEach(({min:r,max:i},a)=>{let o=a?2:0,[s,c,l]=[r[o],a?_[0].min[2]:i[o],(r[2-o]+i[2-o])/2],u=e=>o?[l,1.75,e]:[e,1.75,l],d=(i[2-o]-r[2-o])/2+.1;n(t,Ve,u(s),u(c),[0,1,0],1,[1.75,d]);for(let e=5;e<c-s-1;e+=5)n(t,He,u(s+e),u(s+e+.3),[0,1,0],.3,[1.75,d]);Re(t,2-o,r[2-o]+e+.02,s,c,ce,1.4),Re(t,2-o,i[2-o]-e-.02,a?s:_[1].min[0],c,ce,1.4),z(t,1,ce-.01,r,i,Ee,.9);let[f,p]=[[...r],[...i]];[f[2-o],p[2-o]]=[l-.15,l+.15],z(t,1,ce-.02,f,p,xe)})})(t),(t=>{for(let{min:n,max:r}of C){let i=[(n[0]+r[0])/2,2.5,(n[2]+r[2])/2];for(let a of[-1,1]){let o=a>0?r[2]:n[2];for(let r=0;r<7;r++){let s=n[0]+1+2*r;if(ve.some(e=>Math.abs(e.min[2]-o)<1&&s+.72>e.min[0]&&s-.72<e.max[0]))continue;let c=(e,t,n,r)=>[[-e,t],[e,t],[e,n],[-e,n]].map(([e,t])=>[s+e,t,o+a*r]);E(t,c(.72,2.6,3.8,.02),[.06,.06,.08],i),w(t,.5,()=>E(t,c(.6,2.7,3.7,.04),[.9,.95,1],i)),De(t,c(.56,2.6,3.8,-e-.04),Ce),De(t,c(.46,2.7,3.7,-e-.06),[.45,.48,.5])}}for(let i of[0,2])for(let[a,o]of[[n[i],e+.02],[r[i]-e,-.02]])Re(t,i,a+o,n[2-i]+e,r[2-i]-e,4,1.5,ve.filter(e=>Math.abs(e.min[i]-a)<.01).map(e=>[e.min[2-i],e.max[2-i],ce]));z(t,1,3.99,n,r,Ee,.9);for(let e=0;e<3;e++){let a=n[0]+(r[0]-n[0])*(e+.5)/3;z(t,1,3.98,[a-1.2,0,i[2]-.3],[a+1.2,0,i[2]+.3],xe)}}})(t);for(let{min:e,max:n}of[...C,..._])z(t,1,.02,e,n,Te,1.99);for(let{min:e,max:n}of ve){let r=n[0]-e[0]<1?0:2;for(let i of[e[r]-.02,n[r]+.02])Le(t,r,i,e[2-r],n[2-r],e[1])}})(t),(t=>{(e=>{let t=(t,n=Ge)=>E(e,t,n,[K,5,Ue]),n=(e,n,r,i,a,o)=>{for(let s=e;s<n-1e-9;){let e=Math.min(n,(Math.floor(s/q+1e-9)+1)*q);t([Y(s,r,o),Y(e,r,o),Y(e,i,o),Y(s,i,o)],a),s=e}};for(let[t,r]of[[st[0][1],st[1][0]],[st[1][1],st[0][0]+O]])n(t,r,0,.45,J),w(e,1.6,()=>n(t,r,.16,.3,Ye,.035)),n(t,r,3.18,3.32);n(0,O,4.55,5.01,J,.03),[.4,1.9,2.5,3.7,5.2].forEach(e=>n(e,e+.05,4.68,4.86,qe,.045));for(let e=0;e<70;e++){let n=(e+.5)*O/70,r=.07/We;ct(n)&&[0,2].includes(e%5)&&t([Y(n-r,.45),Y(n+r,.45),Y(n+r,4.55),Y(n-r,4.55)])}let r=(e,n=.1,r,i=.03)=>e.slice(1).forEach(([a,o],s)=>{let[c,l]=e[s],u=Math.max(Math.abs(a-c),Math.abs(o-l)),d=(e,t)=>{let[r,s]=[c+(a-c)*e/u,l+(o-l)*e/u];return a==c?Y(r*q+t*n/ot(s)[0],5+s,i):Y(r*q,5+s+t*n/2.5,i)};for(let e=0;e<u;e++)t([d(e,-1),d(e,1),d(e+1,1),d(e+1,-1)],r)});for(let t=0;t<12;t++){let n=4*t;r([[n,0],[n,9]],.22,Ke,.05),1&t?(w(e,1.6,()=>r([[n,1],[n,8]],.04,Ye,.065)),r([[n,4],[n+2,2],[n+4,4]]),r([[n,6],[n+1,7],[n+3,7],[n+4,6]])):(r([[n,2],[n+1,3],[n+3,3],[n+4,2]]),r([[n+1,3],[n+1,5],[n+2,6],[n+3,5],[n+3,3]]))}n(0,O,13.75,14.15,Ke,.05),w(e,1.6,()=>n(0,O,13.9,14,Ye,.065));for(let[t,r]of[[5,0],[22,1],[34,0]])n(t*q+.02,(t+2)*q-.02,5.25+r,5.8+r,J,.03),w(e,2,()=>n(t*q+.04,t*q+.05,5.65+r,5.72+r,Qe,.045));let[,i,a,o,s]=te[0],c=Ue+i-s;for(let[t,n,r]of[[-a-.62,-a-.3,0],[a+.3,a+.62,0],[-a-.62,a+.62,o+.3]])A(e,[K+t,r,c-.04],[K+n,o+.62,c+.6],J),w(e,1.5,()=>E(e,[[t+.1,r+.1],[n-.1,r+.1],[n-.1,o+.52],[t+.1,o+.52]].map(([e,t])=>[K+e,t,c-.055]),Xe,[K,1,Ue]));for(let t=1;t<7;t++)for(let n of[-2.6,2.6])at(e,K+n,c-2.5*t);let l=(e,t=0,n=0)=>[K+t,e,Ue+n];it(e,l(17),.7,J,0),rt(e,l(17),l(25.099999999999998),.11),[1.9,1.5,1.1].forEach((t,n)=>{let r=20+1.6*n;rt(e,1&n?l(r,0,-t):l(r,-t),1&n?l(r,0,t):l(r,t),.06)}),it(e,l(25.4),.34,Ze)})(t),(e=>{_.forEach(({min:t,max:n},r)=>{let i=r?2:0,a=2-i,[o,s]=[t[i],r?_[0].min[2]:n[i]];for(let r=1;o+5*r/3<s-1;r++)if(r%3){let[s,c]=[[0,0,0],[0,3.53,0]];[s[i],c[i]]=[o+5*r/3-.06,o+5*r/3+.06];for(let r of[0,1]){s[a]=r?n[a]:t[a]-.12,c[a]=s[a]+.12,A(e,s,c,Ge,12|(i?32:2)>>r);let o=r?c[a]+.015:s[a]-.015;w(e,1.8,()=>E(e,[[s[i]+.015,2.7],[c[i]-.015,2.7],[c[i]-.015,2.9],[s[i]+.015,2.9]].map(([e,t])=>{let n=[0,t,0];return[n[i],n[a]]=[e,o],n}),Ye,[(t[0]+n[0])/2,2.8,(t[2]+n[2])/2]))}[s[a],c[a],s[1]]=[t[a]-.12,n[a]+.12,3.5],A(e,s,c,Ge,4|(i?48:3))}})})(t),(e=>{C.forEach(({min:t,max:r},i)=>{for(let n of[0,2]){let i=2-n;for(let a of[-1,1]){let o=a>0?r[n]:t[n],s=(n?1:16)*(a>0?1:2),c=(e,t,r)=>{let s=[0,t,0];return[s[n],s[i]]=[o+a*r,e],s},l=(t,n,r,i=0)=>A(e,t.map((e,t)=>Math.min(e,n[t])),t.map((e,t)=>Math.max(e,n[t])),r,i),u=(t,n,r,i,a,o)=>E(e,[c(t,n,a),c(r,n,a),c(r,i,a),c(t,i,a)],o,c(t,n,-1)),[d]=ve.filter(e=>Math.abs((a>0?e.max[n]:e.min[n])-o)<.01&&e.min[i]>t[i]&&e.max[i]<r[i]).map(e=>{let t=(e.min[i]+e.max[i])/2;return e.max[i]-e.min[i]>3?[t-2.25,t+2.25,3.62,0]:[t-1.32,t+1.32,ce+.14,t]});l(c(t[i]-.06,4.7,0),c(r[i]+.06,5,.06),J,s|(n?48:3));for(let[e,n]of d?[[t[i],d[0]],[d[1],r[i]]]:[[t[i],r[i]]])l(c(e,0,0),c(n,.3,.04),Ge,4|s);let f=(t[i]+r[i])/2;for(let i of n?[1,-1]:[]){let n=i>0?t[0]:r[0],a=d?d[i>0?0:1]:f-.8*i;(a-n)*i>4.2&&(u(n,1,n+3*i,1.1,.02,Ge),u(n+4*i,2,a,2.1,.02,Ge),E(e,[c(n+3*i,1,.02),c(n+4*i,2,.02),c(n+4*i,2.1,.02),c(n+3*i,1.1,.02)],Ge,c(n,1,-1)))}if(n&&w(e,1.6,()=>u(t[0]+.3,4.82,r[0]-.3,4.9,.075,Ye)),!n&&!d){u(f-1.1,.9,f+1.1,1.9,.02,J);for(let e=0;e<4;e++)u(f-1,1.05+.2*e,f+1,1.15+.2*e,.035,qe)}if(d?.[3]){let t=d[3];l(c(t-.5,2.95,0),c(t+.5,3.05,.22),J,s),w(e,1.8,()=>l(c(t-.4,2.83,0),c(t+.4,2.95,.12),Je,8|s)),l(c(t-.05,4.1,0),c(t+.05,4.2,.5),J,s),l(c(t-.5,4.2,.32),c(t+.5,4.42,.5),qe),w(e,2,()=>u(t-.42,4.27,t-.3,4.35,.515,Qe)),rt(e,c(t+.35,4.42,.41),c(t+.35,5.4,.41),.03),it(e,c(t+.35,5.45,.41),.07,Ze);for(let n of[1.5,3.5,5.5])for(let r of[t-1.5,t+1.5]){let[t,,i]=c(r,0,n);at(e,t,i)}}}}if(i){let n=r[0]-.7;A(e,[n-.3,5,t[2]+2],[n+.3,5.2,r[2]-2],J),[3.4,4.6,2.8].forEach((r,i)=>{let a=t[2]+2.5+1.5*i;rt(e,[n,5.2,a],[n,5.2+r,a],.04),it(e,[n,5.26+r,a],.07,1&i?Ze:Ye)})}else{let i=[r[0]-1.4,6.35,t[2]+1.4],a=e=>[i[0]+.6*e,i[1]+.8*e,i[2]];A(e,[i[0]-.4,5,i[2]-.4],[i[0]+.4,5.12,i[2]+.4],J),rt(e,[i[0],5,i[2]],i,.16),it(e,i,.26,J,0),n(e,nt,a(.1),a(1.1),$e,1,1.15),rt(e,a(.2),a(1.05),.03),it(e,a(1.1),.08,Ze)}})})(t),(t=>{for(let n of lt){let r=n[5];if(ut(t,n,r+.1,0,J),w(t,.7,()=>ut(t,n,r,.015,Je)),n[6]){let i=t.length,a=[n[0],n[1],n[2],-n[3],-n[4]];ut(t,a,r+.1,e+.06,[.04,.04,.05]),ut(t,a,r,e+.08,[.45,.48,.5]);for(let e=i;e<t.length;e+=10)[t[e+3],t[e+4],t[e+5],t[e+8]]=[...ye,-2]}}})(t)})(t);for(let[e,n]of r.pads.slice(0,r.pads.length/2))Et(t,e,n);for(let[e,n]of r.masts.slice(0,r.masts.length/2))Dt(t,e,n,0)})(f),u.relief&&((e,t)=>{let{at:n}=t.relief,a=It,s=(e,t)=>Math.max(n(e,Math.max(t,148)),0),c=e=>X(4*(Z(e/6,.5,82)-.35))*(.55+.45*Z(e/1.7,.5,83)),l=([e,t],n)=>{let[r,i,a]=Ft[n];return[e,n?r:s(e,t),t-i-a*c(e)*+!!n]};for(let t=0;t<a.length-1;t++){let[n,r]=[a[t],a[t+1]];for(let a=0;a<Ft.length-1;a++){let s=[l(n,a),l(r,a),l(r,a+1),l(n,a+1)];for(let[l,u,d]of t+a&1?[[0,1,2],[0,2,3]]:[[0,1,3],[1,2,3]]){let f=M(o(s[u],s[l]),o(s[d],s[l]));if(Math.hypot(...f)<1e-9)continue;f=i(f),f=f[2]>0||Math.abs(f[2])<1e-9&&f[1]<0?f.map(e=>-e):f;let p=Ft[a][3]*(.82+.3*P(t,a,73))*(.7+.3*c((n[0]+r[0])/2));for(let t of[s[l],s[u],s[d]])e.push(...t,...f,t[0]+t[2],t[1],j.ROCK,p)}}}r.pillars.forEach(([t,n,r,i,a],o)=>n>140&&jt(e,t,n,r,i,a,o+400)),E(e,[[-2,-30,140],[162,-30,140],[162,-30,158],[-2,-30,158]],[.012,.012,.015]);for(let t=0;t<9;t++){let n=6+17*t+8*P(t,1,77);w(e,.1,()=>E(e,[[n,-29.9,140],[n+9+6*P(t,2,77),-29.9,140],[n+5,-29.9,140.25+.3*P(t,3,77)]],[.2,.55,1]));let r=1.5+2.5*P(t,4,77);Ct(e,[n,-29.6,142.5+5*P(t,5,77)],[r,.7*r,r],t+200,.25,!1)}})(f,u);let v=u.relief?.at??(()=>0);r.crags.forEach(e=>((e,{at:[t,n,r],R:i,H:a,s:o},c)=>{let{reach:u}=l(o,i,a),d=[t,n+s(a),r];he(e,i<1.5?3:i<2.5?4:5,e=>{let t=u(e);return[d[0]+e[0]*t,d[1]+e[1]*t,d[2]+e[2]*t]},n,n+a,o,.8+.4*P(o,5,41),c)})(f,e,v));let b=f.concat((e=>{let t=[];for(let n=0;n<e.length;n+=30)for(let r of[0,2,1]){let i=n+10*r;t.push(e[i],e[i+1],ft-e[i+2],e[i+3],e[i+4],-e[i+5],...e.slice(i+6,i+10))}return t})(f));yield,u.relief&&((e,t)=>{for(let[n,i,o,s,c]of(e=>{let t=fe(e.relief),[n,i,o,s]=t.bound,c=(e,n)=>{if(e>t.hole[0]-.3&&e<t.hole[2]+.3&&n>t.hole[1]-.3&&n<t.hole[3]+.3||t.pits.some(t=>e>=t[0]-.3&&e<=t[2]+.3&&n>=t[1]-.3&&n<=t[3]+.3))return NaN;let[r,i]=[(e-t.x0)/t.cell,(n-t.z0)/t.cell],[a,o]=[Math.floor(r),Math.floor(i)],[s,c]=[r-a,i-o],l=a+o*t.nx,[u,d,f,p]=[t.h[l],t.h[l+1],t.h[l+t.nx],t.h[l+t.nx+1]];return s>=c?u+(d-u)*s+(p-d)*c:u+(f-u)*c+(p-f)*s},l=[],u=(e,t,u,d=1)=>{if(((e,t)=>{let l=t-ft/2,u=([t,n,r,i])=>Math.hypot(Math.max(t-e,e-r,0),Math.max(n-l,l-i,0));return l>.3&&Math.hypot((e-n)/o,(t-i)/s)<.97&&!a.some(e=>u(e)<2.5)&&!g.some(e=>u(e)<1)&&!r.pits.some(n=>Math.abs(e-n.x)<p+.5&&Math.abs(t-n.z)<p+.5)&&!r.crags.some(n=>Math.hypot(e-n.at[0],t-n.at[2])<1.3*n.R)&&Number.isFinite(c(e,t))})(e,t)){let n=P(u,3,211);l.push([e,c(e,t),t,n<.62?0:n<.945+.055*(1-d)?1:2,u])}};r.sites.forEach(([e,t,n],r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>P(r,5*i+e,201),o=n*(.1+1.7*a(1)*a(1));u(e+o*Math.cos(O*a(2)),t+o*Math.sin(O*a(2)),1e3*r+i)}}),r.crags.forEach(({at:[e,,t],R:n},r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>P(r,5*i+e,215),o=n*(1.32+.75*a(1)*a(1));u(e+o*Math.cos(O*a(2)),t+o*Math.sin(O*a(2)),5e5+1e3*r+i)}}),r.bowls.forEach(([e,t,n],r)=>{for(let i=0;t>=ft/2&&i<Math.round(1.1*n);i++){let a=e=>P(r,5*i+e,203),o=i%5<2?.94+.16*a(1):1.15+1.25*a(1)*a(1);u(e+o*n*Math.cos(O*a(2)),t+o*n*Math.sin(O*a(2)),1e5+1e3*r+i)}});for(let e=0;e<60;e++){let t=t=>P(e,t,205),n=1+158*t(1),r=h[Math.floor(n)];u(n,ft/2+8+Math.max(r,0)+.5+2.5*t(2)*t(2),2e5+e,.5)}for(let e=0;e<18;e++){let t=t=>P(e,t,207),[r,i,a]=[n+o*(1.8*t(1)-.9),ft/2+4+(s-8)*t(2),O*t(3)];for(let n=0;n<10+12*t(4);n++)a+=.5*(P(e,10+n,208)-.5),[r,i]=[r+(1+1.4*P(e,40+n,208))*Math.cos(a),i+(1+1.4*P(e,40+n,208))*Math.sin(a)],u(r+.8*(P(e,70+n,208)-.5),i+.8*(P(e,100+n,208)-.5),3e5+100*e+n,.6)}for(let e=0;e<520;e++){let t=t=>P(e,t,209),[r,i]=[n+o*(2*t(1)-1),ft/2+s*t(2)];(Z(r/20,i/20,77)>.62||t(3)<.04)&&u(r,i,4e5+e,.7)}return[...l,...l.map(([e,,t,n,r])=>[e,c(e,ft-t),ft-t,n,r])]})(t)){let t=e=>P(c,e,213),r=At[s]*(.88+.24*t(1)),[a,l,u]=[r/2,r/2*(.65+.35*t(2)),r*(.5+.3*t(3))],[d,f]=[Math.cos(O*t(4)),Math.sin(O*t(4))],p=i+.1*u;he(e,kt[s],e=>{let[t,r]=[e[0]*d+e[2]*f,e[2]*d-e[0]*f],i=(.9+.2*Z(1.3*e[0]+c,1.3*e[2]+e[1],c%97))/Math.hypot(t/a,2*e[1]/u,r/l);return[n+e[0]*i,p+e[1]*i,o+e[2]*i]},i,p+u/2,c,.5+.25*t(5))}})(b,u);for(let[e,t,n,i,a]of r.pillars)t<140&&i>140&&jt(b,e,t,n,i,a,401);return((e,t)=>{let n={relief:t.relief&&fe(t.relief)},r=(e,r,i)=>!t.relief||Array.from({length:17},(e,t)=>t*O/16).every((t,a)=>ie(n,e+(a?i*Math.cos(t):0),r+(a?i*Math.sin(t):0))===0);for(let n=0,i=0;i<72&&n<900;n++){let[a,o,s]=[dt*P(n,1,61),ft*P(n,2,61),.6+2*P(n,3,61)**2];if(!Nt(t,a,o,1.5*s)||!r(a,o,1.5*s)||Math.abs(o-pt[2])<24||(t.rovers??[]).some(([e,,t])=>Math.hypot(a-e,o-t)<6))continue;i++;let c=(e,t)=>{let[r,i,c]=Mt[e],[l,u]=[r*(e&&e<4?.86+.28*P(n,t%12,67):1),e===2||e===3?i*(.55+.45*P(n,t%12,68)):i],d=t*O/12,[f,p]=[Math.cos(d),Math.sin(d)],[m,h]=[Mt[Math.max(e-1,0)],Mt[Math.min(e+1,Mt.length-1)]],g=-3*(h[1]-m[1])/((h[0]-m[0])*s),_=Math.hypot(g,1),[v,y]=[a+f*l*s,o+p*l*s];return[v,u,y,g*f/_,1/_,g*p/_,v,y,j.STONE,c]};for(let t=0;t<Mt.length-1;t++)for(let n=0;n<12;n++){let[r,i,a,o]=[c(t,n),c(t+1,n),c(t+1,n+1),c(t,n+1)];e.push(...r,...a,...i,...r,...o,...a)}}})(b,u),yield,u.relief&&(((e,t)=>{let{at:n}=t.relief,r=(e,t)=>n(e,Math.max(t,148));for(let t of[1,-1]){let n=(e,n)=>{let a=i([r(e-1,n)-r(e+1,n),2,t*(r(e,n-1)-r(e,n+1))]);return[e,Math.max(r(e,n),0),140+t*(n-140),...a,e,140+t*(n-140),j.STONE,1]};for(let t=0;t<It.length-1;t++){let[r,i]=[It[t],It[t+1]];if(r[0]!==i[0]){let[t,a,o,s]=[n(r[0],156),n(i[0],156),n(i[0],i[1]),n(r[0],r[1])];e.push(...t,...o,...a,...t,...s,...o)}}}})(b,u),(e=>{for(let[n,{x:a,z:o,level:s,rows:c}]of r.pits.entries()){let r=(e,t)=>c[e]?.[2+t]??0,l=Array.from({length:c.length+1},(e,t)=>[c[0][0]+t,-Math.min(r(t-1,0),r(t,0)),Math.min(r(t-1,1),r(t,1))]),u=(e,t)=>[e,s,t,0,1,0,e,t,j.STONE,.6+.4*X((Math.hypot(e-a,t-o)-D)/3)],d=(t,n,r,i)=>e.push(...t,...r,...n,...t,...i,...r);for(let[e,t]of[[o-p,o-D],[o+D,o+p]])for(let n=a-p;n<a+p;n+=2)d(u(n,e),u(n+2,e),u(n+2,t),u(n,t));for(let r=0;r<l.length-1;r++){let[[c,f,m],[h,g,_]]=[l[r],l[r+1]];d(u(a-p,c),u(a+f,c),u(a+g,h),u(a-p,h)),d(u(a+m,c),u(a+p,c),u(a+p,h),u(a+_,h));for(let c of[1,2]){let u=[s,s-.6,s-5,s-10,t],d=(e,t)=>[a+e[c]+(c>1?-1:1)*(t&&t<4?.9*P(e[0],t,83+c)-.25:0),u[t],e[0]];for(let f=0;f<4;f++){let p=[d(l[r],f),d(l[r+1],f),d(l[r+1],f+1),d(l[r],f+1)],m=[a+(c>1?99:-99),u[f],o],h=e.length;wt(e,[p[0],p[1],p[2]],m,t-12,s,n+f,1.2),wt(e,[p[0],p[2],p[3]],m,t-12,s,n+f,1.2);for(let t=h+3;t<e.length;t+=10){let n=i([e[t],e[t+1]+.9,e[t+2]]);[e[t],e[t+1],e[t+2]]=n}}}}let f=(e,n)=>[e,t,n,0,1,0,e,n,j.STONE,.5];d(f(a-D-1.5,o-D),f(a+D+1.5,o-D),f(a+D+1.5,o+D),f(a-D-1.5,o+D));let h=c[D][3],g=(s-t)/m;for(let r=0;r<m-1;r++){let i=a+h-1.3*(m-1-r);Tt(e,[[i,t-1,o-1,i+1.3,t+g*(r+1),o+1]],t,9*n+r,2,.9)}for(let t=0;t<20;t++){let r=O*(t+P(n,t,85))/20,[i,c,l]=[a+(D+1.6)*Math.cos(r),o+(D+1.6)*Math.sin(r),.3+.35*P(n,t,86)];Tt(e,[[i-l,s-.3,c-l,i+l,s+.9*l,c+l]],s,40*n+t,1,.9)}}})(b),yield,((e,t)=>{let{at:n}=t.relief,i={relief:fe(t.relief)};r.bowls.forEach(([t,r,a],o)=>{let s=a<12?0:Math.round(O*a/1.5),c=Array.from({length:s},(e,i)=>{let[o,c]=[Math.cos(O*i/s),Math.sin(O*i/s)],[l,u]=[a,-1/0];for(let e=.8*a;e<1.3*a;e+=.5){let i=n(t+o*e,r+c*e);[l,u]=i>u?[e,i]:[l,u]}return l}),l=Array.from({length:s},(e,n)=>{let[a,l]=[Math.cos(O*n/s),Math.sin(O*n/s)],u=[-2,-1,0,1,2].reduce((e,t)=>e+c[(n+t+s)%s],0)/5,d=P(n,o,87);return[-2.4,-1.2,0,1.2,2.4].map((e,s)=>{let[c,f]=[t+a*(u+e),r+l*(u+e)],p=[.04,.12,.1+.15*d,.1,.04][s],m=[.62+.3*P(n>>1,o,88),.9,1.22+.2*d,1.1,1][s];return[c,ie(i,c,f)+p,f,0,1,0,c,f,j.STONE,m]})});l.forEach((t,n)=>{let r=l[(n+1)%s];for(let n=0;n<4;n++)[t[n],t[n+1],r[n],r[n+1]].every(e=>Number.isFinite(e[1]))&&e.push(...t[n],...r[n+1],...r[n],...t[n],...t[n+1],...r[n+1])})})})(b,u),yield,((e,t)=>{let n=fe(t.relief),[a,o,s,c]=n.bound,[l,u]=[Pt(n.x0,a+s),Pt(n.z0,o+c)],d=(e,r)=>{let[i,a]=[(e-n.x0)/n.cell,(r-n.z0)/n.cell];return i%1||a%1||i<0||a<0||i>=n.nx||a>=n.nz?t.relief.at(e,r):n.h[i+a*n.nx]},f=(e,t)=>r.bowls.reduce((n,[r,i,a])=>{let o=Math.hypot(e-r,t-i),s=o/a,c=Z((e-r)/o*5+r,(t-i)/o*5+i,19);return s>1.05&&s<2.4?n+.22*X(5*(c-.55))*X((2.4-s)/.9)*X(6*(s-1.05)):n},0),m=/* @__PURE__ */ new Map,h=(e,t)=>{let n=4096*e+t,r=m.get(n);if(!r){let a=d(e,t),o=[d(e-4,t)-d(e+4,t),d(e,t-4)-d(e,t+4)],s=a===0&&o[0]===0&&o[1]===0,c=n=>s?0:1.4*(P(e,t,131+n)-.5);r=[e,a,t,...i([o[0]+c(0),8,o[1]+c(1)]),e,t,j.STONE,Math.min(Math.max(1+a/60,.78),1.2)+f(e,t)],m.set(n,r)}return r},g=(e,t)=>{let[n,r,i,d]=[l[e],l[e+1],u[t],u[t+1]];if(!(n<r&&i<d))return 0;let f=Math.hypot((Math.min(Math.max(a,n),r)-a)/s,(Math.min(Math.max(o,i),d)-o)/c);return f<1?2:+(f<1.65)};for(let t=0;t<l.length-1;t++)for(let i=0;i<u.length-1;i++){let[a,o,s,c,d]=[l[t],l[t+1],u[i],u[i+1],g(t,i)];if(d>1)for(let t=a;t<o;t+=n.cell)for(let i=s;i<c;i+=n.cell){if(t>=n.hole[0]&&t<n.hole[2]&&i>=n.hole[1]-8&&i<n.hole[3]+8||r.pits.some(e=>t>=e.x-p&&t<e.x+p&&i>=e.z-p&&i<e.z+p))continue;let[a,o,s,c]=[h(t,i),h(t+n.cell,i),h(t+n.cell,i+n.cell),h(t,i+n.cell)];e.push(...a,...s,...o,...a,...c,...s)}else if(d){let n=[];for(let[e,r,l,u,d]of[[a,s,o,s,g(t,i-1)],[o,s,o,c,g(t+1,i)],[o,c,a,c,g(t,i+1)],[a,c,a,s,g(t-1,i)]]){let t=d>1?5:1;for(let i=0;i<t;i++)n.push(h(e+(l-e)*i/t,r+(u-r)*i/t))}let r=h((a+o)/2,(s+c)/2);n.forEach((t,i)=>e.push(...r,...n[(i+1)%n.length],...t))}}})(b,u),yield,((e,n)=>{let{at:a}=n.relief,o=i(M([0,1,0],ht)),s=[o,M(ht,o),ht];for(let[t,n]of r.dishes)Dt(e,t,n,a(t,n),6,[1,.25,.15]),y(e,bt,[t,a(t,n)+5.2,n],s,[0,0,-.9],1);for(let[t,n,i,o]of r.ramps)for(let r of[-8,8])Dt(e,t+r*o,n-r*i,a(t+r*o,n-r*i),2.2,[1,.45,.1]);let[c,l]=r.wreck,u=t,d=i([.8,-.35,.5]),f=i(M([0,1,0],d));y(e,yt,[c-3,u+3.1,l-2],[f,M(d,f),d],[0,0,0],[1.6,1.4,.55],[.6,.6,.62]),E(e,[[c+3,u,l+4],[c+6.5,u+.2,l+5],[c+4,u+2.6,l+5.5]],[.7,.3,.14]),Dt(e,c-3.4,l+2.6,u,3.5,[1,.12,.08])})(b,u)),((e,t)=>{for(let[n,r,a,o,s,c]of Lt){let l=e=>{let l=e*O/480,[u,d]=[Math.cos(l),Math.sin(l)],f=r*Rt(u,d,n,c),p=(e+1)*O/480,m=(r*Rt(Math.cos(p),Math.sin(p),n,c)-f)/(n*O/480);return Array.from({length:a+1},(e,r)=>{let l=r/a,p=n-.3*f*(1-l),h=n/(30+26*(1-l))*(1+.05*l),g=2*Z(u*h+c+1.7*l,d*h-1.3*l,c+9)-1,_=i([-u-d*(-1.5*m-1.6*g*(1-.5*l)),.75,u*(-1.5*m-1.6*g*(1-.5*l))-d]),v=Math.max(me(_,t),0),y=(.8+.3*Z(u*n/90-c,d*n/90+2.3*l,c+11))*(.72+.28*X(.5+.9*g))*(s+(o-s)*Math.min(1.2*v+(r===a?.3:0),1));return[pt[0]+u*p,(f+25)*l-25,pt[2]+d*p,u,0,d,y,y,-2,1.03*y]})},u=l(0);for(let t=1;t<=480;t++){let n=l(t%480);for(let t=0;t<a;t++)e.push(...u[t],...n[t],...n[t+1],...u[t],...n[t+1],...u[t+1]);u=n}}})(b,i(u.sun.dir)),b}var Bt=()=>{let e=[];return(e=>{let t=ht,n=t.map(e=>-e),r=i([n[2],0,-n[0]]),a=M(n,r),o=t.map((e,t)=>pt[t]+800*e),s=t.map((e,t)=>o[t]+100*e),[c,l]=[28,64],u=(e,t)=>o.map((n,i)=>n+60*e*(r[i]*Math.cos(t)+a[i]*Math.sin(t))),d=e.length;for(let t=0;t<c;t++)for(let n=0;n<l;n++){let[r,i]=[n*O/l,(n+1)*O/l],[a,o]=[(t+.5)/c,(n+.5)*O/l],[d,f]=[a*Math.cos(o),a*Math.sin(o)],p=Math.sqrt(1-a*a),[m,h]=[(Math.atan2(d,p)+1.5)/O*12,6*(Math.asin(f)/Math.PI+.5)],g=gt(m,h,11)>.5?pe([.13,.32,.09],[.4,.3,.15],gt(2*m,2*h,13)):[.03,.16,.5],_=Math.abs(f)>.93?1:X(4*(gt(1.5*m+4,3*h,17)-.5));g=pe(g,[.95,.97,1],_).map(e=>e*(.55+.45*Math.max(0,.3*d+.25*f+.9*p))*(.6+.4*p)),E(e,t?[u(t/c,r),u((t+1)/c,r),u((t+1)/c,i),u(t/c,i)]:[u(0,0),u(1/c,r),u(1/c,i)],g,s)}ue(e,d,1.5)})(e),e},{FORWARD:Vt,BACK:Ht,JUMP:Ut,CROUCH:Wt,SPRINT:Gt,USE:Kt}=de,Q=[.78,.8,.84],qt=[.95,.68,.22],Jt=[.06,.06,.07],Yt=[.9,.9,.88],Xt=[.14,.24,.55],Zt=[.75,.42,.2],Qt=[3.2,.35,.15],$t=2*Math.PI,en=(e,t,n,r,i)=>e.push(...t,...n,r[0],r[1],i,r[2]),$=(e,t,n,r,i=-1)=>{let[[a,o],[s,c],[l,u]]=[0,1,2].map(e=>[t[e],n[e]]),d=[[[0,1,0],[[a,c,l],[a,c,u],[o,c,u],[o,c,l]]],[[0,-1,0],[[a,s,l],[o,s,l],[o,s,u],[a,s,u]]],[[1,0,0],[[o,s,l],[o,c,l],[o,c,u],[o,s,u]]],[[-1,0,0],[[a,s,l],[a,s,u],[a,c,u],[a,c,l]]],[[0,0,1],[[a,s,u],[o,s,u],[o,c,u],[a,c,u]]],[[0,0,-1],[[a,s,l],[a,c,l],[o,c,l],[o,s,l]]]];for(let[t,n]of d)for(let a of[0,1,2,0,2,3])en(e,n[a],t,r,i)},tn=(e,t,n,r)=>{let i=T(N(e,r),t);for(let e=8;e<i.length;e+=10)i[e]=n;return i},nn=(e,t,n,r,i,a=-1,o=48)=>y(e,tn(t,i,a,o),n,ae(r,Math.abs(r[1])>.9?[1,0,0]:[0,1,0]),[0,0,0],1),rn=(e,t,r,i,a,o=k)=>n(e,tn([[0,0],[i,0],[i,1],[0,1]],a,o,8),t,r,[0,1,0],1),an=(e,t,n)=>{let r=43758.5453*Math.sin(127.1*e+311.7*t+74.7*n);return 2*(r-Math.floor(r))-1},on=(e,t,n,r,i=-2)=>{for(let a of[0,1,2,0,2,3])en(e,[t[a][0],n,t[a][1]],[0,1,0],r,i)},sn=[.55,.57,.6],cn=[.9,.45,.08],ln=[.95,.75,.1],un=[.4,2.6,1.6],dn=[2.6,1.3,.25],fn=[.08,.35,.8],pn=[2.2,2.3,2.6];function*mn(t,r){let i=yield*zt(t);return yield,i=i.concat((({brushes:t},r)=>{let i=[];for(let e of t)e.ghost&&e.tint&&Oe(i,e,2*Math.max(0,r.indexOf(`${e.tint}`)));let a=[];(t=>{[...ee,...Ie].forEach(e=>((e,[t,r,i,a,o,s,c,l])=>{let d=1&l?2:0,[f,p]=[[r,s,i],[a,c,o]],m=l<2?1:-1,h=(e,t,n)=>{let r=[0,s+t,0];return r[d]=(m>0?f[d]:p[d])+m*n,r[2-d]=f[2-d]+e,r},[g,_,v]=[p[2-d]-f[2-d],p[d]-f[d],c-s],x=(t,n,r)=>{let[i,a]=[h(t[0],t[1],t[2]),h(n[0],n[1],n[2])];A(e,i.map((e,t)=>Math.min(e,a[t])),i.map((e,t)=>Math.max(e,a[t])),r)},S=(t,n,r,i,a,o,s=1)=>w(e,s,()=>E(e,[h(t,n,a),h(r,n,a),h(r,i,a),h(t,i,a)],o,h(t,n,a-1))),C=(e,t,n,r,i,a)=>{x([e,t,i-.06],[n,r,i],H),S(e+.04,t+.04,n-.04,r-.04,i+.005,a,.45);for(let o=0;r-t>.3&&o<4;o++){let s=r-.12-o*((r-t-.16)/4);S(e+.08,s-.025,e+.08+(n-e-.16)*(.4+(7*e+o)%4*.15),s,i+.01,a,1.1)}};ke(e,()=>{if(t==u.BENCH){x([0,v-.06,0],[g,v,_],B),x([.05,0,0],[g-.05,v-.06,_-.06],Ae);for(let e=1.1;e<g-.5;e+=1.1)x([e-.01,.1,_-.06],[e+.01,v-.1,_-.05],H);for(let e=0;e<4;e++){let t=1.4+2.75*e;x([t-.05,v,.16],[t+.05,v+.22,.22],H),C(t-.45,v+.2,t+.45,v+.75,.28,[U,W,G,U][e]),x([t-.3,v,.45],[t+.3,v+.025,.65],V),x([t+.7,v,.2],[t+.82,v+.2,.32],[W,je,G,Pe][e])}}else if(t==u.SAMPLES){x([0,v-.05,0],[g,v,_],V),x([.15,.18,.15],[g-.15,.22,_-.15],H);for(let e of[.1,g-.2])for(let t of[.1,_-.2])x([e,0,t],[e+.1,v-.05,t+.1],H);for(let e=0;e<4;e++){let t=.25+1.2*e;x([t,v,.3],[t+.9,v+.07,1.2],H),S(t+.05,v+.015,t+.85,v+.055,1.205,U,1.2),x([t+.28,v+.07,.55],[t+.62,v+.07+(.16+e%3*.07),.95],[.4+.05*e,.38,.35]);for(let[e,n]of[[0,.3],[.88,.3],[0,1.18],[.88,1.18]])x([t+e,v+.07,n],[t+e+.02,v+.55,n+.02],Ae);x([t,v+.53,.3],[t+.9,v+.55,1.2],[.5,.6,.66])}}else if(t==u.RACKS){x([0,0,0],[g,v,_],H);for(let e=0;e<3;e++){let t=.1+1.63*e;for(let n=0;n<12;n++){let r=.25+.2*n;S(t,r,t+1.43,r+.16,_+.01,V,.25);for(let i=0;i<5;i++){let a=[W,G,W,U,Ne,null][(7*e+5*n+3*i)%6];a&&S(t+.1+.08*i,r+.06,t+.14+.08*i,r+.1,_+.015,a,1.6)}}S(t,v-.4,t+1.43,v-.34,_+.01,U,.9)}}else if(t==u.SCOPE){x([.2,0,.2],[1,.1,1],H),x([.45,.1,.45],[.75,.85,.75],B),S(.52,.55,.68,.65,.755,W,1.4),x([.35,.85,.35],[.85,1.05,.85],V);let[t,r]=[h(.6,.9,.2),h(1.4,2.8,2.1)];n(e,b(2,1,[1,1],[0,0]),t,r,[1,0,0],1,.2,B),n(e,b(2,1,[1,1],[0,0]),h(1.3,2.56,1.86),h(1.42,2.83,2.13),[1,0,0],1,.24,H),n(e,b(2,1,[1,1],[0,0]),h(.86,1.4,.6),h(1.2,2.2,1.4),[1,0,0],1,.05,V)}else if(t==u.ANALYSER){x([0,0,0],[g,.9,_],B),x([0,.9,0],[g,v,.5],B),C(.12,.92,.95,1.26,.56,W),x([1.1,.9,.55],[1.88,1.18,1.1],V),S(1.16,.95,1.82,1.13,1.105,Pe,1.3);for(let e=0;e<6;e++)S(.15+.12*e,.74,.22+.12*e,.8,_+.005,[G,W,U][e%3],1.4);for(let e of[.3,.6])x([.05,e,_],[g-.05,e+.015,_+.005],H)}else if(t==u.PLANTS){for(let e of[0,g/2-.03,g-.06])x([e,0,0],[e+.06,v,_],V);x([0,v-.04,0],[g,v,_],B);for(let t of[.3,.9,1.5]){x([0,t,0],[g,t+.04,_],B),x([.1,t+.04,.12],[g-.1,t+.18,_-.12],Me);for(let e=.25;e<g-.15;e+=.4)x([e-.1,t+.18,.2],[e+.1,t+.18+(.12+(10*e+3*t)%3*.06),_-.2],10*e%2<1?[.18,.5,.16]:[.3,.62,.2]);w(e,1.1,()=>x([.1,t+.53,.3],[g-.1,t+.56,_-.3],Fe))}}else if(t==u.LOCKERS){x([0,0,0],[g,v,_],je);for(let e=0;e<6;e++){let t=.8*e;e&&x([t-.01,.05,_],[t+.01,v-.05,_+.01],H);for(let e=0;e<3;e++)x([t+.2,1.7+.08*e,_],[t+.6,1.73+.08*e,_+.01],H);x([t+.64,.95,_],[t+.68,1.2,_+.04],Ae),S(t+.3,1.5,t+.5,1.56,_+.012,G,.8)}}else if(t==u.SUIT){x([.1,0,.1],[.9,.06,.9],H),x([.47,.06,.06],[.53,1.7,.14],V);for(let e of[.27,.54])x([e-.02,.06,.36],[e+.21,.22,.68],V),x([e,.22,.4],[e+.19,.95,.62],B);x([.22,.95,.32],[.78,1.58,.7],B),x([.25,1,.14],[.75,1.62,.32],Ae);for(let e of[.08,.78])x([e,1,.4],[e+.14,1.54,.6],B),x([e,.88,.4],[e+.14,1,.6],V);S(.34,1.3,.5,1.42,.705,U,1),S(.56,1.34,.64,1.42,.705,Ne,1.2),y(e,b(2,0,[1,1]),h(.5,1.8,.5),le,[0,0,0],.21,B),S(.38,1.74,.62,1.88,.715,G,.7)}else{x([0,0,0],[g,v,.05],V),S(.1,.35,.6*g,v-.1,.055,U,.5);for(let e=0;e<12;e++)S(.66*g+e%3*.2,.4+.25*(e>>2),.66*g+e%3*.2+.1,.5+.25*(e>>2),.055,[W,G,Ne,U][e%4],1.3);S(.1,.1,g-.1,.18,.055,G,.9)}})})(t,e));let[,r]=te[0],i=I+r+.03;z(t,2,i,[F-3,3.4,0],[F+3,4.3,0],Ce);for(let e of[3.42,4.22])z(t,2,i+.01,[F-2.95,e,0],[F+2.95,e+.05,0],xe);for(let e=0;e<9;e++){let n=F-2.6+.6*e;z(t,2,i+.01,[n,3.9,0],[n+.45,4.1,0],[.9,.95,1]),z(t,2,i+.01,[n+.05,3.6,0],[n+.3+e%2*.1,3.7,0],U)}for(let[e,n]of[[F+16.6,.3],[F+17.1,.15]])ke(t,()=>A(t,[e,2.94,I-6.7],[e+n,3.06,I+6.7],H));_.forEach(({min:n,max:r},i)=>{let a=i?2:0,[o,s]=[n[a],i?_[0].min[2]:r[a]],c=n[2-a]+e,l=[0,2,0],u=[0,2.1,0];[l[a],u[a],l[2-a],u[2-a]]=[o,s,c,c+.12],ke(t,()=>A(t,l,u,H));for(let e=o+2.5;e<s-1;e+=5){let[n,r]=[[0,1.3,0],[0,1.5,0]];[n[a],r[a]]=[e-.2,e+.2],z(t,2-a,c+.03,n,r,W)}});for(let e of ve){let n=e.max[0]-e.min[0]<1?0:2,[r]=C.filter(({min:t,max:n})=>t[0]<=e.min[0]&&e.max[0]<=n[0]&&t[2]<=e.min[2]&&e.max[2]<=n[2]),i=(r.min[n]+r.max[n])/2>e.min[n]?1:-1,a=(i>0?e.max[n]:e.min[n])+.02*i,[o,s]=[e.min[2-n],e.max[2-n]];if(_.some(t=>[0,2].every(n=>t.min[n]<=e.max[n]+.01&&e.min[n]-.01<=t.max[n])))continue;for(let e=0;o+.3*e<s;e++){let[r,i]=[[0,ce+.05,0],[0,ce+.35,0]];[r[2-n],i[2-n]]=[o+.3*e,Math.min(o+.3*e+.15,s)],z(t,n,a,r,i,G),[r[2-n],i[2-n]]=[i[2-n],Math.min(o+.3*e+.3,s)],z(t,n,a,r,i,H)}let c=(o+s)/2,[l,u]=[[0,3.2,0],[0,3.45,0]];[l[2-n],u[2-n]]=[c-.15,c+.15],z(t,n,a,l,u,Ne)}})(a);for(let e of a)i.push(e);for(let e=0;e<a.length;e+=30)for(let t of[0,2,1]){let n=e+10*t;i.push(a[n],a[n+1],280-a[n+2],a[n+3],a[n+4],-a[n+5],...a.slice(n+6,n+10))}return i})(t,r)),t.station&&(yield,i=i.concat((({hall:[e],post:t,hull:[n,r,i,a],gun:o})=>{let s=[],{R:c}=f,l=t[0][1],[u,d]=[e[0],e[0]+48],p=[u,d].flatMap(e=>{let t=Math.acos((e-n)/c);return[t,$t-t]}),m=[...Array.from({length:72},(e,t)=>t*$t/72),...p,$t].sort((e,t)=>e-t);for(let e=r;e<a-.01;e+=2){let t=e>=l+30&&e<a-14;for(let r=0;r+1<m.length;r++){let[a,o]=[m[r],m[r+1]],f=(a+o)/2,p=n+c*Math.cos(f);if(p>u&&p<d&&e>=l-2&&e<l+16)continue;let h=t,g=h?.22:.03;for(let[t,a]of[[r,e],[r+1,e],[r+1,e+2],[r,e],[r+1,e+2],[r,e+2]]){let e=m[t],r=t%(m.length-1),[o,l]=[an(r,a,1)*g,an(r,a,2)*g],u=[Math.cos(e)+o*Math.sin(e),l,Math.sin(e)-o*Math.cos(e)];en(s,[n+c*Math.cos(e),a,i+c*Math.sin(e)],u,h?qt:Q,h?ne:k)}}}nn(s,[[c,0],[c-3,3],[.6*c,v.DOME-1],[0,v.DOME]],[n,a,i],[0,1,0],Q,k);let h=[n-16,a+v.MAST,i];rn(s,[h[0],a+4,i],h,.8,Q);let g=Array.from({length:6},(e,t)=>[2.4*t,3.6*(t/5)**2]);nn(s,[...g,...[...g].reverse().map(([e,t])=>[e,t-.3])],h,[-.6,.8,0],Yt,-1,20);let _=v.BARREL*c,y=r-o[1];nn(s,[[c,0],[c-1.5,2],[_+2,2.6],[0,2.6]],[n,r,i],[0,-1,0],Q,k),nn(s,[[0,2.6],[_+2,2.6],[_+2,5],[_,6.5],[_,y-4],[_+3,y-1.5],[_+3,y],[_-2,y],[_-3,y-10],[0,y-10.5]],[n,r,i],[0,-1,0],Jt,k);for(let e=10;e<y-8;e+=7)nn(s,[[0,e],[_+.8,e],[_+.8,e+1.6],[0,e+1.6]],[n,r,i],[0,-1,0],Q,k);nn(s,[[0,y-10.3],[_-3.5,y-10.1],[0,y-9.9]],[n,r,i],[0,-1,0],Qt,-2),$(s,[n-_-8,o[1]-18,i-16],[n-_-7.2,o[1]+8,i+16],Yt,k),rn(s,[n-_-1,o[1]+3,i],[n-_-7.2,o[1]+3,i],.6,Q);let b=r+(a-r)*v.WING,[x,S,C]=[v.PANEL,v.SPAN,v.GAP];for(let e of[-1,1]){let t=n+e*(c+v.BOOM);rn(s,[n+e*c,b,i],[t,b,i],1.4,Q),$(s,[Math.min(t,t+3*e),b-6,i-2],[Math.max(t,t+3*e),b+6,i+2],Q,k),rn(s,[t,b,i],[t+e*(4*(x+C)+2),b,i],.6,Zt);for(let n=0;n<4;n++){let r=t+e*(3+n*(x+C)),[a,o]=[Math.min(r,r+e*x),Math.max(r,r+e*x)];$(s,[a,b-S/2,i-.2],[o,b+S/2,i+.2],Xt,k);for(let e of[b-S/2,b+S/2-.6,b-.3,b-S/4,b+S/4-.3])$(s,[a,e,i-.3],[o,e+.6,i+.3],Q,k);for(let e of[a,a+x/2-.3,o-.6])$(s,[e,b-S/2,i-.3],[e+.6,b+S/2,i+.3],Q,k)}}return s})(t.station),(({hall:[e],post:t,hull:[n,,r]})=>{let i=[],a=t[0][1],[o,s]=[e[0]+4,e[0]+44],[c,l]=[r-f.R,r+f.R];for(let[e,t,n,r]of[[o+.5,2.4,.25,1],[o+.5,3.1,.16,1],[o+.7,8.5,.4,1],[s-.5,4.6,.25,-1],[s-.7,8.5,.4,-1]]){rn(i,[e,a+t,c+5],[e,a+t,l-5],n,sn);for(let o=c+8;o<l-5;o+=8)$(i,[Math.min(e,e-.5*r),a+t-n-.1,o-.15],[Math.max(e,e-.5*r)+.01,a+t+n+.1,o+.15],Jt),o/8%3<1&&rn(i,[e,a+t,o+1.5],[e,a+t,o+1.8],n+.12,cn,-1)}for(let e of[o+.6,s-.6])for(let t of[c+6,l-6])rn(i,[e,a,t],[e,a+14,t],.3,sn);for(let e of[n-10,n+10])rn(i,[e,a+13.2,c+5],[e,a+13.2,l-5],.6,sn);for(let e=c+10;e<l-5;e+=12)$(i,[n-4,a+13.7,e-.6],[n+4,a+13.9,e+.6],pn,-2);for(let e of[-1,1]){let[t,u]=[n+6,r+10*e];for(let e=0;e<32;e++){let[n,r]=[e*$t/32,(e+1)*$t/32],o=(e,n)=>[t+n*Math.cos(e),u+n*Math.sin(e)];on(i,[o(n,7),o(r,7),o(r,6.4),o(n,6.4)],a+.03,ln,-1),e%4==0&&$(i,[t+7.4*Math.cos(n)-.15,a,u+7.4*Math.sin(n)-.15],[t+7.4*Math.cos(n)+.15,a+.12,u+7.4*Math.sin(n)+.15],dn,-2)}let d=e<0?c:l;for(let n=u+10*e;e*(d-n)>4;n+=5*e)for(let r of[-1,1])on(i,[[t+.4*r,n+1.2*e],[t+3.2*r,n-.6*e],[t+3.2*r,n-1.3*e],[t+.4*r,n+.5*e]],a+.04,dn);on(i,[[o,d-.6*e],[s,d-.6*e],[s,d-.2*e],[o,d-.2*e]],a+.04,un);for(let t of[o+.06,s-.06])$(i,[t-.06,a,d-.6*e-.2],[t+.06,a+11,d-.6*e+.2],un,-2);$(i,[o,a+10.94,d-.6*e-.2],[s,a+11,d-.6*e+.2],un,-2)}let[u,d]=[s+4.2,s+13.5];for(let e of[-1,1]){let t=r+8*e;$(i,[u,a,Math.min(t,t-1.1*e)],[d,a+1,Math.max(t,t-1.1*e)],Jt,k);for(let n=u+.4;n<d-1.5;n+=2.3)$(i,[n,a+1.4,Math.min(t,t-.05*e)],[n+1.9,a+2.6,Math.max(t,t-.05*e)],fn,-2)}return $(i,[s+17.94,a+1.2,r-4],[s+18,a+3.4,r+4],fn,-2),i})(t.station))),yield,{land:i,sky:Bt(),heavens:mt}}export{mn as default};
1
+ import{$ as e,A as t,Ct as n,D as r,Dt as i,E as a,Et as o,F as s,G as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,St as y,Tt as b,U as x,W as S,X as C,Y as ee,Z as te,a as w,at as ne,bt as T,d as re,hn as ie,ht as ae,i as E,j as D,jt as O,kt as oe,lt as k,n as A,o as se,pn as j,q as ce,r as M,t as le,u as ue,un as de,vn as fe,wt as N,xt as pe,yt as me}from"./brick-KajeVVVE.js";import{i as P}from"./textures-Big8KwfG.js";import{t as he}from"./stone-DgvIDb2G.js";var ge=[.8,.82,.86],_e=[.35,.36,.4],ve=x.filter(e=>e.min[1]===2.48&&e.max[1]===4),[F,I]=S,L=[F,0,I],R=22.4,ye=[-.6,.6,.53],be=[[2,1],[0,2],[0,1]],xe=[1.25,1.3,1.4],Se=[.56,.48,.28],Ce=[.04,.04,.05],{CONCRETE:we,METAL:Te,PAINT:Ee}=j,De=(e,t,n,r=1,[i,a]=be[1])=>{for(let o of[0,1,2,0,2,3])e.push(...t[o],...ye),typeof n==`number`?e.push(t[o][i],t[o][a],n,r):e.push(n[0],n[1],-2,n[2])},z=(e,t,n,r,i,a,o)=>De(e,[[0,0],[1,0],[1,1],[0,1]].map(([e,a])=>{let o=[0,0,0],[s,c]=[(t+1)%3,(t+2)%3];return[o[t],o[s],o[c]]=[n,(e?i:r)[s],(a?i:r)[c]],o}),a,o,be[t]),Oe=(e,{min:t,max:n,top:r,side:i},a=0)=>{for(let o=0;o<3;o++)z(e,o,t[o],t,n,i,a+(o==1?.4:1.25-.15*o)),z(e,o,n[o],t,n,o==1?r:i,a+(o==1?1.85:1.25-.15*o))},ke=(e,t)=>{let n=e.length;t();let r=oe(e,0);for(let t=n;t<e.length;t+=10){if(r[t+8]==-1){let e=2.2*(.72+.28*r[t+4]-.12*Math.abs(r[t+3]));r[t+6]*=e,r[t+7]*=e,r[t+9]*=e}[r[t+3],r[t+4],r[t+5]]=ye}},[B,Ae,V,H,je,Me]=[[.86,.87,.9],[.55,.57,.6],[.32,.33,.36],[.07,.075,.085],[.42,.52,.66],[.2,.13,.08]],[U,W,G,Ne,Pe,Fe]=[[.3,.8,1],[.35,1,.5],[1,.7,.25],[1,.2,.15],[.7,.35,1],[1,.35,.85]],Ie=[[-1,96.2,242.65,98.6,242.7,1,2.3,3],[-1,96.2,229.3,98.6,229.35,1,2.3,1],[-1,61.4,242.65,63.8,242.7,1,2.3,3],[-1,61.4,229.3,63.8,229.35,1,2.3,1],[-1,73.3,252.4,73.35,255.4,4.3,5.5,0],[-1,86.65,252.4,86.7,255.4,4.3,5.5,2],[-1,73.3,216.6,73.35,219.6,1,2.3,0],[-1,86.65,216.6,86.7,219.6,1,2.3,2]],Le=(e,t,n,r,i,a)=>{for(let[o,s,c]of[[r,r+.1,0],[i-.1,i,0],[r,i,a-.1]])z(e,t,n,[o,c,o],[s,a,s],xe)},Re=(e,t,n,r,i,a,o,s=[])=>{[...s,[i,i,0]].forEach(([i,c,l],u)=>{let[d,f]=[[0,0,0],[0,a,0]];[d[2-t],f[2-t]]=[u?s[u-1][1]:r,i],z(e,t,n,d,f,Ee,o),c>i&&([d[1],d[2-t],f[2-t]]=[l,i,c],z(e,t,n,d,f,Ee,o))})},ze=[[-O/4-Math.asin(te[0][2]/R),-O/4+Math.asin(te[0][2]/R),te[0][3]],[-Math.acos((_[1].min[0]-F)/R),Math.asin((_[0].max[2]-I)/R),te[1][3]]],Be=e=>e.filter((t,n)=>{let r=n-n%30;return Math.max(e[r],e[r+10],e[r+20])>-.49}),Ve=Be(T(N([[1,0],[1,1]],12),ge)),He=Be(T(N([[1.06,0],[1.06,.3]],12),_e)),[K,Ue]=S,We=22.4,q=O/48,Ge=[.4,.42,.46],Ke=[.27,.29,.33],[J,qe,Je,Ye,Xe,Ze,Qe]=[[.16,.17,.2],[.6,.62,.66],[1,.8,.45],[.7,.9,1],[1,.6,.2],[1,.12,.08],[.35,1,.5]],$e=[.6,.64,.48],et=T(N([[1,0],[1,1]],6),[1,1,1]),tt=T(N([[0,-1],[1,0],[0,1]],6),[1,1,1]),nt=T(N([[0,0],[1,.4],[.93,.42],[0,.12]],12),[.82,.84,.88]),rt=(e,t,r,i,a=qe)=>n(e,et,t,r,$e,1,i,a),it=(e,t,n,r,i=2.2)=>{let a=e.length;y(e,tt,t,le,[0,0,0],n,r),i&&ue(e,a,i)},at=(e,t,n)=>w(e,1.8,()=>E(e,[[t-.15,.03,n-.15],[t+.15,.03,n-.15],[t+.15,.03,n+.15],[t-.15,.03,n+.15]],Ye,[t,-5,n])),ot=e=>[We*Math.cos(e*O/40),12*Math.sin(e*O/40)],Y=(e,t,n=.02)=>{let r=Math.max(t-5,0),a=Math.floor(r),[o,s]=[ot(a),ot(a+1)],[c,l]=[o[0]+(s[0]-o[0])*(r-a),o[1]+(s[1]-o[1])*(r-a)],u=i([c/We/We,l/144,0]),d=c*Math.cos(q/2)/Math.cos((e%q+q)%q-q/2)+n*u[0];return[K+d*Math.cos(e),Math.min(t,5)+l+n*u[1],Ue+d*Math.sin(e)]},st=ze.map(([e,t])=>[e-.03,t+.03]),ct=e=>!st.some(([t,n])=>[e,e-O].some(e=>e>t&&e<n)),lt=[...Array.from({length:35},(e,t)=>(2*t+1)*O/70).filter(e=>ct(e-.03)&&ct(e+.03)).map(e=>{let[t,n]=[Math.cos(e),Math.sin(e)];return[K+22.419999999999998*t,4.02,Ue+22.419999999999998*n,t,n,.38,0]}),...C.flatMap(({min:e,max:t})=>[-1,1].flatMap(n=>[-2,2].map(r=>[(n>0?t[0]:e[0])+.02*n,3.1,(e[2]+t[2])/2+r,n,0,.45,1]))).filter(([e,,t])=>!_.some(n=>e>n.min[0]-.5&&e<n.max[0]+.5&&t>n.min[2]-.6&&t<n.max[2]+.6))],ut=(e,[t,n,r,i,a],o,s,c)=>E(e,Array.from({length:12},(e,c)=>{let l=o*Math.cos(c*O/12);return[t+s*i-a*l,n+o*Math.sin(c*O/12),r+s*a+i*l]}),c,[t-i,n,r-a]),[dt,ft]=[160,280],pt=[80,0,140],mt=pt,ht=i([.3,.62,-.75]),X=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),Z=(e,t,n)=>{let[r,i]=[Math.floor(e),Math.floor(t)],[a,o]=[e-r,t-i].map(e=>e*e*(3-2*e)),s=(e,t)=>P(r+e,i+t,n);return(s(0,0)*(1-a)+s(1,0)*a)*(1-o)+(s(0,1)*(1-a)+s(1,1)*a)*o},gt=(e,t,n)=>.55*Z(e,t,n)+.3*Z(2*e,2*t,n+1)+.15*Z(4*e,4*t,n+2),_t=T(N([[1,0],[1,1]],6),[.5,.52,.56]),vt=T(N([[0,-1],[1,0],[0,1]],6),[1,1,1]),yt=T(N([[0,0],[.5,1.6],[.85,3.5],[1,6],[1,10],[.8,12.5],[.55,14],[0,14]],12),[.9,.9,.92]),bt=T(N([[0,0],[2.2,.6],[0,.9]],12),[.8,.82,.86]),xt=(e,t,n)=>{let r=e=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]-n,a=[],o=e.map(e=>{let t=[];return e.forEach((n,i)=>{let o=e[(i+1)%e.length],[s,c]=[r(n),r(o)];if(s<=0&&t.push(n),s*c<0){let e=s/(s-c),r=[n[0]+(o[0]-n[0])*e,n[1]+(o[1]-n[1])*e,n[2]+(o[2]-n[2])*e];t.push(r),a.some(e=>Math.abs(e[0]-r[0])+Math.abs(e[1]-r[1])+Math.abs(e[2]-r[2])<1e-9)||a.push(r)}}),t}).filter(e=>e.length>2);if(a.length>2){let e=a.reduce((e,t)=>e.map((e,n)=>e+t[n]/a.length),[0,0,0]),n=i(M(t,Math.abs(t[1])<.9?[0,1,0]:[1,0,0])),r=M(t,n),s=t=>{let i=[t[0]-e[0],t[1]-e[1],t[2]-e[2]];return Math.atan2(i[0]*r[0]+i[1]*r[1]+i[2]*r[2],i[0]*n[0]+i[1]*n[1]+i[2]*n[2])};o.push(a.sort((e,t)=>s(e)-s(t)))}return o},St=[0,1,2].flatMap(e=>[-1,1].map(t=>[[-1,-1],[1,-1],[1,1],[-1,1]].map(([n,r])=>{let i=[0,0,0];return i[e]=1.2*t,i[(e+1)%3]=1.2*n,i[(e+2)%3]=1.2*r,i}))),Ct=(e,t,[n,r,a],o,s,c=!0)=>{let l=(e,t)=>P(e,t,o),u=xt(St,[0,-1,0],.35),d=(e,t,n)=>{let r=Math.sqrt(1-e*e);u=xt(u,[r*Math.cos(t),e,r*Math.sin(t)],n)};d(.92+.08*l(0,1),O*l(0,2),.72+.15*l(0,3));for(let[e,t,n,r,i,a]of[[7,-.4,.2,.62,.2,0],[8,-.05,.25,.74,.18,.3],[6,.45,.3,.6,.2,.6],[c?14:0,-.22,.2,.78,.1,.5],[c?12:0,.24,.2,.76,.1,.15],[c?9:0,.66,.2,.74,.1,.4]])for(let o=0;o<e;o++){let s=10*e+o;d(t+n*l(s,1),O*((o+a+.45*l(s,2))/e),r+i*l(s,3))}let[f,p]=[.8+.4*P(o,1,9),O*P(o,2,9)],[m,h]=[Math.cos(p),Math.sin(p)],g=([e,i,o])=>{let[s,c]=[e*n*f,o*a*(2-f)];return[t[0]+s*m-c*h,t[1]+i*r,t[2]+s*h+c*m]};u.forEach((n,r)=>{let a=n.map(g).filter((e,t,n)=>Math.hypot(...e.map((e,r)=>e-n[(t+n.length-1)%n.length][r]))>1e-5);if(a.length<3)return;let o=i(M([a[1][0]-a[0][0],a[1][1]-a[0][1],a[1][2]-a[0][2]],[a[2][0]-a[0][0],a[2][1]-a[0][1],a[2][2]-a[0][2]]));o[0]*(a[0][0]-t[0])+o[1]*(a[0][1]-t[1])+o[2]*(a[0][2]-t[2])<0&&(a.reverse(),o.forEach((e,t)=>o[t]=-e));let c=i(M(o,Math.abs(o[1])<.9?[0,1,0]:[1,0,0])),u=M(o,c),d=.85*s*(.88+.24*l(r,7))*(.8+.2*Math.sqrt(Math.max(o[1]+1,0)/2)),f=e=>[...e,...o,e[0]*c[0]+e[1]*c[1]+e[2]*c[2]+7*l(0,5),e[0]*u[0]+e[1]*u[1]+e[2]*u[2]+7*l(0,6),j.ROCK,d];for(let t=1;t<a.length-1;t++)e.push(...f(a[0]),...f(a[t]),...f(a[t+1]))})},wt=(e,t,n,r,a,s,c)=>{let l=M(o(t[1],t[0]),o(t[2],t[0]));if(Math.hypot(...l)<1e-9)return;l=i(l),me(l,o(t[0],n))<0&&(t.reverse(),l=l.map(e=>-e));let u=(t[0][1]+t[1][1]+t[2][1])/3,d=.85*c*(.86+.28*P(e.length,s,7))*(.55+.45*X((u-r)/(.3*(a-r))))*(.82+.18*Math.max(l[1],0));for(let n of t)e.push(...n,...l,...Math.abs(l[1])>.7?[n[0],n[2]]:Math.abs(l[0])>Math.abs(l[2])?[n[2]+3*s,n[1]]:[n[0]+3*s,n[1]],j.ROCK,d)},Tt=(e,t,n,r,i,a)=>{let[o,s,c,l,u,d]=t[0],f=[(o+l)/2,n+.3*(u-n),(c+d)/2],[p,m]=[(i>1?.54:.5)*(l-o),(i>1?.54:.5)*(d-c)];he(e,i>2?5:i>1?3:l-o>1.4?2:1,e=>{let t=e[1]>0?u-f[1]:f[1]-s,n=[e[0]/p,e[1]/t,e[2]/m].map(e=>e*e),a=i>1?1/Math.sqrt(Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2])):1/Math.sqrt(n[0]+n[1]+n[2]),o=a*(.93+.14*Z(1.3*e[0]+r,1.3*e[2]+e[1],r));return[f[0]+e[0]*o,Math.min(f[1]+e[1]*a,u),f[2]+e[2]*o]},n,u,r,a)},Et=(e,t,n)=>{y(e,T(N([[13,0],[13,.27],[0,.27]],32),[.13,.13,.15]),[t,0,n],le,[0,0,0],1),re(e,[t,.29,n],7.6,8,[.8,.8,.82]);for(let r=0;r<24;r++){let i=r*O/24,[a,o]=[t+11.6*Math.cos(i),n+11.6*Math.sin(i)],s=(e,t)=>[a+e,.31,o+t];w(e,1.8,()=>E(e,[s(-.25,-.25),s(.25,-.25),s(.25,.25),s(-.25,.25)],r%3?[1,.95,.8]:[1,.45,.1],[a,-5,o]))}},Dt=(e,t,n,r,i=10,a=[1,.93,.75])=>{y(e,_t,[t,r,n],le,[0,0,0],[.2,.2,i]),y(e,_t,[t,r,n],le,[0,0,0],[.5,.5,.5]),w(e,se,()=>y(e,vt,[t,r+i+.4,n],le,[0,0,0],[.55,.55,.45],a))},Ot=(e,t)=>{let n=(n,r)=>{let[i,a]=[t[n],O*(r+.5*n)/e];return[Math.sqrt(1-i*i)*Math.cos(a),i,Math.sqrt(1-i*i)*Math.sin(a)]},r=[];for(let i=0;i<e;i++){r.push([[0,1,0],n(0,i+1),n(0,i)]);for(let e=0;e+1<t.length;e++)r.push([n(e,i),n(e,i+1),n(e+1,i)],[n(e+1,i),n(e,i+1),n(e+1,i+1)])}return r},kt=[Ot(6,[-.35]),Ot(5,[.45,-.35]),Ot(9,[.62,.1,-.35])],At=[.08,.2,.45],jt=(e,t,n,r,i,a,o)=>{Tt(e,[[t,a-4,n,r,a,i]],a-3.4,o,3,.9),Tt(e,[[t+.15,-17,n+.15,r-.15,a-3,i-.15]],-15,o+9,2,.5)},Mt=[[0,.02,.6],[.55,.04,.72],[.88,.2,1.05],[1,.24,1.12],[1.4,.015,1]],Nt=({brushes:e},t,n,r)=>!e.some(e=>e.max[1]>0&&Math.hypot(Math.max(e.min[0]-t,t-e.max[0],0),Math.max(e.min[2]-n,n-e.max[2],0))<r+.5)&&[0,1,2,3,4].every(i=>{let[a,o]=i?[t+r*Math.cos(1.57*i),n+r*Math.sin(1.57*i)]:[t,n];return Math.abs(a-pt[0])<=pt[0]-.5&&Math.abs(o-pt[2])<=pt[2]-.5&&e.some(e=>e.max[1]==0&&a>e.min[0]&&a<e.max[0]&&o>e.min[2]&&o<e.max[2])}),Pt=(e,t)=>{let n=[0,20,40,60,80,120,160,200,240];return[...n.map(t=>e-t).reverse(),...Array.from({length:(t-e)/20-1},(t,n)=>e+20*(n+1)),...n.map(e=>t+e)]},Ft=[[0,0,0,1],[-.6,-.25,0,.9],[-3,-.2,.7,.95],[-7,.1,.9,.85],[-7.4,.8,.9,.5],[-14,1,1.2,.55],[-14.5,1.7,1.2,.3],[-22,2.1,1.5,.34],[-30,5.6,1.5,.12]],It=(()=>{let e=e=>h[Math.min(Math.max(e,0),h.length-1)],t=[[0,140]];for(let n=0;n<=h.length;n++){let[r,i]=[e(n-1),e(n)];Math.abs(r-i)>.5?t.push([n,148+r],[n,148+i]):t.push([n,148+Math.min(r,i)-.12*P(n,1,71)])}return[...t,[h.length,140]]})(),Lt=[[640,75,4,.17,.02,3],[690,95,3,.16,.03,5],[740,115,3,.15,.04,8]],Rt=(e,t,n,r)=>{let i=(i,a)=>Z(e*n/i+7*r,t*n/i-3*r,r+a),a=n=>{let i=O*P(r,n,97);return e*Math.cos(i)+t*Math.sin(i)},o=Math.max(X((a(1)-.93)/.07),.8*X((a(2)-.95)/.05)),s=Math.max(X((a(3)-.985)/.015),X((a(4)-.985)/.015)),c=1-Math.abs(2*i(150,2)-1);return(.42+.2*i(520,1)+.14*c*c+.24*o)*(1-.5*s)+.1*(i(60,3)-.5)+.04*(i(24,4)-.5)};function*zt(u){let f=[];(t=>{(t=>{(e=>{let t=Array.from({length:9},(e,t)=>{let n=(t+1)/10*(O/4);return[R*Math.cos(n),5+12*Math.sin(n)]}),n=[];y(n,T(N([[R,0],[R,5],...t,[0,17]],48),ge),[F,0,I],le,[0,0,0],1);let r=(e,t)=>(t?Math.ceil:Math.floor)(e*48/O)*O/48;for(let t=0;t<n.length;t+=30){let[i,a,o]=[t,t+10,t+20],s=Math.atan2(n[i+2]+n[a+2]+n[o+2]-3*I,n[i]+n[a]+n[o]-3*F);if(Math.max(n[i+1],n[a+1],n[o+1])>5.01||!ze.some(([e,t])=>s>r(e,0)&&s<r(t,1)))for(let r=t;r<t+30;r++)e.push(n[r])}let i=(e,t)=>[F+R*Math.cos(e),t,I+R*Math.sin(e),Math.cos(e),0,Math.sin(e),ge[0],ge[1],-1,ge[2]];for(let[t,n,a]of ze){let o=[r(t,0),t];for(let e=Math.ceil(t*48/O);e*O/48<n;e++)o.push(e*O/48);o.push(n,r(n,1)),o.slice(1).forEach((t,n)=>{let r=o[n],s=n&&n<o.length-2?a:0;e.push(...i(r,s),...i(t,s),...i(t,5),...i(r,s),...i(t,5),...i(r,5))})}let a=(e,t,n)=>[F+(R+n)*Math.cos(e),t,I+(R+n)*Math.sin(e)];for(let t=0;t<70;t++){let n=t*O/70,r=n>O/2?n-O:n;if(ze.some(([e,t])=>r>e-.04&&r<t+.04))continue;let i=(e,t,r,i)=>[[-e,t],[e,t],[e,r],[-e,r]].map(([e,t])=>a(n+e/R,t,i));E(e,i(.72,1.5,2.9,.04),[.06,.06,.08],[F,2.2,I]),w(e,.56,()=>E(e,i(.6,1.7,2.7,.07),[1,.85,.5],[F,2.2,I]))}let[,o,s,c,l]=te[0],u=I+o-l;for(let[t,n,r]of[[-s-.3,-s-.02,0],[s+.02,s+.3,0],[-s-.3,s+.3,c]])A(e,[F+t,r,u-.1],[F+n,c+.3,u+.5],_e),z(e,2,u-.12,[F+t+.09,r+.09,0],[F+n-.09,c+.21,0],xe)})(t),(e=>{let t=[...d,...d.map(([e,t])=>[t,e]).reverse()];for(let[n,r]of t)z(e,1,.02,[F-n,0,I-r],[F+n,0,I+r],we,1.85);let n=t.flatMap(([e,n],r)=>[[e,n],...t[r+1]?[[t[r+1][0],n]]:[]]),r=[...n,...n.map(([e,t])=>[-e,t]).reverse(),...n.map(([e,t])=>[-e,-t]),...n.map(([e,t])=>[e,-t]).reverse()];r.forEach((t,n)=>{let i=r[(n+1)%r.length],a=t[0]==i[0]?0:2,o=2-a,[s,c]=[L[a]+t[a/2],Math.sign(t[a/2])],[l,u]=[t[o/2],i[o/2]].sort((e,t)=>e-t),d=te.find(e=>e[a/2]==t[a/2]&&e[o/2]>l&&e[o/2]<u),[f,p,m,h]=d?[d[o/2],d[2],d[3],d[4]]:[l,0,0,0],g=(t,n,r,i,l,u=0,d=0)=>{let[f,p]=[[0,r,0],[0,i,0]];[f[o],p[o]]=[L[o]+t,L[o]+n],z(e,a,s-c*d,f,p,l,u)};Re(e,a,s,L[o]+l,L[o]+u,8,1.7,d&&[[L[o]+f-p,L[o]+f+p,m]]),g(l,u,0,.25,Ce,0,.02),g(l,u,7.4,7.6,xe,0,.03);let _=u-l>6?Math.floor((u-l)/2.4):0;for(let e=0;e<_;e++){let t=l+(u-l)*(e+.5)/_;for(let e of[1.5,4.9])(e>m||Math.abs(t-f)>p+.8)&&(g(t-.72,t+.72,e,e+1.4,Ce,0,.02),g(t-.6,t+.6,e+.2,e+1.2,Se,0,.04))}let v=Math.ceil((u-l)/4.2);for(let n=0;n<v;n++){let r=(e,n)=>{let r=[0,8,0];[r[a],r[o]]=[t[a/2],l+(u-l)*e/v];let i=n?21.55/Math.hypot(r[0],r[2]):1;return[F+r[0]*i,8,I+r[2]*i]};De(e,[r(n,0),r(n+1,0),r(n+1,1),r(n,1)],we,1)}if(d){let[t,n]=[[0,0,0],[0,m,0]];[t[a],n[a]]=[s,s+c*h].sort((e,t)=>e-t),[t[o],n[o]]=[L[o]+f-p,L[o]+f+p],z(e,o,t[o],t,n,Ee,1.4),z(e,o,n[o],t,n,Ee,1.4),z(e,1,m,t,n,Ee,.9),z(e,1,.02,t,n,we,1.85),Le(e,a,s-.03*c,t[o],n[o],m)}});let[i,a,o]=[32,6,Math.asin(3/11.7)],s=(e,t)=>{let[n,r]=[o+(O/4-o)*t/a,e*O/i],s=22.099999999999998*Math.cos(n);return[F+s*Math.cos(r),5+11.7*Math.sin(n),I+s*Math.sin(r)]};for(let t=0;t<a;t++)for(let n=0;n<i;n++){let r=.31-.028*t-.018*(n+t&1);De(e,[s(n,t),s(n+1,t),s(n+1,t+1),s(n,t+1)],[r,r,1.06*r])}for(let t=0;t<16;t+=2){let n=e=>[F+3*Math.cos(e*O/16),16.2,I+3*Math.sin(e*O/16)];De(e,[[F,16.2,I],n(t),n(t+1),n(t+2)],xe)}c.forEach(t=>Oe(e,t))})(t),(t=>{_.forEach(({min:r,max:i},a)=>{let o=a?2:0,[s,c,l]=[r[o],a?_[0].min[2]:i[o],(r[2-o]+i[2-o])/2],u=e=>o?[l,1.75,e]:[e,1.75,l],d=(i[2-o]-r[2-o])/2+.1;n(t,Ve,u(s),u(c),[0,1,0],1,[1.75,d]);for(let e=5;e<c-s-1;e+=5)n(t,He,u(s+e),u(s+e+.3),[0,1,0],.3,[1.75,d]);Re(t,2-o,r[2-o]+e+.02,s,c,ce,1.4),Re(t,2-o,i[2-o]-e-.02,a?s:_[1].min[0],c,ce,1.4),z(t,1,ce-.01,r,i,Ee,.9);let[f,p]=[[...r],[...i]];[f[2-o],p[2-o]]=[l-.15,l+.15],z(t,1,ce-.02,f,p,xe)})})(t),(t=>{for(let{min:n,max:r}of C){let i=[(n[0]+r[0])/2,2.5,(n[2]+r[2])/2];for(let a of[-1,1]){let o=a>0?r[2]:n[2];for(let r=0;r<7;r++){let s=n[0]+1+2*r;if(ve.some(e=>Math.abs(e.min[2]-o)<1&&s+.72>e.min[0]&&s-.72<e.max[0]))continue;let c=(e,t,n,r)=>[[-e,t],[e,t],[e,n],[-e,n]].map(([e,t])=>[s+e,t,o+a*r]);E(t,c(.72,2.6,3.8,.02),[.06,.06,.08],i),w(t,.5,()=>E(t,c(.6,2.7,3.7,.04),[.9,.95,1],i)),De(t,c(.56,2.6,3.8,-e-.04),Ce),De(t,c(.46,2.7,3.7,-e-.06),[.45,.48,.5])}}for(let i of[0,2])for(let[a,o]of[[n[i],e+.02],[r[i]-e,-.02]])Re(t,i,a+o,n[2-i]+e,r[2-i]-e,4,1.5,ve.filter(e=>Math.abs(e.min[i]-a)<.01).map(e=>[e.min[2-i],e.max[2-i],ce]));z(t,1,3.99,n,r,Ee,.9);for(let e=0;e<3;e++){let a=n[0]+(r[0]-n[0])*(e+.5)/3;z(t,1,3.98,[a-1.2,0,i[2]-.3],[a+1.2,0,i[2]+.3],xe)}}})(t);for(let{min:e,max:n}of[...C,..._])z(t,1,.02,e,n,Te,1.99);for(let{min:e,max:n}of ve){let r=n[0]-e[0]<1?0:2;for(let i of[e[r]-.02,n[r]+.02])Le(t,r,i,e[2-r],n[2-r],e[1])}})(t),(t=>{(e=>{let t=(t,n=Ge)=>E(e,t,n,[K,5,Ue]),n=(e,n,r,i,a,o)=>{for(let s=e;s<n-1e-9;){let e=Math.min(n,(Math.floor(s/q+1e-9)+1)*q);t([Y(s,r,o),Y(e,r,o),Y(e,i,o),Y(s,i,o)],a),s=e}};for(let[t,r]of[[st[0][1],st[1][0]],[st[1][1],st[0][0]+O]])n(t,r,0,.45,J),w(e,1.6,()=>n(t,r,.16,.3,Ye,.035)),n(t,r,3.18,3.32);n(0,O,4.55,5.01,J,.03),[.4,1.9,2.5,3.7,5.2].forEach(e=>n(e,e+.05,4.68,4.86,qe,.045));for(let e=0;e<70;e++){let n=(e+.5)*O/70,r=.07/We;ct(n)&&[0,2].includes(e%5)&&t([Y(n-r,.45),Y(n+r,.45),Y(n+r,4.55),Y(n-r,4.55)])}let r=(e,n=.1,r,i=.03)=>e.slice(1).forEach(([a,o],s)=>{let[c,l]=e[s],u=Math.max(Math.abs(a-c),Math.abs(o-l)),d=(e,t)=>{let[r,s]=[c+(a-c)*e/u,l+(o-l)*e/u];return a==c?Y(r*q+t*n/ot(s)[0],5+s,i):Y(r*q,5+s+t*n/2.5,i)};for(let e=0;e<u;e++)t([d(e,-1),d(e,1),d(e+1,1),d(e+1,-1)],r)});for(let t=0;t<12;t++){let n=4*t;r([[n,0],[n,9]],.22,Ke,.05),1&t?(w(e,1.6,()=>r([[n,1],[n,8]],.04,Ye,.065)),r([[n,4],[n+2,2],[n+4,4]]),r([[n,6],[n+1,7],[n+3,7],[n+4,6]])):(r([[n,2],[n+1,3],[n+3,3],[n+4,2]]),r([[n+1,3],[n+1,5],[n+2,6],[n+3,5],[n+3,3]]))}n(0,O,13.75,14.15,Ke,.05),w(e,1.6,()=>n(0,O,13.9,14,Ye,.065));for(let[t,r]of[[5,0],[22,1],[34,0]])n(t*q+.02,(t+2)*q-.02,5.25+r,5.8+r,J,.03),w(e,2,()=>n(t*q+.04,t*q+.05,5.65+r,5.72+r,Qe,.045));let[,i,a,o,s]=te[0],c=Ue+i-s;for(let[t,n,r]of[[-a-.62,-a-.3,0],[a+.3,a+.62,0],[-a-.62,a+.62,o+.3]])A(e,[K+t,r,c-.04],[K+n,o+.62,c+.6],J),w(e,1.5,()=>E(e,[[t+.1,r+.1],[n-.1,r+.1],[n-.1,o+.52],[t+.1,o+.52]].map(([e,t])=>[K+e,t,c-.055]),Xe,[K,1,Ue]));for(let t=1;t<7;t++)for(let n of[-2.6,2.6])at(e,K+n,c-2.5*t);let l=(e,t=0,n=0)=>[K+t,e,Ue+n];it(e,l(17),.7,J,0),rt(e,l(17),l(25.099999999999998),.11),[1.9,1.5,1.1].forEach((t,n)=>{let r=20+1.6*n;rt(e,1&n?l(r,0,-t):l(r,-t),1&n?l(r,0,t):l(r,t),.06)}),it(e,l(25.4),.34,Ze)})(t),(e=>{_.forEach(({min:t,max:n},r)=>{let i=r?2:0,a=2-i,[o,s]=[t[i],r?_[0].min[2]:n[i]];for(let r=1;o+5*r/3<s-1;r++)if(r%3){let[s,c]=[[0,0,0],[0,3.53,0]];[s[i],c[i]]=[o+5*r/3-.06,o+5*r/3+.06];for(let r of[0,1]){s[a]=r?n[a]:t[a]-.12,c[a]=s[a]+.12,A(e,s,c,Ge,12|(i?32:2)>>r);let o=r?c[a]+.015:s[a]-.015;w(e,1.8,()=>E(e,[[s[i]+.015,2.7],[c[i]-.015,2.7],[c[i]-.015,2.9],[s[i]+.015,2.9]].map(([e,t])=>{let n=[0,t,0];return[n[i],n[a]]=[e,o],n}),Ye,[(t[0]+n[0])/2,2.8,(t[2]+n[2])/2]))}[s[a],c[a],s[1]]=[t[a]-.12,n[a]+.12,3.5],A(e,s,c,Ge,4|(i?48:3))}})})(t),(e=>{C.forEach(({min:t,max:r},i)=>{for(let n of[0,2]){let i=2-n;for(let a of[-1,1]){let o=a>0?r[n]:t[n],s=(n?1:16)*(a>0?1:2),c=(e,t,r)=>{let s=[0,t,0];return[s[n],s[i]]=[o+a*r,e],s},l=(t,n,r,i=0)=>A(e,t.map((e,t)=>Math.min(e,n[t])),t.map((e,t)=>Math.max(e,n[t])),r,i),u=(t,n,r,i,a,o)=>E(e,[c(t,n,a),c(r,n,a),c(r,i,a),c(t,i,a)],o,c(t,n,-1)),[d]=ve.filter(e=>Math.abs((a>0?e.max[n]:e.min[n])-o)<.01&&e.min[i]>t[i]&&e.max[i]<r[i]).map(e=>{let t=(e.min[i]+e.max[i])/2;return e.max[i]-e.min[i]>3?[t-2.25,t+2.25,3.62,0]:[t-1.32,t+1.32,ce+.14,t]});l(c(t[i]-.06,4.7,0),c(r[i]+.06,5,.06),J,s|(n?48:3));for(let[e,n]of d?[[t[i],d[0]],[d[1],r[i]]]:[[t[i],r[i]]])l(c(e,0,0),c(n,.3,.04),Ge,4|s);let f=(t[i]+r[i])/2;for(let i of n?[1,-1]:[]){let n=i>0?t[0]:r[0],a=d?d[i>0?0:1]:f-.8*i;(a-n)*i>4.2&&(u(n,1,n+3*i,1.1,.02,Ge),u(n+4*i,2,a,2.1,.02,Ge),E(e,[c(n+3*i,1,.02),c(n+4*i,2,.02),c(n+4*i,2.1,.02),c(n+3*i,1.1,.02)],Ge,c(n,1,-1)))}if(n&&w(e,1.6,()=>u(t[0]+.3,4.82,r[0]-.3,4.9,.075,Ye)),!n&&!d){u(f-1.1,.9,f+1.1,1.9,.02,J);for(let e=0;e<4;e++)u(f-1,1.05+.2*e,f+1,1.15+.2*e,.035,qe)}if(d?.[3]){let t=d[3];l(c(t-.5,2.95,0),c(t+.5,3.05,.22),J,s),w(e,1.8,()=>l(c(t-.4,2.83,0),c(t+.4,2.95,.12),Je,8|s)),l(c(t-.05,4.1,0),c(t+.05,4.2,.5),J,s),l(c(t-.5,4.2,.32),c(t+.5,4.42,.5),qe),w(e,2,()=>u(t-.42,4.27,t-.3,4.35,.515,Qe)),rt(e,c(t+.35,4.42,.41),c(t+.35,5.4,.41),.03),it(e,c(t+.35,5.45,.41),.07,Ze);for(let n of[1.5,3.5,5.5])for(let r of[t-1.5,t+1.5]){let[t,,i]=c(r,0,n);at(e,t,i)}}}}if(i){let n=r[0]-.7;A(e,[n-.3,5,t[2]+2],[n+.3,5.2,r[2]-2],J),[3.4,4.6,2.8].forEach((r,i)=>{let a=t[2]+2.5+1.5*i;rt(e,[n,5.2,a],[n,5.2+r,a],.04),it(e,[n,5.26+r,a],.07,1&i?Ze:Ye)})}else{let i=[r[0]-1.4,6.35,t[2]+1.4],a=e=>[i[0]+.6*e,i[1]+.8*e,i[2]];A(e,[i[0]-.4,5,i[2]-.4],[i[0]+.4,5.12,i[2]+.4],J),rt(e,[i[0],5,i[2]],i,.16),it(e,i,.26,J,0),n(e,nt,a(.1),a(1.1),$e,1,1.15),rt(e,a(.2),a(1.05),.03),it(e,a(1.1),.08,Ze)}})})(t),(t=>{for(let n of lt){let r=n[5];if(ut(t,n,r+.1,0,J),w(t,.7,()=>ut(t,n,r,.015,Je)),n[6]){let i=t.length,a=[n[0],n[1],n[2],-n[3],-n[4]];ut(t,a,r+.1,e+.06,[.04,.04,.05]),ut(t,a,r,e+.08,[.45,.48,.5]);for(let e=i;e<t.length;e+=10)[t[e+3],t[e+4],t[e+5],t[e+8]]=[...ye,-2]}}})(t)})(t);for(let[e,n]of r.pads.slice(0,r.pads.length/2))Et(t,e,n);for(let[e,n]of r.masts.slice(0,r.masts.length/2))Dt(t,e,n,0)})(f),u.relief&&((e,t)=>{let{at:n}=t.relief,a=It,s=(e,t)=>Math.max(n(e,Math.max(t,148)),0),c=e=>X(4*(Z(e/6,.5,82)-.35))*(.55+.45*Z(e/1.7,.5,83)),l=([e,t],n)=>{let[r,i,a]=Ft[n];return[e,n?r:s(e,t),t-i-a*c(e)*+!!n]};for(let t=0;t<a.length-1;t++){let[n,r]=[a[t],a[t+1]];for(let a=0;a<Ft.length-1;a++){let s=[l(n,a),l(r,a),l(r,a+1),l(n,a+1)];for(let[l,u,d]of t+a&1?[[0,1,2],[0,2,3]]:[[0,1,3],[1,2,3]]){let f=M(o(s[u],s[l]),o(s[d],s[l]));if(Math.hypot(...f)<1e-9)continue;f=i(f),f=f[2]>0||Math.abs(f[2])<1e-9&&f[1]<0?f.map(e=>-e):f;let p=Ft[a][3]*(.82+.3*P(t,a,73))*(.7+.3*c((n[0]+r[0])/2));for(let t of[s[l],s[u],s[d]])e.push(...t,...f,t[0]+t[2],t[1],j.ROCK,p)}}}r.pillars.forEach(([t,n,r,i,a],o)=>n>140&&jt(e,t,n,r,i,a,o+400)),E(e,[[-2,-30,140],[162,-30,140],[162,-30,158],[-2,-30,158]],[.012,.012,.015]);for(let t=0;t<9;t++){let n=6+17*t+8*P(t,1,77);w(e,.1,()=>E(e,[[n,-29.9,140],[n+9+6*P(t,2,77),-29.9,140],[n+5,-29.9,140.25+.3*P(t,3,77)]],[.2,.55,1]));let r=1.5+2.5*P(t,4,77);Ct(e,[n,-29.6,142.5+5*P(t,5,77)],[r,.7*r,r],t+200,.25,!1)}})(f,u);let v=u.relief?.at??(()=>0);r.crags.forEach(e=>((e,{at:[t,n,r],R:i,H:a,s:o},c)=>{let{reach:u}=l(o,i,a),d=[t,n+s(a),r];he(e,i<1.5?3:i<2.5?4:5,e=>{let t=u(e);return[d[0]+e[0]*t,d[1]+e[1]*t,d[2]+e[2]*t]},n,n+a,o,.8+.4*P(o,5,41),c)})(f,e,v));let b=f.concat((e=>{let t=[];for(let n=0;n<e.length;n+=30)for(let r of[0,2,1]){let i=n+10*r;t.push(e[i],e[i+1],ft-e[i+2],e[i+3],e[i+4],-e[i+5],...e.slice(i+6,i+10))}return t})(f));yield,u.relief&&((e,t)=>{for(let[n,i,o,s,c]of(e=>{let t=fe(e.relief),[n,i,o,s]=t.bound,c=(e,n)=>{if(e>t.hole[0]-.3&&e<t.hole[2]+.3&&n>t.hole[1]-.3&&n<t.hole[3]+.3||t.pits.some(t=>e>=t[0]-.3&&e<=t[2]+.3&&n>=t[1]-.3&&n<=t[3]+.3))return NaN;let[r,i]=[(e-t.x0)/t.cell,(n-t.z0)/t.cell],[a,o]=[Math.floor(r),Math.floor(i)],[s,c]=[r-a,i-o],l=a+o*t.nx,[u,d,f,p]=[t.h[l],t.h[l+1],t.h[l+t.nx],t.h[l+t.nx+1]];return s>=c?u+(d-u)*s+(p-d)*c:u+(f-u)*c+(p-f)*s},l=[],u=(e,t,u,d=1)=>{if(((e,t)=>{let l=t-ft/2,u=([t,n,r,i])=>Math.hypot(Math.max(t-e,e-r,0),Math.max(n-l,l-i,0));return l>.3&&Math.hypot((e-n)/o,(t-i)/s)<.97&&!a.some(e=>u(e)<2.5)&&!g.some(e=>u(e)<1)&&!r.pits.some(n=>Math.abs(e-n.x)<p+.5&&Math.abs(t-n.z)<p+.5)&&!r.crags.some(n=>Math.hypot(e-n.at[0],t-n.at[2])<1.3*n.R)&&Number.isFinite(c(e,t))})(e,t)){let n=P(u,3,211);l.push([e,c(e,t),t,n<.62?0:n<.945+.055*(1-d)?1:2,u])}};r.sites.forEach(([e,t,n],r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>P(r,5*i+e,201),o=n*(.1+1.7*a(1)*a(1));u(e+o*Math.cos(O*a(2)),t+o*Math.sin(O*a(2)),1e3*r+i)}}),r.crags.forEach(({at:[e,,t],R:n},r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>P(r,5*i+e,215),o=n*(1.32+.75*a(1)*a(1));u(e+o*Math.cos(O*a(2)),t+o*Math.sin(O*a(2)),5e5+1e3*r+i)}}),r.bowls.forEach(([e,t,n],r)=>{for(let i=0;t>=ft/2&&i<Math.round(1.1*n);i++){let a=e=>P(r,5*i+e,203),o=i%5<2?.94+.16*a(1):1.15+1.25*a(1)*a(1);u(e+o*n*Math.cos(O*a(2)),t+o*n*Math.sin(O*a(2)),1e5+1e3*r+i)}});for(let e=0;e<60;e++){let t=t=>P(e,t,205),n=1+158*t(1),r=h[Math.floor(n)];u(n,ft/2+8+Math.max(r,0)+.5+2.5*t(2)*t(2),2e5+e,.5)}for(let e=0;e<18;e++){let t=t=>P(e,t,207),[r,i,a]=[n+o*(1.8*t(1)-.9),ft/2+4+(s-8)*t(2),O*t(3)];for(let n=0;n<10+12*t(4);n++)a+=.5*(P(e,10+n,208)-.5),[r,i]=[r+(1+1.4*P(e,40+n,208))*Math.cos(a),i+(1+1.4*P(e,40+n,208))*Math.sin(a)],u(r+.8*(P(e,70+n,208)-.5),i+.8*(P(e,100+n,208)-.5),3e5+100*e+n,.6)}for(let e=0;e<520;e++){let t=t=>P(e,t,209),[r,i]=[n+o*(2*t(1)-1),ft/2+s*t(2)];(Z(r/20,i/20,77)>.62||t(3)<.04)&&u(r,i,4e5+e,.7)}return[...l,...l.map(([e,,t,n,r])=>[e,c(e,ft-t),ft-t,n,r])]})(t)){let t=e=>P(c,e,213),r=At[s]*(.88+.24*t(1)),[a,l,u]=[r/2,r/2*(.65+.35*t(2)),r*(.5+.3*t(3))],[d,f]=[Math.cos(O*t(4)),Math.sin(O*t(4))],p=i+.1*u;he(e,kt[s],e=>{let[t,r]=[e[0]*d+e[2]*f,e[2]*d-e[0]*f],i=(.9+.2*Z(1.3*e[0]+c,1.3*e[2]+e[1],c%97))/Math.hypot(t/a,2*e[1]/u,r/l);return[n+e[0]*i,p+e[1]*i,o+e[2]*i]},i,p+u/2,c,.5+.25*t(5))}})(b,u);for(let[e,t,n,i,a]of r.pillars)t<140&&i>140&&jt(b,e,t,n,i,a,401);return((e,t)=>{let n={relief:t.relief&&fe(t.relief)},r=(e,r,i)=>!t.relief||Array.from({length:17},(e,t)=>t*O/16).every((t,a)=>ie(n,e+(a?i*Math.cos(t):0),r+(a?i*Math.sin(t):0))===0);for(let n=0,i=0;i<72&&n<900;n++){let[a,o,s]=[dt*P(n,1,61),ft*P(n,2,61),.6+2*P(n,3,61)**2];if(!Nt(t,a,o,1.5*s)||!r(a,o,1.5*s)||Math.abs(o-pt[2])<24||(t.rovers??[]).some(([e,,t])=>Math.hypot(a-e,o-t)<6))continue;i++;let c=(e,t)=>{let[r,i,c]=Mt[e],[l,u]=[r*(e&&e<4?.86+.28*P(n,t%12,67):1),e===2||e===3?i*(.55+.45*P(n,t%12,68)):i],d=t*O/12,[f,p]=[Math.cos(d),Math.sin(d)],[m,h]=[Mt[Math.max(e-1,0)],Mt[Math.min(e+1,Mt.length-1)]],g=-3*(h[1]-m[1])/((h[0]-m[0])*s),_=Math.hypot(g,1),[v,y]=[a+f*l*s,o+p*l*s];return[v,u,y,g*f/_,1/_,g*p/_,v,y,j.STONE,c]};for(let t=0;t<Mt.length-1;t++)for(let n=0;n<12;n++){let[r,i,a,o]=[c(t,n),c(t+1,n),c(t+1,n+1),c(t,n+1)];e.push(...r,...a,...i,...r,...o,...a)}}})(b,u),yield,u.relief&&(((e,t)=>{let{at:n}=t.relief,r=(e,t)=>n(e,Math.max(t,148));for(let t of[1,-1]){let n=(e,n)=>{let a=i([r(e-1,n)-r(e+1,n),2,t*(r(e,n-1)-r(e,n+1))]);return[e,Math.max(r(e,n),0),140+t*(n-140),...a,e,140+t*(n-140),j.STONE,1]};for(let t=0;t<It.length-1;t++){let[r,i]=[It[t],It[t+1]];if(r[0]!==i[0]){let[t,a,o,s]=[n(r[0],156),n(i[0],156),n(i[0],i[1]),n(r[0],r[1])];e.push(...t,...o,...a,...t,...s,...o)}}}})(b,u),(e=>{for(let[n,{x:a,z:o,level:s,rows:c}]of r.pits.entries()){let r=(e,t)=>c[e]?.[2+t]??0,l=Array.from({length:c.length+1},(e,t)=>[c[0][0]+t,-Math.min(r(t-1,0),r(t,0)),Math.min(r(t-1,1),r(t,1))]),u=(e,t)=>[e,s,t,0,1,0,e,t,j.STONE,.6+.4*X((Math.hypot(e-a,t-o)-D)/3)],d=(t,n,r,i)=>e.push(...t,...r,...n,...t,...i,...r);for(let[e,t]of[[o-p,o-D],[o+D,o+p]])for(let n=a-p;n<a+p;n+=2)d(u(n,e),u(n+2,e),u(n+2,t),u(n,t));for(let r=0;r<l.length-1;r++){let[[c,f,m],[h,g,_]]=[l[r],l[r+1]];d(u(a-p,c),u(a+f,c),u(a+g,h),u(a-p,h)),d(u(a+m,c),u(a+p,c),u(a+p,h),u(a+_,h));for(let c of[1,2]){let u=[s,s-.6,s-5,s-10,t],d=(e,t)=>[a+e[c]+(c>1?-1:1)*(t&&t<4?.9*P(e[0],t,83+c)-.25:0),u[t],e[0]];for(let f=0;f<4;f++){let p=[d(l[r],f),d(l[r+1],f),d(l[r+1],f+1),d(l[r],f+1)],m=[a+(c>1?99:-99),u[f],o],h=e.length;wt(e,[p[0],p[1],p[2]],m,t-12,s,n+f,1.2),wt(e,[p[0],p[2],p[3]],m,t-12,s,n+f,1.2);for(let t=h+3;t<e.length;t+=10){let n=i([e[t],e[t+1]+.9,e[t+2]]);[e[t],e[t+1],e[t+2]]=n}}}}let f=(e,n)=>[e,t,n,0,1,0,e,n,j.STONE,.5];d(f(a-D-1.5,o-D),f(a+D+1.5,o-D),f(a+D+1.5,o+D),f(a-D-1.5,o+D));let h=c[D][3],g=(s-t)/m;for(let r=0;r<m-1;r++){let i=a+h-1.3*(m-1-r);Tt(e,[[i,t-1,o-1,i+1.3,t+g*(r+1),o+1]],t,9*n+r,2,.9)}for(let t=0;t<20;t++){let r=O*(t+P(n,t,85))/20,[i,c,l]=[a+(D+1.6)*Math.cos(r),o+(D+1.6)*Math.sin(r),.3+.35*P(n,t,86)];Tt(e,[[i-l,s-.3,c-l,i+l,s+.9*l,c+l]],s,40*n+t,1,.9)}}})(b),yield,((e,t)=>{let{at:n}=t.relief,i={relief:fe(t.relief)};r.bowls.forEach(([t,r,a],o)=>{let s=a<12?0:Math.round(O*a/1.5),c=Array.from({length:s},(e,i)=>{let[o,c]=[Math.cos(O*i/s),Math.sin(O*i/s)],[l,u]=[a,-1/0];for(let e=.8*a;e<1.3*a;e+=.5){let i=n(t+o*e,r+c*e);[l,u]=i>u?[e,i]:[l,u]}return l}),l=Array.from({length:s},(e,n)=>{let[a,l]=[Math.cos(O*n/s),Math.sin(O*n/s)],u=[-2,-1,0,1,2].reduce((e,t)=>e+c[(n+t+s)%s],0)/5,d=P(n,o,87);return[-2.4,-1.2,0,1.2,2.4].map((e,s)=>{let[c,f]=[t+a*(u+e),r+l*(u+e)],p=[.04,.12,.1+.15*d,.1,.04][s],m=[.62+.3*P(n>>1,o,88),.9,1.22+.2*d,1.1,1][s];return[c,ie(i,c,f)+p,f,0,1,0,c,f,j.STONE,m]})});l.forEach((t,n)=>{let r=l[(n+1)%s];for(let n=0;n<4;n++)[t[n],t[n+1],r[n],r[n+1]].every(e=>Number.isFinite(e[1]))&&e.push(...t[n],...r[n+1],...r[n],...t[n],...t[n+1],...r[n+1])})})})(b,u),yield,((e,t)=>{let n=fe(t.relief),[a,o,s,c]=n.bound,[l,u]=[Pt(n.x0,a+s),Pt(n.z0,o+c)],d=(e,r)=>{let[i,a]=[(e-n.x0)/n.cell,(r-n.z0)/n.cell];return i%1||a%1||i<0||a<0||i>=n.nx||a>=n.nz?t.relief.at(e,r):n.h[i+a*n.nx]},f=(e,t)=>r.bowls.reduce((n,[r,i,a])=>{let o=Math.hypot(e-r,t-i),s=o/a,c=Z((e-r)/o*5+r,(t-i)/o*5+i,19);return s>1.05&&s<2.4?n+.22*X(5*(c-.55))*X((2.4-s)/.9)*X(6*(s-1.05)):n},0),m=/* @__PURE__ */ new Map,h=(e,t)=>{let n=4096*e+t,r=m.get(n);if(!r){let a=d(e,t),o=[d(e-4,t)-d(e+4,t),d(e,t-4)-d(e,t+4)],s=a===0&&o[0]===0&&o[1]===0,c=n=>s?0:1.4*(P(e,t,131+n)-.5);r=[e,a,t,...i([o[0]+c(0),8,o[1]+c(1)]),e,t,j.STONE,Math.min(Math.max(1+a/60,.78),1.2)+f(e,t)],m.set(n,r)}return r},g=(e,t)=>{let[n,r,i,d]=[l[e],l[e+1],u[t],u[t+1]];if(!(n<r&&i<d))return 0;let f=Math.hypot((Math.min(Math.max(a,n),r)-a)/s,(Math.min(Math.max(o,i),d)-o)/c);return f<1?2:+(f<1.65)};for(let t=0;t<l.length-1;t++)for(let i=0;i<u.length-1;i++){let[a,o,s,c,d]=[l[t],l[t+1],u[i],u[i+1],g(t,i)];if(d>1)for(let t=a;t<o;t+=n.cell)for(let i=s;i<c;i+=n.cell){if(t>=n.hole[0]&&t<n.hole[2]&&i>=n.hole[1]-8&&i<n.hole[3]+8||r.pits.some(e=>t>=e.x-p&&t<e.x+p&&i>=e.z-p&&i<e.z+p))continue;let[a,o,s,c]=[h(t,i),h(t+n.cell,i),h(t+n.cell,i+n.cell),h(t,i+n.cell)];e.push(...a,...s,...o,...a,...c,...s)}else if(d){let n=[];for(let[e,r,l,u,d]of[[a,s,o,s,g(t,i-1)],[o,s,o,c,g(t+1,i)],[o,c,a,c,g(t,i+1)],[a,c,a,s,g(t-1,i)]]){let t=d>1?5:1;for(let i=0;i<t;i++)n.push(h(e+(l-e)*i/t,r+(u-r)*i/t))}let r=h((a+o)/2,(s+c)/2);n.forEach((t,i)=>e.push(...r,...n[(i+1)%n.length],...t))}}})(b,u),yield,((e,n)=>{let{at:a}=n.relief,o=i(M([0,1,0],ht)),s=[o,M(ht,o),ht];for(let[t,n]of r.dishes)Dt(e,t,n,a(t,n),6,[1,.25,.15]),y(e,bt,[t,a(t,n)+5.2,n],s,[0,0,-.9],1);for(let[t,n,i,o]of r.ramps)for(let r of[-8,8])Dt(e,t+r*o,n-r*i,a(t+r*o,n-r*i),2.2,[1,.45,.1]);let[c,l]=r.wreck,u=t,d=i([.8,-.35,.5]),f=i(M([0,1,0],d));y(e,yt,[c-3,u+3.1,l-2],[f,M(d,f),d],[0,0,0],[1.6,1.4,.55],[.6,.6,.62]),E(e,[[c+3,u,l+4],[c+6.5,u+.2,l+5],[c+4,u+2.6,l+5.5]],[.7,.3,.14]),Dt(e,c-3.4,l+2.6,u,3.5,[1,.12,.08])})(b,u)),((e,t)=>{for(let[n,r,a,o,s,c]of Lt){let l=e=>{let l=e*O/480,[u,d]=[Math.cos(l),Math.sin(l)],f=r*Rt(u,d,n,c),p=(e+1)*O/480,m=(r*Rt(Math.cos(p),Math.sin(p),n,c)-f)/(n*O/480);return Array.from({length:a+1},(e,r)=>{let l=r/a,p=n-.3*f*(1-l),h=n/(30+26*(1-l))*(1+.05*l),g=2*Z(u*h+c+1.7*l,d*h-1.3*l,c+9)-1,_=i([-u-d*(-1.5*m-1.6*g*(1-.5*l)),.75,u*(-1.5*m-1.6*g*(1-.5*l))-d]),v=Math.max(me(_,t),0),y=(.8+.3*Z(u*n/90-c,d*n/90+2.3*l,c+11))*(.72+.28*X(.5+.9*g))*(s+(o-s)*Math.min(1.2*v+(r===a?.3:0),1));return[pt[0]+u*p,(f+25)*l-25,pt[2]+d*p,u,0,d,y,y,-2,1.03*y]})},u=l(0);for(let t=1;t<=480;t++){let n=l(t%480);for(let t=0;t<a;t++)e.push(...u[t],...n[t],...n[t+1],...u[t],...n[t+1],...u[t+1]);u=n}}})(b,i(u.sun.dir)),b}var Bt=()=>{let e=[];return(e=>{let t=ht,n=t.map(e=>-e),r=i([n[2],0,-n[0]]),a=M(n,r),o=t.map((e,t)=>pt[t]+800*e),s=t.map((e,t)=>o[t]+100*e),[c,l]=[28,64],u=(e,t)=>o.map((n,i)=>n+60*e*(r[i]*Math.cos(t)+a[i]*Math.sin(t))),d=e.length;for(let t=0;t<c;t++)for(let n=0;n<l;n++){let[r,i]=[n*O/l,(n+1)*O/l],[a,o]=[(t+.5)/c,(n+.5)*O/l],[d,f]=[a*Math.cos(o),a*Math.sin(o)],p=Math.sqrt(1-a*a),[m,h]=[(Math.atan2(d,p)+1.5)/O*12,6*(Math.asin(f)/Math.PI+.5)],g=gt(m,h,11)>.5?pe([.13,.32,.09],[.4,.3,.15],gt(2*m,2*h,13)):[.03,.16,.5],_=Math.abs(f)>.93?1:X(4*(gt(1.5*m+4,3*h,17)-.5));g=pe(g,[.95,.97,1],_).map(e=>e*(.55+.45*Math.max(0,.3*d+.25*f+.9*p))*(.6+.4*p)),E(e,t?[u(t/c,r),u((t+1)/c,r),u((t+1)/c,i),u(t/c,i)]:[u(0,0),u(1/c,r),u(1/c,i)],g,s)}ue(e,d,1.5)})(e),e},{FORWARD:Vt,BACK:Ht,JUMP:Ut,CROUCH:Wt,SPRINT:Gt,USE:Kt}=de,Q=[.78,.8,.84],qt=[.95,.68,.22],Jt=[.06,.06,.07],Yt=[.9,.9,.88],Xt=[.14,.24,.55],Zt=[.75,.42,.2],Qt=[3.2,.35,.15],$t=2*Math.PI,en=(e,t,n,r,i)=>e.push(...t,...n,r[0],r[1],i,r[2]),$=(e,t,n,r,i=-1)=>{let[[a,o],[s,c],[l,u]]=[0,1,2].map(e=>[t[e],n[e]]),d=[[[0,1,0],[[a,c,l],[a,c,u],[o,c,u],[o,c,l]]],[[0,-1,0],[[a,s,l],[o,s,l],[o,s,u],[a,s,u]]],[[1,0,0],[[o,s,l],[o,c,l],[o,c,u],[o,s,u]]],[[-1,0,0],[[a,s,l],[a,s,u],[a,c,u],[a,c,l]]],[[0,0,1],[[a,s,u],[o,s,u],[o,c,u],[a,c,u]]],[[0,0,-1],[[a,s,l],[a,c,l],[o,c,l],[o,s,l]]]];for(let[t,n]of d)for(let a of[0,1,2,0,2,3])en(e,n[a],t,r,i)},tn=(e,t,n,r)=>{let i=T(N(e,r),t);for(let e=8;e<i.length;e+=10)i[e]=n;return i},nn=(e,t,n,r,i,a=-1,o=48)=>y(e,tn(t,i,a,o),n,ae(r,Math.abs(r[1])>.9?[1,0,0]:[0,1,0]),[0,0,0],1),rn=(e,t,r,i,a,o=k)=>n(e,tn([[0,0],[i,0],[i,1],[0,1]],a,o,8),t,r,[0,1,0],1),an=(e,t,n)=>{let r=43758.5453*Math.sin(127.1*e+311.7*t+74.7*n);return 2*(r-Math.floor(r))-1},on=(e,t,n,r,i=-2)=>{for(let a of[0,1,2,0,2,3])en(e,[t[a][0],n,t[a][1]],[0,1,0],r,i)},sn=[.55,.57,.6],cn=[.9,.45,.08],ln=[.95,.75,.1],un=[.4,2.6,1.6],dn=[2.6,1.3,.25],fn=[.08,.35,.8],pn=[2.2,2.3,2.6];function*mn(t,r){let i=yield*zt(t);return yield,i=i.concat((({brushes:t},r)=>{let i=[];for(let e of t)e.ghost&&e.tint&&Oe(i,e,2*Math.max(0,r.indexOf(`${e.tint}`)));let a=[];(t=>{[...ee,...Ie].forEach(e=>((e,[t,r,i,a,o,s,c,l])=>{let d=1&l?2:0,[f,p]=[[r,s,i],[a,c,o]],m=l<2?1:-1,h=(e,t,n)=>{let r=[0,s+t,0];return r[d]=(m>0?f[d]:p[d])+m*n,r[2-d]=f[2-d]+e,r},[g,_,v]=[p[2-d]-f[2-d],p[d]-f[d],c-s],x=(t,n,r)=>{let[i,a]=[h(t[0],t[1],t[2]),h(n[0],n[1],n[2])];A(e,i.map((e,t)=>Math.min(e,a[t])),i.map((e,t)=>Math.max(e,a[t])),r)},S=(t,n,r,i,a,o,s=1)=>w(e,s,()=>E(e,[h(t,n,a),h(r,n,a),h(r,i,a),h(t,i,a)],o,h(t,n,a-1))),C=(e,t,n,r,i,a)=>{x([e,t,i-.06],[n,r,i],H),S(e+.04,t+.04,n-.04,r-.04,i+.005,a,.45);for(let o=0;r-t>.3&&o<4;o++){let s=r-.12-o*((r-t-.16)/4);S(e+.08,s-.025,e+.08+(n-e-.16)*(.4+(7*e+o)%4*.15),s,i+.01,a,1.1)}};ke(e,()=>{if(t==u.BENCH){x([0,v-.06,0],[g,v,_],B),x([.05,0,0],[g-.05,v-.06,_-.06],Ae);for(let e=1.1;e<g-.5;e+=1.1)x([e-.01,.1,_-.06],[e+.01,v-.1,_-.05],H);for(let e=0;e<4;e++){let t=1.4+2.75*e;x([t-.05,v,.16],[t+.05,v+.22,.22],H),C(t-.45,v+.2,t+.45,v+.75,.28,[U,W,G,U][e]),x([t-.3,v,.45],[t+.3,v+.025,.65],V),x([t+.7,v,.2],[t+.82,v+.2,.32],[W,je,G,Pe][e])}}else if(t==u.SAMPLES){x([0,v-.05,0],[g,v,_],V),x([.15,.18,.15],[g-.15,.22,_-.15],H);for(let e of[.1,g-.2])for(let t of[.1,_-.2])x([e,0,t],[e+.1,v-.05,t+.1],H);for(let e=0;e<4;e++){let t=.25+1.2*e;x([t,v,.3],[t+.9,v+.07,1.2],H),S(t+.05,v+.015,t+.85,v+.055,1.205,U,1.2),x([t+.28,v+.07,.55],[t+.62,v+.07+(.16+e%3*.07),.95],[.4+.05*e,.38,.35]);for(let[e,n]of[[0,.3],[.88,.3],[0,1.18],[.88,1.18]])x([t+e,v+.07,n],[t+e+.02,v+.55,n+.02],Ae);x([t,v+.53,.3],[t+.9,v+.55,1.2],[.5,.6,.66])}}else if(t==u.RACKS){x([0,0,0],[g,v,_],H);for(let e=0;e<3;e++){let t=.1+1.63*e;for(let n=0;n<12;n++){let r=.25+.2*n;S(t,r,t+1.43,r+.16,_+.01,V,.25);for(let i=0;i<5;i++){let a=[W,G,W,U,Ne,null][(7*e+5*n+3*i)%6];a&&S(t+.1+.08*i,r+.06,t+.14+.08*i,r+.1,_+.015,a,1.6)}}S(t,v-.4,t+1.43,v-.34,_+.01,U,.9)}}else if(t==u.SCOPE){x([.2,0,.2],[1,.1,1],H),x([.45,.1,.45],[.75,.85,.75],B),S(.52,.55,.68,.65,.755,W,1.4),x([.35,.85,.35],[.85,1.05,.85],V);let[t,r]=[h(.6,.9,.2),h(1.4,2.8,2.1)];n(e,b(2,1,[1,1],[0,0]),t,r,[1,0,0],1,.2,B),n(e,b(2,1,[1,1],[0,0]),h(1.3,2.56,1.86),h(1.42,2.83,2.13),[1,0,0],1,.24,H),n(e,b(2,1,[1,1],[0,0]),h(.86,1.4,.6),h(1.2,2.2,1.4),[1,0,0],1,.05,V)}else if(t==u.ANALYSER){x([0,0,0],[g,.9,_],B),x([0,.9,0],[g,v,.5],B),C(.12,.92,.95,1.26,.56,W),x([1.1,.9,.55],[1.88,1.18,1.1],V),S(1.16,.95,1.82,1.13,1.105,Pe,1.3);for(let e=0;e<6;e++)S(.15+.12*e,.74,.22+.12*e,.8,_+.005,[G,W,U][e%3],1.4);for(let e of[.3,.6])x([.05,e,_],[g-.05,e+.015,_+.005],H)}else if(t==u.PLANTS){for(let e of[0,g/2-.03,g-.06])x([e,0,0],[e+.06,v,_],V);x([0,v-.04,0],[g,v,_],B);for(let t of[.3,.9,1.5]){x([0,t,0],[g,t+.04,_],B),x([.1,t+.04,.12],[g-.1,t+.18,_-.12],Me);for(let e=.25;e<g-.15;e+=.4)x([e-.1,t+.18,.2],[e+.1,t+.18+(.12+(10*e+3*t)%3*.06),_-.2],10*e%2<1?[.18,.5,.16]:[.3,.62,.2]);w(e,1.1,()=>x([.1,t+.53,.3],[g-.1,t+.56,_-.3],Fe))}}else if(t==u.LOCKERS){x([0,0,0],[g,v,_],je);for(let e=0;e<6;e++){let t=.8*e;e&&x([t-.01,.05,_],[t+.01,v-.05,_+.01],H);for(let e=0;e<3;e++)x([t+.2,1.7+.08*e,_],[t+.6,1.73+.08*e,_+.01],H);x([t+.64,.95,_],[t+.68,1.2,_+.04],Ae),S(t+.3,1.5,t+.5,1.56,_+.012,G,.8)}}else if(t==u.SUIT){x([.1,0,.1],[.9,.06,.9],H),x([.47,.06,.06],[.53,1.7,.14],V);for(let e of[.27,.54])x([e-.02,.06,.36],[e+.21,.22,.68],V),x([e,.22,.4],[e+.19,.95,.62],B);x([.22,.95,.32],[.78,1.58,.7],B),x([.25,1,.14],[.75,1.62,.32],Ae);for(let e of[.08,.78])x([e,1,.4],[e+.14,1.54,.6],B),x([e,.88,.4],[e+.14,1,.6],V);S(.34,1.3,.5,1.42,.705,U,1),S(.56,1.34,.64,1.42,.705,Ne,1.2),y(e,b(2,0,[1,1]),h(.5,1.8,.5),le,[0,0,0],.21,B),S(.38,1.74,.62,1.88,.715,G,.7)}else{x([0,0,0],[g,v,.05],V),S(.1,.35,.6*g,v-.1,.055,U,.5);for(let e=0;e<12;e++)S(.66*g+e%3*.2,.4+.25*(e>>2),.66*g+e%3*.2+.1,.5+.25*(e>>2),.055,[W,G,Ne,U][e%4],1.3);S(.1,.1,g-.1,.18,.055,G,.9)}})})(t,e));let[,r]=te[0],i=I+r+.03;z(t,2,i,[F-3,3.4,0],[F+3,4.3,0],Ce);for(let e of[3.42,4.22])z(t,2,i+.01,[F-2.95,e,0],[F+2.95,e+.05,0],xe);for(let e=0;e<9;e++){let n=F-2.6+.6*e;z(t,2,i+.01,[n,3.9,0],[n+.45,4.1,0],[.9,.95,1]),z(t,2,i+.01,[n+.05,3.6,0],[n+.3+e%2*.1,3.7,0],U)}for(let[e,n]of[[F+16.6,.3],[F+17.1,.15]])ke(t,()=>A(t,[e,2.94,I-6.7],[e+n,3.06,I+6.7],H));_.forEach(({min:n,max:r},i)=>{let a=i?2:0,[o,s]=[n[a],i?_[0].min[2]:r[a]],c=n[2-a]+e,l=[0,2,0],u=[0,2.1,0];[l[a],u[a],l[2-a],u[2-a]]=[o,s,c,c+.12],ke(t,()=>A(t,l,u,H));for(let e=o+2.5;e<s-1;e+=5){let[n,r]=[[0,1.3,0],[0,1.5,0]];[n[a],r[a]]=[e-.2,e+.2],z(t,2-a,c+.03,n,r,W)}});for(let e of ve){let n=e.max[0]-e.min[0]<1?0:2,[r]=C.filter(({min:t,max:n})=>t[0]<=e.min[0]&&e.max[0]<=n[0]&&t[2]<=e.min[2]&&e.max[2]<=n[2]),i=(r.min[n]+r.max[n])/2>e.min[n]?1:-1,a=(i>0?e.max[n]:e.min[n])+.02*i,[o,s]=[e.min[2-n],e.max[2-n]];if(_.some(t=>[0,2].every(n=>t.min[n]<=e.max[n]+.01&&e.min[n]-.01<=t.max[n])))continue;for(let e=0;o+.3*e<s;e++){let[r,i]=[[0,ce+.05,0],[0,ce+.35,0]];[r[2-n],i[2-n]]=[o+.3*e,Math.min(o+.3*e+.15,s)],z(t,n,a,r,i,G),[r[2-n],i[2-n]]=[i[2-n],Math.min(o+.3*e+.3,s)],z(t,n,a,r,i,H)}let c=(o+s)/2,[l,u]=[[0,3.2,0],[0,3.45,0]];[l[2-n],u[2-n]]=[c-.15,c+.15],z(t,n,a,l,u,Ne)}})(a);for(let e of a)i.push(e);for(let e=0;e<a.length;e+=30)for(let t of[0,2,1]){let n=e+10*t;i.push(a[n],a[n+1],280-a[n+2],a[n+3],a[n+4],-a[n+5],...a.slice(n+6,n+10))}return i})(t,r)),t.station&&(yield,i=i.concat((({hall:[e],post:t,hull:[n,r,i,a],gun:o})=>{let s=[],{R:c}=f,l=t[0][1],[u,d]=[e[0],e[0]+48],p=[u,d].flatMap(e=>{let t=Math.acos((e-n)/c);return[t,$t-t]}),m=[...Array.from({length:72},(e,t)=>t*$t/72),...p,$t].sort((e,t)=>e-t);for(let e=r;e<a-.01;e+=2){let t=e>=l+30&&e<a-14;for(let r=0;r+1<m.length;r++){let[a,o]=[m[r],m[r+1]],f=(a+o)/2,p=n+c*Math.cos(f);if(p>u&&p<d&&e>=l-2&&e<l+16)continue;let h=t,g=h?.22:.03;for(let[t,a]of[[r,e],[r+1,e],[r+1,e+2],[r,e],[r+1,e+2],[r,e+2]]){let e=m[t],r=t%(m.length-1),[o,l]=[an(r,a,1)*g,an(r,a,2)*g],u=[Math.cos(e)+o*Math.sin(e),l,Math.sin(e)-o*Math.cos(e)];en(s,[n+c*Math.cos(e),a,i+c*Math.sin(e)],u,h?qt:Q,h?ne:k)}}}nn(s,[[c,0],[c-3,3],[.6*c,v.DOME-1],[0,v.DOME]],[n,a,i],[0,1,0],Q,k);let h=[n-16,a+v.MAST,i];rn(s,[h[0],a+4,i],h,.8,Q);let g=Array.from({length:6},(e,t)=>[2.4*t,3.6*(t/5)**2]);nn(s,[...g,...[...g].reverse().map(([e,t])=>[e,t-.3])],h,[-.6,.8,0],Yt,-1,20);let _=v.BARREL*c,y=r-o[1];nn(s,[[c,0],[c-1.5,2],[_+2,2.6],[0,2.6]],[n,r,i],[0,-1,0],Q,k),nn(s,[[0,2.6],[_+2,2.6],[_+2,5],[_,6.5],[_,y-4],[_+3,y-1.5],[_+3,y],[_-2,y],[_-3,y-10],[0,y-10.5]],[n,r,i],[0,-1,0],Jt,k);for(let e=10;e<y-8;e+=7)nn(s,[[0,e],[_+.8,e],[_+.8,e+1.6],[0,e+1.6]],[n,r,i],[0,-1,0],Q,k);nn(s,[[0,y-10.3],[_-3.5,y-10.1],[0,y-9.9]],[n,r,i],[0,-1,0],Qt,-2),$(s,[n-_-8,o[1]-18,i-16],[n-_-7.2,o[1]+8,i+16],Yt,k),rn(s,[n-_-1,o[1]+3,i],[n-_-7.2,o[1]+3,i],.6,Q);let b=r+(a-r)*v.WING,[x,S,C]=[v.PANEL,v.SPAN,v.GAP];for(let e of[-1,1]){let t=n+e*(c+v.BOOM);rn(s,[n+e*c,b,i],[t,b,i],1.4,Q),$(s,[Math.min(t,t+3*e),b-6,i-2],[Math.max(t,t+3*e),b+6,i+2],Q,k),rn(s,[t,b,i],[t+e*(4*(x+C)+2),b,i],.6,Zt);for(let n=0;n<4;n++){let r=t+e*(3+n*(x+C)),[a,o]=[Math.min(r,r+e*x),Math.max(r,r+e*x)];$(s,[a,b-S/2,i-.2],[o,b+S/2,i+.2],Xt,k);for(let e of[b-S/2,b+S/2-.6,b-.3,b-S/4,b+S/4-.3])$(s,[a,e,i-.3],[o,e+.6,i+.3],Q,k);for(let e of[a,a+x/2-.3,o-.6])$(s,[e,b-S/2,i-.3],[e+.6,b+S/2,i+.3],Q,k)}}return s})(t.station),(({hall:[e],post:t,hull:[n,,r]})=>{let i=[],a=t[0][1],[o,s]=[e[0]+4,e[0]+44],[c,l]=[r-f.R,r+f.R];for(let[e,t,n,r]of[[o+.5,2.4,.25,1],[o+.5,3.1,.16,1],[o+.7,8.5,.4,1],[s-.5,4.6,.25,-1],[s-.7,8.5,.4,-1]]){rn(i,[e,a+t,c+5],[e,a+t,l-5],n,sn);for(let o=c+8;o<l-5;o+=8)$(i,[Math.min(e,e-.5*r),a+t-n-.1,o-.15],[Math.max(e,e-.5*r)+.01,a+t+n+.1,o+.15],Jt),o/8%3<1&&rn(i,[e,a+t,o+1.5],[e,a+t,o+1.8],n+.12,cn,-1)}for(let e of[o+.6,s-.6])for(let t of[c+6,l-6])rn(i,[e,a,t],[e,a+14,t],.3,sn);for(let e of[n-10,n+10])rn(i,[e,a+13.2,c+5],[e,a+13.2,l-5],.6,sn);for(let e=c+10;e<l-5;e+=12)$(i,[n-4,a+13.7,e-.6],[n+4,a+13.9,e+.6],pn,-2);for(let e of[-1,1]){let[t,u]=[n+6,r+10*e];for(let e=0;e<32;e++){let[n,r]=[e*$t/32,(e+1)*$t/32],o=(e,n)=>[t+n*Math.cos(e),u+n*Math.sin(e)];on(i,[o(n,7),o(r,7),o(r,6.4),o(n,6.4)],a+.03,ln,-1),e%4==0&&$(i,[t+7.4*Math.cos(n)-.15,a,u+7.4*Math.sin(n)-.15],[t+7.4*Math.cos(n)+.15,a+.12,u+7.4*Math.sin(n)+.15],dn,-2)}let d=e<0?c:l;for(let n=u+10*e;e*(d-n)>4;n+=5*e)for(let r of[-1,1])on(i,[[t+.4*r,n+1.2*e],[t+3.2*r,n-.6*e],[t+3.2*r,n-1.3*e],[t+.4*r,n+.5*e]],a+.04,dn);on(i,[[o,d-.6*e],[s,d-.6*e],[s,d-.2*e],[o,d-.2*e]],a+.04,un);for(let t of[o+.06,s-.06])$(i,[t-.06,a,d-.6*e-.2],[t+.06,a+11,d-.6*e+.2],un,-2);$(i,[o,a+10.94,d-.6*e-.2],[s,a+11,d-.6*e+.2],un,-2)}let[u,d]=[s+4.2,s+13.5];for(let e of[-1,1]){let t=r+8*e;$(i,[u,a,Math.min(t,t-1.1*e)],[d,a+1,Math.max(t,t-1.1*e)],Jt,k);for(let n=u+.4;n<d-1.5;n+=2.3)$(i,[n,a+1.4,Math.min(t,t-.05*e)],[n+1.9,a+2.6,Math.max(t,t-.05*e)],fn,-2)}return $(i,[s+17.94,a+1.2,r-4],[s+18,a+3.4,r+4],fn,-2),i})(t.station))),yield,{land:i,sky:Bt(),heavens:mt}}export{mn as default};
@@ -1,6 +1,10 @@
1
1
  import type { Vec3 } from './mesh';
2
2
  /** The cannon's shots each cell counts, from the elbow's to the wrist's: HUNTER_CELLS in all. */
3
3
  export declare const SHOTS: number[];
4
+ /** A glyph's dash: where its middle is in its cell (to the right, up, 0 to 1) and its angle. */
5
+ export type Dash = [number, number, number];
6
+ /** The four glyphs, each its dashes in the order they are lit, two a shot: the last go out first. */
7
+ export declare const GLYPHS: Dash[][];
4
8
  /** The fire key, in the forearm's frame (the right hand presses it). */
5
9
  export declare const FIRE_KEY: Vec3;
6
10
  /** The computer with `shots` of the cannon's shots left, in the left forearm's frame; made once each. */
@@ -1,5 +1,6 @@
1
1
  import type { FlagState, PlayerState } from '../shared/types';
2
2
  import type { Vec3 } from './mesh';
3
+ import type { RackSet } from './props';
3
4
  import type { Quat } from './rig';
4
5
  import type { Out } from './verts';
5
6
  /** One flag to draw. */
@@ -36,6 +37,8 @@ export interface CtfScene {
36
37
  rails?: readonly (Vec3 | undefined)[];
37
38
  /** The laser rifle racks. */
38
39
  rifles?: readonly (Vec3 | undefined)[];
40
+ /** Which weapons the own class sees on the racks (rackSetOf()): the standard ones when not given. */
41
+ rackSet?: RackSet;
39
42
  packs?: readonly Vec3[];
40
43
  /** The ammo packs that are there to take. */
41
44
  ammo?: readonly Vec3[];
@@ -12,6 +12,13 @@ import type { Pieces } from './store';
12
12
  export declare const REAR: Vec3;
13
13
  export declare const MUZZLE: Vec3;
14
14
  export declare const TILT: number[];
15
+ /**
16
+ * The pistol's back (the user, 2026-11-09: like the rifle's counter, the top of the gun in one
17
+ * piece, cut by a straight leaning face): the face through BACK, facing BACK_N, back and up toward
18
+ * the player. The counter's support, a glossy black rounded trapezoid, sits on it (readout()).
19
+ */
20
+ export declare const BACK: Vec3;
21
+ export declare const BACK_N: Vec3;
15
22
  /**
16
23
  * The gun at a level of detail (0 far, 1 near), built once, in the vertex format of mesh.ts, after
17
24
  * the Halo plasma pistol: a smooth bulbous upper body tapering to a glowing emitter on its nose, a
@@ -44,6 +51,8 @@ export declare const railgun: (lod: number) => number[];
44
51
  * in its last quarter.
45
52
  */
46
53
  export declare const insulators: (lod: number, heat?: number) => number[];
54
+ /** The Hunter's pistol: its own model (pistol.ts), on the gun's marks. */
55
+ export declare const hunterGun: (lod: number) => number[];
47
56
  /** The weapon a gun model is, from a player or a flag: 0 the gun, 2 the rail gun (or true), 3 the laser rifle. */
48
57
  export declare const kindOf: (p: Pick<PlayerState, "railed" | "rifled"> | boolean | number) => number;
49
58
  export declare const LONG_TILT: number[];
@@ -118,8 +127,11 @@ export declare const GUN_ON: {
118
127
  */
119
128
  export declare const PRESS = 0.45;
120
129
  export declare const pressAt: (kind: number) => number;
121
- /** The selected weapon slot, or -1 when bare-handed or down. */
122
- export declare const handOf: (p: Pick<PlayerState, "down" | "fists" | "wield" | "rifled" | "railed" | "ammo">) => number;
130
+ /**
131
+ * The selected weapon slot, or -1 when bare-handed or down: 0 the gun, which is also the Hunter's
132
+ * pistol (`sided`) beside his harpoon.
133
+ */
134
+ export declare const handOf: (p: Pick<PlayerState, "down" | "fists" | "wield" | "rifled" | "railed" | "ammo" | "sided">) => number;
123
135
  /**
124
136
  * A tracker of the weapons each player has had in hand since taking them: true when the weapon in
125
137
  * `p`'s hand comes to it for the first time, the only time it is switched on (the user,
@@ -209,7 +221,7 @@ export declare const TRACKS: number[][][];
209
221
  * strength the shot would have; all orange at the full charge. Not `shown`: the block and the dark
210
222
  * screen only, the gun still booting.
211
223
  */
212
- export declare const readout: (ammo: number, level?: number, shown?: boolean) => number[];
224
+ export declare const readout: (ammo: number, level?: number, shown?: boolean, glyphs?: boolean) => number[];
213
225
  /**
214
226
  * The rail gun's counter, a small LCD out of the left of its receiver turned to the player, in model space
215
227
  * (the user, 2026-11-08: like the screen on the back of a digital camera), in a dark case: neon like
@@ -234,6 +246,8 @@ export declare const scope: (n: number, shown?: boolean, nades?: number) => numb
234
246
  export interface Lit {
235
247
  /** The frame's pieces of the store: the gun's body, lit, goes there (store.ts). */
236
248
  list?: Pieces;
249
+ /** The gun in the Hunter's bronze (hunterGun()): his pistol. */
250
+ skin?: boolean;
237
251
  light?: number;
238
252
  swap?: number;
239
253
  empty?: boolean;
@@ -266,7 +280,7 @@ export declare const cellsOf: (p: Pick<PlayerState, "rail" | "cap">) => number[]
266
280
  * given, and the charge gauge at `level`; its battery (capsule) where the swap has it, its glow and
267
281
  * its counter dimmed with `light`, and the spark only when it is all on.
268
282
  */
269
- export declare const held: (out: Out, pos: Vec3, q: Quat, lod: number, k?: number, ammo?: number, level?: number, kind?: boolean | number, t?: number, { light, swap, empty, screen, digits, cells, heat, hot, press, tune, nades, id, floor, vel, carry, list, }?: Lit) => void;
283
+ export declare const held: (out: Out, pos: Vec3, q: Quat, lod: number, k?: number, ammo?: number, level?: number, kind?: boolean | number, t?: number, { light, swap, empty, screen, digits, cells, heat, hot, press, tune, nades, id, floor, vel, carry, list, skin, }?: Lit) => void;
270
284
  /** The muzzle of a gun (the rail gun's or the rifle's by `kind`) whose grip is at `at` and whose axes are [right, up, forward]. */
271
285
  export declare const tip: (at: Vec3, [, u, f]: Vec3[], kind?: boolean | number) => Vec3;
272
286
  /**
@@ -107,7 +107,9 @@ export interface Hud {
107
107
  * `nades` left in its launcher as dots after the count, hollow for the ones spent. `armor` shows
108
108
  * as gold pips after the health's, only the ones he has.
109
109
  */
110
- vitals(hp: number, ammo: number, blade?: boolean, wield?: boolean, rail?: number, railed?: boolean, loaded?: number, swapping?: boolean, rifle?: number, rifled?: boolean, nades?: number, armor?: number, fists?: boolean): void;
110
+ vitals(hp: number, ammo: number, blade?: boolean, wield?: boolean, rail?: number, railed?: boolean, loaded?: number, swapping?: boolean, rifle?: number, rifled?: boolean, nades?: number, armor?: number, fists?: boolean,
111
+ /** The Hunter's pistol is in hand: `ammo` and `loaded` are its own. */
112
+ sided?: boolean): void;
111
113
  /** The health the own player's class has at most (Kit.hp): as many pips. */
112
114
  life(max: number): void;
113
115
  /** A hit marker on the crosshair for a moment: a ball or a cut of the own player hit. */
@@ -11,18 +11,22 @@ export declare const keyBit: (code: string) => number;
11
11
  export declare const DOUBLE_CLICK_MS = 300;
12
12
  /** The wheel swaps the weapon at most this often (ms): a trackpad's flick is a hundred events, one swap. */
13
13
  export declare const WHEEL_MS = 250;
14
- /** The weapon chosen. The values are the wire's and the HUD's, not the keys' order: SLOTS has that. */
14
+ /**
15
+ * The weapon chosen. The values are the wire's and the HUD's, not the keys' order: SLOTS has that.
16
+ * SIDE is the Hunter's pistol, which KEY.FISTS asks for on the wire (he has no fists).
17
+ */
15
18
  export declare const WEAPON: {
16
19
  readonly GUN: 0;
17
20
  readonly BLADE: 1;
18
21
  readonly RAIL: 2;
19
22
  readonly RIFLE: 3;
20
23
  readonly FISTS: 4;
24
+ readonly SIDE: 5;
21
25
  };
22
26
  /**
23
27
  * The weapon on each key, 1 to 5. The marine, the ninja and the astronaut: fists, katana, pistol,
24
- * assault (laser) rifle, Tesla (rail) gun (the user, 2026-11-24). The Hunter: wrist blades,
25
- * harpoon, shoulder cannon, disc, and no fifth slot (the user, 2026-11-23).
28
+ * assault (laser) rifle, Tesla (rail) gun (the user, 2026-11-24). The Hunter: wrist blades, his
29
+ * pistol, harpoon, shoulder cannon, disc (the user, 2026-11-26: the pistol on 2, the rest one key on).
26
30
  */
27
31
  export declare const SLOTS: readonly number[];
28
32
  /** The weapon in a slot (the key's number less one). */
@@ -31,13 +35,20 @@ export declare const slotted: (slot: number, hunter?: boolean) => number;
31
35
  export declare const slotOf: (weapon: number, hunter?: boolean) => number;
32
36
  /** The choice after a key: the weapon in its slot (SLOTS), the numpad's keys as the digits'; any other key keeps it. */
33
37
  export declare const picked: (weapon: number, code: string, hunter?: boolean) => number;
34
- /** Which of the gun, the katana, the rail gun, the laser rifle and the fists a player has (the Hunter no fists); all of them when there is no state yet. */
38
+ /**
39
+ * Which weapons a player has, by WEAPON: the gun (the Hunter's harpoon), the katana, the rail gun,
40
+ * the laser rifle, the fists (never the Hunter's) and the Hunter's pistol (his alone); all he can
41
+ * have when there is no state yet.
42
+ */
35
43
  export declare const owned: (p?: PlayerState, hunter?: boolean) => boolean[];
36
44
  /**
37
45
  * Follow the spawn's weapon and switch to newly picked-up special weapons unless fists are selected.
38
46
  */
39
47
  export declare const chosen: (weapon: number, was?: PlayerState, now?: PlayerState, hunter?: boolean) => number;
40
- /** The keys of a step with KEY.BLADE set while the katana is the choice, KEY.RAIL while the rail gun is, KEY.RIFLE while the rifle is. */
48
+ /**
49
+ * The keys of a step with KEY.BLADE set while the katana is the choice, KEY.RAIL while the rail gun
50
+ * is, KEY.RIFLE while the rifle is, KEY.FISTS while the fists or the Hunter's pistol are.
51
+ */
41
52
  export declare const withWeapon: (keys: number, weapon: number) => number;
42
53
  /** The choice the wheel turns to, `dir` 1 or -1: the next weapon he has in slot order, including fists. */
43
54
  export declare const turned: (weapon: number, dir: number, have: boolean[], hunter?: boolean) => number;
@@ -0,0 +1,8 @@
1
+ /** Half the screen's window across and up the back face, and its middle up the face from BACK. */
2
+ export declare const WINDOW: number[];
3
+ /**
4
+ * The pistol at `lod` (0 far, 1 near and in hand), made once each: smooth shells (the user,
5
+ * 2026-11-26: no polygons showing), each vertex lit by the mean of the faces round it, the corners
6
+ * of every section rounded in two facets far and three near (half that on a corner under 8 mm).
7
+ */
8
+ export declare const hunterPistol: (lod: number) => number[];
@@ -6,16 +6,35 @@ import type { Pieces } from './store';
6
6
  * count from `from`: the ammo packs come after the health packs.
7
7
  */
8
8
  export declare const packsOf: (all?: readonly Vec3[], mask?: number, from?: number) => Vec3[];
9
+ /**
10
+ * Which weapons a player's racks show: the standard ones (marine, astronaut, ninja), the Hunter's
11
+ * own (his pistol, harpoon, shoulder cannon and disc on the gun, katana, rail gun and rifle points),
12
+ * or none for a class that takes nothing from them (the xenomorph).
13
+ */
14
+ export type RackSet = 'gear' | 'hunter' | 'none';
15
+ /** The rack set of a class: by its kit's `hunter` and `gear`. */
16
+ export declare const rackSetOf: (kit: {
17
+ gear: boolean;
18
+ hunter?: boolean;
19
+ }) => RackSet;
20
+ /** A rack's rotating rigid weapon, made once in model space. */
21
+ export declare const rackWeapon: (kind: number, set?: RackSet) => import("./store").Mesh;
9
22
  /**
10
23
  * A rack at `at` (a point on a top): a post and a dish, a ring on the roof of the radius that gives
11
24
  * the weapon, and the weapon over it: the gun, or by `kind` the katana (1), crackling, the rail
12
- * gun (2) or the laser rifle (3).
25
+ * gun (2) or the laser rifle (3); the Hunter's own weapon on those points when `set` is 'hunter'.
13
26
  */
14
- /** A rack's rotating rigid weapon, made once in model space. */
15
- export declare const rackWeapon: (kind: number) => import("./store").Mesh;
16
- export declare const rack: (out: Out, at: Vec3, rgb: number[], t: number, kind?: number, pieces?: Pieces) => void;
17
- /** Each team's gun rack, katana rack, rail gun rack and laser rifle rack, where it has them. */
18
- export declare const racks: (out: Out, guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[], rifles?: readonly (Vec3 | undefined)[], pieces?: Pieces) => void;
27
+ export declare const rack: (out: Out, at: Vec3, rgb: number[], t: number, kind?: number, pieces?: Pieces, set?: RackSet) => void;
28
+ /**
29
+ * The stand's colour: every rack serves both teams, so it is a neutral yellow rather than a team's
30
+ * red or blue.
31
+ */
32
+ export declare const RACK_RGB: number[];
33
+ /**
34
+ * Each team's gun rack, katana rack, rail gun rack and laser rifle rack, where it has them, as the
35
+ * own class sees them (`set`): none at all for a class that takes nothing from them.
36
+ */
37
+ export declare const racks: (out: Out, guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[], rifles?: readonly (Vec3 | undefined)[], pieces?: Pieces, set?: RackSet) => false | void;
19
38
  /** A health pack at `at`: a white box with a glowing green cross on each side. */
20
39
  export declare const kit: (out: Out, at: Vec3, t: number) => void;
21
40
  /** An ammo pack at `at`: a violet box with a glowing cyan cartridge on each side, the gun's colours. */
@@ -13,8 +13,11 @@ export interface Draw {
13
13
  t: Vec3;
14
14
  k: number;
15
15
  f?: Flesh;
16
- /** Worn: armour, which the shader scuffs (grime, chipped paint, scratches) on its glossy and gold parts. */
17
- w?: boolean;
16
+ /**
17
+ * Worn: armour, which the shader scuffs (grime, chipped paint, scratches) on its glossy and gold
18
+ * parts. 3 is heavy wear (the Hunter's pistol): the scuffs 1.8 times as dense.
19
+ */
20
+ w?: boolean | 3;
18
21
  /** Thin: too fine for a shadow, left out of the depth passes (the xenomorph's teeth and hoses). */
19
22
  s?: boolean;
20
23
  /** Close hair (hair.ts), coloured `rgb`, swung by `sw` in the head's frame at the time `t`: the shader sways it (swayOf()). */
@@ -38,6 +38,9 @@ export declare const STILL: {
38
38
  blade: boolean;
39
39
  wield: boolean;
40
40
  fists: boolean;
41
+ side: number;
42
+ sideMag: number;
43
+ sided: boolean;
41
44
  swing: number;
42
45
  cut: number;
43
46
  zap: boolean;
@@ -84,7 +84,7 @@ export declare const MSG_INPUT = 1;
84
84
  export declare const MSG_SNAPSHOT = 2;
85
85
  export declare const INPUT_BYTES = 12;
86
86
  export declare const SNAP_HEAD = 5;
87
- export declare const SNAP_PLAYER = 62;
87
+ export declare const SNAP_PLAYER = 64;
88
88
  /** Bytes of a rover: thirteen float32, the two seats, then the kind and health, the wreck's time and a ship's missiles. */
89
89
  export declare const SNAP_ROVER = 57;
90
90
  /** The most rovers and ships a snapshot carries (Tranquility has eight: four rovers, four ships). */
@@ -276,6 +276,16 @@ export interface PlayerState {
276
276
  wield?: boolean;
277
277
  /** Bare hands selected explicitly; carried weapons remain available. */
278
278
  fists?: boolean;
279
+ /**
280
+ * The Hunter's pistol (the user, 2026-11-26: the gun with his own skin, on his key 2, apart from
281
+ * his harpoon, which keeps `ammo` and `mag`): its shots left, absent or -1 until he finds it on a
282
+ * gun rack and again once he goes down. Absent reads -1.
283
+ */
284
+ side?: number;
285
+ /** Shots in the Hunter's pistol's battery, of `side` (GUN_MAG at most). Absent reads 0. */
286
+ sideMag?: number;
287
+ /** The Hunter's pistol is in hand (KEY.FISTS picks it: he has no fists). Absent reads false. */
288
+ sided?: boolean;
279
289
  /** Ticks left in the katana's swing, CUTS[cut].ticks at its start, 0 when ready. Absent reads 0. */
280
290
  swing?: number;
281
291
  /** CUT of the running or last swing. Absent reads 0. */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "1.4.5",
5
+ "version": "1.5.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"