diff --git a/cvarinfo.base b/cvarinfo.base index 8dda5a1ca..4d342e967 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -88,7 +88,10 @@ nosave int swwm_shadowdist = 2000; // max distance beyond which blob shadows ar server bool swwm_swapweapons = true; // [DLC1] allows carrying only one weapon in each slot (excluding starter melee) nosave int swwm_forcestats = 1; // always shows level stats on the HUD, not just when the automap is open (2 - also show map name, otherwise only stats) user int swwm_funtrails = 0; // recolors trails of eviscerator chunks and sheen bullets -server int swwm_pistolstart = 0; // enforces pistol start for all maps (excluding hubs) [2 - only between clusters] +server int swwm_ps_fullreset = 0; // full reset of inventory, including score if enabled (0: no, 1: all maps excluding hubs, 2: between clusters) +server int swwm_ps_resetammo = 0; // resets all ammo to zero +server int swwm_ps_resetitems = 0; // removes all carried items +server int swwm_ps_resethealth = 0; // sets health back to 100 nosave int swwm_numcolor_scr = 5; // font color for score numbers (default: gold) nosave int swwm_numcolor_bonus = 23; // font color for bonus numbers (default: fire) nosave int swwm_numcolor_dmg = 6; // font color for damage numbers (default: red) diff --git a/language.def_menu b/language.def_menu index 93c259ab7..3331c461c 100644 --- a/language.def_menu +++ b/language.def_menu @@ -155,7 +155,10 @@ SWWM_TRAILS_MAGENTA = "Magenta"; SWWM_TRAILS_RANDOM = "Random"; SWWM_TRAILS_RAINBOW = "Rainbow"; SWWM_TRAILS_TRANS = "TRANS RIGHTS"; -SWWM_PISTOLSTART = "Force Pistol Start"; +SWWM_PS_FULLRESET = "Pistol Start"; +SWWM_PS_RESETAMMO = "Reset Ammo"; +SWWM_PS_RESETITEMS = "Reset Items"; +SWWM_PS_RESETHEALTH = "Reset Health"; SWWM_PISTOLSTART_MAP = "Per-Map"; SWWM_PISTOLSTART_CLUSTER = "Per-Cluster"; SWWM_NUMCOLOR_SCR = "Score Number Color"; @@ -335,7 +338,10 @@ TOOLTIP_SWWM_SHADOWDIST = "Maximum distance at which to show blob shadows. May h TOOLTIP_SWWM_SWAPWEAPONS = "Allow only one weapon per slot (excluding Deep Impact). Disable if you'd rather throw balance out the window."; TOOLTIP_SWWM_FORCESTATS = "Shows map statistics in the HUD even when the automap isn't open."; TOOLTIP_SWWM_FUNTRAILS = "Recolors the trails left by slot 5 weapon projectiles."; -TOOLTIP_SWWM_PISTOLSTART = "Forces you to pistol start between levels/clusters. This excludes travel between levels within a hub, however."; +TOOLTIP_SWWM_PS_FULLRESET = "Clears your entire inventory, excluding collectibles. May include score reset if enabled separately."; +TOOLTIP_SWWM_PS_RESETAMMO = "Clears all your carried ammo, excluding what is already loaded into your weapons."; +TOOLTIP_SWWM_PS_RESETITEMS = "Clears all your carried items that aren't weapons or ammo. Excludes equipped armor."; +TOOLTIP_SWWM_PS_RESETHEALTH = "Sets your health back to 100%, and removes all equipped armor."; TOOLTIP_SWWM_NUMCOLOR_SCR = "Select the color for score numbers."; TOOLTIP_SWWM_NUMCOLOR_BONUS = "Select the color for bonuses that may accompany score numbers."; TOOLTIP_SWWM_NUMCOLOR_DMG = "Select the color for damage numbers."; diff --git a/language.es_menu b/language.es_menu index 1fe4fa1aa..25642c040 100644 --- a/language.es_menu +++ b/language.es_menu @@ -154,7 +154,10 @@ SWWM_TRAILS_BLUE = "Azul"; SWWM_TRAILS_MAGENTA = "Magenta"; SWWM_TRAILS_RANDOM = "Aleatorio"; SWWM_TRAILS_RAINBOW = "Arcoiris"; -SWWM_PISTOLSTART = "Forzar Pistol Start"; +SWWM_PS_FULLRESET = "Reseteo Completo"; +SWWM_PS_RESETAMMO = "Resetear Munición"; +SWWM_PS_RESETITEMS = "Resetear Ítems"; +SWWM_PS_RESETHEALTH = "Resetear Salud"; SWWM_PISTOLSTART_MAP = "Cada Nivel"; SWWM_PISTOLSTART_CLUSTER = "Cada Clúster"; SWWM_NUMCOLOR_SCR = "Color de Números de Puntos"; @@ -334,7 +337,10 @@ TOOLTIP_SWWM_SHADOWDIST = "Distancia máxima a la que mostrar sombras. Puede ayu TOOLTIP_SWWM_SWAPWEAPONS = "Permite solo un arma por puesto (excluyendo Deep Impact). Desactiva si prefieres tirar el balance por la ventana."; TOOLTIP_SWWM_FORCESTATS = "Muestra estadísticas de mapa en el HUD incluso cuando el automapa no está abierto."; TOOLTIP_SWWM_FUNTRAILS = "Recolorea los rastros dejados por proyectiles de armas de ranura 5."; -TOOLTIP_SWWM_PISTOLSTART = "Fuerza hacer pistol start entre niveles/clústers. Aunque esto excluye viajes entre niveles de un mismo hub."; +TOOLTIP_SWWM_PS_FULLRESET = "Vacía todo tu inventario, excluyendo coleccionables. Puede incluir el reseteo de puntos si está activado."; +TOOLTIP_SWWM_PS_RESETAMMO = "Vacía toda la munición que llevas, excluyendo la que ya esté cargada en tus armas."; +TOOLTIP_SWWM_PS_RESETITEMS = "Vacía todos los ítems que llevas que no sean armas o munición. Excluye la armadura equipada."; +TOOLTIP_SWWM_PS_RESETHEALTH = "Resetea tu salud de vuelta al 100%, y quita toda la armadura equipada."; TOOLTIP_SWWM_NUMCOLOR_SCR = "Selecciona el color para los numeros de puntos."; TOOLTIP_SWWM_NUMCOLOR_BONUS = "Selecciona el color para las bonificaciones que pueden acompañar a los números de puntos."; TOOLTIP_SWWM_NUMCOLOR_DMG = "Selecciona el color para los números de daño."; diff --git a/language.version b/language.version index 94e435973..6bf56c516 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw1.2pre r50 \cu(Thu 4 Nov 20:54:23 CET 2021)\c-"; -SWWM_SHORTVER="\cw1.2pre r50 \cu(2021-11-04 20:54:23)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw1.2pre r51 \cu(Fri 5 Nov 20:54:48 CET 2021)\c-"; +SWWM_SHORTVER="\cw1.2pre r51 \cu(2021-11-05 20:54:48)\c-"; diff --git a/menudef.txt b/menudef.txt index 826170f2d..ce8458b40 100644 --- a/menudef.txt +++ b/menudef.txt @@ -166,7 +166,10 @@ OptionMenu "SWWMOptionMenu" TrapOption "$SWWM_ENGINE", "swwm_engine" StaticText " " StaticText "$SWWM_BTITLE", "Blue" - Option "$SWWM_PISTOLSTART", "swwm_pistolstart", "SWWMPistolStart" + Option "$SWWM_PS_FULLRESET", "swwm_ps_fullreset", "SWWMPistolStart" + Option "$SWWM_PS_RESETAMMO", "swwm_ps_resetammo", "SWWMPistolStart" + Option "$SWWM_PS_RESETITEMS", "swwm_ps_resetitems", "SWWMPistolStart" + Option "$SWWM_PS_RESETHEALTH", "swwm_ps_resethealth", "SWWMPistolStart" Option "$SWWM_ENEMYDROPS", "swwm_enemydrops", "SWWMEnemyDropType" Option "$SWWM_ONDEMANDAMMO", "swwm_ondemandammo", "YesNo" Option "$SWWM_RESETSCORE", "swwm_resetscore", "YesNo" diff --git a/zscript/handler/swwm_handler_worldload.zsc b/zscript/handler/swwm_handler_worldload.zsc index a4f7cd908..86d06a064 100644 --- a/zscript/handler/swwm_handler_worldload.zsc +++ b/zscript/handler/swwm_handler_worldload.zsc @@ -106,16 +106,15 @@ extend Class SWWMHandler } // end of episode resets and enforced pistol starts LevelInfo nextlv = LevelInfo.FindLevelInfo(e.NextMap); - if ( (level.nextsecretmap.Left(6) == "enDSeQ") - || (swwm_pistolstart && nextlv && (level.cluster != nextlv.cluster)) - || ((swwm_pistolstart == 1) && !(level.clusterflags&LevelLocals.CLUSTER_HUB)) ) + for ( int i=0; i 0) && !(level.clusterflags&LevelLocals.CLUSTER_HUB) ) diff --git a/zscript/swwm_gesture_fx.zsc b/zscript/swwm_gesture_fx.zsc index 843151478..afade1936 100644 --- a/zscript/swwm_gesture_fx.zsc +++ b/zscript/swwm_gesture_fx.zsc @@ -106,20 +106,12 @@ Class LoveHeart : Actor override int DoSpecialDamage( Actor target, int damage, Name damagetype ) { + bEXTREMEDEATH = false; + bNOEXTREMEDEATH = false; SWWMStats s = null; if ( Demolitionist(self.target) ) s = Demolitionist(self.target).mystats; if ( s ) s.smooch++; let raging = RagekitPower(self.target.FindInventory("RagekitPower")); - if ( raging ) - { - bEXTREMEDEATH = true; - bNOEXTREMEDEATH = false; - } - else - { - bEXTREMEDEATH = false; - bNOEXTREMEDEATH = true; - } if ( (target is 'WolfensteinSS') || (target.Species == 'WolfensteinSS') ) target.bFRIENDLY = false; if ( target.IsFriend(self.target) || SWWMUtility.IdentifyingDog(target) ) { @@ -163,7 +155,6 @@ Class LoveHeart : Actor { damage = int.max; bEXTREMEDEATH = true; - bNOEXTREMEDEATH = false; } else if ( target is 'SWWMHangingKeen' ) damage = max(target.Health,damage); // rescued by love :3 @@ -171,7 +162,6 @@ Class LoveHeart : Actor { // no cute demon girl can resist demo's charm damage = max(target.Health,damage); - bEXTREMEDEATH = false; bNOEXTREMEDEATH = true; } return damage; diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index 2af32ebc5..979ea8515 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -1,4 +1,5 @@ // The Demolitionist + Class Demolitionist : PlayerPawn { int last_jump_held, last_boost, last_kick; @@ -77,6 +78,15 @@ Class Demolitionist : PlayerPawn int airscreamtime; + enum EInvWipe + { + WIPE_EPISODE = 1, + WIPE_CLUSTER = 2, + WIPE_MAP = 4 + } + + int invwipe; // inventory wipe flags for next level + Property DashFuel : dashfuel; Default @@ -2955,8 +2965,56 @@ Class Demolitionist : PlayerPawn // clean up attached actors if ( selflight ) selflight.Destroy(); // inventory wipes - if ( FindInventory("InventoryWipeToken") && (player.playerstate != PST_DEAD) ) - SWWMUtility.WipeInventory(self,swwm_resetscore); + if ( invwipe && (player.playerstate != PST_DEAD) ) + { + bool wiped = false; + bool resetammo = false; + bool resetitems = false; + bool resethealth = false; + if ( invwipe&WIPE_EPISODE ) + { + SWWMUtility.WipeInventory(self,swwm_resetscore); + wiped = true; + } + if ( invwipe&WIPE_CLUSTER ) + { + if ( (swwm_ps_fullreset == 2) && !wiped ) + { + SWWMUtility.WipeInventory(self,swwm_resetscore); + wiped = true; + } + if ( (swwm_ps_resetammo == 2) && !wiped ) + { + SWWMUtility.ResetAmmo(self); + resetammo = true; + } + if ( (swwm_ps_resetitems == 2) && !wiped ) + { + SWWMUtility.ResetItems(self); + resetitems = true; + } + if ( (swwm_ps_resethealth == 2) && !wiped ) + { + SWWMUtility.ResetHealth(self); + resethealth = true; + } + } + if ( invwipe&WIPE_MAP ) + { + if ( (swwm_ps_fullreset == 1) && !wiped ) + { + SWWMUtility.WipeInventory(self,swwm_resetscore); + wiped = true; + } + if ( (swwm_ps_resetammo == 1) && !wiped && !resetammo ) + SWWMUtility.ResetAmmo(self); + if ( (swwm_ps_resetitems == 1) && !wiped && !resetitems ) + SWWMUtility.ResetItems(self); + if ( (swwm_ps_resethealth == 1) && !wiped && !resethealth ) + SWWMUtility.ResetHealth(self); + } + } + invwipe = 0; } override void Travelled() { diff --git a/zscript/utility/swwm_utility.zsc b/zscript/utility/swwm_utility.zsc index 45be2664b..f46c7c58a 100644 --- a/zscript/utility/swwm_utility.zsc +++ b/zscript/utility/swwm_utility.zsc @@ -1809,6 +1809,50 @@ Class SWWMUtility p.health = p.mo.Health = p.mo.SpawnHealth(); } + // sets all carried ammo back to zero + static play void ResetAmmo( Actor mo ) + { + PlayerInfo p = mo.player; + if ( !p || !p.mo ) return; + for ( Inventory i=p.mo.inv; i; i=i.inv ) + { + if ( !(i is 'Ammo') ) continue; + i.Amount = 0; + } + } + + // removes all carried items that aren't weapons or ammo + static play void ResetItems( Actor mo ) + { + PlayerInfo p = mo.player; + if ( !p || !p.mo ) return; + Actor last = p.mo; + while ( last.inv ) + { + let inv = last.inv; + if ( (inv is 'SWWMCollectible') || (inv is 'Weapon') || (inv is 'Ammo') || (inv is 'SWWMArmor') ) + { + last = inv; + continue; + } + inv.Destroy(); + if ( !inv.bDestroyed ) last = inv; + } + } + + // resets health and removes worn armor + static play void ResetHealth( Actor mo ) + { + PlayerInfo p = mo.player; + if ( !p || !p.mo ) return; + p.health = p.mo.health = 100; + for ( Inventory i=p.mo.inv; i; i=i.inv ) + { + if ( !(i is 'SWWMArmor') ) continue; + i.Amount = 0; + } + } + // WHACK static play void EndLevelDie( Actor victim ) { @@ -2162,14 +2206,3 @@ Class ShinemapDebugSphere : Actor Loop; } } - -// used to indicate that the next level resets inventory -Class InventoryWipeToken : Inventory -{ - default - { - +INVENTORY.UNDROPPABLE; - +INVENTORY.UNTOSSABLE; - +INVENTORY.UNCLEARABLE; - } -} diff --git a/zscript/weapons/swwm_baseweapon_melee.zsc b/zscript/weapons/swwm_baseweapon_melee.zsc index b2122b2b5..244346dd5 100644 --- a/zscript/weapons/swwm_baseweapon_melee.zsc +++ b/zscript/weapons/swwm_baseweapon_melee.zsc @@ -368,16 +368,6 @@ extend Class SWWMWeapon if ( hits.Size() <= 0 ) return false; bool blooded = false; bool bloodless = false; - if ( raging ) - { - invoker.bEXTREMEDEATH = true; - invoker.bNOEXTREMEDEATH = false; - } - else - { - invoker.bEXTREMEDEATH = false; - invoker.bNOEXTREMEDEATH = true; - } int flg = DMG_USEANGLE|DMG_THRUSTLESS; if ( raging ) flg |= DMG_FOILINVUL; int quakin = raging?8:2; @@ -414,8 +404,6 @@ extend Class SWWMWeapon } } self.angle += clamp(diff/hits.Size(),-5.,5.); // averaged reorient - invoker.bEXTREMEDEATH = invoker.default.bEXTREMEDEATH; - invoker.bNOEXTREMEDEATH = invoker.default.bEXTREMEDEATH; A_QuakeEx(quakin/2,quakin/2,quakin/2,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.06*quakin); if ( raging ) {