diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 72e7e54c9..528515b1d 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -140,9 +140,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } break; - case DTILE_CRYSTALAMMO: - t->shade = int(BobVal(PlayClock << 4) * 16); - continue; case DTILE_GROWSPARK: t->picnum = DTILE_GROWSPARK + ((PlayClock >> 4) & 3); break; diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 4ef84e614..e9f283cc4 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -71,26 +71,8 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* switch (act->spr.picnum) { case DTILE_FIREFLY: - if (act->spr.picnum != DTILE_FIREFLY) - { - if (actj && isrespawncontroller(actj)) - act->spr.pal = actj->spr.pal; - if (act->spr.pal != 0) - { - act->clipdist = 20; - act->spr.scale = DVector2(0.625, 0.625); - } - else - { - act->spr.scale = DVector2(1.25, 1.25); - act->clipdist = 41; - } - } - else - { - act->spr.scale = DVector2(0.625, 0.625); - act->clipdist = 20; - } + act->spr.scale = DVector2(0.625, 0.625); + act->clipdist = 20; if (actj) act->spr.lotag = 0; @@ -287,88 +269,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* break; - case DTILE_FLAMETHROWERSPRITE: - case DTILE_FLAMETHROWERAMMO: // Twentieth Anniversary World Tour - if (!isWorldTour()) - break; - [[fallthrough]]; - - case DTILE_STEROIDS: - case DTILE_HEATSENSOR: - case DTILE_SHIELD: - case DTILE_AIRTANK: - case DTILE_TRIPBOMBSPRITE: - case DTILE_JETPACK: - case DTILE_HOLODUKE: - - case DTILE_FIRSTGUNSPRITE: - case DTILE_CHAINGUNSPRITE: - case DTILE_SHOTGUNSPRITE: - case DTILE_RPGSPRITE: - case DTILE_SHRINKERSPRITE: - case DTILE_FREEZESPRITE: - case DTILE_DEVISTATORSPRITE: - - case DTILE_SHOTGUNAMMO: - case DTILE_FREEZEAMMO: - case DTILE_HBOMBAMMO: - case DTILE_CRYSTALAMMO: - case DTILE_GROWAMMO: - case DTILE_DEVISTATORAMMO: - case DTILE_RPGAMMO: - case DTILE_BOOTS: - case DTILE_AMMO: - case DTILE_AMMOLOTS: - case DTILE_COLA: - case DTILE_FIRSTAID: - if (actj) - { - act->spr.lotag = 0; - act->spr.pos.Z -= 32; - act->vel.Z = -4; - ssp(act, CLIPMASK0); - if (krand() & 4) act->spr.cstat |= CSTAT_SPRITE_XFLIP; - } - else - { - act->SetOwner(act); - act->spr.cstat = 0; - } - - if ((ud.multimode < 2 && act->spr.pal != 0) || (act->spr.lotag > ud.player_skill)) - { - act->spr.scale = DVector2(0, 0); - ChangeActorStat(act, STAT_MISC); - break; - } - - act->spr.pal = 0; - [[fallthrough]]; - - case DTILE_ACCESSCARD: - - if (ud.multimode > 1 && ud.coop != 1 && act->spr.picnum == DTILE_ACCESSCARD) - { - act->spr.scale = DVector2(0, 0); - ChangeActorStat(act, STAT_MISC); - break; - } - else - { - if (act->spr.picnum == DTILE_AMMO) - act->spr.scale = DVector2(0.25, 0.25); - else act->spr.scale = DVector2(0.5, 0.5); - } - - act->spr.shade = -17; - - if (actj) ChangeActorStat(act, STAT_ACTOR); - else - { - ChangeActorStat(act, STAT_ZOMBIEACTOR); - makeitfall(act); - } - break; case DTILE_FLOORFLAME: act->spr.shade = -127; diff --git a/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses b/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses index e6c6cc685..81ac465a3 100644 --- a/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses @@ -12,4 +12,8 @@ spawnclasses 5310 = DukeBoss5 5311 = DukeBoss5Stayput + + 5134 = DukeFlamethrowerSprite + 5135 = DukeFlamethrowerAmmo + } diff --git a/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses b/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses index bd52a0f62..e2c47d9d5 100644 --- a/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses @@ -244,9 +244,40 @@ spawnclasses 2310 = DukeBurning2 1890 = DukeExplosion2 2219 = DukeExplosion2Bot + + 46 = DukeCrystalAmmo + 55 = DukeSteroids + 59 = DukeHeatSensor + 54 = DukeShield + 56 = DukeAirtank + 27 = DukeTripbombSprite + 57 = DukeJetpack + 1348 = DukeHoloDuke + 21 = DukeFirstgunSprite + 28 = DukeShotgunSprite + 22 = DukeChaingunSprite + 23 = DukeRPGSprite + 25 = DukeShrinkerSprite + 24 = DukeFreezeSprite + 29 = DukeDevastatorSprite + 49 = DukeShotgunammo + 37 = DukeFreezeammo + 47 = DukeHBombammo + 45 = DukeGrowammo + 42 = DukeDevastatorammo + 44 = DukeRPGammo + 40 = DukeAmmo + 61 = DukeBoots + 48 = DukeAmmoLots + 51 = DukeCola + 53 = DukeFirstAid + 60 = DukeAccessCard + 41 = DukeBatteryAmmo 52 = DukeSixpak 100 = DukeAtomicHealth + + 1656 = DukeShrinkerExplosion 661 = DukeWaterBubble 2329 = DukeSmallSmoke diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index a1e6d486a..1261078dd 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -110,6 +110,7 @@ version "4.10" #include "zscript/games/duke/actors/smallsmoke.zs" #include "zscript/games/duke/actors/steam.zs" +#include "zscript/games/duke/actors/dukeitems.zs" #include "zscript/games/duke/actors/batteryammo.zs" #include "zscript/games/duke/actors/sixpak.zs" #include "zscript/games/duke/actors/atomichealth.zs" diff --git a/wadsrc/static/zscript/games/duke/actors/atomichealth.zs b/wadsrc/static/zscript/games/duke/actors/atomichealth.zs index ae89ea1e9..4ea0f012b 100644 --- a/wadsrc/static/zscript/games/duke/actors/atomichealth.zs +++ b/wadsrc/static/zscript/games/duke/actors/atomichealth.zs @@ -1,4 +1,4 @@ -class DukeAtomicHealth : DukeActor +class DukeAtomicHealth : DukeItemBase { default { @@ -19,7 +19,7 @@ class DukeAtomicHealth : DukeActor } } -class RedneckGoogooCluster : DukeActor +class RedneckGoogooCluster : DukeItemBase { default { diff --git a/wadsrc/static/zscript/games/duke/actors/dukeitems.zs b/wadsrc/static/zscript/games/duke/actors/dukeitems.zs new file mode 100644 index 000000000..6cb58e83a --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/dukeitems.zs @@ -0,0 +1,263 @@ +class DukeItemBase : DukeActor +{ + override void Initialize() + { + commonItemSetup(); + } +} + + +class DukeCrystalAmmo : DukeItemBase +{ + default + { + pic "CRYSTALAMMO"; + } + + override bool animate(tspritetype t) + { + t.shade = int(Raze.BobVal(PlayClock << 4) * 16); + return false; + } +} + +class DukeFlamethrowerSprite : DukeItemBase +{ + default + { + pic "FLAMETHROWERSPRITE"; + } +} + +class DukeFlamethrowerAmmo : DukeItemBase +{ + default + { + pic "FLAMETHROWERAMMO"; + } +} + +class DukeSteroids : DukeItemBase +{ + default + { + pic "STEROIDS"; + } +} + +class DukeHeatSensor : DukeItemBase +{ + default + { + pic "HEATSENSOR"; + } +} + +class DukeShield : DukeItemBase +{ + default + { + pic "SHIELD"; + } +} + +class DukeAirtank : DukeItemBase +{ + default + { + pic "AIRTANK"; + } +} + +class DukeTripbombSprite : DukeItemBase +{ + default + { + pic "TRIPBOMBSPRITE"; + } +} + +class DukeJetpack : DukeItemBase +{ + default + { + pic "JETPACK"; + } +} + +class DukeHoloDuke : DukeItemBase +{ + default + { + pic "HOLODUKE"; + } +} + +class DukeFirstgunSprite : DukeItemBase +{ + default + { + pic "FIRSTGUNSPRITE"; + } +} + +class DukeShotgunSprite : DukeItemBase +{ + default + { + pic "SHOTGUNSPRITE"; + } +} +class DukeChaingunSprite : DukeItemBase +{ + default + { + pic "CHAINGUNSPRITE"; + } +} +class DukeRPGSprite : DukeItemBase +{ + default + { + pic "RPGSPRITE"; + } +} +class DukeShrinkerSprite : DukeItemBase +{ + default + { + pic "SHRINKERSPRITE"; + } +} +class DukeFreezeSprite : DukeItemBase +{ + default + { + pic "FREEZESPRITE"; + } +} +class DukeDevastatorSprite : DukeItemBase +{ + default + { + pic "DEVISTATORSPRITE"; + } +} + +class DukeShotgunammo : DukeItemBase +{ + default + { + pic "SHOTGUNAMMO"; + } +} + +class DukeFreezeammo : DukeItemBase +{ + default + { + pic "FREEZEAMMO"; + } +} +class DukeHBombammo : DukeItemBase +{ + default + { + pic "HBOMBAMMO"; + } +} +class DukeGrowammo : DukeItemBase +{ + default + { + pic "GROWAMMO"; + } +} +class DukeDevastatorammo : DukeItemBase +{ + default + { + pic "DEVISTATORAMMO"; + } +} +class DukeRPGammo : DukeItemBase +{ + default + { + pic "RPGAMMO"; + } +} +class DukeAmmo : DukeItemBase +{ + default + { + pic "AMMO"; + } + + override void Initialize() + { + commonItemSetup((0.25, 0.25)); + } + +} + +class DukeBoots : DukeItemBase +{ + default + { + pic "BOOTS"; + } +} + +class DukeAmmoLots : DukeItemBase +{ + default + { + pic "AMMOLOTS"; + } +} + +class DukeCola : DukeItemBase +{ + default + { + pic "COLA"; + } +} + +class DukeFirstAid : DukeItemBase +{ + default + { + pic "FIRSTAID"; + } +} + +class DukeAccessCard : DukeItemBase +{ + default + { + pic "ACCESSCARD"; + } + + override void Initialize() + { + if (ud.multimode > 1 && ud.coop != 1) + { + self.scale = (0, 0); + self.ChangeStat(STAT_MISC); + return; + } + + self.Scale = (0.5, 0.5); + self.shade = -17; + + if (!self.mapSpawned) self.ChangeStat(STAT_ACTOR); + else + { + self.ChangeStat(STAT_ZOMBIEACTOR); + self.makeitfall(); + } + } +} + diff --git a/wadsrc/static/zscript/games/duke/actors/sixpak.zs b/wadsrc/static/zscript/games/duke/actors/sixpak.zs index a99067ad5..999ebbe90 100644 --- a/wadsrc/static/zscript/games/duke/actors/sixpak.zs +++ b/wadsrc/static/zscript/games/duke/actors/sixpak.zs @@ -1,17 +1,12 @@ -class DukeSixpak : DukeActor +class DukeSixpak : DukeItemBase { default { pic "SIXPAK"; } - - override void Initialize() - { - commonItemSetup(); - } } -class RedneckPorkRinds : DukeActor +class RedneckPorkRinds : DukeItemBase { default {