Ghost Artifact behavior overhaul.

This commit is contained in:
Mari the Deer 2021-03-25 15:06:59 +01:00
commit 36feddcf8f
4 changed files with 91 additions and 5 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r406 \cu(Thu 25 Mar 15:06:40 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r406 \cu(2021-03-25 15:06:40)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r407 \cu(Thu 25 Mar 15:06:59 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r407 \cu(2021-03-25 15:06:59)\c-";

View file

@ -118,7 +118,8 @@ extend Class SWWMHandler
enteredcombat = true;
}
}
if ( enteredcombat && (!highesttic || (gametic > highesttic+700)) )
// be smart, demo-chan, don't shout if you're invisible, or you'll make it worse
if ( enteredcombat && (!highesttic || (gametic > highesttic+700)) && !players[consoleplayer].mo.FindInventory("GhostPower") )
lastcombat = AddOneliner("fightstart",1,10);
}
@ -228,6 +229,8 @@ extend Class SWWMHandler
continue;
if ( a == players[consoleplayer].Camera )
continue;
if ( a is 'GhostTarget' )
continue;
if ( !a.player && !a.bSOLID && !a.bSHOOTABLE && !a.bISMONSTER && !a.bFRIENDLY && !(a is 'Inventory') && !(a is 'Chancebox') )
continue;
if ( !thesight && !(a.IsFriend(players[consoleplayer].mo) && !(a.player && (a.player.mo != a))) && !players[consoleplayer].Camera.CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) )
@ -270,6 +273,8 @@ extend Class SWWMHandler
continue;
if ( a == players[consoleplayer].Camera )
continue;
if ( a is 'GhostTarget' )
continue;
if ( !a.player && !a.bSOLID && !a.bSHOOTABLE && !a.bISMONSTER && !a.bFRIENDLY && !(a is 'Inventory') && !(a is 'Chancebox') )
continue;
if ( !thesight && !a.IsFriend(players[consoleplayer].mo) && !players[consoleplayer].Camera.CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) )

View file

