<!-- SOLID CITY · part 3396 -->
.addScaledVector(e,y.gun?2.4:-2.4).addScaledVector(Ot,-.6).add(Je.set(0,-.12,0).applyQuaternion(lc)),i.prev.copy(i.pos),i.dir.copy(Ot),y.lock){let t=y.lock,n=t.pos.distanceTo(i.pos)/(1500+y.speed);i.dir.copy(Je.copy(t.pos).addScaledVector(t.vel,n).sub(i.pos).normalize())}i.v=1500+y.speed,i.life=1.15,i.on=!0,In("laser"),au(Je.copy(i.pos).addScaledVector(Ot,1.5),3,!1,Bt.muzzle)}var nu=new at,kf=new fn,ny=new $e(1,1,16),iy=new $e(0,0,1),Kl=new $e,iu=new $e;function cp(i,e,t,n){Kl.copy(e).sub(i);let s=Kl.lengthSq(),r=s>0?ht(iu.copy(t).sub(i).dot(Kl)/s,0,1):0;return iu.copy(i).addScaledVector(Kl,r),iu.distanceToSquared(t)<n*n}function sy(i){let e=0;for(let t of pc)if(t.on){if(t.prev.copy(t.pos),t.pos.addScaledVector(t.dir,t.v*i),t.life-=i,t.life<=0){t.on=!1;continue}for(let n of Hn)if(n.alive&&cp(t.prev,t.pos,n.pos,n.r+(Qn?3:1.5))){t.on=!1,ry(n,t.pos);break}t.on&&(kf.setFromUnitVectors(iy,t.dir),nu.compose(Je.copy(t.pos).addScaledVector(t.dir,-8),kf,ny),pr.setMatrixAt(e,nu),mr.setMatrixAt(e,nu),e++)}pr.count=mr.count=e,pr.instanceMatrix.needsUpdate=mr.instanceMatrix.needsUpdate=!0}function ry(i,e){if(i.hp--,i.flash=.09,ip(e,i.type==="circler"?Bt.magenta:Bt.green),In("hit"),i.type==="scout"&&i.mode==="attack"&&i.hp>0&&(i.mode="break",i.modeT=1.6,i.aim.set(0,0,0)),i.hp<=0){i.alive=!1,i.mesh.visible=!1,y.kills++;let t=i.type==="mother";if(oc(i.pos.clone(),t?3.2:1,i.type==="circler"?Bt.magenta:i.type==="diver"?Bt.red:Bt.green),In(t?"bigboom":"boom"),y.shake=Math.max(y.shake,t?1.2:.35),t)for(let n=0;n<5;n++)setTimeout(()=>oc(i.pos.clone().add(new $e((Math.random()-.5)*50,(Math.random()-.5)*16,(Math.random()-.5)*50)),1.3,Bt.fire),160+n*170)}}function jl(i,e){let t=mc.find(s=>!s.on);if(!t)return;let n=i.pos.distanceTo(y.pos)/260;Je.copy(y.pos).addScaledVector(_n(Ot),y.speed*n*.7).sub(i.pos).normalize(),e&&Je.add(Nt.set(Math.random()-.5,Math.random()-.5,Math.random()-.5).multiplyScalar(e)).normalize(),t.pos.copy(i.pos),t.prev.copy(i.pos),t.vel.copy(Je).multiplyScalar(260),t.life=5,t.on=!0}function ay(i){for(let e=0;e<pu;e++){let t=mc[e];t.on&&(t.prev.copy(t.pos),t.pos.addScaledVector(t.vel,i),t.life-=i,t.life<=0?t.on=!1:gn.visible&&y.phase==="battle"&&cp(t.prev,t.pos,y.pos,Qn?4.6:5.2)&&(t.on=!1,op(10,t.pos))),t.on?(dr[e*3]=t.pos.x,dr[e*3+1]=t.pos.y,dr[e*3+2]=t.pos.z):dr[e*3+1]=-1e6}mu.attributes.position.needsUpdate=!0}var Ql=new $e,oy=new $e;function ps(i,e,t,n,s){Ql.copy(e).sub(i.pos);let r=Ql.length();return r>.01&&Ql.multiplyScalar(t/r),i.vel.lerp(Ql,1-Math.exp(-n*s)),r}function ly(i){if(!Hn.length)return;let e=y.pos,t=_n(oy),n=y.invuln>0||y.phase!=="battle";for(let s of Hn){if(!s.alive)continue;s.t+=i,s.modeT-=i,s.fireT-=i;let r=s.pos.distanceTo(e);if(s.type==="scout")s.mode==="attack"?(ps(s,Ot.copy(e).addScaledVector(t,60),s.vmax,1.4,i),r<110&&(s.mode="break",s.modeT=2.6,s.aim.set(Math.random()-.5,Math.random()*.6-.3,Math.random()-.5).normalize().multiplyScalar(800).add(e))):(ps(s,s.aim.lengthSq()?s.aim:Ot.copy(e).addScaledVector(t,600),s.vmax*1.1,1.2,i),s.modeT<=0&&(s.mode="attack",s.aim.set(0,0,0))),s.fireT<=0&&r<950&&!n&&(Je.copy(e).sub(s.pos).normalize().dot(Nt.copy(s.vel).normalize())>.6?(jl(s,.04),s.fireT=1.9+Math.random()*1.2):s.fireT=.4);else if(s.type==="circler"){s.orbit+=i*(.42+.06*s.side)*s.side;let o=330+Math.sin(s.t*.7)*80;Ot.set(Math.cos(s.orbit)*o,Math.sin(s.t*.9+s.orbit)*90,Math.sin(s.orbit)*o).add(e).addScaledVector(t,150),ps(s,Ot,s.vmax+y.speed*.8,1.6,i),s.fireT<=0&&r<900&&!n&&(jl(s,.06),s.fireT=2.3+Math.random()*1.4)}else if(s.type==="diver")s.mode==="hold"?(ps(s,Ot.copy(e).addScaledVector(t,700).add(Nt.set(Math.cos(s.t+s.side)*200,150,Math.sin(s.t)*200)),y.speed+60,1.2,i),s.modeT<=0&&!n&&(s.mode="dive",s.modeT=4,In("zap"))):s.mode==="dive"?(ps(s,e,s.vmax+y.speed*.4,2.2,i),r<12?(op(22,s.pos),s.mode="away",s.modeT=2.5,s.aim.copy(s.vel).normalize().multiplyScalar(900).add(s.pos).add(Nt.set(0,300,0))):(r<80||s.modeT<=0)&&(s.mode="away",s.modeT=2.2,s.aim.copy(s.vel).normalize().multiplyScalar(900).add(s.pos).add(Nt.set(0,300,0)))):(ps(s,s.aim,s.vmax,1.2,i),s.modeT<=0&&(s.mode="hold",s.modeT=2.5+Math.random()*2)),s.fireT<=0&&r<700&&s.mode!=="dive"&&!n&&(jl(s,.08),s.fireT=3+Math.random()*2);else if(Ot.copy(e).addScaledVector(t,900).add(Nt.set(Math.sin(s.t*.3)*300,140+Math.sin(s.t*.5)*60,Math.cos(s.t*.3)*300)),r>2600&&Ot.copy(e),ps(s,Ot,Math.max(s.vmax,y.speed*.85),.5,i),s.mesh.rotation.y+=i*.35,s.fireT<=0&&r<1500&&!n){for(let o=0;o<3;o++)jl(s,.05+o*.03);s.fireT=2.8}s.pos.addScaledVector(s.vel,i),s.mesh.position.copy(s.pos),s.type!=="mother"&&(s.mesh.lookAt(Je.copy(s.pos).add(s.vel)),s.type==="circler"&&s.mesh.rotateZ(s.t*2)),s.flash=Math.max(0,s.flash-i);let a=s.flash>0?2.5:0;s.hull.emissive.setRGB(a,a,a)}}function cy(i){let e=y.phase,t=.25,n=0;e==="count"?t=.3+y.phaseT*.15:e==="climb"?t=1:e==="battle"||e==="return"?t=.55+ht(y.speed/hc,0,1)*.35:e==="landing"?t=.45:(e==="parked"||e==="pad"||e==="result")&&(t=.12),y.boosting&&(t=1.3,n=1);let s=$t.flameMat.uniforms;s.uP.