- Blood: Restore originally intended isRunning code that never worked behind two CVARs to offer an alternative playing experience.

* `cl_bloodvanillarun` enables/disables the `isRunning` code that affects AI, bobbing and swaying.
* `cl_bloodvanillabobbing` enables/disables the `isRunning` code that affects bobbing and swaying, allowing only the `isRunning` AI changes.
This commit is contained in:
Mitchell Richters 2021-07-31 10:14:47 +10:00
parent 9884d5f396
commit f6c7ed3984
5 changed files with 15 additions and 21 deletions

View file

@ -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")

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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);