Add one extra skill.

Prevent mp items from spawning on skills 5 and 6.
Disable store on skills 5 and 6.
Fix Shotgunners dropping Wallbusters in Doom 1.
Fix episode/skill menus being compacted when they have more than 5 text items.
Tweak message boxes.
This commit is contained in:
Mari the Deer 2021-03-19 17:14:33 +01:00
commit 761042e200
9 changed files with 199 additions and 37 deletions

View file

@ -17,10 +17,12 @@ SWWM_KBASE = "Demolitionist Menu";
SWWM_MINIMAPIN = "Minimap Zoom In";
SWWM_MINIMAPOUT = "Minimap Zoom Out";
// skills
SWWM_SKCHILL = "\cdJust Chillin'\c-";
SWWM_SKEASY = "\ckTaking It Easy~\c-";
SWWM_SKNORMAL = "\ciAdequate Adventure\c-";
SWWM_SKHARD = "\cgI'm A Masochist\c-";
SWWM_SKCHILL = "\cvJust Chillin'\c-";
SWWM_SKEASY = "\cdTaking It Easy~\c-";
SWWM_SKNORMAL = "\cfAdequate Adventure\c-";
SWWM_SKHARD = "\ciModerate Challenge\c-";
SWWM_SKHARDCORE = "\cgI'm A Masochist\c-";
SWWM_SKHARDCORECONFIRM = "You think the mod's too easy?\nPrepare yourself.";
SWWM_SKLUNATIC = "\cr \c-";
SWWM_SKLUNATICCONFIRM = "You will die, you will suffer.\nThat, I can guarantee.";
// mod menu

View file

@ -17,10 +17,12 @@ SWWM_KBASE = "Menú de Demolicionista";
SWWM_MINIMAPIN = "Acercar Zoom de Minimapa";
SWWM_MINIMAPOUT = "Alejar Zoom de Minimapa";
// skills
SWWM_SKCHILL = "\cdDe Relax\c-";
SWWM_SKEASY = "\ckCon Calmita~\c-";
SWWM_SKNORMAL = "\ciAventura Adecuada\c-";
SWWM_SKHARD = "\cgSoy Masoca\c-";
SWWM_SKCHILL = "\cvDe Relax\c-";
SWWM_SKEASY = "\cdCon Calmita~\c-";
SWWM_SKNORMAL = "\cfAventura Adecuada\c-";
SWWM_SKHARD = "\ciDesafío Moderado\c-";
SWWM_SKHARDCORE = "\cgSoy Masoca\c-";
SWWM_SKHARDCORECONFIRM = "¿Crees que el mod es demasiado fácil?\nPues prepárate.";
SWWM_SKLUNATIC = "\crINTENTA MUERTE\c-";
SWWM_SKLUNATICCONFIRM = "Vas a morir, vas a sufrir.\nEso te lo puedo garantizar.";
// mod menu

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r371 \cu(Fri 19 Mar 17:14:06 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r371 \cu(2021-03-19 17:14:06)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r372 \cu(Fri 19 Mar 17:14:33 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r372 \cu(2021-03-19 17:14:33)\c-";

View file

@ -256,7 +256,7 @@ ListMenu "MainMenu"
Size Clean
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
LineSpacing 32
SWWMLogo "graphics/M_SWWM.png"
Position 0, 56
SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu"
@ -271,7 +271,7 @@ ListMenu "MainMenuTextOnly"
Size Clean
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
LineSpacing 32
SWWMLogo "graphics/M_SWWM.png"
Position 0, 56
SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu"
@ -286,7 +286,7 @@ ListMenu "GameFilesMenu"
Size Clean
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
LineSpacing 32
Position 0, 88
SWWMTextItemM "$MNU_LOADGAME", "l", "LoadGameMenu"
SWWMTextItemM "$MNU_SAVEGAME", "s", "SaveGameMenu"
@ -305,9 +305,9 @@ ListMenu "EpisodeMenu"
}
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
LineSpacing 0
SWWMStaticTextM 0, 0, "$MNU_EPISODE", "Blue"
Position 0, 48
Position 0, 0
}
ListMenu "SkillMenu"
@ -316,7 +316,7 @@ ListMenu "SkillMenu"
Size Clean
Font "SWWMBigFont", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 28
LineSpacing 0
SWWMStaticTextM 0, 0, "$MNU_CHOOSESKILL", "Blue"
Position 0, 48
Position 0, 0
}

