Add option to toggle friendly fire.

This commit is contained in:
Mari the Deer 2022-08-17 17:34:15 +02:00
commit 283ebbda34
6 changed files with 31 additions and 2 deletions

View file

@ -84,6 +84,7 @@ nosave bool swwm_skipskill = false; // skips skill confirmations
nosave bool swwm_hudallammo = false; // only show ammo for owned weapons
nosave bool swwm_nointroex = false; // does not play the "explosions" intro sequence
server bool swwm_bonkhammer = false; // combat hammer makes bonk sounds when hitting enemies
server int swwm_friendlyfire = 0; // 0: allow all friendly fire, 1: block incoming damage, 2: block incoming and outgoing damage
// minimap settings
nosave bool swwm_mm_enable = true; // show a minimap below the score counter

View file

@ -185,6 +185,10 @@ SWWM_COL_12 = "White";
SWWM_COL_13 = "Yellow";
SWWM_UTITLE = "Interface Options";
SWWM_BONKHAMMER = "Bonk Hammer";
SWWM_FRIENDLYFIRE = "Friendly Fire";
SWWM_FF_UNRESTRICTED = "Unrestricted";
SWWM_FF_INCOMING = "Block Incoming";
SWWM_FF_ALL = "Block All";
SWWM_MM_ENABLE = "Show Minimap";
SWWM_MM_MISSILES = "Projectiles In Minimap";
SWWM_MM_COLORSET = "Minimap Color Set";
@ -284,6 +288,7 @@ TOOLTIP_SWWM_HUDALLAMMO = "Shows all ammo types in the HUD, rather than only tho
TOOLTIP_SWWM_NOINTROEX = "Skips the explosion sequence over the original titlepic.";
TOOLTIP_SWWM_TAGCOLOR = "Changes the color for the glowing tags on various parts of the player's body.";
TOOLTIP_SWWM_BONKHAMMER = "The Combat Hammer will make funny sounds when hitting enemies.";
TOOLTIP_SWWM_FRIENDLYFIRE = "Controls whether friendlies can deal damage to or take damage from the player.";
TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements.";
TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap on the top right corner of the screen.";
TOOLTIP_SWWM_MM_MISSILES = "Displays projectiles in the minimap. Can be toggled if this clutters too much.";

View file

@ -182,6 +182,10 @@ SWWM_COL_12 = "Blanco";
SWWM_COL_13 = "Amarillo";
SWWM_UTITLE = "Opciones de Interfaz";
SWWM_BONKHAMMER = "Martillo Loco";
SWWM_FRIENDLYFIRE = "Fuego Amigo";
SWWM_FF_UNRESTRICTED = "Sin Restricción";
SWWM_FF_INCOMING = "Bloquear Entrante";
SWWM_FF_ALL = "Bloquear Todo";
SWWM_MM_ENABLE = "Mostrar Minimapa";
SWWM_MM_MISSILES = "Proyectiles en Minimapa";
SWWM_MM_COLORSET = "Set de Colores de Minimapa";
@ -282,6 +286,7 @@ TOOLTIP_SWWM_HUDALLAMMO = "Muestra todos los tipos de munición en el HUD, en lu
TOOLTIP_SWWM_NOINTROEX = "Salta la secuencia de explosiones sobre la imagen de título original.";
TOOLTIP_SWWM_TAGCOLOR = "Cambia el color de las marcas brillantes en varias partes del cuerpo del jugador.";
TOOLTIP_SWWM_BONKHAMMER = "El Martillo de Combate hará ruídos graciosos al golpear enemigos.";
TOOLTIP_SWWM_FRIENDLYFIRE = "Controla el que los aliados puedan causar daño o ser dañados por el jugador.";
TOOLTIP_SWWMACHIEVEMENTMENU = "Revisa tus logros.";
TOOLTIP_SWWM_MM_ENABLE = "Muestra un minimapa en la esquina superior derecha de la pantalla.";
TOOLTIP_SWWM_MM_MISSILES = "Muestra proyectiles en el minimapa. Puede ser desactivado si causa problemas de visibilidad.";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r336 \cu(Wed 17 Aug 16:10:31 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r336 \cu(2022-08-17 16:10:31)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r337 \cu(Wed 17 Aug 17:34:15 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r337 \cu(2022-08-17 17:34:15)\c-";

View file

@ -105,6 +105,12 @@ OptionValue "SWWMTagColor"
12, "$SWWM_COL_12"
13, "$SWWM_COL_13"
}
OptionValue "SWWMFriendlyFire"
{
0, "$SWWM_FF_UNRESTRICTED"
1, "$SWWM_FF_INCOMING"
2, "$SWWM_FF_ALL"
}
OptionMenu "SWWMOptionMenu"
{
Class "SWWMOptionMenu"
@ -204,6 +210,7 @@ OptionMenu "SWWMOptionMenu"
Option "$SWWM_UNCAPALERT", "swwm_uncapalert", "YesNo"
Option "$SWWM_NOTRACK", "swwm_notrack", "YesNo"
Option "$SWWM_STRICTUNTOUCHABLE", "swwm_strictuntouchable", "SWWMUntouchableStrictness"
Option "$SWWM_FRIENDLYFIRE", "swwm_friendlyfire", "SWWMFriendlyFire"
Option "$SWWM_SWAPWEAPONS", "swwm_swapweapons", "YesNo"
StaticText " "
StaticText "$SWWM_ITITLE", 1

View file

@ -28,6 +28,17 @@ Class SayaCollar : SWWMArmor
newdamage = splitdmg[0]+splitdmg[1];
}
}
// for friendly fire handling, jammed into here
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
{
int ff = swwm_friendlyfire;
if ( !source || !source.IsFriend(Owner) || !ff ) return;
// 1: block incoming friendly damage
// 2: also block outgoing friendly damage
if ( (passive && ff) || (!passive && (ff == 2)) )
newdamage = 0;
}
}
// high-resonant almasteel plating