swwmgz_m/zscript/compat/swwm_shame.zsc

102 lines
3.9 KiB
Text

// SHAMEFUL DISPLAY
// At this point there's no clearer way to tell people to stop combining
// incompatible mods.
// The BD crowd never listens, never learns, you can't just mix up gameplay
// mods and expect everything to work.
// You also can't expect modders to put in the effort needed to go and add
// compatibility for a mod that wouldn't even make any sense to add
// compatibility for because both replace the same things and are entirely
// different beasts with different styles altogether.
// Just stop. Put that gray matter to use. Do you really think it's worth it?
// Don't do this shit.
Class SWWMBrutalHandler : StaticEventHandler
{
ui int timer;
ui TextureID scr;
bool detected;
String which, whichshort;
override void OnRegister()
{
if ( swwm_iseriouslywanttoplaythiswithbd )
return;
foreach ( cls:AllActorClasses )
{
if ( cls.GetClassName() == "BDoomer" )
{
detected = true;
which = "Brutal Doom";
whichshort = "BD";
}
else if ( cls.GetClassName() == "BrutalDoomer" )
{
detected = true;
which = "Project Brutality";
whichshort = "PB";
}
if ( detected ) break;
}
if ( !detected )
return;
SetRandomSeed[bdscreen](Random[bdscreen]()+consoleplayer+MSTime());
Console.Printf(
"\cx┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\c-\n"
"\cx┃ \cfIf you have "..whichshort.." on your autoload you really shouldn't. \cx┃\c-\n"
"\cx┃ \cfIf you manually loaded it with this mod, why would you? \cx┃\c-\n"
"\cx┃ \cfThey're not compatible and never will be. \cx┃\c-\n"
"\cx┃ \cfThis mod will now shit the bed once you go in-game, \cx┃\c-\n"
"\cx┃ \cfand trust me, it's better this way. \cx┃\c-\n"
"\cx┃ \cf<See you again, have a nice day> \cx┃\c-\n"
"\cx┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\c-");
S_StartSound("compat/warn",CHAN_YOUDONEFUCKEDUP,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
}
override void WorldLoaded( WorldEvent e )
{
// get rid of ourselves if not needed
if ( !detected && !bDestroyed )
Destroy();
}
override void UiTick()
{
if ( !detected ) return;
if ( gamestate == GS_LEVEL )
{
if ( timer == 1 )
{
S_StartSound("brutal/ezmodo",CHAN_YOUDONEFUCKEDUP,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
S_StartSound("brutal/ezmodo",CHAN_YOUDONEFUCKEDUP,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
}
else if ( timer == 350 ) ThrowAbortException("This manual abort is for your own safety");
timer++;
}
else timer = 0;
}
override void WorldTick()
{
if ( !detected ) return;
for ( int i=0; i<MAXPLAYERS; i++ ) if ( playeringame[i] ) players[i].cheats |= CF_TOTALLYFROZEN;
}
override void RenderOverlay( RenderEvent e )
{
if ( !detected ) return;
if ( !scr ) scr = TexMan.CheckForTexture("graphics/bdscreen.png");
Screen.Dim("Red",(timer/350.)-.2,0,0,Screen.GetWidth(),Screen.GetHeight());
double ar = Screen.GetAspectRatio();
Vector2 tsize = TexMan.GetScaledSize(scr);
Vector2 vsize = (Screen.GetWidth(),Screen.GetHeight());
if ( (tsize.x > vsize.x) || (tsize.y > vsize.y) )
{
double sar = tsize.x/tsize.y;
if ( sar > ar ) vsize = (tsize.x,tsize.x/ar);
else if ( sar < ar ) vsize = (tsize.y*ar,tsize.y);
else vsize = tsize;
}
Screen.DrawTexture(scr,false,(vsize.x-tsize.x)/2.+FRandom[bdscreen](-1,1)*max(timer-40,0)**3*.000003,(vsize.y-tsize.y)/2.+FRandom[bdscreen](-1,1)*max(timer-40,0)**3*.000003,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_Alpha,min(1.,timer/50.));
Screen.Dim("Red",(timer/70.)-3.5,0,0,Screen.GetWidth(),Screen.GetHeight());
}
}