2022-11-30 15:56:29 +00:00
|
|
|
class DukeLetter : DukeActor
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
|
|
|
pic "LETTER";
|
2022-12-16 11:47:30 +00:00
|
|
|
+NOFALLER;
|
2022-11-30 15:56:29 +00:00
|
|
|
}
|
|
|
|
|
2023-05-14 10:18:47 +00:00
|
|
|
override void Initialize(DukeActor spawner)
|
2022-11-30 15:56:29 +00:00
|
|
|
{
|
|
|
|
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
2022-12-19 09:21:20 +00:00
|
|
|
self.ChangeStat(STAT_ACTOR);
|
|
|
|
self.extra = 1;
|
2022-11-30 15:56:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class DukeDuck : DukeLetter // shooting gallery target
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
|
|
|
pic "DUCK";
|
|
|
|
}
|
|
|
|
override void Tick()
|
|
|
|
{
|
|
|
|
if (self.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
|
|
|
{
|
2022-12-22 08:49:42 +00:00
|
|
|
self.counter++;
|
|
|
|
if (self.counter > 60)
|
2022-11-30 15:56:29 +00:00
|
|
|
{
|
2022-12-22 08:49:42 +00:00
|
|
|
self.counter = 0;
|
2022-11-30 15:56:29 +00:00
|
|
|
self.cstat = CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_ALIGNMENT_WALL;
|
|
|
|
self.extra = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int j = self.ifhitbyweapon();
|
|
|
|
if (j >= 0)
|
|
|
|
{
|
|
|
|
self.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_YCENTER;
|
|
|
|
|
|
|
|
DukeStatIterator itr;
|
|
|
|
for(let act2 = itr.First(STAT_ACTOR); act2; act2 = itr.Next())
|
|
|
|
{
|
|
|
|
if (act2.lotag == self.lotag && act2.GetClass() == self.GetClass())
|
|
|
|
{
|
|
|
|
if ((act2.hitag && !(act2.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) ||
|
|
|
|
(!act2.hitag && (act2.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
|
|
|
|
)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// got the last one. Receive your reward!
|
|
|
|
dlevel.operateactivators(self.lotag, nullptr);
|
|
|
|
self.operateforcefields(self.lotag);
|
|
|
|
dlevel.operatemasterswitches(self.lotag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class DukeTarget : DukeDuck
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
|
|
|
pic "TARGET";
|
|
|
|
}
|
|
|
|
}
|