raze/wadsrc/static/zscript/games/duke/actors/helicopt.zs
Christoph Oelckers 60af1b4c62 - renamed temp_data[0] to 'counter' and map temp_data[5] to the now free temp_data[0].
This not only matches its use in CON but seems to be used as a counter in most other places as well.
The main reason is to improve readability of CON to ZScript conversions.
2023-04-12 21:54:33 +02:00

46 lines
755 B
Text

class DukeCar : DukeActor
{
default
{
pic "DUKECAR";
}
override void Initialize()
{
self.extra = 1;
self.clipdist = 32;
self.vel.X = 292 / 16.;
self.vel.Z = 360 / 256.;
self.cstat = CSTAT_SPRITE_BLOCK_ALL;
self.ChangeStat(STAT_ACTOR);
}
override void Tick()
{
self.pos.Z += self.vel.Z;
self.counter++;
if (self.counter == 4) self.PlayActorSound("WAR_AMBIENCE2");
if (self.counter > (26 * 8))
{
Duke.PlaySound("RPG_EXPLODE");
for (int j = 0; j < 32; j++)
self.RANDOMSCRAP();
ud.earthquaketime = 16;
self.Destroy();
return;
}
else if ((self.counter & 3) == 0)
self.spawn("DukeExplosion2");
self.DoMove(CLIPMASK0);
}
}
class DukeHelicopter : DukeCar
{
default
{
pic "HELECOPT";
}
}