From 6248cd0cebd544db11c5951a5a50940836492dbc Mon Sep 17 00:00:00 2001 From: patience Date: Tue, 21 Apr 2026 13:28:57 +0100 Subject: [PATCH] Added Doom transition --- Effects/transitions.fx | 17 +++++++++++++++++ Effects/transitions.xnb | Bin 24712 -> 26192 bytes TransitionPlayer.cs | 4 ++-- TransitionsConfig.cs | 2 +- description.txt | 1 + description_workshop.txt | 3 +-- smoothDeathTransitions.cs | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Effects/transitions.fx b/Effects/transitions.fx index 0e846b7..77fccb9 100755 --- a/Effects/transitions.fx +++ b/Effects/transitions.fx @@ -351,6 +351,22 @@ float4 doors(float2 st : TEXCOORD0) : COLOR0 { return color; } +float4 doom(float2 st : TEXCOORD0) : COLOR0 { + float time=uProgress*0.02; + if(uProgress>50.){time=2.-uProgress*0.02;} + + float diff=sin(ceil(st.x*100.)*2.2 + ceil(st.x*st.x*100.)*3.)*0.2 -0.4+time*2.0; + + if(diff>0.){ + if(uProgress>50.){st.y+=diff;} + else{st.y-=diff;} + } + float4 color = tex2D(uImage0, st); + if(st.y>1. || st.y<0.)color = float4(0,0,0,0); + + return color; +} + technique Technique1 { pass Lines {PixelShader = compile ps_2_0 lines();} @@ -366,4 +382,5 @@ technique Technique1 pass Collapse {PixelShader = compile ps_2_0 columns_sudden_angled();} pass Circle {PixelShader = compile ps_2_0 circle();} pass Doors {PixelShader = compile ps_2_0 doors();} + pass Doom {PixelShader = compile ps_2_0 doom();} } \ No newline at end of file diff --git a/Effects/transitions.xnb b/Effects/transitions.xnb index 9c2a38dc02d8f3c4dea5f484c248ac0bd1413f29..8f41a93a11b3fde8ed3281bad0ef6f6ec1e2d7bb 100644 GIT binary patch delta 780 zcmY*XO=uHA6n?YWO*b~}idkq8Dy_2gP%k|xB27ruP$*J^E5(BsiKYjQJ&2-*Z1Cc- z>+>L(!yIJ~5((al#GAqf_28)<6mpc(qk?q(W`77B_A&E)?|bikGwkz^;%g|(&8yW% zhS<2{o87{j2GN(vgWbpeySx6NXox~|820DHYfVhEug&m*raPBft$TzuiMZal-MqiG z{jjl2qyr1Y9Kz!7xz)n1h9lN=e?e~v(c=Z9<@|fz zan{c~wcpl$J$YG9@@th;m+f>I-QdVM$NQ@nc)osu_v^>FxpbWWT(?$l*5}He zwKh<^4t^M}uMETR1Me(uv<;#hk?BF$Q;}c+9C^5^ED>STRK9})v?@mk*BfgIT304G z*7nA=y3(e#D(4~s4^NIyv|~b}KoXj!BslUgN#@WrF^~*Bnh%hVq=QBxF$hB=nMY(g zfnhiUyYi@cN^v`Oi-E3kjF~#l)KPddcBpyyF{E;=oM&97QQWvr-7=DiMu%SAGQjYR wQ?INHC0ty0o)V#YZVUn!-?UeS89^2bMjn}?w5h^DM}X6Lsx;H@8ozJ;2ZukWXaE2J delta 83 zcmca`hOy%yBS(avQ#mVRN5VvoIh+sT85quUf7nwnabxym1x6Oe6`NHVXERNH!Ysim i&A`CGH<^*enR5mckO>65n|)dG8QH*0hRt!@pP~R$FcxkA diff --git a/TransitionPlayer.cs b/TransitionPlayer.cs index 31747dd..2605ea2 100644 --- a/TransitionPlayer.cs +++ b/TransitionPlayer.cs @@ -10,10 +10,10 @@ using Terraria.ModLoader; namespace smoothDeathTransitions { public class TransitionPlayer : ModPlayer { - /*public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) + public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) { Player.respawnTimer=150; // For testing - }*/ + } public string GetBiomeSpecificTransitions(){ // This code is going to suck. diff --git a/TransitionsConfig.cs b/TransitionsConfig.cs index 3529708..a206005 100644 --- a/TransitionsConfig.cs +++ b/TransitionsConfig.cs @@ -17,7 +17,7 @@ namespace smoothDeathTransitions [DefaultValue("Lines")] [TooltipKey("$DefaultTransitionTooltip")] [DrawTicks] - [OptionStrings(["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Collapse", "Circle", "Doors", "Prideful"])] + [OptionStrings(["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Collapse", "Circle", "Doors", "Doom", "Prideful"])] public string DefaultTransition; [DefaultValue(160)] diff --git a/description.txt b/description.txt index 8cae7fc..04a148b 100644 --- a/description.txt +++ b/description.txt @@ -12,6 +12,7 @@ Currently available transitions: - Collapse - jagged diagonal letterboxing. - Circle - simple closing-in circle. - Doors - two-sided shut and open. +- Doom - puts the screen through a paper shredder. - Prideful - trans flag sweep that optionally replaces the Hallow's ordinary transition. Explicitly supports Calamity and Confection Rebaked, but all content mods should be fine; it'll just use the default transition. diff --git a/description_workshop.txt b/description_workshop.txt index 9da7ea4..e57d353 100644 --- a/description_workshop.txt +++ b/description_workshop.txt @@ -1,5 +1,3 @@ -[h1]Smooth Death Transitions[/h1] - Updates the traditional death screen with smooth transition shaders when you respawn. Fully client-side (does not alter gameplay) and configurable. Explicitly supports Calamity and Confection Rebaked, but all content mods should be fine; it'll just use the default transition for your position. Currently available transitions: @@ -15,6 +13,7 @@ Currently available transitions: [*][b]Collapse[/b] - jagged diagonal letterboxing. [*][b]Circle[/b] - simple closing-in circle. [*][b]Doors[/b] - two-sided shut and open. + [*][b]Doom[/b] - puts the screen through a paper shredder. [*][b]Prideful[/b] - trans flag sweep that optionally replaces the Hallow's ordinary transition. [/list] diff --git a/smoothDeathTransitions.cs b/smoothDeathTransitions.cs index 286d3aa..ccfc2ab 100644 --- a/smoothDeathTransitions.cs +++ b/smoothDeathTransitions.cs @@ -10,7 +10,7 @@ namespace smoothDeathTransitions { public class SmoothDeathTransitions : Mod { - public string[] transitionsAvailable = ["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Prideful", "Collapse", "Circle", "Doors"]; + public string[] transitionsAvailable = ["Lines", "Loving", "Rising", "Falling", "Starry", "Winding", "Jaws", "Flooding", "Wonder", "Prideful", "Collapse", "Circle", "Doors", "Doom"]; public override void Load(){ if(Main.netMode != NetmodeID.Server){ Asset screenRef = Assets.Request("Effects/transitions");