Skip to content

Commit b9c620d

Browse files
committed
Improve EMP.
Tweak crane.
1 parent 1ad1b4d commit b9c620d

3 files changed

Lines changed: 27 additions & 37 deletions

File tree

LuaUI/Widgets/gfx_paralyze_effect.lua

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -334,30 +334,20 @@ void main() {
334334
335335
// ------------------ CONFIG START --------------------
336336
337-
if (paralysis_level < 0.9999) { // not fully paralyzed
338-
noisescale = 0.15;
339-
persistance = 0.45;
340-
lacunarity = 2.5;
341-
minlightningcolor = vec3(0.1, 0.1, 0.5); //blue
342-
maxlightningcolor = vec3(0.9, 0.9, 0.9); //white
343-
wholeunitbasecolor = vec4(0.0, 0.0, 0.0, 0.0); // none
344-
lightningalpha = 1.4;
345-
lighting_sharpness = 12.8;
346-
lighting_width = 3.95;
347-
lightning_speed = 0.14;
348-
}
349-
else{ // fully paralyzed
350-
noisescale = 0.31;
351-
persistance = 0.45;
352-
lacunarity = 2.5;
353-
minlightningcolor = vec3(0.1, 0.1, 1.0); //blue
354-
maxlightningcolor = vec3(1.0, 1.0, 1.0); //white
355-
wholeunitbasecolor = vec4(0.49, 0.43, 0.94, 0.35); // light blue base tone
356-
lightningalpha = 1.2;
357-
lighting_sharpness = 4.8;
358-
lighting_width = 3.8;
359-
lightning_speed = 0.95;
337+
if (paralysis_level < 0.98) { // not fully paralyzed
338+
fragColor = vec4(0);
339+
return;
360340
}
341+
noisescale = 0.31;
342+
persistance = 0.45;
343+
lacunarity = 2.5;
344+
minlightningcolor = vec3(0.1, 0.1, 1.0); //blue
345+
maxlightningcolor = vec3(1.0, 1.0, 1.0); //white
346+
wholeunitbasecolor = vec4(0.49, 0.5, 1.0, 1.0); // light blue base tone
347+
lightningalpha = 1.2;
348+
lighting_sharpness = 4.8;
349+
lighting_width = 3.8;
350+
lightning_speed = 0.95;
361351
// ------------------ CONFIG END --------------------
362352
363353
vec4 noiseposition = noisescale * vec4(v_modelPosOrig, (timeInfo.x + timeInfo.w) * lightning_speed);
@@ -372,21 +362,19 @@ void main() {
372362
373363
vec3 lightningcolor;
374364
float effectalpha;
375-
if (paralysis_level < 0.9999) {
376-
//empreworktagdonotremove
377-
//empreworkherealsodonotremove
378-
// Calculate the lightning color based on the amount of electricity
379-
lightningcolor = mix(minlightningcolor, maxlightningcolor, electricity);
380-
effectalpha = paralysis_level * lightningalpha; // less transparency non-paralyzed
381-
}
382-
else
383-
{
384-
lightningcolor = mix(minlightningcolor, maxlightningcolor, electricity);
385-
effectalpha = clamp(paralysis_level * lightningalpha, 0.0, 1.0);
386-
}
365+
lightningcolor = mix(minlightningcolor, maxlightningcolor, electricity);
366+
effectalpha = clamp(paralysis_level * lightningalpha, 0.0, 1.0);
367+
float flash = abs((2.0 * fract((timeInfo.x + timeInfo.w) * 0.07)) - 1.0);
387368
388369
fragColor = vec4(lightningcolor, electricity*effectalpha);
389-
fragColor = max(wholeunitbasecolor, fragColor); // apply whole unit base color
370+
float baseItensity = snoise(0.032 * vec4(v_modelPosOrig, 1.7*(timeInfo.x + timeInfo.w))) +
371+
snoise(0.02 * vec4(v_modelPosOrig, 1.3*(timeInfo.x + timeInfo.w)));
372+
baseItensity = sqrt(abs(baseItensity) + 0.2) * (0.5 * flash + 0.2) + clamp(baseItensity * (flash - 0.5) * 0.5, -0.2, 1.0);
373+
wholeunitbasecolor.a = wholeunitbasecolor.a * (0.4 + baseItensity * 0.5);
374+
wholeunitbasecolor.r = wholeunitbasecolor.r + baseItensity * 0.33;
375+
wholeunitbasecolor.g = wholeunitbasecolor.g + baseItensity * 0.45;
376+
fragColor = max(wholeunitbasecolor, fragColor); // apply whole unit base color
377+
fragColor.a *= clamp((paralysis_level - 0.98) * 50.0, 0.0, 1.0);
390378
}
391379
]]
392380

LuaUI/Widgets/unit_healthbars.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,9 @@ do
15161516

15171517
glDepthMask(false)
15181518

1519-
DrawOverlays()
1519+
if not WG.DrawParalyzedUnitGL4 then
1520+
DrawOverlays()
1521+
end
15201522
glMultiTexCoord(1, 1, 1, 1)
15211523
glColor(1, 1, 1, 1)
15221524

unittextures/crane2.dds

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)