Rewrite title stuff without using exploits.

This commit is contained in:
Mari the Deer 2022-05-20 13:11:58 +02:00
commit 08f4ef4b06
5 changed files with 63 additions and 52 deletions

View file

@ -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)*<br/>
*(Quadravol, Biospark Carbine, Sparkster Rifle, Ray-Khom, Mortal Rifle, Ynykron, Rafan-Kos and K79-D)*<br/>
@ -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)*

View file

@ -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-";

Binary file not shown.

View file

@ -12,6 +12,7 @@ Struct TitleExplosion
Class SWWMTitleStuff : EventHandler
{
ui bool bInitialized;
ui TextureID tex[6];
ui TextureID letters[13];
ui TextureID camtex; // must be drawn for shaders to actually use it
@ -23,10 +24,11 @@ Class SWWMTitleStuff : EventHandler
ui bool lastlogo;
ui TitleExplosion smk[64];
ui TextureID smk_frame[19];
int titletimer;
ui int titletimer;
int playtimer; // required for the logo fader
ui int rss;
ui int stopinit_t;
bool bFadeIn;
ui bool bFadeIn;
ui Font mSmallFont, mBigFont;
private ui int GetUIRandom()
@ -68,8 +70,46 @@ Class SWWMTitleStuff : EventHandler
}
}
override void WorldTick()
override void WorldLoaded( WorldEvent e )
{
let f = LogoFader(Actor.Spawn("LogoFader"));
f.hnd = self;
TexMan.SetCameraToTexture(f,"LOGOFADE",90);
// fallback in case netevents fail (old gzdoom)
playtimer = -65536;
}
// synchronize ui->play 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));
}
}

View file

@ -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");