2022-12-01 12:58:18 +00:00
|
|
|
class DukeFrameEffect : DukeActor
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
2022-12-16 11:47:30 +00:00
|
|
|
Pic "FRAMEEFFECT1";
|
2022-12-01 12:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-05-14 10:18:47 +00:00
|
|
|
override void Initialize(DukeActor spawner)
|
2022-12-01 12:58:18 +00:00
|
|
|
{
|
2023-05-14 10:18:47 +00:00
|
|
|
if (spawner)
|
2022-12-01 12:58:18 +00:00
|
|
|
{
|
2023-05-14 10:18:47 +00:00
|
|
|
self.scale = spawner.scale;
|
2022-12-01 12:58:18 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self.Scale = (0, 0);
|
|
|
|
}
|
2022-12-19 09:21:20 +00:00
|
|
|
self.ChangeStat(STAT_MISC);
|
2022-12-01 12:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Tick()
|
|
|
|
{
|
|
|
|
let Owner = self.ownerActor;
|
|
|
|
if (Owner)
|
|
|
|
{
|
2022-12-22 08:49:42 +00:00
|
|
|
self.counter++;
|
2022-12-01 12:58:18 +00:00
|
|
|
|
2022-12-22 08:49:42 +00:00
|
|
|
if (self.counter > 7)
|
2022-12-01 12:58:18 +00:00
|
|
|
{
|
|
|
|
self.Destroy();
|
|
|
|
return;
|
|
|
|
}
|
2022-12-22 08:49:42 +00:00
|
|
|
else if (self.counter > 4) self.cstat |= CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
|
|
|
|
else if (self.counter > 2) self.cstat |= CSTAT_SPRITE_TRANSLUCENT;
|
2022-12-01 12:58:18 +00:00
|
|
|
self.xoffset = Owner.xoffset;
|
|
|
|
self.yoffset = Owner.yoffset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override bool animate(tspritetype t)
|
|
|
|
{
|
|
|
|
let OwnerAc = self.ownerActor;
|
2022-12-13 10:29:37 +00:00
|
|
|
if (OwnerAc)
|
2022-12-01 12:58:18 +00:00
|
|
|
{
|
|
|
|
if (OwnerAc.isPlayer())
|
|
|
|
if (ud.cameraactor == nullptr)
|
|
|
|
if (Duke.GetViewPlayer() == OwnerAc.GetPlayer() && display_mirror == 0)
|
|
|
|
{
|
|
|
|
t.ownerActor = nullptr;
|
|
|
|
t.scale = (0, 0);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if ((OwnerAc.cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
|
|
|
{
|
2023-01-01 17:22:08 +00:00
|
|
|
if (!OwnerAc.isPlayer() || !isRR()) t.SetSpritePic(OwnerAc, -1);
|
2022-12-01 12:58:18 +00:00
|
|
|
else t.SetSpritePic(OwnerAc, 0);
|
|
|
|
t.pal = OwnerAc.pal;
|
|
|
|
t.shade = OwnerAc.shade;
|
|
|
|
t.angle = OwnerAc.angle;
|
|
|
|
t.cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc.cstat;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|