From 066c4c88b2bacddc9d1f2d357febe4f50ba928aa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 2 Dec 2022 18:04:41 +0100 Subject: [PATCH] - scriptified the two final special stat items from RRRA. --- source/games/duke/src/actors_r.cpp | 32 ------------- source/games/duke/src/animatesprites_r.cpp | 2 - source/games/duke/src/namelist_r.h | 10 ++-- source/games/duke/src/sectors_r.cpp | 14 ------ source/games/duke/src/spawn_r.cpp | 13 ------ .../redneck.ridesagain/engine/engine.def | 3 ++ wadsrc/static/filter/redneck/sndinfo.txt | 2 +- wadsrc/static/zscript.txt | 2 + .../zscript/games/duke/actors/airplane.zs | 39 ++++++++++++++++ .../static/zscript/games/duke/actors/piano.zs | 46 +++++++++++++++++++ 10 files changed, 96 insertions(+), 67 deletions(-) create mode 100644 wadsrc/static/zscript/games/duke/actors/airplane.zs create mode 100644 wadsrc/static/zscript/games/duke/actors/piano.zs diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 306c6d90b..8afa7af7d 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -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); - } } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index fbf39ab63..aca188ec0 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -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; diff --git a/source/games/duke/src/namelist_r.h b/source/games/duke/src/namelist_r.h index a288866fd..e65591b67 100644 --- a/source/games/duke/src/namelist_r.h +++ b/source/games/duke/src/namelist_r.h @@ -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) diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index a923f63f0..60f5f7367 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -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) diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index d02603a0c..03b52c4ce 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -56,13 +56,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* 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* 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; diff --git a/wadsrc/static/filter/redneck.ridesagain/engine/engine.def b/wadsrc/static/filter/redneck.ridesagain/engine/engine.def index 163bbafc2..0659ec95c 100644 --- a/wadsrc/static/filter/redneck.ridesagain/engine/engine.def +++ b/wadsrc/static/filter/redneck.ridesagain/engine/engine.def @@ -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" diff --git a/wadsrc/static/filter/redneck/sndinfo.txt b/wadsrc/static/filter/redneck/sndinfo.txt index 393389814..6fe7d9828 100644 --- a/wadsrc/static/filter/redneck/sndinfo.txt +++ b/wadsrc/static/filter/redneck/sndinfo.txt @@ -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 diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 1e80525f7..59812ab8c 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -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" diff --git a/wadsrc/static/zscript/games/duke/actors/airplane.zs b/wadsrc/static/zscript/games/duke/actors/airplane.zs new file mode 100644 index 000000000..6f3982dcc --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/airplane.zs @@ -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); + } + } + } +} diff --git a/wadsrc/static/zscript/games/duke/actors/piano.zs b/wadsrc/static/zscript/games/duke/actors/piano.zs new file mode 100644 index 000000000..5a6f333fb --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/piano.zs @@ -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; + } +}