View file

@ -99,6 +99,7 @@ Skill chill
AutoUseHealth
DamageFactor = 0.5
EasyBossBrain
SlowMonsters
SpawnFilter = baby
ACSReturn = 0
Name = "$SWWM_SKCHILL"
@ -122,14 +123,28 @@ Skill hard
ACSReturn = 3
Name = "$SWWM_SKHARD"
}
Skill hardcore
{
DisableCheats
FastMonsters
HealthFactor = 1.5
DamageFactor = 1.5
Aggressiveness = 0.25
SpawnFilter = nightmare
SpawnMulti
ACSReturn = 4
Name = "$SWWM_SKHARDCORE"
MustConfirm = "$SWWM_SKHARDCORECONFIRM"
}
Skill lunatic
{
FastMonsters
DisableCheats
Aggressiveness = 1.0
SpawnFilter = nightmare
SpawnMulti
TotalInfighting
InstantReaction
NoPain
ACSReturn = 4
Name = "$SWWM_SKLUNATIC"
MustConfirm = "$SWWM_SKLUNATICCONFIRM"

View file

@ -180,6 +180,21 @@ extend Class SWWMHandler
}
}
private bool SuppressMultiItem( WorldEvent e )
{
// quick checks
if ( !G_SkillPropertyInt(SKILLP_SpawnMulti) || multiplayer || (dmflags2&(1<<29)) ) // wow there's no dmflags constants defined in zscript???
return false;
// is it coop inventory? suppress it
if ( (e.Thing.spawnflags&(MTF_COOPERATIVE|MTF_DEATHMATCH)) && !(e.Thing.spawnflags&MTF_SINGLE) && (e.Thing is 'Inventory') )
{
e.Thing.ClearCounters();
e.Thing.Destroy();
return true;
}
return false;
}
override void WorldThingDestroyed( WorldEvent e )
{
if ( !e.Thing.default.bSHOOTABLE || !e.Thing.default.bMISSILE )
@ -192,6 +207,8 @@ extend Class SWWMHandler
override void WorldThingSpawned( WorldEvent e )
{
if ( SuppressMultiItem(e) )
return;
IWantDieSpawn(e);
if ( (e.Thing is 'TeleportDest') || (e.Thing is 'BossTarget') )
{

View file

@ -331,7 +331,7 @@ Class DemolitionistMenu : GenericMenu
tabs.Push(TAB_INVENTORY);
tabs.Push(TAB_KEYS);
tabs.Push(TAB_LIBRARY);
if ( !deathmatch ) tabs.Push(TAB_STORE);
if ( !deathmatch && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4) ) tabs.Push(TAB_STORE);
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || (i == consoleplayer) ) continue;

View file

@ -217,13 +217,17 @@ Class SWWMMainMenu : ListMenu
// skill/episode menu hack
Class SWWMBigMenuHack : ListMenu
{
bool longlist; // more than 10 entries, scrolls
int ofs;
Font markfont;
override void Init( Menu parent, ListMenuDescriptor desc )
{
Super.Init(parent,desc);
// replace text/patch items with our own
for ( int i=0; i<mDesc.mItems.Size(); i++ )
{
let itm = mDesc.mItems[i];
// replace text/patch items with our own
if ( itm.GetClass() == 'ListMenuItemTextItem' )
{
let ti = ListMenuItemTextItem(itm);
@ -247,6 +251,100 @@ Class SWWMBigMenuHack : ListMenu
pi.Destroy();
}
}
// realign everything to be vertically centered
int ntext = 0;
for ( int i=0; i<mDesc.mItems.Size(); i++ )
{
let itm = mDesc.mItems[i];
if ( (itm.GetClass() == 'ListMenuItemSWWMTextItemM') || (itm.GetClass() == 'ListMenuItemSWWMPatchItemM') )
ntext++;
}
if ( ntext > 7 )
{
longlist = true;
ntext = 7;
markfont = Font.GetFont('TewiShaded');
}
double theight = ntext*32+56;
int h = mDesc.DisplayHeight();
if ( h == -1 ) h = 200;
double oy = int((h-theight)/2);
// apply offsets
for ( int i=0, j=0; i<mDesc.mItems.Size(); i++ )
{
let itm = mDesc.mItems[i];
if ( (itm.GetClass() == 'ListMenuItemSWWMTextItemM') || (itm.GetClass() == 'ListMenuItemSWWMPatchItemM') )
{
itm.OffsetPositionY(oy+56); // offset from static text header
itm.OffsetPositionY(32*(j++)); // offset from other entries
}
else
{
// GROSS HACK statictext will for whatever reason INCREASE in offset every time Init is called
if ( itm.GetClass() == 'ListMenuItemSWWMStaticTextM' )
itm.OffsetPositionY(-itm.GetY());
itm.OffsetPositionY(oy);
}
}
}
override void Ticker()
{
Super.Ticker();
// update selection offset
if ( longlist ) ofs = clamp(mDesc.mSelectedItem-4,0,mDesc.mItems.Size()-8);
}
override void Drawer()
{
if ( !longlist )
{
Super.Drawer();
return;
}
// LOTS OF HACK
int w = mDesc.DisplayWidth();
int h = mDesc.DisplayHeight();
bool isclean = false;
if ( w == -1 )
{
w = 320;
h = 200;
isclean = true;
}
int mofs = (h-280)/2;
if ( ofs > 0 )
{
String str = "⌃ ⌃ ⌃";
if ( isclean ) Screen.DrawText(markfont,Font.CR_FIRE,int((w-markfont.StringWidth(str))/2.),mofs+40,str,DTA_Clean,true);
else Screen.DrawText(markfont,Font.CR_FIRE,int((w-markfont.StringWidth(str))/2.),mofs+40,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
if ( ofs < (mDesc.mItems.Size()-8) )
{
String str = "⌄ ⌄ ⌄";
if ( isclean ) Screen.DrawText(markfont,Font.CR_FIRE,int((w-markfont.StringWidth(str))/2.),mofs+276,str,DTA_Clean,true);
else Screen.DrawText(markfont,Font.CR_FIRE,int((w-markfont.StringWidth(str))/2.),mofs+276,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
for( int i=0; i<mDesc.mItems.Size(); i++ )
{
if ( !mDesc.mItems[i].mEnabled ) continue;
bool offsetme = false;
if ( (mDesc.mItems[i].GetClass() == 'ListMenuItemSWWMTextItemM') || (mDesc.mItems[i].GetClass() == 'ListMenuItemSWWMPatchItemM') )
{
if ( (i <= ofs) || (i > ofs+7) )
continue;
offsetme = true;
}
if ( offsetme ) mDesc.mItems[i].OffsetPositionY(-ofs*32);
mDesc.mItems[i].Draw((mDesc.mSelectedItem==i),mDesc);
if ( offsetme ) mDesc.mItems[i].OffsetPositionY(ofs*32);
}
if ( (mDesc.mSelectedItem >= 0) && (mDesc.mSelectedItem < mDesc.mItems.Size()) )
{
if ( !menuDelegate.DrawSelector(mDesc) )
mDesc.mItems[mDesc.mSelectedItem].DrawSelector(mDesc.mSelectOfsX,mDesc.mSelectOfsY-ofs*32,mDesc.mSelector,mDesc);
}
Menu.Drawer();
}
}
@ -281,12 +379,12 @@ Class ListMenuItemSWWMStaticTextM : ListMenuItem
if ( w == ListMenuDescriptor.CleanScale )
{
double x = (320-mFont.StringWidth(text))/2;
Screen.DrawText(mFont,mColor,x,abs(mYpos),text,(mYpos<0)?DTA_CleanTop:DTA_Clean,true);
Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_Clean,true);
}
else
{
double x = (w-mFont.StringWidth(text))/2;
Screen.DrawText(mFont,mColor,x,abs(mYpos),text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
}
}
@ -329,35 +427,63 @@ Class SWWMMessageBox : MessageBoxMenu
override void Init( Menu parent, String message, int messagemode, bool playsound, Name cmd, voidptr native_handler )
{
Super.Init(parent,message,messagemode,playsound,cmd,native_handler);
arrowFont = textFont = NewSmallFont;
destWidth = CleanWidth;
destHeight = CleanHeight;
selector = "▸";
int mr1 = destWidth/2+10+textFont.StringWidth(Stringtable.Localize("$TXT_YES"));
int mr2 = destWidth/2+10+textFont.StringWidth(Stringtable.Localize("$TXT_NO"));
mMouseRight = max(mr1,mr2);
mMessage = textFont.BreakLines(Stringtable.Localize(message),int(300/NotifyFontScale));
mMessage = newsmallfont.BreakLines(Stringtable.Localize(message),int(300/NotifyFontScale));
}
override void Drawer()
{
let fontheight = int(textFont.GetHeight()*NotifyFontScale);
let fontheight = int(newsmallfont.GetHeight()*NotifyFontScale);
double y = destHeight/2;
int c = mMessage.Count();
y -= c*fontHeight/2;
for ( int i=0; i<c; i++ )
{
Screen.DrawText(textFont,OptionMenuSettings.mFontColorValue,destWidth/2-int(mMessage.StringWidth(i)*NotifyFontScale)/2,y,mMessage.StringAt(i),DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,NotifyFontScale,DTA_ScaleY,NotifyFontScale);
Screen.DrawText(newsmallfont,OptionMenuSettings.mFontColorValue,destWidth/2-int(mMessage.StringWidth(i)*NotifyFontScale)/2,y,mMessage.StringAt(i),DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,NotifyFontScale,DTA_ScaleY,NotifyFontScale);
y += fontheight;
}
if ( mMessageMode != 0 ) return;
y += fontheight;
mMouseY = int(y);
Screen.DrawText(textFont,messageSelection==0?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,destWidth/2,y,Stringtable.Localize("$TXT_YES"), DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,NotifyFontScale,DTA_ScaleY,NotifyFontScale);
Screen.DrawText(textFont,messageSelection==1?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,destWidth/2,y+fontheight, Stringtable.Localize("$TXT_NO"),DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,NotifyFontScale,DTA_ScaleY,NotifyFontScale);
if ( messageSelection < 0 ) return;
if ( (MenuTime()%8) < 6 )
Screen.DrawText(arrowFont,OptionMenuSettings.mFontColorSelection,destWidth/2-11,y+fontheight*messageSelection,selector,DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
String stryes = Stringtable.Localize("$TXT_YES");
String strno = Stringtable.Localize("$TXT_NO");
Screen.DrawText(newsmallfont,messageSelection==0?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,(destWidth-newsmallfont.StringWidth(stryes))/2,y,stryes, DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,NotifyFontScale,DTA_ScaleY,NotifyFontScale);
Screen.DrawText(newsmallfont,messageSelection==1?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,(destWidth-newsmallfont.StringWidth(strno))/2,y+fontheight,strno,DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,NotifyFontScale,DTA_ScaleY,NotifyFontScale);
if ( (messageSelection < 0) || ((MenuTime()%8) >= 4) ) return;
Screen.DrawText(newsmallfont,OptionMenuSettings.mFontColorSelection,(destWidth-newsmallfont.StringWidth(messageSelection?strno:stryes))/2-16,y+fontheight*messageSelection,"►",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
Screen.DrawText(newsmallfont,OptionMenuSettings.mFontColorSelection,(destWidth+newsmallfont.StringWidth(messageSelection?strno:stryes))/2+8,y+fontheight*messageSelection,"◄",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true);
}
override bool MouseEvent( int type, int x, int y )
{
if ( mMessageMode == 1 )
{
if ( type == MOUSE_Click )
return MenuEvent(MKEY_Enter,true);
return false;
}
else
{
int sel = -1;
int fh = newsmallfont.GetHeight()+1;
// convert x/y from screen to virtual coordinates, according to CleanX/Yfac use in DrawTexture
x = x*destWidth/screen.GetWidth();
y = y*destHeight/screen.GetHeight();
if ( (y >= mMouseY) && (y < mMouseY+2*fh) )
{
sel = (y >= mMouseY+fh);
// are we actually selecting the text?
String txt = sel?Stringtable.Localize("$TXT_NO"):Stringtable.Localize("$TXT_YES");
int txtln = newsmallfont.StringWidth(txt);
int minx = (destWidth-txtln)/2;
if ( (x < (destWidth-txtln)/2) && (x > (destWidth+txtln)/2) )
sel = -1;
}
messageSelection = sel;
if ( type == MOUSE_Release ) return MenuEvent(MKEY_Enter,true);
return true;
}
}
}

View file

@ -1782,8 +1782,8 @@ Class SWWMUtility
}
static Class<Inventory> PickHereticSlot3() // also used for Doom 1
{
//return PickPair(PickSWWMSlot3(),PickSWWMSlot4(),2);
return PickPair('Spreadgun','Wallbuster',2);
if ( level.maptime ) return PickSWWMSlot3(); // always slot 3 after map start, prevents shotgun guys from dropping wallbusters
return PickPair(PickSWWMSlot3(),PickSWWMSlot4(),2);
}
}