raze/wadsrc/static/zscript/games/duke/actors/rrraenemies/rabbitspawner.zs
Christoph Oelckers 513de38723 - pass the spawner to Initialize as an explicit parameter.
Using ownerActor is not robust, for some actors this will have unwanted side effects.
2023-05-19 22:57:26 +02:00

39 lines
573 B
Text

class RedneckRabbitSpawner : DukeActor
{
override void Initialize(DukeActor spawner)
{
self.cstat = CSTAT_SPRITE_INVISIBLE;
self.extra = 0;
self.ChangeStat(STAT_FX);
}
override void Tick()
{
if (self.statnum == STAT_RABBITSPAWN)
{
if (self.hitag > 0)
{
if (self.extra == 0)
{
self.hitag--;
self.extra = 150;
self.spawn("RedneckRabbit");
}
else
self.extra--;
}
}
}
override void onRespawn(int low)
{
if (self.lotag == low)
{
if (!ud.monsters_off)
self.ChangeStat(STAT_RABBITSPAWN);
}
}
}