mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- scriptified the octabrain projectile.
This commit is contained in:
parent
6a83a72f71
commit
26d9511087
5 changed files with 81 additions and 31 deletions
|
@ -892,10 +892,6 @@ static bool weaponhitsector(DDukeActor* proj, const DVector3& oldpos, bool fireb
|
|||
|
||||
static void weaponcommon_d(DDukeActor* proj)
|
||||
{
|
||||
if (proj->spr.picnum == COOLEXPLOSION1)
|
||||
if (!S_CheckActorSoundPlaying(proj, WIERDSHOT_FLY))
|
||||
S_PlayActorSound(WIERDSHOT_FLY, proj);
|
||||
|
||||
double vel = proj->vel.X;
|
||||
double velz = proj->vel.Z;
|
||||
|
||||
|
@ -940,16 +936,6 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
|
||||
if (coll.type != 0)
|
||||
{
|
||||
if (proj->spr.picnum == COOLEXPLOSION1)
|
||||
{
|
||||
if (coll.type == kHitSprite && !coll.actor()->isPlayer())
|
||||
{
|
||||
return;
|
||||
}
|
||||
proj->vel.X = 0;
|
||||
proj->vel.Z = 0;
|
||||
}
|
||||
|
||||
bool fireball = (isWorldTour() && proj->spr.picnum == FIREBALL && (!proj->GetOwner() || proj->GetOwner()->spr.picnum != FIREBALL));
|
||||
|
||||
if (coll.type == kHitSprite)
|
||||
|
@ -1000,15 +986,6 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (proj->spr.picnum == COOLEXPLOSION1)
|
||||
{
|
||||
proj->spr.shade++;
|
||||
if (proj->spr.shade >= 40)
|
||||
{
|
||||
proj->Destroy();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -1038,9 +1015,6 @@ void moveweapons_d(void)
|
|||
case FIREBALL:
|
||||
// Twentieth Anniversary World Tour
|
||||
if (act->spr.picnum == FIREBALL && !isWorldTour()) break;
|
||||
[[fallthrough]];
|
||||
case SPIT:
|
||||
case COOLEXPLOSION1:
|
||||
weaponcommon_d(act);
|
||||
break;
|
||||
|
||||
|
|
|
@ -519,10 +519,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->pos.Z = t->sectp->floorz;
|
||||
t->shade = -127;
|
||||
break;
|
||||
case COOLEXPLOSION1:
|
||||
t->shade = -127;
|
||||
t->picnum += (h->spr.shade >> 1);
|
||||
break;
|
||||
case PLAYERONWATER:
|
||||
if (hw_models && modelManager.CheckModel(h->spr.picnum, h->spr.pal))
|
||||
{
|
||||
|
|
|
@ -442,7 +442,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
case BURNING2:
|
||||
case SMALLSMOKE:
|
||||
case SHRINKEREXPLOSION:
|
||||
case COOLEXPLOSION1:
|
||||
|
||||
if (actj)
|
||||
{
|
||||
|
|
|
@ -60,6 +60,7 @@ spawnclasses
|
|||
2605 = DukeRPG
|
||||
1641 = DukeFreezeBlast
|
||||
1636 = DukeSpit
|
||||
1360 = DukeCoolExplosion1
|
||||
|
||||
1272 = DukeTrash
|
||||
634 = DukeBolt1
|
||||
|
|
|
@ -503,3 +503,83 @@ class DukeSpit : DukeProjectile
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class DukeCoolExplosion1 : DukeProjectile // octabrain shot.
|
||||
{
|
||||
default
|
||||
{
|
||||
spriteset "COOLEXPLOSION1", "COOLEXPLOSION2", "COOLEXPLOSION3", "COOLEXPLOSION4", "COOLEXPLOSION5",
|
||||
"COOLEXPLOSION6", "COOLEXPLOSION7", "COOLEXPLOSION8", "COOLEXPLOSION9", "COOLEXPLOSION10",
|
||||
"COOLEXPLOSION11", "COOLEXPLOSION12", "COOLEXPLOSION13", "COOLEXPLOSION14", "COOLEXPLOSION15",
|
||||
"COOLEXPLOSION16", "COOLEXPLOSION17", "COOLEXPLOSION18", "COOLEXPLOSION19", "COOLEXPLOSION20";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.angle = self.ownerActor.angle;
|
||||
self.shade = -64;
|
||||
self.cstat = CSTAT_SPRITE_YCENTER | self.randomXFlip();
|
||||
|
||||
double c, f;
|
||||
[c, f] = self.sector.getSlopes(self.pos.XY);
|
||||
if (self.pos.Z > f - 12)
|
||||
self.pos.Z = f - 12;
|
||||
}
|
||||
|
||||
override bool premoveeffect()
|
||||
{
|
||||
if (!self.CheckSoundPlaying("WIERDSHOT_FLY"))
|
||||
self.PlayActorSound("WIERDSHOT_FLY");
|
||||
return false;
|
||||
}
|
||||
|
||||
override bool weaponhitsprite_pre(DukeActor targ)
|
||||
{
|
||||
if (!targ.isPlayer())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
self.vel.X = self.vel.Z = 0;
|
||||
return super.weaponhitsprite_pre(targ);
|
||||
}
|
||||
|
||||
override bool weaponhitwall(walltype wal)
|
||||
{
|
||||
self.vel.X = self.vel.Z = 0;
|
||||
return super.weaponhitwall(wal);
|
||||
}
|
||||
|
||||
override bool weaponhitsector()
|
||||
{
|
||||
self.vel.X = self.vel.Z = 0;
|
||||
return super.weaponhitsector();
|
||||
}
|
||||
|
||||
override void posthiteffect(CollisionData coll)
|
||||
{
|
||||
// don't destroy.
|
||||
}
|
||||
|
||||
override void Tick()
|
||||
{
|
||||
Super.Tick();
|
||||
if (++self.shade >= 40)
|
||||
{
|
||||
self.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
override bool animate(tspritetype tspr)
|
||||
{
|
||||
tspr.setSpritePic(self, clamp((self.shade >> 1), 0, 19));
|
||||
tspr.shade = -127;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue