From 08f4ef4b06e7002acacf9648dfaa09d9f86f906d Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Fri, 20 May 2022 13:11:58 +0200 Subject: [PATCH] Rewrite title stuff without using exploits. --- FuturePlans.md | 4 +- language.version | 4 +- maps/TITLEMAP.wad | Bin 2091 -> 1745 bytes zscript/menu/swwm_title.zsc | 103 ++++++++++++++++++--------------- zscript/swwm_statichandler.zsc | 4 +- 5 files changed, 63 insertions(+), 52 deletions(-) diff --git a/FuturePlans.md b/FuturePlans.md index 7e027a5cf..e97f64c71 100644 --- a/FuturePlans.md +++ b/FuturePlans.md @@ -63,7 +63,7 @@ Re-animation of old FK models. Plus extra score incentives and achievements. - Pachinko Code *(Find the Secret Menu)* - Double Succ *(Merge two Ynykron singularities)* - The Ultimate Combo *(Hit a Ynykron singularity with a Ynykron beam)* - - Author Appeal *(Smooch a boss brain)* + - Yukkuri Love *(Smooch a boss brain)* - Power of Love *(Recover a total of 500 health by kissing the Kirin Plush)* - Arsenal of Olden Times *(Find all classic UnSX weapons)*
*(Quadravol, Biospark Carbine, Sparkster Rifle, Ray-Khom, Mortal Rifle, Ynykron, Rafan-Kos and K79-D)*
@@ -72,7 +72,7 @@ Re-animation of old FK models. Plus extra score incentives and achievements. - Assortment of Thingamajigs *(Find all items)* - Words Words Words *(Read 100 library entries)* - Oops I Pressed It *(Turn the engine off)* - - Dangerous Ball Action *(Knock yourself out with your own lead ball)* + - Dangerous Ball Action *(Land a lead ball crit on yourself)* - Total Ball Destruction *(Kill the Icon of Sin with a lead ball)* - Say The Line Vinny *(Spin attack with the Itamex Hammer for 60 seconds)* - Whateverbuster *(Use the Wallbuster shuffle function 100 times)* diff --git a/language.version b/language.version index 55e807315..d6a4c2740 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.20 \cu(Wed 1 Jun 18:30:15 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.2.20 \cu(2022-06-01 18:30:15)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.20 r1 \cu(Wed 1 Jun 18:30:30 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.2.20 r1 \cu(2022-06-01 18:30:30)\c-"; diff --git a/maps/TITLEMAP.wad b/maps/TITLEMAP.wad index a808c287ee5efed4cd17bab26be963a675eef4da..0add6fe787bc5553e1126003138ad883bfbec27c 100644 GIT binary patch delta 52 zcmZ22aFLfQAl%V~m4Shwk!>SaIossZ>?Se{3=9lTt{#qIp8i3NY#<&3gR7s5uVVlM F0{}sJ3e^Ar delta 401 zcmcb}yIO!NAl%V~je&vTH2X%ba<+O$=U|2w1_p)=42&Q0nJzK-%YiveV2&9h10w?i zLvTPy5C;PT1BeHrgF}LR92g*g8A35gFfcHvGcYh1fz*eG`-Wteplay timer + override void NetworkProcess( ConsoleEvent e ) + { + if ( e.Name == "swwmtitle.timer" ) + playtimer = e.Args[0]; + } + + override void UiTick() + { + // you're not supposed to be here + if ( gamestate == GS_LEVEL ) + ThrowAbortException("Attempted to warp into TITLEMAP"); + if ( !bInitialized ) + { + bInitialized = true; + titletimer = -300; + // birthday event + if ( SystemTime.Format("%d%m",SystemTime.Now()) == "2001" ) + titletimer = -500; + let shnd = SWWMStaticHandler(StaticEventHandler.Find("SWWMStaticHandler")); + if ( shnd ) + { + if ( shnd.titlefirst ) + { + titletimer = GameTicRate*22; // skip to logo + S_ChangeMusic("music/TRAUMATI.XM",1); // skip to order 1 + bFadeIn = true; + } + shnd.titlefirst = true; + } + } if ( titletimer == -250 ) { if ( gameinfo.gametype&GAME_Hexen ) S_ChangeMusic("HEXEN"); @@ -83,54 +123,17 @@ Class SWWMTitleStuff : EventHandler } } if ( titletimer == -75 ) S_ChangeMusic(""); - if ( titletimer == 0 ) S_ChangeMusic("music/TRAUMATI.XM"); - titletimer++; - if ( menuactive && (titletimer < -80) && (titletimer >= -300) ) titletimer = -80; - } - - override void WorldLoaded( WorldEvent e ) - { - let f = LogoFader(Actor.Spawn("LogoFader")); - f.hnd = self; - TexMan.SetCameraToTexture(f,"LOGOFADE",90); - titletimer = -300; - let shnd = SWWMStaticHandler(StaticEventHandler.Find("SWWMStaticHandler")); - if ( !shnd ) return; - if ( shnd.titlefirst ) - { - titletimer = GameTicRate*22; // skip to logo - S_ChangeMusic("music/TRAUMATI.XM",1); // skip to order 1 - bFadeIn = true; - } - shnd.titlefirst = true; - } - - // GROSS HACK, GROSS HACK - static ui bool IsBirthday() - { - return (SystemTime.Format("%d%m",SystemTime.Now()) == "2001"); - } - static play void SetBirthday() - { - let hnd = SWWMTitleStuff(EventHandler.Find("SWWMTitleStuff")); - hnd.titletimer = -500; - } - - override void UiTick() - { if ( (titletimer > -80) && (titletimer < -20) ) TickExplosions(); + if ( titletimer == 0 ) S_ChangeMusic("music/TRAUMATI.XM"); if ( !swwm_oldlogo ) { // title lettering if ( ((double(titletimer)/GameTicRate) >= 23.) && ((double(titletimer)/GameTicRate) <= 25.4) && !(titletimer%5) ) S_StartSound("title/thump",CHAN_WEAPON,CHANF_UI|CHANF_OVERLAP,1.,ATTN_NONE); } - if ( gamestate != GS_LEVEL ) return; - // you're not supposed to be here - Menu.SetMenu('EndGameMenu'); - let m = MessageBoxMenu(Menu.GetCurrentMenu()); - if ( m ) m.HandleResult(true); - // special thanks to marrub for this absolute crime + titletimer++; + EventHandler.SendNetworkEvent("swwmtitle.timer",titletimer); + if ( menuactive && (titletimer < -80) && (titletimer >= -300) ) titletimer = -80; } private ui void RenderExplosions() @@ -431,8 +434,16 @@ Class LogoFader : Actor } override void Tick() { - double alf1 = clamp(((double(hnd.titletimer)/GameTicRate)-26.5)*.5,0.,1.); - double alf2 = (hnd.titletimer>28*GameTicRate)?clamp((double((hnd.titletimer-GameTicRate*3)%(GameTicRate*5))/GameTicRate),0.,1.):0.; + // old gzdoom fallback + // won't look as nice, but it's better than nothing + if ( hnd.playtimer == -65536 ) + { + double alf = clamp(double((gametic-GameTicRate*3)%(GameTicRate*5))/GameTicRate,0.,1.); + base.SetShade(Color(255,int(255*alf),0)); + return; + } + double alf1 = clamp(((double(hnd.playtimer)/GameTicRate)-26.5)*.5,0.,1.); + double alf2 = (hnd.playtimer>28*GameTicRate)?clamp((double((hnd.playtimer-GameTicRate*3)%(GameTicRate*5))/GameTicRate),0.,1.):0.; base.SetShade(Color(int(255*alf1),int(255*alf2),0)); } } diff --git a/zscript/swwm_statichandler.zsc b/zscript/swwm_statichandler.zsc index 001d27557..db5cb4b2a 100644 --- a/zscript/swwm_statichandler.zsc +++ b/zscript/swwm_statichandler.zsc @@ -19,7 +19,7 @@ Class SWWMStaticHandler : StaticEventHandler bool unloading; ui Dictionary menustate; // used by Demolitionist Menu to restore old menu positions // title stuff - bool titlefirst; + ui bool titlefirst; // warnings bool mpwarned; // checks @@ -69,7 +69,6 @@ Class SWWMStaticHandler : StaticEventHandler override void WorldLoaded( WorldEvent e ) { - if ( gamestate != GS_TITLELEVEL ) titlefirst = true; // we skip it unloading = false; maptime = 0; if ( e.IsSavegame || e.IsReopen ) @@ -311,6 +310,7 @@ Class SWWMStaticHandler : StaticEventHandler override void PostUiTick() { + if ( gamestate != GS_TITLELEVEL ) titlefirst = true; // we skip it if ( !aprcheck && (gamestate == GS_LEVEL) ) { aprfnt = Font.GetFont("TewiFontOutline");