diff --git a/cvarinfo.base b/cvarinfo.base index 73b6886e9..c43a945e1 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -120,6 +120,7 @@ nosave string swwm_menuposehistory = ""; // stores currently seen poses for the nosave string swwm_titlesubhistory = ""; // stores currently seen subtitles for the title screen, for shuffling nosave noarchive int swwm_profstart = 0; // starts profiling as soon as handler is registered for specified >0 tics server bool swwm_nodeathexit = false; // completely sidesteps the inventory resetting of death exits, if you hate those +server bool swwm_extendedpickup = false; // items will have an additional "virtual hitbox" that's the same size as vanilla // minimap settings nosave bool swwm_mm_enable = true; // show a minimap below the score counter diff --git a/language.def_menu b/language.def_menu index 47522c3f4..c897c0d4d 100644 --- a/language.def_menu +++ b/language.def_menu @@ -207,6 +207,7 @@ SWWM_VOICEAMP = "Voice Amplification"; SWWM_CLEARFX = "Clear All Effects"; SWWM_OLDLOGO = "Old Branding"; SWWM_NODEATHEXIT = "Disable Death Exits"; +SWWM_EXTENDEDPICKUP = "Extend Item Size"; SWWM_MMTITLE = "Minimap Settings"; SWWM_MM_ENABLE = "Show Minimap"; SWWM_MM_ROTATE = "Rotate Minimap"; @@ -366,6 +367,7 @@ TOOLTIP_SWWM_VOICEAMP = "At their default volume, the Demolitionist's voice line TOOLTIP_NETEVENT_SWWMCLEAREFFECTS = "Fades out any active blood, gore, debris and casings."; TOOLTIP_SWWM_OLDLOGO = "For those who miss the days of SWWM GZ, you can restore the old title screen and main menu with this."; TOOLTIP_SWWM_NODEATHEXIT = "This option completely negates the effects of death exits, if you don't like losing all your stuff."; +TOOLTIP_SWWM_EXTENDEDPICKUP = "Gives all items a vanilla-sized \"virtual hitbox\" that allows picking them up from farther away. Requires a map restart if changed."; TOOLTIP_SWWMMINIMAPMENU = "Configure the minimap."; TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements."; TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap under the score counter."; diff --git a/language.es_menu b/language.es_menu index 3ba59dd1f..cd120c58d 100644 --- a/language.es_menu +++ b/language.es_menu @@ -206,6 +206,7 @@ SWWM_VOICEAMP = "Amplificación de Voz"; SWWM_CLEARFX = "Limpiar todos los Efectos"; SWWM_OLDLOGO = "Marca Antigua"; SWWM_NODEATHEXIT = "Desactivar Salidas de Muerte"; +SWWM_EXTENDEDPICKUP = "Extender Tamaño de Ítem"; SWWM_MMTITLE = "Opciones de Minimapa"; SWWM_MM_ENABLE = "Mostrar Minimapa"; SWWM_MM_ROTATE = "Rotar Minimapa"; @@ -370,6 +371,7 @@ TOOLTIP_SWWM_VOICEAMP = "A su volumen normal, las voces de la Demolicionista pue TOOLTIP_NETEVENT_SWWMCLEAREFFECTS = "Desvanece cualquier sangre, vísceras, escombros y casquillos activos."; TOOLTIP_SWWM_OLDLOGO = "Para quienes echan de menos los viejos tiempos de SWWM GZ, podeis restaurar la antigua pantalla de inicio y menú principal con esto."; TOOLTIP_SWWM_NODEATHEXIT = "Esta opción invalida completamente los efectos de las salidas de muerte, si no te gusta perder todas tus cosas."; +TOOLTIP_SWWM_EXTENDEDPICKUP = "Da a todos los ítems una \"hitbox virtual\" de tamaño vanilla que permite recogerlos a mayor distancia. Requiere reinicio de mapa si se cambia."; TOOLTIP_SWWMMINIMAPMENU = "Configura el minimapa."; TOOLTIP_SWWMACHIEVEMENTMENU = "Revisa tus logros."; TOOLTIP_SWWM_MM_ENABLE = "Muestra un minimapa bajo el contador de puntuación."; diff --git a/language.version b/language.version index 9273eea38..c5f232b46 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.2 \cu(Sun 27 Mar 03:08:46 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.2.2 \cu(2022-03-27 03:08:46)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.2 \cu(Sun 27 Mar 15:29:24 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.2.2 \cu(2022-03-27 15:29:24)\c-"; diff --git a/menudef.txt b/menudef.txt index 7cdfaca39..bb1ea6a24 100644 --- a/menudef.txt +++ b/menudef.txt @@ -224,6 +224,7 @@ OptionMenu "SWWMOptionMenu" StaticText "$SWWM_ITITLE", 1 Option "$SWWM_USETOPICKUP", "swwm_usetopickup", "YesNo" Option "$SWWM_MELEEPICKUP", "swwm_meleepickup", "YesNo" + Option "$SWWM_EXTENDEDPICKUP", "swwm_extendedpickup", "YesNo" Option "$SWWM_ARMORUSE", "swwm_autousearmor", "YesNo" Option "$SWWM_HEALTHUSE", "swwm_autousehealth", "YesNo" IfGame(Doom) diff --git a/zscript/handler/swwm_handler_debugrender.zsc b/zscript/handler/swwm_handler_debugrender.zsc index dea8db9d5..e091d6096 100644 --- a/zscript/handler/swwm_handler_debugrender.zsc +++ b/zscript/handler/swwm_handler_debugrender.zsc @@ -111,7 +111,9 @@ extend Class SWWMHandler if ( a == players[consoleplayer].Camera ) continue; if ( a.bINVISIBLE && !(a is 'DynamicLight') ) continue; if ( (a is 'Inventory') && Inventory(a).Owner ) continue; - if ( (a is 'SWWMShadow') || (a is 'GhostArtifactX') || (a is 'DemolitionistSelfLight') || (a is 'HeadpatTracker') ) continue; + if ( (a is 'SWWMPickupFlash') && (a.CurState == a.FindState('Pickup')) ) continue; + if ( (a is 'SWWMShadow') || (a is 'GhostArtifactX') || (a is 'DemolitionistSelfLight') || (a is 'HeadpatTracker') || (a is 'SWWMExtendedItemHitbox') + || (a is 'SWWMTeleportLine') || (a is 'SWWMTeleportDest') ) continue; if ( a.Distance3DSquared(e.Camera) > 1000000 ) continue; DrawActor(e,a); } diff --git a/zscript/items/swwm_baseitem.zsc b/zscript/items/swwm_baseitem.zsc index 486ca58f5..b815d318e 100644 --- a/zscript/items/swwm_baseitem.zsc +++ b/zscript/items/swwm_baseitem.zsc @@ -52,10 +52,43 @@ Class CrossLineFinder : LineTracer } } +// hitbox with default collision size for items +Class SWWMExtendedItemHitbox : Actor +{ + override void Tick() + { + if ( !master ) + { + Destroy(); + return; + } + if ( pos != master.pos ) SetOrigin(master.pos,false); + } + override void Touch( Actor toucher ) + { + if ( !master || !master.bSPECIAL || !swwm_extendedpickup ) + return; + master.Touch(toucher); + } + default + { + +NOGRAVITY; + +SPECIAL; + } +} + Mixin Class SWWMUseToPickup { bool bUsePickup; + override void BeginPlay() + { + Super.BeginPlay(); + if ( !swwm_extendedpickup ) return; + let box = Spawn("SWWMExtendedItemHitbox",pos); + box.master = self; + } + // allow pickup by use override bool Used( Actor user ) { diff --git a/zscript/weapons/swwm_baseweapon.zsc b/zscript/weapons/swwm_baseweapon.zsc index 0a686de37..279db0d12 100644 --- a/zscript/weapons/swwm_baseweapon.zsc +++ b/zscript/weapons/swwm_baseweapon.zsc @@ -47,6 +47,14 @@ Class SWWMWeapon : Weapon abstract return null; } + override void BeginPlay() + { + Super.BeginPlay(); + if ( !swwm_extendedpickup ) return; + let box = Spawn("SWWMExtendedItemHitbox",pos); + box.master = self; + } + override void Touch( Actor toucher ) { // show prompt to swap weapon, and prevent normal pickup