@korial29/tiny-fps 1.16.0 → 1.18.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.
- package/dist/assets/{room-CVIx5hx8.js → room-84qRjTTp.js} +21 -19
- package/dist/brick-Ba93nQNN.js +1 -0
- package/dist/index.js +6 -6
- package/dist/landfall-Gm6gWQeg.js +21 -0
- package/dist/local.js +1 -1
- package/dist/paint-D82HAPtH.js +4 -0
- package/dist/room.js +1 -1
- package/dist/server.js +1 -1
- package/dist/stone-CIuE5Aan.js +1 -0
- package/dist/{textures-BkEnQMsT.js → textures-C5wfst_O.js} +1 -1
- package/dist/tranquility-nE0CyPui.js +1 -0
- package/dist/types/client/announce.d.ts +1 -1
- package/dist/types/client/gait/moves.d.ts +1 -1
- package/dist/types/client/moonbase/console.d.ts +3 -0
- package/dist/types/client/moonbase/constants.d.ts +6 -1
- package/dist/types/client/moonbase/kit.d.ts +2 -0
- package/dist/types/client/moonbase/mirror.d.ts +11 -0
- package/dist/types/client/moonbase/round.d.ts +14 -0
- package/dist/types/client/render/scene.d.ts +2 -0
- package/dist/types/client/render/shader.d.ts +4 -3
- package/dist/types/client/satellite.d.ts +1 -1
- package/dist/types/client/station/hull.d.ts +9 -0
- package/dist/types/shared/moonbase.d.ts +1 -1
- package/dist/types/shared/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/brick-BSIQdeSz.js +0 -1
- package/dist/landfall-DqMPx3EL.js +0 -21
- package/dist/paint-Ck7ZtE7l.js +0 -4
- package/dist/stone-Bdq5eUwO.js +0 -1
- package/dist/tranquility-CtgYmGVn.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{$ as e,$n as t,$t as n,An as r,Bn as i,Cn as a,Et as o,Fn as s,Hn as c,I as l,J as u,K as d,Kn as f,Ln as p,Mn as m,Nn as h,On as g,Ot as _,Pn as v,Qn as y,Qt as b,Sn as x,Tn as S,Tt as C,U as w,Un as T,Ut as E,V as D,Vn as ee,X as te,Y as ne,Z as re,Zn as ie,Zt as ae,_n as O,_t as oe,ar as k,bn as se,ct as ce,dt as le,en as ue,er as de,et as fe,fr as A,ft as pe,gn as j,gt as me,hn as he,ht as ge,jn as _e,kn as ve,lt as ye,m as be,mn as xe,mt as Se,or as M,pn as Ce,pr as we,pt as Te,q as Ee,qn as De,rr as Oe,sr as ke,st as Ae,tn as je,ur as N,vn as Me,vt as Ne,wn as Pe,wt as Fe,yn as Ie,yt as Le}from"./brick-Ba93nQNN.js";var P=125,[Re,ze]=k,{METAL:F,STEEL:Be,PAINT:Ve,WOOD:He,STONE:Ue,GRATE:We}=we,Ge=[1,.42,.08],I={sea:0,shore:30,trees:90,east:110,cape:-6,water:0},L={east:I.trees+5,cape:I.cape-4},R={r:7,sunk:2,sections:[[6,36],[44,74],[82,106]],axis:[4,6.25,7.5],spine:2.5,skin:.85},Ke=e=>{let t=Math.max(1-e*e/(R.r*R.r),0);return Math.max(R.r*Math.sqrt(Math.sqrt(t*Math.sqrt(t))),e>0?R.spine:0)},qe=[-4,-2.05,-1.75,0,1.95,2.25,3.6,5,5.5,6,6.5,7],Je=[-1.75,2.25,R.r],Ye=(qe.map(e=>[e,Ke(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]]}]),Xe={floor:R.axis[1]+Ye[1].floor,ceil:R.axis[1]+qe[1],half:4.525,x:R.sections[1],door:Ye[1].tears[0],lintel:qe[1]-Ye[1].floor,walls:[],way:2.4},Ze={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]},Qe=[[38.5,150.3,2.7,19,.78],[4.5,137,2.5,9]],$e=[60,219,4],et=1.25,tt=[[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]],nt=(e,t,r)=>{let i=t=>n(e,t,151),a=2*i(1)-1,[o,s]=[(1-a*a)/(1+a*a),2*a/(1+a*a)],c=r-E(r),[l,u]=[t*(.85+.3*i(2)),t*(.6+.3*i(3))],d=E(r)+.7*r,f=[4,8].map(e=>{let[t,n,r]=[2*i(e)-1,.35*i(e+1),2*i(e+2)-1],a=Math.sqrt(t*t+n*n+r*r);return[t/a,n/a,r/a,.7+.2*i(e+3)]}),p=e=>{let t=(e[0]*o+e[2]*s)/l,n=(e[2]*o-e[0]*s)/u,r=e[1]/c,[i,a,d]=[t*t*t*t,r*r*r*r,n*n*n*n];return .25/Math.sqrt(Math.sqrt(i+a+d))+.75/Math.sqrt(Math.sqrt(Math.sqrt(i*i+a*a+d*d)))},m=t=>{if(t[1]<0){let e=Math.sqrt(t[0]*t[0]+t[2]*t[2]);return e<1e-6?d:Math.min(m([t[0]/e,0,t[2]/e])/e,d/-t[1])}let n=p(t);for(let[e,r,i,a]of f){let o=t[0]*e+t[1]*r+t[2]*i;if(o>.001){let t=a*p([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*ue(1.3*t[0]+e,1.3*t[2]+1.1*t[1],e+3))};return{reach:m}},rt=Array.from({length:28},(e,t)=>[I.trees+3*n(t,1,7),134+4*t+2*n(t,2,7),.22+.1*n(t,3,7)]),it=e=>Math.min(Math.max(e,0),1),at=e=>it(e)*it(e)*(3-2*it(e)),ot=(e,t)=>Math.sqrt(e*e+t*t),st=[[57,132,61,138,Xe.floor-.95],[56,171,66,175,1.3],[44,209,76,229,et]],ct=[1.5,1.2],lt=(e,t)=>{let n=Math.abs(t-P),{shore:r,trees:i}=I,a=e>r?2.5*(e-r)/(i-r):(e-r)/10;a+=.9*at((e-46)/24)*(ue(e/13,n/13,5)-.45)*at((n-14)/10),a+=at((e-r)/14)*(1-at((e-102)/8))*(ct[1]*it(1-Math.abs(n-12)/5)-ct[0]*(1-at((n-2)/7))),a+=1.8*it(1-ot(e-110,n)/9);for(let[t,r,i,o,s]of st){let c=ot(Math.max(t-e,e-i,0),Math.max(r-P-n,P+n-o,0));a=s+(a-s)*at((c-6)/6)}return a},ut=(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(lt(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},z=(e,t,n,r,i,a,o,s)=>({min:[e,t,n],max:[r,i,a],top:o,side:o,...s?{tint:s}:{}}),dt=e=>({...e,ghost:!0}),ft=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===Re?ze:e.tint}:{}}),pt=([e,t,n])=>[e,t,250-n],mt=(e,...t)=>[...e,...e.map(pt),...t],B=[],ht=[],V=(e,t,n)=>(e.push({kind:t,min:n.min,max:n.max}),dt(n)),gt=(e,t,n,r)=>{let i=[0,.25,.5,.75,1].flatMap(i=>[0,.25,.5,.75,1].map(a=>ut(e+(n-e)*i,t+(r-t)*a)));return[Math.max(...i),Math.min(...i)]},H=(e,t,n,r,i,a,o,s)=>{let[c,l]=gt(t,n,r,i);return V(B,e,z(t,l-.5,n,r,Math.round(32*(c+a))/32,i,o,s))},U=e=>[(e.min[0]+e.max[0])/2,e.max[1],(e.min[2]+e.max[2])/2],_t=(e,t,n,r,i,a,o,s=0)=>{let c=[],l=t,u=(o,s,l)=>{let[u,d]=[Math.max(o,t),Math.min(s,n)];if(d>u&&l<a)for(let[t,n]of l>0?[[-a,-l],[l,a]]:[[-a,a]])c.push(V(ht,e,z(u,r,P+t,d,i,P+n,e==`deck`?We:F)))};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},vt=R.axis.map(e=>e+R.r),yt=R.sections.slice(1).map(([e],t)=>{let n=R.sections[t][1],[r,i]=gt(n,123.5,e,126.5),a=Math.round(32*(Math.max(r,I.water)+1.875))/32;return{x:(n+e)/2,top:a,heap:z(n,i-.5,123.5,e,a,126.5,Be,Ge)}}),bt=R.sections.flatMap(([e,t],n)=>[n&&[e,e+1],n<2&&[t-1,t]].filter(e=>e).map(e=>{let[t,r]=e,i=R.axis[n],a=Math.round(16*Ke(Ye[n].floor))/16-R.skin;return z(t,i+Ye[n].floor,P-a,r,i+qe[1],P+a,F)})),xt=[36,74].flatMap(e=>{let[t,n]=gt(e,128,e+1.2,130.5),r=z(e,n-.5,128,e+1.2,Math.round(32*(t+1.4))/32,130.5,Be);return[r,ft(r)]}),St=z(.5,-.3,121,5,.4,129,F),Ct=[...Ye.flatMap(({cut:e,floor:t,holes:n,tears:r,fair:i,crates:a},o)=>{let s=R.axis[o],c=[t,...qe.filter(e=>e>t+.5)];return[...e.flatMap(([e,a,o,l=R.skin])=>{let u=e=>Math.round(16*o*Ke(e))/16;return[..._t(`deck`,e,a,s-R.r,s+t,u(t),[]),...c.slice(1).flatMap((d,f)=>{let p=c[f],m=Je.indexOf(d),h=d<R.r?u(m<0?(p+d)/2:d):o*R.spine,g=p<Je[0]?t:p<Je[1]?Je[0]:Je[1];return[...m<0?_t(`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):_t(`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<=Je[1]?i.flatMap(([t,n,r])=>_t(`fairing`,Math.max(t,e),Math.min(n,a),s+p,s+d,R.r+r,[],h)):[]]})]}),...a.map(([e,n])=>{let r=s+(Je[n]??t);return V(ht,`crate`,z(e,r,124.25,e+1.5,r+[1,1.4,2][n+1],125.75,He))})]}),...yt.map(e=>V(ht,`heap`,e.heap)),...xt.map(e=>V(ht,`frame`,e)),...bt.map(e=>V(ht,`jam`,e)),V(ht,`raft`,St),dt(z(L.east,-10,L.cape-2,L.east+2,40,250-L.cape+2,Ue))],wt=e=>.6-.45*e/47.5,Tt=(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])},Et=Array.from({length:6},(e,t)=>{let[n,r,i,,a]=Qe[0],o=n-7.5+2.5*t,s=r+a*(o+1.25-n);return H(`fallen`,o,s-i-.2,o+2.5,s+i+.2,3.5,F,t?void 0:Ge)}),Dt=[...[U(Et[3]),[Qe[1][0]-1.5,1.3,Qe[1][1]+3.5]].flatMap(([e,t,n])=>[[e,t,n,42,1.3,7],[e,t,250-n,42,1.3,7]]),...R.sections.flatMap(([e,t],n)=>[n&&e-.6,n<2&&t+.6].filter(e=>e).map(e=>[+e,R.axis[n]+4.2,125,28,.9,4]))],Ot=[.55,2.3],kt=(()=>{let[e,t,n,r]=Qe[1];return V(B,`engine`,z(e-n,-5,t-r/2,e+n,1.4,t+r/2,F,Ge))})(),At=[V(B,`float`,z(16,-1.6,141,22,.35,144,F)),V(B,`float`,z(10,-.2,138,13,.5,141,F)),V(B,`float`,z(23,-1.6,132.6,26,.2,135,F))],jt=V(B,`pod`,z($e[0]-3,.75,$e[1]-3,$e[0]+3,4.25,$e[1]+3,F)),Mt=V(B,`dais`,z($e[0]-2,.75,$e[1]-10,$e[0]+2,1.3,$e[1]-6,Ve,Re)),Nt=(e,t,n=.4,r)=>H(`crate`,e-1.5,t-1.5,e+1.5,t+1.5,n,He,r),Pt=(e,t)=>[z(e-2.6,4.85,t-2.1,e+2.6,5,t+2.1,Ve,Re),...[-1,1].flatMap(n=>[-1,1].map(r=>z(e+2.5*n-.1,.75,t+2*r-.1,e+2.5*n+.1,4.85,t+2*r+.1,Be)))].map(e=>V(B,`shelter`,e)),[Ft,It]=[Nt(49,221),Nt(71,221)],[Lt,Rt]=[Nt(84,185,.4,Re),Nt(33,153,.4,Re)],zt=H(`panel`,67,184.5,70.5,188,.65,F),Bt=H(`container`,68.5,176,71.1,182,1.875,F,Ge),Vt=H(`gear`,68.6,170.6,71,173,2.9,Be,[.95,.75,.1]),Ht=H(`container`,64,164.5,67.5,168,2.6,F,Ge),Ut=H(`gear`,67.6,169.6,72,170.6,1.2,Be),W={camp:[Nt(76,213),Nt(40,217)],west:[H(`panel`,44.5,191.5,47.5,194.5,.5,F),H(`container`,33,173.7,39,176.3,2.2,F,Ge),H(`panel`,41,163.5,44,166.5,.4,F),H(`panel`,25.5,159.5,28.5,162.5,.5,F),H(`panel`,50.5,139.5,53.5,142.5,.4,F),H(`container`,49.5,132.4,52.5,135,2.6,F,Ge)],east:[H(`panel`,62.5,145.5,65.5,148.5,.4,F),Nt(80,171),Nt(85.5,165),Nt(84,153),H(`panel`,84.5,135.5,87.5,138.5,.4,F)],cover:[H(`panel`,78,156.6,83,157,2.6,F),H(`panel`,30,166.6,35,167,2.2,F),H(`container`,76,190,82,192.6,2.6,F,Ge)]},Wt=(e,t,n,r,i,a)=>{let{reach:o}=nt(i,n,r),s=gt(e-.8*n,t-.8*n,e+.8*n,t+.8*n),c=ut(e,t)+E(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])},d=(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)]},f=[],[p,m]=[n<5?1:n<8?2:3,r<5?1:r<12?2:3];for(let r=s[1]-.5;r<l-.3;r+=m){let i=Math.min(r+m,l);for(let o=-1.5*n;o<1.5*n;o+=p){let n=[.1,.5,.9].flatMap(e=>[Math.max(r,s[1])+.05,i].map(t=>d(o+p*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&&f.push([e+o,r,s,e+o+p,i,c])}}}return f},Gt=tt.map(([e,t,n,r,i])=>({at:[e,ut(e,t),t],R:n,H:r,s:i,parts:Wt(e,t,n,r,i,250-L.cape)})),Kt=[...Ze.pieces.flatMap(([e,t,n,r,i,a],o)=>{let s=(e,t=n)=>P+R.r+Ye[1].fair[1][2]+Ze.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=Ze.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]=[Ze.trail,Ze.lead].map(e=>Math.round(8*(Tt(e,u)+d))/8),[m,h]=[o,o+1].map(n=>s(e+(t-e)*n/l)),g=r+(i-r)*o/(l-1);return V(B,`wingpiece`,z(f,g-wt(u),m,p,g,h,F))}),...u?Ze.rails.map(t=>{let n=Math.min(u[4],r);return V(B,`rail`,z(t-.225,n-.45,s(u[1],u[2]),t+.225,n,s(e),Be))}):[]]}),...Et,kt,...At,jt,Mt,Ft,It,...Pt(49,221),...Pt(71,221),Lt,Rt,zt,Bt,Vt,Ut,Ht,...Object.values(W).flat(),...rt.map(([e,t,n])=>{let r=ut(e,t);return dt(z(e-n,r-1,t-n,e+n,r+9,t+n,He))}),...Gt.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>dt(z(e,t,n,r,i,a,Ue))),dt(z(-60,-10,250-L.cape,L.east+2,40,250-L.cape+2,Ue))],qt={hull:R.sections.map(([e,t],n)=>[e,t,R.axis[n]]),pieces:[...ht,...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:[...Gt,...Gt.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])}))]},Jt=[46,54,62,70].flatMap(e=>[[e,et,226,0],[e+4,et,229,0]]),Yt=e=>{let t=t=>e?t:pt(t);return{base:t(U(Mt)),spawns:e?Jt:Jt.map(([e,t,n])=>[e,t,250-n,Math.PI]),rack:t(U(Ft)),blade:t(U(It)),rifle:t(U(Lt)),rail:t(U(Rt))}},Xt=[79,222],Zt=[70.5,R.axis[1]+Je[1],128],Qt={navy:[.09,.12,.25],leather:[.26,.21,.18],carpet:[.2,.22,.33],red:[.4,.07,.06],green:[.08,.2,.1],tan:[.45,.31,.16]},$t={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:[...Kt,...Kt.map(ft),...Ct],tints:Object.values(Qt),teams:[Yt(!0),Yt(!1)],packs:mt([U(W.camp[0]),U(W.west[2]),U(W.west[4]),U(At[0]),U(W.east[3])],...yt.map(({x:e,top:t})=>[e,t,P])),ammo:mt([U(zt),U(Bt),U(Vt),U(W.west[0]),U(W.west[1]),U(W.west[3]),U(W.east[0]),U(W.east[1]),U(W.east[4])],[51,Xe.floor,P],[67,Xe.floor,P]),cells:mt([U(W.camp[1]),U(Ht),U(At[1]),U(W.east[2]),Zt],[59,Xe.floor,P]),vests:mt([U(kt)],[63,vt[1],P]),rovers:[[Xt[0],et,Xt[1],0],[Xt[0],et,250-Xt[1],Math.PI]],floor:-1.4,water:I.water,fires:Dt.map(([e,t,n,,r])=>[e,t,n,.6*r+Ot[0],Ot[1]]),relief:{hole:[0,0,0,0],bound:[56,P,100,185],cell:4,origin:[0,1],at:lt},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`},G={DROP:1.3,H:2.6,R:1.6,BODY:[4.8,0,-4.8],HITS:[4.5,0,-4.5],HIT:2.6,ACC:24,STRAFE:14,LIFT:16,BOOST:1.7,VMAX:48,DRIFT:.25,HOLD:1.5,HOVER:3,SKID:3,TURN:4,YRATE:1.9,PRATE:1.5,RESP:8,PMAX:1.25,BANK:.4,SLIDE:.3,RMAX:.8,RRESP:5,CEIL:p.TOP,EDGE:.88,WARN:20,PUSH:3,BRAKE:4,OVER:12,ENTER_R:6,ENTER_H:4,GUN_COOL:6,GUN_RANGE:160,GUN_AIM:80,MISSILES:4,MISSILE_COOL:30,RELOAD:300,MISSILE_SPEED:60,CRASH:12,CRASH_HP:4,BOUNCE:.3},en=[[-2.6,-.2,-.9],[2.6,-.2,-.9]],tn=[[-3.4,-.7,-2.9],[3.4,-.7,-2.9]],nn=[[.9,-2.7,-5.3,.14,-.12],[2.6,-2.6,-5.5,.12,-.1],[6.4,-4.9,-6.1,-.7,-.78]],rn=/* @__PURE__ */ new Map,an=e=>{let t=rn.get(e);if(t)return t;let n=e<nn[1][0]?0:1,[r,i]=[nn[n],nn[n+1]],a=(e-r[0])/(i[0]-r[0]),o=r.map((e,t)=>e+(i[t]-e)*a);return rn.set(e,o),o},on=.1,sn=[.9,2.6,3.9,5.15,6.4].slice(1).map((e,t,n)=>{let r=t?n[t-1]:.9,[i,a]=[an(r),an(e)];return[[r,e+on],[Math.min(i[4],a[4])-on,Math.max(i[3],a[3])+on],[Math.min(i[2],a[2])-on,Math.max(i[1],a[1])+on]]}),cn=[[1.4,3.2,1.1],[3.2,5.8,.75]],ln=.4,un=5.6,dn=.8,fn=Math.max(...G.BODY.map(e=>Math.abs(e)+G.DROP+G.R),un+Math.abs(an(un)[4])+Math.max(Math.abs(an(un)[1]),Math.abs(an(un)[2]))+dn),pn=[[3.2,0],[4.8,0],[6.4,-1],[6.4,1]],mn=[0,.05,-.2],hn=G.R+.9,K=1/60,gn=Math.fround,{sin:_n,cos:vn,min:q,max:J,abs:yn,sqrt:bn}=Math,xn=(e,t,n)=>q(J(e,t),n),Sn=`x y z vx vy vz yaw pitch roll wy wp wr steer`.split(` `),Cn=e=>{let[t,n,r,i,a,o]=[_n(e.yaw),vn(e.yaw),_n(e.pitch),vn(e.pitch),_n(e.roll),vn(e.roll)],s=[n,0,-t],c=[t*r,i,n*r];return[[s[0]*o-c[0]*a,s[1]*o-c[1]*a,s[2]*o-c[2]*a],[c[0]*o+s[0]*a,c[1]*o+s[1]*a,c[2]*o+s[2]*a],[-t*i,r,-n*i]]},wn=/* @__PURE__ */ new WeakMap,Y=(e,t,n,r)=>{let[i,a,o]=(e=>{let t=wn.get(e);if(t&&t.yaw===e.yaw&&t.pitch===e.pitch&&t.roll===e.roll)return t.axes;let n={yaw:e.yaw,pitch:e.pitch,roll:e.roll,axes:Cn(e)};return wn.set(e,n),n.axes})(e);return[e.x+i[0]*t+a[0]*n+o[0]*r,e.y+i[1]*t+a[1]*n+o[1]*r,e.z+i[2]*t+a[2]*n+o[2]*r]},Tn=(e=[])=>e.map(([e,t,n,r])=>({x:gn(e),y:gn(t+G.DROP),z:gn(n),vx:0,vy:0,vz:0,yaw:gn(oe(r)),pitch:0,roll:0,wy:0,wp:0,wr:0,steer:0,driver:255,rider:255,ship:!0,hp:Oe.HP,wreck:0,nades:G.MISSILES})),En=e=>{let[t,n]=[G.BODY[0],G.BODY[2]].map(t=>Y(e,0,-G.DROP,t));return{a:t,b:n,r:G.R,h:G.H}},Dn=e=>[-1,1].flatMap(t=>cn.map(([n,r,i])=>{let[a,o]=[n,r].map(n=>{let[,r,i,,a]=an(n);return Y(e,t*n,a-.05,(r+i)/2)});return{a,b:o,r:i,h:ln}})),On=e=>e<=p.SEAM?e:p.SEAM*(p.ALT/p.SEAM)**(Math.min(e-p.SEAM,p.TOP-p.SEAM)/(p.TOP-p.SEAM)),kn=(e,t)=>{let n=(e.y-G.CEIL+G.WARN)/G.WARN,r=An(e,t);return[J(0,n),r?J(0,(r[0]-r[1]+G.WARN)/G.WARN):0]},An=(e,t)=>{if(!t.relief)return;let[n,r,i,a]=t.relief.bound,[o,s]=[e.x-n,e.z-r],c=bn(o*o+s*s);if(!c)return[0,G.EDGE*q(i,a),1,0];let[l,u]=[o/c,s/c];return[c,G.EDGE/bn(l*l/(i*i)+u*u/(a*a)),l,u]},jn=(e,t,n,r,i)=>{let a=i;for(let i of C(e,t,n,G.R)){let{min:o,max:s}=e.def.brushes[i];t>o[0]-G.R&&t<s[0]+G.R&&n>o[2]-G.R&&n<s[2]+G.R&&o[1]>r&&o[1]<a&&(a=o[1])}return a},Mn=(e,t,n=!0)=>{let r=n?[t[0]-e.x,t[1]-e.y,t[2]-e.z]:t;return Cn(e).map(e=>e[0]*r[0]+e[1]*r[1]+e[2]*r[2])},Nn=[-1,1].flatMap(e=>sn.map(([t,n,r])=>[e>0?t:[-t[1],-t[0]],n,r])),Pn=(e,t=!0)=>{let[n,r]=[e&N.LEFT,e&N.RIGHT];return n&&!r?M.LEFT:r&&!n?M.RIGHT:t&&e&N.FORWARD?M.THRUST:M.SLASH},Fn=(e,n=O)=>{let i=n[e.cut??0],a=n===y,o=a?de:ve;return e.heavy?{...i,ticks:Math.round((i.ticks-i.hold)*o),strike:Math.round((i.strike-i.hold)*o),reach:i.reach+(a?t:h),arc:i.arc*r,hp:i.hp+_e}:i},In=(e,t,n,{reach:r,arc:i}=Fn(t))=>{let[a,o]=le(t.yaw),s=[t.x,t.y+.7*Se(t),t.z];return n.filter(n=>{let[c,l]=[n.x-t.x,n.z-t.z],u=Math.hypot(c,l);return!(u-.4>r||t.y>=n.y+Se(n)||n.y>=t.y+Se(t))&&(u>.4?Math.abs(Math.atan2(a*l-o*c,a*c+o*l)):0)<=i+(u>.4?Math.asin(.4/u):Math.PI)&&!Fe(e,s,[n.x,n.y+.7*Se(n),n.z])})},Ln=(e,t,n)=>{let[r,i]=le(e.yaw),o,s=Pe;for(let c of t){let[t,l]=[c.x-e.x,c.z-e.z],u=Math.hypot(t,l),d=u<.001||Math.acos(Math.min(1,(t*r+l*i)/u))<=x;!c.down&&!c.lock&&c.mode!==A.RIDE&&(n?!Fe(n,[e.x,e.y+1.3,e.z],[c.x,c.y+1.3,c.z]):c.hp<=a)&&u<=s&&Math.abs(c.y-e.y)<1.8&&d&&([o,s]=[c,u])}return o},Rn=e=>{if(e.mode===A.GROUND){if(e.cut===M.LUNGE){let[t,n]=le(e.yaw);e.vx=13*t,e.vz=13*n,e.dash=60,e.ev|=ke.DASH}else e.cut===M.LEAP&&(e.vy=s,e.ev|=ke.JUMP)}},zn=(e,t,n,r,i=!0,a=[],o=_[0])=>{Bn=!1;let s=Hn(e,t,n,r,i,a,o);return Bn&&Vn(e),s},Bn=!1,Vn=e=>{[e.ammo,e.side,e.mag,e.sideMag]=[e.side??-1,e.ammo,e.sideMag??0,e.mag??0]},Hn=(e,t,n,r,i,a,o)=>{let s=e.down>0,c=!s&&(e.lock??0)>0,l=e.exec?se.TICKS:S,u=!e.wield||e.exec===se.KILLER;if(c&&u&&e.lock>l-20&&(e.vx||e.vz)?(Ae(e,n,a),e.ev=e.lock==l?ke.DASH:0,e.lock<=l-20+1&&(e.vx=e.vz=0)):ge(e,s||c?{...t,keys:0}:t,n,r,a,o),e.hp=Math.min(e.ev&ke.RESPAWN?o.hp:e.hp,o.hp),e.heat=Math.max(0,(e.heat??0)-(e.zapping?0:e.hot?1:2)),e.hot=!!e.hot&&e.heat>0,e.zapping=!1,e.zap=!!e.stun&&!!e.zap,(s||c)&&(e.burst=0),s)return e.down>0&&!--e.down&&Ne(e,n,r,o),0;if(c)return Kn(e,t);let d=!!(t.keys&N.FIRE)&&!e.pressed;e.pressed=!!(t.keys&N.FIRE);let f=t=>n.def.teams.some(n=>!!n[t]&&((e,t)=>{let[n,r]=[e.x-t[0],e.z-t[2]];return n*n+r*r<1.44&&Math.abs(e.y-t[1])<1})(e,n[t])),p=o.gear;p||([e.ammo,e.rail,e.rifle,e.blade,e.nades]=[-1,-1,-1,!1,0]);let h=o.hunter,g=f(`rack`)||!!h&&f(`blade`);h&&(e.nades=0,e.clip=Math.max(0,(e.clip??0)-1),e.rifle=(e.rifle??-1)>=0?0:-1,(e.rail??-1)>=0&&(e.cap=Math.min(e.cap??o.cap,o.cap),e.rail=Math.min(e.rail,90),e.cap>=o.cap?e.rail=0:e.rail>1?e.rail--:(e.cap++,e.rail=e.cap<o.cap?90:0))),i&&p&&g&&!e.rack&&(h&&f(`rack`)?[e.side,e.sideMag]=[60,15]:[e.ammo,e.mag]=[o.ammo,o.mag]),e.rack=g,e.blade=!!o.katana||!!e.blade||i&&p&&f(`blade`);let _=f(`rail`);i&&p&&_&&!e.inRail&&([e.rail,e.cap]=[h?0:o.rail,o.cap]),e.inRail=_;let b=f(`rifle`);i&&p&&b&&!e.inRifle&&(h?[e.rifle,e.clip]=e.rifle<0?[0,0]:[e.rifle,e.clip]:[e.rifle,e.clip,e.nades]=[o.rifle,o.clip,3]),e.inRifle=b,e.ammo=Math.min(e.ammo,o.ammo),e.side=h?Math.min(e.side??-1,60):-1,e.sideMag=Math.min(e.sideMag??0,Math.max(e.side,0),15),e.rail=e.rail===void 0?e.rail:Math.min(e.rail,o.rail),e.rifle=e.rifle===void 0?e.rifle:Math.min(e.rifle,o.rifle),[e.mag,e.cap,e.clip]=[Math.min(e.mag??0,o.mag),Math.min(e.cap??0,o.cap),h?e.clip:Math.min(e.clip??0,o.clip)],e.cool=Math.max(0,e.cool-1),e.lob=Math.max(0,(e.lob??0)-1);let x=e.mode===A.HANG||e.mode===A.CLIMB||e.mode===A.SWIM,C=o.xeno?y:O,{ticks:w,hold:E}=C[e.cut??0],D=!!e.swing&&!e.heavy&&w-e.swing===E,ee=i&&!x,te=!!(t.keys&(o.xeno?N.BLADE:N.FIRE));if(o.xeno&&D&&!ee)[e.swing,e.charge]=[0,0];else if(D&&ee&&te&&(e.wield||o.xeno))e.charge=Math.min((e.charge??0)+1,m);else if(D&&ee&&(e.charge??0)>=v)[e.heavy,e.charge]=[!0,o.xeno?e.charge:0],e.swing=Fn(e,C).ticks;else if(o.xeno&&D&&ee&&!te&&(e.charge??0)>0)e.charge=0,e.swing=w-E-1;else{e.charge=D||o.xeno&&!e.heavy?0:e.charge;let t=e.swing??0,n=Fn(e,C),r=T[e.cut??0]??T[0];e.swing=Math.max(0,o.haste>1&&(i=>i==t-1&&(i==n.ticks-n.strike||i==r.ticks-r.strike||!e.heavy&&i==w-E))(t-1)?t-1:t-o.haste),e.heavy=!!e.swing&&!!e.heavy,e.charge=o.xeno&&!e.heavy?0:e.charge}o.xeno&&D&&ee&&!te&&e.heavy&&e.cut===ie.LEAP&&e.mode===A.GROUND&&(e.vy=10,e.ev|=ke.JUMP),e.mag=Math.min(e.mag??0,Math.max(e.ammo,0));let ne=[e.ammo>=0,!!e.blade,(e.rail??-1)>=0,(e.rifle??-1)>=0,e.side>=0],re=h&&t.keys&N.FISTS?4:t.keys&N.BLADE?1:t.keys&N.RAIL?2:t.keys&N.RIFLE?3:0,ae=p&&!h&&!!(t.keys&N.FISTS)&&!(e.swing&&e.wield),oe=h&&ne[1]?1:ne.indexOf(!0),k=e.swing&&e.wield?1:ae?-1:ne[re]?re:oe;k!=(e.fists?-1:e.sided?4:e.rifled?3:e.railed?2:+!!e.wield)&&(e.reload=0),e.swing&&k>=0&&!e.wield&&(e.swing=0),[e.wield,e.railed,e.rifled,e.fists,e.sided]=[k==1,k==2,k==3,ae,k==4],k==4&&(Vn(e),Bn=!0);let ce=h&&k==0;if(!i)return[e.charge,e.reload]=[o.xeno?e.charge:0,0],0;let[le,ue,de,fe]=k==3?[`clip`,o.clip,e.rifle,96]:k==2?[`cap`,o.cap,e.rail,90]:[`mag`,k==4?15:o.mag,e.ammo,78],[pe,me]=[e[le]??0,Math.min(ue,de)];e.reload?--e.reload||(e[le]=me):k>=0&&k!=1&&(!h||k!=2)&&!x&&pe<me&&(!pe||t.keys&N.RELOAD)&&([e.reload,e.charge]=[fe,0]);let he=k<0,_e=o.xeno?Fn(e,y):he?T[e.cut??0]??T[0]:Fn(e);if(e.swing&&_e.ticks-e.swing===_e.strike)return 2;if(o.xeno)return Gn(e,t,d,x),0;(he||e.wield&&!D||e.railed||e.rifled||x||e.reload||!e.wield&&!e.mag)&&(e.charge=0);let ve=!(k!=0&&k!=4||ce||x||e.reload||e.charge||!e.mag);if(e.burst=ve?e.burst??0:0,ve&&!e.cool&&(e.burst||t.keys&N.SPECIAL))return e.burst=(e.burst||3)-1,e.power=1,e.ammo--,e.mag--,e.shots=e.shots+1&255,e.cool=e.burst?Math.ceil(o.cool/2):Math.min(15,2*o.cool),1;if(e.railed&&!h&&t.keys&N.SPECIAL&&!x&&!e.reload&&!e.hot&&e.cap>=De)return e.rail-=De,e.cap-=De,[e.heat,e.hot]=[120,!0],e.shots=e.shots+1&255,7;if(e.rifled&&t.keys&N.SPECIAL&&!x&&e.nades&&!e.lob)return e.nades--,[e.lob,e.cool]=[60,7],e.shots=e.shots+1&255,5;if(e.wield&&t.keys&N.SPECIAL&&!x&&!e.swing)return e.cut=t.keys&N.FIRE?Pn(t.keys,!o.hunter)+4:(t.keys&(N.LEFT|N.RIGHT))===N.LEFT?M.ARC_L:M.ARC_R,[e.swing,e.charge]=[O[e.cut].ticks,0],Rn(e),0;if(t.keys&N.FIRE&&!x){if(he)e.swing?d&&e.cut<j.HOOK&&_e.ticks-e.swing>_e.strike&&(e.cut++,e.swing=T[e.cut].ticks):(e.cut=(e=>e.mode===A.SLIDE||e.dash>50)(e)||e.mode===A.GROUND&&t.keys&N.SPRINT&&e.vx*e.vx+e.vz*e.vz>o.run*o.run?j.LUNGE:j.JAB,[e.heavy,e.swing]=[!1,T[e.cut].ticks]);else if(e.wield&&!e.swing)e.cut=Pn(t.keys,!o.hunter),[e.swing,e.charge]=[O[e.cut].ticks,0],Rn(e);else if(e.rifled&&h){if(!e.clip)return e.clip=120,e.shots=e.shots+1&255,6}else if(e.rifled){if(!e.cool&&e.clip&&!e.reload)return e.rifle--,e.clip--,e.cool=o.rifleCool,e.shots=e.shots+1&255,4}else if(e.railed&&h){if(!e.cool&&e.cap)return e.cool=15,e.cap--,e.rail=90,e.shots=e.shots+1&255,3}else if(e.railed){if(e.cap&&!e.reload&&!e.hot)return e.heat=(e.heat??0)+1,e.hot=e.heat>=120,e.cool||=(e.rail--,e.cap--,2),e.zapping=!0,3}else if(!e.wield&&!e.cool&&e.mag&&!e.reload){if(ce)return e.power=1,e.ammo--,e.mag--,e.charge=0,e.cool=o.cool,e.shots=e.shots+1&255,1;e.charge=Math.min((e.charge??0)+1,60)}}else if(e.charge)return e.power=Math.min(Yn(e.charge),e.mag),e.charge=0,e.ammo-=e.power,e.mag-=e.power,e.shots=e.shots+1&255,e.cool=o.cool,1;return 0},Un=[1.2,.7],Wn=(e,t,n,r)=>{let[i,a,o,s]=[Math.cos(n),Math.sin(n),Math.cos(t),Math.sin(t)],c=[0,1,2].map(t=>r[t]-e[t]),l=-c[0]*s*i+c[1]*a-c[2]*o*i,u=c[0]*o-c[2]*s,d=c[0]*s*a+c[1]*i+c[2]*o*a;return l>0&&Math.abs(u)<Un[0]*l&&Math.abs(d)<Un[1]*l},Gn=(e,t,n,r)=>{if(r)return;let i=y[e.cut??0],a=e.cut===j.CLAW_L||e.cut===j.CLAW_R,o=!!(t.keys&N.BLADE),s=i.ticks-(e.swing??0),c=o&&!!(t.keys&N.SPECIAL)&&!!e.swing&&!a&&!e.heavy&&(e.cut??0)<4&&s<i.strike;if(o&&(!e.swing&&!e.charge||c)){let n=Pn(t.keys);e.cut=t.keys&N.SPECIAL?n===M.LEFT||n===M.RIGHT?ie.SPIN:ie.LEAP:n;let r=!(t.keys&N.DASH);[e.heavy,e.swing,e.charge]=r?[!1,y[e.cut].ticks-y[e.cut].hold,1]:[!1,y[e.cut].ticks,0]}else t.keys&N.FIRE&&(!e.swing||n&&a&&i.ticks-e.swing>i.strike)&&(e.cut=e.cut===j.CLAW_L?j.CLAW_R:j.CLAW_L,[e.heavy,e.swing]=[!1,y[e.cut].ticks])},Kn=(e,t)=>{if(e.exec)return Jn(e);let n=!!(t.keys&N.FIRE);return e.pushes=(e.pushes??0)+ +(n&&!e.pressed)&255,e.pressed=n,e.away=t.keys&(N.LEFT|N.RIGHT|N.BACK)?Math.min((e.away??0)+1,24):0,e.lock=Math.max(1,e.lock-1),[e.wield,e.swing,e.charge]=[!!e.blade,0,0],0},qn=e=>!!e.lock&&!e.exec,Jn=e=>{e.lock=Math.max(1,e.lock-1),e.away=e.pushes=0;let t=se.TICKS-e.lock,n=se.CUTS.indexOf(t),r=e.exec===se.KILLER&&!!e.wield;return e.cut=r&&n>=0?[M.THRUST,M.SLASH][n]:e.cut,e.swing=r&&n>=0?O[e.cut].ticks:Math.max(0,(e.swing??0)-1),[e.wield,e.charge,e.heavy]=[r,0,!1],0},Yn=e=>e<10?1:1+Math.floor(4*(e-10)/50),Xn=(e,t=0,n=!1)=>{let[r,i]=e.rifled?(a=e.shots,[f*Math.sin(2.4*a),f*Math.cos(1.7*a)]):[0,0];var a;let[o,s]=[e.yaw+r,e.pitch+i],[c,l,u,d]=[Math.sin(o),Math.cos(o),Math.sin(s),Math.cos(s)];return{id:e.shots,by:e.id,team:t,x:e.x,y:e.y+ce(e),z:e.z,dx:-c*d,dy:u,dz:-l*d,left:e.rifled?60:n?90:80,burst:!1,power:e.rifled?0:n?8:e.power??1}},Zn=(e,t=0)=>({...Xn({...e,rifled:!1},t),power:9,left:28}),Qn=(e,t=0)=>({...Xn(e,t),id:128^e.shots,left:xe,power:1,arc:e.cut}),$n=e=>e.arc?he:e.power===9||e.power===10?52:e.power===8?600:e.power===6?120:e.power===0?400:80,er=(e,t,n,r,i)=>{let[a,o]=[e[0]-n.x,e[2]-n.z],s=t[0]*t[0]+t[2]*t[2],c=a*t[0]+o*t[2],l=c*c-s*(a*a+o*o-r*r),[u,d]=[0,1/0];if(s>1e-12){if(l<0)return 1/0;[u,d]=[(-c-Math.sqrt(l))/s,(-c+Math.sqrt(l))/s]}else if(a*a+o*o>r*r)return 1/0;let[f,p]=[n.y-e[1],n.y+i-e[1]];if(t[1])[u,d]=[Math.max(u,Math.min(f/t[1],p/t[1])),Math.min(d,Math.max(f/t[1],p/t[1]))];else if(f>0||p<0)return 1/0;return u<=d&&d>=0?Math.max(u,0):1/0},tr=(e,t=0)=>({...Xn({...e,rifled:!1},t),left:150,power:7,v:36}),nr=e=>!e.wield&&(e.lob??0)>53,rr=(e,t,n)=>{let r=Math.fround,[a,s,l]=[t.dx*t.v,t.dy*t.v-(t.missile?0:Te(e))/60,t.dz*t.v],u=Math.sqrt(a*a+s*s+l*l)||1;[t.dx,t.dy,t.dz,t.v]=[r(a/u),r(s/u),r(l/u),r(u)];let d=((e,t,n,r)=>{let a=[t.x,t.y,t.z],s=[t.dx,t.dy,t.dz],l=Math.min(n,t.left),u=t.power===9||t.power===10,d=u?Me:t.power===8?g:i,f=e.def.seam!==void 0&&s[1]?(e.def.seam-a[1])/s[1]:1/0,p,m=o(e,a,s,f>1e-6?Math.min(l,f):l,d);for(let e of r){let n=er(a,s,e,c+(t.arc?Ce:u?Ie:d),Se(e));n<m&&([m,p]=[n,e])}return t.burst=m<l,t.left-=m,[t.x,t.y,t.z]=[a[0]+s[0]*m,a[1]+s[1]*m,a[2]+s[2]*m],p})(e,t,t.v/60,n);return[t.x,t.y,t.z,t.left]=[r(t.x),r(t.y),r(t.z),r(t.left)],t.burst||=t.left<=0,d},X={A:1.25,B:1,WR:.5,L0:.6,CMAX:.5,K:30,D:2,KP2:1.2,KR2:.7,HC:.7,ENGINE:12,VMAX:23.2,VREV:8,BRAKE:14,ROLL:.6,HB:6,BOOST:10,VBOOST:34,MU:1.1,MUL:1.2,HBG:.35,HBY:1.5,SK:2.5,SV:10,SMAX:.55,SRATE:3.5,YMAX:2.4,YRESP:10,AK:5,AC:3,AD:.5,TILT:.9,RB:1.05,BODY:[1.15,0,-1.15],BODY_H:1.5,WHEEL_STEP:.6,BOUNCE:.3,CRASH:10,CRASH_HP:3,ENTER_R:3,SPLAT_MIN:6,SPLAT_KILL:12,GUN_COOL:8,GUN_RANGE:90,GUN_AIM:50},ir=[[-1.05,.18,.6],[1.05,.18,.6]],ar=[[-.45,-.35,.1],[.45,-.35,.1]],or=[1,1,-1,-1].map(e=>e*X.A),sr=[-1,1,-1,1].map(e=>e*X.B),cr=X.L0+X.WR,lr=X.RB+c+.15,ur=`x y z vx vy vz yaw pitch roll wy wp wr steer`.split(` `),Z=1/60,Q=Math.fround,{sin:dr,cos:fr,min:pr,max:mr,abs:hr,sqrt:gr}=Math,$=(e,t,n)=>pr(mr(e,t),n),_r=(e,t,n,r=0)=>{let[i,a]=le(e.yaw),[o,s]=[t*fr(e.pitch),n*fr(e.roll)];return[e.x+i*o-a*s,e.y+r+t*dr(e.pitch)-n*dr(e.roll),e.z+a*o+i*s]},vr=(e,t)=>or.map((n,r)=>{let[i,a,o]=_r(e,n,sr[r]);return[i,a,o,cr+ye(t,i,o,a-X.L0+X.WHEEL_STEP)-a]}),yr=(e,t)=>vr(e,t).map(([e,t,n,r])=>{let i=$(r,0,X.CMAX);return[e,t-X.L0+i,n,i]}),br=e=>X.BODY.map(t=>_r(e,t,0,-cr)),xr=e=>{if(e.ship)return En(e);let[t,,n]=br(e);return{a:t,b:n,r:X.RB,h:X.BODY_H}},Sr=e=>e.ship?(e=>[En(e),...Dn(e)])(e):[xr(e)],Cr=e=>{e.ship||([e.vx,e.vz]=[Q(e.vx*Oe.SKID),Q(e.vz*Oe.SKID)])},wr=(e,t)=>e.filter(e=>!(t.down&&e.wreck)).flatMap(Sr),Tr=e=>[...Er(e),...Tn(e.def.ships)],Er=e=>(e.def.rovers??[]).map(([e,t,n,r])=>({x:Q(e),y:Q(t+cr),z:Q(n),vx:0,vy:0,vz:0,yaw:Q(oe(r)),pitch:0,roll:0,wy:0,wp:0,wr:0,steer:0,driver:255,rider:255,hp:Oe.HP,wreck:0})),Dr=(e,t)=>{let[n,r]=[e.def.rovers?.length??0,e.def.ships?.length??0];return t<n?+(2*t>=n):+(2*(t-n)>=r)},Or=(e,t,n,r)=>{if(e.ship)return((e,t,n,r)=>{let i=((e,t,n)=>{let[r,i]=[Mn(e,t),Mn(e,n,!1)],a=1/0;for(let e of Nn){let[t,n]=[0,1/0];for(let a=0;a<3&&t<=n;a++){let[o,s]=e[a];if(yn(i[a])<1e-9){(r[a]<o||r[a]>s)&&(t=1/0);continue}let[c,l]=[(o-r[a])/i[a],(s-r[a])/i[a]];t=J(t,q(c,l)),n=q(n,J(c,l))}t<=n&&t<a&&(a=t)}return a})(e,t,n);for(let a of G.HITS){let o=Y(e,0,0,a),[s,c,l]=[t[0]-o[0],t[1]-o[1],t[2]-o[2]],u=s*n[0]+c*n[1]+l*n[2],d=u*u-(s*s+c*c+l*l-G.HIT*G.HIT);if(d<0)continue;let f=J(0,-u-bn(d));f<=r&&f<i&&(i=f)}return i<=r?i:1/0})(e,t,n,r);let i=pr(...br(e).map(([e,r,i])=>er(t,n,{x:e,y:r,z:i},X.RB,X.BODY_H)));return i<=r?i:1/0},kr=(e,t,n,r=[],i)=>{if(e.ship)return((e,t,n,r=[],i)=>{let a=t?t.keys:0,o=e=>a&e?1:0,s=o(N.FORWARD)-o(N.BACK),c=o(N.RIGHT)-o(N.LEFT),l=o(N.JUMP)-o(N.CROUCH),u=o(N.SPRINT)&&s>0?G.BOOST:1,d=e.steer<0;if(t){let n=oe(t.yaw-e.yaw+Math.PI)-Math.PI,r=xn(t.pitch,d?0:-G.PMAX,G.PMAX),i=q(1,G.RESP*K);e.wy+=(xn(G.TURN*n,-G.YRATE,G.YRATE)-e.wy)*i,e.wp+=(xn(G.TURN*(r-e.pitch),-G.PRATE,G.PRATE)-e.wp)*i}else e.wy*=1-q(1,G.RESP*K),e.wp=d?-G.TURN*e.pitch:e.wp*(1-q(1,G.RESP*K));e.wr=((d?0:xn(-G.BANK*e.wy+G.SLIDE*c,-G.RMAX,G.RMAX))-e.roll)*G.RRESP;let[f,p,m,h]=[_n(e.yaw),vn(e.yaw),_n(e.pitch),vn(e.pitch)],g=t?[-f*h*s*G.ACC*u+p*c*G.STRAFE,m*s*G.ACC*u+l*G.LIFT,-p*h*s*G.ACC*u-f*c*G.STRAFE]:[0,-Te(n),0],_=e.y-G.CEIL;g[1]>0&&(g[1]*=xn(-_/G.WARN,0,1)),_>0&&(g[1]-=G.PUSH*_,e.vy>0&&(e.vy*=1-q(1,G.BRAKE*K)));let v=An(e,n);if(v){let[t,n,r,i]=v,a=g[0]*r+g[2]*i,o=t-n;if(a>0){let e=1-xn(-o/G.WARN,0,1);g[0]-=a*r*e,g[2]-=a*i*e}if(o>0){g[0]-=G.PUSH*o*r,g[2]-=G.PUSH*o*i;let t=e.vx*r+e.vz*i;if(t>0){let n=t*q(1,G.BRAKE*K);e.vx-=n*r,e.vz-=n*i}}}let y=t?G.ACC/G.VMAX:G.DRIFT,b=y+(!t||s||c?0:G.HOLD),x=y+(!t||s||l?0:G.HOVER);if(e.vx+=(g[0]-e.vx*b)*K,e.vy+=(g[1]-e.vy*x)*K,e.vz+=(g[2]-e.vz*b)*K,d){let t=1-q(1,G.SKID*K);e.vx*=s||c?1:t,e.vz*=s||c?1:t}if(e.x+=e.vx*K,e.y+=e.vy*K,e.z+=e.vz*K,e.yaw=oe(e.yaw+e.wy*K),e.pitch=xn(e.pitch+e.wp*K,-G.PMAX,G.PMAX),e.roll+=e.wr*K,e.y=q(e.y,G.CEIL+G.OVER),v){let[t,r,i,a]=An(e,n);t>r+G.OVER&&(e.x-=i*(t-r-G.OVER),e.z-=a*(t-r-G.OVER))}let S=[e.vx,e.vy,e.vz],C=0;for(let t of G.BODY){let[r,i,a]=Y(e,0,-G.DROP,t);C=J(C,ye(n,r,a,i+.6)-i)}e.steer=0,C>0&&(e.y+=C,e.vy=J(e.vy,0),e.steer=e.vy>.5?0:-1);let w=0;for(let t of[-1,1])for(let[r,i]of pn){let[,a,o,,s]=an(r),[c,l,u]=Y(e,t*r,s,i<0?o:i>0?a:(a+o)/2);w=J(w,ye(n,c,u,l+1)-l)}w>0&&(e.y+=w,e.vy=J(e.vy,0));for(let t of G.BODY){let[r,i,a]=Y(e,0,-G.DROP,t),o=jn(n,r,a,i+.6,i+G.H);o<i+G.H&&(e.y-=i+G.H-o,e.vy=q(e.vy,0))}for(let t of G.BODY){let[r,i,a]=Y(e,0,-G.DROP,t),[o,s]=Le({x:r,y:i+.6,z:a},n,G.H-.6,G.R),c=o*o+s*s;if(c){e.x+=o,e.z+=s;let t=q(0,e.vx*o+e.vz*s)/c;e.vx-=t*o,e.vz-=t*s}}for(let t of[-1,1]){let[,r,i,,a]=an(un),[o,s,c]=Y(e,t*un,a,(r+i)/2),[l,u]=Le({x:o,y:s,z:c},n,ln,dn),d=l*l+u*u;if(d){e.x+=l,e.z+=u;let t=q(0,e.vx*l+e.vz*u)/d;e.vx-=t*l,e.vz-=t*u}}if(r.length){let[,t,n,,i]=an(un),a=[...G.BODY.map(e=>[0,-G.DROP,e,G.R,G.H]),[-5.6,i,(t+n)/2,dn,ln],[un,i,(t+n)/2,dn,ln]];for(let t of r)if(me(t,e.x,e.z,fn+t.r))for(let[n,r,i,o,s]of a){let[a,c,l]=Y(e,n,r,i),u=o+t.r;if(!me(t,a,l,u))continue;let[d,f,p]=pe(t,a,l),m=bn(d*d+f*f);if(m>=u-1e-4||p>=c+s||p+t.h<=c)continue;let[h,g]=m?[d/m,f/m]:[vn(e.yaw),-_n(e.yaw)];e.x+=h*(u-m),e.z+=g*(u-m);let _=q(0,e.vx*h+e.vz*g)*(1+G.BOUNCE);e.vx-=_*h,e.vz-=_*g}}ae(e,n);let T=bn((e.vx-S[0])**2+((e.vy-S[1])/2)**2+(e.vz-S[2])**2);i&&T>G.CRASH&&i(T),yn(e.roll)<1e-6&&(e.roll=0);for(let t of Sn)e[t]=gn(e[t]);return e.y<n.def.floor})(e,t,n,r.filter(t=>t!==e).flatMap(Sr),i);let{A:a,B:o,CMAX:s,K:c,D:l,KP2:u,KR2:d,HC:f,MU:p,MUL:m,TILT:h}=X,g=Te(n),_=t?t.keys:0,v=(_&N.FORWARD?1:0)-(_&N.BACK?1:0),y=_&N.JUMP,b=v>0&&_&N.SPRINT,[x,S]=le(e.yaw),[C,w]=[fr(e.pitch),fr(e.roll)],T=vr(e,n),[E,D,ee,te]=T.map(([,e,,t])=>t+e-cr),ne=T.some(e=>e[3]<-s),re=ne?0:(E+D-ee-te)/(4*a*C),ie=ne?0:(D+te-E-ee)/(4*o*w),O=1/gr(re*re+ie*ie+1),k=-(re*x-ie*S)*O,se=-(re*S+ie*x)*O,ce=()=>e.vx*k+e.vy*O+e.vz*se,ue=mr(0,...T.map(e=>e[3]-s));if(ue){e.y+=ue;let t=pr(0,ce());e.vx-=t*k,e.vy-=t*O,e.vz-=t*se}let de=ce(),[fe,A,j]=[0,0,0];T.forEach(([,,,t],n)=>{if(t>ue){let r=mr(0,c*(t-ue)-l*(de+(or[n]*C*e.wp-sr[n]*w*e.wr)*O));fe+=r,A+=r*or[n],j+=r*sr[n]}}),e.vx+=fe*k*Z,e.vy+=(fe*O-g)*Z,e.vz+=fe*se*Z,e.wp+=A/u*Z,e.wr-=j/d*Z;let he=pr(fe/g,2);if(he>0){let n=e.vx*x+e.vz*S,r=e.vz*x-e.vx*S,i=t?oe(t.yaw-e.yaw+Math.PI)-Math.PI:0,o=$(X.SK*i/(1+hr(n)/X.SV),-X.SMAX,X.SMAX),s=X.SRATE*Z;e.steer+=$((n+v<0?-o:o)-e.steer,-s,s);let c=$(n*e.steer/(2*a),-X.YMAX,X.YMAX)*(y?X.HBY:1);e.wy+=(c-e.wy)*X.YRESP*Z*pr(1,he);let l=g*he*Z,h=$((v*n<0?v*X.BRAKE:v*X.ENGINE*mr(0,1-hr(n)/(v>0?X.VMAX:X.VREV)))*Z,-m*l,m*l);b&&(h+=X.BOOST*$(1-n/X.VBOOST,0,1)*Z);let _=(X.ROLL+(y||!t?X.HB:0))*he*Z;h-=$(n+h,-_,_);let C=p*l*(y?X.HBG:1),w=-$(r,-C,C);e.vx+=h*x-w*S,e.vz+=h*S+w*x,e.wp+=h*f/u,e.wr-=w*f/d}else e.wp-=(X.AK*e.pitch+X.AC*e.wp)*Z,e.wr-=(X.AK*e.roll+X.AC*e.wr)*Z;e.wp*=1-X.AD*Z,e.wr*=1-X.AD*Z,e.x+=e.vx*Z,e.y+=e.vy*Z,e.z+=e.vz*Z,e.yaw=oe(e.yaw+e.wy*Z),e.pitch=$(e.pitch+e.wp*Z,-h,h),e.roll=$(e.roll+e.wr*Z,-h,h),hr(e.pitch)===h&&e.pitch*e.wp>0&&(e.wp=0),hr(e.roll)===h&&e.roll*e.wr>0&&(e.wr=0);let[ge,_e]=[e.vx,e.vz];for(let t of X.BODY){let[r,i,a]=_r(e,t,0,-cr),[o,s]=Le({x:r,y:mr(i,E,D,ee,te),z:a},n,X.BODY_H,X.RB),c=o*o+s*s;if(c){e.x+=o,e.z+=s;let t=pr(0,e.vx*o+e.vz*s)/c;e.vx-=t*o,e.vz-=t*s}}for(let t of r)if(t!==e)for(let n of Sr(t))for(let r of X.BODY){let[i,a,o]=_r(e,r,0,-cr),s=X.RB+n.r;if(!me(n,i,o,s))continue;let[c,l,u]=pe(n,i,o),d=gr(c*c+l*l);if(d>=s-1e-4||u>=a+X.BODY_H||u+n.h<=a)continue;let[f,p]=le(t.yaw),[m,h]=d?[c/d,l/d]:[-p,f];e.x+=m*(s-d),e.z+=h*(s-d);let g=pr(0,e.vx*m+e.vz*h)*(1+X.BOUNCE);e.vx-=g*m,e.vz-=g*h}ae(e,n);let ve=gr((e.vx-ge)**2+(e.vz-_e)**2);i&&ve>X.CRASH&&i(ve);for(let t of ur)e[t]=Q(e[t]);return e.y<n.def.floor},Ar=(e,t,n)=>{let[r,i,a]=t.ship?mn:ar[n];[e.x,e.y,e.z]=(t.ship?Y(t,r,i,a):_r(t,a,r,i)).map(Q),e.vx=t.vx,e.vy=t.vy,e.vz=t.vz},jr=(e,t,n,r,i,a=[],o)=>{let s=(n.keys&N.USE)!==0&&(e.held&N.USE)===0,l=kr(t,n,r,a,o);return zn(e,n,r,i,!1),e.mode===A.RIDE?(Ar(e,t,0),s&&((e,t,n,r)=>{t.driver=255,e.mode=A.AIR,e.t=0,e.coyote=0,[e.vx,e.vy,e.vz]=[t.vx,t.vy,t.vz];let i=t.ship?-hn:-lr,[a,o]=t.ship?[G.DROP,G.H]:[cr,X.BODY_H];for(let[n,s]of[[i,-a],[-i,-a],[0,o-a]]){let i=t.ship?mn[2]:ar[0][2],[a,o,l]=t.ship?Y(t,n,s,i):_r(t,i,n,s);Object.assign(e,{x:a,y:o,z:l}),ae(e,r);let u=ye(r,e.x,e.z,t.y);e.y=mr(o,u);let[d,f]=Le(e,r,ee,c);if(!n||u>o-1&&!d&&!f)break}[e.x,e.y,e.z,e.vx,e.vz]=[e.x,e.y,e.z,e.vx,e.vz].map(Q)})(e,t,0,r)):t.driver=255,l},Mr=(e,t)=>(e.x-t.x)**2+(e.z-t.z)**2,Nr=(e,t)=>{let[n,r]=e.ship?[G.ENTER_R,G.ENTER_H]:[X.ENTER_R,X.ENTER_R];return!e.wreck&&Math.abs(e.y-t.y)<=r&&Mr(e,t)<=n*n},Pr=(e,t)=>e.driver!==255||t?e.rider!==255||e.ship?-1:1:0,Fr=(e,t,n,r)=>{let[i,a,o,s]=[Math.sin(t),Math.cos(t),Math.sin(n),Math.cos(n)],c=[-i*s,o,-a*s],l=e.ship?G.GUN_RANGE:X.GUN_RANGE,u=r?r([e.x,e.y,e.z],c,l):1/0,d=u<l?mr(u,8):(e=>e.ship?G.GUN_AIM:X.GUN_AIM)(e);return[e.x+c[0]*d,e.y+c[1]*d,e.z+c[2]*d]},{A:Ir,B:Lr,WR:Rr,L0:zr}=X,Br=[[Ir,-Lr],[Ir,Lr],[-Ir,-Lr],[-Ir,Lr]],Vr=[.74,.75,.78],Hr=[.5,.52,.56],Ur=[.24,.25,.28],Wr=[.09,.095,.11],Gr=[.9,.62,.17,l],Kr=[.4,.41,.44],qr=[1,.95,.8],Jr=[1,.1,.06],Yr=[.3,.8,1],Xr=Rr-.025,Zr=Rr+.025,Qr=.15,$r=Rr+.1,ei=Lr-.2,ti=[.46,.42],ni=.42,ri=[.5,-.2,2.1],ii=[-.45,.3,.6],ai=2.5,oi=(e,t,n)=>[e,t,-n],si=(t,[n,r,i,a],o,s)=>{let[c,l]=[e(r,n),e(i,n)],u=d([c[1]*l[2]-c[2]*l[1],c[2]*l[0]-c[0]*l[2],c[0]*l[1]-c[1]*l[0]],s)<0,f=t.length;be(t,n,u?i:r,u?r:i,o),a&&be(t,n,u?a:i,u?i:a,o);for(let e=f+8;o[3]&&e<t.length;e+=10)t[e]=o[3]},ci=(t,n,r,i,a,o)=>{let s=[...n,...r],c=s.reduce(D).map(e=>e/s.length),l=(n,r)=>si(t,n,r,e(u(n[0],n[2],.5),c));n.forEach((e,t)=>{let a=(t+1)%n.length;l([e,n[a],r[a],r[t]],i[t%i.length])}),a&&l(n,a),o&&l(r,o)},li=(e,t,n,r,i)=>[oi(-t,n,e),oi(t,n,e),oi(r,i,e),oi(-r,i,e)],ui=e=>Ee(re([[1,0],[1,1]],e),[1,1,1]),di=ui(3),fi=ui(4),pi=(t,n,r,i,a,o)=>{let s=e(i,r);te(t,n,r,i,Math.abs(s[1])>Math.abs(s[0])?[1,0,0]:[0,1,0],1,a,o)},mi=-1.09,hi=[16,48,120,280,600,1100],[gi,_i]=[.08,-40],[vi,yi]=[[.64,.59,.48],[.3,.25,.15]],bi=[.1,.2,.12],xi=(e,t,n)=>Math.min(Math.max(e,t),n),Si=Ee(re([[0,-1],[1,0],[0,1]],4),[1,1,1]),[Ci,wi]=[72,17],Ti=/* @__PURE__ */ new WeakMap,Ei=e=>{let t=Ti.get(e);if(t)return t;let r=e.relief&&je(e.relief),[i,a,o,s,c]=r?[r.x0,r.z0,r.cell,r.nx,r.nz]:[I.sea,0,10,(I.east-I.sea)/10+1,26],l=hi.length,u=(e,t)=>[...hi.map(t=>e-t).reverse(),...Array.from({length:t},(t,n)=>e+n*o),...hi.map(n=>e+(t-1)*o+n)],[d,f]=[u(i,s),u(a,c)],[p,m]=[d.length,f.length],h=new Float64Array(p*m);for(let e=0;e<m;e++)for(let t=0;t<p;t++){let[n,a]=[xi(t-l,0,s-1),xi(e-l,0,c-1)],u=r?r.h[n+a*s]:I.water+.1*(i+n*o-I.shore);h[t+e*p]=Math.max(u-gi*Math.max(i-d[t],0),_i)}let g=(e,t)=>h[xi(e,0,p-1)+xi(t,0,m-1)*p],_=[],v=[];for(let e=0;e<m;e++)for(let t=0;t<p;t++){let[n,i,a]=[d[t],f[e],g(t,e)],[o,s]=[Math.max(t-1,0),Math.min(t+1,p-1)],[c,l]=[Math.max(e-1,0),Math.min(e+1,m-1)],u=r?fe([(g(o,e)-g(s,e))/(d[s]-d[o]),1,(g(t,c)-g(t,l))/(f[l]-f[c])]):[0,1,0],h=.92+.16*ue(n/11,i/11,5),y=xi((n-I.trees-2)/14,0,1),b=vi.map((e,t)=>(e+(yi[t]-e)*y)*h);_.push([n,r?a:I.water-.02,i,...u,b[0],b[1],-1.09,b[2]]),v.push([n,I.water+.05,i,0,1,0,I.water+.05-a,0,-5,0])}let y=[[],[]],x=r?.hole??[0,0,0,0];for(let e=0;e<m-1;e++)for(let t=0;t<p-1;t++){let[n,r,i,a]=[t+e*p,t+1+e*p,t+1+(e+1)*p,t+(e+1)*p];d[t]>=x[0]&&d[t+1]<=x[2]&&f[e]>=x[1]&&f[e+1]<=x[3]||y[0].push(..._[n],..._[i],..._[r],..._[n],..._[a],..._[i]),Math.min(h[n],h[r],h[i],h[a])<I.water+.05&&y[1].push(...v[n],...v[i],...v[r],...v[n],...v[a],...v[i])}if((e=>{let[t,n,r,i]=[28,I.sea-840,125,560],a=e=>{let n=e/t;return 70*(4*n*(1-n))**.7*(.45+.75*ue(5*n,3,9))},o=(e,o)=>[n-60*o,o?a(e):I.water-1,r+(e/t-.5)*i,.6,.8,0,bi[0],bi[1],-1,bi[2]];for(let n=0;n<t;n++)e.push(...o(n,0),...o(n+1,0),...o(n+1,1),...o(n,0),...o(n+1,1),...o(n,1))})(y[0]),r){let e={relief:r};((e,t)=>{let[r,i]=[I.shore+4,R.sections[2][1]];for(let a=0;a<Ci;a++){let o=e=>n(a,e,31),[s,c]=[r+(i-r)*o(1),3+(wi-3)*o(2)*o(2)];if(c<R.r+1.5&&R.sections.some(([e,t])=>s>e&&s<t))continue;let[l,u,d]=[125+(o(3)<.5?c:-c),.12+.3*o(4)*o(4),.03+.04*o(5)];ne(e,Si,[s,t(s,l)+.2*u,l],w(7*o(5),0),[0,0,0],[u*(.6+o(6)),.7*u,u],[d,d,d])}})(y[0],(t,n)=>b(e,t,n))}return Ti.set(e,y),y},Di=e=>Ei(e)[0],Oi=e=>Ei(e)[1],ki=`0.05+0.05*sin(T*.55+q.y*.13+4.*vn(q*.05))`,Ai=`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);}`,ji=e=>`{vec2 q=P.xz;float d=C.x-(${ki});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;}`,Mi=[(R.sections[1][0]+R.sections[1][1])/2,R.sections[2][1]-2],Ni=`{vec2 q=P.xz;float y=P.y-${I.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-(${ki});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-${Mi[0]}.)/26.,1.-abs(q.x-${Mi[1]}.)/14.),0.),\nwd=cz/(1.+1.2*smoothstep(${Mi[1]-14}.,${Mi[1]+6}.,q.x))+6.*vn(vec2(q.x*.06,q.y*.15))+30.\n-30.*smoothstep(8.,20.,q.x)*(1.-smoothstep(${Mi[1]+8}.,${Mi[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);}}}`,Pi=`c+=bw*k*(.02+.3*fr);`,Fi=-1.05,Ii=.25,Li=`{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.;}}`,Ri=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;}`,zi=`c+=hk*(mix(vec3(.8,.72,.56),k,smoothstep(-.3,.05,r.y))*(.06+.35*fr)+vec3(.15,.135,.105)*clamp(.5-m.y,0.,1.));`,Bi=-1.098,Vi=`{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{jr as $,ai as A,Je as At,Zr as B,rt as Bt,Hr as C,en as Ct,ni as D,Y as Dt,ei as E,kn as Et,Kr as F,R as Ft,X as G,wt as Gt,Rr as H,nt as Ht,Yr as I,qt as It,Pr as J,Fr as K,Ur as L,qe as Lt,Qr as M,Qe as Mt,qr as N,Dt as Nt,Wr as O,$t as Ot,ri as P,I as Pt,Tr as Q,Jr as R,tt as Rt,Ir as S,G as St,Xr as T,On as Tt,ii as U,Tt as Ut,Vr as V,Ze as Vt,ir as W,Ke as Wt,Dr as X,Mr as Y,Nr as Z,fi as _,Ln as _t,Li as a,er as at,pi as b,mn as bt,Ni as c,tr as ct,ji as d,rr as dt,Ar as et,Pi as f,Qn as ft,oi as g,zn as gt,di as h,qn as ht,Fi as i,yr as it,Gr as j,L as jt,$r as k,Qt as kt,mi as l,nr as lt,Di as m,Yn as mt,Ii as n,wr as nt,Bi as o,Zn as ot,Oi as p,Wn as pt,kr as q,zi as r,Or as rt,Vi as s,Xn as st,Ri as t,Cr as tt,Ai as u,$n as ut,ci as v,In as vt,Br as w,nn as wt,li as x,tn as xt,si as y,Fn as yt,ti as z,Ye as zt};
|
package/dist/room.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as MAPS, r as RULES, t as Room } from "./assets/room-
|
|
1
|
+
export { n as MAPS, r as RULES, t as Room } from "./assets/room-84qRjTTp.js";
|
package/dist/server.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,et as t,pr as n,r}from"./brick-Ba93nQNN.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{
|
|
1
|
+
import{pr as e}from"./brick-Ba93nQNN.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)]},u[e.FABRIC]=(e,t)=>{let[n,i]=[Math.floor(128*e),Math.floor(128*t)],a=+((n+i)%4<2),o=r(n,i,51),[l,u]=[n%16-7.5,i%16-7.5],d=+(Math.abs(Math.abs(l)+Math.abs(u)-4)<1.2);return[s([232,232,236],.78+.1*a+.08*o+.2*d),c(.3+.45*a+.2*o)]},u[e.HIDE]=(e,t)=>{let[n,i]=[Math.floor(128*e),Math.floor(128*t)],o=r(n>>2,i>>2,53),l=3&n&&3&i?0:1,u=a(4*e,4*t,4,3,55),[d,f]=[n%64,i%64],p=d<2||f<2;return[s([228,226,224],p?.55:(.82+.1*o-.08*l)*(.9+.2*u)*(d==4&&(3&i)<2||f==4&&(3&n)<2?1.15:1)),p?.1:c(.35+.35*o-.2*l+.2*u)]},u[e.HULL]=(e,t)=>{let n=2*e%1,r=Math.min(n,t,1-n,1-t)-.008,o=.6*a(4*e,4*t,4,3,51)+.4*i(64*e,64*t,64,53);return r<0?[[70,74,82],.15]:[s([172,177,186],1.01-.06*c(100*r)+.06*(e>.5)+.05*o),.8+.04*o]};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,A as t,Bt as n,F as r,Ft as i,Gt as a,H as o,Ht as s,I as c,It as l,J as u,K as d,Kt as f,Pt as p,Q as m,Qt as h,Rt as g,Ut as _,Vt as v,Wt as y,X as b,Y as x,Z as S,a as C,an as w,cn as T,d as E,dn as D,et as O,f as ee,fn as k,i as A,in as te,it as j,ln as ne,n as M,nn as re,nt as ie,o as ae,on as oe,pr as N,q as P,r as F,rn as se,s as ce,sn as le,t as ue,tn as de,un as fe,ur as pe,zt as I}from"./brick-Ba93nQNN.js";import{i as L}from"./textures-C5wfst_O.js";import{t as me}from"./stone-CIuE5Aan.js";var he=[.8,.82,.86],ge=[.35,.36,.4],_e=re.filter(e=>e.min[1]===2.48&&e.max[1]===4),[R,z]=se,ve=[R,0,z],B=22.4,ye=[-.6,.6,.53],be=[[2,1],[0,2],[0,1]],[xe,Se]=[-2.35,-2.4],Ce=[1.25,1.3,1.4],we=[.56,.48,.28],Te=[.04,.04,.05],{CONCRETE:Ee,HULL:De,PAINT:Oe}=N,[V,ke,H,U,Ae,je]=[[.86,.87,.9],[.55,.57,.6],[.32,.33,.36],[.07,.075,.085],[.42,.52,.66],[.2,.13,.08]],[Me,W,Ne,Pe,Fe,Ie]=[[.3,.8,1],[.35,1,.5],[1,.7,.25],[1,.2,.15],[.7,.35,1],[1,.35,.85]],Le=(e,t,n,r=1,[i,a]=be[1])=>{for(let o of[0,1,2,0,2,3])e.push(...t[o],...ye),typeof n==`number`?e.push(t[o][i],t[o][a],n,r):e.push(n[0],n[1],-2,n[2])},G=(e,t,n,r,i,a,o)=>Le(e,[[0,0],[1,0],[1,1],[0,1]].map(([e,a])=>{let o=[0,0,0],[s,c]=[(t+1)%3,(t+2)%3];return[o[t],o[s],o[c]]=[n,(e?i:r)[s],(a?i:r)[c]],o}),a,o,be[t]),Re=(e,{min:t,max:n,top:r,side:i},a=0)=>{for(let o=0;o<3;o++)G(e,o,t[o],t,n,i,a+(o==1?.4:1.25-.15*o)),G(e,o,n[o],t,n,o==1?r:i,a+(o==1?1.85:1.25-.15*o))},ze=(e,t)=>{let n=e.length;t();let r=ie(e,0);for(let t=n;t<e.length;t+=10){if(r[t+8]==-1){let e=2.2*(.72+.28*r[t+4]-.12*Math.abs(r[t+3]));r[t+6]*=e,r[t+7]*=e,r[t+9]*=e}[r[t+3],r[t+4],r[t+5]]=ye}},Be=(e,t,n,r)=>{let i=ie(e,0);for(let a=t;a<e.length;a+=10)[i[a+3],i[a+4],i[a+5],i[a+8]]=[n[0],n[1],n[2],r]},Ve=(e,t,n,r,i,a)=>{for(let[o,s,c]of[[r,r+.1,0],[i-.1,i,0],[r,i,a-.1]])G(e,t,n,[o,c,o],[s,a,s],Ce)},He=(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],G(e,t,n,d,f,Oe,o),c>i&&([d[1],d[2-t],f[2-t]]=[l,i,c],G(e,t,n,d,f,Oe,o))})},Ue=(e,t,n,r,i)=>{let a=Math.min(i,...n.map((e,n)=>(e-t[n])/3)),o=t.map((e,t)=>(e+n[t])/2),s=(e,r)=>[0,1,2].map(i=>{let o=e>>i&1,s=o?n[i]:t[i];return i==r?s:s+(o?-a:a)});for(let t=0;t<3;t++){let[n,i]=[1<<(t+1)%3,1<<(t+2)%3];for(let a of[0,1<<t])A(e,[a,a|n,a|n|i,a|i].map(e=>s(e,t)),r,o);let[a,c]=[(t+1)%3,(t+2)%3];for(let l of[0,n,i,n|i])A(e,[s(l,a),s(l,c),s(l|1<<t,c),s(l|1<<t,a)],r,o)}for(let t=0;t<8;t++)A(e,[s(t,0),s(t,1),s(t,2)],r,o)},We=(e,t,[n,r,i])=>e.push(...t,...ye,n,r,-2,i),Ge=(e,t,n,r,[i,a],o,s,c=12,l=0)=>{let u=l>0?c/2:c,d=Array.from({length:l>0?2*(u+1):c+1},(e,t)=>{let n=l>0?t<=u?1:-1:0,r=l>0?(t<=u?t:t-u-1)/u*Math.PI-Math.PI/2:t/c*2*Math.PI;return[n,n<0?Math.PI+r:r]});l>0&&d.push(d[0]);let f=([e,i],a)=>{let[o,s]=[e*l+Math.cos(i)*a,Math.sin(i)*a];return[0,1,2].map(e=>t[e]+n[e]*o+r[e]*s)};for(let t=0;t+1<d.length;t++){let[n,r]=[d[t],d[t+1]],c=[[f(n,i),o],[f(n,a),s],[f(r,a),s]];(i>0||n[0]!=r[0])&&c.push([f(n,i),o],[f(r,a),s],[f(r,i),o]);for(let[t,n]of c)We(e,t,n)}},[Ke,qe,Je]=[[.13,.135,.15],[.2,.205,.22],[.05,.05,.06]],Ye=[.62,.6,1.05],Xe=[.04,.04,.09],[Ze,Qe,$e]=[7,38*Math.PI/180,32*Math.PI/180],et=[[-.2,-.22,.2,-.2],[-.2,.2,.2,.22],[-.2,-.22,-.18,.22],[.18,-.22,.2,.22],[-.12,-.1,-.1,.1],[.1,-.1,.12,.1],[-.12,-.01,.12,.01],[-.02,.12,.02,.16],[-.02,-.16,.02,-.12],[.22,-.05,.25,.05]],tt=(e,t,[n,r,i,a],[o,s,c])=>{for(let[l,u]of[[n,r],[n,a],[i,a],[n,r],[i,a],[i,r]])e.push(l,t,u,0,1,0,o,s,-2,c)},nt=(()=>{let e=[];Ue(e,[.95,0,-.22],[1.35,.74,.22],Ke,.05);let t=e.length;Ue(e,[-.32,-.05,-.3],[.32,.03,.3],Ke,.03),tt(e,.032,[-.27,-.25,.27,.25],Ye.map(e=>.9*e));for(let t of et)tt(e,.034,[t[1],t[0],t[3],t[2]],Xe);for(let[t,n]of[[-.15,[.5,1,.6]],[0,Ye],[.15,[1,.7,.3]]])Ge(e,[-.322,-.01,t],[0,0,-1],[0,1,0],[0,.014],n.map(e=>2*e),n,8);return((e,t,n)=>{let[r,i]=[Math.cos(n),Math.sin(n)];for(let n=t;n<e.length;n+=10)for(let[t,a]of[[0,1],[3,0]]){let[o,s]=[e[n+t],e[n+t+1]];[e[n+t],e[n+t+1]]=[r*o-i*s+(a?1.1:0),i*o+r*s+(a?.86:0)]}})(e,t,$e),e})(),rt=[0,1,0],it=[.035,.037,.045],at=(e,t)=>e.map(e=>(e+(1-e)/3)*t),ot=[[-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]],st=(e,t,n,i,a,o)=>{let s=ie(e,0);for(let c=t;c<e.length;c+=10){let e=[0,1,2].map(e=>s[c+e]-n[e]),t=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];[s[c+3],s[c+4],s[c+5]]=O([0,1,2].map(n=>i[n]+o*(e[n]-t*i[n])/a)),s[c+8]=r}},ct=[[-j/4-Math.asin(fe[0][2]/B),-j/4+Math.asin(fe[0][2]/B),fe[0][3]],[-Math.acos((D[1].min[0]-R)/B),Math.asin((D[0].max[2]-z)/B),fe[1][3]]],lt=e=>e.filter((t,n)=>{let r=n-n%30;return Math.max(e[r],e[r+10],e[r+20])>-.49}),ut=lt(P(S([[1,0],[1,1]],12),he)),dt=lt(P(S([[1.06,0],[1.06,.3]],12),ge)),ft=({brushes:e},t)=>{let n=[];for(let r of e)r.ghost&&r.tint&&Re(n,r,2*Math.max(0,t.indexOf(`${r.tint}`)));let r=[];(e=>{[...T,...ot].forEach(t=>((e,[t,n,r,i,a,o,s,c])=>{let l=1&c?2:0,[u,d]=[[n,o,r],[i,s,a]],f=c<2?1:-1,p=(e,t,n)=>{let r=[0,o+t,0];return r[l]=(f>0?u[l]:d[l])+f*n,r[2-l]=u[2-l]+e,r},[h,g,_]=[d[2-l]-u[2-l],d[l]-u[l],s-o],v=(t,n,r)=>{let[i,a]=[p(t[0],t[1],t[2]),p(n[0],n[1],n[2])];M(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=.025)=>{let[a,o]=[p(t[0],t[1],t[2]),p(n[0],n[1],n[2])];Ue(e,a.map((e,t)=>Math.min(e,o[t])),a.map((e,t)=>Math.max(e,o[t])),r,i)},S=[0,0,0];S[2-l]=(l?1:-1)*f;let w=[0,1,0],T=(t,n,r,i,a,o=1.6,s=!0,c=8,l=0)=>{Ge(e,p(t,n,i+.004),S,w,[0,r],at(a,1.4*o),a.map(e=>e*o),c,l),s&&Ge(e,p(t,n,i+.001),S,w,[r,3*r],a.map(e=>.45*e),it,c,l)},E=(t,n,r,i,a,o,s=1)=>C(e,s,()=>A(e,[p(t,n,a),p(r,n,a),p(r,i,a),p(t,i,a)],o,p(t,n,a-1))),D=(e,t,n,r,i,a)=>{y([e,t,i-.06],[n,r,i],U,.025),E(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);E(e+.08,s-.025,e+.08+(n-e-.16)*(.4+(7*e+o)%4*.15),s,i+.01,a,1.1)}};t==le.CONSOLE?((e,t,n,r,i)=>{ze(e,()=>{let a=m(2,1,[1,1],[0,0]);b(e,a,[t,r,n],[t,r+.08,n],[1,0,0],1,1.48,qe),b(e,a,[t,r+.08,n],[t,r+.14,n],[1,0,0],1,.75,Ke),b(e,a,[t,r+.14,n],[t,r+.5,n],[1,0,0],1,.05,qe),b(e,a,[t,r+.5,n],[t,r+.6,n],[1,0,0],1,.22,Je);for(let a=0;a<Ze;a++){let o=i+Math.PI+(a-(Ze-1)/2)*Qe;ae(e,nt,[t,r,n],-o)}})})(e,(n+i)/2,(r+a)/2,o,c*Math.PI/2):ze(e,()=>{if(t==le.BENCH){y([0,_-.06,0],[h,_,g],V,.03),y([.05,0,0],[h-.05,_-.06,g-.06],ke,.04);for(let e=1.1;e<h-.5;e+=1.1)v([e-.01,.1,g-.06],[e+.01,_-.1,g-.05],U);for(let t=0;t<4;t++){let n=1.4+2.75*t;v([n-.05,_,.16],[n+.05,_+.22,.22],U),D(n-.45,_+.2,n+.45,_+.75,.28,[Me,W,Ne,Me][t]),v([n-.3,_,.45],[n+.3,_+.025,.65],H);let r=m(2,1,[1,1],[0,0]);b(e,r,p(n+.76,_,.26),p(n+.76,_+.2,.26),[1,0,0],1,.055,[W,Ae,Ne,Fe][t])}}else if(t==le.RACKS){y([0,0,0],[h,_,g],U,.05);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;E(t,r,t+1.43,r+.16,g+.01,H,.25);for(let i=0;i<5;i++){let a=[W,Ne,W,Me,Pe,null][(7*e+5*n+3*i)%6];a&&T(t+.12+.08*i,r+.08,.017,g+.011,a,1.9,!1,6)}}E(t,_-.4,t+1.43,_-.34,g+.01,Me,.9)}}else if(t==le.SCOPE){v([.2,0,.2],[1,.1,1],U),y([.45,.1,.45],[.75,.85,.75],V,.04),T(.6,.6,.035,.75,W,1.8,!1),y([.35,.85,.35],[.85,1.05,.85],H,.04);let[t,n]=[p(.6,.9,.2),p(1.4,2.8,2.1)];b(e,m(2,1,[1,1],[0,0]),t,n,[1,0,0],1,.2,V),b(e,m(2,1,[1,1],[0,0]),p(1.3,2.56,1.86),p(1.42,2.83,2.13),[1,0,0],1,.24,U),b(e,m(2,1,[1,1],[0,0]),p(.86,1.4,.6),p(1.2,2.2,1.4),[1,0,0],1,.05,H)}else if(t==le.ANALYSER){y([0,0,0],[h,.9,g],V,.04),y([0,.9,0],[h,_,.5],V,.04),D(.12,.92,.95,1.26,.56,W),y([1.1,.9,.55],[1.88,1.18,1.1],H,.03),E(1.16,.95,1.82,1.13,1.105,Fe,1.3),y([.08,.68,g-.01],[.9,.86,g+.015],U,.012);for(let e=0;e<6;e++)T(.185+.125*e,.77,.025,g+.015,[Ne,W,Me][e%3]);for(let e of[.3,.6])v([.05,e,g],[h-.05,e+.015,g+.005],U)}else if(t==le.PLANTS){for(let e of[0,h/2-.03,h-.06])y([e,0,0],[e+.06,_,g],H,.02);y([0,_-.04,0],[h,_,g],V,.015);for(let t of[.3,.9,1.5]){y([0,t,0],[h,t+.04,g],V,.015),v([.1,t+.04,.12],[h-.1,t+.18,g-.12],je);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]);C(e,1.1,()=>v([.1,t+.53,.3],[h-.1,t+.56,g-.3],Ie))}}else if(t==le.LOCKERS){y([0,0,0],[h,_,g],Ae,.04);for(let e=0;e<6;e++){let t=.8*e;e&&v([t-.01,.05,g],[t+.01,_-.05,g+.01],U);for(let e=0;e<3;e++)v([t+.2,1.7+.08*e,g],[t+.6,1.73+.08*e,g+.01],U);y([t+.64,.95,g],[t+.68,1.2,g+.04],ke,.015),T(t+.4,1.53,.025,g+.008,Ne,1.3,!1,12,.07)}}else if(t==le.SUIT){v([.1,0,.1],[.9,.06,.9],U),v([.47,.06,.06],[.53,1.7,.14],H);for(let e of[.27,.54])v([e-.02,.06,.36],[e+.21,.22,.68],H),v([e,.22,.4],[e+.19,.95,.62],V);y([.22,.95,.32],[.78,1.58,.7],V,.07),y([.25,1,.14],[.75,1.62,.32],ke,.05);for(let e of[.08,.78])v([e,1,.4],[e+.14,1.54,.6],V),v([e,.88,.4],[e+.14,1,.6],H);T(.42,1.36,.05,.7,Me,1.3,!1),T(.6,1.38,.03,.7,Pe,1.6,!1),x(e,m(2,0,[1,1]),p(.5,1.8,.5),ue,[0,0,0],.21,V),E(.38,1.74,.62,1.88,.715,Ne,.7)}else{y([0,0,0],[h,_,.05],H,.03),y([.08,.3,.03],[.6*h+.02,_-.08,.07],U,.02),E(.12,.34,.6*h-.02,_-.12,.071,Me,.5),y([.64*h,.3,.03],[h-.08,_-.08,.07],U,.02);for(let e=0;e<12;e++){let[t,n]=[.64*h+.15+e%3*.24,.42+.23*Math.floor(e/3)];T(t,n,.04,.07,[W,Ne,Pe,Me][(e+Math.floor(e/3))%4])}y([.1,.09,.03],[h-.1,.21,.06],U,.015),T(h/2,.15,.03,.06,Ne,1.4,!1,12,h/2-.2)}})})(e,t));let[,t]=fe[0],n=z+t+.03;G(e,2,n,[R-3,3.4,0],[R+3,4.3,0],Te);for(let t of[3.42,4.22])G(e,2,n+.01,[R-2.95,t,0],[R+2.95,t+.05,0],Ce);for(let t=0;t<9;t++){let r=R-2.6+.6*t;G(e,2,n+.01,[r,3.9,0],[r+.45,4.1,0],[.9,.95,1]),G(e,2,n+.01,[r+.05,3.6,0],[r+.3+t%2*.1,3.7,0],Me)}for(let[t,n]of[[R+16.6,.3],[R+17.1,.15]])ze(e,()=>M(e,[t,2.94,z-6.7],[t+n,3.06,z+6.7],U));D.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o]=[t[i],r?D[0].min[2]:n[i]],s=t[2-i]+k,c=[0,2,0],l=[0,2.1,0];[c[i],l[i],c[2-i],l[2-i]]=[a,o,s,s+.12],ze(e,()=>M(e,c,l,U));let[u,d]=[[0,0,0],[0,0,0]];[u[i],d[2-i]]=[i?-1:1,1];for(let t=a+2.5;t<o-1;t+=5){let[n,r]=[[0,1.22,0],[0,1.58,0]];[n[i],r[i],n[2-i],r[2-i]]=[t-.3,t+.3,s,s+.03],ze(e,()=>Ue(e,n,r,U,.012));let a=[0,1.4,0];[a[i],a[2-i]]=[t,s+.03],Ge(e,a,u,rt,[.05,.13],W.map(e=>.5*e),it,12,.16),Ge(e,a.map((e,t)=>e+.002*d[t]),u,rt,[0,.05],at(W,2),W.map(e=>1.4*e),12,.16)}});for(let t of _e){let n=t.max[0]-t.min[0]<1?0:2,[r]=ne.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(D.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,oe+.05,0],[0,oe+.35,0]];[r[2-n],i[2-n]]=[o+.3*t,Math.min(o+.3*t+.15,s)],G(e,n,a,r,i,Ne),[r[2-n],i[2-n]]=[i[2-n],Math.min(o+.3*t+.3,s)],G(e,n,a,r,i,U)}let c=(o+s)/2,[l,u]=[[0,3.32,0],[0,0,0]];[l[n],l[2-n],u[2-n]]=[a,c,(n?1:-1)*i],Ge(e,l,u,rt,[.12,.17],it,it,14),l[n]+=.003*i,Ge(e,l,u,rt,[0,.12],at(Pe,2.2),Pe.map(e=>1.6*e),14)}})(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},K=e=>Number.isInteger(e)?`${e}.`:`${e}`,pt=e=>`vec3(${e.map(K)})`,[[mt,ht],[gt,_t]]=ne.map(({min:e,max:t})=>[[e[0]+k,0,e[2]+k],[t[0]-k,4,t[2]-k]]),[vt,yt]=se,bt=[...w,...w.map(([e,t])=>[t,e])],xt=`if(L<${(xe+.05).toFixed(2)}&&L>${(Se-.05).toFixed(2)}){\nbool rd=P.z>${K(140)};vec3 id=1./(r+step(abs(r),vec3(1e-5))*1e-5),h,e,W=vec3(.55,.56,.58);float t=0.;\nif(L<${((xe+Se)/2).toFixed(3)}){vec2 o=P.xz-vec2(${K(vt)},rd?${K(yt)}:${K(280-yt)}),E[4]=vec2[](${bt.map(([e,t])=>`vec2(${K(e)},${K(t)})`)});float ax=0.;\nfor(int n=0;n<2;n++)for(int i=0;i<4;i++){vec2 a=(-E[i]-o)*id.xz,b=(E[i]-o)*id.xz,lo=min(a,b),hi=max(a,b);float t1=min(hi.x,hi.y);\nif(max(lo.x,lo.y)<=t+.01&&t1>t){t=t1;ax=hi.x<hi.y?0.:1.;}}\nfloat tf=r.y<0.?-P.y*id.y:1e3;bool fl=tf<t;t=min(t,tf);h=P+r*t;float u=fract((ax<.5?h.z:h.x)/2.4);\ne=fl?vec3(.42,.43,.45)*(min(fract(h.x),fract(h.z))<.03?.7:1.):h.y>${K(8)}?vec3(.03,.03,.04):h.y>${K(7.4)}&&h.y<${K(7.6)}?vec3(1.3):h.y<.25?vec3(.04):\n((h.y>1.7&&h.y<2.9)||(h.y>5.1&&h.y<6.3))&&u>.25&&u<.75?vec3(.56,.48,.28):W;}\nelse{bool m0=P.x>${K((_t[0]+mt[0])/2)};vec3 lo=m0?${pt(mt)}:${pt(gt)},hi=m0?${pt(ht)}:${pt(_t)};\nif(!rd){float z=lo.z;lo.z=${K(280)}-hi.z;hi.z=${K(280)}-z;}\nvec3 x=max((lo-P)*id,(hi-P)*id);t=min(x.x,min(x.y,x.z));h=P+r*t;float s=(hi.x-lo.x)/3.,lx=abs(fract((h.x-lo.x)/s)-.5)*s,wx=abs(fract((h.x-lo.x-${K(1-k)})*.5+.5)-.5)*2.;\ne=t==x.y?(r.y>0.?(lx<1.2&&abs(h.z-(lo.z+hi.z)*.5)<.3?vec3(1.6):vec3(.5)):vec3(.4,.41,.44)):\nt==x.z&&h.y>2.7&&h.y<3.7&&wx<.46?vec3(.22,.24,.26):W;}\nvec3 dv=normalize(P-E),w;if(dv.y>0.)w=K0(dv,.0015);else{float tg=-P.y/dv.y;vec2 g=P.xz+dv.xz*tg;\nw=vec3(.5,.49,.47)*(.7+.45*vn(g*.12))*(.75+.35*vn(g*1.7))*(.25+.75*max(O.y,0.));}\nc=mix(w,e,.08+.6*fr);}`,[St,Ct]=se,wt=22.4,q=j/48,Tt=[.4,.42,.46],Et=[.27,.29,.33],[J,Dt,Ot,kt,At,jt,Mt]=[[.16,.17,.2],[.6,.62,.66],[1,.8,.45],[.7,.9,1],[1,.6,.2],[1,.12,.08],[.35,1,.5]],Nt=[.6,.64,.48],Pt=P(S([[1,0],[1,1]],6),[1,1,1]),Ft=P(S([[0,-1],[1,0],[0,1]],6),[1,1,1]),It=P(S([[0,0],[1,.4],[.93,.42],[0,.12]],12),[.82,.84,.88]),Lt=(e,t,n,r,i=Dt)=>b(e,Pt,t,n,Nt,1,r,i),Rt=(e,t,n,r,i=2.2)=>{let a=e.length;x(e,Ft,t,ue,[0,0,0],n,r),i&&E(e,a,i)},zt=(e,t,n)=>C(e,1.8,()=>A(e,[[t-.15,.03,n-.15],[t+.15,.03,n-.15],[t+.15,.03,n+.15],[t-.15,.03,n+.15]],kt,[t,-5,n])),Bt=e=>[wt*Math.cos(e*j/40),12*Math.sin(e*j/40)],Y=(e,t,n=.02)=>{let r=Math.max(t-5,0),i=Math.floor(r),[a,o]=[Bt(i),Bt(i+1)],[s,c]=[a[0]+(o[0]-a[0])*(r-i),a[1]+(o[1]-a[1])*(r-i)],l=O([s/wt/wt,c/144,0]),u=s*Math.cos(q/2)/Math.cos((e%q+q)%q-q/2)+n*l[0];return[St+u*Math.cos(e),Math.min(t,5)+c+n*l[1],Ct+u*Math.sin(e)]},Vt=ct.map(([e,t])=>[e-.03,t+.03]),Ht=e=>!Vt.some(([t,n])=>[e,e-j].some(e=>e>t&&e<n)),Ut=[...Array.from({length:35},(e,t)=>(2*t+1)*j/70).filter(e=>Ht(e-.03)&&Ht(e+.03)).map(e=>{let[t,n]=[Math.cos(e),Math.sin(e)];return[St+22.419999999999998*t,4.02,Ct+22.419999999999998*n,t,n,.38,0]}),...ne.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])=>!D.some(n=>e>n.min[0]-.5&&e<n.max[0]+.5&&t>n.min[2]-.6&&t<n.max[2]+.6))],Wt=(e,[t,n,r,i,a],o,s,c)=>A(e,Array.from({length:12},(e,c)=>{let l=o*Math.cos(c*j/12);return[t+s*i-a*l,n+o*Math.sin(c*j/12),r+s*a+i*l]}),c,[t-i,n,r-a]),Gt=(e,[t,n,r,i,a],o,s)=>{let c=e.length,l=e=>{let c=o*Math.cos(e*j/12);return[t+s*i-a*c,n+o*Math.sin(e*j/12),r+s*a+i*c]},u=[t+s*i,n,r+s*a];for(let o=0;o<12;o++)A(e,[u,l(o),l(o+1)],Ot,[t-i,n,r-a]);E(e,c,.7),st(e,c,u,[i,0,a],o,.8)},[Kt,qt]=[160,280],Jt=[80,0,140],Yt=Jt,Xt=O([.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)=>L(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},Zt=(e,t,n)=>.55*Z(e,t,n)+.3*Z(2*e,2*t,n+1)+.15*Z(4*e,4*t,n+2),Qt=P(S([[1,0],[1,1]],6),[.5,.52,.56]),$t=P(S([[0,-1],[1,0],[0,1]],6),[1,1,1]),en=P(S([[0,0],[.5,1.6],[.85,3.5],[1,6],[1,10],[.8,12.5],[.55,14],[0,14]],12),[.9,.9,.92]),tn=P(S([[0,0],[2.2,.6],[0,.9]],12),[.8,.82,.86]),nn=(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=O(F(t,Math.abs(t[1])<.9?[0,1,0]:[1,0,0])),r=F(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},rn=[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}))),an=(e,t,[n,r,i],a,o,s=!0)=>{let c=(e,t)=>L(e,t,a),l=nn(rn,[0,-1,0],.35),u=(e,t,n)=>{let r=Math.sqrt(1-e*e);l=nn(l,[r*Math.cos(t),e,r*Math.sin(t)],n)};u(.92+.08*c(0,1),j*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),j*((o+a+.45*c(s,2))/e),r+i*c(s,3))}let[d,f]=[.8+.4*L(a,1,9),j*L(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=O(F([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=O(F(a,Math.abs(a[1])<.9?[0,1,0]:[1,0,0])),l=F(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),N.ROCK,u];for(let t=1;t<i.length-1;t++)e.push(...d(i[0]),...d(i[t]),...d(i[t+1]))})},on=(t,n,r,i,a,o,s)=>{let c=F(e(n[1],n[0]),e(n[2],n[0]));if(Math.hypot(...c)<1e-9)return;c=O(c),d(c,e(n[0],r))<0&&(n.reverse(),c=c.map(e=>-e));let l=(n[0][1]+n[1][1]+n[2][1])/3,u=.85*s*(.86+.28*L(t.length,o,7))*(.55+.45*X((l-i)/(.3*(a-i))))*(.82+.18*Math.max(c[1],0));for(let e of n)t.push(...e,...c,...Math.abs(c[1])>.7?[e[0],e[2]]:Math.abs(c[0])>Math.abs(c[2])?[e[2]+3*o,e[1]]:[e[0]+3*o,e[1]],N.ROCK,u)},sn=(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)];me(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)},cn=(e,t,n)=>{x(e,P(S([[13,0],[13,.27],[0,.27]],32),[.13,.13,.15]),[t,0,n],ue,[0,0,0],1),ee(e,[t,.29,n],7.6,8,[.8,.8,.82]);for(let r=0;r<24;r++){let i=r*j/24,[a,o]=[t+11.6*Math.cos(i),n+11.6*Math.sin(i)],s=(e,t)=>[a+e,.31,o+t];C(e,1.8,()=>A(e,[s(-.25,-.25),s(.25,-.25),s(.25,.25),s(-.25,.25)],r%3?[1,.95,.8]:[1,.45,.1],[a,-5,o]))}},ln=(e,t,n,r,i=10,a=[1,.93,.75])=>{x(e,Qt,[t,r,n],ue,[0,0,0],[.2,.2,i]),x(e,Qt,[t,r,n],ue,[0,0,0],[.5,.5,.5]),C(e,ce,()=>x(e,$t,[t,r+i+.4,n],ue,[0,0,0],[.55,.55,.45],a))},un=(e,t)=>{let n=(n,r)=>{let[i,a]=[t[n],j*(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},dn=[un(6,[-.35]),un(5,[.45,-.35]),un(9,[.62,.1,-.35])],fn=[.08,.2,.45],pn=(e,t,n,r,i,a,o)=>{sn(e,[[t,a-4,n,r,a,i]],a-3.4,o,3,.9),sn(e,[[t+.15,-17,n+.15,r-.15,a-3,i-.15]],-15,o+9,2,.5)},mn=[[0,.02,.6],[.55,.04,.72],[.88,.2,1.05],[1,.24,1.12],[1.4,.015,1]],hn=({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-Jt[0])<=Jt[0]-.5&&Math.abs(o-Jt[2])<=Jt[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])}),gn=(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)]},_n=[[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]],vn=(()=>{let e=e=>l[Math.min(Math.max(e,0),l.length-1)],t=[[0,140]];for(let n=0;n<=l.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*L(n,1,71)])}return[...t,[l.length,140]]})(),yn=[[640,75,4,.17,.02,3],[690,95,3,.16,.03,5],[740,115,3,.15,.04,8]],bn=(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=j*L(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*xn(t){let r=[];(e=>{(e=>{(e=>{let t=Array.from({length:9},(e,t)=>{let n=(t+1)/10*(j/4);return[B*Math.cos(n),5+12*Math.sin(n)]}),n=[];x(n,P(S([[B,0],[B,5],...t,[0,17]],48),he),[R,0,z],ue,[0,0,0],1);let r=(e,t)=>(t?Math.ceil:Math.floor)(e*48/j)*j/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*z,n[i]+n[a]+n[o]-3*R);if(Math.max(n[i+1],n[a+1],n[o+1])>5.01||!ct.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)=>[R+B*Math.cos(e),t,z+B*Math.sin(e),Math.cos(e),0,Math.sin(e),he[0],he[1],-1,he[2]];for(let[t,n,a]of ct){let o=[r(t,0),t];for(let e=Math.ceil(t*48/j);e*j/48<n;e++)o.push(e*j/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)=>[R+(B+n)*Math.cos(e),t,z+(B+n)*Math.sin(e)];for(let t=0;t<70;t++){let n=t*j/70,r=n>j/2?n-j:n;if(ct.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/B,t,i));A(e,i(.72,1.5,2.9,.04),[.06,.06,.08],[R,2.2,z]);let o=e.length;C(e,.56,()=>A(e,i(.6,1.7,2.7,.07),[1,.85,.5],[R,2.2,z])),st(e,o,a(n,2.2,.07),[Math.cos(n),0,Math.sin(n)],.6,.25)}let[,o,s,c,l]=fe[0],u=z+o-l;for(let[t,n,r]of[[-s-.3,-s-.02,0],[s+.02,s+.3,0],[-s-.3,s+.3,c]])M(e,[R+t,r,u-.1],[R+n,c+.3,u+.5],ge),G(e,2,u-.12,[R+t+.09,r+.09,0],[R+n-.09,c+.21,0],Ce)})(e),(e=>{let t=[...w,...w.map(([e,t])=>[t,e]).reverse()];for(let[n,r]of t)G(e,1,.02,[R-n,0,z-r],[R+n,0,z+r],Ee,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]=[ve[a]+t[a/2],Math.sign(t[a/2])],[l,u]=[t[o/2],i[o/2]].sort((e,t)=>e-t),d=fe.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]]=[ve[o]+t,ve[o]+n],G(e,a,s-c*d,f,p,l,u)};He(e,a,s,ve[o]+l,ve[o]+u,8,1.7,d&&[[ve[o]+f-p,ve[o]+f+p,m]]),g(l,u,0,.25,Te,0,.02),g(l,u,7.4,7.6,Ce,0,.03);let _=u-l>6?Math.floor((u-l)/2.4):0;for(let t=0;t<_;t++){let n=l+(u-l)*(t+.5)/_;for(let t of[1.5,4.9])if(t>m||Math.abs(n-f)>p+.8){g(n-.72,n+.72,t,t+1.4,Te,0,.02);let r=e.length;g(n-.6,n+.6,t+.2,t+1.2,we,0,.04);let i=[0,0,0];i[a]=-c,Be(e,r,i,Se)}}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[R+r[0]*i,8,z+r[2]*i]};Le(e,[r(n,0),r(n+1,0),r(n+1,1),r(n,1)],Ee,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]]=[ve[o]+f-p,ve[o]+f+p],G(e,o,t[o],t,n,Oe,1.4),G(e,o,n[o],t,n,Oe,1.4),G(e,1,m,t,n,Oe,.9),G(e,1,.02,t,n,Ee,1.85),Ve(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+(j/4-o)*t/a,e*j/i],s=(B-.3)*Math.cos(n);return[R+s*Math.cos(r),5+11.7*Math.sin(n),z+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);Le(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=>[R+3*Math.cos(e*j/16),16.2,z+3*Math.sin(e*j/16)];Le(e,[[R,16.2,z],n(t),n(t+1),n(t+2)],Ce)}te.forEach(t=>Re(e,t))})(e),(e=>{D.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o,s]=[t[i],r?D[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;b(e,ut,c(a),c(o),[0,1,0],1,[1.75,l]);for(let t=5;t<o-a-1;t+=5)b(e,dt,c(a+t),c(a+t+.3),[0,1,0],.3,[1.75,l]);He(e,2-i,t[2-i]+k+.02,a,o,oe,1.4),He(e,2-i,n[2-i]-k-.02,r?a:D[1].min[0],o,oe,1.4),G(e,1,oe-.01,t,n,Oe,.9);let[u,d]=[[...t],[...n]];[u[2-i],d[2-i]]=[s-.15,s+.15],G(e,1,oe-.02,u,d,Ce)})})(e),(e=>{for(let{min:t,max:n}of ne){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(_e.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]);A(e,s(.72,2.6,3.8,.02),[.06,.06,.08],r);let c=e.length;C(e,.5,()=>A(e,s(.6,2.7,3.7,.04),[.9,.95,1],r)),st(e,c,[o,3.2,a+.04*i],[0,0,i],.6,.25),Le(e,s(.56,2.6,3.8,-k-.04),Te);let l=e.length;Le(e,s(.46,2.7,3.7,-k-.06),[.45,.48,.5]),Be(e,l,[0,0,-i],xe)}}for(let r of[0,2])for(let[i,a]of[[t[r],k+.02],[n[r]-k,-.02]])He(e,r,i+a,t[2-r]+k,n[2-r]-k,4,1.5,_e.filter(e=>Math.abs(e.min[r]-i)<.01).map(e=>[e.min[2-r],e.max[2-r],oe]));G(e,1,3.99,t,n,Oe,.9);for(let i=0;i<3;i++){let a=t[0]+(n[0]-t[0])*(i+.5)/3;G(e,1,3.98,[a-1.2,0,r[2]-.3],[a+1.2,0,r[2]+.3],Ce)}}})(e);for(let{min:t,max:n}of[...ne,...D])G(e,1,.02,t,n,De,1.99);for(let{min:t,max:n}of _e){let r=n[0]-t[0]<1?0:2;for(let i of[t[r]-.02,n[r]+.02])Ve(e,r,i,t[2-r],n[2-r],t[1])}})(e),(e=>{(e=>{let t=(t,n=Tt)=>A(e,t,n,[St,5,Ct]),n=(e,n,r,i,a,o)=>{for(let s=e;s<n-1e-9;){let e=Math.min(n,(Math.floor(s/q+1e-9)+1)*q);t([Y(s,r,o),Y(e,r,o),Y(e,i,o),Y(s,i,o)],a),s=e}};for(let[t,r]of[[Vt[0][1],Vt[1][0]],[Vt[1][1],Vt[0][0]+j]])n(t,r,0,.45,J),C(e,1.6,()=>n(t,r,.16,.3,kt,.035)),n(t,r,3.18,3.32);n(0,j,4.55,5.01,J,.03),[.4,1.9,2.5,3.7,5.2].forEach(e=>n(e,e+.05,4.68,4.86,Dt,.045));for(let e=0;e<70;e++){let n=(e+.5)*j/70,r=.07/wt;Ht(n)&&[0,2].includes(e%5)&&t([Y(n-r,.45),Y(n+r,.45),Y(n+r,4.55),Y(n-r,4.55)])}let r=(e,n=.1,r,i=.03)=>e.slice(1).forEach(([a,o],s)=>{let[c,l]=e[s],u=Math.max(Math.abs(a-c),Math.abs(o-l)),d=(e,t)=>{let[r,s]=[c+(a-c)*e/u,l+(o-l)*e/u];return a==c?Y(r*q+t*n/Bt(s)[0],5+s,i):Y(r*q,5+s+t*n/2.5,i)};for(let e=0;e<u;e++)t([d(e,-1),d(e,1),d(e+1,1),d(e+1,-1)],r)});for(let t=0;t<12;t++){let n=4*t;r([[n,0],[n,9]],.22,Et,.05),1&t?(C(e,1.6,()=>r([[n,1],[n,8]],.04,kt,.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,j,13.75,14.15,Et,.05),C(e,1.6,()=>n(0,j,13.9,14,kt,.065));for(let[t,r]of[[5,0],[22,1],[34,0]])n(t*q+.02,(t+2)*q-.02,5.25+r,5.8+r,J,.03),C(e,2,()=>n(t*q+.04,t*q+.05,5.65+r,5.72+r,Mt,.045));let[,i,a,o,s]=fe[0],c=Ct+i-s;for(let[t,n,r]of[[-a-.62,-a-.3,0],[a+.3,a+.62,0],[-a-.62,a+.62,o+.3]])M(e,[St+t,r,c-.04],[St+n,o+.62,c+.6],J),C(e,1.5,()=>A(e,[[t+.1,r+.1],[n-.1,r+.1],[n-.1,o+.52],[t+.1,o+.52]].map(([e,t])=>[St+e,t,c-.055]),At,[St,1,Ct]));for(let t=1;t<7;t++)for(let n of[-2.6,2.6])zt(e,St+n,c-2.5*t);let l=(e,t=0,n=0)=>[St+t,e,Ct+n];Rt(e,l(17),.7,J,0),Lt(e,l(17),l(25.099999999999998),.11),[1.9,1.5,1.1].forEach((t,n)=>{let r=20+1.6*n;Lt(e,1&n?l(r,0,-t):l(r,-t),1&n?l(r,0,t):l(r,t),.06)}),Rt(e,l(25.4),.34,jt)})(e),(e=>{D.forEach(({min:t,max:n},r)=>{let i=r?2:0,a=2-i,[o,s]=[t[i],r?D[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,M(e,s,c,Tt,12|(i?32:2)>>r);let o=r?c[a]+.015:s[a]-.015;C(e,1.8,()=>A(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}),kt,[(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],M(e,s,c,Tt,4|(i?48:3))}})})(e),(e=>{ne.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)=>M(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)=>A(e,[c(t,n,a),c(r,n,a),c(r,i,a),c(t,i,a)],o,c(t,n,-1)),[d]=_e.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,oe+.14,t]});l(c(t[i]-.06,4.7,0),c(n[i]+.06,5,.06),J,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),Tt,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,Tt),u(r+4*i,2,a,2.1,.02,Tt),A(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)],Tt,c(r,1,-1)))}if(r&&C(e,1.6,()=>u(t[0]+.3,4.82,n[0]-.3,4.9,.075,kt)),!r&&!d){u(f-1.1,.9,f+1.1,1.9,.02,J);for(let e=0;e<4;e++)u(f-1,1.05+.2*e,f+1,1.15+.2*e,.035,Dt)}if(d?.[3]){let t=d[3];l(c(t-.5,2.95,0),c(t+.5,3.05,.22),J,s),C(e,1.8,()=>l(c(t-.4,2.83,0),c(t+.4,2.95,.12),Ot,8|s)),l(c(t-.05,4.1,0),c(t+.05,4.2,.5),J,s),l(c(t-.5,4.2,.32),c(t+.5,4.42,.5),Dt),C(e,2,()=>u(t-.42,4.27,t-.3,4.35,.515,Mt)),Lt(e,c(t+.35,4.42,.41),c(t+.35,5.4,.41),.03),Rt(e,c(t+.35,5.45,.41),.07,jt);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);zt(e,t,i)}}}}if(r){let r=n[0]-.7;M(e,[r-.3,5,t[2]+2],[r+.3,5.2,n[2]-2],J),[3.4,4.6,2.8].forEach((n,i)=>{let a=t[2]+2.5+1.5*i;Lt(e,[r,5.2,a],[r,5.2+n,a],.04),Rt(e,[r,5.26+n,a],.07,1&i?jt:kt)})}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]];M(e,[r[0]-.4,5,r[2]-.4],[r[0]+.4,5.12,r[2]+.4],J),Lt(e,[r[0],5,r[2]],r,.16),Rt(e,r,.26,J,0),b(e,It,i(.1),i(1.1),Nt,1,1.15),Lt(e,i(.2),i(1.05),.03),Rt(e,i(1.1),.08,jt)}})})(e),(e=>{for(let t of Ut){let n=t[5];if(Wt(e,t,n+.1,0,J),Gt(e,t,n,.015),t[6]){let r=e.length,i=[t[0],t[1],t[2],-t[3],-t[4]];Wt(e,i,n+.1,k+.06,[.04,.04,.05]),Wt(e,i,n,k+.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]]=[...ye,-2]}}})(e)})(e);for(let[t,n]of i.pads.slice(0,i.pads.length/2))cn(e,t,n);for(let[t,n]of i.masts.slice(0,i.masts.length/2))ln(e,t,n,0)})(r),t.relief&&((t,n)=>{let{at:r}=n.relief,a=vn,o=(e,t)=>Math.max(r(e,Math.max(t,148)),0),s=e=>X(4*(Z(e/6,.5,82)-.35))*(.55+.45*Z(e/1.7,.5,83)),c=([e,t],n)=>{let[r,i,a]=_n[n];return[e,n?r:o(e,t),t-i-a*s(e)*+!!n]};for(let n=0;n<a.length-1;n++){let[r,i]=[a[n],a[n+1]];for(let a=0;a<_n.length-1;a++){let o=[c(r,a),c(i,a),c(i,a+1),c(r,a+1)];for(let[c,l,u]of n+a&1?[[0,1,2],[0,2,3]]:[[0,1,3],[1,2,3]]){let d=F(e(o[l],o[c]),e(o[u],o[c]));if(Math.hypot(...d)<1e-9)continue;d=O(d),d=d[2]>0||Math.abs(d[2])<1e-9&&d[1]<0?d.map(e=>-e):d;let f=_n[a][3]*(.82+.3*L(n,a,73))*(.7+.3*s((r[0]+i[0])/2));for(let e of[o[c],o[l],o[u]])t.push(...e,...d,e[0]+e[2],e[1],N.ROCK,f)}}}i.pillars.forEach(([e,n,r,i,a],o)=>n>140&&pn(t,e,n,r,i,a,o+400)),A(t,[[-2,-30,140],[162,-30,140],[162,-30,158],[-2,-30,158]],[.012,.012,.015]);for(let e=0;e<9;e++){let n=6+17*e+8*L(e,1,77);C(t,.1,()=>A(t,[[n,-29.9,140],[n+9+6*L(e,2,77),-29.9,140],[n+5,-29.9,140.25+.3*L(e,3,77)]],[.2,.55,1]));let r=1.5+2.5*L(e,4,77);an(t,[n,-29.6,142.5+5*L(e,5,77)],[r,.7*r,r],e+200,.25,!1)}})(r,t);let a=t.relief?.at??(()=>0);i.crags.forEach(e=>((e,{at:[t,n,r],R:i,H:a,s:o},s)=>{let{reach:c}=y(o,i,a),l=[t,n+_(a),r];me(e,i<1.5?3:i<2.5?4:5,e=>{let t=c(e);return[l[0]+e[0]*t,l[1]+e[1]*t,l[2]+e[2]*t]},n,n+a,o,.8+.4*L(o,5,41),s)})(r,e,a));let o=r.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],qt-e[i+2],e[i+3],e[i+4],-e[i+5],...e.slice(i+6,i+10))}return t})(r));yield,t.relief&&((e,t)=>{for(let[r,a,o,c,u]of(e=>{let t=de(e.relief),[r,a,o,c]=t.bound,u=(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},d=[],f=(e,t,l,f=1)=>{if(((e,t)=>{let l=t-qt/2,d=([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)/o,(t-a)/c)<.97&&!p.some(e=>d(e)<2.5)&&!s.some(e=>d(e)<1)&&!i.pits.some(r=>Math.abs(e-r.x)<n+.5&&Math.abs(t-r.z)<n+.5)&&!i.crags.some(n=>Math.hypot(e-n.at[0],t-n.at[2])<1.3*n.R)&&Number.isFinite(u(e,t))})(e,t)){let n=L(l,3,211);d.push([e,u(e,t),t,n<.62?0:n<.945+.055*(1-f)?1:2,l])}};i.sites.forEach(([e,t,n],r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>L(r,5*i+e,201),o=n*(.1+1.7*a(1)*a(1));f(e+o*Math.cos(j*a(2)),t+o*Math.sin(j*a(2)),1e3*r+i)}}),i.crags.forEach(({at:[e,,t],R:n},r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>L(r,5*i+e,215),o=n*(1.32+.75*a(1)*a(1));f(e+o*Math.cos(j*a(2)),t+o*Math.sin(j*a(2)),5e5+1e3*r+i)}}),i.bowls.forEach(([e,t,n],r)=>{for(let i=0;t>=qt/2&&i<Math.round(1.1*n);i++){let a=e=>L(r,5*i+e,203),o=i%5<2?.94+.16*a(1):1.15+1.25*a(1)*a(1);f(e+o*n*Math.cos(j*a(2)),t+o*n*Math.sin(j*a(2)),1e5+1e3*r+i)}});for(let e=0;e<60;e++){let t=t=>L(e,t,205),n=1+158*t(1),r=l[Math.floor(n)];f(n,qt/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=>L(e,t,207),[n,i,a]=[r+o*(1.8*t(1)-.9),qt/2+4+(c-8)*t(2),j*t(3)];for(let r=0;r<10+12*t(4);r++)a+=.5*(L(e,10+r,208)-.5),[n,i]=[n+(1+1.4*L(e,40+r,208))*Math.cos(a),i+(1+1.4*L(e,40+r,208))*Math.sin(a)],f(n+.8*(L(e,70+r,208)-.5),i+.8*(L(e,100+r,208)-.5),3e5+100*e+r,.6)}for(let e=0;e<520;e++){let t=t=>L(e,t,209),[n,i]=[r+o*(2*t(1)-1),qt/2+c*t(2)];(Z(n/20,i/20,77)>.62||t(3)<.04)&&f(n,i,4e5+e,.7)}return[...d,...d.map(([e,,t,n,r])=>[e,u(e,qt-t),qt-t,n,r])]})(t)){let t=e=>L(u,e,213),n=fn[c]*(.88+.24*t(1)),[i,s,l]=[n/2,n/2*(.65+.35*t(2)),n*(.5+.3*t(3))],[d,f]=[Math.cos(j*t(4)),Math.sin(j*t(4))],p=a+.1*l;me(e,dn[c],e=>{let[t,n]=[e[0]*d+e[2]*f,e[2]*d-e[0]*f],a=(.9+.2*Z(1.3*e[0]+u,1.3*e[2]+e[1],u%97))/Math.hypot(t/i,2*e[1]/l,n/s);return[r+e[0]*a,p+e[1]*a,o+e[2]*a]},a,p+l/2,u,.5+.25*t(5))}})(o,t);for(let[e,t,n,r,a]of i.pillars)t<140&&r>140&&pn(o,e,t,n,r,a,401);return((e,t)=>{let n={relief:t.relief&&de(t.relief)},r=(e,r,i)=>!t.relief||Array.from({length:17},(e,t)=>t*j/16).every((t,a)=>h(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]=[Kt*L(n,1,61),qt*L(n,2,61),.6+2*L(n,3,61)**2];if(!hn(t,a,o,1.5*s)||!r(a,o,1.5*s)||Math.abs(o-Jt[2])<24||(t.rovers??[]).some(([e,,t])=>Math.hypot(a-e,o-t)<6))continue;i++;let c=(e,t)=>{let[r,i,c]=mn[e],[l,u]=[r*(e&&e<4?.86+.28*L(n,t%12,67):1),e===2||e===3?i*(.55+.45*L(n,t%12,68)):i],d=t*j/12,[f,p]=[Math.cos(d),Math.sin(d)],[m,h]=[mn[Math.max(e-1,0)],mn[Math.min(e+1,mn.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,N.STONE,c]};for(let t=0;t<mn.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,t),yield,t.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=O([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),N.STONE,1]};for(let t=0;t<vn.length-1;t++){let[r,i]=[vn[t],vn[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,t),(e=>{for(let[t,{x:r,z:a,level:o,rows:s}]of i.pits.entries()){let i=(e,t)=>s[e]?.[2+t]??0,c=Array.from({length:s.length+1},(e,t)=>[s[0][0]+t,-Math.min(i(t-1,0),i(t,0)),Math.min(i(t-1,1),i(t,1))]),l=(e,t)=>[e,o,t,0,1,0,e,t,N.STONE,.6+.4*X((Math.hypot(e-r,t-a)-I)/3)],u=(t,n,r,i)=>e.push(...t,...r,...n,...t,...i,...r);for(let[e,t]of[[a-n,a-I],[a+I,a+n]])for(let i=r-n;i<r+n;i+=2)u(l(i,e),l(i+2,e),l(i+2,t),l(i,t));for(let i=0;i<c.length-1;i++){let[[s,d,f],[p,m,h]]=[c[i],c[i+1]];u(l(r-n,s),l(r+d,s),l(r+m,p),l(r-n,p)),u(l(r+f,s),l(r+n,s),l(r+n,p),l(r+h,p));for(let n of[1,2]){let s=[o,o-.6,o-5,o-10,g],l=(e,t)=>[r+e[n]+(n>1?-1:1)*(t&&t<4?.9*L(e[0],t,83+n)-.25:0),s[t],e[0]];for(let u=0;u<4;u++){let d=[l(c[i],u),l(c[i+1],u),l(c[i+1],u+1),l(c[i],u+1)],f=[r+(n>1?99:-99),s[u],a],p=e.length;on(e,[d[0],d[1],d[2]],f,g-12,o,t+u,1.2),on(e,[d[0],d[2],d[3]],f,g-12,o,t+u,1.2);for(let t=p+3;t<e.length;t+=10){let n=O([e[t],e[t+1]+.9,e[t+2]]);[e[t],e[t+1],e[t+2]]=n}}}}let d=(e,t)=>[e,g,t,0,1,0,e,t,N.STONE,.5];u(d(r-I-1.5,a-I),d(r+I+1.5,a-I),d(r+I+1.5,a+I),d(r-I-1.5,a+I));let f=s[I][3],p=(o-g)/v;for(let n=0;n<v-1;n++){let i=r+f-1.3*(v-1-n);sn(e,[[i,g-1,a-1,i+1.3,g+p*(n+1),a+1]],g,9*t+n,2,.9)}for(let n=0;n<20;n++){let i=j*(n+L(t,n,85))/20,[s,c,l]=[r+(I+1.6)*Math.cos(i),a+(I+1.6)*Math.sin(i),.3+.35*L(t,n,86)];sn(e,[[s-l,o-.3,c-l,s+l,o+.9*l,c+l]],o,40*t+n,1,.9)}}})(o),yield,((e,t)=>{let{at:n}=t.relief,r={relief:de(t.relief)};i.bowls.forEach(([t,i,a],o)=>{let s=a<12?0:Math.round(j*a/1.5),c=Array.from({length:s},(e,r)=>{let[o,c]=[Math.cos(j*r/s),Math.sin(j*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}),l=Array.from({length:s},(e,n)=>{let[a,l]=[Math.cos(j*n/s),Math.sin(j*n/s)],u=[-2,-1,0,1,2].reduce((e,t)=>e+c[(n+t+s)%s],0)/5,d=L(n,o,87);return[-2.4,-1.2,0,1.2,2.4].map((e,s)=>{let[c,f]=[t+a*(u+e),i+l*(u+e)],p=[.04,.12,.1+.15*d,.1,.04][s],m=[.62+.3*L(n>>1,o,88),.9,1.22+.2*d,1.1,1][s];return[c,h(r,c,f)+p,f,0,1,0,c,f,N.STONE,m]})});l.forEach((t,n)=>{let r=l[(n+1)%s];for(let n=0;n<4;n++)[t[n],t[n+1],r[n],r[n+1]].every(e=>Number.isFinite(e[1]))&&e.push(...t[n],...r[n+1],...r[n],...t[n],...t[n+1],...r[n+1])})})})(o,t),yield,((e,t)=>{let r=de(t.relief),[a,o,s,c]=r.bound,[l,u]=[gn(r.x0,a+s),gn(r.z0,o+c)],d=(e,n)=>{let[i,a]=[(e-r.x0)/r.cell,(n-r.z0)/r.cell];return i%1||a%1||i<0||a<0||i>=r.nx||a>=r.nz?t.relief.at(e,n):r.h[i+a*r.nx]},f=(e,t)=>i.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),p=/* @__PURE__ */ new Map,m=(e,t)=>{let n=4096*e+t,r=p.get(n);if(!r){let i=d(e,t),a=[d(e-4,t)-d(e+4,t),d(e,t-4)-d(e,t+4)],o=i===0&&a[0]===0&&a[1]===0,s=n=>o?0:1.4*(L(e,t,131+n)-.5);r=[e,i,t,...O([a[0]+s(0),8,a[1]+s(1)]),e,t,N.STONE,Math.min(Math.max(1+i/60,.78),1.2)+f(e,t)],p.set(n,r)}return r},h=(e,t)=>{let[n,r,i,d]=[l[e],l[e+1],u[t],u[t+1]];if(!(n<r&&i<d))return 0;let f=Math.hypot((Math.min(Math.max(a,n),r)-a)/s,(Math.min(Math.max(o,i),d)-o)/c);return f<1?2:+(f<1.65)};for(let t=0;t<l.length-1;t++)for(let a=0;a<u.length-1;a++){let[o,s,c,d,f]=[l[t],l[t+1],u[a],u[a+1],h(t,a)];if(f>1)for(let t=o;t<s;t+=r.cell)for(let a=c;a<d;a+=r.cell){if(t>=r.hole[0]&&t<r.hole[2]&&a>=r.hole[1]-8&&a<r.hole[3]+8||i.pits.some(e=>t>=e.x-n&&t<e.x+n&&a>=e.z-n&&a<e.z+n))continue;let[o,s,c,l]=[m(t,a),m(t+r.cell,a),m(t+r.cell,a+r.cell),m(t,a+r.cell)];e.push(...o,...c,...s,...o,...l,...c)}else if(f){let n=[];for(let[e,r,i,l,u]of[[o,c,s,c,h(t,a-1)],[s,c,s,d,h(t+1,a)],[s,d,o,d,h(t,a+1)],[o,d,o,c,h(t-1,a)]]){let t=u>1?5:1;for(let a=0;a<t;a++)n.push(m(e+(i-e)*a/t,r+(l-r)*a/t))}let r=m((o+s)/2,(c+d)/2);n.forEach((t,i)=>e.push(...r,...n[(i+1)%n.length],...t))}}})(o,t),yield,((e,t)=>{let{at:n}=t.relief,r=O(F([0,1,0],Xt)),a=[r,F(Xt,r),Xt];for(let[t,r]of i.dishes)ln(e,t,r,n(t,r),6,[1,.25,.15]),x(e,tn,[t,n(t,r)+5.2,r],a,[0,0,-.9],1);for(let[t,r,a,o]of i.ramps)for(let i of[-8,8])ln(e,t+i*o,r-i*a,n(t+i*o,r-i*a),2.2,[1,.45,.1]);let[o,s]=i.wreck,c=g,l=O([.8,-.35,.5]),u=O(F([0,1,0],l));x(e,en,[o-3,c+3.1,s-2],[u,F(l,u),l],[0,0,0],[1.6,1.4,.55],[.6,.6,.62]),A(e,[[o+3,c,s+4],[o+6.5,c+.2,s+5],[o+4,c+2.6,s+5.5]],[.7,.3,.14]),ln(e,o-3.4,s+2.6,c,3.5,[1,.12,.08])})(o,t)),((e,t)=>{for(let[n,r,i,a,o,s]of yn){let c=e=>{let c=e*j/480,[l,u]=[Math.cos(c),Math.sin(c)],f=r*bn(l,u,n,s),p=(e+1)*j/480,m=(r*bn(Math.cos(p),Math.sin(p),n,s)-f)/(n*j/480);return Array.from({length:i+1},(e,r)=>{let c=r/i,p=n-.3*f*(1-c),h=n/(30+26*(1-c))*(1+.05*c),g=2*Z(l*h+s+1.7*c,u*h-1.3*c,s+9)-1,_=O([-l-u*(-1.5*m-1.6*g*(1-.5*c)),.75,l*(-1.5*m-1.6*g*(1-.5*c))-u]),v=Math.max(d(_,t),0),y=(.8+.3*Z(l*n/90-s,u*n/90+2.3*c,s+11))*(.72+.28*X(.5+.9*g))*(o+(a-o)*Math.min(1.2*v+(r===i?.3:0),1));return[Jt[0]+l*p,(f+25)*c-25,Jt[2]+u*p,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,O(t.sun.dir)),o}var Sn=()=>{let e=[];return(e=>{let t=Xt,n=t.map(e=>-e),r=O([n[2],0,-n[0]]),i=F(n,r),a=t.map((e,t)=>Jt[t]+800*e),o=t.map((e,t)=>a[t]+100*e),[s,c]=[28,64],l=(e,t)=>a.map((n,a)=>n+60*e*(r[a]*Math.cos(t)+i[a]*Math.sin(t))),d=e.length;for(let t=0;t<s;t++)for(let n=0;n<c;n++){let[r,i]=[n*j/c,(n+1)*j/c],[a,d]=[(t+.5)/s,(n+.5)*j/c],[f,p]=[a*Math.cos(d),a*Math.sin(d)],m=Math.sqrt(1-a*a),[h,g]=[(Math.atan2(f,m)+1.5)/j*12,6*(Math.asin(p)/Math.PI+.5)],_=Zt(h,g,11)>.5?u([.13,.32,.09],[.4,.3,.15],Zt(2*h,2*g,13)):[.03,.16,.5],v=Math.abs(p)>.93?1:X(4*(Zt(1.5*h+4,3*g,17)-.5));_=u(_,[.95,.97,1],v).map(e=>e*(.55+.45*Math.max(0,.3*f+.25*p+.9*m))*(.6+.4*m)),A(e,t?[l(t/s,r),l((t+1)/s,r),l((t+1)/s,i),l(t/s,i)]:[l(0,0),l(1/s,r),l(1/s,i)],_,o)}E(e,d,1.5)})(e),e},{FORWARD:Cn,BACK:wn,JUMP:Tn,CROUCH:En,SPRINT:Dn,USE:On}=pe,kn=2*Math.PI,An=[.5,.51,.53],jn=[.62,.63,.64],Mn=[.36,.37,.4],Nn=[.16,.17,.19],Pn=[1.5,1.4,1.05],Q=(e,t)=>{let n=43758.5453*Math.sin(91.7*e+47.3*t+3.1);return n-Math.floor(n)},Fn=(e,t,n)=>e>=t+44&&e<n-36,In=[.78,.8,.84],Ln=[.95,.68,.22],Rn=[.06,.06,.07],zn=[.9,.9,.88],Bn=[.14,.24,.55],Vn=[.75,.42,.2],Hn=[3.2,.35,.15],Un=2*Math.PI,Wn=(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])Wn(e,n[a],t,r,i)},Gn=(e,t,n,r)=>{let i=P(S(e,r),t);for(let e=8;e<i.length;e+=10)i[e]=n;return i},Kn=(e,t,n,r,i,a=-1,s=48)=>x(e,Gn(t,i,a,s),n,o(r,Math.abs(r[1])>.9?[1,0,0]:[0,1,0]),[0,0,0],1),qn=(e,t,n,r,i,a=c)=>b(e,Gn([[0,0],[r,0],[r,1],[0,1]],i,a,8),t,n,[0,1,0],1),Jn=(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},Yn=(e,t)=>{let n=Jn(Math.floor(Math.min(e,Un-e)/(4*Un/72)),Math.floor(t/6),3);return An.map(e=>e*(1+.12*n))},Xn=(e,t,n,r,i=-2)=>{for(let a of[0,1,2,0,2,3])Wn(e,[t[a][0],n,t[a][1]],[0,1,0],r,i)},Zn=[.55,.57,.6],Qn=[.9,.45,.08],$n=[.95,.75,.1],er=[.4,2.6,1.6],tr=[2.6,1.3,.25],nr=[.08,.35,.8],rr=[2.2,2.3,2.6];function*ir(e,n){let r=yield*xn(e);return yield,r=r.concat(ft(e,n)),e.station&&(yield,r=r.concat((e=>{let{hall:[n],post:r,hull:[i,o,s,l],gun:u}=e,d=[],{R:p}=a,m=r[0][1],[h,g]=[n[0],n[0]+48],_=[h,g].flatMap(e=>{let t=Math.acos((e-i)/p);return[t,Un-t]}),v=[...Array.from({length:72},(e,t)=>t*Un/72),..._,Un].sort((e,t)=>e-t);for(let e=o;e<l-.01;e+=2){let n=Fn(e,m,l);for(let r=0;r+1<v.length;r++){let[a,o]=[v[r],v[r+1]],c=(a+o)/2,l=i+p*Math.cos(c);if(l>h&&l<g&&e>=m-2&&e<m+16)continue;let u=n,f=u?Ln:Yn(c,e),_=u?.22:.03;for(let[n,a]of[[r,e],[r+1,e],[r+1,e+2],[r,e],[r+1,e+2],[r,e+2]]){let e=v[n],r=n%(v.length-1),[o,c]=[Jn(r,a,1)*_,Jn(r,a,2)*_],l=[Math.cos(e)+o*Math.sin(e),c,Math.sin(e)-o*Math.cos(e)];Wn(d,[i+p*Math.cos(e),a,s+p*Math.sin(e)],l,f,u?t:-1)}}}Kn(d,[[p,0],[p-3,3],[.6*p,f.DOME-1],[0,f.DOME]],[i,l,s],[0,1,0],In,c);let y=[i-16,l+f.MAST,s];qn(d,[y[0],l+4,s],y,.8,In);let b=Array.from({length:6},(e,t)=>[2.4*t,3.6*(t/5)**2]);Kn(d,[...b,...[...b].reverse().map(([e,t])=>[e,t-.3])],y,[-.6,.8,0],zn,-1,20);let x=f.BARREL*p,S=o-u[1];Kn(d,[[p,0],[p-1.5,2],[x+2,2.6],[0,2.6]],[i,o,s],[0,-1,0],In,c),Kn(d,[[0,2.6],[x+2,2.6],[x+2,5],[x,6.5],[x,S-4],[x+3,S-1.5],[x+3,S],[x-2,S],[x-3,S-10],[0,S-10.5]],[i,o,s],[0,-1,0],Rn,c);for(let e=10;e<S-8;e+=7)Kn(d,[[0,e],[x+.8,e],[x+.8,e+1.6],[0,e+1.6]],[i,o,s],[0,-1,0],In,c);Kn(d,[[0,S-10.3],[x-3.5,S-10.1],[0,S-9.9]],[i,o,s],[0,-1,0],Hn,-2),$(d,[i-x-8,u[1]-18,s-16],[i-x-7.2,u[1]+8,s+16],zn,c),qn(d,[i-x-1,u[1]+3,s],[i-x-7.2,u[1]+3,s],.6,In);let C=o+(l-o)*f.WING,[w,T,D]=[f.PANEL,f.SPAN,f.GAP];for(let e of[-1,1]){let t=i+e*(p+f.BOOM);qn(d,[i+e*p,C,s],[t,C,s],1.4,In),$(d,[Math.min(t,t+3*e),C-6,s-2],[Math.max(t,t+3*e),C+6,s+2],In,c),qn(d,[t,C,s],[t+e*(4*(w+D)+2),C,s],.6,Vn);for(let n=0;n<4;n++){let r=t+e*(3+n*(w+D)),[i,a]=[Math.min(r,r+e*w),Math.max(r,r+e*w)];$(d,[i,C-T/2,s-.2],[a,C+T/2,s+.2],Bn,c);for(let e of[C-T/2,C+T/2-.6,C-.3,C-T/4,C+T/4-.3])$(d,[i,e,s-.3],[a,e+.6,s+.3],In,c);for(let e of[i,i+w/2-.3,a-.6])$(d,[e,C-T/2,s-.3],[e+.6,C+T/2,s+.3],In,c)}}return(({hall:[e],post:t,hull:[n,r,i,o]},s=[])=>{let{R:c}=a,l=t[0][1],[u,d]=[e[0],e[0]+48],p=r+(o-r)*f.WING,m=(e,t,r,a)=>[n+r*Math.cos(e)-t*Math.sin(e),a,i+r*Math.sin(e)+t*Math.cos(e)],h=(e,t,r,i)=>{let a=n+c*Math.cos(e),o=a>u-4-t&&a<d+4+t&&i>l-4&&r<l+19,s=Math.abs(Math.sin(e))<.2&&i>p-10&&r<p+10;return!o&&!s},g=(e,t,n,r,i,a,o)=>{let[l,u]=[c+i,c+a],d=m(e,0,(l+u)/2,(n+r)/2),f=(n,r,i)=>m(e,n*t,r,i);for(let e of[[f(-1,u,n),f(1,u,n),f(1,u,r),f(-1,u,r)],[f(-1,l,r),f(-1,u,r),f(1,u,r),f(1,l,r)],[f(-1,l,n),f(1,l,n),f(1,u,n),f(-1,u,n)],[f(-1,l,n),f(-1,u,n),f(-1,u,r),f(-1,l,r)],[f(1,l,n),f(1,l,r),f(1,u,r),f(1,u,n)]])A(s,e,o,d)},_=e=>e<1e-6||e>Math.PI-1e-6?[e]:[e,kn-e],v=(e,t,n,r,i)=>{for(let a=0;a<72;a++){let[o,l]=[a*kn/72,(a+1)*kn/72],[u,d]=[c+t,c+r];A(s,[m(o,0,u,e),m(l,0,u,e),m(l,0,d,n),m(o,0,d,n)],i,m((o+l)/2,0,c-1,(e+n)/2))}};for(let[e,t]of[[0,r+14],[1,o-24]]){v(t,.12,t+3,.12,Nn),v(t-.6,0,t,.45,jn),v(t+3,.45,t+3.6,0,jn);for(let n=0;n<14;n++){let r=(n+.5+.4*Q(n,e))*Math.PI/14,i=.5+.9*Q(n,e+7);for(let a of _(r))g(a,i,t+.4,t+1.2+1.4*Q(n,e+3),.1,.35,Mn)}}[[r+1,r+13],[r+18,l+44],[o-36,o-25],[o-20,o-1]].forEach(([e,t],n)=>{for(let n=0;n<18;n++){let r=4*n*kn/72;if(h(r,.1,e,t)){let n=(e,t)=>m(r,.09*e,c+.03,t);A(s,[n(-1,e),n(1,e),n(1,t),n(-1,t)],Nn,m(r,0,c,e))}}let r=Math.round(.5*(t-e));for(let i=0;i<r;i++){let a=(i+.15+.7*Q(i,10+n))*Math.PI/r,o=Math.min(t-e-2,3+8*Q(i,20+n)),s=e+1+(t-e-2-o)*Q(i,30+n),c=2+4*Q(i,40+n);if(h(a,c,s,s+o))for(let e of _(a))g(e,c,s,s+o,0,.35,jn),Q(i,45+n)<.5&&o>3&&g(e,.6*c,s+.25*o,s+.75*o,.35,.7,An)}for(let i=0;i<r;i++){let a=(i+Q(i,50+n))*Math.PI/r,o=.8+2.4*Q(i,60+n),s=e+.5+(t-e-1-o)*Q(i,70+n),c=.6+1.8*Q(i,80+n);if(h(a,c,s,s+o))for(let e of _(a))g(e,c,s,s+o,0,.6+1.2*Q(i,90+n),Mn)}for(let r=0;e+3+10*r<t-1;r++){let t=e+3+10*r;for(let e=0;e<9;e++){let i=4+Math.floor(5*Q(e,100+n+9*r)),a=1.2/c,o=(i-1)*a,l=(e+.1+.5*Q(e,110+n+9*r))*Math.PI/9;if(l+o>Math.PI||!h(l+o/2,o*c/2+1,t,t+.45))continue;let u=s.length;for(let e=0;e<i;e++)for(let n of _(l+e*a)){let e=(e,t)=>m(n,.35*e,c+.06,t);A(s,[e(-1,t),e(1,t),e(1,t+.45),e(-1,t+.45)],Pn,m(n,0,c,t))}E(s,u,1)}}})})(e,d),d})(e.station),(({hall:[e],post:t,hull:[n,,r]})=>{let i=[],o=t[0][1],[s,l]=[e[0]+4,e[0]+44],[u,d]=[r-a.R,r+a.R];for(let[e,t,n,r]of[[s+.5,2.4,.25,1],[s+.5,3.1,.16,1],[s+.7,8.5,.4,1],[l-.5,4.6,.25,-1],[l-.7,8.5,.4,-1]]){qn(i,[e,o+t,u+5],[e,o+t,d-5],n,Zn);for(let a=u+8;a<d-5;a+=8)$(i,[Math.min(e,e-.5*r),o+t-n-.1,a-.15],[Math.max(e,e-.5*r)+.01,o+t+n+.1,a+.15],Rn),a/8%3<1&&qn(i,[e,o+t,a+1.5],[e,o+t,a+1.8],n+.12,Qn,-1)}for(let e of[s+.6,l-.6])for(let t of[u+6,d-6])qn(i,[e,o,t],[e,o+14,t],.3,Zn);for(let e of[n-10,n+10])qn(i,[e,o+13.2,u+5],[e,o+13.2,d-5],.6,Zn);for(let e=u+10;e<d-5;e+=12)$(i,[n-4,o+13.7,e-.6],[n+4,o+13.9,e+.6],rr,-2);for(let e of[-1,1]){let[t,a]=[n+6,r+10*e];for(let e=0;e<32;e++){let[n,r]=[e*Un/32,(e+1)*Un/32],s=(e,n)=>[t+n*Math.cos(e),a+n*Math.sin(e)];Xn(i,[s(n,7),s(r,7),s(r,6.4),s(n,6.4)],o+.03,$n,-1),e%4==0&&$(i,[t+7.4*Math.cos(n)-.15,o,a+7.4*Math.sin(n)-.15],[t+7.4*Math.cos(n)+.15,o+.12,a+7.4*Math.sin(n)+.15],tr,-2)}let c=e<0?u:d;for(let n=a+10*e;e*(c-n)>4;n+=5*e)for(let r of[-1,1])Xn(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]],o+.04,tr);Xn(i,[[s,c-.6*e],[l,c-.6*e],[l,c-.2*e],[s,c-.2*e]],o+.04,er);for(let t of[s+.06,l-.06])$(i,[t-.06,o,c-.6*e-.2],[t+.06,o+11,c-.6*e+.2],er,-2);$(i,[s,o+10.94,c-.6*e-.2],[l,o+11,c-.6*e+.2],er,-2)}let[f,p]=[l+4.2,l+13.5];for(let e of[-1,1]){let t=r+8*e;$(i,[f,o,Math.min(t,t-1.1*e)],[p,o+1,Math.max(t,t-1.1*e)],Rn,c);for(let n=f+.4;n<p-1.5;n+=2.3)$(i,[n,o+1.4,Math.min(t,t-.05*e)],[n+1.9,o+2.6,Math.max(t,t-.05*e)],nr,-2)}return $(i,[l+17.94,o+1.2,r-4],[l+18,o+3.4,r+4],nr,-2),i})(e.station))),yield,{land:r,sky:Sn(),heavens:Yt,glaze:xt}}export{ir as default};
|
|
@@ -4,7 +4,7 @@ import type { Beat } from './beats';
|
|
|
4
4
|
/** Seconds between two frags for them to count as a double kill, a multi kill and on. */
|
|
5
5
|
export declare const MULTI = 4;
|
|
6
6
|
/** The lines of the 2nd, 3rd, 4th, 5th frag in quick succession; the last for every one after. */
|
|
7
|
-
export declare const QUICK: (16 | 14 |
|
|
7
|
+
export declare const QUICK: (16 | 14 | 15 | 18 | 17)[];
|
|
8
8
|
/** Frags without going down between two lines of a run; the last line for every SPREE after. */
|
|
9
9
|
export declare const SPREE = 5;
|
|
10
10
|
export declare const RUNS: (20 | 19 | 22 | 23 | 21)[];
|
|
@@ -109,7 +109,7 @@ export declare const strokeShare: (v: number) => number;
|
|
|
109
109
|
*/
|
|
110
110
|
export declare const stroke: (row: number[], u: number, m: number) => number[];
|
|
111
111
|
/** What a move poses: the pelvis, the spine, the arms and the legs, and nothing of the head. */
|
|
112
|
-
export declare const FK: (0 | 1 | 2 | 6 | 16 | 7 | 10 | 11 | 13 | 14 |
|
|
112
|
+
export declare const FK: (0 | 1 | 2 | 6 | 16 | 7 | 10 | 11 | 13 | 14 | 15 | 20 | 18 | 19 | 17)[];
|
|
113
113
|
export declare const fk: (c: number[]) => Quat[];
|
|
114
114
|
export declare const IDENT: Quat;
|
|
115
115
|
/**
|
|
@@ -16,11 +16,16 @@ export declare const TOP = 8;
|
|
|
16
16
|
export declare const INDOORS: number[];
|
|
17
17
|
/** Texture axes of a face flat on x, y and z: world metres, as the brushes'. */
|
|
18
18
|
export declare const UV: number[][];
|
|
19
|
+
/**
|
|
20
|
+
* The layers of the glass seen from inside (the user, 2026-11-27: reflections on the windows): glows
|
|
21
|
+
* whose reflection of the room is traced per pixel (mirror.ts), in a module and in the hall.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ROOM_GLASS: number, HALL_GLASS: number;
|
|
19
24
|
/** Lamps, the windows' glass seen from inside, their frames. */
|
|
20
25
|
export declare const LAMP: number[];
|
|
21
26
|
export declare const GLASS: number[];
|
|
22
27
|
export declare const FRAME: number[];
|
|
23
|
-
export declare const CONCRETE: 8,
|
|
28
|
+
export declare const CONCRETE: 8, HULL: 15, WHITE: 11;
|
|
24
29
|
/** Flat colours of the kit. */
|
|
25
30
|
export declare const SNOW: number[], GREY: number[], IRON: number[], INK: number[], BLUISH: number[], SOIL: number[];
|
|
26
31
|
/** Glows: screens, status lights, grow lights. */
|
|
@@ -12,6 +12,8 @@ export declare const block: (o: Out, { min, max, top, side }: Brush, tint?: numb
|
|
|
12
12
|
* looked, brighter since it takes the ambient only (about what the textured walls get).
|
|
13
13
|
*/
|
|
14
14
|
export declare const inside: (o: Out, make: () => void) => void;
|
|
15
|
+
/** Makes what was drawn from `from` glass on the layer `l`, facing n: the reflection traced in it needs its true normal. */
|
|
16
|
+
export declare const glazed: (o: Out, from: number, n: number[], l: number) => void;
|
|
15
17
|
/** A lit frame just inside a doorway h high from c0 to c1, in the plane of the axis k at `at`. */
|
|
16
18
|
export declare const frame: (o: Out, k: number, at: number, c0: number, c1: number, h: number) => void;
|
|
17
19
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Over the glass of a window (ROOM_GLASS, HALL_GLASS: glows with their true normal m), the view
|
|
3
|
+
* reflected (r, from the light's code) is traced through the room it looks into, from the pane to
|
|
4
|
+
* what it meets first, and the colour drawn there is mirrored in it, more at a grazing angle (fr).
|
|
5
|
+
* The room is red's or its twin across ZED. A module is a box (slabs): its ceiling with its three
|
|
6
|
+
* lamps, its floor in panels, its walls with their row of windows. The hall is the union of its four
|
|
7
|
+
* rectangles, crossed slab by slab twice over (a ray that leaves one goes on in the next), then the
|
|
8
|
+
* floor: the concrete with its seams, the walls with their skirting, two rows of windows and the
|
|
9
|
+
* strip of light under the ledge at TOP, and the dark dome over them.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GLAZE: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Vec3 } from '../mesh';
|
|
2
|
+
import type { Out } from '../verts';
|
|
3
|
+
/**
|
|
4
|
+
* A box of one colour from lo to hi, its twelve edges cut at 45 degrees `c` deep (at most a third of
|
|
5
|
+
* its thinnest side): six faces, twelve bevels and eight corners, each shaded by where it looks once
|
|
6
|
+
* inside() moves it indoors, so the edges catch a lighter or darker line.
|
|
7
|
+
*/
|
|
8
|
+
export declare const bevel: (o: Out, lo: Vec3, hi: Vec3, rgb: number[], c: number) => void;
|
|
9
|
+
/**
|
|
10
|
+
* A glowing ring round `at` in the plane of the unit axes a and b, from radius r0 (colour c0) to r1
|
|
11
|
+
* (colour c1), facing a × b; r0 0 makes it a disc. With `half`, a bar with round ends: the ring is
|
|
12
|
+
* drawn round the segment `half` either side of `at` along a, each end a half circle of n / 2 sides.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ring: (o: Out, at: Vec3, a: Vec3, b: Vec3, [r0, r1]: number[], c0: number[], c1: number[], n?: number, half?: number) => void;
|
|
@@ -36,6 +36,8 @@ export type Decor = {
|
|
|
36
36
|
glass?: number[];
|
|
37
37
|
/** GLSL for the map's rocks (TEX.ROCK) under BEACH, spliced in by fragOf(): Landfall's granite, which its chunk brings. */
|
|
38
38
|
rock?: string;
|
|
39
|
+
/** GLSL for the map's indoor windows under MOON, spliced in by fragOf(): Tranquility's traced reflections, which its chunk brings. */
|
|
40
|
+
glaze?: string;
|
|
39
41
|
/** How the map's rovers look, if not as the moon's: Landfall's buggy, which its chunk brings. */
|
|
40
42
|
car?: Look;
|
|
41
43
|
};
|
|
@@ -4,7 +4,7 @@ export declare const POST_VERT = "#version 300 es\nout vec2 U;void main(){U=vec2
|
|
|
4
4
|
export declare const POST_FRAG = "#version 300 es\nprecision highp float;uniform sampler2D S[4];uniform vec4 Y;uniform float L,Dp;in vec2 U;out vec4 o;\nvec3 b(vec2 x){vec3 c=texture(S[0],x).rgb;if(any(isnan(c)))return vec3(0);return c*smoothstep(.9,2.,max(c.r,max(c.g,c.b)));}\n#define T(k)texture(S[0],U+Y.xy*(k)).rgb\nvoid main(){\nvec3 c;\nif(Y.z<1.)c=(b(U+Y.xy)+b(U-Y.xy)+b(U+Y.xy*vec2(1,-1))+b(U-Y.xy*vec2(1,-1)))/4.;\nelse if(Y.z<2.)c=T(0.)*.227+(T(1.3846)+T(-1.3846))*.3162+(T(3.2308)+T(-3.2308))*.0703;\nelse{\nvec3 s=texture(S[0],U).rgb;\nif(any(isnan(s))){s=textureOffset(S[0],U,ivec2(0,-2)).rgb;if(any(isnan(s)))s=vec3(0);}\nif(Dp>0.){vec2 e=Y.xy*3.,f=e*.7;s=mix(s,(s+texture(S[0],U+e*vec2(1,0)).rgb+texture(S[0],U-e*vec2(1,0)).rgb+texture(S[0],U+e*vec2(0,1)).rgb+texture(S[0],U-e*vec2(0,1)).rgb+texture(S[0],U+f).rgb+texture(S[0],U-f).rgb+texture(S[0],U+f*vec2(1,-1)).rgb+texture(S[0],U-f*vec2(1,-1)).rgb)/9.,Dp);}\nc=s+texture(S[1],U).rgb*1.3+texture(S[2],U).rgb*1.+texture(S[3],U).rgb*.7;\nvec2 q=U-.5;\nc=min(c,.6)+.4*(1.-exp(-max(c-.6,0.)/.4));\nc=mix(c,c*vec3(.3,.7,.95)+vec3(0,.025,.045),Dp*.85);\nfloat a=atan(q.y,q.x)*24.,h=fract(sin(floor(a)*12.9898)*43758.5453);\nc+=L*step(.85-.5*L,h)*sin(fract(a)*3.1416)*smoothstep(.2,.6,length(q))*fract(length(q)*3.-Y.w*.002+h*9.)*.22;\nc*=1.-(.7+.3*L+.4*Dp)*dot(q,q);\nc=pow(max(c*vec3(.97,1.,1.03),0.),vec3(.92))+(fract(sin(dot(gl_FragCoord.xy+Y.w,vec2(12.9898,78.233)))*43758.5453)-.5)*.03;}\no=vec4(c,1);}";
|
|
5
5
|
/**
|
|
6
6
|
* Blinn-Phong strength and exponent: a row per TEX id in order (brick, tile, lava, stone, metal, wood,
|
|
7
|
-
* moss, grate, concrete, glass, steel, paint, rock, fabric, hide), then the flat bodies, then polished metal (SHINE),
|
|
7
|
+
* moss, grate, concrete, glass, steel, paint, rock, fabric, hide, hull), then the flat bodies, then polished metal (SHINE),
|
|
8
8
|
* then a glossy shell (GLOSS: broader, so it shows on the armour). Lava and glows never get here: they
|
|
9
9
|
* light themselves.
|
|
10
10
|
*/
|
|
@@ -65,12 +65,13 @@ export declare const mirrors: (brushes?: readonly Brush[]) => boolean;
|
|
|
65
65
|
* colour's registers kept every shadow map's pixels from running as many at once); with none, all of it. Left in where it never runs,
|
|
66
66
|
* code still costs every pixel through the shader's registers: the moon 2.4 ms of GPU a frame on
|
|
67
67
|
* Highline, the ninja's 1.9 ms on three astronauts at 3 m on the moon. `rock` is the GLSL of the
|
|
68
|
-
* map's rocks under BEACH (Decor.rock: Landfall's granite, from its chunk)
|
|
68
|
+
* map's rocks under BEACH (Decor.rock: Landfall's granite, from its chunk), `glaze` that of its indoor
|
|
69
|
+
* windows under MOON (Decor.glaze: Tranquility's traced reflections, from its chunk). `sight` adds the
|
|
69
70
|
* vision's filter and its glowing prey (VISION), for a frame in a xenomorph's or the Hunter's
|
|
70
71
|
* vision: its loop and palettes were 4.6 ms a frame on Highline with none ever drawn, 1.4 on
|
|
71
72
|
* Tranquility and none on Landfall, through the registers they take from every pixel.
|
|
72
73
|
*/
|
|
73
|
-
export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief" | "helmets"> & Partial<Pick<WorldDef, "brushes">>, kind?: string, rock?: string, sight?: boolean) => string;
|
|
74
|
+
export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief" | "helmets"> & Partial<Pick<WorldDef, "brushes">>, kind?: string, rock?: string, sight?: boolean, glaze?: string) => string;
|
|
74
75
|
/** A map whose ground takes footprints (createPrints): Landfall's sand, the moon's regolith. */
|
|
75
76
|
export declare const printed: (def: Pick<WorldDef, "scenery" | "relief">) => boolean;
|
|
76
77
|
/** A map with the moon's sky: its globe, stars and craters. Not the beach, whose sand is a relief too. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StationDef } from '../shared/station';
|
|
2
|
-
export declare const satellite: (
|
|
2
|
+
export declare const satellite: (def: StationDef) => number[];
|
|
3
3
|
/**
|
|
4
4
|
* The station's inside (the user, 2026-11-14): pipes along the hangar's walls and ducts under its
|
|
5
5
|
* roof, a painted landing circle with its lights where each team's ship sets down (sortie.ts lands
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StationDef } from '../../shared/station';
|
|
2
|
+
type Out = number[];
|
|
3
|
+
/** The plated hull's greys: the wall's panels, lighter plates, darker blocks, the trenches' floor. */
|
|
4
|
+
export declare const PLATE: number[];
|
|
5
|
+
/** The grey bands of the wall: where the gold foil is not (the hangar's floor to its top, then the cap). */
|
|
6
|
+
export declare const foiled: (y: number, deck: number, y1: number) => boolean;
|
|
7
|
+
/** Adds the plated hull's detail to `o`, and returns it. */
|
|
8
|
+
export declare const plating: ({ hall: [lo], post, hull: [cx, y0, cz, y1] }: StationDef, o?: Out) => Out;
|
|
9
|
+
export {};
|
|
@@ -358,6 +358,8 @@ export declare const TEX: {
|
|
|
358
358
|
readonly FABRIC: 13;
|
|
359
359
|
/** Grained leather, near white so a tint is its colour, stitched in panels. Seats and luggage. */
|
|
360
360
|
readonly HIDE: 14;
|
|
361
|
+
/** Smooth satin composite panels, 1 m by 2 m, with fine seams: the moon base's floors and walls. */
|
|
362
|
+
readonly HULL: 15;
|
|
361
363
|
};
|
|
362
364
|
/** One player in a snapshot: the state (its ev and fall read 0) and the ack. */
|
|
363
365
|
export interface SnapPlayer extends PlayerState {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@korial29/tiny-fps",
|
|
3
3
|
"description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.18.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
package/dist/brick-BSIQdeSz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e,t={HOME:0,CARRIED:1,DROPPED:2},n={FORWARD:1,BACK:2,LEFT:4,RIGHT:8,JUMP:16,SPRINT:32,DASH:64,CROUCH:128,FIRE:256,BLADE:512,SPECIAL:1024,RAIL:2048,RELOAD:4096,RIFLE:8192,USE:16384,FISTS:32768},r={THRUST:0,LEFT:1,RIGHT:2,SLASH:3,LUNGE:4,ARC_L:5,ARC_R:6,LEAP:7},i={NONE:0,HEAD:1,ARM_L:2,ARM_R:3,LEG_L:4,LEG_R:5,EATEN:6,BURST:7},a={PLAIN:0,SHOT:1,STRUCK:2},o={GROUND:0,AIR:1,WALLRUN:2,HANG:3,CLIMB:4,SLIDE:5,CROUCH:6,RIDE:7,CLING:8,SWIM:9},s={JUMP:1,DOUBLE:2,DASH:4,LAND:8,GRAB:16,CLIMB:32,WALLRUN_START:64,WALLRUN_END:128,SLIDE_START:256,SLIDE_END:512,RESPAWN:1024},c={BRICK:0,TILE:1,LAVA:2,STONE:3,METAL:4,WOOD:5,MOSS:6,GRATE:7,CONCRETE:8,GLASS:9,STEEL:10,PAINT:11,ROCK:12,FABRIC:13,HIDE:14},l=(e,t,n,r,i,a=c.CONCRETE)=>({min:[e,-30,t],max:[n,i,r],top:c.CONCRETE,side:a}),u=([e,t,n],[r,i,a],o,s=o,c)=>({min:[e,t,n],max:[r,i,a],top:o,side:s,tint:c}),d=(l(4,57.7,24,76,10),l(4,36,24,53.5,10,c.GLASS),l(4,20,24,36,12.4),l(4,-5,24,7,12.4,c.GLASS),l(27,20,47,50,8),l(27,60,47,76,8,c.BRICK),u([9,12.2,39],[19,12.6,47],c.STEEL),[1,2,3,4,5,6].map(e=>u([12,10,53-e],[14,10+.4*e,53-e+1],c.CONCRETE)),u([5,10,42],[5.5,14,42.5],c.STEEL),u([5,10,50],[5.5,14,50.5],c.STEEL),u([8,12.4,24],[20,12.85,24.45],c.STEEL),u([36,8,22],[37,14.5,48],c.PAINT,c.PAINT,[.15,.72,.62]),u([30,8,28],[34,10,32],c.CONCRETE),u([40,8,30],[44,10.2,34],c.PAINT,c.PAINT,[1,.3,.06]),u([28,9.2,44],[35,12,46],c.STEEL,c.PAINT,[.2,.42,1]),u([41.5,7.6,50],[42,8,60],c.STEEL),u([30,8,64],[34,9.6,68],c.PAINT,c.PAINT,[.2,.8,.3]),240),f=[1,.22,.26],p=[.2,.46,1],m=[f,p],h=[1,.42,.08],g=[.12,.7,.62],_=(e,t,n,r,i,a,o)=>u([e,t,n],[r,i,a],c.PAINT,c.PAINT,o),v=(e,t,n,r,i,a,o,s=-30)=>{let l=Math.ceil((o-a)/.46);return Array.from({length:l},(d,f)=>{let[p,m]=[t+(n-t)*f/l,t+(n-t)*(f+1)/l].sort((e,t)=>e-t),h=a+(o-a)*(f+1)/l;return e===0?u([p,s,r],[m,h,i],c.CONCRETE):u([r,s,p],[i,h,m],c.CONCRETE)})},y=(e,t,n,r,i,a,o)=>o.map((o,s)=>u([e+s*n,a,t+s*r],[e+s*n+4,o,t+s*r+i],c.STEEL,c.CONCRETE)),b=[l(12,212,52,240,26,c.GLASS),_(12,26,212,52,26.12,212.5,f),_(12,26,239.5,52,26.12,240,f),_(12,26,212.5,12.5,26.12,239.5,f),_(51.5,26,212.5,52,26.12,239.5,f),_(11.6,12,222,12,25.8,232,f),_(28,12,211.4,31,25.5,212,f),u([19,26,222],[22,27.4,225],c.STEEL),u([42,26,222],[45,27.4,225],c.STEEL),u([29,26,229],[35,27.1,229.6],c.CONCRETE),l(6,164,26,201,26,c.GLASS),l(6,134,26,147,26,c.GLASS),l(6,201,26,212,19),l(15,147,26,164,19),u([14,26,164],[15,32,196],c.PAINT,c.PAINT,g),u([14,18,147],[15,32,164],c.PAINT,c.PAINT,g),u([14,26,134],[15,32,147],c.PAINT,c.PAINT,g),...y(6,201,7,0,4,19,[21.2,23.4,25]),...[[18,152,22,156,21.2],[18,158,22,162,23.4],[23,160,26,164,25]].map(([e,t,n,r,i])=>u([e,19,t],[n,i,r],c.STEEL,c.CONCRETE)),u([20,26,178],[23,27.3,181],c.STEEL),u([8,26,176],[11,27.2,179],c.STEEL),u([8,26,190],[11,27.3,193],c.STEEL),u([20,26,140],[23,27.3,143],c.STEEL),l(32,186,76,209,19),_(32,19,207.5,76,19.1,209,f),...y(33,209,7,0,3,19,[21.2,23.4,25]),...[[28,196,32,200,21.2],[28,190,32,194,23.4],[26,184,30,188,25]].map(([e,t,n,r,i])=>u([e,-30,t],[n,i,r],c.STEEL,c.CONCRETE)),l(32,166,64,182,21.2,c.GLASS),l(32,140,64,161,19),u([40,21.2,172],[44,22.6,176],c.STEEL),u([52,19,148],[57,20.3,151],c.STEEL),u([38,19,196],[41,20.4,199],c.STEEL),u([60,19,200],[63,20.4,203],c.STEEL),u([52,19,190],[58,20.6,194],c.STEEL),u([66,19,204],[72,20.2,207],c.STEEL),u([56,21.2,170],[60,22.4,174],c.STEEL),u([34,19,152],[37,20.3,156],c.STEEL),...y(36,135,18,0,3,15,[17.2,17.2]),...y(6.5,129,6,0,4,15,[17.2,19.4,21.6,23.8]),l(76,213,100,240,14.5,c.STEEL),_(76,14.5,238.5,100,14.6,240,f),l(76,185,100,209,14.5),l(76,138,100,181,14.5,c.GLASS),u([80,15.7,158],[96,17.7,162],c.STEEL,c.PAINT,h),u([82,14.5,234],[85,15.9,237],c.STEEL),u([91,14.5,190],[94,15.9,193],c.STEEL),u([80,14.5,204],[83,15.6,207],c.STEEL),u([78,14.5,170],[81,15.9,173],c.STEEL),u([92,14.5,146],[95,15.7,149],c.STEEL),u([92,14.5,222],[96,15.8,226],c.STEEL),...v(0,76,52,226,232,14.5,26),...v(0,85,76,196,202,14.5,19,14.5)],x=[l(6,106,62,134,15),l(62,106,100,134,14.5),u([34,15,112],[54,17.2,128],c.CONCRETE),_(38,17.2,116,50,17.3,124,h),...[[35,113],[35,126.2],[51,113],[51,126.2]].map(([e,t])=>u([e,17.2,t],[e+.8,21.5,t+.8],c.STEEL)),u([34.6,21.5,112.6],[52.2,21.9,127.4],c.GLASS),u([14,15,114],[17,16.5,117],c.STEEL),u([14,15,123],[17,16.5,126],c.STEEL),u([56,15,114],[59,16.5,117],c.STEEL),u([56,15,123],[59,16.5,126],c.STEEL),u([15.35,25.5,106],[15.85,26,134],c.STEEL),u([70,14.5,108],[70.8,38,108.8],c.STEEL),u([70,14.5,131.2],[70.8,38,132],c.STEEL),u([66,14.5,110],[69,15.9,113],c.STEEL),u([66,14.5,127],[69,15.9,130],c.STEEL)],ee=(e,t,n)=>[...[16,22,28,34,40].map(n=>[n,26,t,e]),...[19,31,43].map(t=>[t,26,n,e])],te=[[20,26,190],[48,21.2,172],[48,19,200],[88,14.5,198]],ne=[[21,26,168],[16,26,140],[46,19,144],[36,21.2,178],[58,19,156],[64,19,196],[88,14.5,216],[88,14.5,172],[90,14.5,150]],S=[[19.5,26,179],[46,19,152],[39.5,21.2,172],[88,14.5,186],[88,14.5,207]],re={armor:!0,name:`Highline`,tag:`Rooftops · 94 × 240 m`,lore:`The towers of an old business district, closed for years, far above streets that still have traffic. Two crews of runners have taken the roofs. Three routes cross between them, and a fall takes you back to your tower.`,brushes:[...b,...b.map(e=>({...e,min:[e.min[0],e.min[1],d-e.max[2]],max:[e.max[0],e.max[1],d-e.min[2]],tint:e.tint===f?p:e.tint})),...x],teams:[{base:[32,26,224],spawns:ee(0,236,231),rack:[30.75,26,217],blade:[38,26,217],rail:[18,26,137],rifle:[48,19,156]},{base:[32,26,16],spawns:ee(Math.PI,4,9),rack:[30.75,26,23],blade:[38,26,23],rail:[18,26,103],rifle:[48,19,84]}],packs:[...te,...te.map(([e,t,n])=>[e,t,d-n]),[24,15,112],[24,15,128]],ammo:[...ne,...ne.map(([e,t,n])=>[e,t,d-n]),[12,15,116],[12,15,124]],cells:[...S,...S.map(([e,t,n])=>[e,t,d-n]),[28,15,120]],vests:[[36,17.2,120],[23,26,136],[23,26,104]],floor:-25,sun:{dir:[.8,.6,0],color:[2.6,2.3,1.8]},sky:[[.04,.2,.72],[.72,.86,.98]],fog:[.72,.86,.98,.0035]},C=.4,ie=1.8,ae=1.6,oe=1.55,se=.5,ce=2.4,le=.03,ue=[`Red`,`Blue`],de=[`#ff3d4f`,`#2f80ff`],fe={ticks:20,strike:6,reach:1.4,arc:.6,hp:0,hold:-1,knock:0},pe={JAB:0,CROSS:1,HOOK:2,LUNGE:3,CLAW_L:4,CLAW_R:5},me={ticks:16,strike:5,reach:1.8,arc:.7,hp:2,hold:-1,knock:0},he=[fe,fe,{ticks:28,strike:9,reach:1.5,arc:.9,hp:1,hold:-1,knock:1.4},{ticks:26,strike:7,reach:2.2,arc:.5,hp:1,hold:-1,knock:1.2},me,me],ge=[2,6],_e={STAB:0,SWEEP_L:1,SWEEP_R:2,LASH:3,SPIN:6,LEAP:7},ve=[{ticks:52,strike:26,reach:3.4,arc:.25,hp:ge[0],hold:18,knock:0},{ticks:50,strike:26,reach:2.8,arc:1.1,hp:ge[0],hold:16,knock:0},{ticks:50,strike:26,reach:2.8,arc:1.1,hp:ge[0],hold:16,knock:0},{ticks:54,strike:28,reach:3.1,arc:.4,hp:ge[0],hold:20,knock:0},me,me,{ticks:60,strike:30,reach:2.6,arc:Math.PI,hp:3,hold:18,knock:0},{ticks:63,strike:52,reach:2.8,arc:.6,hp:5,hold:32,knock:0}],[ye,be]=[.75,1],[xe,Se,Ce,we]=[3,2.5,1,120],Te={TICKS:88,REACH:1.3,FIST:.85,CUTS:[26,71],KILLER:1,VICTIM:2},Ee=.12,De=.08,Oe=.16,ke=.5,Ae=.012,je=1.2,Me=[{ticks:28,strike:10,reach:2.65,arc:.3,hp:2,hold:8},{ticks:34,strike:13,reach:2.15,arc:1.2,hp:2,hold:4},{ticks:34,strike:13,reach:2.15,arc:1.2,hp:2,hold:4},{ticks:40,strike:16,reach:2.15,arc:.45,hp:3,hold:11},{ticks:36,strike:12,reach:3.2,arc:.3,hp:3,hold:-1},{ticks:46,strike:20,reach:2.15,arc:.6,hp:3,hold:-1},{ticks:46,strike:20,reach:2.15,arc:.6,hp:3,hold:-1},{ticks:58,strike:40,reach:2.4,arc:.6,hp:4,hold:-1}],[Ne,Pe,Fe]=[1.8,15,60],[Ie,Le,Re]=[2,.5,1.4],[ze,Be,Ve]=[24,15,.6],He=7.5,Ue=.7,We=.3,[Ge,Ke,qe]=[20,4,2.5],Je=.012,Ye={maxPlayers:16,scoreLimit:3,timeLimit:480,map:`highline`},Xe={HP:10,WRECK:300,FADE:60,GRAZE:4,SKID:.92},Ze={SEAM:300,TOP:960,ALT:25e4},{CONCRETE:Qe,METAL:w,STEEL:T,PAINT:$e}=c,E=(e,t,n,r,i,a,o,s=o,c)=>({min:[e,t,n],max:[r,i,a],top:o,side:s,tint:c}),et=(e,t,n,r,i,a)=>({min:[e,t,n],max:[r,i,a]}),tt=22.4,nt=e=>Math.round(10*e)/10,rt=[0,10.5,13.5,15.5,17],it=.4,at=2.48,[D,O]=[.4,2.48],k=[80,236],A=[et(111,0,222,125,5,230),et(96,0,196,110,5,204)],ot=[et(102,0,223.2,111,3.5,227.2),et(98,0,204,102,3.5,227.2)],[[st,,ct],[lt,ut,dt],[ft,,pt],[mt]]=ot.flatMap(e=>[e.min,e.max]),ht=[[19.8,6.7],[16,13.5]],[[gt,_t],[vt,yt]]=ht,j=[[0,-gt,2,3,2.8],[vt,-10.8,2,3.5,2]],bt=[et(k[0]-j[0][2],0,k[1]-gt-1.55,k[0]+j[0][2],j[0][3],k[1]-gt-1.25),et(116.8,0,A[0].max[2]-.3,119.2,O,A[0].max[2]-.1),et(101.8,0,A[1].min[2]+.1,104.2,O,A[1].min[2]+.3)],xt=e=>[...new Map(e.flatMap(([e,t,n,r])=>[1,-1].flatMap(i=>[1,-1].flatMap(a=>[[e,n,t,r],[t,r,e,n]].map(([e,t,n,r])=>[Math.min(i*e,i*t),Math.min(a*n,a*r),Math.max(i*e,i*t),Math.max(a*n,a*r)])))).map(e=>[`${e}`,e])).values()],St=(()=>{let e=tt/Math.SQRT2,t=[...Array.from({length:Math.ceil(e**2/13.53)},(e,t)=>Math.round(100*Math.sqrt(13.53*t))/100),_t,yt,j[0][2],nt(-j[1][1]-j[1][2]),nt(-j[1][1]+j[1][2])],n=[.../* @__PURE__ */ new Set([...t.filter(t=>t<e),e])].sort((e,t)=>e-t),r=[...ht,...ht.map(([e,t])=>[t,e])];return n.slice(1).flatMap((e,t)=>{let i=n[t],a=Math.max(...r.filter(([,e])=>e>i).map(([e])=>e)),o=(s=Math.sqrt(tt*tt-i*i),Math.ceil(100*s)/100);var s;return a<e?[[i,i,e,e],[e,i,o,e]]:[[a,i,o,e]]})})(),Ct=([e,t,n,r])=>j.find(([i,a,o])=>Math.abs(i)>Math.abs(a)?e<=i&&i<=n&&a-o-1e-6<=t&&r<=a+o+1e-6:t<=a&&a<=r&&i-o-1e-6<=e&&n<=i+o+1e-6)?.[3]??0,M=([e,t,n,r],i,a,o=Qe,s=o)=>({...E(k[0]+e,i,k[1]+t,k[0]+n,a,k[1]+r,o,s),ghost:!0}),wt=(e,t,n,r,i,a,o)=>{let s=Math.ceil((o-a)/.46);return Array.from({length:s},(c,l)=>{let[u,d]=[t+(n-t)*l/s,t+(n-t)*(l+1)/s].sort((e,t)=>e-t),f=a+(o-a)*(l+1)/s;return e?E(r,a,u,i,f,d,Qe):E(u,a,r,d,f,i,Qe)})},Tt=[...xt([[12,-yt,vt,yt],[vt,-_t,gt,_t]]).filter(e=>e[1]>-gt).map(e=>M(e,3.1,3.5,w,T)),...wt(2,k[1]+5.6,k[1]+12,k[0]-1.5,k[0]+1.5,0,3.5).map(e=>({...e,ghost:!0})),M([-3,19,3,gt],3.5,4.6,T,w),M([-9,12,-2.5,12.5],3.5,4.6,T,$e),M([2.5,12,9,12.5],3.5,4.6,T,$e),M([-9.5,-10,-7.5,-8],0,1.4,T),M([7.5,-10,9.5,-8],0,1.4,T),M([7.5,3,10,5.5],0,2.4,T)],Et={BENCH:0,SAMPLES:1,RACKS:2,SCOPE:3,ANALYSER:4,PLANTS:5,LOCKERS:6,SUIT:7},{BENCH:Dt,SAMPLES:Ot,RACKS:kt,SCOPE:At,ANALYSER:jt,PLANTS:Mt,LOCKERS:Nt,SUIT:Pt}=Et,Ft=[[Dt,60.2,230.5,61.2,241.5,0,.95,0],[Ot,65,233.5,66.5,238.5,0,.9,0],[kt,98.8,229.3,99.8,234.3,0,3.1,2],[kt,98.8,237.7,99.8,242.7,0,3.1,2],[At,68.9,250.8,70.1,252,3.5,4.5,3],[jt,89.4,250.8,91.4,252,3.5,4.8,3],[Mt,115,222.4,121,223.2,0,2,1],[Mt,123.8,226.4,124.6,229.6,0,2,2],[Nt,96.4,200.4,97,203.6,0,2.1,0],[Pt,108.6,197.4,109.6,198.4,0,2,2]],It=(e,t,n,r,i,a,o=[])=>{let s=(t,n,o)=>e?E(r,o,t,i,a,n,Qe):E(t,o,r,n,a,i,Qe);return[...o,[n,n]].flatMap(([e,n],r,i)=>[s(r?i[r-1][1]:t,e,0),...n>e?[s(e,n,O)]:[]])},Lt=({min:[e,,t],max:[n,r,i]},a,o)=>[E(e,4,t,n,r,i,w,Qe),...It(0,e,n,t,t+D,4,a[0]),...It(0,e,n,i-D,i,4,a[1]),...It(2,t+D,i-D,e,e+D,4,a[2]),...It(2,t+D,i-D,n-D,n,4),o],Rt=[1,.42,.08],zt=[...rt.slice(2).flatMap((e,t)=>{return(n=(e=>e<5?tt:tt*Math.sqrt(1-((e-5)/12)**2))(rt[t+1])+.2,[[1,.39],[.93,.71],[.71,.93],[.39,1]].map(([e,t])=>[nt(e*n),nt(t*n)])).map(([n,r])=>M([-n,-r,n,r],rt[t+1],e));var n}),...xt(St).flatMap(e=>(e=>{let[t,n,r,i]=e,[a,o,s]=[ft-k[0],pt-k[1],ct-k[1]];return t<a&&a<r+1&&o<i&&n<s?[[[t,n,a,i],0],...r>a?[[[a,n,r,i],ut]]:[]]:[[e,Ct(e)]]})(e).map(([e,t])=>M(e,t,rt[1]))),...Tt,...Ft.map(([,e,t,n,r,i,a])=>({...E(e,i,t,n,a,r,T),ghost:!0})),...Lt(A[0],[[[118,118]],[[116.8,119.2]],[[ct+D,dt-D]]],E(121.5,0,223.5,123.5,1.2,225.5,$e,$e,Rt)),...Lt(A[1],[[[101.8,104.2]],[[ft+D,mt-D],[105.8,105.8]]],E(106,0,200.6,108,1.2,202.6,$e,$e,Rt)),E(st,O,ct,lt,ut,dt,T,w),E(ft,O,pt,mt,ut,dt,T,w),E(ft,0,dt-D,lt,O,dt,w),E(mt-D,0,ct,lt,O,ct+D,w),E(ft,0,pt,ft+D,O,ct,w),E(mt-D,0,pt,mt,O,ct,w),...wt(2,214,ct,105,109,0,3.5),...wt(0,108,mt,206,210,0,3.5)],Bt=(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},N=(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)=>Bt(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},Vt=/* @__PURE__ */ new WeakMap,Ht=e=>{let t=Vt.get(e);if(t)return t;let{hole:n,bound:r,cell:i,at:a,pits:o=[],origin:[s,c]=[0,0]}=e,l=o.reduce((e,t)=>[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])],[1/0,1/0,-1/0,-1/0]),[u,d,f,p]=r,m=Math.floor((u-f-s)/i)*i+s,h=Math.floor((d-p-c)/i)*i+c,g=Math.ceil((u+f-m)/i)+1,_=Math.ceil((d+p-h)/i)+1,v=new Float32Array(g*_),y=-1/0;for(let e=0;e<_;e++)for(let t=0;t<g;t++)v[t+e*g]=a(m+t*i,h+e*i),y=Math.max(y,v[t+e*g]);let b=new Uint8Array(g*_);for(let[e,t,n,r]of o)for(let a=Math.floor((t-h)/i)-1;a<=Math.floor((r-h)/i)+1;a++)for(let t=Math.floor((e-m)/i)-1;t<=Math.floor((n-m)/i)+1;t++)t>=0&&a>=0&&t<g&&a<_&&(b[t+a*g]=1);let x={x0:m,z0:h,cell:i,nx:g,nz:_,h:v,hole:n,pits:o,pitted:b,box:l,bound:r,top:y};return Vt.set(e,x),x},Ut=(e,t,n)=>{let r=e.relief;if(!r||t>r.hole[0]&&t<r.hole[2]&&n>r.hole[1]&&n<r.hole[3])return-1/0;let i=Math.min(Math.max((t-r.x0)/r.cell,0),r.nx-1),a=Math.min(Math.max((n-r.z0)/r.cell,0),r.nz-1),o=Math.min(Math.floor(i),r.nx-2),s=Math.min(Math.floor(a),r.nz-2);if(r.pitted[o+s*r.nx]&&r.pits.some(e=>t>=e[0]&&t<=e[2]&&n>=e[1]&&n<=e[3]))return-1/0;let[c,l]=[i-o,a-s],u=o+s*r.nx,[d,f,p,m]=[r.h[u],r.h[u+1],r.h[u+r.nx],r.h[u+r.nx+1]];return c>=l?d+(f-d)*c+(m-f)*l:d+(p-d)*l+(m-p)*c},Wt=(e,t)=>{if(!t.relief)return;let[n,r,i,a]=t.relief.bound,[o,s]=[(e.x-n)/i,(e.z-r)/a],c=o*o+s*s;if(c<=1)return;let l=1/Math.sqrt(c);e.x=n+o*l*i,e.z=r+s*l*a;let[u,d]=[o*l/i,s*l/a],f=(e.vx*u+e.vz*d)/(u*u+d*d);f>0&&(e.vx-=f*u,e.vz-=f*d)},Gt={READY:0,ARMED:1,STRUCK:2,COOL:3},Kt=({hall:[e,t]},n,r,i)=>n>e[0]&&n<t[0]&&r>e[1]&&r<t[1]&&i>e[2]&&i<t[2],qt=({hull:[e,,t],post:[[,n]]})=>[[[e-24,n,t-$t.R],[e+24,n+14,t+$t.R]],[[e+24,n,t-10],[e+40,n+4,t+10]]],Jt=({hull:[e,,t],post:[[,n]]})=>[t-$t.R,t+$t.R].map(t=>[[e-20,n,t],[e+20,n,t],[e+20,n+11,t],[e-20,n+11,t]]),{METAL:Yt,STEEL:Xt,PAINT:P,GLASS:Zt,GRATE:Qt}=c,F=(e,t,n,r,i,a,o,s=o,c)=>({min:[e,t,n],max:[r,i,a],top:o,side:s,tint:c}),$t={R:44,LOW:-40,TOP:130},I={BARREL:.68,GUN:44,BOOM:16,PANEL:44,SPAN:50,GAP:2,WING:.45,DOME:7,MAST:16},[en,tn]=m,{STONE:L,CONCRETE:nn,METAL:rn,STEEL:an,PAINT:on}=c,sn=({min:e,max:t})=>et(e[0],e[1],280-t[2],t[0],t[1],280-e[2]),cn=[[40,220,13],[13.5,220,13]],ln=[[106.2,230.4],[103.2,212.4]],un=k[1]-2,R=e=>Math.min(Math.max(e,0),1),z=e=>R(e)*R(e)*(3-2*R(e)),B=(e,t)=>Math.sqrt(e*e+t*t),dn=[[-100,0,46,.13,.52],[-4,224,36,.12,.67],[110,236,16],[-112,108,14],[236,170,13],[-52,230,10],[80,184,14],[150,250,13],[-36,168,10],[200,152,12],[262,134,14],[240,150,9],[-140,60,12],[-66,60,9],[40,262,10],[118,200,11]],fn=[[-20,0,-1,0],[192,124,0,-1],[64,236,1,0],[-60,100,0,1]],[pn,mn]=[[248,64],[180,200]],hn=[[12,24],[36,60],[72,88],[124,156]],gn=(()=>{let e=Array.from({length:160},(e,t)=>hn.some(([e,n])=>t>=e-1&&t<=n)?0:Math.min(Math.round(Math.max(26*N(t/17,0,33)+8*N(t/5,0,35)-11,0))/2,6.5));for(let t of[1,-1])for(let n=t>0?1:158;n>=0&&n<160;n+=t)e[n]=Math.min(e[n],e[n-t]+.5);return e.map((e,t)=>{let n=Math.min(t,159-t);return n<4?-6:n<8?-3:e})})(),_n=e=>e.reduce((e,t,n)=>(e.at(-1)?.[2]===t?e.at(-1)[1]++:e.push([n,1,t]),e),[]),vn=_n(gn),V=[114,176,2],yn=[48,144],[bn,xn]=[3,8],Sn=[[27,67,53,93],[.5,67,26.5,93],[56,74,104,133],[96,56,125,90],[98,36,102,40],[28,113,32,117],[30,45,30,45],[135,50,135,50],[50,106,50,106],[35,104,35,104],[115,22,115,22],[45,20,51,62],[114,36,114,36],[141,20,147,66]],Cn=[[0,0,4.5],[-14,6,3],[10,-12,3.5],[16,10,2.5],[-8,-16,2.2],[-20,-8,3.8],[6,18,3],[22,-4,2],[-12,20,2.4]].map(([e,t,n])=>[e-50,t+330,n]),wn=[[126,143,131,147,1.2],[130,138.5,135,141.5,2.4],[126,133,131,137,1.2]],Tn=[[180,340],[173,346],[186,347]],En=[dn[0][0]-4.5,140],Dn=[[6,174,2.5],[32.5,156.5,3.1],[67.5,159.5,1.9],[97.5,166,2.8],[128,177.5,3.4],[94,188,2.5],...Array.from({length:36},(e,t)=>{let n=e=>Bt(t,e,41),r=Math.floor(3*n(1)),[i,a]=r<2?[(r?151:0)+9*n(2),150+122*n(3)]:[5+150*n(2),273+7*n(3)];return[i,a+(r===0&&Math.abs(a-174)<8?16:0),.6+2.4*n(4)*n(4)]}),...Cn],On=(e,t)=>{let n=t=>R((12-Math.abs(t-e))/8)*R((152-t)/4),r=4*Math.floor(t/4);return n(r)+(n(r+4)-n(r))*(t-r)/4},kn=[[8,0,28,16],[70,0,90,16],[122,0,139,16],[36,0,60,16],[132,0,156,16]],An=(e,t)=>{t=Math.abs(t-140);let n=B((e-80)/300,t/360),r=Math.max((n-.78)/.22,0),i=((e,t)=>{let[n,r]=[0,0];for(let[i,a,o,s=.17,c=0]of dn){let l=B(e-i,t-a),[u,d]=l?[(e-i)/l,(t-a)/l]:[1,0],f=l/o*(.9+.2*N(2.5*u+.37*i,2.5*d+.21*a,9)),p=.03+.045*N(4*u-.1*a,4*d+.1*i,10),m=1-R((f-1-4/o)/.6),h=c?(s+p)*R((f-c)/(1-c))-s:(s+p)*f*f-s;n+=o*(f<1?h:p*m*m),r=Math.max(r,c?R((1.6-f)/(1.5-c)):0)}return[n,r]})(e,t),a=Math.max(Math.abs(e-80)-80,t-140),o=z((a-12)/48)*(1-.7*z(r))*(16*N(e/96,t/96,1)+6*N(e/52,t/52,4)+5*N(e/36,t/36,2)+1.4*N(e/22,t/22,3)-14.2);if(a<0){let n=z((t-16-10*N(e/19,.5,37))/8)*z(-a/10);for(let[r,i,a,o]of Sn)n*=z((B(Math.max(r-e,e-a,0),Math.max(i-t,t-o,0))-(r<a?6:7.5))/6);o=n*Math.min(Math.max(4.8*N(e/15,t/15,21)-.9,0)+Math.max(3*N(e/31,t/31,23)-.6,0),2.6);let r=z((10-B(e-V[0],t-(V[1]-140)))/8);o=o*(1-r)-V[2]*r;for(let n of yn)o+=bn*R((8+xn-t)/xn)*On(n,e);o=t<8?0:o}o=(a<0?o:o*(1-i[1]))+i[0]+((e,t,n)=>{let r=(n,r,i)=>n.reduce((n,[a,o,s,c])=>n*z((B(Math.max(a-e,e-s,0),Math.max(o-t,t-c,0))-r)/i),1);if(n<0){let i=Math.min(Math.max(Math.floor(e),6),gn.length-7),a=Math.max(...gn.slice(i-6,i+7),0);return(.6*Math.max(N(e/5,t/5,61)-.42,0)+.25*Math.max(N(e/9,t/9,67)-.5,0))*z(-n/4)*z((t-14-a)/3)*r(Sn.filter(e=>e[0]===e[2]),7.5,2)*r(Sn.filter(e=>e[0]<e[2]),5.7,2)*r(kn,5.7,2)}let i=z(n/4)*(Math.abs(e-80)<96?z((t-10)/6):1);for(let[n,r,a,o]of fn){let[s,c]=[e-n,t-r],l=s*a+c*o;i*=z((B(Math.max(-22-l,l-38,0),Math.max(Math.abs(s*o-c*a)-10,0))-2)/4)}for(let[n,r,a]of dn)i*=z((B(e-n,t-r)/a-1.3)/.25);return i*=z((B(e-mn[0],t-mn[1])-40)/20),(.75*Math.max(N(e/5,t/5,61)-.42,0)-.8*Math.max(N(e/7,t/7,63)-.6,0)+.25*(N(e/11,t/11,65)-.5))*i})(e,t,a)*(1-i[1])*(1-z(r));for(let[n,r,i,a]of fn){let[s,c]=[e-n,t-r],l=s*i+c*a;o+=5.6*R(Math.min(l/16,(32-l)/12))*R((18-Math.abs(s*a-c*i))/12)}let s=R(B(e-pn[0],Math.max(t-pn[1],0))/36);o+=12*(1-s*s)*(1-s*s)+8*z((36-B(e-mn[0],t-mn[1]))/24);let c=10*r*(1+r);if(n>1){let r=28+14*N(e/170,t/170,5)+6*N(e/70,t/70,7),i=10*z((n-1)/.1);c=(c+r-Math.sqrt((c-r)*(c-r)+i*i))/2*(1-z((n-1.3)/.35))}return o*=1-.55*z((16-B(e-44,t-122))/10),Math.max(o,-14.5)+c},jn=e=>Math.max(.3*e,Math.min(.5*e,.8)),Mn=(e,t,n)=>{let r=t=>Bt(e,t,131),i=e=>{let[t,n]=[2*r(e)-1,2*r(e+1)-1],i=Math.sqrt(t*t+n*n)||1;return[t/i,n/i]},[a,o]=i(1),[s,c]=[t*(.9+.25*r(3)),t*(.68+.22*r(4))],l=.3*r(9)-.15,[u,d]=i(5),[f,p]=i(7),m=t=>{let n=.8+.28*N(1.1*t[0]+e,1.1*t[2]+.9*t[1],e)+.1*N(2.3*t[0]-e,2.3*t[2]+1.7*t[1],e+1),r=R((.8*(t[0]*u+t[2]*d)+.6*t[1]-.55)/.45),i=R((.954*(t[0]*f+t[2]*p)+.3*t[1]-.4)/.6);return n*(1-.14*r*r)*(1-.16*i*i)},h=(n-jn(n))/m([0,1,0]),g=jn(n)+.7*n,_=e=>{if(e[1]<0){let t=Math.sqrt(e[0]*e[0]+e[2]*e[2]);return t<1e-6?g:Math.min(_([e[0]/t,0,e[2]/t])/t,g/-e[1])}let t=(e[0]*a+e[2]*o-l*e[1])/s,n=(e[2]*a-e[0]*o-(.15-l)*e[1])/c,r=e[1]*e[1]/(h*h),[i,u]=[t*t+n*n+.65*r,.35*r*r],d=u<1e-12?1/i:(Math.sqrt(i*i+4*u)-i)/(2*u);return Math.sqrt(d)*m(e)};return{reach:_}},Nn=[.16,.3,.16,.3],Pn=({reach:e},t,n,r,i)=>{let a=(n,r)=>{let i=new Float64Array(8*r),a=[0,0,0];for(let o=0;o<8*r;o++){let s=(o%(2*r)+.5)/r-1,c=Math.floor(o/(2*r)),l=Math.sqrt(1+s*s)*(c>1?-1:1),u=(c%2?-s:1)/l,d=(c%2?1:s)/l,f=0,p=1.6*t;for(let t=0;t<8;t++){let t=(f+p)/2,r=Math.sqrt(t*t+n*n);a[0]=t*u/r,a[1]=n/r,a[2]=t*d/r,r<=e(a)+.07?f=t:p=t}i[o]=f}return i},o=(e,t,n)=>{let r=e.length/8,i=Math.abs(t)>=Math.abs(n);if(Math.abs(t)+Math.abs(n)<1e-9)return!0;let a=(1+(i?n/t:-t/n))*r-.5+2*(i?t>0?0:2:n>0?1:3)*r,o=Math.floor(a),s=e[(o+8*r)%(8*r)]*(1-(a-o))+e[(o+1)%(8*r)]*(a-o);return t*t+n*n<=s*s},s=e([0,1,0])-.1,c=Math.max(.07,Math.min(.12,t/12)),l=[],u=r-ie+.7,d=[n];for(let e=n;e<s-1e-9;){let t=e<r-1e-9?Nn[0]:Nn[1],i=a(e+.03,2),o=Math.min(e===n&&u<s-.3?u:e+.25,s);for(;o<s&&o-e<.9&&a(Math.min(o+.1,s),2).every((e,n)=>Math.abs(e-i[n])<=t);)o=Math.min(o+.1,s);e=s-o<.15?s:o,d.push(e)}let f=d.map((e,t)=>a(t?e:e+.03,8));for(let e=0;e+1<d.length;e++){let[t,n]=[d[e],d[e+1]],a=t<r-1e-9?Nn[2]:Nn[3],s=Math.ceil(Math.min(Math.max(...f[e]),Math.max(...f[e+1]))/c)+1,u=2*s+1,p=new Uint8Array(u*u);for(let t=0;t<u;t++)for(let n=0;n<u;n++){let[r,i]=[(t-s)*c,(n-s)*c];p[t+n*u]=o(f[e],r,i)&&o(f[e+1],r,i)?1:0}let m=Math.max(1,Math.round(a/c)),h=(e,t)=>e>=0&&e<u&&t>=0&&t<u&&p[e+t*u]>0,g=new Uint8Array(u*u);for(let e=0;e<u;e++)for(let t=0;t<u;t++)g[e+t*u]=!h(e,t)||h(e-1,t)&&h(e+1,t)&&h(e,t-1)&&h(e,t+1)?0:1;let _=[],v=new Uint8Array(u),y=u>48?2:1;for(let e=0;e<u;e+=y){v.fill(1);for(let t=e;t<u;t++){let n=!1;for(let r=0,i=0;r<=u;r++)v[r]=r<u&&v[r]&&p[t+r*u]?1:0,v[r]||(r-1-i>=2&&t-e>=2&&(t-e)%y===0&&_.push([e,i,t,r-1]),n||=r-1>i,i=r+1);if(!n)break}}let b=new Int32Array((u+1)*(u+1)),x=(e,t,n,r)=>{let[i,a,o,s]=[Math.max(e,0),Math.max(t,0),Math.min(n,u-1)+1,Math.min(r,u-1)+1];return b[o+s*(u+1)]-b[i+s*(u+1)]-b[o+a*(u+1)]+b[i+a*(u+1)]},ee=[];for(let r=0;r<40&&_.length;r++){for(let e=0;e<u;e++)for(let t=0;t<u;t++)b[t+1+(e+1)*(u+1)]=g[t+e*u]+b[t+(e+1)*(u+1)]+b[t+1+e*(u+1)]-b[t+e*(u+1)];let[a,o]=[-1,0];for(let e=0;e<_.length;e++){let t=_[e];if(r&&!ee.some(e=>t[0]<e[2]&&e[0]<t[2]&&t[1]<e[3]&&e[1]<t[3]))continue;let n=(t[2]-t[0])*(t[3]-t[1]),i=r?x(t[0]-m,t[1]-m,t[2]+m,t[3]+m):2,s=r?1e6*i+n:n;i>=2&&s>o&&([a,o]=[e,s])}if(a<0)break;let[d,f,p,h]=_[a];ee.push(_[a]);for(let e=Math.max(d-m,0);e<=Math.min(p+m,u-1);e++)for(let t=Math.max(f-m,0);t<=Math.min(h+m,u-1);t++)g[e+t*u]=0;l.push([(d-s)*c,e?t:i,(f-s)*c,(p-s)*c,n,(h-s)*c])}}return l},Fn=(e,t)=>{let[n,r]=[Math.floor(e/4),Math.floor(t/4)],[i,a]=[e/4-n,t/4-r],o=(e,t)=>An(4*(n+e),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},In=[[32.5,156.5,3.1,3.45,62],[67.5,159.5,1.86,1.84,63],[97.5,166,2.79,2.99,64],[128,177.5,3.41,3.68,65],[-50,330,3.6,2.9,100],[-64,336,2.4,1.9,101],[-14,204,2.4,1.9,110],[176,212,2.8,2.3,111]].map(([e,t,n,r,i])=>((e,t,n,r,i)=>{let a=Fn(e,t),o=a+jn(r),s=[-3,-2,-1,0,1,2,3].map(e=>.4*n*e),c=s.map(n=>s.map(r=>Fn(e+n,t+r))),l=Math.max(Math.min(...c.flat()),a-.55*r),u=Math.max(...c.flat())+ie;return{at:[e,a,t],R:n,H:r,s:i,parts:Pn(Mn(i,n,r),n,l-o,u-o,l-.5-o).map(([n,r,i,a,s,c])=>[e+n,o+r,t+i,e+a,o+s,t+c])}})(e,t,n,r,i)),[H,U,Ln,Rn]=[9,12,-19,7],zn=dn.filter(e=>e[4]).map(([e,t],n)=>{let r=140+t,i=Array.from({length:2*H},(e,t)=>{let i=Math.abs(t+.5-H),a=Math.sqrt(H*H-i*i),o=e=>Math.ceil(2*a*(.88+.24*N(i/4,e+.5,60+n)))/2;return[r-H+t,r-H+t+1,o(0),o(1)]});return{x:e,z:r,level:An(e,r),rows:i}}),Bn=({x:e,z:t,level:n,rows:r})=>{let i=r.reduce((e,[t,n,r,i])=>{let a=e.at(-1);return a&&a[2]===r&&a[3]===i?a[1]=n:e.push([t,n,r,i]),e},[]),a=r[H][3],o=(n-Ln)/Rn;return[E(e-U,-30,t-U,e+U,n,t-H,L),E(e-U,-30,t+H,e+U,n,t+U,L),...i.flatMap(([t,r,i,a])=>[E(e-U,-30,t,e-i,n,r,L),E(e+a,-30,t,e+U,n,r,L)]),E(e-H-1.5,-30,t-H,e+H+1.5,Ln,t+H,L),...Array.from({length:Rn-1},(n,r)=>E(e+a-1.3*(Rn-1-r),Ln,t-1,e+a-1.3*(Rn-2-r),Ln+o*(r+1),t+1,L))].map(e=>({...e,ghost:!0}))},Vn=(e,t,n,r)=>({...E(e-n,An(e,t)-6,t-n,e+n,An(e,t)+r,t+n,L),ghost:!0}),Hn={dishes:[...Tn,...Tn.map(([e,t])=>[e,280-t])],ramps:fn.flatMap(([e,t,n,r])=>(t?[1,-1]:[1]).map(i=>[e+16*n,140+i*(t+16*r),n,i*r+0])),wreck:En,pits:zn.flatMap(e=>e.z===140?[e]:[e,{...e,z:280-e.z,rows:e.rows.map(([e,t,n,r])=>[280-t,280-e,n,r]).reverse()}]),bowls:dn.flatMap(([e,t,n,r=.17])=>(t?[1,-1]:[1]).map(i=>[e,140+i*t,n,r])),crags:In,sites:Dn,pillars:wn,domes:[k,[k[0],280-k[1]]],pads:[...cn,...cn.map(([e,t,n])=>[e,280-t,n])],modules:[...A,...A.map(sn)],tubes:[...ot,...ot.map(sn)],masts:[...ln,...ln.map(([e,t])=>[e,280-t])]},Un=([e,t,n])=>[e,t,280-n],Wn=(e,...t)=>[...e,...e.map(Un),...t],Gn=[...[E(0,-30,160,160,0,V[1]-12,L),E(0,-30,V[1]-12,V[0]-12,0,V[1]+12,L),E(V[0]+12,-30,V[1]-12,160,0,V[1]+12,L),E(0,-30,V[1]+12,160,0,280,L),E(V[0]-12,-30,V[1]-12,V[0]+12,-3,V[1]+12,L),...vn.filter(e=>e[2]<0).map(([e,t,n])=>E(e,-30,148+n,e+t,0,160,L)),...Array.from({length:14},(e,t)=>_n(gn.map(e=>e<0?2:+(e>t/2))).filter(e=>!e[2]).map(([e,n])=>E(e,-30,148+t/2,e+n,0,t<13?148.5+t/2:160,L))).flat(),...yn.flatMap(e=>[-12,-10,-8,-6,-4,4,6,8,10].map(e=>[e,e+(e===-4?8:2)]).map(([t,n])=>[e+t,e+n,bn*Math.min(On(e,e+t),On(e,e+n))*(1-.5/xn)-.12]).filter(e=>e[2]>.3).map(([e,t,n])=>E(e,0,148,t,n,148.5,L)))].map(e=>({...e,ghost:!0})),...zt,{...E(75.25,0,un-4.75,84.75,.5,un+4.75,on,nn,en),ghost:!0},{...E(75.75,.5,un-4.25,84.25,1,un+4.25,on,nn,en),ghost:!0},...cn.map(([e,t,n])=>E(e-n,0,t-n,e+n,.25,t+n,rn)),...ln.map(([e,t])=>E(e-.2,0,t-.2,e+.2,10,t+.2,an)),E(12,-30,146.75,24,0,148,on,L,[1,.42,.08]),...zn.filter(e=>e.z!==140).flatMap(Bn),...(e=In,e.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>({...E(e,t,n,r,i,a,L),ghost:!0}))),...Tn.map(([e,t])=>Vn(e,t,.4,6))],Kn=[E(74,-1.5,132,86,0,148,rn,an),E(74,0,132,74.4,1.1,148,nn),E(85.6,0,132,86,1.1,148,nn),...wn.map(([e,t,n,r,i])=>({...E(e,-30,t,n,i,r,L),ghost:!0})),{...E(-10,-30,132,0,0,148,L),ghost:!0},{...E(160,-30,132,170,0,148,L),ghost:!0},{...E(En[0]-3.6,-30,En[1]-3.6,En[0]+3.6,Ln+3.5,En[1]+3.6,L),ghost:!0},...zn.filter(e=>e.z===140).flatMap(Bn),...Hn.ramps.flatMap(([e,t,n,r])=>[-8,8].map(i=>Vn(e+i*r,t-i*n,.2,2.2)))],qn=[...[56,68,80,92,104].map(e=>[e,0,271,0]),...[62,80,98].map(e=>[e,0,267,0])],Jn=(e,t)=>{let n=t=>e>140?t:Un(t);return{base:[80,1,e],spawns:t,rack:n([66,0,262]),blade:n([94,0,262]),rifle:n([145,0,191]),rail:n([43,0,158])}},[Yn,Xn,Zn]=((e,t,n)=>{let{R:r,LOW:i,TOP:a}=$t,[o,s,c,l]=[56,104,n-r,n+r],u=[.78,.8,.84],d=[.95,.55,.15],f=[[110.5,t,138.5],[112.5,601.1,141.5]],p=[];for(let u=e-r;u<e+r;u+=4){let d=Math.max(Math.abs(u-e),Math.abs(u+4-e)),f=Math.sqrt(r*r-d*d),m=(e,t,n,r)=>r>n&&p.push({...F(u,e,n,u+4,t,r,Yt),ghost:!0});m(t+i,598,n-f,n+f),m(616,t+a,n-f,n+f);let[h,g]=u<s?u+4>o?[c,l]:[n,n]:u<120?[130,150]:[n,n];m(598,616,n-f,Math.min(h,n+f)),m(598,616,Math.max(g,n-f),n+f);let _=Math.sqrt(Math.max(0,(.75*r)**2-d*d));m(t+a,t+a+I.DOME-2,n-_,n+_);let v=I.BARREL*r+3,y=Math.sqrt(Math.max(0,v*v-d*d));m(t+i-I.GUN,t+i,n-y,n+y)}let m=t+i+(a-i)*I.WING,h=I.BOOM+4*(I.PANEL+I.GAP)+3;for(let t of[-1,1]){let[n,i]=[e+t*r,e+t*(r+h)];p.push({...F(Math.min(n,i),m-1.5,138.5,Math.max(n,i),m+1.5,141.5,Yt),ghost:!0},{...F(Math.min(n,i),m-I.SPAN/2,139.6,Math.max(n,i),m+I.SPAN/2,140.4,Yt),ghost:!0})}p.push({...F(55,t+a+3,133,73,t+a+I.MAST+6,147,Yt),ghost:!0});let g=[[s-2.15,t,137],[s-1.85,603.2,143]];return[[F(o,598,c,s,t,l,Qt,Yt),F(o,614,c,s,616,l,Yt),F(o,t,c,o+4,614,l,P,P,u),F(s-4,t,c,s,614,137,P,P,u),F(s-4,t,143,s,614,l,P,P,u),F(s-4,603.2,137,s,614,143,P,P,u),F(o+4,611,c,s-4,614,c+4,Xt,Xt,d),F(o+4,611,l-4,s-4,614,l,Xt,Xt,d),F(s,598,130,120,t,150,Yt),F(s,604,130,120,605,150,Yt),F(s,t,130,120,604,132,P,P,u),F(s,t,148,120,604,150,P,P,u),F(118,t,132,120,604,148,Zt),F(...f[0],...f[1],Xt,Xt,d),...p],{post:f,hall:[[o,599,c],[120,616,l]],hull:[e,t+i,n,t+a],gun:[e,t+i-I.GUN,n]},{min:g[0],max:g[1]}]})(80,600,140),Qn={name:`Tranquility`,tag:`Moon · half gravity`,lore:`A mining base left in a lunar crater, its domes still lit. Two crews fight for it in space helmets, under the Earth and a black sky. Jumps float twice as high, and a rille cuts the base in two.`,brushes:[...Gn,...Gn.map(e=>({...e,min:[e.min[0],e.min[1],280-e.max[2]],max:[e.max[0],e.max[1],280-e.min[2]],tint:e.tint===en?tn:e.tint})),...Kn,...Yn],teams:[Jn(un,qn),Jn(280-un,qn.map(([e,t,n])=>[e,t,280-n,Math.PI]))],packs:Wn([[90,0,210],[118,5,226],[30,0,185],[80,3.5,253.5]],[45,0,162],[45,0,118]),ammo:Wn([[50,0,246],[103,5,200],[135,0,190]],[115,0,162],[115,0,118]),cells:Wn([[106.5,3.5,226],[35,0,244]],[80,0,140]),vests:Wn([[107,5,200]],[132.5,2.4,140]),floor:-26,relief:{hole:[0,132,160,148],pits:[...vn.flatMap(([e,t,n])=>n>0?[[e,148,e+t,148+n],[e,132-n,e+t,132]]:[]),...Hn.pits.flatMap(({x:e,rows:t})=>t.map(([t,n,r,i])=>[e-r,t,e+i,n]))],bound:[80,140,300,360],cell:4,at:An},sun:{dir:[.87996,.40998,.23999],color:[3,2.95,2.85]},sky:[[.002,.002,.006],[.02,.02,.035]],gravity:.5,rovers:[[100,0,178,0],[30,0,255,0],[100,0,102,Math.PI],[30,0,25,Math.PI]],ships:[...cn.map(([e,t])=>[e,.25,t,0]),...cn.map(([e,t])=>[e,.25,280-t,Math.PI])],doors:[...bt,...bt.map(sn),Zn],scenery:`moon`,helmets:!0,armor:!0,seam:Ze.SEAM,station:Xn},W={MARINE:0,NINJA:1,ASTRONAUT:2,XENO:3,HUNTER:4},$n={run:6,sprint:9,jump:7,double:6,wallrun:75,dashes:1,dash:16,haste:1,ammo:60,rail:240,rifle:240,cool:7,rifleCool:3,mag:15,cap:80,clip:60,damage:1,slow:1,accel:1,parry:0,hp:8,gear:!0,xeno:!1},er=[$n,{run:6*1.2,sprint:9*1.2,jump:9.1,double:6*1.3,wallrun:150,dashes:3,dash:16,haste:2,ammo:30,rail:120,rifle:120,cool:14,rifleCool:6,mag:8,cap:40,clip:30,damage:.5,slow:.55,accel:1,parry:.7,katana:!0,hp:8,gear:!0,xeno:!1},$n,{...$n,run:7.5,sprint:11.25,jump:7*Math.SQRT2,double:6*Math.SQRT2,dashes:3,dash:22.4,accel:1.25,ammo:0,rail:0,rifle:0,mag:0,cap:0,clip:0,hp:12,gear:!1,xeno:!0,girth:.1},{...$n,katana:!0,hunter:!0,ammo:12,mag:1,cap:15,rail:90,girth:.25,size:1.2}],tr=e=>e.helmets?[W.ASTRONAUT,W.XENO,W.HUNTER]:[W.MARINE,W.NINJA,W.XENO,W.HUNTER],nr=(e,t)=>{let n=tr(t);return n.includes(e??-1)?e:n[0]},rr=(e,t)=>nr(e.role,t)==W.XENO?0:e.body??0,ir=(e,t)=>er[nr(e,t)],ar=1024,or=(e,t)=>2048*(e+ar)+t+ar,G=(e,t)=>Math.min(Math.max(Math.floor(e/t),-1024),1023),sr=[],cr=e=>[...new Map([[`1,1,1`,[1,1,1]],...(e.tints??[]).map(e=>[`${e}`,e]),...e.brushes.flatMap(({tint:e})=>e?[[`${e}`,e]]:[])]).values()],lr=(e,t=4)=>{let n=/* @__PURE__ */ new Map;return e.brushes.forEach(({min:e,max:r},i)=>{for(let a=G(e[0],t);a<=G(r[0],t);a++)for(let o=G(e[2],t);o<=G(r[2],t);o++){let e=or(a,o),t=n.get(e);t?t.push(i):n.set(e,[i])}}),{def:e,cell:t,grid:n,...e.relief?{relief:Ht(e.relief)}:{},...e.doors?{doors:e.doors.map(()=>({open:0,wait:0}))}:{}}},ur=/* @__PURE__ */ new Uint32Array,dr=0,K=(e,t,n,r)=>{let i=[];ur.length<e.def.brushes.length&&(ur=new Uint32Array(e.def.brushes.length)),dr=dr+1>>>0||(ur.fill(0),1);for(let a=G(t-r,e.cell);a<=G(t+r,e.cell);a++)for(let t=G(n-r,e.cell);t<=G(n+r,e.cell);t++)for(let n of e.grid.get(or(a,t))??[])ur[n]!==dr&&(ur[n]=dr,i.push(n));return i},fr=(e,t,n,r,i=0)=>{let a=pr(e,t,n,r,i);return e.doors?.forEach(({open:r},o)=>{if(r<.5){let{min:r,max:s}=e.def.doors[o],[c,l]=[0,a];for(let e=0;e<3;e++){let[a,o]=n[e]?[(r[e]-i-t[e])/n[e],(s[e]+i-t[e])/n[e]]:t[e]<r[e]-i||t[e]>s[e]+i?[1,-1]:[-1/0,1/0];c=Math.max(c,Math.min(a,o)),l=Math.min(l,Math.max(a,o))}c<=l&&l>0&&(a=c)}}),e.relief?((e,t,n,r,i=0)=>{let a=e.relief;if(!a||Math.min(t[1],t[1]+n[1]*r)-i>a.top)return r;let[o,s]=[0,r];for(let e of[0,1]){let[r,i,c,l]=[t[2*e],n[2*e],a.hole[e],a.hole[e+2]];if(i){let[e,t]=[(c-r)/i,(l-r)/i];o=Math.max(o,Math.min(e,t)),s=Math.min(s,Math.max(e,t))}else(r<=c||r>=l)&&(s=-1)}let c=r=>t[1]+n[1]*r-i-Ut(e,t[0]+n[0]*r,t[2]+n[2]*r);if(!n[0]&&!n[2]){let e=c(0);return e<0?0:n[1]<0?Math.min(r,e/-n[1]):r}for(let[e,t]of o<s?[[0,o],[s,r]]:[[0,r]]){if(e<t&&c(e)<0)return e;for(let n=e;n<t;n+=1){let e=Math.min(n+1,t);if(c(e)<0){let[t,r]=[n,e];for(let e=0;e<6;e++){let e=(t+r)/2;c(e)<0?r=e:t=e}return t}}}return r})(e,t,n,a,i):a},pr=(e,t,n,r,i)=>{let{cell:a,def:o}=e,s=r,c=G(t[0],a),l=G(t[2],a),u=Math.sign(n[0]),d=Math.sign(n[2]),f=u?((c+ +(u>0))*a-t[0])/n[0]:1/0,p=d?((l+ +(d>0))*a-t[2])/n[2]:1/0,m=u?a/Math.abs(n[0]):1/0,h=d?a/Math.abs(n[2]):1/0;for(;;){for(let r of e.grid.get(or(c,l))??[]){let e=o.brushes[r],[a,c]=[0,s];for(let r=0;r<3&&a<=c;r++){if(!n[r]){(t[r]<e.min[r]-i||t[r]>e.max[r]+i)&&(c=-1);continue}let o=(e.min[r]-i-t[r])/n[r],s=(e.max[r]+i-t[r])/n[r];a=Math.max(a,Math.min(o,s)),c=Math.min(c,Math.max(o,s))}a<=c&&c>0&&a<s&&(s=a)}if(Math.min(f,p)>=s||Math.abs(c)>ar||Math.abs(l)>ar)return s;f<p?(c+=u,f+=m):(l+=d,p+=h)}},mr=(e,t,n)=>{let[r,i,a]=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=Math.hypot(r,i,a);return o>0&&fr(e,t,[r/o,i/o,a/o],o)<o-1e-4},q=1/60,hr=2*Math.PI,gr=1e-6,J=.01,_r=e=>(e%hr+hr)%hr,vr=e=>[-Math.sin(e),-Math.cos(e)],Y=Math.fround,yr=Math.sqrt,br=(e,t,n)=>Math.min(Math.max(e,t),n),X=(e,t)=>yr(e*e+t*t),Z=[[0,0],[1,0],[-1,0],[0,1],[0,-1]],xr={vx:0,vz:0,mode:o.GROUND,t:0,wall:0,edge:0,jumps:1,dashes:1,dash:0,stun:0,coyote:6,buffer:0,held:0,hp:8,armor:0,ammo:-1,cool:0,mag:0,cap:0,reload:0,rack:!1,down:0,shots:0,hits:0,blade:!1,wield:!1,fists:!1,side:-1,sideMag:0,sided:!1,swing:0,cut:0,zap:!1,lost:i.NONE,rail:-1,railed:!1,rifle:-1,clip:0,rifled:!1,nades:0,lob:0,inRifle:!1,inRail:!1,zapping:!1,slow:0,fried:!1,heavy:!1,ev:0,fall:0},Sr=(e,t,n,r=0,i=er[0])=>{let{spawns:a}=t.def.teams[r],[o,s,c,l]=a[(n%a.length+a.length)%a.length];return{id:e,x:Y(o),y:Y(s),z:Y(c),vy:0,yaw:_r(l),pitch:0,ground:!0,...xr,hp:i.hp,blade:!!i.katana,wield:!!i.katana}},Cr=(e,t,n,r=er[0])=>{let{yaw:i,pitch:a,id:o,shots:c,hits:l}=e;Object.assign(e,Sr(o,t,o,n,r),{yaw:i,pitch:a,shots:c,hits:l,ev:e.ev|s.RESPAWN})},wr=e=>e===o.GROUND||e===o.SLIDE||e===o.CROUCH,Tr=e=>e.mode===o.SLIDE||e.mode===o.CROUCH?.9:ie,Er=e=>e.mode===o.SWIM?1.35:e.mode===o.SLIDE||e.mode===o.CROUCH?.7:1.6,Dr=e=>X(e.vx,e.vz),Or=e=>e.mode===o.GROUND&&X(e.vx,e.vz)>6.5,kr=(e,t,n)=>e.max[1]>t+.5+J&&e.min[1]<t+n-J,Ar=(e,t,n)=>[t-br(t,e.min[0],e.max[0]),n-br(n,e.min[2],e.max[2])],jr=(e,t,n)=>Mr(e,t,n,C),Mr=(e,t,n,r)=>{let{brushes:i}=t.def,a=K(t,e.x,e.z,2*r),o=(r-gr)**2,[s,c]=[0,0];for(let t=0;t<4;t++){let t=0,l=0,u=0;for(let s of a){let a=i[s];if(!kr(a,e.y,n))continue;let[c,d]=Ar(a,e.x,e.z),f=c*c+d*d;if(f>=o)continue;if(f){let e=yr(f);r-e>t&&(t=r-e,l=c/e*t,u=d/e*t);continue}let[p,m,h]=[[e.x-a.min[0],-1,0],[a.max[0]-e.x,1,0],[e.z-a.min[2],0,-1],[a.max[2]-e.z,0,1]].reduce((e,t)=>t[0]<e[0]?t:e);p+r>t&&(t=p+r,[l,u]=[m*t,h*t])}if(!t)break;e.x+=l,e.z+=u,s+=l,c+=u}return[s,c]},Nr=(e,t,n)=>{let[[r,i,a],[o,s,c]]=[e.a,e.b],[l,u]=[o-r,c-a],d=l*l+u*u,f=d?br(((t-r)*l+(n-a)*u)/d,0,1):0;return[t-r-f*l,n-a-f*u,i+f*(s-i)]},Pr=(e,t,n,r)=>t>=Math.min(e.a[0],e.b[0])-r&&t<=Math.max(e.a[0],e.b[0])+r&&n>=Math.min(e.a[2],e.b[2])-r&&n<=Math.max(e.a[2],e.b[2])+r,Fr=(e,t,n,r=[])=>{let{brushes:i}=t.def,a=(C-gr)**2,o=Ut(t,e.x,e.z),s=1/0;for(let r of K(t,e.x,e.z,C)){let t=i[r],[c,l]=Ar(t,e.x,e.z);c*c+l*l>=a||(t.max[1]<=e.y+.5+J?o=Math.max(o,t.max[1]):t.min[1]>=e.y+n-J&&(s=Math.min(s,t.min[1])))}for(let t of r){if(!Pr(t,e.x,e.z,t.r+.4))continue;let[r,i,a]=Nr(t,e.x,e.z);r*r+i*i>=(t.r+.4-gr)**2||(a+t.h<=e.y+.5+J?o=Math.max(o,a+t.h):a>=e.y+n-J&&(s=Math.min(s,a)))}return[o,s]},Ir=(e,t,n,r)=>{let i=Ut(e,t,n);for(let a of((e,t,n)=>e.grid.get(or(G(t,e.cell),G(n,e.cell)))??sr)(e,t,n)){let{min:o,max:s}=e.def.brushes[a];t>=o[0]&&t<=s[0]&&n>=o[2]&&n<=s[2]&&s[1]<=r&&(i=Math.max(i,s[1]))}return i},Lr=(e,t)=>{let n=(C-gr)**2;return K(t,e.x,e.z,C).every(r=>{let i=t.def.brushes[r],[a,o]=Ar(i,e.x,e.z);return a*a+o*o>=n||!kr(i,e.y,1.8)})},Rr=(e,t,n,r,i)=>{let a=(C-gr)**2;return K(e,t,n,C).every(o=>{let s=e.def.brushes[o],[c,l]=Ar(s,t,n);return c*c+l*l>=a||s.max[1]<=r||s.min[1]>=i})},zr=(e,t)=>{let[n,r]=Z[t],i=n?0:2;return{a:i,o:2-i,sign:n||r,c:n?e.x:e.z,co:n?e.z:e.x}},Br=(e,t,n,r)=>{let{a:i,o:a,sign:o,c:s,co:c}=zr(t,n),l=((o>0?e.min[i]:e.max[i])-s)*o;return l>=.399&&l<=.4+r&&c>=e.min[a]&&c<=e.max[a]?l:void 0},Vr=(e,t,n)=>{let r;for(let i of K(t,e.x,e.z,.9)){let a=t.def.brushes[i],o=Br(a,e,n,.5);o!==void 0&&a.min[1]<e.y+.5&&a.max[1]>e.y+1.8&&(r=Math.min(r??1/0,Math.max(0,o-C)))}return r},Hr=e=>e>20?Math.ceil((e-20)/2):0,Ur=e=>20*(e.def.gravity??1),Q=(e,t)=>{e.mode=t,e.t=0},Wr=e=>!!e.zap&&e.stun>24,Gr=(e,t)=>{let n=X(e.vx,e.vz);n>t&&(e.vx*=t/n,e.vz*=t/n)},Kr=(e,t,n,r)=>{let[i,a]=[n.wx,n.wz];for(let n of K(t,e.x,e.z,.401)){let o=t.def.brushes[n],[s,c]=Ar(o,e.x,e.z),l=X(s,c);if(l>0&&l<=.401&&kr(o,e.y,r)){let e=(-i*s-a*c)/l;e>0&&(i+=e*s/l,a+=e*c/l)}}return[i,a]},qr=(e,t,n,r=6,i=1)=>{let a=X(t[0],t[1]);if(a<gr){let t=X(e.vx,e.vz),n=t?Math.max(0,t-.75)/t:0;e.vx*=n,e.vz*=n;return}let[o,s]=[t[0]/a,t[1]/a],c=e.vx*o+e.vz*s,[l,u]=[e.vx-c*o,e.vz-c*s],d=X(l,u);if(d){let e=Math.max(0,d-.75)/d;[l,u]=[l*e,u*e]}c=c<(n*=a)?Math.min(n,c+(c>=r?3:50)*i*q):Math.max(n,c-.2),e.vx=l+c*o,e.vz=u+c*s},Jr=(e,t,n)=>{Yr(e,t,Tr(e),0,!1,n),[e.x,e.y,e.z]=[Y(e.x),Y(e.y),Y(e.z)]},Yr=(e,t,n,r,i,a)=>{let o=e.y;e.x+=e.vx*q,e.z+=e.vz*q;let[s,c]=jr(e,t,n),[l,u]=((e,t,n)=>{let[r,i]=[0,0];for(let a of t){let t=a.r+C;if(!Pr(a,e.x,e.z,t))continue;let[o,s,c]=Nr(a,e.x,e.z),l=o*o+s*s;if(l>=(t-gr)**2||c+a.h<=e.y+.5+J||c>=e.y+n-J)continue;let u=yr(l),[d,f]=[a.b[0]-a.a[0],a.b[2]-a.a[2]],p=X(d,f),[m,h]=u?[o/u,s/u]:p?[f/p,-d/p]:[1,0];e.x+=m*(t-u),e.z+=h*(t-u),r+=m*(t-u),i+=h*(t-u)}return[r,i]})(e,a,n);if(l||u){let[r,i]=jr(e,t,n);s+=l+r,c+=u+i}let d=X(s,c);if(d){let t=(e.vx*s+e.vz*c)/d;t<0&&(e.vx-=t*s/d,e.vz-=t*c/d)}Wt(e,t);let[f,p]=Fr(e,t,n,a),m=e.vy-r*Ur(t)*q;if(e.y+=(e.vy+m)/2*q,e.vy=m,e.y+n>p&&(e.y=p-n,e.vy=Math.min(e.vy,0)),e.vy<=0?e.y<=f+J:e.y<f){if(e.y=f,e.vy<=0){let t=-e.vy;return e.vy=0,t}}else if(i&&e.vy<=0&&f>=o-.5)return e.y=f,e.vy=0,0;return-1},Xr=(e,t)=>{e.vy=t,e.coyote=0,e.buffer=0,e.ev|=s.JUMP},Zr=e=>(e.def.water??0)-1.1,Qr=(e,t,r,i)=>{let a=(r.keys&n.CROUCH)!==0;if(e.buffer>0&&(e.mode===o.GROUND||Lr(e,t)))return e.ev|=e.mode===o.SLIDE?s.SLIDE_END:0,Q(e,o.AIR),void Xr(e,r.kit.jump);let c=X(e.vx,e.vz);if(e.mode===o.GROUND&&a){let t=c>=7.5;Q(e,t?o.SLIDE:o.CROUCH),e.ev|=t?s.SLIDE_START:0}else e.mode===o.SLIDE&&(e.t>=60||c<4.5||r.stumble)?(e.ev|=s.SLIDE_END,Q(e,!a&&Lr(e,t)?o.GROUND:o.CROUCH)):e.mode===o.SLIDE&&!a&&Lr(e,t)?(e.ev|=s.SLIDE_END,Q(e,o.GROUND)):e.mode===o.CROUCH&&!a&&Lr(e,t)&&Q(e,o.GROUND);if(!i){if(r.stumble){if(c>2.5){let t=Math.max(2.5,c-.2)/c;e.vx*=t,e.vz*=t}else qr(e,Kr(e,t,r,Tr(e)),2.5)}else if(e.mode===o.SLIDE){let t=Math.max(0,c-4*q)/c;e.vx*=t,e.vz*=t}else if(e.mode===o.CROUCH)qr(e,Kr(e,t,r,.9),3);else{let i=(r.keys&n.SPRINT)!==0&&r.fwd,a=r.kit.run*r.pace;qr(e,Kr(e,t,r,ie),i?r.kit.sprint*r.pace:a,a,r.kit.accel)}}},$r=(e,t,n,r)=>{if(e.buffer>0&&(e.coyote>0?Xr(e,n.kit.jump):e.jumps>0&&!((e,t)=>{if(e.vy>=0)return!1;let[n]=Fr(e,t,ie);return e.y-n<=.1*-e.vy+.5*Ur(t)*.1*.1})(e,t)&&(e.jumps--,Xr(e,n.kit.double),e.ev=e.ev&~s.JUMP|s.DOUBLE)),r||!n.wx&&!n.wz)return;let i=X(e.vx,e.vz);e.vx+=14*n.wx*q,e.vz+=14*n.wz*q,Gr(e,Math.max(i,6))},ei=(e,t,r,i=0,a=[],c=er[0])=>{e.yaw=_r(t.yaw),e.pitch=Math.max(-1.55,Math.min(1.55,t.pitch));let l=(t.keys&n.FORWARD?1:0)-(t.keys&n.BACK?1:0),u=(t.keys&n.RIGHT?1:0)-(t.keys&n.LEFT?1:0),d=Wr(e)?1/0:X(l,u)||1,[f,p]=vr(e.yaw),m=n=>(t.keys&n)!==0&&(e.held&n)===0,h=e.stun>0,g=e.mode===o.RIDE,_={keys:t.keys,stumble:h,jump:!h&&!g&&m(n.JUMP),dash:!h&&!g&&m(n.DASH),fwd:l>0,wx:(f*l-p*u)/d,wz:(p*l+f*u)/d,fx:f,fz:p,bodies:a,kit:c,pace:e.fists||e.wield||!(e.ammo>=0||(e.rail??-1)>=0||(e.rifle??-1)>=0)?1:c.slow},v=e.mode;e.ev=0,e.fall=0,_.jump&&(e.buffer=7),h&&e.stun--,e.dash>0&&(e.dash--,e.dash===50&&Gr(e,10)),e.mode===o.HANG&&((e,t,r)=>{let[i,a]=Z[e.wall],s=t=>{Q(e,t),e.edge=0};if(r.keys&(n.BACK|n.CROUCH))s(o.AIR),e.coyote=0;else if(r.jump&&r.fx*i+r.fz*a<0)s(o.AIR),e.vx=4*-i,e.vz=4*-a,Xr(e,6);else if(r.jump||r.fwd&&e.t>=6)Q(e,o.CLIMB);else if(e.t>=30)s(o.AIR),e.coyote=0;else{let n=Math.max(e.edge-2,Fr(e,t,ie)[0]);e.y+=br(n-e.y,-8*q,8*q)}})(e,r,_),e.mode===o.CLING&&((e,t,r)=>{let[i,a]=Z[e.wall],c=((e,t,n)=>{let{a:r,sign:i}=zr(e,n),a;for(let o of K(t,e.x,e.z,.9)){let s=t.def.brushes[o],c=Br(s,e,n,.5);if(c!==void 0&&s.max[1]>e.y+.4&&s.min[1]<e.y+1.8){let e=Math.max(0,c-C);a={gap:Math.min(a?.gap??1/0,e),top:Math.max(a?.top??-1/0,s.max[1]),face:i>0?s.min[r]:s.max[r]}}}return a})(e,t,e.wall);if(r.keys&n.CROUCH||!c)return Q(e,o.AIR),void(e.coyote=0);if(r.jump){Q(e,o.AIR);let[t,n]=[10*Math.cos(e.pitch),10*Math.sin(e.pitch)],[s,c]=[Math.max(n,3.25),(r.fz*i-r.fx*a)*t];e.vx=-i*s-a*c,e.vz=-a*s+i*c,Xr(e,(r.fx*i+r.fz*a)*t);return}let l=(r.keys&n.FORWARD?1:0)-(r.keys&n.BACK?1:0),u=(r.keys&n.RIGHT?1:0)-(r.keys&n.LEFT?1:0),[d,f]=[-a,i],[p,m]=[r.fx*i+r.fz*a,r.fx*d+r.fz*f],[h,g]=[l*p-u*m,l*m+u*p],_=Math.sqrt(h*h+g*g),v=Math.sqrt(e.vx*e.vx+e.vy*e.vy+e.vz*e.vz),y=r.keys&n.SPRINT,b=r.kit.run*r.pace*(y?1:.5),x=y?r.kit.sprint*r.pace:b,ee=v>x?Math.max(x,v-.2):Math.min(x,Math.max(b,v+3*r.kit.accel*q)),te=_>1?ee/_:ee,ne=h>.05?1:h<-.05?-1:0,S=g*te,{a:re,sign:ie}=zr(e,e.wall);if(ne>0&&c.top<e.y+1.8){let n=c.face+.2*ie,[r,i]=re===0?[n,e.z]:[e.x,n];if(Rr(t,r,i,c.top+J,c.top+1.8))return Q(e,o.CLIMB),e.edge=Y(c.top),void(e.vx=e.vy=e.vz=0)}e.vx=d*S,e.vz=f*S,e.vy=ne>0&&c.top-e.y<=.45?0:h*te;let ae=Math.min(c.gap,4*q);e.x+=i*ae,e.z+=a*ae,Yr(e,t,1.8,0,!1,r.bodies)>=0&&ne<0&&(Q(e,o.GROUND),e.wall=0,e.coyote=6,e.ev|=s.LAND)})(e,r,_),e.mode===o.SWIM?((e,t,r)=>{let i=.1,a=Zr(t),s=(r.keys&n.FORWARD?1:0)-(r.keys&n.BACK?1:0),c=s!==0&&(e.pitch<0||e.y<a-J)?Math.cos(e.pitch):1;e.vx+=(4*r.wx*c-e.vx)*i,e.vz+=(4*r.wz*c-e.vz)*i,e.vy+=((s===0?1.5:s*Math.sin(e.pitch)*4)-e.vy)*i,Yr(e,t,Tr(e),0,!1,r.bodies),Fr(e,t,Tr(e),r.bodies)[0]>=a-J?(e.y=Math.max(e.y,a),e.vy=0,e.jumps=1,e.dashes=r.kit.dashes,Q(e,o.GROUND)):e.y>a&&(e.y=a,e.vy=Math.min(e.vy,0))})(e,r,_):e.mode===o.CLIMB?((e,t)=>{let[n,r]=Z[e.wall];e.y<e.edge?e.y=Math.min(e.edge,e.y+8*q):(e.x+=5.5*n*q,e.z+=5.5*r*q),e.y>=e.edge&&((e,t)=>{let{a:n,o:r,sign:i,c:a,co:o}=zr(e,e.wall);return K(t,e.x,e.z,0).some(s=>{let c=t.def.brushes[s],l=i>0?a-c.min[n]:c.max[n]-a;return Y(c.max[1])===e.edge&&o>=c.min[r]&&o<=c.max[r]&&l>=.2})})(e,t)?(Q(e,o.GROUND),e.vx=3*n,e.vz=3*r,e.vy=0,e.edge=0,e.wall=0,e.coyote=6,e.ev|=s.CLIMB):e.t>=40&&(Q(e,e.y>=e.edge?o.GROUND:o.AIR),e.edge=0,e.wall=0)})(e,r):e.mode===o.HANG||e.mode===o.CLING||g||((e,t,r)=>{let i=e.mode===o.GROUND,a=r.kit.dashes>1;if(a&&i&&e.dash===0&&(e.dashes=r.kit.dashes),r.dash&&(e.dash===0||a&&e.dashes>0&&e.dash<=44)&&(i?!a||e.dashes>0:(e.mode===o.AIR||e.mode===o.WALLRUN)&&e.dashes>0)){let[t,n]=r.wx||r.wz?[r.wx,r.wz]:[r.fx,r.fz];e.dashes-=+(i&&a),i||(e.dashes--,e.vy=0,e.mode===o.WALLRUN&&(Q(e,o.AIR),e.ev|=s.WALLRUN_END)),e.vx=t*r.kit.dash,e.vz=n*r.kit.dash,e.dash=60,e.ev|=s.DASH}let c=e.dash>50;e.mode===o.WALLRUN&&((e,t,n)=>{let[r,i]=Z[e.wall],a=e.vx*r+e.vz*i,[c,l]=[e.vx-a*r,e.vz-a*i],u=X(c,l);if(n.jump){Q(e,o.AIR);let t=u>0?1+2/u:1;e.vx=c*t-6.5*r,e.vz=l*t-6.5*i,Xr(e,7.5),e.jumps=1,e.dashes=n.kit.dashes,e.ev|=s.WALLRUN_END}else{let a=Vr(e,t,e.wall);if(a===void 0||!n.fwd||u<3.5||e.t>=n.kit.wallrun)return Q(e,o.AIR),void(e.ev|=s.WALLRUN_END);let d=Math.max(0,u-.025)/u;e.vx=c*d,e.vz=l*d;let f=Math.min(a,4*q);e.x+=r*f,e.z+=i*f}})(e,t,r),wr(e.mode)&&Qr(e,t,r,c),e.mode===o.AIR&&$r(e,t,r,c);let l=c&&e.vy<=0?0:e.mode===o.WALLRUN?.15:1,u=e.mode,d=[X(e.vx,e.vz),e.vx,e.vz],f=Yr(e,t,Tr(e),l,wr(u),r.bodies);if(f>=0){if(!wr(e.mode)){if(e.ev|=s.LAND|(e.mode===o.WALLRUN?s.WALLRUN_END:0),e.fall=f,e.jumps=1,e.dashes=r.kit.dashes,e.wall=0,r.keys&n.CROUCH){let t=X(e.vx,e.vz)>=7.5;Q(e,t?o.SLIDE:o.CROUCH),e.ev|=t?s.SLIDE_START:0}else Q(e,o.GROUND)}e.coyote=6}else wr(e.mode)&&(e.ev|=e.mode===o.SLIDE?s.SLIDE_END:0,Q(e,o.AIR));if((e.mode!==o.AIR&&e.mode!==o.GROUND||!((e,t,r,i)=>{if(!r.kit.xeno||!r.fwd||!(r.keys&n.SPRINT)||r.stumble)return!1;let a=e.mode===o.AIR?.5:.05;for(let n=1;n<=4;n++){let[c,l]=Z[n],u=Vr(e,t,n);if(n!==e.wall&&r.fx*c+r.fz*l>=.6&&u!==void 0&&u<=a){Q(e,o.CLING),e.wall=n;let[t,a]=[-l,c],u=Math.min(1,r.kit.sprint*r.pace/Math.max(i[0],gr)),d=(i[1]*t+i[2]*a)*u;return e.vx=t*d,e.vz=a*d,e.vy=Math.sqrt(Math.max(0,(i[0]*u)**2-d*d)),e.jumps=1,e.coyote=0,e.ev|=s.GRAB,!0}}return!1})(e,t,r,d))&&e.mode===o.AIR){let n=((e,t)=>{let[n,r]=vr(e.yaw),i;for(let a=1;a<=4;a++){let[o,s]=Z[a];if(a===e.wall||n*o+r*s<.5)continue;let{a:c,sign:l}=zr(e,a);for(let n of K(t,e.x,e.z,C+.2)){let r=t.def.brushes[n],o=r.max[1],s=o-e.y;if(Br(r,e,a,.2)===void 0||s<1.2||s>2.4||r.min[1]>o-.25||i&&i.top>=o)continue;let u=l>0?r.min[c]:r.max[c],d=u-l*(C+.03),f=u+.2*l,[p,m]=c===0?[d,e.z]:[e.x,d],[h,g]=c===0?[f,e.z]:[e.x,f];Rr(t,p,m,Math.min(e.y,o-2)+J,o+1.8)&&Rr(t,h,g,o+J,o+1.8)&&(i={side:a,top:o,hang:d})}}return i})(e,t);n?((e,t,n)=>{Q(e,o.HANG),e.wall=t.side,e.edge=Y(t.top),t.side<=2?e.x=t.hang:e.z=t.hang,e.vx=e.vy=e.vz=0,e.jumps=1,e.dashes=n,e.coyote=0,e.buffer=0,e.ev|=s.GRAB})(e,n,r.kit.dashes):((e,t,n)=>{if(!n.fwd)return;let r=X(e.vx,e.vz);if(!(r<4.5))for(let i=1;i<=4;i++){let[a,c]=Z[i],l=e.vx*a+e.vz*c,[u,d]=[e.vx-l*a,e.vz-l*c];if(i!==e.wall&&l<=.75*r&&l>=-.2*r&&Vr(e,t,i)!==void 0){let t=X(u,d),a=Math.max(t,.9*r)/t;Q(e,o.WALLRUN),e.wall=i,[e.vx,e.vz]=[u*a,d*a],e.vy=br(e.vy,2,3),e.jumps=1,e.dashes=n.kit.dashes,e.coyote=0,e.ev|=s.WALLRUN_START;return}}})(e,t,r)}})(e,r,_),((e,t)=>{t.def.water===void 0||e.y>=Zr(t)-.02||e.mode!==o.GROUND&&e.mode!==o.AIR&&e.mode!==o.CROUCH&&e.mode!==o.SLIDE&&e.mode!==o.WALLRUN||(Q(e,o.SWIM),e.y=Zr(t),e.vy=0,e.dash=0,e.wall=0)})(e,r),e.slow&&(e.slow--,Gr(e,3)),e.y<r.def.floor&&e.mode!==o.SWIM&&Cr(e,r,i,c),e.t=e.mode===v?Math.min(255,e.t+1):e.t,e.buffer=Math.max(0,e.buffer-1),e.mode===o.AIR&&v===o.AIR&&(e.coyote=Math.max(0,e.coyote-1)),e.held=t.keys&(n.JUMP|n.DASH|n.USE),e.ground=wr(e.mode),e.x=Y(e.x),e.y=Y(e.y),e.z=Y(e.z),e.vx=Y(e.vx),e.vy=Y(e.vy),e.vz=Y(e.vz),e.edge=Y(e.edge)},ti=class{a=/* @__PURE__ */ new Float64Array(65536);length=0;room(e){let t=this.length+e;if(t>this.a.length){let e=new Float64Array(Math.max(t,2*this.a.length));e.set(this.a),this.a=e}return this.a}push(...e){let t=this.room(e.length);for(let n=0;n<e.length;n++)t[this.length++]=e[n]}slice(e,t){return Array.from(this.a.subarray(e,t))}},ni=(e,t)=>Array.isArray(e)?e:e.room(t),ri=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],ii=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]],ai=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],oi=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n],si=e=>{let t=Math.hypot(...e)||1;return[e[0]/t,e[1]/t,e[2]/t]},ci=-1.25,li=-1.12,ui=-1.42,di=-2.2,[fi,pi]=[-1.45,.04],[mi,hi]=[-1.36,1e-4],gi=-1.06,_i=[.3,.2,.14],vi=-1.17,yi=-1.19,bi=-1.135,xi=-.94,Si=(e,t,n=0)=>{let[r,i,a,o,s,c]=[e,t,n].flatMap(e=>[Math.sin(e),Math.cos(e)]),l=[i,0,-r],u=[r*a,o,i*a];return[l.map((e,t)=>e*c-u[t]*s),u.map((e,t)=>e*c+l[t]*s),[-r*o,a,-i*o]]},Ci=(e,t,n=[0,0,0])=>{let r=[],i=e.filter((t,n)=>!n||Math.hypot(t[0]-e[n-1][0],t[1]-e[n-1][1])>1e-9),a=i.slice(1).map(([e,t],n)=>{let[r,a]=i[n],o=Math.hypot(e-r,t-a);return[(t-a)/o,-(e-r)/o]}),o=i.map(([e],t)=>{let[n,r]=[0,1].map(e=>(a[t-1]?.[e]??0)+(a[t]?.[e]??0)),i=Math.hypot(n,r);return e?[n/i,r/i]:[0,Math.sign(r)]}),s=(e,a)=>{let[s,c]=i[a],[l,u]=[Math.cos(e*hr/t),Math.sin(e*hr/t)];r.push(n[0]+s*l,n[1]+s*u,n[2]-c,o[a][0]*l,o[a][0]*u,-o[a][1])};for(let e=1;e<i.length;e++)for(let n=0;n<t;n++)[...i[e-1][0]?[[n,e-1],[n+1,e-1],[n+1,e]]:[],...i[e][0]?[[n,e-1],[n+1,e],[n,e]]:[]].forEach(([e,t])=>s(e,t));return r},wi=(e,t,n,[r,i],a)=>{let o=(e,t,n,r)=>Array.from({length:t},(i,a)=>{let o=a*hr/t/4;return[e*Math.sin(o),n-r*e*Math.cos(o)]});return Ci([...r?o(t[0],r,0,1):[[0,0]],...t.map((n,r)=>[n,e*r/(t.length-1)]),...i?o(t[t.length-1],i,e,-1).reverse():[[0,e]]],n,a)},Ti=(e,[t,n,r])=>Array.from({length:e.length*(10/6)},(i,a)=>{let[o,s]=[Math.floor(a/10),a%10];return s<6?e[6*o+s]:[t,n,-1,r][s-6]}),Ei=[[5,1],[7,2],[10,3]],Di=/* @__PURE__ */ new Map,Oi=(e,t,n,r=[1,1])=>{let[i,a]=Ei[e];!e&&n.length>3&&(n=[n[0],n[n.length>>1],n[n.length-1]]);let o=`${e} ${t} ${n} ${r}`,s=Di.get(o);return s||(s=Ti(wi(t,n,i,r.map(e=>Math.ceil(a*e))),[1,1,1]),Di.set(o,s)),s},ki=(e,t,n,[r,i,a],o,s,c=[1,1,1])=>{let[l,u,d]=typeof s==`number`?[s,s,s]:s,f=l==u&&u==d,[p,m,h,g,_,v,y,b,x]=[...r,...i,...a],ee=n[0]+p*o[0]+g*o[1]+y*o[2],te=n[1]+m*o[0]+_*o[1]+b*o[2],ne=n[2]+h*o[0]+v*o[1]+x*o[2];for(let n=0;n<t.length;n+=10){let[r,i,a]=[t[n]*l,t[n+1]*u,t[n+2]*d],[o,s,S]=[t[n+3],t[n+4],t[n+5]];if(!f){[o,s,S]=[o/l,s/u,S/d];let e=Math.sqrt(o*o+s*s+S*S)||1;[o,s,S]=[o/e,s/e,S/e]}e.push(ee+p*r+g*i-y*a,te+m*r+_*i-b*a,ne+h*r+v*i-x*a,p*o+g*s-y*S,m*o+_*s-b*S,h*o+v*s-x*S,t[n+6]*c[0],t[n+7]*c[1],t[n+8],t[n+9]*c[2])}},Ai=(e,t,n)=>{let r=ni(e,0);for(let i=t;n<1&&i<e.length;i+=10)r[i+8]==-2&&(r[i+6]*=n,r[i+7]*=n,r[i+9]*=n)},ji=(e,t)=>{let n=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],r=t.map((t,r)=>t-e[r]*n),i=Math.hypot(...r)||1,[a,o,s]=r.map(e=>e/i);return[[a,o,s],[o*e[2]-s*e[1],s*e[0]-a*e[2],a*e[1]-o*e[0]],e]},Mi=(e,t,n,r,i,a,o=1,s)=>{let c=[r[0]-n[0],r[1]-n[1],r[2]-n[2]],l=Math.hypot(...c)||1,[u,d]=typeof o==`number`?[o,o]:o;ki(e,t,n,ji([c[0]/l,c[1]/l,c[2]/l],i),[0,0,0],[u,d,l/a],s)},Ni={PELVIS:0,SPINE:1,CHEST:2,NECK:3,HEAD:4,CLAVICLE_L:5,ARM_L:6,FOREARM_L:7,HAND_L:8,CLAVICLE_R:9,ARM_R:10,FOREARM_R:11,HAND_R:12,THIGH_L:13,SHIN_L:14,FOOT_L:15,TOE_L:16,THIGH_R:17,SHIN_R:18,FOOT_R:19,TOE_R:20},Pi=Object.keys(Ni).length,Fi=[-1,0,1,2,3,2,5,6,7,2,9,10,11,0,13,14,15,0,17,18,19],Ii=[[0,.98,0],[0,.12,0],[0,.2,0],[0,.22,0],[0,.1,0],[-.04,.17,0],[-.15,0,0],[-.03,-.29,0],[0,-.26,0],[.04,.17,0],[.15,0,0],[.03,-.29,0],[0,-.26,0],[-.1,-.05,0],[0,-.44,0],[0,-.43,0],[0,-.04,-.13],[.1,-.05,0],[0,-.44,0],[0,-.43,0],[0,-.04,-.13]],Li={MALE:0,FEMALE:1},$=Ii.map(e=>[...e]);$[1]=[0,.115,0],$[2]=[0,.19,0],$[3]=[0,.21,0],$[4]=[0,.095,0],[-1,1].forEach((e,t)=>{$[5+4*t]=[.035*e,.16,0],$[6+4*t]=[.132*e,0,0],$[7+4*t]=[.026*e,-.275,0],$[8+4*t]=[0,-.25,0],$[13+4*t]=[.104*e,-.05,0]});var Ri=[Ii,$],zi=[0,0,0,1],Bi=(e=[0,0,0],t=0,n=0)=>({at:e,yaw:t,hips:[0,0,0],rot:Array.from({length:Pi},()=>[...zi]),...n?{rest:Ri[n]}:{}}),Vi=([e,t,n,r],[i,a,o,s])=>[r*i+e*s+t*o-n*a,r*a-e*o+t*s+n*i,r*o+e*a-t*i+n*s,r*s-e*i-t*a-n*o],Hi=([e,t,n],r)=>{let i=Math.sin(r/2);return[e*i,t*i,n*i,Math.cos(r/2)]},Ui=(e,[t,n,r])=>{let[i,a,o,s]=e,[c,l,u]=[2*(a*r-o*n),2*(o*t-i*r),2*(i*n-a*t)];return[t+s*c+a*u-o*l,n+s*l+o*c-i*u,r+s*u+i*l-a*c]},Wi=(e,t,n)=>{let r=e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],i=r<0?-1:1;if(r*=i,r>.9995){let r=e.map((e,r)=>e+(i*t[r]-e)*n),a=Math.hypot(...r);return r.map(e=>e/a)}let a=Math.acos(r),[o,s]=[Math.sin((1-n)*a),Math.sin(n*a)*i],c=1/Math.sin(a);return e.map((e,n)=>(e*o+t[n]*s)*c)},Gi=e=>{let t=[],n=[],r=Hi([0,1,0],e.yaw),i=e.rest??Ri[0];for(let a=0;a<Pi;a++){let o=Fi[a],s=o<0?r:n[o];n[a]=Vi(s,e.rot[a]);let c=Ui(s,a===0?i[0].map((t,n)=>t+e.hips[n]):i[a]),l=o<0?e.at:t[o];t[a]=[l[0]+c[0],l[1]+c[1],l[2]+c[2]]}return{pos:t,rot:n}},Ki=[1,.62],qi=2.2,Ji=e=>{let t=parseInt(de[e].slice(1),16);return[t>>16,t>>8&255,255&t].map(e=>e/255)},Yi=(e,n,r)=>e.flatMap((e,i)=>{if(e.state===t.DROPPED)return[{team:i,at:[e.x,e.y,e.z],dropped:!0}];if(e.state===t.CARRIED){let t=r(e.by);return t?[{team:i,at:[t.x,t.y,t.z],by:{id:e.by,yaw:t.yaw,vx:t.vx,vz:t.vz}}]:[]}return[{team:i,at:n[i]}]}),Xi=[[1,0,0],[0,1,0],[0,0,1]],Zi=(e,t,n)=>{let r=ni(e,0);for(let i=t;i<e.length;i+=10)r[i+6]*=n,r[i+7]*=n,r[i+9]*=n,r[i+8]=-2},Qi=(e,t,n,r,[i,a,o])=>{let[s,c,l]=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],[u,d,f]=[r[0]-t[0],r[1]-t[1],r[2]-t[2]],p=[c*f-l*d,l*u-s*f,s*d-c*u],m=Math.hypot(...p)||1;if(Array.isArray(e))for(let s of[t,n,r])e.push(...s,p[0]/m,p[1]/m,p[2]/m,i,a,-1,o);else{let s=e.room(30),c=e.length,l=p[0]/m,u=p[1]/m,d=p[2]/m;for(let e of[t,n,r])s[c++]=e[0],s[c++]=e[1],s[c++]=e[2],s[c++]=l,s[c++]=u,s[c++]=d,s[c++]=i,s[c++]=a,s[c++]=-1,s[c++]=o;e.length=c}},$i=(e,t,n,r,i)=>{for(let a=0;a<28;a++){let[o,s]=[a,a+1].map(e=>2*e*Math.PI/28),c=(e,n)=>[t[0]+e*Math.cos(n),t[1],t[2]+e*Math.sin(n)];Qi(e,c(n,o),c(r,s),c(r,o),i),Qi(e,c(n,o),c(n,s),c(r,s),i)}},ea=(e,t,n,r)=>{((e,t,n,r)=>{for(let i=0;i<28;i++){let[a,o]=[i,i+1].map(e=>2*e*Math.PI/28);Qi(e,t,[t[0]+n*Math.cos(o),t[1],t[2]+n*Math.sin(o)],[t[0]+n*Math.cos(a),t[1],t[2]+n*Math.sin(a)],r)}})(e,[t[0],t[1]+.04,t[2]],1.5,n.map(e=>.4*e));let i=e.length;$i(e,[t[0],t[1]+.045,t[2]],1.34,1.5,n),Zi(e,i,qi*(.75+.25*Math.sin(3*r)))},ta=(e,t,n,[r,i],a,o,s)=>{let c=[-n[2],0,n[0]],l=(e,s)=>{let l=a*e*Math.sin(7*o-5*e),u=i*s*(1-e);return[t[0]+n[0]*r*e+c[0]*l,t[1]-u+.12*r*e*Math.sin(5*o-4*e)*a,t[2]+n[2]*r*e+c[2]*l]};for(let t=0;t<8;t++){let[n,r]=[t/8,(t+1)/8],[i,a,o,c]=[l(n,0),l(r,0),l(r,1),l(n,1)],u=[(a[1]-i[1])*(c[2]-i[2])-(a[2]-i[2])*(c[1]-i[1]),(a[2]-i[2])*(c[0]-i[0])-(a[0]-i[0])*(c[2]-i[2]),(a[0]-i[0])*(c[1]-i[1])-(a[1]-i[1])*(c[0]-i[0])],d=Math.hypot(...u)||1,f=(e,t)=>[e[0]+u[0]/d*.004*t,e[1]+u[1]/d*.004*t,e[2]+u[2]/d*.004*t];for(let t of[1,-1]){let n=[i,a,o,c].map(e=>f(e,t)),[r,l,u,d]=t>0?n:[n[0],n[3],n[2],n[1]];Qi(e,r,l,u,s),Qi(e,r,u,d,s)}}},na=(e,t,n,r)=>{Mi(e,Oi(1,1,[1,1],[0,0]),t,n,[.6,0,.8],1,.045,[.82,.84,.9]);let i=e.length;ki(e,Oi(1,0,[1,1]),n,Xi,[0,0,0],.09,r),Zi(e,i,qi)},ra=(e,t,n,r,i)=>{let[a,o,s]=t.at,c=r+1.7*t.team;if(t.by){let{yaw:r,vx:l,vz:u}=t.by,d=-Math.sin(r),f=-Math.cos(r),p=Math.hypot(l,u),[m,h]=i??[[a,o+1.3,s],Hi([0,1,0],r)],g=e=>Ui(h,e).map((e,t)=>m[t]+e),_=g([0,-.4,.2]),v=g([0,1.5499999999999998,.42]),[y,b]=p>1?[-l/p,-u/p]:[-d,-f];na(e,_,v,n);let x=Math.min(1,p/8);ta(e,v,[y,0,b],[Ki[0]*(.7+.5*x),Ki[1]],.1+.16*x,c,n);return}if(t.dropped){let t=12.9898*a+78.233*s,[i,l]=[Math.cos(t),Math.sin(t)],u=[a+2.3*i,o+.6,s+2.3*l];na(e,[a,o+.06,s],u,n),ta(e,u,[i,0,l],[.8*Ki[0],.8*Ki[1]],.04,c,n);let d=e.length;$i(e,[a,o+.045,s],1.4,1.5,n),Zi(e,d,qi*(.5+.5*Math.abs(Math.sin(5*r))));return}let l=[a,o+2.4,s];na(e,[a,o,s],l,n);let u=.6+t.team*Math.PI;ta(e,l,[Math.cos(u),0,Math.sin(u)],Ki,.18,c,n)},ia=[[1,0,0],[0,0,1],[0,1,0]],aa=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],oa=(e,t,n,r)=>{let i=aa(ri(t[1],t[0]),ri(t[2],t[0])),a=r&&ai(i,ri(t[0],r))<0?[...t].reverse():t;for(let t=1;t<a.length-1;t++)Qi(e,a[0],a[t],a[t+1],n)},sa=(e,t,n,r,i=0)=>{let a=t.map((e,t)=>(e+n[t])/2),o=e=>[1&e?n[0]:t[0],2&e?n[1]:t[1],4&e?n[2]:t[2]];for(let t of[[0,1,3,2],[4,5,7,6],[0,1,5,4],[2,3,7,6],[0,2,6,4],[1,3,7,5]].filter((e,t)=>!(i>>t&1)))oa(e,t.map(o),r,a)},ca=(e,t,n)=>{let r=e.length;n(),Zi(e,r,t)};export{si as $,ye as $n,N as $t,li as A,Ie as An,ir as At,ii as B,ie as Bn,Rn as Bt,Wi as C,Se as Cn,mr as Ct,hi as D,De as Dn,er as Dt,mi as E,ce as En,cr as Et,ci as F,oe as Fn,gn as Ft,ai as G,Je as Gn,I as Gt,Si as H,he as Hn,jn as Ht,gi as I,Ze as In,Qn as It,ki as J,Ye as Jn,Jt,Ti as K,Ge as Kn,Gt as Kt,yi as L,Ue as Ln,Ln as Lt,pi as M,Le as Mn,tr as Mt,_i as N,Pe as Nn,Sn as Nt,vi as O,Ne as On,W as Ot,di as P,He as Pn,Hn as Pt,ri as Q,be as Qn,Bt as Qt,bi as R,We as Rn,H as Rt,Bi as S,xe as Sn,lr as St,Ui as T,le as Tn,fr as Tt,wi as U,je as Un,Mn as Ut,ji as V,C as Vn,kn as Vt,Ai as W,Ae as Wn,$t as Wt,Ci as X,_e as Xn,Wt as Xt,Mi as Y,se as Yn,qt as Yt,Oi as Z,ve as Zn,Ut as Zt,Fi as _,Oe as _n,Cr as _t,ca as a,at as an,r as ar,Hr as at,Hi as b,ae as bn,Dr as bt,ra as c,A as cn,t as cr,Ir as ct,$i as d,it as dn,o as dr,Nr as dt,Ht as en,de as er,ti as et,Ji as f,Ve as fn,c as fr,Ur as ft,Pi as g,Me as gn,_r as gt,Ni as h,pe as hn,Pr as ht,oa as i,ht as in,m as ir,Z as it,fi as j,Fe as jn,nr as jt,ui as k,Re as kn,rr as kt,Yi as l,j as ln,n as lr,Wr as lt,Li as m,ze as mn,ei as mt,sa as n,k as nn,Xe as nr,xr as nt,qi as o,Et as on,s as or,Jr as ot,Qi as p,Be as pn,Tr as pt,oi as q,Ke as qn,Kt as qt,aa as r,Tt as rn,re as rr,hr as rt,ea as s,Ft as sn,a as sr,Er as st,ia as t,zt as tn,ue as tr,ni as tt,Zi as u,ot as un,i as ur,vr as ut,Ii as v,ke as vn,Mr as vt,Gi as w,we as wn,K as wt,Vi as x,Ce as xn,Or as xt,Ri as y,Te as yn,Sr as yt,xi as z,Ee as zn,U as zt};
|