- scriptified the shrink spark.

This commit is contained in:
Christoph Oelckers 2022-11-29 15:46:29 +01:00
parent a756b71647
commit c1545a1eaa
5 changed files with 34 additions and 13 deletions

View file

@ -1053,13 +1053,7 @@ static void weaponcommon_d(DDukeActor* proj)
// j is only needed for the hit type mask.
rpgexplode(proj, coll.type, oldpos, EXPLOSION2, EXPLOSION2BOT, -1, RPG_EXPLODE);
}
else if (proj->spr.picnum == SHRINKSPARK)
{
spawn(proj, SHRINKEREXPLOSION);
S_PlayActorSound(SHRINKER_HIT, proj);
fi.hitradius(proj, gs.shrinkerblastradius, 0, 0, 0, 0);
}
else if (proj->spr.picnum != COOLEXPLOSION1 && proj->spr.picnum != FREEZEBLAST && (!isWorldTour() || proj->spr.picnum != FIREBALL))
if (proj->spr.picnum != COOLEXPLOSION1 && proj->spr.picnum != FREEZEBLAST && (!isWorldTour() || proj->spr.picnum != FIREBALL))
{
auto spawned = spawn(proj, EXPLOSION2);
if (spawned)
@ -1147,7 +1141,6 @@ void moveweapons_d(void)
// Twentieth Anniversary World Tour
if (act->spr.picnum == FIREBALL && !isWorldTour()) break;
[[fallthrough]];
case SHRINKSPARK:
case RPG:
case SPIT:
case COOLEXPLOSION1:

View file

@ -221,9 +221,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
case CRYSTALAMMO:
t->shade = int(BobVal(PlayClock << 4) * 16);
continue;
case SHRINKSPARK:
t->picnum = SHRINKSPARK + ((PlayClock >> 4) & 3);
break;
case GROWSPARK:
t->picnum = GROWSPARK + ((PlayClock >> 4) & 3);
break;
@ -519,7 +516,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
case EXPLOSION2BOT:
case FREEZEBLAST:
case ATOMICHEALTH:
case SHRINKSPARK:
case GROWSPARK:
case CHAINGUN:
case SHRINKEREXPLOSION:

View file

@ -1029,7 +1029,7 @@ static void shootshrinker(DDukeActor* actor, int p, const DVector3& pos, DAngle
else zvel = 0;
auto spawned = CreateActor(actor->sector(),
pos.plusZ(2) + ang.ToVector() * 0.25, SHRINKSPARK, -16, DVector2(0.4375, 0.4375), ang, vel, zvel, actor, 4);
pos.plusZ(2) + ang.ToVector() * 0.25, PClass::FindActor("DukeShrinkSpark"), -16, DVector2(0.4375, 0.4375), ang, vel, zvel, actor, 4);
if (spawned)
{

View file

@ -56,6 +56,7 @@ spawnclasses
2298 = DukeBloodSplat3
2299 = DukeBloodSplat4
1625 = DukeFireLaser
1646 = DukeShrinkSpark
1272 = DukeTrash
634 = DukeBolt1

View file

@ -224,3 +224,34 @@ class DukeFirelaserTrail : DukeActor
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
class DukeShrinkSpark : DukeProjectile
{
default
{
spriteset "SHRINKSPARK", "SHRINKSPARK1", "SHRINKSPARK2", "SHRINKSPARK3";
}
override void posthiteffect(CollisionData coll)
{
self.spawn('DukeShrinkerExplosion');
self.PlayActorSound("SHRINKER_HIT");
self.hitradius(gs.shrinkerblastradius, 0, 0, 0, 0);
self.Destroy();
}
override bool animate(tspritetype tspr)
{
tspr.setSpritePic(self, (PlayClock >> 4) & 3);
tspr.shade = -127;
return true;
}
}