"Extended Virtual Hitbox" for items.

This commit is contained in:
Mari the Deer 2022-03-27 15:27:03 +02:00
commit 0aee4035ed
8 changed files with 53 additions and 4 deletions

View file

@ -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

View file

@ -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.";

View file

@ -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.";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r2 \cu(Sun 27 Mar 15:26:51 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r2 \cu(2022-03-27 15:26:51)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r3 \cu(Sun 27 Mar 15:27:03 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r3 \cu(2022-03-27 15:27:03)\c-";

View file

@ -219,11 +219,12 @@ OptionMenu "SWWMOptionMenu"
Option "$SWWM_SIMPLEFOG", "swwm_simplefog", "YesNo"
Option "$SWWM_SHOTGIB", "swwm_shotgib", "YesNo"
Option "$SWWM_STRICTUNTOUCHABLE", "swwm_strictuntouchable", "SWWMUntouchableStrictness"
Option "$SWWM_SWAPWEAPONS", "swwm_swapweapons", "YesNo" // comment out until DLC1
Option "$SWWM_SWAPWEAPONS", "swwm_swapweapons", "YesNo"
StaticText " "
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)

View file

@ -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);
}

View file

@ -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 )
{

View file

@ -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