- scriptified the two final special stat items from RRRA.

This commit is contained in:
Christoph Oelckers 2022-12-02 18:04:41 +01:00
parent 7cbc713b4e
commit 066c4c88b2
10 changed files with 96 additions and 67 deletions

View file

@ -1092,38 +1092,6 @@ static void rrra_specialstats()
{
CallTick(act);
}
it.Reset(116);
while (auto act = it.Next())
{
if (act->spr.extra)
{
if (act->spr.extra == act->spr.lotag)
S_PlaySound(183);
act->spr.extra--;
int j = movesprite_ex(act, DVector3(act->spr.Angles.Yaw.ToVector() * act->spr.hitag / 16., act->spr.hitag / 128.), CLIPMASK0, coll);
if (j > 0)
{
S_PlayActorSound(PIPEBOMB_EXPLODE, act);
act->Destroy();
}
if (act->spr.extra == 0)
{
S_PlaySound(215);
act->Destroy();
ud.earthquaketime = 32;
SetPlayerPal(&ps[myconnectindex], PalEntry(32, 32, 32, 48));
}
}
}
it.Reset(123);
while (auto act = it.Next())
{
if (act->spr.lotag == 5)
if (!S_CheckSoundPlaying(330))
S_PlayActorSound(330, act);
}
}
//---------------------------------------------------------------------------

View file

@ -79,8 +79,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
case RRTILE1947:
case RRTILE2859:
case RRTILE3774:
case RRTILE5088:
case RRTILE8094:
case RRTILE8096:
if (isRRRA()) continue;

View file

@ -1160,8 +1160,8 @@ y(RRTILE5083, 5083)
y(RRTILE5084, 5084)
y(RRTILE5085, 5085)
y(RRTILE5086, 5086)
y(RRTILE5087, 5087)
y(RRTILE5088, 5088)
y(PIANOBUST, 5087)
y(PIANOKEYSBUST, 5088)
y(SHITBURN1, 5090)
y(SHITBURN2, 5091)
y(SHITBURN3, 5092)
@ -1294,9 +1294,9 @@ y(RRTILE8060, 8060)
y(RRTILE8063, 8063)
y(RRTILE8067, 8067)
y(RRTILE8076, 8076)
y(RRTILE8094, 8094)
y(PIANOKEYS, 8094)
y(RRTILE8096, 8096)
y(RRTILE8099, 8099)
y(PIANO, 8099)
y(RRTILE8106, 8106)
y(GAMBLINGMACHINE2, 8162)
y(GAMBLINGMACHINE3, 8163)
@ -1340,7 +1340,7 @@ y(RRTILE8398, 8398)
y(RRTILE8399, 8399)
y(RRTILE8423, 8423)
y(RRTILE8448, 8448)
y(RRTILE8450, 8450)
y(AIRPLANE, 8450)
x(BOATAMMO, 8460)
y(RRTILE8461, 8461)
y(RRTILE8462, 8462)

View file

@ -1414,20 +1414,6 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
}
}
break;
case RRTILE8099:
if (targ->spr.lotag == 5)
{
targ->spr.lotag = 0;
targ->spr.picnum = RRTILE5087;
S_PlayActorSound(340, targ);
DukeSpriteIterator it;
while (auto act = it.Next())
{
if (act->spr.picnum == RRTILE8094)
act->spr.picnum = RRTILE5088;
}
}
break;
}
switch (targ->spr.picnum)

View file

@ -56,13 +56,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
default_case:
spawninitdefault(actj, act);
break;
case RRTILE8450:
if (!isRRRA()) goto default_case;
act->spr.scale = DVector2(1, 1);
act->spr.extra = act->spr.lotag;
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
ChangeActorStat(act, 116);
break;
case RRTILE7936:
if (!isRRRA()) goto default_case;
act->spr.scale = DVector2(0, 0);
@ -78,12 +71,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.lotag = 1;
act->clipdist = 0;
break;
case RRTILE8099:
if (!isRRRA()) goto default_case;
act->spr.lotag = 5;
act->clipdist = 0;
ChangeActorStat(act, 123);
break;
case RRTILE8704:
if (!isRRRA()) goto default_case;
act->spr.lotag = 1;

View file

@ -45,6 +45,9 @@ spawnclasses
1781 = RedneckChickenArrow
1790 = RedneckBoatGrenade
4956 = RedneckPigDisplay
8450 = RedneckAirplane
8099 = RedneckPiano
8094 = RedneckPianoKeys
7636 = DukeGenericDestructible, "OLDPHOTO0", "OLDPHOTO0BROKE", "VENT_BUST"
7638 = DukeGenericDestructible, "OLDPHOTO1", "OLDPHOTO1BROKE", "VENT_BUST"

View file

@ -12,7 +12,7 @@ $conreserve LASERA 10
$conreserve SHRINKER 11
$conreserve CRAPFLOW 12
$conreserve DYNOCLMP 13
$conreserve DYNEW 14
$conreserve PIPEBOMB_EXPLODE 14
$conreserve CRAPSTIR 15
$conreserve BRICDOOR 16
$conreserve LASERTRIP_EXPLODE 17

View file

@ -110,6 +110,8 @@ version "4.10"
#include "zscript/games/duke/actors/balloons.zs"
#include "zscript/games/duke/actors/gamblingmachine.zs"
#include "zscript/games/duke/actors/pigback.zs"
#include "zscript/games/duke/actors/airplane.zs"
#include "zscript/games/duke/actors/piano.zs"
#include "zscript/games/blood/bloodgame.zs"
#include "zscript/games/blood/ui/menu.zs"

View file

@ -0,0 +1,39 @@
class RedneckAirplane : DukeActor
{
default
{
statnum STAT_ACTOR;
pic "AIRPLANE";
ScaleX 1;
ScaleY 1;
}
override void Initialize()
{
self.extra = self.lotag;
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
}
override void Tick()
{
if (self.extra)
{
if (self.extra == self.lotag)
Duke.PlaySound("PLANE");
self.extra--;
int j = self.movesprite((self.angle.ToVector() * self.hitag / 16., self.hitag / 128.), CLIPMASK0);
if (j > 0)
{
self.PlayActorSound("PIPEBOMB_EXPLODE");
self.Destroy();
}
if (self.extra == 0)
{
Duke.PlaySound("PLANEXP");
self.Destroy();
ud.earthquaketime = 32;
Duke.GetViewPlayer().pals = Color(32, 32, 32, 48);
}
}
}
}

View file

@ -0,0 +1,46 @@
class RedneckPiano : DukeActor
{
default
{
lotag 5;
clipdist 0;
statnum STAT_ACTOR;
spriteset "PIANO", "PIANOBUST";
}
override void Tick()
{
if (self.lotag == 5)
if (!Duke.CheckSoundPlaying("PIANO_P2"))
self.PlayActorSound("PIANO_P2");
}
override void onHit(DukeActor hitter)
{
if (self.lotag == 5)
{
self.lotag = 0;
self.setSpriteSetImage(1);
self.PlayActorSound("PIANO_P3");
DukeSpriteIterator it;
for (let act = it.First(); act; act = it.Next())
{
if (act is 'RedneckPianoKeys') act.setSpriteSetImage(1);
}
}
}
}
class RedneckPianoKeys : DukeActor
{
default
{
spriteset "PIANOKEYS", "PIANOKEYSBUST";
}
override bool Animate(tspritetype tspr)
{
tspr.shade = self.shade;
return true;
}
}