@korial29/tiny-fps 1.10.1 → 1.11.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.
Files changed (41) hide show
  1. package/dist/assets/{room-BPH05sFp.js → room-CmFLG8k9.js} +2 -2
  2. package/dist/brick-D8hJf8WJ.js +1 -0
  3. package/dist/index.js +8 -8
  4. package/dist/landfall-BYpMbytZ.js +21 -0
  5. package/dist/local.js +1 -1
  6. package/dist/paint-MnJfhuX-.js +4 -0
  7. package/dist/room.js +1 -1
  8. package/dist/server.js +1 -1
  9. package/dist/stone-BuPL-95D.js +1 -0
  10. package/dist/{textures-Big8KwfG.js → textures--_oN1PjN.js} +1 -1
  11. package/dist/tranquility-CT6deZ6t.js +1 -0
  12. package/dist/types/client/combat/constants.d.ts +24 -0
  13. package/dist/types/client/combat/create.d.ts +21 -0
  14. package/dist/types/client/combat/events.d.ts +41 -0
  15. package/dist/types/client/combat/types.d.ts +23 -0
  16. package/dist/types/client/combat.d.ts +3 -76
  17. package/dist/types/client/gun/ammo.d.ts +1 -1
  18. package/dist/types/client/hud/create.d.ts +7 -0
  19. package/dist/types/client/hud/css.d.ts +2 -0
  20. package/dist/types/client/hud/format.d.ts +26 -0
  21. package/dist/types/client/hud/markup.d.ts +2 -0
  22. package/dist/types/client/hud/text.d.ts +29 -0
  23. package/dist/types/client/hud/types.d.ts +148 -0
  24. package/dist/types/client/hud.d.ts +5 -203
  25. package/dist/types/client/hulk/common.d.ts +1 -1
  26. package/dist/types/client/hulk/types.d.ts +2 -0
  27. package/dist/types/client/index.d.ts +2 -51
  28. package/dist/types/client/paint.d.ts +16 -0
  29. package/dist/types/client/play/constants.d.ts +11 -0
  30. package/dist/types/client/play/entry.d.ts +13 -0
  31. package/dist/types/client/play/match.d.ts +8 -0
  32. package/dist/types/client/play/types.d.ts +39 -0
  33. package/dist/types/client/render/shader.d.ts +4 -0
  34. package/dist/types/client/render/shots.d.ts +1 -1
  35. package/dist/types/shared/beach.d.ts +2 -0
  36. package/package.json +1 -1
  37. package/dist/brick-KajeVVVE.js +0 -1
  38. package/dist/landfall-CSZGx2iA.js +0 -21
  39. package/dist/paint-DipbUTzI.js +0 -4
  40. package/dist/stone-DgvIDb2G.js +0 -1
  41. package/dist/tranquility-BGx_-pTQ.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{B as e,J as t,Jt as n,K as r,W as i,Xt as a,Yt as o,Z as s,Zt as c,lr as l,tr as u,zt as d}from"./brick-D8hJf8WJ.js";var f=125,[p,m]=u,{METAL:h,STEEL:g,PAINT:_,WOOD:v,STONE:y,GRATE:b}=l,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,-4,-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],N=1.25,ee=[[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]],te=(e,t,n)=>{let r=t=>o(e,t,151),i=2*r(1)-1,[s,c]=[(1-i*i)/(1+i*i),2*i/(1+i*i)],l=n-d(n),[u,f]=[t*(.85+.3*r(2)),t*(.6+.3*r(3))],p=d(n)+.7*n,m=[4,8].map(e=>{let[t,n,i]=[2*r(e)-1,.35*r(e+1),2*r(e+2)-1],a=Math.sqrt(t*t+n*n+i*i);return[t/a,n/a,i/a,.7+.2*r(e+3)]}),h=e=>{let t=(e[0]*s+e[2]*c)/u,n=(e[2]*s-e[0]*c)/f,r=e[1]/l,[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*a(1.3*t[0]+e,1.3*t[2]+1.1*t[1],e+3))};return{reach:g}},ne=Array.from({length:28},(e,t)=>[S.trees+3*o(t,1,7),134+4*t+2*o(t,2,7),.22+.1*o(t,3,7)]),P=e=>Math.min(Math.max(e,0),1),F=e=>P(e)*P(e)*(3-2*P(e)),re=(e,t)=>Math.sqrt(e*e+t*t),ie=[[57,132,61,138,k.floor-.95],[56,171,66,175,1.3],[44,209,76,229,N]],ae=[1.5,1.2],oe=(e,t)=>{let n=Math.abs(t-f),{shore:r,trees:i}=S,o=e>r?2.5*(e-r)/(i-r):(e-r)/10;o+=.9*F((e-46)/24)*(a(e/13,n/13,5)-.45)*F((n-14)/10),o+=F((e-r)/14)*(1-F((e-102)/8))*(ae[1]*P(1-Math.abs(n-12)/5)-ae[0]*(1-F((n-2)/7))),o+=1.8*P(1-re(e-110,n)/9);for(let[t,r,i,a,s]of ie){let c=re(Math.max(t-e,e-i,0),Math.max(r-f-n,f+n-a,0));o=s+(o-s)*F((c-6)/6)}return o},I=(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(oe(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},L=(e,t,n,r,i,a,o,s)=>({min:[e,t,n],max:[r,i,a],top:o,side:o,...s?{tint:s}:{}}),R=e=>({...e,ghost:!0}),se=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}:{}}),ce=([e,t,n])=>[e,t,250-n],z=(e,...t)=>[...e,...e.map(ce),...t],B=[],V=[],H=(e,t,n)=>(e.push({kind:t,min:n.min,max:n.max}),R(n)),U=(e,t,n,r)=>{let i=[0,.25,.5,.75,1].flatMap(i=>[0,.25,.5,.75,1].map(a=>I(e+(n-e)*i,t+(r-t)*a)));return[Math.max(...i),Math.min(...i)]},W=(e,t,n,r,i,a,o,s)=>{let[c,l]=U(t,n,r,i);return H(B,e,L(t,l-.5,n,r,Math.round(32*(c+a))/32,i,o,s))},G=e=>[(e.min[0]+e.max[0])/2,e.max[1],(e.min[2]+e.max[2])/2],K=(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(H(V,e,L(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},le=w.axis.map(e=>e+w.r),ue=w.sections.slice(1).map(([e],t)=>{let n=w.sections[t][1],[r,i]=U(n,123.5,e,126.5),a=Math.round(32*(Math.max(r,S.water)+1.875))/32;return{x:(n+e)/2,top:a,heap:L(n,i-.5,123.5,e,a,126.5,g,x)}}),de=w.sections.flatMap(([e,t],n)=>[n&&[e,e+1],n<2&&[t-1,t]].filter(e=>e).map(e=>{let[t,r]=e,i=w.axis[n],a=Math.round(16*T(O[n].floor))/16-w.skin;return L(t,i+O[n].floor,f-a,r,i+E[1],f+a,h)})),fe=[36,74].flatMap(e=>{let[t,n]=U(e,128,e+1.2,130.5),r=L(e,n-.5,128,e+1.2,Math.round(32*(t+1.4))/32,130.5,g);return[r,se(r)]}),pe=L(.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[...K(`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?K(`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):K(`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])=>K(`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 H(V,`crate`,L(e,r,124.25,e+1.5,r+[1,1.4,2][n+1],125.75,v))})]}),...ue.map(e=>H(V,`heap`,e.heap)),...fe.map(e=>H(V,`frame`,e)),...de.map(e=>H(V,`jam`,e)),H(V,`raft`,pe),R(L(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 W(`fallen`,o,s-i-.2,o+2.5,s+i+.2,3.5,h,t?void 0:x)}),ve=[...[G(_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 H(B,`engine`,L(e-n,-5,t-r/2,e+n,1.4,t+r/2,h,x))})(),q=[H(B,`float`,L(16,-1.6,141,22,.35,144,h)),H(B,`float`,L(10,-.2,138,13,.5,141,h)),H(B,`float`,L(23,-1.6,132.6,26,.2,135,h))],xe=H(B,`pod`,L(M[0]-3,.75,M[1]-3,M[0]+3,4.25,M[1]+3,h)),Se=H(B,`dais`,L(M[0]-2,.75,M[1]-10,M[0]+2,1.3,M[1]-6,_,p)),J=(e,t,n=.4,r)=>W(`crate`,e-1.5,t-1.5,e+1.5,t+1.5,n,v,r),Ce=(e,t)=>[L(e-2.6,4.85,t-2.1,e+2.6,5,t+2.1,_,p),...[-1,1].flatMap(n=>[-1,1].map(r=>L(e+2.5*n-.1,.75,t+2*r-.1,e+2.5*n+.1,4.85,t+2*r+.1,g)))].map(e=>H(B,`shelter`,e)),[we,Te]=[J(49,221),J(71,221)],[Ee,De]=[J(84,185,.4,p),J(33,153,.4,p)],Oe=W(`panel`,67,184.5,70.5,188,.65,h),ke=W(`container`,68.5,176,71.1,182,1.875,h,x),Ae=W(`gear`,68.6,170.6,71,173,2.9,g,[.95,.75,.1]),je=W(`container`,64,164.5,67.5,168,2.6,h,x),Me=W(`gear`,67.6,169.6,72,170.6,1.2,g),Y={camp:[J(76,213),J(40,217)],west:[W(`panel`,44.5,191.5,47.5,194.5,.5,h),W(`container`,33,173.7,39,176.3,2.2,h,x),W(`panel`,41,163.5,44,166.5,.4,h),W(`panel`,25.5,159.5,28.5,162.5,.5,h),W(`panel`,50.5,139.5,53.5,142.5,.4,h),W(`container`,49.5,132.4,52.5,135,2.6,h,x)],east:[W(`panel`,62.5,145.5,65.5,148.5,.4,h),J(80,171),J(85.5,165),J(84,153),W(`panel`,84.5,135.5,87.5,138.5,.4,h)],cover:[W(`panel`,78,156.6,83,157,2.6,h),W(`panel`,30,166.6,35,167,2.2,h),W(`container`,76,190,82,192.6,2.6,h,x)]},Ne=(e,t,n,r,i,a)=>{let{reach:o}=te(i,n,r),s=U(e-.8*n,t-.8*n,e+.8*n,t+.8*n),c=I(e,t)+d(r),l=c+o([0,1,0])-.1,u=(e,t,n)=>{let r=Math.sqrt(e*e+t*t+n*n)||1;return r<=o([e/r,t/r,n/r])},f=(e,t)=>{if(!u(e,t,0))return;let r=r=>{let[i,a]=[0,1.6*n];for(let n=0;n<9;n++){let n=(i+a)/2;u(e,t,r*n)?i=n:a=n}return r*i};return[r(-1),r(1)]},p=[],[m,h]=[n<5?1:n<8?2:3,r<5?1:r<12?2:3];for(let r=s[1]-.5;r<l-.3;r+=h){let i=Math.min(r+h,l);for(let o=-1.5*n;o<1.5*n;o+=m){let n=[.1,.5,.9].flatMap(e=>[Math.max(r,s[1])+.05,i].map(t=>f(o+m*e,t-c)));if(n.every(e=>e)){let s=t+Math.max(...n.map(e=>e[0])),c=Math.min(t+Math.min(...n.map(e=>e[1])),a);c-s>.4&&p.push([e+o,r,s,e+o+m,i,c])}}}return p},X=ee.map(([e,t,n,r,i])=>({at:[e,I(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);return H(B,`wingpiece`,L(f,_-he(u),m,p,_,g,h))}),...u?A.rails.map(t=>{let n=Math.min(u[4],r);return H(B,`rail`,L(t-.225,n-.45,s(u[1],u[2]),t+.225,n,s(e),g))}):[]]}),..._e,be,...q,xe,Se,we,Te,...Ce(49,221),...Ce(71,221),Ee,De,Oe,ke,Ae,Me,je,...Object.values(Y).flat(),...ne.map(([e,t,n])=>{let r=I(e,t);return R(L(e-n,r-1,t-n,e+n,r+9,t+n,v))}),...X.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>R(L(e,t,n,r,i,a,y))),R(L(-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:[...V,...B,...B.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:[...X,...X.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,N,226,0],[e+4,N,229,0]]),Le=e=>{let t=t=>e?t:ce(t);return{base:t(G(Se)),spawns:e?Ie:Ie.map(([e,t,n])=>[e,t,250-n,Math.PI]),rack:t(G(we)),blade:t(G(Te)),rifle:t(G(Ee)),rail:t(G(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(se),...me],teams:[Le(!0),Le(!1)],packs:z([G(Y.camp[0]),G(Y.west[2]),G(Y.west[4]),G(q[0]),G(Y.east[3])],...ue.map(({x:e,top:t})=>[e,t,f])),ammo:z([G(Oe),G(ke),G(Ae),G(Y.west[0]),G(Y.west[1]),G(Y.west[3]),G(Y.east[0]),G(Y.east[1]),G(Y.east[4])],[51,k.floor,f],[67,k.floor,f]),cells:z([G(Y.camp[1]),G(je),G(q[1]),G(Y.east[2]),Re],[59,k.floor,f]),vests:z([G(be)],[63,le[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:oe},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,Z=[16,48,120,280,600,1100],[Ve,He]=[.08,-40],[Ue,We]=[[.64,.59,.48],[.3,.25,.15]],Ge=[.1,.2,.12],Q=(e,t,n)=>Math.min(Math.max(e,t),n),Ke=i(t([[0,-1],[1,0],[0,1]],4),[1,1,1]),[qe,Je]=[72,17],Ye=/* @__PURE__ */ new WeakMap,Xe=t=>{let i=Ye.get(t);if(i)return i;let l=t.relief&&c(t.relief),[u,d,f,p,m]=l?[l.x0,l.z0,l.cell,l.nx,l.nz]:[S.sea,0,10,(S.east-S.sea)/10+1,26],h=Z.length,g=(e,t)=>[...Z.map(t=>e-t).reverse(),...Array.from({length:t},(t,n)=>e+n*f),...Z.map(n=>e+(t-1)*f+n)],[_,v]=[g(u,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=l?l.h[n+r*p]:S.water+.1*(u+n*f-S.shore);x[t+e*y]=Math.max(i-Ve*Math.max(u-_[t],0),He)}let C=(e,t)=>x[Q(e,0,y-1)+Q(t,0,b-1)*y],T=[],E=[];for(let e=0;e<b;e++)for(let t=0;t<y;t++){let[n,r,i]=[_[t],v[e],C(t,e)],[o,c]=[Math.max(t-1,0),Math.min(t+1,y-1)],[u,d]=[Math.max(e-1,0),Math.min(e+1,b-1)],f=l?s([(C(o,e)-C(c,e))/(_[c]-_[o]),1,(C(t,u)-C(t,d))/(v[d]-v[u])]):[0,1,0],p=.92+.16*a(n/11,r/11,5),m=Q((n-S.trees-2)/14,0,1),h=Ue.map((e,t)=>(e+(We[t]-e)*m)*p);T.push([n,l?i:S.water-.02,r,...f,h[0],h[1],-1.09,h[2]]),E.push([n,S.water+.05,r,0,1,0,S.water+.05-i,0,-5,0])}let D=[[],[]],O=l?.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,r,i]=[28,S.sea-840,125,560],o=e=>{let n=e/t;return 70*(4*n*(1-n))**.7*(.45+.75*a(5*n,3,9))},s=(e,a)=>[n-60*a,a?o(e):S.water-1,r+(e/t-.5)*i,.6,.8,0,Ge[0],Ge[1],-1,Ge[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]),l){let t={relief:l};((t,n)=>{let[i,a]=[S.shore+4,w.sections[2][1]];for(let s=0;s<qe;s++){let c=e=>o(s,e,31),[l,u]=[i+(a-i)*c(1),3+(Je-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)];r(t,Ke,[l,n(l,d)+.2*f,d],e(7*c(5),0),[0,0,0],[f*(.6+c(6)),.7*f,f],[p,p,p])}})(D[0],(e,r)=>n(t,e,r))}return Ye.set(t,D),D},Ze=e=>Xe(e)[0],Qe=e=>Xe(e)[1],$e=`0.05+0.05*sin(T*.55+q.y*.13+4.*vn(q*.05))`,et=`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
+ f=smoothstep(1.05,1.4,f)*smoothstep(0.,.05,d.y)*(1.-smoothstep(.12,.4,d.y));
3
+ s=mix(s,vec3(1.22,1.2,1.17)*(.8+.3*max(dot(d,O),0.)),f*.9);}`,tt=e=>`{vec2 q=P.xz;float d=C.x-(${$e});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],nt=`{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-(${$e});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);}}}`,rt=`c+=bw*k*(.02+.3*fr);`,it=-1.05,at=`{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
+ 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.;}}`,ot=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;}`,st=`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.));`,ct=-1.098,lt=`{bool rf=abs(n.y)>.5;vec2 q=rf?P.xz:vec2(P.x+P.z,P.y);float f=1.-smoothstep(.002,.008,pw),w=sin(q.x*785.)*sin(q.y*785.),te;\nif(rf)te=vn(q*.45+3.)+.35*vn(q*.9+17.)-.08*vn(q*6.)-.04*vn(q*19.)-.88;\nelse{float d=${5 .toFixed(3)}-P.y,l=.25+.5*vn(vec2(q.x*2.2,1.))+.12*vn(vec2(q.x*9.,2.))+.05*vn(vec2(q.x*31.,3.));te=max(d-l,(vn(vec2(q.x*7.,d*1.2))-.72)*smoothstep(l-.6,l,d))*2.;}\nif(te>0.)discard;\nh+=f*.004*w+.02*(vn(q*2.5)-.5);c*=(1.+.18*f*w)*(.78+.34*vn(q*1.3+4.))*mix(1.,.62,smoothstep(.5,.8,vn(q*.7+11.)))*mix(.45,1.,smoothstep(0.,.06,-te));}`;export{O as C,ge as D,te as E,T as O,ee as S,A as T,ve as _,ct as a,Fe as b,Be as c,rt as d,Qe as f,j as g,D as h,at as i,he as k,et as l,ze as m,st as n,lt as o,Ze as p,it as r,nt as s,ot as t,tt as u,S as v,ne as w,E as x,w as y};
package/dist/room.js CHANGED
@@ -1 +1 @@
1
- export { n as MAPS, r as RULES, t as Room } from "./assets/room-BPH05sFp.js";
1
+ export { n as MAPS, r as RULES, t as Room } from "./assets/room-CmFLG8k9.js";
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Room } from "./assets/room-BPH05sFp.js";
1
+ import { t as Room } from "./assets/room-CmFLG8k9.js";
2
2
  import { WebSocketServer } from "ws";
