New Anti-BD script. >:3

This commit is contained in:
Mari the Deer 2023-07-29 18:00:28 +02:00
commit 7653d7d09f
103 changed files with 159 additions and 330 deletions

View file

@ -13,10 +13,14 @@
Class SWWMBrutalHandler : StaticEventHandler
{
ui int timer;
ui TextureID scr[85];
ui Font fnt;
ui TextureID boydance[10], boykiss;
ui int boyframe, boystate, boyloop1, boyloop2, boytimer;
bool detected;
String which, whichshort;
const BOYTICRATE = 5;
override void OnRegister()
{
// check for brutal doom
@ -66,21 +70,134 @@ Class SWWMBrutalHandler : StaticEventHandler
timer = 0;
return;
}
if ( timer == 35 )
if ( timer == 70 )
{
S_StartSound("misc/spawn",CHAN_YABLEWIT,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
S_StartSound("misc/spawn",CHAN_YABLEWIT,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
boykiss = TexMan.CheckForTexture("graphics/BDScreen/BOYKISSR.png");
fnt = Font.GetFont("TewiFontOutline");
S_StartSound("misc/spawn",CHAN_YABLEWIT,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1.,ATTN_NONE);
S_StartSound("misc/spawn",CHAN_YABLEWIT,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1.,ATTN_NONE);
S_ChangeMusic("",force:true);
Console.PrintfEx(PRINT_HIGH|PRINT_NONOTIFY,"\n\n\cjYou like playing \cg"..which.."\cj don't you?\c-\n\n\n");
}
else if ( timer == 140 )
{
for ( int i=0; i<85; i++ )
scr[i] = TexMan.CheckForTexture(String.Format("graphics/BDScreen/BDSCR%03d.jpg",i+1));
S_ChangeMusic("",force:true);
S_StartSound("brutal/bdscreen",CHAN_YABLEWIT,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
S_StartSound("brutal/bdscreen",CHAN_YABLEWIT,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
for ( int i=0; i<10; i++ )
boydance[i] = TexMan.CheckForTexture(String.Format("graphics/BDScreen/BOYKISS%d.png",i));
S_ChangeMusic("music/thepenis.it",force:true);
}
else if ( timer == 484 ) ThrowAbortException("This manual abort is for your own safety");
else if ( timer == 2100 ) ThrowAbortException("This manual abort is for your own safety");
timer++;
if ( timer >= 105 )
{
boytimer++;
switch ( boystate )
{
case 0: // up
boyframe = 0;
if ( !(boytimer%BOYTICRATE) )
boystate = 1;
break;
case 1: // down
boyframe = 1;
if ( !(boytimer%BOYTICRATE) )
{
if ( boyloop1 >= 2 )
{
boyloop1 = 0;
boystate = 2;
}
else
{
boyloop1++;
boystate = 0;
}
}
break;
case 2: // turn A
boyframe = 2;
if ( !(boytimer%BOYTICRATE) )
boystate = 3;
break;
case 3: // turn B
boyframe = 3;
if ( !(boytimer%BOYTICRATE) )
boystate = 4;
break;
case 4: // down
boyframe = 4;
if ( !(boytimer%BOYTICRATE) )
boystate = 5;
break;
case 5: // up
boyframe = 5;
if ( !(boytimer%BOYTICRATE) )
{
if ( boyloop1 >= 2 )
{
boyloop1 = 0;
boystate = 6;
}
else
{
boyloop1++;
boystate = 4;
}
}
break;
case 6: // turn B
boyframe = 3;
if ( !(boytimer%BOYTICRATE) )
boystate = 7;
break;
case 7: // turn A
boyframe = 2;
if ( !(boytimer%BOYTICRATE) )
{
if ( boyloop2 >= 2 )
{
boyloop2 = 0;
boystate = 8;
}
else
{
boyloop2++;
boystate = 0;
}
}
break;
case 8: // spin left
boyframe = 6;
if ( !(boytimer%BOYTICRATE) )
boystate = 9;
break;
case 9: // spin back
boyframe = 7;
if ( !(boytimer%BOYTICRATE) )
boystate = 10;
break;
case 10: // spin right
boyframe = 8;
if ( !(boytimer%BOYTICRATE) )
boystate = 11;
break;
case 11: // spin front
boyframe = 9;
if ( !(boytimer%BOYTICRATE) )
{
if ( boyloop1 >= 2 )
{
boyloop1 = 0;
boystate = 0;
}
else
{
boyloop1++;
boystate = 8;
}
}
break;
}
}
}
override void WorldTick()
@ -92,16 +209,24 @@ Class SWWMBrutalHandler : StaticEventHandler
override void RenderOverlay( RenderEvent e )
{
if ( !detected ) return;
if ( timer < 35 ) return;
Screen.Dim("Black",clamp(((timer+e.fractic)-35.)/70.,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight());
if ( timer < 140 )
Screen.Dim("White",clamp((timer+e.fractic)/70.,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight());
if ( timer < 70 ) return;
String str = "You like playing \cg"..which.."\c- don't you?";
int boxh = fnt?((fnt.GetHeight()+16)*CleanYFac):0;
double scl = (Screen.GetHeight()-boxh)/2048.;
if ( boykiss.IsValid() ) Screen.DrawTexture(boykiss,false,Screen.GetWidth()/2,(Screen.GetHeight()-boxh)/2,DTA_CenterOffset,true,DTA_ScaleX,scl,DTA_ScaleY,scl);
if ( fnt )
{
String str = "Can I run this with \cg"..which.."\c-?";
Screen.DrawText(bigfont,Font.CR_WHITE,(Screen.GetWidth()-bigfont.StringWidth(str)*CleanXFac_1)/2,(Screen.GetHeight()-bigfont.GetHeight()*CleanYFac_1)/2,str,DTA_CleanNoMove_1,true);
return;
Screen.Dim("Black",.8,0,Screen.GetHeight()-boxh,Screen.GetWidth(),boxh);
Screen.DrawText(fnt,Font.CR_WHITE,(Screen.GetWidth()-fnt.StringWidth(str)*CleanXFac)/2,Screen.GetHeight()-(boxh-8*CleanYFac),str,DTA_CleanNoMove,true);
}
if ( timer < 140 ) return;
if ( boydance[boyframe].IsValid() )
{
Screen.DrawTexture(boydance[boyframe],false,112*CleanXFac_1,192*CleanYFac_1,DTA_CleanNoMove_1,true);
Screen.DrawTexture(boydance[boyframe],false,Screen.GetWidth()-112*CleanXFac_1,192*CleanYFac_1,DTA_CleanNoMove_1,true);
Screen.DrawTexture(boydance[boyframe],false,112*CleanXFac_1,Screen.GetHeight()-(boxh+32*CleanYFac_1),DTA_CleanNoMove_1,true);
Screen.DrawTexture(boydance[boyframe],false,Screen.GetWidth()-112*CleanXFac_1,Screen.GetHeight()-(boxh+32*CleanYFac_1),DTA_CleanNoMove_1,true);
}
int frameno = clamp((timer-140)/4,0,84);
double scl = max(floor(Screen.GetWidth()/320.),1.);
Screen.DrawTexture(scr[frameno],false,(Screen.GetWidth()-320*scl)/2,(Screen.GetHeight()-132*scl)/2,DTA_ScaleX,scl,DTA_ScaleY,scl);
}
}