@ -266,6 +266,56 @@ Class GhostSnd : Actor
}
}
Class GhostTarget : Actor
{
bool diedie;
Default
{
+SPECTRAL;
+NOGRAVITY;
+DONTSPLASH;
+SHOOTABLE;
+NONSHOOTABLE;
+NOTELEPORT;
+NODAMAGE;
+NOBLOOD;
+CANTSEEK;
+SHADOW; // so they can barely aim
Radius .1;
Height 56;
}
override void Tick()
{
if ( isFrozen() ) return;
if ( diedie ) A_FadeOut(.02);
let bt = BlockThingsIterator.Create(self,300);
while ( bt.Next() )
{
let t = bt.Thing;
if ( !t || !t.bIsMonster || t.player || !t.IsHostile(master) || (t.target != self) ) continue;
if ( SWWMUtility.BoxIntersect(self,t,pad:16) )
{
// they found out, there's no one here
diedie = true;
break;
}
}
// player made noise or is visible again
if ( !master || (LastHeard == master) || !master.FindInventory("GhostPower") )
{
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( hnd ) for ( int i=0; i<hnd.suckableactors.Size(); i++ )
{
let a = hnd.suckableactors[i];
if ( !a || !a.bISMONSTER || a.player || !a.IsHostile(master) || (a.Health <= 0) ) continue;
if ( a.target == self ) a.target = master;
}
Destroy();
}
}
}
Class GhostPower : PowerInvisibility
{
Actor snd;
@ -278,8 +328,10 @@ Class GhostPower : PowerInvisibility
Powerup.Mode "Translucent";
Powerup.Color "F0 E0 FF", 0.1;
+INVENTORY.ADDITIVETIME;
+CANTSEEK;
}
override void InitEffect()
{
Super.InitEffect();
@ -293,7 +345,6 @@ Class GhostPower : PowerInvisibility
{
Super.EndEffect();
if ( !Owner ) return;
Owner.bNOTARGET = false;
Owner.A_StartSound("powerup/ghostend",CHAN_ITEMEXTRA);
SWWMHandler.DoFlash(Owner,Color(96,224,192,255),20);
if ( Owner is 'Demolitionist' )
@ -305,7 +356,25 @@ Class GhostPower : PowerInvisibility
{
Super.DoEffect();
if ( !Owner ) return;
Owner.bNOTARGET = true;
// are any enemies targetting us? if so, make them focus on a fake target located where we currently are standing
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
Actor gt = null;
if ( hnd ) for ( int i=0; i<hnd.suckableactors.Size(); i++ )
{
let a = hnd.suckableactors[i];
if ( !a || !a.bISMONSTER || a.player || !a.IsHostile(Owner) || (a.Health <= 0) ) continue;
// make them forget the ghost if we make noise
if ( (a.LastHeard == Owner) && (a.target is 'GhostTarget') && (a.target.master == Owner) )
{
a.target = Owner;
continue;
}
if ( a.target != Owner ) continue;
if ( !gt ) gt = Spawn("GhostTarget",Owner.pos);
a.target = gt;
a.LastHeard = gt;
gt.master = Owner;
}
if ( !snd ) snd = Spawn("GhostSnd",Owner.pos);
snd.target = Owner;
snd.master = self;

View file

@ -911,7 +911,10 @@ Class Demolitionist : PlayerPawn
bumppitch.Push(newp-pitch);
A_SetPitch(newp,SPF_INTERPOLATE);
if ( lastvelz < -10 )
{
A_StartSound("demolitionist/runstop",CHAN_FOOTSTEP,CHANF_OVERLAP);
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:200);
}
if ( (lastvelz < -gruntspeed) && (swwm_mutevoice < 4) && (health > 0) )
A_StartSound(String.Format("voice/%s/grunt",myvoice.GetString()),CHAN_DEMOVOICE,CHANF_OVERLAP);
if ( lastvelz < -1 )
@ -1785,6 +1788,7 @@ Class Demolitionist : PlayerPawn
if ( walljump || wallclimb )
{
A_StartSound("demolitionist/kick",CHAN_FOOTSTEP,CHANF_OVERLAP);
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:100);
last_kick = level.maptime+1;
SWWMUtility.AchievementProgressInc('swwm_progress_jump',1,player);
}
@ -1792,7 +1796,10 @@ Class Demolitionist : PlayerPawn
bOnMobj = false;
player.jumpTics = -1;
if ( !(player.cheats&CF_PREDICTING) )
{
A_StartSound("demolitionist/runstart",CHAN_FOOTSTEP,CHANF_OVERLAP);
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:100);
}
if ( (dashfuel > 10.) && !player.onground && !walljump && !wallclimb )
{
dashboost = 3.;
@ -2241,6 +2248,7 @@ Class Demolitionist : PlayerPawn
if ( !myvoice ) myvoice = CVar.GetCVar('swwm_voicetype',player);
if ( lastdamage > 90 )
{
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:1200);
A_QuakeEx(3,3,3,9,0,8,"",QF_RELATIVE|QF_SCALEDOWN);
A_StartSound("demolitionist/hipain",CHAN_VOICE);
lastbump *= 1.04;
@ -2250,6 +2258,7 @@ Class Demolitionist : PlayerPawn
}
else if ( lastdamage > 30 )
{
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:600);
A_QuakeEx(2,2,2,6,0,8,"",QF_RELATIVE|QF_SCALEDOWN);
A_StartSound("demolitionist/pain",CHAN_VOICE);
lastbump *= 1.02;
@ -2259,6 +2268,7 @@ Class Demolitionist : PlayerPawn
}
else if ( lastdamage > 0 )
{
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:200);
A_QuakeEx(1,1,1,3,0,8,"",QF_RELATIVE|QF_SCALEDOWN);
A_StartSound("demolitionist/lopain",CHAN_VOICE);
lastbump *= 1.01;
@ -2394,6 +2404,7 @@ Class Demolitionist : PlayerPawn
let b = Spawn("InvisibleSplasher",level.Vec3Offset(pos,(RotateVector((0,yofs*.25*radius),angle),0)));
b.A_CheckTerrain();
vel.xy += (RotateVector(NormalizedMove(),angle)/3600.)*TweakSpeed();
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:(200*vol));
}
else
{
@ -2401,6 +2412,7 @@ Class Demolitionist : PlayerPawn
let b = Spawn("InvisibleSplasher",level.Vec3Offset(pos,(RotateVector((0,yofs*.25*radius),angle),0)));
b.A_CheckTerrain();
vel.xy += (RotateVector(NormalizedMove(),angle)/4800.)*TweakSpeed();
if ( swwm_extraalert ) A_AlertMonsters(swwm_uncapalert?0:(100*vol));
}
}
override bool Used( Actor user )