3
3
  // src/server/index.ts
4
4
  /** `/demo` → "demo", `/` → "default". Undecodable paths are kept as is. */
@@ -0,0 +1 @@
1
+ import{X as e,Z as t,lr as n,r}from"./brick-D8hJf8WJ.js";var i=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),a=[1,2,3,4,6].map(e=>{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(e=>t(e));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)=>t(n.map((t,n)=>t+((r[n]-t)*a+(i[n]-t)*o)/e)),o=[];for(let t=0;t<e;t++)for(let n=0;t+n<e;n++)o.push([a(t,n),a(t+1,n),a(t,n+1)]),t+n<e-1&&o.push([a(t+1,n),a(t+1,n+1),a(t,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 t of h){let n=r(e(t[1].p,t[0].p),e(t[2].p,t[0].p));t.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(e(a[1].p,a[0].p),e(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:e,n:r}of a){let a=Math.hypot(...r)>1e-12?t(r):[0,1,0];o.push(...e,...a,...c?[e[0],e[2]]:p?[e[2]+3*d,e[1]]:[e[0]+3*d,e[1]],n.ROCK,.85*f*(.55+.45*i((e[1]-l)/(.3*(u-l)))))}}};export{o as t};
@@ -1 +1 @@
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
+ import{lr as e}from"./brick-D8hJf8WJ.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};
@@ -0,0 +1 @@
1
+ import{$ as e,$t as t,At as n,Bt as r,Ft as i,G as a,Ht as o,It as s,J as c,Jt as l,K as u,Lt as d,Mt as f,N as p,Pt as m,Qt as h,Rt as g,U as _,Vt as v,W as y,X as b,Y as x,Z as S,Zt as C,a as w,an as ee,cn as T,d as te,en as ne,i as E,in as re,jt as D,k as ie,lr as O,n as k,nn as ae,o as oe,on as se,or as ce,q as le,r as A,rn as ue,sn as j,t as de,tn as fe,tt as M,u as pe,z as me,zt as he}from"./brick-D8hJf8WJ.js";import{i as N}from"./textures--_oN1PjN.js";import{t as ge}from"./stone-BuPL-95D.js";var _e=[.8,.82,.86],ve=[.35,.36,.4],ye=h.filter(e=>e.min[1]===2.48&&e.max[1]===4),[P,F]=t,I=[P,0,F],L=22.4,be=[-.6,.6,.53],xe=[[2,1],[0,2],[0,1]],Se=[1.25,1.3,1.4],Ce=[.56,.48,.28],we=[.04,.04,.05],{CONCRETE:Te,METAL:Ee,PAINT:De}=O,Oe=(e,t,n,r=1,[i,a]=xe[1])=>{for(let o of[0,1,2,0,2,3])e.push(...t[o],...be),typeof n==`number`?e.push(t[o][i],t[o][a],n,r):e.push(n[0],n[1],-2,n[2])},R=(e,t,n,r,i,a,o)=>Oe(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,xe[t]),ke=(e,{min:t,max:n,top:r,side:i},a=0)=>{for(let o=0;o<3;o++)R(e,o,t[o],t,n,i,a+(o==1?.4:1.25-.15*o)),R(e,o,n[o],t,n,o==1?r:i,a+(o==1?1.85:1.25-.15*o))},Ae=(t,n)=>{let r=t.length;n();let i=e(t,0);for(let e=r;e<t.length;e+=10){if(i[e+8]==-1){let t=2.2*(.72+.28*i[e+4]-.12*Math.abs(i[e+3]));i[e+6]*=t,i[e+7]*=t,i[e+9]*=t}[i[e+3],i[e+4],i[e+5]]=be}},[z,je,B,V,Me,Ne]=[[.86,.87,.9],[.55,.57,.6],[.32,.33,.36],[.07,.075,.085],[.42,.52,.66],[.2,.13,.08]],[H,U,W,Pe,Fe,Ie]=[[.3,.8,1],[.35,1,.5],[1,.7,.25],[1,.2,.15],[.7,.35,1],[1,.35,.85]],Le=[[-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]],Re=(e,t,n,r,i,a)=>{for(let[o,s,c]of[[r,r+.1,0],[i-.1,i,0],[r,i,a-.1]])R(e,t,n,[o,c,o],[s,a,s],Se)},ze=(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],R(e,t,n,d,f,De,o),c>i&&([d[1],d[2-t],f[2-t]]=[l,i,c],R(e,t,n,d,f,De,o))})},Be=[[-M/4-Math.asin(se[0][2]/L),-M/4+Math.asin(se[0][2]/L),se[0][3]],[-Math.acos((j[1].min[0]-P)/L),Math.asin((j[0].max[2]-F)/L),se[1][3]]],Ve=e=>e.filter((t,n)=>{let r=n-n%30;return Math.max(e[r],e[r+10],e[r+20])>-.49}),He=Ve(y(c([[1,0],[1,1]],12),_e)),Ue=Ve(y(c([[1.06,0],[1.06,.3]],12),ve)),[G,We]=t,Ge=22.4,K=M/48,Ke=[.4,.42,.46],qe=[.27,.29,.33],[q,Je,Ye,Xe,Ze,Qe,$e]=[[.16,.17,.2],[.6,.62,.66],[1,.8,.45],[.7,.9,1],[1,.6,.2],[1,.12,.08],[.35,1,.5]],et=[.6,.64,.48],tt=y(c([[1,0],[1,1]],6),[1,1,1]),nt=y(c([[0,-1],[1,0],[0,1]],6),[1,1,1]),rt=y(c([[0,0],[1,.4],[.93,.42],[0,.12]],12),[.82,.84,.88]),it=(e,t,n,r,i=Je)=>le(e,tt,t,n,et,1,r,i),at=(e,t,n,r,i=2.2)=>{let a=e.length;u(e,nt,t,de,[0,0,0],n,r),i&&pe(e,a,i)},ot=(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]],Xe,[t,-5,n])),st=e=>[Ge*Math.cos(e*M/40),12*Math.sin(e*M/40)],J=(e,t,n=.02)=>{let r=Math.max(t-5,0),i=Math.floor(r),[a,o]=[st(i),st(i+1)],[s,c]=[a[0]+(o[0]-a[0])*(r-i),a[1]+(o[1]-a[1])*(r-i)],l=S([s/Ge/Ge,c/144,0]),u=s*Math.cos(K/2)/Math.cos((e%K+K)%K-K/2)+n*l[0];return[G+u*Math.cos(e),Math.min(t,5)+c+n*l[1],We+u*Math.sin(e)]},ct=Be.map(([e,t])=>[e-.03,t+.03]),lt=e=>!ct.some(([t,n])=>[e,e-M].some(e=>e>t&&e<n)),ut=[...Array.from({length:35},(e,t)=>(2*t+1)*M/70).filter(e=>lt(e-.03)&&lt(e+.03)).map(e=>{let[t,n]=[Math.cos(e),Math.sin(e)];return[G+22.419999999999998*t,4.02,We+22.419999999999998*n,t,n,.38,0]}),...ee.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])=>!j.some(n=>e>n.min[0]-.5&&e<n.max[0]+.5&&t>n.min[2]-.6&&t<n.max[2]+.6))],dt=(e,[t,n,r,i,a],o,s,c)=>E(e,Array.from({length:12},(e,c)=>{let l=o*Math.cos(c*M/12);return[t+s*i-a*l,n+o*Math.sin(c*M/12),r+s*a+i*l]}),c,[t-i,n,r-a]),[ft,Y]=[160,280],pt=[80,0,140],mt=pt,ht=S([.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)=>N(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=y(c([[1,0],[1,1]],6),[.5,.52,.56]),vt=y(c([[0,-1],[1,0],[0,1]],6),[1,1,1]),yt=y(c([[0,0],[.5,1.6],[.85,3.5],[1,6],[1,10],[.8,12.5],[.55,14],[0,14]],12),[.9,.9,.92]),bt=y(c([[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,i=[],a=e.map(e=>{let t=[];return e.forEach((n,a)=>{let o=e[(a+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),i.some(e=>Math.abs(e[0]-r[0])+Math.abs(e[1]-r[1])+Math.abs(e[2]-r[2])<1e-9)||i.push(r)}}),t}).filter(e=>e.length>2);if(i.length>2){let e=i.reduce((e,t)=>e.map((e,n)=>e+t[n]/i.length),[0,0,0]),n=S(A(t,Math.abs(t[1])<.9?[0,1,0]:[1,0,0])),r=A(t,n),o=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])};a.push(i.sort((e,t)=>o(e)-o(t)))}return a},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,i],a,o,s=!0)=>{let c=(e,t)=>N(e,t,a),l=xt(St,[0,-1,0],.35),u=(e,t,n)=>{let r=Math.sqrt(1-e*e);l=xt(l,[r*Math.cos(t),e,r*Math.sin(t)],n)};u(.92+.08*c(0,1),M*c(0,2),.72+.15*c(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],[s?14:0,-.22,.2,.78,.1,.5],[s?12:0,.24,.2,.76,.1,.15],[s?9:0,.66,.2,.74,.1,.4]])for(let o=0;o<e;o++){let s=10*e+o;u(t+n*c(s,1),M*((o+a+.45*c(s,2))/e),r+i*c(s,3))}let[d,f]=[.8+.4*N(a,1,9),M*N(a,2,9)],[p,m]=[Math.cos(f),Math.sin(f)],h=([e,a,o])=>{let[s,c]=[e*n*d,o*i*(2-d)];return[t[0]+s*p-c*m,t[1]+a*r,t[2]+s*m+c*p]};l.forEach((n,r)=>{let i=n.map(h).filter((e,t,n)=>Math.hypot(...e.map((e,r)=>e-n[(t+n.length-1)%n.length][r]))>1e-5);if(i.length<3)return;let a=S(A([i[1][0]-i[0][0],i[1][1]-i[0][1],i[1][2]-i[0][2]],[i[2][0]-i[0][0],i[2][1]-i[0][1],i[2][2]-i[0][2]]));a[0]*(i[0][0]-t[0])+a[1]*(i[0][1]-t[1])+a[2]*(i[0][2]-t[2])<0&&(i.reverse(),a.forEach((e,t)=>a[t]=-e));let s=S(A(a,Math.abs(a[1])<.9?[0,1,0]:[1,0,0])),l=A(a,s),u=.85*o*(.88+.24*c(r,7))*(.8+.2*Math.sqrt(Math.max(a[1]+1,0)/2)),d=e=>[...e,...a,e[0]*s[0]+e[1]*s[1]+e[2]*s[2]+7*c(0,5),e[0]*l[0]+e[1]*l[1]+e[2]*l[2]+7*c(0,6),O.ROCK,u];for(let t=1;t<i.length-1;t++)e.push(...d(i[0]),...d(i[t]),...d(i[t+1]))})},wt=(e,t,n,r,i,a,o)=>{let s=A(b(t[1],t[0]),b(t[2],t[0]));if(Math.hypot(...s)<1e-9)return;s=S(s),_(s,b(t[0],n))<0&&(t.reverse(),s=s.map(e=>-e));let c=(t[0][1]+t[1][1]+t[2][1])/3,l=.85*o*(.86+.28*N(e.length,a,7))*(.55+.45*X((c-r)/(.3*(i-r))))*(.82+.18*Math.max(s[1],0));for(let n of t)e.push(...n,...s,...Math.abs(s[1])>.7?[n[0],n[2]]:Math.abs(s[0])>Math.abs(s[2])?[n[2]+3*a,n[1]]:[n[0]+3*a,n[1]],O.ROCK,l)},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)];ge(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)=>{u(e,y(c([[13,0],[13,.27],[0,.27]],32),[.13,.13,.15]),[t,0,n],de,[0,0,0],1),te(e,[t,.29,n],7.6,8,[.8,.8,.82]);for(let r=0;r<24;r++){let i=r*M/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])=>{u(e,_t,[t,r,n],de,[0,0,0],[.2,.2,i]),u(e,_t,[t,r,n],de,[0,0,0],[.5,.5,.5]),w(e,oe,()=>u(e,vt,[t,r+i+.4,n],de,[0,0,0],[.55,.55,.45],a))},Ot=(e,t)=>{let n=(n,r)=>{let[i,a]=[t[n],M*(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=>f[Math.min(Math.max(e,0),f.length-1)],t=[[0,140]];for(let n=0;n<=f.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*N(n,1,71)])}return[...t,[f.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=M*N(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(e){let t=[];(e=>{(e=>{(e=>{let t=Array.from({length:9},(e,t)=>{let n=(t+1)/10*(M/4);return[L*Math.cos(n),5+12*Math.sin(n)]}),n=[];u(n,y(c([[L,0],[L,5],...t,[0,17]],48),_e),[P,0,F],de,[0,0,0],1);let r=(e,t)=>(t?Math.ceil:Math.floor)(e*48/M)*M/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*F,n[i]+n[a]+n[o]-3*P);if(Math.max(n[i+1],n[a+1],n[o+1])>5.01||!Be.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)=>[P+L*Math.cos(e),t,F+L*Math.sin(e),Math.cos(e),0,Math.sin(e),_e[0],_e[1],-1,_e[2]];for(let[t,n,a]of Be){let o=[r(t,0),t];for(let e=Math.ceil(t*48/M);e*M/48<n;e++)o.push(e*M/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)=>[P+(L+n)*Math.cos(e),t,F+(L+n)*Math.sin(e)];for(let t=0;t<70;t++){let n=t*M/70,r=n>M/2?n-M:n;if(Be.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/L,t,i));E(e,i(.72,1.5,2.9,.04),[.06,.06,.08],[P,2.2,F]),w(e,.56,()=>E(e,i(.6,1.7,2.7,.07),[1,.85,.5],[P,2.2,F]))}let[,o,s,l,d]=se[0],f=F+o-d;for(let[t,n,r]of[[-s-.3,-s-.02,0],[s+.02,s+.3,0],[-s-.3,s+.3,l]])k(e,[P+t,r,f-.1],[P+n,l+.3,f+.5],ve),R(e,2,f-.12,[P+t+.09,r+.09,0],[P+n-.09,l+.21,0],Se)})(e),(e=>{let t=[...fe,...fe.map(([e,t])=>[t,e]).reverse()];for(let[n,r]of t)R(e,1,.02,[P-n,0,F-r],[P+n,0,F+r],Te,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]=[I[a]+t[a/2],Math.sign(t[a/2])],[l,u]=[t[o/2],i[o/2]].sort((e,t)=>e-t),d=se.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]]=[I[o]+t,I[o]+n],R(e,a,s-c*d,f,p,l,u)};ze(e,a,s,I[o]+l,I[o]+u,8,1.7,d&&[[I[o]+f-p,I[o]+f+p,m]]),g(l,u,0,.25,we,0,.02),g(l,u,7.4,7.6,Se,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,we,0,.02),g(t-.6,t+.6,e+.2,e+1.2,Ce,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[P+r[0]*i,8,F+r[2]*i]};Oe(e,[r(n,0),r(n+1,0),r(n+1,1),r(n,1)],Te,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]]=[I[o]+f-p,I[o]+f+p],R(e,o,t[o],t,n,De,1.4),R(e,o,n[o],t,n,De,1.4),R(e,1,m,t,n,De,.9),R(e,1,.02,t,n,Te,1.85),Re(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+(M/4-o)*t/a,e*M/i],s=22.099999999999998*Math.cos(n);return[P+s*Math.cos(r),5+11.7*Math.sin(n),F+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);Oe(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=>[P+3*Math.cos(e*M/16),16.2,F+3*Math.sin(e*M/16)];Oe(e,[[P,16.2,F],n(t),n(t+1),n(t+2)],Se)}ne.forEach(t=>ke(e,t))})(e),(e=>{j.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o,s]=[t[i],r?j[0].min[2]:n[i],(t[2-i]+n[2-i])/2],c=e=>i?[s,1.75,e]:[e,1.75,s],l=(n[2-i]-t[2-i])/2+.1;le(e,He,c(a),c(o),[0,1,0],1,[1.75,l]);for(let t=5;t<o-a-1;t+=5)le(e,Ue,c(a+t),c(a+t+.3),[0,1,0],.3,[1.75,l]);ze(e,2-i,t[2-i]+T+.02,a,o,ae,1.4),ze(e,2-i,n[2-i]-T-.02,r?a:j[1].min[0],o,ae,1.4),R(e,1,ae-.01,t,n,De,.9);let[u,d]=[[...t],[...n]];[u[2-i],d[2-i]]=[s-.15,s+.15],R(e,1,ae-.02,u,d,Se)})})(e),(e=>{for(let{min:t,max:n}of ee){let r=[(t[0]+n[0])/2,2.5,(t[2]+n[2])/2];for(let i of[-1,1]){let a=i>0?n[2]:t[2];for(let n=0;n<7;n++){let o=t[0]+1+2*n;if(ye.some(e=>Math.abs(e.min[2]-a)<1&&o+.72>e.min[0]&&o-.72<e.max[0]))continue;let s=(e,t,n,r)=>[[-e,t],[e,t],[e,n],[-e,n]].map(([e,t])=>[o+e,t,a+i*r]);E(e,s(.72,2.6,3.8,.02),[.06,.06,.08],r),w(e,.5,()=>E(e,s(.6,2.7,3.7,.04),[.9,.95,1],r)),Oe(e,s(.56,2.6,3.8,-T-.04),we),Oe(e,s(.46,2.7,3.7,-T-.06),[.45,.48,.5])}}for(let r of[0,2])for(let[i,a]of[[t[r],T+.02],[n[r]-T,-.02]])ze(e,r,i+a,t[2-r]+T,n[2-r]-T,4,1.5,ye.filter(e=>Math.abs(e.min[r]-i)<.01).map(e=>[e.min[2-r],e.max[2-r],ae]));R(e,1,3.99,t,n,De,.9);for(let i=0;i<3;i++){let a=t[0]+(n[0]-t[0])*(i+.5)/3;R(e,1,3.98,[a-1.2,0,r[2]-.3],[a+1.2,0,r[2]+.3],Se)}}})(e);for(let{min:t,max:n}of[...ee,...j])R(e,1,.02,t,n,Ee,1.99);for(let{min:t,max:n}of ye){let r=n[0]-t[0]<1?0:2;for(let i of[t[r]-.02,n[r]+.02])Re(e,r,i,t[2-r],n[2-r],t[1])}})(e),(e=>{(e=>{let t=(t,n=Ke)=>E(e,t,n,[G,5,We]),n=(e,n,r,i,a,o)=>{for(let s=e;s<n-1e-9;){let e=Math.min(n,(Math.floor(s/K+1e-9)+1)*K);t([J(s,r,o),J(e,r,o),J(e,i,o),J(s,i,o)],a),s=e}};for(let[t,r]of[[ct[0][1],ct[1][0]],[ct[1][1],ct[0][0]+M]])n(t,r,0,.45,q),w(e,1.6,()=>n(t,r,.16,.3,Xe,.035)),n(t,r,3.18,3.32);n(0,M,4.55,5.01,q,.03),[.4,1.9,2.5,3.7,5.2].forEach(e=>n(e,e+.05,4.68,4.86,Je,.045));for(let e=0;e<70;e++){let n=(e+.5)*M/70,r=.07/Ge;lt(n)&&[0,2].includes(e%5)&&t([J(n-r,.45),J(n+r,.45),J(n+r,4.55),J(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?J(r*K+t*n/st(s)[0],5+s,i):J(r*K,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,qe,.05),1&t?(w(e,1.6,()=>r([[n,1],[n,8]],.04,Xe,.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,M,13.75,14.15,qe,.05),w(e,1.6,()=>n(0,M,13.9,14,Xe,.065));for(let[t,r]of[[5,0],[22,1],[34,0]])n(t*K+.02,(t+2)*K-.02,5.25+r,5.8+r,q,.03),w(e,2,()=>n(t*K+.04,t*K+.05,5.65+r,5.72+r,$e,.045));let[,i,a,o,s]=se[0],c=We+i-s;for(let[t,n,r]of[[-a-.62,-a-.3,0],[a+.3,a+.62,0],[-a-.62,a+.62,o+.3]])k(e,[G+t,r,c-.04],[G+n,o+.62,c+.6],q),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])=>[G+e,t,c-.055]),Ze,[G,1,We]));for(let t=1;t<7;t++)for(let n of[-2.6,2.6])ot(e,G+n,c-2.5*t);let l=(e,t=0,n=0)=>[G+t,e,We+n];at(e,l(17),.7,q,0),it(e,l(17),l(25.099999999999998),.11),[1.9,1.5,1.1].forEach((t,n)=>{let r=20+1.6*n;it(e,1&n?l(r,0,-t):l(r,-t),1&n?l(r,0,t):l(r,t),.06)}),at(e,l(25.4),.34,Qe)})(e),(e=>{j.forEach(({min:t,max:n},r)=>{let i=r?2:0,a=2-i,[o,s]=[t[i],r?j[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,k(e,s,c,Ke,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}),Xe,[(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],k(e,s,c,Ke,4|(i?48:3))}})})(e),(e=>{ee.forEach(({min:t,max:n},r)=>{for(let r of[0,2]){let i=2-r;for(let a of[-1,1]){let o=a>0?n[r]:t[r],s=(r?1:16)*(a>0?1:2),c=(e,t,n)=>{let s=[0,t,0];return[s[r],s[i]]=[o+a*n,e],s},l=(t,n,r,i=0)=>k(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]=ye.filter(e=>Math.abs((a>0?e.max[r]:e.min[r])-o)<.01&&e.min[i]>t[i]&&e.max[i]<n[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,ae+.14,t]});l(c(t[i]-.06,4.7,0),c(n[i]+.06,5,.06),q,s|(r?48:3));for(let[e,r]of d?[[t[i],d[0]],[d[1],n[i]]]:[[t[i],n[i]]])l(c(e,0,0),c(r,.3,.04),Ke,4|s);let f=(t[i]+n[i])/2;for(let i of r?[1,-1]:[]){let r=i>0?t[0]:n[0],a=d?d[i>0?0:1]:f-.8*i;(a-r)*i>4.2&&(u(r,1,r+3*i,1.1,.02,Ke),u(r+4*i,2,a,2.1,.02,Ke),E(e,[c(r+3*i,1,.02),c(r+4*i,2,.02),c(r+4*i,2.1,.02),c(r+3*i,1.1,.02)],Ke,c(r,1,-1)))}if(r&&w(e,1.6,()=>u(t[0]+.3,4.82,n[0]-.3,4.9,.075,Xe)),!r&&!d){u(f-1.1,.9,f+1.1,1.9,.02,q);for(let e=0;e<4;e++)u(f-1,1.05+.2*e,f+1,1.15+.2*e,.035,Je)}if(d?.[3]){let t=d[3];l(c(t-.5,2.95,0),c(t+.5,3.05,.22),q,s),w(e,1.8,()=>l(c(t-.4,2.83,0),c(t+.4,2.95,.12),Ye,8|s)),l(c(t-.05,4.1,0),c(t+.05,4.2,.5),q,s),l(c(t-.5,4.2,.32),c(t+.5,4.42,.5),Je),w(e,2,()=>u(t-.42,4.27,t-.3,4.35,.515,$e)),it(e,c(t+.35,4.42,.41),c(t+.35,5.4,.41),.03),at(e,c(t+.35,5.45,.41),.07,Qe);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);ot(e,t,i)}}}}if(r){let r=n[0]-.7;k(e,[r-.3,5,t[2]+2],[r+.3,5.2,n[2]-2],q),[3.4,4.6,2.8].forEach((n,i)=>{let a=t[2]+2.5+1.5*i;it(e,[r,5.2,a],[r,5.2+n,a],.04),at(e,[r,5.26+n,a],.07,1&i?Qe:Xe)})}else{let r=[n[0]-1.4,6.35,t[2]+1.4],i=e=>[r[0]+.6*e,r[1]+.8*e,r[2]];k(e,[r[0]-.4,5,r[2]-.4],[r[0]+.4,5.12,r[2]+.4],q),it(e,[r[0],5,r[2]],r,.16),at(e,r,.26,q,0),le(e,rt,i(.1),i(1.1),et,1,1.15),it(e,i(.2),i(1.05),.03),at(e,i(1.1),.08,Qe)}})})(e),(e=>{for(let t of ut){let n=t[5];if(dt(e,t,n+.1,0,q),w(e,.7,()=>dt(e,t,n,.015,Ye)),t[6]){let r=e.length,i=[t[0],t[1],t[2],-t[3],-t[4]];dt(e,i,n+.1,T+.06,[.04,.04,.05]),dt(e,i,n,T+.08,[.45,.48,.5]);for(let t=r;t<e.length;t+=10)[e[t+3],e[t+4],e[t+5],e[t+8]]=[...be,-2]}}})(e)})(e);for(let[t,n]of D.pads.slice(0,D.pads.length/2))Et(e,t,n);for(let[t,n]of D.masts.slice(0,D.masts.length/2))Dt(e,t,n,0)})(t),e.relief&&((e,t)=>{let{at:n}=t.relief,r=It,i=(e,t)=>Math.max(n(e,Math.max(t,148)),0),a=e=>X(4*(Z(e/6,.5,82)-.35))*(.55+.45*Z(e/1.7,.5,83)),o=([e,t],n)=>{let[r,o,s]=Ft[n];return[e,n?r:i(e,t),t-o-s*a(e)*+!!n]};for(let t=0;t<r.length-1;t++){let[n,i]=[r[t],r[t+1]];for(let r=0;r<Ft.length-1;r++){let s=[o(n,r),o(i,r),o(i,r+1),o(n,r+1)];for(let[o,c,l]of t+r&1?[[0,1,2],[0,2,3]]:[[0,1,3],[1,2,3]]){let u=A(b(s[c],s[o]),b(s[l],s[o]));if(Math.hypot(...u)<1e-9)continue;u=S(u),u=u[2]>0||Math.abs(u[2])<1e-9&&u[1]<0?u.map(e=>-e):u;let d=Ft[r][3]*(.82+.3*N(t,r,73))*(.7+.3*a((n[0]+i[0])/2));for(let t of[s[o],s[c],s[l]])e.push(...t,...u,t[0]+t[2],t[1],O.ROCK,d)}}}D.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*N(t,1,77);w(e,.1,()=>E(e,[[n,-29.9,140],[n+9+6*N(t,2,77),-29.9,140],[n+5,-29.9,140.25+.3*N(t,3,77)]],[.2,.55,1]));let r=1.5+2.5*N(t,4,77);Ct(e,[n,-29.6,142.5+5*N(t,5,77)],[r,.7*r,r],t+200,.25,!1)}})(t,e);let a=e.relief?.at??(()=>0);D.crags.forEach(e=>((e,{at:[t,n,i],R:a,H:o,s},c)=>{let{reach:l}=r(s,a,o),u=[t,n+he(o),i];ge(e,a<1.5?3:a<2.5?4:5,e=>{let t=l(e);return[u[0]+e[0]*t,u[1]+e[1]*t,u[2]+e[2]*t]},n,n+o,s,.8+.4*N(s,5,41),c)})(t,e,a));let o=t.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],Y-e[i+2],e[i+3],e[i+4],-e[i+5],...e.slice(i+6,i+10))}return t})(t));yield,e.relief&&((e,t)=>{for(let[r,i,a,o,c]of(e=>{let t=C(e.relief),[r,i,a,o]=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-Y/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-r)/a,(t-i)/o)<.97&&!n.some(e=>u(e)<2.5)&&!g.some(e=>u(e)<1)&&!D.pits.some(n=>Math.abs(e-n.x)<s+.5&&Math.abs(t-n.z)<s+.5)&&!D.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=N(u,3,211);l.push([e,c(e,t),t,n<.62?0:n<.945+.055*(1-d)?1:2,u])}};D.sites.forEach(([e,t,n],r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>N(r,5*i+e,201),o=n*(.1+1.7*a(1)*a(1));u(e+o*Math.cos(M*a(2)),t+o*Math.sin(M*a(2)),1e3*r+i)}}),D.crags.forEach(({at:[e,,t],R:n},r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>N(r,5*i+e,215),o=n*(1.32+.75*a(1)*a(1));u(e+o*Math.cos(M*a(2)),t+o*Math.sin(M*a(2)),5e5+1e3*r+i)}}),D.bowls.forEach(([e,t,n],r)=>{for(let i=0;t>=Y/2&&i<Math.round(1.1*n);i++){let a=e=>N(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(M*a(2)),t+o*n*Math.sin(M*a(2)),1e5+1e3*r+i)}});for(let e=0;e<60;e++){let t=t=>N(e,t,205),n=1+158*t(1),r=f[Math.floor(n)];u(n,Y/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=>N(e,t,207),[n,i,s]=[r+a*(1.8*t(1)-.9),Y/2+4+(o-8)*t(2),M*t(3)];for(let r=0;r<10+12*t(4);r++)s+=.5*(N(e,10+r,208)-.5),[n,i]=[n+(1+1.4*N(e,40+r,208))*Math.cos(s),i+(1+1.4*N(e,40+r,208))*Math.sin(s)],u(n+.8*(N(e,70+r,208)-.5),i+.8*(N(e,100+r,208)-.5),3e5+100*e+r,.6)}for(let e=0;e<520;e++){let t=t=>N(e,t,209),[n,i]=[r+a*(2*t(1)-1),Y/2+o*t(2)];(Z(n/20,i/20,77)>.62||t(3)<.04)&&u(n,i,4e5+e,.7)}return[...l,...l.map(([e,,t,n,r])=>[e,c(e,Y-t),Y-t,n,r])]})(t)){let t=e=>N(c,e,213),n=At[o]*(.88+.24*t(1)),[s,l,u]=[n/2,n/2*(.65+.35*t(2)),n*(.5+.3*t(3))],[d,f]=[Math.cos(M*t(4)),Math.sin(M*t(4))],p=i+.1*u;ge(e,kt[o],e=>{let[t,n]=[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/s,2*e[1]/u,n/l);return[r+e[0]*i,p+e[1]*i,a+e[2]*i]},i,p+u/2,c,.5+.25*t(5))}})(o,e);for(let[e,t,n,r,i]of D.pillars)t<140&&r>140&&jt(o,e,t,n,r,i,401);return((e,t)=>{let n={relief:t.relief&&C(t.relief)},r=(e,r,i)=>!t.relief||Array.from({length:17},(e,t)=>t*M/16).every((t,a)=>l(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]=[ft*N(n,1,61),Y*N(n,2,61),.6+2*N(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*N(n,t%12,67):1),e===2||e===3?i*(.55+.45*N(n,t%12,68)):i],d=t*M/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,O.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)}}})(o,e),yield,e.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 i=S([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),...i,e,140+t*(n-140),O.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)}}}})(o,e),(e=>{for(let[t,{x:n,z:r,level:a,rows:o}]of D.pits.entries()){let c=(e,t)=>o[e]?.[2+t]??0,l=Array.from({length:o.length+1},(e,t)=>[o[0][0]+t,-Math.min(c(t-1,0),c(t,0)),Math.min(c(t-1,1),c(t,1))]),u=(e,t)=>[e,a,t,0,1,0,e,t,O.STONE,.6+.4*X((Math.hypot(e-n,t-r)-i)/3)],f=(t,n,r,i)=>e.push(...t,...r,...n,...t,...i,...r);for(let[e,t]of[[r-s,r-i],[r+i,r+s]])for(let r=n-s;r<n+s;r+=2)f(u(r,e),u(r+2,e),u(r+2,t),u(r,t));for(let i=0;i<l.length-1;i++){let[[o,c,d],[p,h,g]]=[l[i],l[i+1]];f(u(n-s,o),u(n+c,o),u(n+h,p),u(n-s,p)),f(u(n+d,o),u(n+s,o),u(n+s,p),u(n+g,p));for(let o of[1,2]){let s=[a,a-.6,a-5,a-10,m],c=(e,t)=>[n+e[o]+(o>1?-1:1)*(t&&t<4?.9*N(e[0],t,83+o)-.25:0),s[t],e[0]];for(let u=0;u<4;u++){let d=[c(l[i],u),c(l[i+1],u),c(l[i+1],u+1),c(l[i],u+1)],f=[n+(o>1?99:-99),s[u],r],p=e.length;wt(e,[d[0],d[1],d[2]],f,m-12,a,t+u,1.2),wt(e,[d[0],d[2],d[3]],f,m-12,a,t+u,1.2);for(let t=p+3;t<e.length;t+=10){let n=S([e[t],e[t+1]+.9,e[t+2]]);[e[t],e[t+1],e[t+2]]=n}}}}let p=(e,t)=>[e,m,t,0,1,0,e,t,O.STONE,.5];f(p(n-i-1.5,r-i),p(n+i+1.5,r-i),p(n+i+1.5,r+i),p(n-i-1.5,r+i));let h=o[i][3],g=(a-m)/d;for(let i=0;i<d-1;i++){let a=n+h-1.3*(d-1-i);Tt(e,[[a,m-1,r-1,a+1.3,m+g*(i+1),r+1]],m,9*t+i,2,.9)}for(let o=0;o<20;o++){let s=M*(o+N(t,o,85))/20,[c,l,u]=[n+(i+1.6)*Math.cos(s),r+(i+1.6)*Math.sin(s),.3+.35*N(t,o,86)];Tt(e,[[c-u,a-.3,l-u,c+u,a+.9*u,l+u]],a,40*t+o,1,.9)}}})(o),yield,((e,t)=>{let{at:n}=t.relief,r={relief:C(t.relief)};D.bowls.forEach(([t,i,a],o)=>{let s=a<12?0:Math.round(M*a/1.5),c=Array.from({length:s},(e,r)=>{let[o,c]=[Math.cos(M*r/s),Math.sin(M*r/s)],[l,u]=[a,-1/0];for(let e=.8*a;e<1.3*a;e+=.5){let r=n(t+o*e,i+c*e);[l,u]=r>u?[e,r]:[l,u]}return l}),u=Array.from({length:s},(e,n)=>{let[a,u]=[Math.cos(M*n/s),Math.sin(M*n/s)],d=[-2,-1,0,1,2].reduce((e,t)=>e+c[(n+t+s)%s],0)/5,f=N(n,o,87);return[-2.4,-1.2,0,1.2,2.4].map((e,s)=>{let[c,p]=[t+a*(d+e),i+u*(d+e)],m=[.04,.12,.1+.15*f,.1,.04][s],h=[.62+.3*N(n>>1,o,88),.9,1.22+.2*f,1.1,1][s];return[c,l(r,c,p)+m,p,0,1,0,c,p,O.STONE,h]})});u.forEach((t,n)=>{let r=u[(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])})})})(o,e),yield,((e,t)=>{let n=C(t.relief),[r,i,a,o]=n.bound,[c,l]=[Pt(n.x0,r+a),Pt(n.z0,i+o)],u=(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]},d=(e,t)=>D.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),f=/* @__PURE__ */ new Map,p=(e,t)=>{let n=4096*e+t,r=f.get(n);if(!r){let i=u(e,t),a=[u(e-4,t)-u(e+4,t),u(e,t-4)-u(e,t+4)],o=i===0&&a[0]===0&&a[1]===0,s=n=>o?0:1.4*(N(e,t,131+n)-.5);r=[e,i,t,...S([a[0]+s(0),8,a[1]+s(1)]),e,t,O.STONE,Math.min(Math.max(1+i/60,.78),1.2)+d(e,t)],f.set(n,r)}return r},m=(e,t)=>{let[n,s,u,d]=[c[e],c[e+1],l[t],l[t+1]];if(!(n<s&&u<d))return 0;let f=Math.hypot((Math.min(Math.max(r,n),s)-r)/a,(Math.min(Math.max(i,u),d)-i)/o);return f<1?2:+(f<1.65)};for(let t=0;t<c.length-1;t++)for(let r=0;r<l.length-1;r++){let[i,a,o,u,d]=[c[t],c[t+1],l[r],l[r+1],m(t,r)];if(d>1)for(let t=i;t<a;t+=n.cell)for(let r=o;r<u;r+=n.cell){if(t>=n.hole[0]&&t<n.hole[2]&&r>=n.hole[1]-8&&r<n.hole[3]+8||D.pits.some(e=>t>=e.x-s&&t<e.x+s&&r>=e.z-s&&r<e.z+s))continue;let[i,a,o,c]=[p(t,r),p(t+n.cell,r),p(t+n.cell,r+n.cell),p(t,r+n.cell)];e.push(...i,...o,...a,...i,...c,...o)}else if(d){let n=[];for(let[e,s,c,l,d]of[[i,o,a,o,m(t,r-1)],[a,o,a,u,m(t+1,r)],[a,u,i,u,m(t,r+1)],[i,u,i,o,m(t-1,r)]]){let t=d>1?5:1;for(let r=0;r<t;r++)n.push(p(e+(c-e)*r/t,s+(l-s)*r/t))}let s=p((i+a)/2,(o+u)/2);n.forEach((t,r)=>e.push(...s,...n[(r+1)%n.length],...t))}}})(o,e),yield,((e,t)=>{let{at:n}=t.relief,r=S(A([0,1,0],ht)),i=[r,A(ht,r),ht];for(let[t,r]of D.dishes)Dt(e,t,r,n(t,r),6,[1,.25,.15]),u(e,bt,[t,n(t,r)+5.2,r],i,[0,0,-.9],1);for(let[t,r,i,a]of D.ramps)for(let o of[-8,8])Dt(e,t+o*a,r-o*i,n(t+o*a,r-o*i),2.2,[1,.45,.1]);let[a,o]=D.wreck,s=m,c=S([.8,-.35,.5]),l=S(A([0,1,0],c));u(e,yt,[a-3,s+3.1,o-2],[l,A(c,l),c],[0,0,0],[1.6,1.4,.55],[.6,.6,.62]),E(e,[[a+3,s,o+4],[a+6.5,s+.2,o+5],[a+4,s+2.6,o+5.5]],[.7,.3,.14]),Dt(e,a-3.4,o+2.6,s,3.5,[1,.12,.08])})(o,e)),((e,t)=>{for(let[n,r,i,a,o,s]of Lt){let c=e=>{let c=e*M/480,[l,u]=[Math.cos(c),Math.sin(c)],d=r*Rt(l,u,n,s),f=(e+1)*M/480,p=(r*Rt(Math.cos(f),Math.sin(f),n,s)-d)/(n*M/480);return Array.from({length:i+1},(e,r)=>{let c=r/i,f=n-.3*d*(1-c),m=n/(30+26*(1-c))*(1+.05*c),h=2*Z(l*m+s+1.7*c,u*m-1.3*c,s+9)-1,g=S([-l-u*(-1.5*p-1.6*h*(1-.5*c)),.75,l*(-1.5*p-1.6*h*(1-.5*c))-u]),v=Math.max(_(g,t),0),y=(.8+.3*Z(l*n/90-s,u*n/90+2.3*c,s+11))*(.72+.28*X(.5+.9*h))*(o+(a-o)*Math.min(1.2*v+(r===i?.3:0),1));return[pt[0]+l*f,(d+25)*c-25,pt[2]+u*f,l,0,u,y,y,-2,1.03*y]})},l=c(0);for(let t=1;t<=480;t++){let n=c(t%480);for(let t=0;t<i;t++)e.push(...l[t],...n[t],...n[t+1],...l[t],...n[t+1],...l[t+1]);l=n}}})(o,S(e.sun.dir)),o}var Bt=()=>{let e=[];return(e=>{let t=ht,n=t.map(e=>-e),r=S([n[2],0,-n[0]]),i=A(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,a)=>n+60*e*(r[a]*Math.cos(t)+i[a]*Math.sin(t))),d=e.length;for(let t=0;t<c;t++)for(let n=0;n<l;n++){let[r,i]=[n*M/l,(n+1)*M/l],[o,d]=[(t+.5)/c,(n+.5)*M/l],[f,p]=[o*Math.cos(d),o*Math.sin(d)],m=Math.sqrt(1-o*o),[h,g]=[(Math.atan2(f,m)+1.5)/M*12,6*(Math.asin(p)/Math.PI+.5)],_=gt(h,g,11)>.5?a([.13,.32,.09],[.4,.3,.15],gt(2*h,2*g,13)):[.03,.16,.5],v=Math.abs(p)>.93?1:X(4*(gt(1.5*h+4,3*g,17)-.5));_=a(_,[.95,.97,1],v).map(e=>e*(.55+.45*Math.max(0,.3*f+.25*p+.9*m))*(.6+.4*m)),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)],_,s)}pe(e,d,1.5)})(e),e},{FORWARD:Vt,BACK:Ht,JUMP:Ut,CROUCH:Wt,SPRINT:Gt,USE:Kt}=ce,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=y(c(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)=>u(e,tn(t,i,a,o),n,me(r,Math.abs(r[1])>.9?[1,0,0]:[0,1,0]),[0,0,0],1),rn=(e,t,n,r,i,a=p)=>le(e,tn([[0,0],[r,0],[r,1],[0,1]],i,a,8),t,n,[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(e,t){let n=yield*zt(e);return yield,n=n.concat((({brushes:e},t)=>{let n=[];for(let r of e)r.ghost&&r.tint&&ke(n,r,2*Math.max(0,t.indexOf(`${r.tint}`)));let r=[];(e=>{[...re,...Le].forEach(t=>((e,[t,n,r,i,a,o,s,c])=>{let l=1&c?2:0,[d,f]=[[n,o,r],[i,s,a]],p=c<2?1:-1,m=(e,t,n)=>{let r=[0,o+t,0];return r[l]=(p>0?d[l]:f[l])+p*n,r[2-l]=d[2-l]+e,r},[h,g,_]=[f[2-l]-d[2-l],f[l]-d[l],s-o],v=(t,n,r)=>{let[i,a]=[m(t[0],t[1],t[2]),m(n[0],n[1],n[2])];k(e,i.map((e,t)=>Math.min(e,a[t])),i.map((e,t)=>Math.max(e,a[t])),r)},y=(t,n,r,i,a,o,s=1)=>w(e,s,()=>E(e,[m(t,n,a),m(r,n,a),m(r,i,a),m(t,i,a)],o,m(t,n,a-1))),b=(e,t,n,r,i,a)=>{v([e,t,i-.06],[n,r,i],V),y(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);y(e+.08,s-.025,e+.08+(n-e-.16)*(.4+(7*e+o)%4*.15),s,i+.01,a,1.1)}};Ae(e,()=>{if(t==ue.BENCH){v([0,_-.06,0],[h,_,g],z),v([.05,0,0],[h-.05,_-.06,g-.06],je);for(let e=1.1;e<h-.5;e+=1.1)v([e-.01,.1,g-.06],[e+.01,_-.1,g-.05],V);for(let e=0;e<4;e++){let t=1.4+2.75*e;v([t-.05,_,.16],[t+.05,_+.22,.22],V),b(t-.45,_+.2,t+.45,_+.75,.28,[H,U,W,H][e]),v([t-.3,_,.45],[t+.3,_+.025,.65],B),v([t+.7,_,.2],[t+.82,_+.2,.32],[U,Me,W,Fe][e])}}else if(t==ue.SAMPLES){v([0,_-.05,0],[h,_,g],B),v([.15,.18,.15],[h-.15,.22,g-.15],V);for(let e of[.1,h-.2])for(let t of[.1,g-.2])v([e,0,t],[e+.1,_-.05,t+.1],V);for(let e=0;e<4;e++){let t=.25+1.2*e;v([t,_,.3],[t+.9,_+.07,1.2],V),y(t+.05,_+.015,t+.85,_+.055,1.205,H,1.2),v([t+.28,_+.07,.55],[t+.62,_+.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]])v([t+e,_+.07,n],[t+e+.02,_+.55,n+.02],je);v([t,_+.53,.3],[t+.9,_+.55,1.2],[.5,.6,.66])}}else if(t==ue.RACKS){v([0,0,0],[h,_,g],V);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;y(t,r,t+1.43,r+.16,g+.01,B,.25);for(let i=0;i<5;i++){let a=[U,W,U,H,Pe,null][(7*e+5*n+3*i)%6];a&&y(t+.1+.08*i,r+.06,t+.14+.08*i,r+.1,g+.015,a,1.6)}}y(t,_-.4,t+1.43,_-.34,g+.01,H,.9)}}else if(t==ue.SCOPE){v([.2,0,.2],[1,.1,1],V),v([.45,.1,.45],[.75,.85,.75],z),y(.52,.55,.68,.65,.755,U,1.4),v([.35,.85,.35],[.85,1.05,.85],B);let[t,n]=[m(.6,.9,.2),m(1.4,2.8,2.1)];le(e,x(2,1,[1,1],[0,0]),t,n,[1,0,0],1,.2,z),le(e,x(2,1,[1,1],[0,0]),m(1.3,2.56,1.86),m(1.42,2.83,2.13),[1,0,0],1,.24,V),le(e,x(2,1,[1,1],[0,0]),m(.86,1.4,.6),m(1.2,2.2,1.4),[1,0,0],1,.05,B)}else if(t==ue.ANALYSER){v([0,0,0],[h,.9,g],z),v([0,.9,0],[h,_,.5],z),b(.12,.92,.95,1.26,.56,U),v([1.1,.9,.55],[1.88,1.18,1.1],B),y(1.16,.95,1.82,1.13,1.105,Fe,1.3);for(let e=0;e<6;e++)y(.15+.12*e,.74,.22+.12*e,.8,g+.005,[W,U,H][e%3],1.4);for(let e of[.3,.6])v([.05,e,g],[h-.05,e+.015,g+.005],V)}else if(t==ue.PLANTS){for(let e of[0,h/2-.03,h-.06])v([e,0,0],[e+.06,_,g],B);v([0,_-.04,0],[h,_,g],z);for(let t of[.3,.9,1.5]){v([0,t,0],[h,t+.04,g],z),v([.1,t+.04,.12],[h-.1,t+.18,g-.12],Ne);for(let e=.25;e<h-.15;e+=.4)v([e-.1,t+.18,.2],[e+.1,t+.18+(.12+(10*e+3*t)%3*.06),g-.2],10*e%2<1?[.18,.5,.16]:[.3,.62,.2]);w(e,1.1,()=>v([.1,t+.53,.3],[h-.1,t+.56,g-.3],Ie))}}else if(t==ue.LOCKERS){v([0,0,0],[h,_,g],Me);for(let e=0;e<6;e++){let t=.8*e;e&&v([t-.01,.05,g],[t+.01,_-.05,g+.01],V);for(let e=0;e<3;e++)v([t+.2,1.7+.08*e,g],[t+.6,1.73+.08*e,g+.01],V);v([t+.64,.95,g],[t+.68,1.2,g+.04],je),y(t+.3,1.5,t+.5,1.56,g+.012,W,.8)}}else if(t==ue.SUIT){v([.1,0,.1],[.9,.06,.9],V),v([.47,.06,.06],[.53,1.7,.14],B);for(let e of[.27,.54])v([e-.02,.06,.36],[e+.21,.22,.68],B),v([e,.22,.4],[e+.19,.95,.62],z);v([.22,.95,.32],[.78,1.58,.7],z),v([.25,1,.14],[.75,1.62,.32],je);for(let e of[.08,.78])v([e,1,.4],[e+.14,1.54,.6],z),v([e,.88,.4],[e+.14,1,.6],B);y(.34,1.3,.5,1.42,.705,H,1),y(.56,1.34,.64,1.42,.705,Pe,1.2),u(e,x(2,0,[1,1]),m(.5,1.8,.5),de,[0,0,0],.21,z),y(.38,1.74,.62,1.88,.715,W,.7)}else{v([0,0,0],[h,_,.05],B),y(.1,.35,.6*h,_-.1,.055,H,.5);for(let e=0;e<12;e++)y(.66*h+e%3*.2,.4+.25*(e>>2),.66*h+e%3*.2+.1,.5+.25*(e>>2),.055,[U,W,Pe,H][e%4],1.3);y(.1,.1,h-.1,.18,.055,W,.9)}})})(e,t));let[,t]=se[0],n=F+t+.03;R(e,2,n,[P-3,3.4,0],[P+3,4.3,0],we);for(let t of[3.42,4.22])R(e,2,n+.01,[P-2.95,t,0],[P+2.95,t+.05,0],Se);for(let t=0;t<9;t++){let r=P-2.6+.6*t;R(e,2,n+.01,[r,3.9,0],[r+.45,4.1,0],[.9,.95,1]),R(e,2,n+.01,[r+.05,3.6,0],[r+.3+t%2*.1,3.7,0],H)}for(let[t,n]of[[P+16.6,.3],[P+17.1,.15]])Ae(e,()=>k(e,[t,2.94,F-6.7],[t+n,3.06,F+6.7],V));j.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o]=[t[i],r?j[0].min[2]:n[i]],s=t[2-i]+T,c=[0,2,0],l=[0,2.1,0];[c[i],l[i],c[2-i],l[2-i]]=[a,o,s,s+.12],Ae(e,()=>k(e,c,l,V));for(let t=a+2.5;t<o-1;t+=5){let[n,r]=[[0,1.3,0],[0,1.5,0]];[n[i],r[i]]=[t-.2,t+.2],R(e,2-i,s+.03,n,r,U)}});for(let t of ye){let n=t.max[0]-t.min[0]<1?0:2,[r]=ee.filter(({min:e,max:n})=>e[0]<=t.min[0]&&t.max[0]<=n[0]&&e[2]<=t.min[2]&&t.max[2]<=n[2]),i=(r.min[n]+r.max[n])/2>t.min[n]?1:-1,a=(i>0?t.max[n]:t.min[n])+.02*i,[o,s]=[t.min[2-n],t.max[2-n]];if(j.some(e=>[0,2].every(n=>e.min[n]<=t.max[n]+.01&&t.min[n]-.01<=e.max[n])))continue;for(let t=0;o+.3*t<s;t++){let[r,i]=[[0,ae+.05,0],[0,ae+.35,0]];[r[2-n],i[2-n]]=[o+.3*t,Math.min(o+.3*t+.15,s)],R(e,n,a,r,i,W),[r[2-n],i[2-n]]=[i[2-n],Math.min(o+.3*t+.3,s)],R(e,n,a,r,i,V)}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],R(e,n,a,l,u,Pe)}})(r);for(let e of r)n.push(e);for(let e=0;e<r.length;e+=30)for(let t of[0,2,1]){let i=e+10*t;n.push(r[i],r[i+1],280-r[i+2],r[i+3],r[i+4],-r[i+5],...r.slice(i+6,i+10))}return n})(e,t)),e.station&&(yield,n=n.concat((({hall:[e],post:t,hull:[n,r,i,a],gun:s})=>{let c=[],{R:l}=v,u=t[0][1],[d,f]=[e[0],e[0]+48],m=[d,f].flatMap(e=>{let t=Math.acos((e-n)/l);return[t,$t-t]}),h=[...Array.from({length:72},(e,t)=>t*$t/72),...m,$t].sort((e,t)=>e-t);for(let e=r;e<a-.01;e+=2){let t=e>=u+30&&e<a-14;for(let r=0;r+1<h.length;r++){let[a,o]=[h[r],h[r+1]],s=(a+o)/2,m=n+l*Math.cos(s);if(m>d&&m<f&&e>=u-2&&e<u+16)continue;let g=t,_=g?.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=h[t],r=t%(h.length-1),[o,s]=[an(r,a,1)*_,an(r,a,2)*_],u=[Math.cos(e)+o*Math.sin(e),s,Math.sin(e)-o*Math.cos(e)];en(c,[n+l*Math.cos(e),a,i+l*Math.sin(e)],u,g?qt:Q,g?ie:p)}}}nn(c,[[l,0],[l-3,3],[.6*l,o.DOME-1],[0,o.DOME]],[n,a,i],[0,1,0],Q,p);let g=[n-16,a+o.MAST,i];rn(c,[g[0],a+4,i],g,.8,Q);let _=Array.from({length:6},(e,t)=>[2.4*t,3.6*(t/5)**2]);nn(c,[..._,...[..._].reverse().map(([e,t])=>[e,t-.3])],g,[-.6,.8,0],Yt,-1,20);let y=o.BARREL*l,b=r-s[1];nn(c,[[l,0],[l-1.5,2],[y+2,2.6],[0,2.6]],[n,r,i],[0,-1,0],Q,p),nn(c,[[0,2.6],[y+2,2.6],[y+2,5],[y,6.5],[y,b-4],[y+3,b-1.5],[y+3,b],[y-2,b],[y-3,b-10],[0,b-10.5]],[n,r,i],[0,-1,0],Jt,p);for(let e=10;e<b-8;e+=7)nn(c,[[0,e],[y+.8,e],[y+.8,e+1.6],[0,e+1.6]],[n,r,i],[0,-1,0],Q,p);nn(c,[[0,b-10.3],[y-3.5,b-10.1],[0,b-9.9]],[n,r,i],[0,-1,0],Qt,-2),$(c,[n-y-8,s[1]-18,i-16],[n-y-7.2,s[1]+8,i+16],Yt,p),rn(c,[n-y-1,s[1]+3,i],[n-y-7.2,s[1]+3,i],.6,Q);let x=r+(a-r)*o.WING,[S,C,w]=[o.PANEL,o.SPAN,o.GAP];for(let e of[-1,1]){let t=n+e*(l+o.BOOM);rn(c,[n+e*l,x,i],[t,x,i],1.4,Q),$(c,[Math.min(t,t+3*e),x-6,i-2],[Math.max(t,t+3*e),x+6,i+2],Q,p),rn(c,[t,x,i],[t+e*(4*(S+w)+2),x,i],.6,Zt);for(let n=0;n<4;n++){let r=t+e*(3+n*(S+w)),[a,o]=[Math.min(r,r+e*S),Math.max(r,r+e*S)];$(c,[a,x-C/2,i-.2],[o,x+C/2,i+.2],Xt,p);for(let e of[x-C/2,x+C/2-.6,x-.3,x-C/4,x+C/4-.3])$(c,[a,e,i-.3],[o,e+.6,i+.3],Q,p);for(let e of[a,a+S/2-.3,o-.6])$(c,[e,x-C/2,i-.3],[e+.6,x+C/2,i+.3],Q,p)}}return c})(e.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-v.R,r+v.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,p);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})(e.station))),yield,{land:n,sky:Bt(),heavens:mt}}export{mn as default};
@@ -0,0 +1,24 @@
1
+ /** The sound of each cue of a swap (CUES): the gun's, then the rail gun's. */
2
+ export declare const RELOADS: ((32 | 31)[] | (34 | 33)[])[];
3
+ /** Seconds between two buzzes of a saber lock, and two crackles of a rail gun's bolt. */
4
+ export declare const BUZZ = 0.16;
5
+ export declare const CRACKLE = 0.09;
6
+ /** A bolt's buzz goes up and down 1.6 times a second, by 35 % of its pitch either way. */
7
+ export declare const WAIL: number[];
8
+ /** A heavy release's swish is told by its cut plus this. */
9
+ export declare const HEAVY_CUE = 8;
10
+ /** A blow of the fists' swish is told by its blow (BLOW) plus this: shorter, higher and softer than a cut's. */
11
+ export declare const FIST_CUE = 16;
12
+ export declare const WHOOSH: {
13
+ rate: number[];
14
+ gain: number[];
15
+ };
16
+ /** The thud of a blow that landed, the tackle's impact played higher: its gain, by BLOW, and its rate. */
17
+ export declare const THUD: readonly [readonly [0.35, 0.35, 0.65, 0.7, 0.5, 0.5, 0.8], 1.5];
18
+ /** The xenomorph's swipes, left then right a little apart in pitch, and its tail's whip: rate, by BLOW from CLAW_L. */
19
+ export declare const RAKE: number[];
20
+ /** The swish of a cut, by CUT: higher and quieter for a thrust, lower and fuller for a slash. */
21
+ export declare const SWISH: {
22
+ rate: number[];
23
+ gain: number[];
24
+ };
@@ -0,0 +1,21 @@
1
+ import type { World } from '../../shared/world';
2
+ import type { Audio } from '../audio';
3
+ import type { Balls } from '../balls';
4
+ import type { Tracer } from '../beams';
5
+ import type { Effects } from '../effects';
6
+ import type { Hud } from '../hud';
7
+ import type { Vec3 } from '../mesh';
8
+ import type { Combat } from './types';
9
+ export declare const createCombat: (world: World, audio: Pick<Audio, "play"> & Partial<Pick<Audio, "loop">>, hud: Pick<Hud, "vitals" | "hit" | "down">, fx: Pick<Effects, "fire" | "cut" | "wound" | "lie" | "quake" | "blow" | "punch">, tracer: Pick<Tracer, "flash" | "burst" | "impact" | "blast" | "orbs" | "update" | "mount" | "crackle" | "laser" | "charging" | "lightning" | "tesla">, ctl: {
10
+ pitch: number;
11
+ }, balls: Pick<Balls, "fire" | "frame">,
12
+ /** The muzzle of a runner's long gun as last drawn, from his feet (Renderer.muzzle()). */
13
+ drawn?: (id: number) => Vec3 | undefined,
14
+ /** The pitch of a player's voice (voiceOf()). */
15
+ voice?: (id: number) => number,
16
+ /** A player's BODY: his death cries' voice. */
17
+ bodyOf?: (id: number) => number | undefined,
18
+ /** Whether a player is a xenomorph: its own cries, its acid, its hiss at a tail's charge, its shriek at a dash. */
19
+ beast?: (id: number) => boolean,
20
+ /** Whether a player fires the Hunter's harpoon rather than a plasma ball. */
21
+ hunter?: (id: number) => boolean) => Combat;
@@ -0,0 +1,41 @@
1
+ import type { PlayerState } from '../../shared/types';
2
+ import type { World } from '../../shared/world';
3
+ import type { Vec3 } from '../mesh';
4
+ import type { View, Blade } from './types';
5
+ /** The own muzzle in the world: the view's muzzle (camera space) from the camera. */
6
+ export declare const muzzleOf: (v: View) => Vec3;
7
+ /**
8
+ * Where the own shots end: the first wall along the look ray from the eye, or the range. `local` is
9
+ * that point in the camera's space (right, up, forward), which is turned by the drawn pitch, so
10
+ * that the gun can point at it.
11
+ */
12
+ export declare const sight: (world: World, eye: Vec3, cam: Vec3, yaw: number, pitch: number, drawn: number) => {
13
+ end: Vec3;
14
+ hit: boolean;
15
+ local: Vec3;
16
+ };
17
+ /** Shots between two states of a player, a u8 counter that wraps. */
18
+ export declare const fired: (a?: PlayerState, b?: PlayerState) => number;
19
+ /**
20
+ * The CUT of a swing that started between two states of a player, or -1: `swing` jumped up (it
21
+ * only counts down), or the cut changed under a running one.
22
+ */
23
+ export declare const swung: (a?: Blade, b?: Blade, xeno?: boolean) => number;
24
+ /**
25
+ * Whether the step from a to b is the strike of its cut: `swing` went down through the strike tick
26
+ * (CUTS; the xenomorph's, `xeno`, TAILS).
27
+ */
28
+ export declare const struck: (a?: Blade, b?: Blade, xeno?: boolean) => boolean;
29
+ /** The pitch of a player's voice: the woman's higher, and each a little off the next by his id. */
30
+ export declare const voiceOf: (id: number, body?: number) => number;
31
+ /** Health and armour together: what a hit takes. */
32
+ export declare const life: (p: Pick<PlayerState, "hp" | "armor">) => number;
33
+ /**
34
+ * A death worth a cry of pain rather than a groan (the user, 2026-11-17): a katana's cut that took
35
+ * a limb, a fall hard enough to hurt (the speed a frame before the landing), or a hit of 3 or more
36
+ * (a grenade, a charged shot). `was` is the life and vertical speed a frame before.
37
+ */
38
+ export declare const dreadful: (was: {
39
+ life: number;
40
+ vy: number;
41
+ }, p: PlayerState) => boolean;
@@ -0,0 +1,23 @@
1
+ import type { PlayerState } from '../../shared/types';
2
+ import type { Vec3 } from '../mesh';
3
+ /** What the frame draws from: the own eye and the camera (the eye plus the shake), the look, the own muzzle in the camera's space. */
4
+ export interface View {
5
+ eye: Vec3;
6
+ cam: Vec3;
7
+ yaw: number;
8
+ pitch: number;
9
+ /** The pitch the camera draws at: the look plus the shake. */
10
+ drawn: number;
11
+ /** The own muzzle (the emitter) in the camera's space. */
12
+ muzzle: Vec3;
13
+ }
14
+ export interface Combat {
15
+ /** One live step of the own player, its state before and after: the recoil and the kick of each shot it fired, the swish and the punch of a cut. */
16
+ step(a?: PlayerState, b?: PlayerState): void;
17
+ /** One frame at `now` (ms): the balls, the flashes and the sounds of what changed since the last one, and the HUD. */
18
+ frame(v: View | undefined, me: PlayerState | undefined, others: PlayerState[], keys: number, dt: number, now?: number): void;
19
+ /** Where the own shoulder cannon is locked on (a foe's chest), or undefined: its shots' beams go there. */
20
+ lock(at?: Vec3): void;
21
+ }
22
+ /** What the katana's sounds read of a player: the swing, the cut and whether it is in hand. */
23
+ export type Blade = Pick<PlayerState, 'swing' | 'cut' | 'wield' | 'blade' | 'fists' | 'heavy' | 'charge' | 'down' | 'railed' | 'ammo' | 'reload' | 'rifled' | 'hot' | 'hits'>;
@@ -1,76 +1,3 @@
1
- import type { PlayerState } from '../shared/types';
2
- import type { World } from '../shared/world';
3
- import type { Audio } from './audio';
4
- import type { Balls } from './balls';
5
- import type { Tracer } from './beams';
6
- import type { Effects } from './effects';
7
- import type { Hud } from './hud';
8
- import type { Vec3 } from './mesh';
9
- /** What the frame draws from: the own eye and the camera (the eye plus the shake), the look, the own muzzle in the camera's space. */
10
- export interface View {
11
- eye: Vec3;
12
- cam: Vec3;
13
- yaw: number;
14
- pitch: number;
15
- /** The pitch the camera draws at: the look plus the shake. */
16
- drawn: number;
17
- /** The own muzzle (the emitter) in the camera's space. */
18
- muzzle: Vec3;
19
- }
20
- /**
21
- * Where the own shots end: the first wall along the look ray from the eye, or the range. `local` is
22
- * that point in the camera's space (right, up, forward), which is turned by the drawn pitch, so
23
- * that the gun can point at it.
24
- */
25
- export declare const sight: (world: World, eye: Vec3, cam: Vec3, yaw: number, pitch: number, drawn: number) => {
26
- end: Vec3;
27
- hit: boolean;
28
- local: Vec3;
29
- };
30
- export interface Combat {
31
- /** One live step of the own player, its state before and after: the recoil and the kick of each shot it fired, the swish and the punch of a cut. */
32
- step(a?: PlayerState, b?: PlayerState): void;
33
- /** One frame at `now` (ms): the balls, the flashes and the sounds of what changed since the last one, and the HUD. */
34
- frame(v: View | undefined, me: PlayerState | undefined, others: PlayerState[], keys: number, dt: number, now?: number): void;
35
- /** Where the own shoulder cannon is locked on (a foe's chest), or undefined: its shots' beams go there. */
36
- lock(at?: Vec3): void;
37
- }
38
- /** Shots between two states of a player, a u8 counter that wraps. */
39
- export declare const fired: (a?: PlayerState, b?: PlayerState) => number;
40
- /** What the katana's sounds read of a player: the swing, the cut and whether it is in hand. */
41
- type Blade = Pick<PlayerState, 'swing' | 'cut' | 'wield' | 'blade' | 'fists' | 'heavy' | 'charge' | 'down' | 'railed' | 'ammo' | 'reload' | 'rifled' | 'hot' | 'hits'>;
42
- /**
43
- * The CUT of a swing that started between two states of a player, or -1: `swing` jumped up (it
44
- * only counts down), or the cut changed under a running one.
45
- */
46
- export declare const swung: (a?: Blade, b?: Blade, xeno?: boolean) => number;
47
- /**
48
- * Whether the step from a to b is the strike of its cut: `swing` went down through the strike tick
49
- * (CUTS; the xenomorph's, `xeno`, TAILS).
50
- */
51
- export declare const struck: (a?: Blade, b?: Blade, xeno?: boolean) => boolean;
52
- /** The pitch of a player's voice: the woman's higher, and each a little off the next by his id. */
53
- export declare const voiceOf: (id: number, body?: number) => number;
54
- /**
55
- * A death worth a cry of pain rather than a groan (the user, 2026-11-17): a katana's cut that took
56
- * a limb, a fall hard enough to hurt (the speed a frame before the landing), or a hit of 3 or more
57
- * (a grenade, a charged shot). `was` is the life and vertical speed a frame before.
58
- */
59
- export declare const dreadful: (was: {
60
- life: number;
61
- vy: number;
62
- }, p: PlayerState) => boolean;
63
- export declare const createCombat: (world: World, audio: Pick<Audio, "play"> & Partial<Pick<Audio, "loop">>, hud: Pick<Hud, "vitals" | "hit" | "down">, fx: Pick<Effects, "fire" | "cut" | "wound" | "lie" | "quake" | "blow" | "punch">, tracer: Pick<Tracer, "flash" | "burst" | "impact" | "blast" | "orbs" | "update" | "mount" | "crackle" | "laser" | "charging" | "lightning" | "tesla">, ctl: {
64
- pitch: number;
65
- }, balls: Pick<Balls, "fire" | "frame">,
66
- /** The muzzle of a runner's long gun as last drawn, from his feet (Renderer.muzzle()). */
67
- drawn?: (id: number) => Vec3 | undefined,
68
- /** The pitch of a player's voice (voiceOf()). */
69
- voice?: (id: number) => number,
70
- /** A player's BODY: his death cries' voice. */
71
- bodyOf?: (id: number) => number | undefined,
72
- /** Whether a player is a xenomorph: its own cries, its acid, its hiss at a tail's charge, its shriek at a dash. */
73
- beast?: (id: number) => boolean,
74
- /** Whether a player fires the Hunter's harpoon rather than a plasma ball. */
75
- hunter?: (id: number) => boolean) => Combat;
76
- export {};
1
+ export type { Combat, View } from './combat/types';
2
+ export { dreadful, fired, sight, struck, swung, voiceOf } from './combat/events';
3
+ export * from './combat/create';
@@ -10,7 +10,7 @@ export declare const WELL_HOLE: number[];
10
10
  * The gun's battery (the user, 2026-11-08), built once: a gunmetal cell in the grip, along its own
