diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index 0ce84ee70c4..ed869e112ca 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -82,6 +82,8 @@ CVARD(Bool, cl_showmagamt, false, CVAR_ARCHIVE, "show the amount of rounds left CVARD(Bool, cl_nomeleeblur, false, CVAR_ARCHIVE, "enable/disable blur effect with melee weapons in SW") CVARD(Bool, cl_exhumedoldturn, false, CVAR_ARCHIVE, "enable/disable legacy turning speed for Powerslave/Exhumed") CVARD(Bool, cl_hudinterpolation, true, CVAR_ARCHIVE, "enable/disable HUD (weapon drawer) interpolation") +CVARD(Bool, cl_bloodvanillarun, true, CVAR_ARCHIVE, "enable/disable Blood's vanilla run mode") +CVARD(Bool, cl_bloodvanillabobbing, true, CVAR_ARCHIVE, "enable/disable Blood's vanilla bobbing while not using vanilla run mode") CUSTOM_CVARD(Int, cl_autoaim, 1, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable weapon autoaim") diff --git a/source/core/gamecvars.h b/source/core/gamecvars.h index 17de6a44ffa..2aa589599d3 100644 --- a/source/core/gamecvars.h +++ b/source/core/gamecvars.h @@ -27,6 +27,8 @@ EXTERN_CVAR(Bool, cl_showmagamt) EXTERN_CVAR(Bool, cl_nomeleeblur) EXTERN_CVAR(Bool, cl_exhumedoldturn) EXTERN_CVAR(Bool, cl_hudinterpolation) +EXTERN_CVAR(Bool, cl_bloodvanillarun) +EXTERN_CVAR(Bool, cl_bloodvanillabobbing) EXTERN_CVAR(Bool, demorec_seeds_cvar) EXTERN_CVAR(Bool, demoplay_diffs) diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index 11dc94a8fda..a39c9dc1cd2 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -303,7 +303,6 @@ static void cultThinkChase(DBloodActor* actor) actor->dudeSlope = DivScale(pTarget->z-pSprite->z, nDist, 10); switch (pSprite->type) { case kDudeCultistTommy: -#if 0 // apparently this can never be entered. if (nDist < 0x1e00 && nDist > 0xe00 && abs(nDeltaAngle) < 85 && !TargetNearExplosion(pTarget) && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) @@ -327,9 +326,7 @@ static void cultThinkChase(DBloodActor* actor) break; } } - else -#endif - if (nDist < 0x4600 && abs(nDeltaAngle) < 28) + else if (nDist < 0x4600 && abs(nDeltaAngle) < 28) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); switch (hit) @@ -375,7 +372,7 @@ static void cultThinkChase(DBloodActor* actor) break; case kDudeCultistShotgun: if (nDist < 0x2c00 && nDist > 0x1400 && !TargetNearExplosion(pTarget) - && (pTarget->flags&2) && gGameOptions.nDifficulty >= 2 && IsPlayerSprite(pTarget) /*&& !gPlayer[pTarget->type-kDudePlayer1].isRunning*/ + && (pTarget->flags&2) && gGameOptions.nDifficulty >= 2 && IsPlayerSprite(pTarget) && !gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); @@ -442,7 +439,6 @@ static void cultThinkChase(DBloodActor* actor) } break; case kDudeCultistTesla: -#if 0 if (nDist < 0x1e00 && nDist > 0xe00 && !TargetNearExplosion(pTarget) && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) @@ -466,9 +462,7 @@ static void cultThinkChase(DBloodActor* actor) break; } } - else -#endif - if (nDist < 0x3200 && abs(nDeltaAngle) < 28) + else if (nDist < 0x3200 && abs(nDeltaAngle) < 28) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); switch (hit) @@ -557,7 +551,6 @@ static void cultThinkChase(DBloodActor* actor) } break; case kDudeCultistBeast: -#if 0 if (nDist < 0x1e00 && nDist > 0xe00 && !TargetNearExplosion(pTarget) && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) @@ -581,9 +574,7 @@ static void cultThinkChase(DBloodActor* actor) break; } } - else -#endif - if (nDist < 0x3200 && abs(nDeltaAngle) < 28) + else if (nDist < 0x3200 && abs(nDeltaAngle) < 28) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); switch (hit) diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index e6bc0384190..df86d59eb46 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1317,14 +1317,14 @@ void ProcessInput(PLAYER *pPlayer) POSTURE *pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture]; InputPacket *pInput = &pPlayer->input; + // Originally, this was never able to be true due to sloppy input code in the original game. + // Allow it to become true behind a CVAR to offer an alternate playing experience if desired. + pPlayer->isRunning = !!(pInput->actions & SB_RUN) && !cl_bloodvanillarun; + if ((pInput->actions & SB_BUTTON_MASK) || pInput->fvel || pInput->svel || pInput->avel) pPlayer->restTime = 0; else if (pPlayer->restTime >= 0) pPlayer->restTime += 4; - - // This was just too broken. Every single place in the game depending on 'isRunning' will misbehave if this is set because originally it never worked as intended. - pPlayer->isRunning = false;// !!(pInput->actions& SB_RUN) && pPlayer->restTime <= 10; - WeaponProcess(pPlayer); if (pXSprite->health == 0) { @@ -1666,8 +1666,7 @@ void playerProcess(PLAYER *pPlayer) { if (pXSprite->height < 256) { - // taking a cue from BloodGDX here. Apparently due to poor coding in the original game this could never be true. - bool running = false;// pPlayer->isRunning; + bool running = pPlayer->isRunning && !cl_bloodvanillabobbing; pPlayer->bobAmp = (pPlayer->bobAmp+pPosture->pace[running]*4) & 2047; pPlayer->swayAmp = (pPlayer->swayAmp+(pPosture->pace[running]*4)/2) & 2047; if (running) diff --git a/wadsrc/static/zscript/games/blood/ui/sbar.zs b/wadsrc/static/zscript/games/blood/ui/sbar.zs index 3916ef6605a..15abea253be 100644 --- a/wadsrc/static/zscript/games/blood/ui/sbar.zs +++ b/wadsrc/static/zscript/games/blood/ui/sbar.zs @@ -547,8 +547,8 @@ class BloodStatusBar : RazeStatusBar else DrawImage(nTile, (x, y), DI_ITEM_RELCENTER, style:STYLE_Normal, col: 0xff606060, translation:Translation.MakeID(Translation_Remap, 5)); } - DrawImage("BlinkIcon", (118.5, 185.5), DI_ITEM_RELCENTER, col:0xff606060); - DrawImage("BlinkIcon", (201.5, 185.5), DI_ITEM_RELCENTER, col:0xff606060); + DrawImage("BlinkIcon", (118.5, 185.5), DI_ITEM_RELCENTER, col:Raze.shadeToLight(pPlayer.isRunning || cl_bloodvanillarun ? 16 : 40)); + DrawImage("BlinkIcon", (201.5, 185.5), DI_ITEM_RELCENTER, col:Raze.shadeToLight(pPlayer.isRunning || cl_bloodvanillarun ? 16 : 40)); if (pPlayer.throwPower) { TileHGauge("ThrowGauge", 124, 175.5, pPlayer.throwPower, 65536);