raze/wadsrc/static/zscript/games/duke/actors/redneckweapons/boatcannon.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

52 lines
968 B
Text

//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
class RedneckBoatGrenade : RedneckDynamiteArrow // RRRA only
{
default
{
pic "BOATGRENADE";
-DOUBLEDMGTHRUST;
-ALWAYSROTATE2;
-DOUBLEHITDAMAGE;
DukeProjectile.SpawnSound "MORTAR";
}
override void Initialize(DukeActor spawner)
{
self.extra = 10;
self.vel.Z = -10;
self.vel.X *= 2;
super.Initialize(spawner);
}
override bool premoveeffect()
{
if (self.extra)
{
self.vel.Z = -(self.extra * 250/256.); // 250 looks like a typo...
self.extra--;
}
else
self.makeitfall();
return Super.premoveeffect();
}
override void posthiteffect(CollisionData coll)
{
self.rpgexplode(coll.type, oldpos, false, 160, "RPG_EXPLODE");
self.Destroy();
}
override class<DukeActor> GetRadiusDamageType(int targhealth)
{
return 'DukeRadiusExplosion';
}
}