Fix target of ynykron attack nulled on self-kill.

This commit is contained in:
Mari the Deer 2022-03-28 22:31:32 +02:00
commit bc149a854e
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,3 @@
[default]
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-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.2 r1 \cu(Mon 28 Mar 22:31:32 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.2.2 r1 \cu(2022-03-28 22:31:32)\c-";

View file

@ -73,10 +73,10 @@ Class PlayerGone : PlayerChunk
// no revive (for obvious reasons)
}
static void FeckOff( Actor p )
static Actor FeckOff( Actor p )
{
// doesn't affect voodoo dolls (convenient, isn't it?)
if ( !p.player || (p.player.mo != p) ) return;
if ( !p.player || (p.player.mo != p) ) return p;
let c = PlayerGone(Spawn("PlayerGone",(65535,65535,0)));
c.player = p.player;
c.Health = p.Health;
@ -94,6 +94,7 @@ Class PlayerGone : PlayerChunk
if ( playeringame[i] && (players[i].camera == p) )
players[i].camera = c;
}
return c;
}
States
@ -433,8 +434,11 @@ Class YnykronImpact : Actor
if ( tracer.player )
{
if ( tracer == target )
{
SWWMUtility.MarkAchievement("oopsie",tracer.player);
PlayerGone.FeckOff(tracer);
target = PlayerGone.FeckOff(tracer);
}
else PlayerGone.FeckOff(tracer);
}
if ( tracer.FindState("YnykronDeath",true) )
tracer.SetStateLabel("YnykronDeath"); // dedicated state
@ -2492,8 +2496,11 @@ Class YnykronSingularity : Actor
if ( a.player )
{
if ( a == target )
{
SWWMUtility.MarkAchievement("oopsie",a.player);
PlayerGone.FeckOff(a);
target = PlayerGone.FeckOff(a);
}
else PlayerGone.FeckOff(a);
}
if ( a.FindState("YnykronAltDeath",true) )
a.SetStateLabel("YnykronAltDeath"); // dedicated state