<!-- SOLID CITY · part 3395 -->
e"||e==="return")Kv(i);else if(e==="landing")jv(i);else if(e==="respawn"&&y.phaseT>2.4){let n=y.checkpoint;y.pos.copy(n.pos),y.yaw=n.yaw,y.pitch=0,y.speed=$i,y.shields=100,y.invuln=3,gn.visible=!0,jn("battle"),y.phaseT=3,On.init=!1,Bn("BACK IN THE FIGHT","Shields restored",2)}(e==="climb"||e==="battle"||e==="return")&&Oe.boosting&&y.boostMeter>(y.boosting?0:.15)?(y.boosting||In("boost"),y.boosting=!0,y.boostMeter=Math.max(0,y.boostMeter-i*.26),y.boostLock=.9):(y.boosting=!1,y.boostLock-=i,y.boostLock<=0&&(y.boostMeter=Math.min(1,y.boostMeter+i*.17))),y.sinceHit+=i,y.invuln=Math.max(0,y.invuln-i),y.slowT=Math.max(0,y.slowT-i),y.sinceHit>4&&y.shields<100&&e==="battle"&&(y.shields=Math.min(100,y.shields+i*6)),y.fireCd-=i,Oe.firing&&(e==="battle"||e==="return"||e==="climb")&&gn.visible&&y.fireCd<=0&&(ty(),y.fireCd=.11),ey(),ly(i),sy(i),ay(i),e==="battle"&&(Hn.some(s=>s.alive)?y.waveT=2.2:(y.waveT-=i,y.waveT<=0&&(y.wave<3?Xv(y.wave+1):qv()))),y.topSpeed=Math.max(y.topSpeed,y.speed),Hf.set(y.pitch,y.yaw,y.roll),lc.setFromEuler(Hf),gn.quaternion.copy(lc),gn.position.copy(y.pos),cy(i),hp(i),fp(i),dy(i),fy(i),e==="parked"||e==="result"||e==="pad"?tu(e==="pad"?.25:.12,.05,0):e==="count"?tu(.4+y.phaseT*.2,.15+y.phaseT*.1,y.phaseT*.15):tu(e==="respawn"?0:.85,ht(y.speed/520,0,1)+(y.boosting?.25:0),(y.boosting?.35:0)+y.heat*1.2+(e==="climb"&&y.phaseT<6?.6:0))}function $v(i){if(y.phaseT<1.6){y.vUp=Math.min(y.vUp+i*26,34),y.pos.y+=y.vUp*i,y.speed=y.vUp;for(let n=0;n<3;n++)Je.set((Math.random()-.5)*60,Math.random()*5,(Math.random()-.5)*60),Nt.set(y.pos.x+(Math.random()-.5)*4,.6,y.pos.z+(Math.random()-.5)*4),vr(Ti,Nt,Je,Bt.smoke,2.2,9,.55);y.shake=Math.max(y.shake,.6);return}y.pitch=Yt(y.pitch,ht(1.12+Oe.y*.3,.55,1.4),1.6,i),y.yaw-=Oe.x*.9*i,y.roll=Yt(y.roll,-Oe.x*.6,4,i);let t=Gf+(y.boosting?180:0);y.speed=Math.min(t,y.speed+i*(y.boosting?120:75)),y.vUp=Yt(y.vUp,0,1.2,i),_n(Je),y.pos.addScaledVector(Je,y.speed*i),y.pos.y+=y.vUp*i,y.shake=Math.max(y.shake,.25+(y.boosting?.25:0)),vs(y.pos.y)>Xf&&Wv()}function Kv(i){let e=y.phase,t=vs(y.pos.y);if(y.yaw-=Oe.x*1.45*i,y.pitch=ht(y.pitch+Oe.y*1.25*i,-1.35,1.35),y.roll=Yt(y.roll,-Oe.x*.85,5,i),Qn&&y.lock&&Oe.firing){Je.copy(y.lock.pos).sub(y.pos);let c=Math.atan2(-Je.x,-Je.z),h=Math.asin(ht(Je.y/Je.length(),-1,1));y.yaw+=ht(rc(c-y.yaw),-1,1)*.9*i,y.pitch+=ht(h-y.pitch,-1,1)*.9*i}e==="battle"&&(t<6200&&y.pitch<.4&&(y.pitch+=(6200-t)/1500*.9*i),t>16e3&&y.pitch>-.4&&(y.pitch-=(t-16e3)/1500*.9*i),y.phaseT<2.5&&(y.pitch=Yt(y.pitch,0,1.4,i)));let n=y.boosting?hc:$i;if(e==="return"){let c=Math.max(0,-Math.sin(y.pitch));t>1500&&(n+=c*(Wf-$i)*cn((t-1500)/1500))}e==="battle"&&y.phaseT<3&&(n=Math.max(n,on(Gf,$i,y.phaseT/3))),y.slowT>0&&(n*=.62);let s=n>y.speed?y.boosting?160:90:110;y.speed=y.speed<n?Math.min(n,y.speed+s*i):Math.max(n,y.speed-s*i),_n(Je),y.pos.addScaledVector(Je,y.speed*i);let r=Je.y*y.speed,a=$f(y.pos.x,y.pos.z),o=y.pos.y-a;o<60&&y.pitch<.2&&(y.pitch=Math.min(.2,y.pitch+(60-o)/60*2.5*i)),o<6&&(y.pos.y=a+6);let l=0;if(e==="return"&&t<9e3&&t>1200&&r<-60&&(l=ht((-r-60)/260,0,1)*cn((t-1200)/900)*cn((9e3-t)/800)),y.heat=Yt(y.heat,l,3,i),y.heat>.2&&(y.shake=Math.max(y.shake,y.heat*.7)),y.heat>.15)for(let c=0;c<(Qt?2:4);c++)_n(Nt),Je.copy(Nt).multiplyScalar(-(40+Math.random()*60)).add(Ot.set((Math.random()-.5)*30,(Math.random()-.5)*30,(Math.random()-.5)*30)),Nt.multiplyScalar(3).add(y.pos),vr(Ti,Nt,Je,Math.random()<.5?Bt.fire:Bt.gold,.5+Math.random()*.4,3.5*y.heat+1);e==="return"&&Math.hypot(y.pos.x,y.pos.z)<750&&t<560&&Yv(),y.boosting&&(y.shake=Math.max(y.shake,.22))}function jv(i){let e=y.landing,t=y.pos,n=Math.hypot(t.x,t.z),s=Ot.set(-t.x,0,-t.z).normalize();Math.abs(Oe.x)>.12||Math.abs(Oe.y)>.12?(y.yaw-=Oe.x*1.3*i,_n(Nt,y.yaw,0).multiplyScalar(Oe.y*Nf)):(Nt.copy(s).multiplyScalar(Math.min(Nf,n*.55)),n>12&&(y.yaw+=ht(rc(Math.atan2(t.x,t.z)-y.yaw),-1,1)*1.6*i)),n<40&&Nt.addScaledVector(s,(40-n)*.35),e.hv.x=Yt(e.hv.x,Nt.x,1.25,i),e.hv.z=Yt(e.hv.z,Nt.z,1.25,i);let a=$f(t.x,t.z),o=n<10?_s:Math.max(a+14,Math.min(t.y,n*.32+14)),l=n<10?ht((o-t.y)*1.4,-9,0):ht((o-t.y)*1.1,-32,18);if(e.vy=Yt(e.vy,l,2.2,i),t.x+=e.hv.x*i,t.z+=e.hv.z*i,t.y+=e.vy*i,t.y<a+1.2&&n>16&&(t.y=a+1.2),y.speed=Math.hypot(e.hv.x,e.hv.z,e.vy),y.pitch=Yt(y.pitch,ht(-Math.hypot(e.hv.x,e.hv.z)/400,-.15,0),3,i),y.roll=Yt(y.roll,-Oe.x*.3,4,i),n<10&&t.y<_s+.35&&Math.hypot(e.hv.x,e.hv.z)<7){t.y=_s,Zv();return}t.y-a<40&&Math.random()<.6&&(Ji.set(t.x+(Math.random()-.5)*3,Math.max(a,0)+.5,t.z+(Math.random()-.5)*3),Je.set((Math.random()-.5)*30,2,(Math.random()-.5)*30),vr(Ti,Ji,Je,Bt.smoke,1.5,6,.4))}var Qv=Qn?.3:.12;function ey(){if(y.lock=null,y.phase!=="battle")return;_n(Ot);let i=Qv;for(let e of Hn){if(!e.alive)continue;Je.copy(e.pos).sub(y.pos);let t=Je.length();if(t>1700)continue;let n=Math.acos(ht(Je.dot(Ot)/t,-1,1))-Math.atan(e.r/t)*.8;n<i&&(i=n,y.lock=e)}}function ty(){let i=pc.find(t=>!t.on);if(!i)return;y.gun^=1,y.shots++,_n(Ot);let e=Nt.set(1,0,0).applyQuaternion(lc);if(i.pos.copy(y.pos)