"Demoslayer" fun option (enemies drop health).

This commit is contained in:
Mari the Deer 2021-10-22 17:26:48 +02:00
commit 883e770899
8 changed files with 144 additions and 3 deletions

View file

@ -120,6 +120,7 @@ nosave bool swwm_weapontooltips = true; // shows a tooltip on weapon operation
nosave string swwm_tooltipshown = ""; // which weapons have already had their tooltips displayed
nosave noarchive bool swwm_tooltipnote = false; // set if the note on how to disable tooltips was already displayed
nosave bool swwm_nointertips = false; // hides intermission tips, in case you don't want to see them
server bool swwm_demoslayer = false; // if you're below 100hp, enemies drop healing orbs when you kill them
// minimap settings
nosave bool swwm_mm_enable = true; // show a minimap below the score counter

View file

@ -205,6 +205,7 @@ SWWM_RESETTOOLTIPS = "Reset Weapon Tooltips";
SWWM_CRESET = "Reset to Defaults";
SWWM_ARESET = "Wipe Achievements";
SWWM_NOINTERTIPS = "Hide Intermission Tips";
SWWM_DEMOSLAYER = "Demoslayer Mode";
SWWM_MMTITLE = "Minimap Settings";
SWWM_MM_ENABLE = "Show Minimap";
SWWM_MM_ROTATE = "Rotate Minimap";
@ -361,6 +362,7 @@ TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resets weapon tooltips so you can see them al
TOOLTIP_EVENT_SWWMRESETCVARS = "Resets all the mod's settings to their original values.";
TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Erases all your archievement progress.";
TOOLTIP_SWWM_NOINTERTIPS = "Hides intermission tips, in case you don't want to see them.";
TOOLTIP_SWWM_DEMOSLAYER = "If you're below 100 health, killed enemies will drop health orbs.";
TOOLTIP_SWWMMINIMAPMENU = "Configure the minimap.";
TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements.";
TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap under the score counter.";

View file

@ -204,6 +204,7 @@ SWWM_RESETTOOLTIPS = "Resetear Ayuda de Armas";
SWWM_CRESET = "Restaurar Predeterminado";
SWWM_ARESET = "Borrar Logros";
SWWM_NOINTERTIPS = "Ocultar Consejos de Intermisión";
SWWM_DEMOSLAYER = "Modo Demoslayer";
SWWM_MMTITLE = "Opciones de Minimapa";
SWWM_MM_ENABLE = "Mostrar Minimapa";
SWWM_MM_ROTATE = "Rotar Minimapa";
@ -360,6 +361,7 @@ TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resetea la ayuda de armas para que puedas vol
TOOLTIP_EVENT_SWWMRESETCVARS = "Resetea todas las opciones del mod a sus valores originales.";
TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Borra todo tu progreso de logros.";
TOOLTIP_SWWM_NOINTERTIPS = "Oculta los consejos de intermisión, por si no quieres verlos.";
TOOLTIP_SWWM_DEMOSLAYER = "Si tienes menos de 100 puntos de vida, los enemigos que mates soltarán orbes de salud.";
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="\chSWWM \czGZ\c- \cw1.1.31 r2 \cu(Fri 22 Oct 13:06:38 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.31 r2 \cu(2021-10-22 13:06:38)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.1.32 \cu(Fri 22 Oct 17:27:17 CEST 2021)\c-";
SWWM_SHORTVER="\cw1.1.32 \cu(2021-10-22 17:27:17)\c-";

View file

@ -159,6 +159,7 @@ OptionMenu "SWWMOptionMenu"
Option "$SWWM_OMNIBUST", "swwm_omnibust", "YesNo"
Option "$SWWM_SUPERFUEL", "swwm_superfuel", "YesNo"
Option "$SWWM_PARTYTIME", "swwm_partytime", "YesNo"
Option "$SWWM_DEMOSLAYER", "swwm_demoslayer", "YesNo"
Option "$SWWM_FUNTRAILS", "swwm_funtrails", "SWWMFunTrails"
TrapOption "$SWWM_ENGINE", "swwm_engine"
StaticText " "

View file

