diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 64b2a58e4..b00a09975 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2638,7 +2638,7 @@ void handle_se25(DDukeActor* actor, int snd1, int snd2) if (sec->ceilingz > sec->floorz) { sec->setceilingz(sec->floorz); - if (pistonsound && snd1 >= 0) + if (ud.pistonsound && snd1 >= 0) S_PlayActorSound(snd1, actor); } } @@ -2648,7 +2648,7 @@ void handle_se25(DDukeActor* actor, int snd1, int snd2) if (sec->ceilingz < actor->temp_pos.Z) { sec->setceilingz(actor->temp_pos.Z); - if (pistonsound && snd2 >= 0) + if (ud.pistonsound && snd2 >= 0) S_PlayActorSound(snd2, actor); } } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 62562200c..b4363fd55 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1612,7 +1612,7 @@ void destroyit(DDukeActor *actor) DukeSectIterator it1(actor->sector()); while (auto a2 = it1.Next()) { - if (a2->spr.picnum == RTILE_RRTILE63) + if (a2->spr.picnum == RTILE_DESTROYTAGS) { lotag = a2->spr.lotag; spr = a2; @@ -1691,7 +1691,7 @@ void destroyit(DDukeActor *actor) switch (a2->spr.picnum) { case RTILE_DESTRUCTO: - case RTILE_RRTILE63: + case RTILE_DESTROYTAGS: case RTILE_TORNADO: case RTILE_APLAYER: case RTILE_COOT: diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index ea8b69d9d..5e3615a35 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -243,36 +243,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi drawshadows(tsprites, t, h); } - - switch (h->spr.picnum) - { - case RTILE_CRYSTALAMMO: - t->shade = int(BobVal(PlayClock << 4) * 16); - break; - - case RTILE_SBMOVE: - if (!isRRRA()) - t->shade = -127; - break; - - case RTILE_EXPLOSION3: - t->shade = -127; - break; - case RTILE_UFOBEAM: - case RTILE_RRTILE3586: - case RTILE_LADDER: - t->cstat |= CSTAT_SPRITE_INVISIBLE; - h->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - break; - case RTILE_DESTRUCTO: - t->cstat |= CSTAT_SPRITE_INVISIBLE; - break; - - case RTILE_LETSBOWL: - t->picnum = RTILE_LETSBOWL + ((PlayClock >> 2) & 1); - break; - } - h->dispicnum = t->picnum; if (t->sectp->floortexture == mirrortex) t->scale = DVector2(0, 0); diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index 13e709626..c8902bf94 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -192,7 +192,6 @@ void initactorflags_r() RTILE_FORCESPHERE, RTILE_BURNING, RTILE_ATOMICHEALTH, - RTILE_CRYSTALAMMO, RTILE_SHITBALL, RTILE_RPG, RTILE_RECON, diff --git a/source/games/duke/src/global.cpp b/source/games/duke/src/global.cpp index 8d7762703..1e25470b6 100644 --- a/source/games/duke/src/global.cpp +++ b/source/games/duke/src/global.cpp @@ -67,7 +67,7 @@ int lastlevel; // Set at the end of RRRA's E2L7. short fakebubba_spawn, mamaspawn_count, banjosound; // RRRA special effects int WindTime; DAngle WindDir; -uint8_t enemysizecheat /*raat607*/, pistonsound, chickenphase /* raat605*/, RRRA_ExitedLevel, fogactive; +uint8_t enemysizecheat /*raat607*/, chickenphase /* raat605*/, RRRA_ExitedLevel; //------------------------------------------------------------------------- // diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index 2a9d75c49..5a0d9c992 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -128,7 +128,7 @@ extern TArray mspos; extern int WindTime; extern DAngle WindDir; extern short fakebubba_spawn, mamaspawn_count, banjosound; -extern uint8_t enemysizecheat /*raat607*/, pistonsound, chickenphase /* raat605*/, RRRA_ExitedLevel, fogactive; +extern uint8_t enemysizecheat /*raat607*/, chickenphase /* raat605*/, RRRA_ExitedLevel; extern player_orig po[MAXPLAYERS]; extern int32_t g_cdTrack; diff --git a/source/games/duke/src/namelist_r.h b/source/games/duke/src/namelist_r.h index ed852168f..afac2cb7a 100644 --- a/source/games/duke/src/namelist_r.h +++ b/source/games/duke/src/namelist_r.h @@ -30,8 +30,6 @@ x(BATTERYAMMO, 41) x(DEVISTATORAMMO, 42) x(SAWAMMO, 43) x(RPGAMMO, 44) -x(GROWAMMO, 45) -x(CRYSTALAMMO, 46) x(HBOMBAMMO, 47) x(AMMOLOTS, 48) x(SHOTGUNAMMO, 49) @@ -46,7 +44,7 @@ x(HEATSENSOR, 59) x(ACCESSCARD, 60) x(BOOTS, 61) x(GUTMETER, 62) -y(RRTILE63, 63) +y(DESTROYTAGS, 63) y(RRMINECART, 64) y(RRMINECARTSOUND, 65) y(RRMINECARTINNER, 66) @@ -675,6 +673,7 @@ x(BOWLINGLANE2, 2026) x(BOWLINGLANE3, 2027) x(BOWLINGLANE4, 2028) y(LETSBOWL, 2034) +y(LETSBOWL1, 2035) y(RRTILE2050, 2050) y(RRTILE2052, 2052) y(RRTILE2053, 2053) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 2e11e4220..759154347 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -641,7 +641,7 @@ void prelevel_common(int g) auto p = &ps[screenpeek]; p->sea_sick_stat = 0; ud.ufospawnsminion = 0; - pistonsound = 0; + ud.pistonsound = 0; p->SlotWin = 0; enemysizecheat = 0; p->MamaEnd = 0; @@ -660,7 +660,7 @@ void prelevel_common(int g) mamaspawn_count = currentLevel->rr_mamaspawn; // RRRA E2L1 fog handling. - fogactive = 0; + ud.fogactive = 0; resetprestat(0, g); numclouds = 0; diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 21abee2b9..c9e759e58 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -227,14 +227,14 @@ void displayrooms(int snum, double interpfrac, bool sceneonly) return; // Do not light up the fog in RRRA's E2L1. Ideally this should apply to all foggy levels but all others use lookup table hacks for their fog. - if (isRRRA() && fogactive) + if (ud.fogactive) { p->visibility = ud.const_visibility; } g_visibility = ud.const_visibility; g_relvisibility = p->visibility - ud.const_visibility; - GlobalMapFog = fogactive ? 0x999999 : 0; - GlobalFogDensity = fogactive ? 350.f : 0.f; + GlobalMapFog = ud.fogactive ? 0x999999 : 0; + GlobalFogDensity = ud.fogactive ? 350.f : 0.f; DoInterpolations(interpfrac); @@ -341,7 +341,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly) //GLInterface.SetMapFog(false); RestoreInterpolations(); - if (!fogactive) + if (!ud.fogactive) { if (PlayClock < lastvisinc) { diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index 9ef61a84d..6f43e9b4b 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -430,10 +430,10 @@ void GameInterface::SerializeGameState(FSerializer& arc) ("mamaspawn_count", mamaspawn_count) ("banjosound", banjosound) ("enemysizecheat", enemysizecheat) - ("pistonsound", pistonsound) + ("pistonsound", ud.pistonsound) ("chickenphase", chickenphase) ("RRRA_ExitedLevel", RRRA_ExitedLevel) - ("fogactive", fogactive) + ("fogactive", ud.fogactive) ("thunder_brightness", thunder_brightness) .Array("po", po, ud.multimode) ("rrcdtrack", g_cdTrack) diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 18705966e..f63375b41 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -64,52 +64,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (!badguy(act) || commonEnemySetup(act, actj)) CallInitialize(act); break; - case RTILE_RRTILE7936: - if (!isRRRA()) goto default_case; - act->spr.scale = DVector2(0, 0); - fogactive = 1; - break; - case RTILE_RRTILE6144: - if (!isRRRA()) goto default_case; - act->spr.scale = DVector2(0, 0); - ps[screenpeek].sea_sick_stat = 1; - break; - case RTILE_RRTILE8193: - if (!isRRRA()) goto default_case; - act->spr.scale = DVector2(0, 0); - pistonsound = 1; - break; - - case RTILE_GRATE1: - act->clipdist = 8; - act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; - ChangeActorStat(act, 0); - break; - case RTILE_EXPLOSION3: - if (actj) - { - act->spr.Angles.Yaw = actj->spr.Angles.Yaw; - act->spr.shade = -64; - act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip(); - } - - else if (act->spr.picnum == RTILE_EXPLOSION3) - { - act->spr.scale = DVector2(2, 2); - act->spr.shade = -127; - act->spr.cstat |= CSTAT_SPRITE_YCENTER; - } - - if (actj) - { - double x = getflorzofslopeptr(act->sector(), act->spr.pos); - if (act->spr.pos.Z > x - 12) - act->spr.pos.Z = x - 12; - } - - ChangeActorStat(act, STAT_MISC); - - break; case RTILE_APLAYER: { @@ -124,6 +78,14 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* break; } + + /* animate + case RTILE_SBMOVE: + if (!isRRRA()) + t->shade = -127; + break; + + */ // this is not really nice... case RTILE_BIKERB: case RTILE_BIKERBV2: @@ -355,8 +317,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case RTILE_SHOTGUNAMMO: case RTILE_FREEZEAMMO: case RTILE_HBOMBAMMO: - case RTILE_CRYSTALAMMO: - case RTILE_GROWAMMO: case RTILE_DEVISTATORAMMO: case RTILE_RPGAMMO: case RTILE_BOOTS: @@ -366,6 +326,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case RTILE_FIRSTAID: case RTILE_SAWAMMO: + if (actj) { act->spr.lotag = 0; @@ -485,16 +446,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* } act->spr.shade = act->sector()->floorshade; break; - case RTILE_CEILINGSTEAM: - ChangeActorStat(act, STAT_STANDABLE); - break; - - case RTILE_RRTILE63: - act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE); - act->clipdist = 0.25; - ChangeActorStat(act, 100); - break; } return act; } diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 57d605f0e..25d3b1a68 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -157,6 +157,7 @@ struct user_defs uint8_t clipping; uint8_t user_pals[MAXPLAYERS]; uint8_t ufospawnsminion; + uint8_t pistonsound, fogactive; short from_bonus; short last_level, secretlevel; diff --git a/source/games/duke/src/vmexports.cpp b/source/games/duke/src/vmexports.cpp index 71d21ac4c..7173114ac 100644 --- a/source/games/duke/src/vmexports.cpp +++ b/source/games/duke/src/vmexports.cpp @@ -1478,6 +1478,8 @@ DEFINE_FIELD_X(DukeUserDefs, user_defs, monsters_off); DEFINE_FIELD_X(DukeUserDefs, user_defs, brightness); DEFINE_FIELD_X(DukeUserDefs, user_defs, ffire); DEFINE_FIELD_X(DukeUserDefs, user_defs, multimode); +DEFINE_FIELD_X(DukeUserDefs, user_defs, pistonsound); +DEFINE_FIELD_X(DukeUserDefs, user_defs, fogactive); DEFINE_FIELD_X(DukeUserDefs, user_defs, player_skill); DEFINE_FIELD_X(DukeUserDefs, user_defs, marker); DEFINE_FIELD_X(DukeUserDefs, user_defs, bomb_tag); diff --git a/wadsrc/static/filter/redneck.ridesagain/rmapinfo.spawnclasses b/wadsrc/static/filter/redneck.ridesagain/rmapinfo.spawnclasses index 5cfa94342..6a31d1a65 100644 --- a/wadsrc/static/filter/redneck.ridesagain/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/redneck.ridesagain/rmapinfo.spawnclasses @@ -1,5 +1,9 @@ spawnclasses { + 7936 = RedneckFogEnabler + 6144 = RedneckSeasickEnabler + 8193 = RedneckPistonSoundEnabler + 3464 = RedneckCheerBomb 2430 = RedneckCactusLargeYellow 2431 = RedneckCactusLargeGreen diff --git a/wadsrc/static/filter/redneck/rmapinfo.spawnclasses b/wadsrc/static/filter/redneck/rmapinfo.spawnclasses index 14827afaa..66543dfce 100644 --- a/wadsrc/static/filter/redneck/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/redneck/rmapinfo.spawnclasses @@ -16,6 +16,15 @@ spawnclasses 68 = DukeShadeCtrl 67 = DukeMinecartKiller 71 = DukeSoundFX + 252 = RedneckUfoBeam + 2586 = RedneckInvisible + 3587 = RedneckLadder + 36 = RedneckDestructo + 63 = RedneckDestroyTags + 7936 = RedneckFogEnabler + 6144 = RedneckSeasickEnabler + 8193 = RedneckPistonSoundEnabler + 64 = RedneckMinecartDef 65 = RedneckMinecartSound @@ -271,6 +280,8 @@ spawnclasses 3171 = DukeActor, "*RRTILE3171" 3216 = DukeActor, "*RRTILE3216" 3720 = DukeActor, "*RRTILE3720" + 2944 = DukeActor, "*PULSELAMP" + 2034 = RedneckLetsBowl // the following actors use CON @@ -280,6 +291,7 @@ spawnclasses 1494 = DukeBurning 1495 = RedneckFire 1441 = DukeExplosion2 + 1442 = RedneckExplosion3 41 = RedneckRifleAmmo 52 = RedneckPorkRinds 5595 = RedneckGoogooCluster @@ -292,6 +304,7 @@ spawnclasses 1391 = RedneckBlood 3998 = RedneckPlayerLyingDead 3860 = DukePlayerOnWater + 1332 = DukeCeilingSteam 4861 = RedneckHen diff --git a/wadsrc/static/zscript/games/duke/actors/controllers.zs b/wadsrc/static/zscript/games/duke/actors/controllers.zs index 2894968db..96e0fc5f9 100644 --- a/wadsrc/static/zscript/games/duke/actors/controllers.zs +++ b/wadsrc/static/zscript/games/duke/actors/controllers.zs @@ -195,3 +195,106 @@ class RedneckKeyinfoSetter : DukeActor { } +class RedneckUfoBeam : DukeActor +{ + default + { + pic "UFOBEAM"; + } + + override bool animate(tspritetype t) + { + t.cstat |= CSTAT_SPRITE_INVISIBLE; + self.cstat |= CSTAT_SPRITE_INVISIBLE; + return true; + } +} + +class RedneckInvisible : DukeActor +{ + default + { + pic "RRTILE3586"; + } + + override bool animate(tspritetype t) + { + t.cstat |= CSTAT_SPRITE_INVISIBLE; + self.cstat |= CSTAT_SPRITE_INVISIBLE; + return true; + } +} + +class RedneckLadder : DukeActor +{ + default + { + pic "Ladder"; + } + + override bool animate(tspritetype t) + { + t.cstat |= CSTAT_SPRITE_INVISIBLE; + self.cstat |= CSTAT_SPRITE_INVISIBLE; + return true; + } +} + +class RedneckDestructo : DukeActor +{ + default + { + pic "DESTRUCTO"; + statnum STAT_DESTRUCT; + } + + override bool animate(tspritetype t) + { + t.cstat |= CSTAT_SPRITE_INVISIBLE; + return true; + } +} + +class RedneckDestroyTags : DukeActor +{ + default + { + pic "DESTROYTAGS"; + } + override void Initialize() + { + self.cstat |= CSTAT_SPRITE_INVISIBLE; + self.scale = (REPEAT_SCALE, REPEAT_SCALE); + self.clipdist = 0.25; + self.ChangeStat(STAT_DESTRUCT); + } +} + +class RedneckPistonSoundEnabler : DukeActor +{ + override void StaticSetup() + { + ud.pistonsound = true; + self.Destroy(); + } +} + +class RedneckFogEnabler : DukeActor +{ + override void StaticSetup() + { + ud.fogactive = true; + self.Destroy(); + } +} + +class RedneckSeasickEnabler : DukeActor +{ + override void StaticSetup() + { + // this is so wrong... :( + Duke.GetViewPlayer().sea_sick_stat = true; + self.Destroy(); + } +} + diff --git a/wadsrc/static/zscript/games/duke/actors/explosion2.zs b/wadsrc/static/zscript/games/duke/actors/explosion2.zs index dc0886f57..5f33cc320 100644 --- a/wadsrc/static/zscript/games/duke/actors/explosion2.zs +++ b/wadsrc/static/zscript/games/duke/actors/explosion2.zs @@ -47,3 +47,21 @@ class DukeExplosion2Bot : DukeExplosion2 } } +class RedneckExplosion3 : DukeExplosion2 +{ + default + { + pic "EXPLOSION3"; + } + + override void Initialize() + { + self.scale = (2, 2); + } + + override bool animate(tspritetype t) + { + t.shade = -127; + return false; + } +} diff --git a/wadsrc/static/zscript/games/duke/actors/redneckmisc.zs b/wadsrc/static/zscript/games/duke/actors/redneckmisc.zs index 9c12a8982..264758fb4 100644 --- a/wadsrc/static/zscript/games/duke/actors/redneckmisc.zs +++ b/wadsrc/static/zscript/games/duke/actors/redneckmisc.zs @@ -108,3 +108,16 @@ class RedneckBellSwitch : DukeActor } } +class RedneckLetsBowl : DukeActor +{ + default + { + spriteset "LETSBOWL", "LETSBOWL1"; + } + + override bool animate(tspritetype t) + { + t.SetspritePic(self, (PlayClock >> 2) & 1); + return true; + } +} diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index 9a5e7a310..b77347ed6 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -477,7 +477,7 @@ struct DukeUserDefs native native readonly int player_skill, marker; native int earthquaketime, chickenplant; - native uint8 ufospawnsminion; + native uint8 ufospawnsminion, pistonsound, fogactive; native int16 bomb_tag; native DukeActor cameraactor; native bool joe9000;