CREATORJD commited on
Commit
41ce5b1
·
verified ·
1 Parent(s): 519ceaf

1.33.25 singularity weapons

Browse files
Files changed (1) hide show
  1. src/ui/render3d.js +35 -0
src/ui/render3d.js CHANGED
@@ -241,6 +241,11 @@ function selectCinematicLights(nA){
241
  sceneLightPush(ux[i],uy[i],terrainH(ux[i],uy[i])+T.size*.52,66,c[0],c[1],c[2],(.16+night*.22)*boost,boost*.6);
242
  promoted++;
243
  }
 
 
 
 
 
244
  if(carrier.active&&carrier.phase<2){
245
  const c=_lin(sceneLightColor(dropFactionKey(carrier.fac)));
246
  const alt=Math.max(18,carrierEffectiveAlt()*.65);
@@ -1019,6 +1024,11 @@ function render(dtDraw){
1019
  Flown, not placed. It holds a hover altitude, banks into its turns and
1020
  runs its engines — none of which a building does, which was exactly why
1021
  borrowing the deployed HQ's mesh made it read as a sliding bunker. */
 
 
 
 
 
1022
  if(carrier.active&&carrier.phase<2){
1023
  const H=gh(carrier.x,carrier.y),key=dropFactionKey(carrier.fac),P=DROP_PROFILE[key];
1024
  const hover=carrier.phase===1? 26+Math.sin(t*1.5)*2.4 : 0;
@@ -1999,6 +2009,31 @@ function render(dtDraw){
1999
  }
2000
  }
2001
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2002
  /* ---- structures burning down --------------------------------------
2003
  A building below a third health is visibly failing: fire licking out of
2004
  the hull, a smoke column climbing off it, and sparks. This is the single
 
241
  sceneLightPush(ux[i],uy[i],terrainH(ux[i],uy[i])+T.size*.52,66,c[0],c[1],c[2],(.16+night*.22)*boost,boost*.6);
242
  promoted++;
243
  }
244
+ if(typeof singularities!=='undefined') for(const Sg of singularities){
245
+ const dxs=Sg.x-cam.x,dys=Sg.y-cam.y;
246
+ sceneLightPush(Sg.x,Sg.y,terrainH(Sg.x,Sg.y)+22,150,_lin([172,120,255])[0],_lin([172,120,255])[1],_lin([172,120,255])[2],
247
+ 0.9+0.5*Math.sin((typeof stats!=='undefined'?stats.t:0)*9),150*150/(dxs*dxs+dys*dys+150*150)+3);
248
+ }
249
  if(carrier.active&&carrier.phase<2){
250
  const c=_lin(sceneLightColor(dropFactionKey(carrier.fac)));
251
  const alt=Math.max(18,carrierEffectiveAlt()*.65);
 
1024
  Flown, not placed. It holds a hover altitude, banks into its turns and
1025
  runs its engines — none of which a building does, which was exactly why
1026
  borrowing the deployed HQ's mesh made it read as a sliding bunker. */
1027
+ if(typeof singularities!=='undefined') for(const Sg of singularities){
1028
+ const dxs=Sg.x-cam.x,dys=Sg.y-cam.y;
1029
+ sceneLightPush(Sg.x,Sg.y,terrainH(Sg.x,Sg.y)+22,150,_lin([172,120,255])[0],_lin([172,120,255])[1],_lin([172,120,255])[2],
1030
+ 0.9+0.5*Math.sin((typeof stats!=='undefined'?stats.t:0)*9),150*150/(dxs*dxs+dys*dys+150*150)+3);
1031
+ }
1032
  if(carrier.active&&carrier.phase<2){
1033
  const H=gh(carrier.x,carrier.y),key=dropFactionKey(carrier.fac),P=DROP_PROFILE[key];
1034
  const hover=carrier.phase===1? 26+Math.sin(t*1.5)*2.4 : 0;
 
2009
  }
2010
  }
2011
  }
2012
+ /* ---- live singularities --------------------------------------------
2013
+ A black hole cannot be drawn additively — additive can only brighten.
2014
+ The core is a deep-dark blob in the ALPHA pass, and everything luminous
2015
+ around it (accretion rings, einstein rim, polar shimmer) rides additive
2016
+ on top. The implosion phase collapses the ring radius toward the core. */
2017
+ if(typeof singularities!=='undefined') for(const Sg of singularities){
2018
+ if(!vis(Sg.x,Sg.y,300)) continue;
2019
+ const Rg=170*Math.sqrt(Sg.pow), H=gh(Sg.x,Sg.y)+16;
2020
+ const ph=Sg.phase, q=ph===0?Math.min(1,Sg.t/2.5):1;
2021
+ const coreR=(ph===2? Math.max(0,1-Sg.t/0.6) : (0.35+q*0.65))*Rg*0.22;
2022
+ if(coreR>1){
2023
+ bbAlpha.add(sprites.glow,Sg.x,Sg.y,H,coreR*2.6,0, 4,2,10, 244);
2024
+ bbAlpha.add(sprites.glow,Sg.x,Sg.y,H,coreR*1.4,0, 0,0,0, 252);
2025
+ bbAdd.add(sprites.ring,Sg.x,Sg.y,H,coreR*1.55,t*3.1, 205,170,255, 215);
2026
+ bbAdd.add(sprites.ring,Sg.x,Sg.y,H,coreR*2.1,-t*2.2, 140,100,240, 130);
2027
+ bbAdd.add(sprites.glow,Sg.x,Sg.y,H,coreR*3.4,0, 96,60,190, 60);
2028
+ FX.ring.add(Sg.x,Sg.y,H-8,(coreR*2.4)/3,t*4.2, 196,160,255, 180);
2029
+ /* infall shimmer: brief luminous streaks on the spiral */
2030
+ if(ph===0&&Math.random()<0.5){
2031
+ const a4=Math.random()*TAU, d5=coreR*2.2+Math.random()*Rg*0.8;
2032
+ bbAdd.add(sprites.glow,Sg.x+Math.cos(a4)*d5,Sg.y+Math.sin(a4)*d5,H+Math.random()*14,
2033
+ 5+Math.random()*7,0, 210,180,255, 90);
2034
+ }
2035
+ }
2036
+ }
2037
  /* ---- structures burning down --------------------------------------
2038
  A building below a third health is visibly failing: fire licking out of
2039
  the hull, a smoke column climbing off it, and sparks. This is the single