raze/wadsrc/static/zscript/games/duke/actors/powderkeg.zs
Christoph Oelckers 0db441accb - scriptified the native parts of the powder keg.
This was the last remaining actor with its own native ticking part.
2023-01-28 16:31:46 +01:00

34 lines
594 B
Text

class RedneckPowderKeg : DukeActor
{
default
{
pic "POWDERKEG";
}
override void Tick()
{
let sectp = self.sector;
if (sectp.lotag != ST_1_ABOVE_WATER && sectp.lotag != ST_160_FLOOR_TELEPORT)
if (self.vel.X != 0)
{
movesprite((self.Angle.ToVector()* self.vel.X, self.vel.Z), CLIPMASK0);
self.vel.X -= 1. / 16.;
}
Super.Tick();
}
override bool shootthis(DukeActor actor, DukePlayer p, Vector3 spos, double sang)
{
let j = actor.spawn("RedneckPowderKeg");
if (j)
{
j.vel.X = 2;
j.Angle = actor.Angle;
j.pos.Z -= 5;
}
return true;
}
}