2022-11-27 19:25:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
class DukeRat : DukeActor
|
|
|
|
{
|
|
|
|
default
|
|
|
|
{
|
|
|
|
pic "RAT";
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Initialize()
|
|
|
|
{
|
2022-12-13 10:29:37 +00:00
|
|
|
if (!self.mapSpawned) self.lotag = 0;
|
2022-11-27 19:25:41 +00:00
|
|
|
|
|
|
|
if ((self.lotag > ud.player_skill) || ud.monsters_off == 1)
|
|
|
|
{
|
|
|
|
self.scale = (0, 0);
|
|
|
|
self.ChangeStat(STAT_MISC);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self.makeitfall();
|
|
|
|
self.angle = frandom(0, 360);
|
|
|
|
self.cstat = 0;
|
|
|
|
|
2022-12-13 10:29:37 +00:00
|
|
|
if (!self.mapSpawned && self.ownerActor)
|
2022-11-27 19:25:41 +00:00
|
|
|
{
|
|
|
|
self.timetosleep = 0;
|
|
|
|
self.ChangeStat(STAT_ACTOR);
|
|
|
|
if (Raze.isRR()) self.shade = self.ownerActor.shade;
|
|
|
|
}
|
|
|
|
else self.ChangeStat(STAT_ZOMBIEACTOR);
|
|
|
|
}
|
2022-12-19 09:21:20 +00:00
|
|
|
self. clipdist = 10;
|
|
|
|
self. scale = (0.75, 0.75);
|
2022-11-27 19:25:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override void Tick()
|
|
|
|
{
|
|
|
|
self.makeitfall();
|
|
|
|
if (self.DoMove(CLIPMASK0))
|
|
|
|
{
|
|
|
|
if (!Raze.isRRRA() && random(0, 255) == 0) self.PlayActorSound("RATTY");
|
|
|
|
self.angle += Raze.BAngToDegree * (random(-15, 15) + Raze.BobVal(self.temp_data[0] << 8) * 8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self.temp_data[0]++;
|
|
|
|
if (self.temp_data[0] > 1)
|
|
|
|
{
|
|
|
|
self.Destroy();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else self.angle = frandom(0, 360);
|
|
|
|
}
|
|
|
|
if (self.vel.X < 8)
|
|
|
|
self.vel.X += 1/8.;
|
|
|
|
self.angle += Raze.BAngToDegree * (random(0, 3) - 6);
|
|
|
|
}
|
|
|
|
}
|