11
11
  * forward from its foot, which stands out under the lower shell with a band of glow round it.
12
12
  */
13
- export declare const battery: (lod: number) => number[];
13
+ export declare const battery: (lod: number, bronze?: boolean) => number[];
14
14
  export declare const cells: number[][];
15
15
  /**
16
16
  * The rail gun's cell (the user, 2026-11-08: its batteries in view), built once for each of 9 steps
@@ -0,0 +1,7 @@
1
+ import type { Hud } from './types';
2
+ /**
3
+ * Appends the HUD to `screen`, whose stylesheet has HUD_CSS. `play` is the title screen's button:
4
+ * the click that starts the game (the panel takes its other clicks, the view round it plays too).
5
+ * `recast`: what the pause menu's Character opens instead of the panel's part (the whole-page screen).
6
+ */
7
+ export declare const createHud: (screen: HTMLElement, play?: () => void, quit?: () => void, recast?: () => void) => Hud;
@@ -0,0 +1,2 @@
1
+ export declare const rim: () => [number, number][];
2
+ export declare const HUD_CSS: string;
@@ -0,0 +1,26 @@
1
+ import type { PlayerState, Rover } from '../../shared/types';
2
+ /**
3
+ * What E does for a player on foot: 'drive' near a rover whose wheel is free, 'ride' when only the
4
+ * seat beside it is, or when he carries a flag (a carrier does not drive), 'fly' near a ship that
5
+ * is there and has no pilot (a carrier does not fly), '' with no free seat in reach, seated or
6
+ * down. The nearest vehicle with a seat for him counts, as the room judges it (nearby(), free()).
7
+ */
8
+ export declare const boarding: (me: Pick<PlayerState, "x" | "y" | "z" | "mode" | "down"> | undefined, rovers: readonly Rover[], carrying?: boolean) => "" | "drive" | "ride" | "fly";
9
+ /** The speed-o-meter's reading of a rover: whole km/h over the ground. */
10
+ export declare const kmh: (r: Pick<Rover, "vx" | "vz">) => number;
11
+ /** The warning of the nearest limit once one is within its last half of WARN, or ''. */
12
+ export declare const warning: (up: number, out: number) => string;
13
+ /** The ship's height on its panel: metres under the edge of space, kilometres in orbit. */
14
+ export declare const height: (alt: number) => string;
15
+ /** Milliseconds a banner stays, and a hit marker. */
16
+ export declare const BANNER_MS = 2800;
17
+ /** Milliseconds an own frag's name and award stay, and a line of the kill feed; the feed's lines. */
18
+ export declare const FRAG_MS = 2400;
19
+ export declare const FEED_MS = 6000;
20
+ export declare const FEED_MAX = 5;
21
+ /** The radio screen's canvas, pixels a side, and the seconds it stays after its line. */
22
+ export declare const COMM = 192;
23
+ export declare const COMM_TAIL = 0.5;
24
+ export declare const HIT_MS = 140;
25
+ /** m:ss. */
26
+ export declare const clock: (s: number) => string;
@@ -0,0 +1,2 @@
1
+ /** The HUD's elements, as createHud() appends them to the screen. */
2
+ export declare const MARKUP: string;
@@ -0,0 +1,29 @@
1
+ /** The menu of a game paused by Escape (the user, 2026-11-12): play on, then the two parts of the title screen it opens, then leave. */
2
+ export declare const PAUSE: string[];
3
+ /** The tabs of the title screen's menu, the first one shown first. */
4
+ export declare const TABS: string[];
5
+ /** The Audio panel's sliders (the user, 2026-11-20): a name, and its bus in LEVELS (audio.ts). */
6
+ export declare const MIXES: [name: string, bus: number][];
7
+ /** The characters' first names (the user, 2026-11-11: names, not "man" and "woman"), in BODY's order, and the size of the character's picture in pixels. */
8
+ export declare const CAST: string[];
9
+ export declare const SHOT: number[];
10
+ /** The size of a haircut's picture, pixels. */
11
+ export declare const HEAD_PX = 112;
12
+ /** The haircuts of each body, in HAIRS_N's order: the man's by length (LENGTHS, soldier.ts), the woman's STYLE (hair.ts). */
13
+ export declare const HAIR_NAMES: string[][];
14
+ /** The classes, in ROLE's order (kit.ts): the name, what it is good at, what it pays for it, and where it plays. */
15
+ export declare const ROLES: [name: string, pros: string, cons: string, where: string][];
16
+ /** A skin tone (TONES, linear) as a CSS colour. */
17
+ export declare const swatch: (t: number[]) => string;
18
+ /** Capture the flag in a few lines, with the room's default rules. */
19
+ export declare const GOAL: string[];
20
+ /**
21
+ * The controls of the title screen, a group each: the caps of a row split by `|` (a `+`, `/`, `or`
22
+ * or `twice` between them stays text), what they do, and the KeyboardEvent.codes the row tells,
23
+ * which together must be all of input.ts's CODES.
24
+ */
25
+ export declare const CONTROLS: [group: string, rows: [keys: string, does: string, codes?: string][]][];
26
+ /** Seconds the way out is shown after sitting down. */
27
+ export declare const OUT_HINT = 4;
28
+ /** The prompt of a glory kill on offer, drawn pulsing. */
29
+ export declare const GLORY_ACT = "glory kill";
@@ -0,0 +1,148 @@
1
+ import type { Result } from '../../shared/protocol';
2
+ import type { Choice, Snapshot } from '../../shared/types';
3
+ import type { Mark } from '../marks';
4
+ /** What the end screen shows: the final captures and what each player did. */
5
+ export interface Summary {
6
+ score: [number, number];
7
+ players: Result[];
8
+ }
9
+ export interface Hud {
10
+ /**
11
+ * The title screen with `status` on its button, "Click to play" or why not; '' hides it. `name`,
12
+ * `tag` and `lore` are the map's (WorldDef).
13
+ */
14
+ title(status: string, name: string, tag?: string, lore?: string): void;
15
+ /**
16
+ * Whether the player has been in the game: then the title screen opens on the pause menu (PAUSE)
17
+ * rather than the whole panel, until he plays again. `fresh`: he has not played yet (he comes from
18
+ * the character screen), its first button reads Play.
19
+ */
20
+ paused(on: boolean, fresh?: boolean): void;
21
+ /**
22
+ * The character on the title screen: `pick` is told the whole choice (the body, the skin, the
23
+ * haircut, the class) each time the player changes a part of it. Returns the canvas of his live
24
+ * picture (SHOT pixels).
25
+ */
26
+ cast(pick: (c: Choice & {
27
+ body: number;
28
+ }) => void, preview?: (active: boolean) => void): HTMLCanvasElement;
29
+ /** Shows the loader over the character portrait while its deferred render is pending. */
30
+ previewLoading(loading: boolean): void;
31
+ /** The pictures of the haircuts on offer, in their order (HEAD_PX square): the own head with each. */
32
+ heads(): HTMLCanvasElement[];
33
+ /** The own player's magazines, as his class holds them (Kit's mag, cap, clip): the spare ones counted by them. */
34
+ magazines(sizes: number[]): void;
35
+ /** Shows or hides the muted mark. */
36
+ mute(on: boolean): void;
37
+ /**
38
+ * The score and the clock at the top, and under them the state of both flags: at home, taken by
39
+ * a player (`who` gives his name) or dropped with the seconds left. Over, the clock reads END.
40
+ */
41
+ match(m: Pick<Snapshot, 'score' | 'clock' | 'over' | 'flags'>, who: (id: number) => string): void;
42
+ /** The markers of this frame (see marks.ts), in the order given; the ones before are removed. */
43
+ marks(list: Mark[]): void;
44
+ /** The orbital station's mission line (mission.ts), `hot` when urgent; none hides it. */
45
+ mission(text?: string, hot?: boolean): void;
46
+ /**
47
+ * The Hunter's current local vision mode, `text` empty for the plain view; with `hint`, the V key
48
+ * is shown with it, blinking in the plain view.
49
+ */
50
+ hunterVision(text?: string, scoped?: boolean, hint?: boolean): void;
51
+ /** The Predator-style shoulder-laser sight, at a screen point and progressing to a lock. */
52
+ hunterAim(at?: [number, number], progress?: number, now?: number): void;
53
+ /** The dark rim of a space helmet's visor around the screen: on while the own player wears one, off otherwise. */
54
+ visor(on: boolean): void;
55
+ /** The red vignette of a tackle, 0 (none) to 1 (full). */
56
+ hurt(level: number): void;
57
+ /** The orbital strike's light over the view, 0 (none) to 1 (all white), over the down screen. */
58
+ glare(level: number): void;
59
+ /**
60
+ * The health as pips out of HP_MAX, and the weapon in hand: the ammo counter with the gun glyph,
61
+ * the katana glyph when `wield` (or when it is all there is), or the rail gun's lightning left
62
+ * (charge(), 99 full) with the gun glyph in violet when `railed`. -1 ammo is no gun, `blade` is a
63
+ * katana carried, `rail` the rail gun's lightning (-1 none); two or more carried show their slots (1 gun, 2 katana, 3 rail gun)
64
+ * over the glyph, none hides it. `loaded` is what the battery or the capsule of the gun in hand
65
+ * holds, in the same count: big, with the rest after it as the magazines it makes (an open one for
66
+ * a part) over its count; faded while `swapping` it. `rifle` is the
67
+ * laser rifle's rounds (-1 none), shown with the glyph in red when `rifled` (slot 4), with the
68
+ * `nades` left in its launcher as dots after the count, hollow for the ones spent. `armor` shows
69
+ * as gold pips after the health's, only the ones he has.
70
+ */
71
+ 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,
72
+ /** The Hunter's pistol is in hand: `ammo` and `loaded` are its own. */
73
+ sided?: boolean,
74
+ /**
75
+ * The Hunter's other gun, out of hand: his harpoon's bolts when `sided`, else his pistol's
76
+ * shots; -1 when he has not found it.
77
+ */
78
+ other?: number): void;
79
+ /** The health the own player's class has at most (Kit.hp): as many pips. */
80
+ life(max: number): void;
81
+ /** A hit marker on the crosshair for a moment: a ball or a cut of the own player hit. */
82
+ hit(): void;
83
+ /** The face over the health, frame `n` of face.ts (-1 hides it). */
84
+ face(n: number): void;
85
+ /**
86
+ * The own player's character (BODY): the face is hers when she is the woman. `c` is what the
87
+ * roster says he picked, shown chosen on the title screen, and `roles` the classes the map offers
88
+ * (ROLE): the others are hidden.
89
+ */
90
+ wear(body: number, c?: Choice, roles?: number[]): void;
91
+ /**
92
+ * A saber lock: the gauge of the tug of war under the crosshair, with `lead` the own side's, -1
93
+ * (the foe wins) to 1 (he wins); undefined hides it.
94
+ */
95
+ duel(lead: number | undefined): void;
96
+ /** The state of being down: `level` 0 (up) to 1 hides or greys the screen, `left` seconds till the respawn. */
97
+ down(level: number, left: number, what?: string): void;
98
+ /** A line in the middle of the top of the screen in `team`'s colour, for a few seconds; a newer one replaces it. */
99
+ banner(text: string, team?: number): void;
100
+ /** The own frags this match, top left. */
101
+ frags(n: number): void;
102
+ /**
103
+ * Under the banner for FRAG_MS: `text` ("Bob killed!", '' for none) and the announcer's `award`
104
+ * in gold under it; a newer one replaces both.
105
+ */
106
+ fragged(text: string, award?: string): void;
107
+ /**
108
+ * A line of the kill feed, top right: `by` put `who` down, each [name, team] in his team's
109
+ * colour. The newest at the bottom, FEED_MAX at most, each gone after FEED_MS.
110
+ */
111
+ feed(by: [string, number], who: [string, number]): void;
112
+ /**
113
+ * An ally on the radio: the small screen with `name` in `team`'s colour opens for `s` seconds
114
+ * (and COMM_TAIL more), a newer one taking its place, and shows his `face` (COMM pixels square)
115
+ * as a scrambled transmission with bad reception (signal.ts), static alone without one.
116
+ */
117
+ comm(name: string, team: number, s: number, face?: CanvasImageSource): void;
118
+ /**
119
+ * The rover: `act` is what E does now ('drive', 'ride', 'get out', GLORY_ACT which pulses; '' hides the prompt), and
120
+ * `speed` the km/h shown at the wheel, where the gun and the crosshair then hide; undefined off it.
121
+ */
122
+ rover(act: string, speed?: number): void;
123
+ /** The camera out of the head for a glory kill (killcam.ts): the crosshair, the gun and the visor's rim go. */
124
+ outside(on: boolean): void;
125
+ /** The rover's reticle, where its lasers cross: `at` on screen in [0, 1] from the top left; undefined hides it. */
126
+ aim(at?: [number, number]): void;
127
+ /** The ship flown: its missiles and height, and how near its limits are (limits(), ship.ts); undefined hides it. */
128
+ ship(s?: ShipPanel): void;
129
+ /**
130
+ * A vehicle's health, of VEHICLE.HP: `own` in pips for who is seated in it (undefined on foot),
131
+ * and `near` as a small bar over a vehicle close by, `at` on screen in [0, 1] from the top left.
132
+ */
133
+ hull(own?: number, near?: {
134
+ hp: number;
135
+ at: [number, number];
136
+ }): void;
137
+ /** The end screen with the result and each player's captures, frags and returns, `next` seconds before the next match; undefined hides it. */
138
+ end(sum: Summary | undefined, next: number): void;
139
+ }
140
+ /** What the ship's panel shows. */
141
+ export interface ShipPanel {
142
+ nades: number;
143
+ /** Metres over the crater's floor. */
144
+ alt: number;
145
+ /** limits(): the ceiling's and the edge's nearness, 1 at the limit. */
146
+ up: number;
147
+ out: number;
148
+ }