diff --git a/animdefs.misc b/animdefs.misc index 778ee3d99..a5369c4eb 100644 --- a/animdefs.misc +++ b/animdefs.misc @@ -1,3 +1,5 @@ canvastexture LOGOFADE 4 4 canvastexture SHEENLED 128 128 canvastexture QUADRLED 64 64 +canvastexture MORTLED1 256 128 +canvastexture MORTLED2 64 16 diff --git a/gldefs.mortalrifle b/gldefs.mortalrifle index 745b8ee1d..c5b067bea 100644 --- a/gldefs.mortalrifle +++ b/gldefs.mortalrifle @@ -100,3 +100,13 @@ HardwareShader Texture "models/MortalGrenade_Used.png" Define "RIMFACT" = "1.2" Define "RIMSTEP" = ".2" } +HardwareShader Texture "models/MortalLED.png" +{ + Shader "shaders/glsl/BrightCanvas.fp" + Texture "scrtex" "MORTLED1" +} +HardwareShader Texture "models/MortalLED2.png" +{ + Shader "shaders/glsl/BrightCanvas.fp" + Texture "scrtex" "MORTLED2" +} diff --git a/language.version b/language.version index 641dedbc1..6cc2dd220 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r414 \cu(Thu 8 Sep 00:18:01 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r414 \cu(2022-09-08 00:18:01)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r415 \cu(Thu 8 Sep 13:56:42 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r415 \cu(2022-09-08 13:56:42)\c-"; diff --git a/models/canvas/MortalBG.png b/models/canvas/MortalBG.png new file mode 100644 index 000000000..d3222f095 Binary files /dev/null and b/models/canvas/MortalBG.png differ diff --git a/models/QuadLEDBase.png b/models/canvas/QuadLEDBase.png similarity index 100% rename from models/QuadLEDBase.png rename to models/canvas/QuadLEDBase.png diff --git a/models/QuadLEDCharge.png b/models/canvas/QuadLEDCharge.png similarity index 100% rename from models/QuadLEDCharge.png rename to models/canvas/QuadLEDCharge.png diff --git a/models/QuadLEDRound.png b/models/canvas/QuadLEDRound.png similarity index 100% rename from models/QuadLEDRound.png rename to models/canvas/QuadLEDRound.png diff --git a/models/SheenLEDBar.png b/models/canvas/SheenLEDBar.png similarity index 100% rename from models/SheenLEDBar.png rename to models/canvas/SheenLEDBar.png diff --git a/models/SheenLEDBase.png b/models/canvas/SheenLEDBase.png similarity index 100% rename from models/SheenLEDBase.png rename to models/canvas/SheenLEDBase.png diff --git a/models/SheenLEDNums.png b/models/canvas/SheenLEDNums.png similarity index 100% rename from models/SheenLEDNums.png rename to models/canvas/SheenLEDNums.png diff --git a/models/SheenLEDSpeed.png b/models/canvas/SheenLEDSpeed.png similarity index 100% rename from models/SheenLEDSpeed.png rename to models/canvas/SheenLEDSpeed.png diff --git a/zscript.txt b/zscript.txt index 3230521ec..90d42fb69 100644 --- a/zscript.txt +++ b/zscript.txt @@ -123,6 +123,7 @@ version "4.9" #include "zscript/weapons/swwm_deathlydeathcannon.zsc" #include "zscript/weapons/swwm_deathlydeathcannon_fx.zsc" #include "zscript/weapons/swwm_weapons_hud.zsc" +#include "zscript/weapons/swwm_weapons_canvas.zsc" // monsters #include "zscript/swwm_monsters.zsc" // DLC1 - Weapon Set @@ -148,6 +149,7 @@ version "4.9" #include "zscript/dlc1/swwm_ultimate.zsc" #include "zscript/dlc1/swwm_ultimate_fx.zsc" #include "zscript/dlc1/swwm_dlcweapons_hud.zsc" +#include "zscript/dlc1/swwm_dlcweapons_canvas.zsc" // DLC2 - Game Set #include "zscript/dlc2/swwm_demoland.zsc" #include "zscript/dlc2/swwm_demoshmup.zsc" diff --git a/zscript/dlc1/swwm_dlcweapons_canvas.zsc b/zscript/dlc1/swwm_dlcweapons_canvas.zsc new file mode 100644 index 000000000..c3f94ac70 --- /dev/null +++ b/zscript/dlc1/swwm_dlcweapons_canvas.zsc @@ -0,0 +1,133 @@ +// RenderTexture code for DLC weapons + +// Plasma Blaster +extend Class PlasmaBlast +{ + override void RenderTexture( RenderEvent e ) + { + // ammo display + // dynamic glow + } +} + +extend Class DualPlasmaBlast +{ + override void RenderTexture( RenderEvent e ) + { + // render right-hand weapon's scripted textures as well + SWWMWeapon(SisterWeapon).RenderTexture(e); + // ammo display + // dynamic glow + } +} + +// Sheen HMG +extend Class HeavyMahSheenGun +{ + transient ui Canvas AmmoLed; + ui TextureID AmmoLedBase, AmmoLedBar, AmmoLedSpeed, AmmoLedNums; + + override void RenderTexture( RenderEvent e ) + { + if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("SHEENLED"); + if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/canvas/SheenLEDBase.png",TexMan.Type_Any); + if ( !AmmoLedBar ) AmmoLedBar = TexMan.CheckForTexture("models/canvas/SheenLEDBar.png",TexMan.Type_Any); + if ( !AmmoLedSpeed ) AmmoLedSpeed = TexMan.CheckForTexture("models/canvas/SheenLEDSpeed.png",TexMan.Type_Any); + if ( !AmmoLedNums ) AmmoLedNums = TexMan.CheckForTexture("models/canvas/SheenLEDNums.png",TexMan.Type_Any); + int d1 = Ammo1.Amount%10; + int d2 = (Ammo1.Amount/10)%10; + int d3 = (Ammo1.Amount/100)%10; + AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_Color,0xFF00FF00); + AmmoLed.DrawTexture(AmmoLedSpeed,false,16,16,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==0)?0xFF80FF00:0xFF408000,DTA_LegacyRenderStyle,STYLE_Add); + AmmoLed.DrawTexture(AmmoLedSpeed,false,48,16,DTA_SrcY,16,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==1)?0xFFFFFF00:0xFF808000,DTA_LegacyRenderStyle,STYLE_Add); + AmmoLed.DrawTexture(AmmoLedSpeed,false,80,16,DTA_SrcY,32,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==2)?0xFFFF8000:0xFF804000,DTA_LegacyRenderStyle,STYLE_Add); + if ( incooldown ) + AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,64,DTA_SrcY,64,DTA_SrcWidth,96,DTA_SrcHeight,64,DTA_DestWidth,96,DTA_DestHeight,64,DTA_Color,((gametic%8)>=4)?0xFFFF0000:0xFF800000,DTA_LegacyRenderStyle,STYLE_Add); + else + { + Vector3 rgb = SWWMUtility.HSVtoRGB(((Ammo1.Amount/4.)/Ammo1.MaxAmount,1.,1.)); + Color numcol = Color(255,int(rgb.x*255),int(rgb.y*255),int(rgb.z*255)); + Color blkcol = Color(255,int(rgb.x*128),int(rgb.y*128),int(rgb.z*128)); + AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,(d3%8)*32,DTA_SrcY,(d3/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add); + AmmoLed.DrawTexture(AmmoLedNums,false,48,32,DTA_SrcX,(d2%8)*32,DTA_SrcY,(d2/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add); + AmmoLed.DrawTexture(AmmoLedNums,false,80,32,DTA_SrcX,(d1%8)*32,DTA_SrcY,(d1/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2&&!d1)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add); + } + double ht = barrelheat*.96; + AmmoLed.DrawTexture(AmmoLedBar,false,16,100,DTA_SrcWidth,ht,DTA_DestWidthF,ht,DTA_Color,0xFFFF0000,DTA_LegacyRenderStyle,STYLE_Add); + } +} + +// Quadravol +extend Class Quadravol +{ + transient ui Canvas AmmoLed; + ui TextureID AmmoLedBase, AmmoLedRound, AmmoLedCharge; + + override void RenderTexture( RenderEvent e ) + { + if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("QUADRLED"); + if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/canvas/QuadLEDBase.png",TexMan.Type_Any); + if ( !AmmoLedRound ) AmmoLedRound = TexMan.CheckForTexture("models/canvas/QuadLEDRound.png",TexMan.Type_Any); + if ( !AmmoLedCharge ) AmmoLedCharge = TexMan.CheckForTexture("models/canvas/QuadLEDCharge.png",TexMan.Type_Any); + AmmoLed.Clear(0,0,64,64,0xFF101033); + AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,0xFF00FFFF); + Color col; + switch ( chargelevel ) + { + default: + col = 0xFF00FF00; + break; + case 1: + case 9: + col = 0xFF0080FF; + break; + case 2: + case 8: + col = 0xFF0000FF; + break; + case 3: + case 7: + col = 0xFF8000FF; + break; + case 4: + case 6: + col = 0xFFFF0080; + break; + case 5: + col = 0xFFFF0000; + break; + } + AmmoLed.DrawTexture(AmmoLedCharge,false,12,4,DTA_SrcX,(chargelevel%4)*64,DTA_SrcY,(chargelevel/4)*64,DTA_SrcWidth,40,DTA_SrcHeight,40,DTA_DestWidth,40,DTA_DestHeight,40,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,col); + for ( int i=0; i=4)?0xFFFF0000:0xFF800000,DTA_LegacyRenderStyle,STYLE_Add); - else - { - Vector3 rgb = SWWMUtility.HSVtoRGB(((Ammo1.Amount/4.)/Ammo1.MaxAmount,1.,1.)); - Color numcol = Color(255,int(rgb.x*255),int(rgb.y*255),int(rgb.z*255)); - Color blkcol = Color(255,int(rgb.x*128),int(rgb.y*128),int(rgb.z*128)); - AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,(d3%8)*32,DTA_SrcY,(d3/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add); - AmmoLed.DrawTexture(AmmoLedNums,false,48,32,DTA_SrcX,(d2%8)*32,DTA_SrcY,(d2/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add); - AmmoLed.DrawTexture(AmmoLedNums,false,80,32,DTA_SrcX,(d1%8)*32,DTA_SrcY,(d1/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2&&!d1)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add); - } - double ht = barrelheat*.96; - AmmoLed.DrawTexture(AmmoLedBar,false,16,100,DTA_SrcWidth,ht,DTA_DestWidthF,ht,DTA_Color,0xFFFF0000,DTA_LegacyRenderStyle,STYLE_Add); - } - override void HudTick() { Super.HudTick(); diff --git a/zscript/dlc1/swwm_notashotgun.zsc b/zscript/dlc1/swwm_notashotgun.zsc index a403da627..2660fd834 100644 --- a/zscript/dlc1/swwm_notashotgun.zsc +++ b/zscript/dlc1/swwm_notashotgun.zsc @@ -11,50 +11,8 @@ Class Quadravol : SWWMWeapon Property ClipCount : clipcount; - transient ui Canvas AmmoLed; - ui TextureID AmmoLedBase, AmmoLedRound, AmmoLedCharge; - int wastecycle; // for easter egg - override void RenderTexture( RenderEvent e ) - { - if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("QUADRLED"); - if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/QuadLEDBase.png",TexMan.Type_Any); - if ( !AmmoLedRound ) AmmoLedRound = TexMan.CheckForTexture("models/QuadLEDRound.png",TexMan.Type_Any); - if ( !AmmoLedCharge ) AmmoLedCharge = TexMan.CheckForTexture("models/QuadLEDCharge.png",TexMan.Type_Any); - AmmoLed.Clear(0,0,64,64,0xFF101033); - AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,0xFF00FFFF); - Color col; - switch ( chargelevel ) - { - default: - col = 0xFF00FF00; - break; - case 1: - case 9: - col = 0xFF0080FF; - break; - case 2: - case 8: - col = 0xFF0000FF; - break; - case 3: - case 7: - col = 0xFF8000FF; - break; - case 4: - case 6: - col = 0xFFFF0080; - break; - case 5: - col = 0xFFFF0000; - break; - } - AmmoLed.DrawTexture(AmmoLedCharge,false,12,4,DTA_SrcX,(chargelevel%4)*64,DTA_SrcY,(chargelevel/4)*64,DTA_SrcWidth,40,DTA_SrcHeight,40,DTA_DestWidth,40,DTA_DestHeight,40,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,col); - for ( int i=0; i0)||(chambered&&!charged)||(clipcount>0)||(Ammo1.Amount > 0); diff --git a/zscript/weapons/swwm_weapons_canvas.zsc b/zscript/weapons/swwm_weapons_canvas.zsc new file mode 100644 index 000000000..2e3030aa8 --- /dev/null +++ b/zscript/weapons/swwm_weapons_canvas.zsc @@ -0,0 +1,10 @@ +// RenderTexture code for all weapons + +// Ynykron Artifact +extend Class Ynykron +{ + // TODO for 1.4: re-add the glowing red indicators from SWWM Platinum + override void RenderTexture( RenderEvent e ) + { + } +}