@ -186,7 +186,7 @@ extend Class SWWMHandler
}
int pnum = src.PlayerNumber();
// achievement stuff
if ( e.Thing.IsHostile(src) )
if ( e.Thing.IsHostile(src) && (e.Thing.bISMONSTER || e.Thing.player) )
{
if ( (e.Thing.bBOSS||e.Thing.FindInventory("BossMarker")) && ((e.DamageType == 'Dash') || (e.DamageType == 'Buttslam')) )
SWWMUtility.AchievementProgressInc('swwm_progress_bossdash',1,src.player);
@ -218,6 +218,18 @@ extend Class SWWMHandler
onehpspree[pnum]++;
SWWMUtility.AchievementProgress('swwm_progress_onehp',onehpspree[pnum],src.player);
}
// tasty treats
if ( swwm_demoslayer && (src.Health < 100) )
{
int amt = clamp(min(-e.Thing.Health,-e.Thing.GetGibHealth())/5,0,20);
for ( int i=0; i<amt; i++ )
{
let a = Actor.Spawn("HealthOrb",e.Thing.Vec3Offset(0,0,e.Thing.Height/2));
a.vel.z = FRandom[Junk](4,12);
double ang = FRandom[Junk](0,360);
a.vel.xy = (cos(ang),sin(ang))*FRandom[Junk](4,6);
}
}
}
// no credits unless it's a counted kill or marine (that isn't friendly) or another player in DM
if ( e.Thing.IsFriend(src) || (!e.Thing.default.bCountKill && !(e.Thing is 'ScriptedMarine') && !(deathmatch && e.Thing.player)) )

View file

@ -138,6 +138,7 @@ Class SWWMHealth : Inventory abstract
newdamage = newdamage-GetDefaultByType(giveme).Amount;
if ( newdamage < 0 ) Owner.GiveBody(-newdamage,GetDefaultByType(giveme).MaxAmount);
newdamage = max(0,newdamage);
if ( !morethanonce ) SWWMHandler.HealthFlash(Owner.PlayerNumber());
AutoUseExtra(morethanonce);
morethanonce = true;
Amount--;

View file

@ -1,5 +1,127 @@
// player effects
// drop from monsters when using "Demoslayer" fun option
// heals up to 100 HP when touched
Class HealthOrb : Actor
{
Default
{
RenderStyle "Add";
Radius 4;
Height 8;
Scale .5;
BounceFactor .75;
WallBounceFactor .75;
Gravity .5;
PROJECTILE;
+THRUACTORS;
-NOGRAVITY;
+NOTELEPORT;
+DONTSPLASH;
+BOUNCEONWALLS;
+BOUNCEONFLOORS;
+BOUNCEONCEILINGS;
+CANBOUNCEWATER;
+FORCEXYBILLBOARD;
}
override void Tick()
{
Vector3 oldp = pos;
Super.Tick();
if ( !isFrozen() )
{
let t = Spawn("HealthOrbTrail",pos);
t.scale *= abs(scale.x);
t.alpha *= alpha;
scale *= .995;
alpha = abs(scale.x)*2.;
if ( abs(scale.x) < .1 )
{
Destroy();
return;
}
}
int np = -1;
double mdist = 600.;
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || (players[i].Health < 0) || !players[i].mo || !CheckSight(players[i].mo,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
double dist = Distance3D(players[i].mo);
if ( dist > mdist ) continue;
mdist = dist;
np = i;
}
if ( np == -1 ) return;
let mo = players[np].mo;
if ( SWWMUtility.BoxIntersect(self,mo,pad:8) )
{
int flg = CHANF_OVERLAP|CHANF_MAYBE_LOCAL;
if ( mo.CheckLocalView() ) flg |= CHANF_NOPAUSE;
mo.A_StartSound("misc/health_pkup",CHAN_ITEM,flg);
int hp = int(ceil(abs(scale.x*10)));
mo.GiveBody(hp,100);
SWWMHandler.HealthFlash(np);
SWWMScoreObj.Spawn(hp,mo.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+mo.Height/2),ST_Health);
Destroy();
return;
}
if ( isFrozen() ) return;
Vector3 dirto = level.Vec3Diff(pos,mo.Vec3Offset(0,0,mo.Height/2));
double distto = dirto.length();
dirto /= distto;
vel += dirto*((600.-distto)/400.)**2.;
vel.z += .2;
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
SpriteOffset = (0,-4);
Scale.x *= RandomPick[Junk](-1,-1);
Scale.y *= RandomPick[Junk](-1,-1);
}
States
{
Spawn:
BLPF E -1 Bright;
Stop;
}
}
Class HealthOrbTrail : Actor
{
Default
{
RenderStyle "Add";
Radius .1;
Height 0.;
Scale .25;
Alpha .5;
+FORCEXYBILLBOARD;
+NOGRAVITY;
+NOBLOCKMAP;
+DONTSPLASH;
+NOTELEPORT;
+NOINTERACTION;
}
override void Tick()
{
if ( isFrozen() ) return;
alpha *= .9;
scale *= 1.05;
if ( alpha < .05 ) Destroy();
}
override void PostBeginPlay()
{
Super.PostBeginPlay();
SpriteOffset = (0,-4);
}
States
{
Spawn:
BLPS E -1 Bright;
Stop;
}
}
Class DashTrail : Actor
{
Default