From 761042e2003b50901ebfecafa602fda8d0be582b Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Fri, 19 Mar 2021 17:14:33 +0100 Subject: [PATCH] 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. --- language.def_menu | 10 +- language.es_menu | 10 +- language.version | 4 +- menudef.txt | 14 +- zmapinfo.txt | 17 +- zscript/handler/swwm_handler_worldthings.zsc | 17 ++ zscript/kbase/swwm_kbase.zsc | 2 +- zscript/menu/swwm_menus.zsc | 158 +++++++++++++++++-- zscript/utility/swwm_utility.zsc | 4 +- 9 files changed, 199 insertions(+), 37 deletions(-) diff --git a/language.def_menu b/language.def_menu index b288e1bd2..c4c722261 100644 --- a/language.def_menu +++ b/language.def_menu @@ -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 = "\crI WANT DIE\c-"; SWWM_SKLUNATICCONFIRM = "You will die, you will suffer.\nThat, I can guarantee."; // mod menu diff --git a/language.es_menu b/language.es_menu index 276a888d5..ebd2cb3a3 100644 --- a/language.es_menu +++ b/language.es_menu @@ -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 diff --git a/language.version b/language.version index 45689a7f1..a8b3cf8c7 100644 --- a/language.version +++ b/language.version @@ -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-"; diff --git a/menudef.txt b/menudef.txt index 308b8b318..36143608e 100644 --- a/menudef.txt +++ b/menudef.txt @@ -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 } diff --git a/zmapinfo.txt b/zmapinfo.txt index 77d463de8..7662b83a6 100644 --- a/zmapinfo.txt +++ b/zmapinfo.txt @@ -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" diff --git a/zscript/handler/swwm_handler_worldthings.zsc b/zscript/handler/swwm_handler_worldthings.zsc index 9071f4911..c01d67f65 100644 --- a/zscript/handler/swwm_handler_worldthings.zsc +++ b/zscript/handler/swwm_handler_worldthings.zsc @@ -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') ) { diff --git a/zscript/kbase/swwm_kbase.zsc b/zscript/kbase/swwm_kbase.zsc index a7ed353dd..6ef45cec0 100644 --- a/zscript/kbase/swwm_kbase.zsc +++ b/zscript/kbase/swwm_kbase.zsc @@ -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 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 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 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= 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; + } } } diff --git a/zscript/utility/swwm_utility.zsc b/zscript/utility/swwm_utility.zsc index 9cb19f664..a9bd70812 100644 --- a/zscript/utility/swwm_utility.zsc +++ b/zscript/utility/swwm_utility.zsc @@ -1782,8 +1782,8 @@ Class SWWMUtility } static Class 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); } }