From 440fa3b70e8d83eef25f9cce91a361cd5afb88d0 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 03:21:41 +1000 Subject: [PATCH 01/12] GetClosestSpriteSectors - Fixed typo with nLength check --- source/games/blood/src/gameutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index b964b8a1b..c51e73e3b 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -884,7 +884,7 @@ int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, uint8_t *pSect const int nWallB = wall[nWallA].point2; int x1 = wall[nWallA].x, y1 = wall[nWallA].y; int x2 = wall[nWallB].x, y2 = wall[nWallB].y; - int nLength = approxDist(x1-x2, y1-x2); + int nLength = approxDist(x1-x2, y1-y2); const int nDist2 = (nDist+(nDist>>1))<<4; if (nLength > nDist2) // if span is greater than range * 1.5, test midsection { From db9a413f21bc586568ca8f199f515fb487c76f04 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 14:19:41 +1000 Subject: [PATCH 02/12] Added new cl_bloodvanillaenemies CVAR GetClosestSpriteSectors(): If newSectCheckMethod is set, then always test midpoints at least once Use new CVAR for tiny Caleb/burning cultists/Cerberus fixes Do not use new GetClosestSpriteSectors() fix for teslaHit() if vanilla explosions is set Do not use GetClosestSpriteSectors() fix for enemies sight scanning if vanilla enemies is set --- source/core/gamecvars.cpp | 3 ++- source/core/gamecvars.h | 1 + source/games/blood/src/actor.cpp | 6 +++--- source/games/blood/src/ai.cpp | 8 ++++---- source/games/blood/src/aibeast.cpp | 2 +- source/games/blood/src/gameutil.cpp | 29 +++++++++++++---------------- source/games/blood/src/weapon.cpp | 2 +- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index 6167d2716..2f0b65ccb 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -84,7 +84,8 @@ CVARD(Bool, cl_exhumedoldturn, false, CVAR_ARCHIVE, "enable/disable legacy turni 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") -CVARD(Bool, cl_bloodvanillaexplosions, false, CVAR_ARCHIVE, "enable/disable Blood's original explosion behavior") +CVARD(Bool, cl_bloodvanillaexplosions, false, CVAR_ARCHIVE, "enable/disable Blood's vanilla explosion behavior") +CVARD(Bool, cl_bloodvanillaenemies, false, CVAR_ARCHIVE, "enable/disable Blood's vanilla enemy behavior") CVARD(Bool, cl_bloodhudinterp, false, CVAR_ARCHIVE, "enable/disable Blood's HUD interpolation") CVARD(Bool, cl_bloodoldweapbalance, false, CVAR_ARCHIVE, "enable/disable legacy 1.0 weapon handling for Blood") diff --git a/source/core/gamecvars.h b/source/core/gamecvars.h index 9d6c93fe9..e0159630e 100644 --- a/source/core/gamecvars.h +++ b/source/core/gamecvars.h @@ -30,6 +30,7 @@ EXTERN_CVAR(Bool, cl_hudinterpolation) EXTERN_CVAR(Bool, cl_bloodvanillarun) EXTERN_CVAR(Bool, cl_bloodvanillabobbing) EXTERN_CVAR(Bool, cl_bloodvanillaexplosions) +EXTERN_CVAR(Bool, cl_bloodvanillaenemies) EXTERN_CVAR(Bool, cl_bloodhudinterp) EXTERN_CVAR(Bool, cl_bloodoldweapbalance) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index f9b298559..bc917da83 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -3092,7 +3092,7 @@ static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType) break; case kDudeTinyCaleb: - if (VanillaMode() || DemoRecordStatus()) + if (cl_bloodvanillaenemies || VanillaMode() || DemoRecordStatus()) break; if (damageType == kDamageBurn && pXSprite->medium == kMediumNormal) { @@ -5110,7 +5110,7 @@ void MoveDude(spritetype *pSprite) break; case kDudeBurningCultist: { - const bool fixRandomCultist = (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode() && !DemoRecordStatus(); // fix burning cultists randomly switching types underwater + const bool fixRandomCultist = !cl_bloodvanillaenemies && (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode() && !DemoRecordStatus(); // fix burning cultists randomly switching types underwater if (Chance(chance)) pSprite->type = kDudeCultistTommy; else @@ -6197,7 +6197,7 @@ void actProcessSprites(void) if (nXSprite > 0) { XSPRITE *pXSprite = &xsprite[nXSprite]; - const bool fixBurnGlitch = IsBurningDude(pSprite) && !VanillaMode() && !DemoRecordStatus(); // if enemies are burning, always apply burning damage per tick + const bool fixBurnGlitch = !cl_bloodvanillaenemies && IsBurningDude(pSprite) && !VanillaMode() && !DemoRecordStatus(); // if enemies are burning, always apply burning damage per tick if ((pXSprite->burnTime > 0) || fixBurnGlitch) { switch (pSprite->type) diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index f93c6d516..6349b64cb 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -177,7 +177,7 @@ bool CanMove(spritetype *pSprite, int a2, int nAngle, int nRange) // It makes ignore danger if enemy immune to N damageType. As result Cerberus start acting like // in Blood 1.0 so it can move normally to player. It's up to you for adding rest of enemies here as // i don't think it will broke something in game. - if (!VanillaMode() && Crusher && isImmune(pSprite, pXSector->damageType, 16)) return true; + if (!cl_bloodvanillaenemies && !VanillaMode() && Crusher && isImmune(pSprite, pXSector->damageType, 16)) return true; fallthrough__; case kDudeZombieButcher: case kDudeSpiderBrown: @@ -1033,7 +1033,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType DUDEEXTRA *pDudeExtra = &gDudeExtra[pSprite->extra]; pDudeExtra->recoil = 1; } - const bool fixRandomCultist = (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode() && !DemoRecordStatus(); // fix burning cultists randomly switching types underwater + const bool fixRandomCultist = !cl_bloodvanillaenemies && (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode() && !DemoRecordStatus(); // fix burning cultists randomly switching types underwater switch (pSprite->type) { case kDudeCultistTommy: @@ -1110,7 +1110,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType case kDudeTinyCaleb: if (nDmgType == kDamageBurn && pXSprite->health <= (unsigned int)pDudeInfo->fleeHealth/* && (pXSprite->at17_6 != 1 || pXSprite->at17_6 != 2)*/) { - if (!VanillaMode() && !DemoRecordStatus()) // fix burning sprite for tiny caleb + if (!cl_bloodvanillaenemies && !VanillaMode() && !DemoRecordStatus()) // fix burning sprite for tiny caleb { pSprite->type = kDudeBurningTinyCaleb; aiNewState(actor, &tinycalebBurnGoto); @@ -1480,7 +1480,7 @@ void aiLookForTarget(spritetype *pSprite, XSPRITE *pXSprite) if (pXSprite->state) { uint8_t sectmap[(kMaxSectors+7)>>3]; - const bool newSectCheckMethod = !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic GetClosestSpriteSectors(pSprite->sectnum, pSprite->x, pSprite->y, 400, sectmap, nullptr, newSectCheckMethod); int nSprite2; diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index af33c536f..5edf271f0 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -95,7 +95,7 @@ void StompSeqCallback(int, DBloodActor* actor1) int nSector = pSprite->sectnum; int v1c = 5+2*gGameOptions.nDifficulty; int v10 = 25+30*gGameOptions.nDifficulty; - const bool newSectCheckMethod = !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic GetClosestSpriteSectors(nSector, x, y, vc, sectmap, nullptr, newSectCheckMethod); char v4 = 0; int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index c51e73e3b..2840c85f8 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -886,23 +886,20 @@ int GetClosestSpriteSectors(int nSector, int x, int y, int nDist, uint8_t *pSect int x2 = wall[nWallB].x, y2 = wall[nWallB].y; int nLength = approxDist(x1-x2, y1-y2); const int nDist2 = (nDist+(nDist>>1))<<4; - if (nLength > nDist2) // if span is greater than range * 1.5, test midsection + nLength = ClipRange(nLength / nDist2, 1, 4); // never split more than 4 times + for (int k = 0; true; k++) // subdivide span into smaller chunks towards direction { - nLength = ClipRange(nLength / nDist2, 1, 4); // never split more than 4 times - for (int k = 0; k < nLength; k++) // subdivide span into smaller chunks towards direction - { - const int xcenter = (x1+x2)>>1, ycenter = (y1+y2)>>1; - withinRange = CheckProximityPoint(xcenter, ycenter, 0, x, y, 0, nDist); - if (withinRange) - break; - if ((k+1) == nLength) // reached end, no point in calculating direction/center again - break; - const bool bDir = approxDist(x-x1, y-y1) < approxDist(x-x2, y-y2); - if (bDir) // step closer and check again - x2 = xcenter, y2 = ycenter; - else - x1 = xcenter, y1 = ycenter; - } + const int xcenter = (x1+x2)>>1, ycenter = (y1+y2)>>1; + withinRange = CheckProximityPoint(xcenter, ycenter, 0, x, y, 0, nDist); + if (withinRange) + break; + if (k == (nLength-1)) // reached end + break; + const bool bDir = approxDist(x-x1, y-y1) < approxDist(x-x2, y-y2); + if (bDir) // step closer and check again + x2 = xcenter, y2 = ycenter; + else + x1 = xcenter, y1 = ycenter; } } if (withinRange) // if new sector is within range, set to current sector and test walls diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index b2898cba3..321a9c3d9 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -2625,7 +2625,7 @@ void teslaHit(spritetype *pMissile, int a2) int nDist = 300; int nSector = pMissile->sectnum; int nOwner = pMissile->owner; - const bool newSectCheckMethod = !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic GetClosestSpriteSectors(nSector, x, y, nDist, sectmap, nullptr, newSectCheckMethod); bool v4 = true; DBloodActor* actor = nullptr; From 9ba9acf39ec3c9c1592a4055c7acabca3755870e Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:02:58 +1000 Subject: [PATCH 03/12] Added cl_bloodvanillaenemies to menu --- wadsrc/static/menudef.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 396cfb04a..c444dd45b 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -956,6 +956,12 @@ OptionValue "ExplosBehavior" 1, "$OPTVAL_OLD" } +OptionValue "EnemyBehavior" +{ + 0, "$OPTVAL_DEFAULT" + 1, "$OPTVAL_OLD" +} + OptionMenu GameplayOptions protected { @@ -978,6 +984,7 @@ OptionMenu GameplayOptions protected { Option "$PLRMNU_EQUIP", "cl_weaponswitch", "WeapSwitch" Option "$EXPLOS_BEHAVIOR", "cl_bloodvanillaexplosions", "ExplosBehavior" + Option "$ENEMY_BEHAVIOR", "cl_bloodvanillaenemies", "EnemyBehavior" } ifgame(Exhumed) { From 0e0c4e692f83818da996ac4e73dc1826c705b966 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 20:38:31 +1000 Subject: [PATCH 04/12] Set thing/missile to use accurate clipmove --- source/games/blood/src/actor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index bc917da83..ae337b59c 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4646,11 +4646,15 @@ int MoveThing(spritetype *pSprite) assert(nSector >= 0 && nSector < kMaxSectors); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); + const int bakCompat = enginecompatibilitymode; if (xvel[nSprite] || yvel[nSprite]) { short bakCstat = pSprite->cstat; pSprite->cstat &= ~257; + if (!cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) + enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy v8 = gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, pSprite->clipdist<<2, (pSprite->z-top)/4, (bottom-pSprite->z)/4, CLIPMASK0); + enginecompatibility_mode = bakCompat; // restore pSprite->cstat = bakCstat; assert(nSector >= 0); if (pSprite->sectnum != nSector) @@ -5427,6 +5431,7 @@ int MoveMissile(spritetype *pSprite) int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); int i = 1; + const int bakCompat = enginecompatibilitymode; while (1) { int x = pSprite->x; @@ -5434,7 +5439,10 @@ int MoveMissile(spritetype *pSprite) int z = pSprite->z; int nSector2 = pSprite->sectnum; clipmoveboxtracenum = 1; + if (!cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) + enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy int vdx = ClipMove(&x, &y, &z, &nSector2, vx, vy, pSprite->clipdist<<2, (z-top)/4, (bottom-z)/4, CLIPMASK0); + enginecompatibility_mode = bakCompat; // restore clipmoveboxtracenum = 3; short nSector = nSector2; if (nSector2 < 0) From f0627fa6c24bb43093684ab5f8492c7e119c0095 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 20:44:13 +1000 Subject: [PATCH 05/12] enginecompatibilitymode -> enginecompatibility_mode --- source/games/blood/src/actor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index ae337b59c..adcd4688a 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4646,7 +4646,7 @@ int MoveThing(spritetype *pSprite) assert(nSector >= 0 && nSector < kMaxSectors); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); - const int bakCompat = enginecompatibilitymode; + const int bakCompat = enginecompatibility_mode; if (xvel[nSprite] || yvel[nSprite]) { short bakCstat = pSprite->cstat; @@ -5431,7 +5431,7 @@ int MoveMissile(spritetype *pSprite) int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); int i = 1; - const int bakCompat = enginecompatibilitymode; + const int bakCompat = enginecompatibility_mode; while (1) { int x = pSprite->x; From 6d4a3243b76cfabe48edc9bdb2af1827352cd3fc Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 22:18:52 +1000 Subject: [PATCH 06/12] Lower flame damage if using accurate clipmove The eduke clipmove will cause a higher hit %, lower all flame damage from 8->3 to compensate with overall higher sprite hit result --- source/games/blood/src/actor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index adcd4688a..c2e7f23d3 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4078,7 +4078,11 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) evPost(actorHit, 0, kCallbackFXFlameLick); actBurnSprite(missileOwner, actorHit, (4 + gGameOptions.nDifficulty) << 2); - actDamageSprite(missileOwner, actorHit, kDamageBurn, 8); + const bool reduceSprayDamage = !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus(); + int nDamage = 8; + if (reduceSprayDamage) // reduce flame damage if using improved clipmove mode (higher hit rate) + nDamage = 3; + actDamageSprite(missileOwner, actorHit, kDamageBurn, nDamage); } break; From 28d7f0de5824d4250824966596982affbb7ab474 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Thu, 19 Aug 2021 22:28:00 +1000 Subject: [PATCH 07/12] Do not use accurate clipmove for flame missiles Changes gameplay too much --- source/games/blood/src/actor.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index c2e7f23d3..09d43c4b9 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4078,11 +4078,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) evPost(actorHit, 0, kCallbackFXFlameLick); actBurnSprite(missileOwner, actorHit, (4 + gGameOptions.nDifficulty) << 2); - const bool reduceSprayDamage = !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus(); - int nDamage = 8; - if (reduceSprayDamage) // reduce flame damage if using improved clipmove mode (higher hit rate) - nDamage = 3; - actDamageSprite(missileOwner, actorHit, kDamageBurn, nDamage); + actDamageSprite(missileOwner, actorHit, kDamageBurn, 8); } break; @@ -4655,7 +4651,7 @@ int MoveThing(spritetype *pSprite) { short bakCstat = pSprite->cstat; pSprite->cstat &= ~257; - if (!cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) + if ((pSprite->owner >= 0) && !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy v8 = gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, pSprite->clipdist<<2, (pSprite->z-top)/4, (bottom-pSprite->z)/4, CLIPMASK0); enginecompatibility_mode = bakCompat; // restore @@ -5436,6 +5432,7 @@ int MoveMissile(spritetype *pSprite) GetSpriteExtents(pSprite, &top, &bottom); int i = 1; const int bakCompat = enginecompatibility_mode; + const bool isFlameSprite = (pSprite->type == kMissileFlameSpray || pSprite->type == kMissileFlameHound); // do not use accurate clipmove for flame based sprites (changes damage too much) while (1) { int x = pSprite->x; @@ -5443,7 +5440,7 @@ int MoveMissile(spritetype *pSprite) int z = pSprite->z; int nSector2 = pSprite->sectnum; clipmoveboxtracenum = 1; - if (!cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) + if ((pSprite->owner >= 0) && !isFlameSprite && !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy int vdx = ClipMove(&x, &y, &z, &nSector2, vx, vy, pSprite->clipdist<<2, (z-top)/4, (bottom-z)/4, CLIPMASK0); enginecompatibility_mode = bakCompat; // restore From cd53e4c9668a3753c454483c67a4db67d921a519 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Sat, 21 Aug 2021 12:43:24 +1000 Subject: [PATCH 08/12] Fix teleport triggers not updating player angle --- source/games/blood/src/triggers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 16d641df2..b8928144a 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1466,6 +1466,7 @@ void OperateTeleport(unsigned int nSector, XSECTOR *pXSector) { playerResetInertia(pPlayer); pPlayer->zViewVel = pPlayer->zWeaponVel = 0; + pPlayer->angle.settarget(pSprite->ang, true); } } } From 1f6181fa99cdf08021774e91170543cb9f9be8cd Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Sat, 21 Aug 2021 19:52:24 +1000 Subject: [PATCH 09/12] Renamed untitled spider functions --- source/games/blood/src/aispid.cpp | 29 +++++++++++++---------------- source/games/blood/src/aistate.h | 2 +- source/games/blood/src/loadsave.cpp | 2 +- source/games/blood/src/seq.cpp | 2 +- source/games/blood/src/seqcb.h | 4 ++-- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index 04ec9bca7..acd5c4edc 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -42,25 +42,22 @@ AISTATE spidGoto = { kAiStateMove, 7, -1, 600, NULL, aiMoveForward, spidThinkGot AISTATE spidSearch = { kAiStateSearch, 7, -1, 1800, NULL, aiMoveForward, spidThinkSearch, &spidIdle }; AISTATE spidBite = { kAiStateChase, 6, nSpidBiteClient, 60, NULL, NULL, NULL, &spidChase }; AISTATE spidJump = { kAiStateChase, 8, nSpidJumpClient, 60, NULL, aiMoveForward, NULL, &spidChase }; -AISTATE spid13A92C = { kAiStateOther, 0, dword_279B50, 60, NULL, NULL, NULL, &spidIdle }; +AISTATE spidBirth = { kAiStateOther, 0, nSpidBirthClient, 60, NULL, NULL, NULL, &spidIdle }; -static char sub_70D30(XSPRITE *pXDude, int a2, int a3) +static char SpidPoisonTarget(XSPRITE *pXDude, int nBlind, int max) { assert(pXDude != NULL); int nDude = pXDude->reference; spritetype *pDude = &sprite[nDude]; if (IsPlayerSprite(pDude)) { - a2 <<= 4; - a3 <<= 4; - if (IsPlayerSprite(pDude)) + nBlind <<= 4; + max <<= 4; + PLAYER *pPlayer = &gPlayer[pDude->type-kDudePlayer1]; + if (pPlayer->blindEffect < max) { - PLAYER *pPlayer = &gPlayer[pDude->type-kDudePlayer1]; - if (a3 > pPlayer->blindEffect) - { - pPlayer->blindEffect = ClipHigh(pPlayer->blindEffect+a2, a3); - return 1; - } + pPlayer->blindEffect = ClipHigh(pPlayer->blindEffect+nBlind, max); + return 1; } } return 0; @@ -93,11 +90,11 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) break; case kDudeSpiderRed: actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); - if (Chance(0x5000)) sub_70D30(pXTarget, 4, 16); + if (Chance(0x5000)) SpidPoisonTarget(pXTarget, 4, 16); break; case kDudeSpiderBlack: actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); - sub_70D30(pXTarget, 8, 16); + SpidPoisonTarget(pXTarget, 8, 16); break; case kDudeSpiderMother: { actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); @@ -106,7 +103,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) dy += Random2(2000); dz += Random2(2000); actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); - sub_70D30(pXTarget, 8, 16); + SpidPoisonTarget(pXTarget, 8, 16); } break; } @@ -141,7 +138,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor) } } -void sub_71370(int, DBloodActor* actor) +void SpidBirthSeqCallback(int, DBloodActor* actor) { XSPRITE* pXSprite = &actor->x(); spritetype* pSprite = &actor->s(); @@ -249,7 +246,7 @@ static void spidThinkChase(DBloodActor* actor) if (nDist < 0x733 && nDist > 0x399 && abs(nDeltaAngle) < 85) aiNewState(actor, &spidJump); else if (Chance(0x8000)) - aiNewState(actor, &spid13A92C); + aiNewState(actor, &spidBirth); break; } diff --git a/source/games/blood/src/aistate.h b/source/games/blood/src/aistate.h index 18d13e6cf..930fce36b 100644 --- a/source/games/blood/src/aistate.h +++ b/source/games/blood/src/aistate.h @@ -313,7 +313,7 @@ extern AISTATE spidGoto; extern AISTATE spidSearch; extern AISTATE spidBite; extern AISTATE spidJump; -extern AISTATE spid13A92C; +extern AISTATE spidBirth; extern AISTATE tchernobogIdle; extern AISTATE tchernobogSearch; diff --git a/source/games/blood/src/loadsave.cpp b/source/games/blood/src/loadsave.cpp index 08ee82125..7589b0e0e 100644 --- a/source/games/blood/src/loadsave.cpp +++ b/source/games/blood/src/loadsave.cpp @@ -318,7 +318,7 @@ static AISTATE* allAIStates[] = &spidSearch, &spidBite, &spidJump, - &spid13A92C, + &spidBirth, &tchernobogIdle, &tchernobogSearch, &tchernobogChase, diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 9977fd10e..0bf150b03 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -75,7 +75,7 @@ static void (*seqClientCallback[])(int, DBloodActor*) = { ratBiteSeqCallback, SpidBiteSeqCallback, SpidJumpSeqCallback, - sub_71370, + SpidBirthSeqCallback, sub_71BD4, sub_720AC, sub_71A90, diff --git a/source/games/blood/src/seqcb.h b/source/games/blood/src/seqcb.h index 62e5c9987..5f7f70ad1 100644 --- a/source/games/blood/src/seqcb.h +++ b/source/games/blood/src/seqcb.h @@ -43,7 +43,7 @@ void sub_70284(int, DBloodActor*); void ratBiteSeqCallback(int, DBloodActor*); void SpidBiteSeqCallback(int, DBloodActor*); void SpidJumpSeqCallback(int, DBloodActor*); -void sub_71370(int, DBloodActor*); +void SpidBirthSeqCallback(int, DBloodActor*); void sub_71A90(int, DBloodActor*); void sub_71BD4(int, DBloodActor*); void sub_720AC(int, DBloodActor*); @@ -104,7 +104,7 @@ enum nRatBiteClient, nSpidBiteClient, nSpidJumpClient, - dword_279B50, + nSpidBirthClient, dword_279B54, dword_279B58, dword_279B5C, From 44e6ccb3d41d4cfba209f0cd080ae1d754ad1e74 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Sat, 21 Aug 2021 20:16:48 +1000 Subject: [PATCH 10/12] Eliminate misused DemoRecordStatus usages --- source/games/blood/src/actor.cpp | 20 ++++++++++---------- source/games/blood/src/ai.cpp | 6 +++--- source/games/blood/src/aibeast.cpp | 2 +- source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/weapon.cpp | 16 ++++++++-------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 09d43c4b9..53d4c7494 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2661,7 +2661,7 @@ void actRadiusDamage(DBloodActor* source, int x, int y, int z, int nSector, int { uint8_t sectmap[(kMaxSectors + 7) >> 3]; auto pOwner = source->GetOwner(); - const bool newSectCheckMethod = !cl_bloodvanillaexplosions && pOwner && pOwner->IsDudeActor() && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaexplosions && pOwner && pOwner->IsDudeActor() && !VanillaMode(); // use new sector checking logic GetClosestSpriteSectors(nSector, x, y, nDist, sectmap, nullptr, newSectCheckMethod); nDist <<= 4; if (flags & 2) @@ -3092,7 +3092,7 @@ static bool actKillDudeStage1(DBloodActor* actor, DAMAGE_TYPE damageType) break; case kDudeTinyCaleb: - if (cl_bloodvanillaenemies || VanillaMode() || DemoRecordStatus()) + if (cl_bloodvanillaenemies || VanillaMode()) break; if (damageType == kDamageBurn && pXSprite->medium == kMediumNormal) { @@ -3936,7 +3936,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) actBurnSprite(missileActor->GetOwner(), actorHit, 360); // by NoOne: make Life Leech heal user, just like it was in 1.0x versions - if (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus() && pDudeInfo != nullptr) + if (gGameOptions.weaponsV10x && !VanillaMode() && pDudeInfo != nullptr) { if (missileOwner->IsDudeActor() && missileOwner->hasX() && missileOwner->x().health != 0) actHealDude(missileOwner, nDamage >> 2, getDudeInfo(missileOwner->s().type)->startHealth); @@ -4042,7 +4042,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) actRadiusDamage(missileOwner, pMissile->x, pMissile->y, pMissile->z, pMissile->sectnum, 16, 20, 10, kDamageBullet, 6, 480); // by NoOne: allow additional bullet damage for Flare Gun - if (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus()) + if (gGameOptions.weaponsV10x && !VanillaMode()) { int nDamage = (20 + Random(10)) << 4; actDamageSprite(missileOwner, actorHit, kDamageBullet, nDamage); @@ -4651,7 +4651,7 @@ int MoveThing(spritetype *pSprite) { short bakCstat = pSprite->cstat; pSprite->cstat &= ~257; - if ((pSprite->owner >= 0) && !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) + if ((pSprite->owner >= 0) && !cl_bloodvanillaexplosions && !VanillaMode()) enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy v8 = gSpriteHit[nXSprite].hit = ClipMove((int*)&pSprite->x, (int*)&pSprite->y, (int*)&pSprite->z, &nSector, xvel[nSprite]>>12, yvel[nSprite]>>12, pSprite->clipdist<<2, (pSprite->z-top)/4, (bottom-pSprite->z)/4, CLIPMASK0); enginecompatibility_mode = bakCompat; // restore @@ -5016,7 +5016,7 @@ void MoveDude(spritetype *pSprite) } if (pPlayer && zvel[nSprite] > 0x155555 && !pPlayer->fallScream && pXSprite->height > 0) { - const bool playerAlive = (pXSprite->health > 0) || VanillaMode() || DemoRecordStatus(); // only trigger falling scream if player is alive or vanilla mode + const bool playerAlive = (pXSprite->health > 0) || VanillaMode(); // only trigger falling scream if player is alive or vanilla mode if (playerAlive) { pPlayer->fallScream = 1; @@ -5114,7 +5114,7 @@ void MoveDude(spritetype *pSprite) break; case kDudeBurningCultist: { - const bool fixRandomCultist = !cl_bloodvanillaenemies && (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode() && !DemoRecordStatus(); // fix burning cultists randomly switching types underwater + const bool fixRandomCultist = !cl_bloodvanillaenemies && (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode(); // fix burning cultists randomly switching types underwater if (Chance(chance)) pSprite->type = kDudeCultistTommy; else @@ -5440,7 +5440,7 @@ int MoveMissile(spritetype *pSprite) int z = pSprite->z; int nSector2 = pSprite->sectnum; clipmoveboxtracenum = 1; - if ((pSprite->owner >= 0) && !isFlameSprite && !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus()) + if ((pSprite->owner >= 0) && !isFlameSprite && !cl_bloodvanillaexplosions && !VanillaMode()) enginecompatibility_mode = ENGINECOMPATIBILITY_NONE; // improved clipmove accuracy int vdx = ClipMove(&x, &y, &z, &nSector2, vx, vy, pSprite->clipdist<<2, (z-top)/4, (bottom-z)/4, CLIPMASK0); enginecompatibility_mode = bakCompat; // restore @@ -6013,7 +6013,7 @@ void actProcessSprites(void) // the new flag newSectCheckMethod for GetClosestSpriteSectors() does rectify these issues, but this may cause unintended side effects for level scripted explosions // so only allow this new checking method for dude spawned explosions short gAffectedXWalls[kMaxXWalls]; - const bool newSectCheckMethod = !cl_bloodvanillaexplosions && pOwner && pOwner->IsDudeActor() && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaexplosions && pOwner && pOwner->IsDudeActor() && !VanillaMode(); // use new sector checking logic GetClosestSpriteSectors(nSector, x, y, radius, sectmap, gAffectedXWalls, newSectCheckMethod); for (int i = 0; i < kMaxXWalls; i++) @@ -6206,7 +6206,7 @@ void actProcessSprites(void) if (nXSprite > 0) { XSPRITE *pXSprite = &xsprite[nXSprite]; - const bool fixBurnGlitch = !cl_bloodvanillaenemies && IsBurningDude(pSprite) && !VanillaMode() && !DemoRecordStatus(); // if enemies are burning, always apply burning damage per tick + const bool fixBurnGlitch = !cl_bloodvanillaenemies && IsBurningDude(pSprite) && !VanillaMode(); // if enemies are burning, always apply burning damage per tick if ((pXSprite->burnTime > 0) || fixBurnGlitch) { switch (pSprite->type) diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 6349b64cb..3d88c236b 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -1033,7 +1033,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType DUDEEXTRA *pDudeExtra = &gDudeExtra[pSprite->extra]; pDudeExtra->recoil = 1; } - const bool fixRandomCultist = !cl_bloodvanillaenemies && (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode() && !DemoRecordStatus(); // fix burning cultists randomly switching types underwater + const bool fixRandomCultist = !cl_bloodvanillaenemies && (pSprite->inittype >= kDudeBase) && (pSprite->inittype < kDudeMax) && !VanillaMode(); // fix burning cultists randomly switching types underwater switch (pSprite->type) { case kDudeCultistTommy: @@ -1110,7 +1110,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType case kDudeTinyCaleb: if (nDmgType == kDamageBurn && pXSprite->health <= (unsigned int)pDudeInfo->fleeHealth/* && (pXSprite->at17_6 != 1 || pXSprite->at17_6 != 2)*/) { - if (!cl_bloodvanillaenemies && !VanillaMode() && !DemoRecordStatus()) // fix burning sprite for tiny caleb + if (!cl_bloodvanillaenemies && !VanillaMode()) // fix burning sprite for tiny caleb { pSprite->type = kDudeBurningTinyCaleb; aiNewState(actor, &tinycalebBurnGoto); @@ -1480,7 +1480,7 @@ void aiLookForTarget(spritetype *pSprite, XSPRITE *pXSprite) if (pXSprite->state) { uint8_t sectmap[(kMaxSectors+7)>>3]; - const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode(); // use new sector checking logic GetClosestSpriteSectors(pSprite->sectnum, pSprite->x, pSprite->y, 400, sectmap, nullptr, newSectCheckMethod); int nSprite2; diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 5edf271f0..f3316df08 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -95,7 +95,7 @@ void StompSeqCallback(int, DBloodActor* actor1) int nSector = pSprite->sectnum; int v1c = 5+2*gGameOptions.nDifficulty; int v10 = 25+30*gGameOptions.nDifficulty; - const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode(); // use new sector checking logic GetClosestSpriteSectors(nSector, x, y, vc, sectmap, nullptr, newSectCheckMethod); char v4 = 0; int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 87efb285e..e8667549d 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -491,7 +491,7 @@ void nnExtInitModernStuff(bool bSaveLoad) { nnExtResetGlobals(); // use true random only for single player mode, otherwise use Blood's default one. - if (gGameOptions.nGameType == 0 && !VanillaMode() && !DemoRecordStatus()) { + if (gGameOptions.nGameType == 0 && !VanillaMode()) { gStdRandom.seed(std::random_device()()); diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 321a9c3d9..ee19f0953 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -155,7 +155,7 @@ static bool checkFired6or7(PLAYER *pPlayer) case 6: return 1; case 7: - if (VanillaMode() || DemoRecordStatus()) + if (VanillaMode()) return 0; return 1; } @@ -731,7 +731,7 @@ void WeaponLower(PLAYER *pPlayer) } break; case 7: // throwing ignited alt fire spray - if (VanillaMode() || DemoRecordStatus() || (pPlayer->newWeapon != 0)) + if (VanillaMode() || (pPlayer->newWeapon != 0)) break; pPlayer->weaponState = 1; StartQAV(pPlayer, 11, -1, 0); @@ -1479,7 +1479,7 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer) // by NoOne: trying to simulate v1.0x voodoo here. // dunno how exactly it works, but at least it not spend all the ammo on alt fire - if (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus()) { + if (gGameOptions.weaponsV10x && !VanillaMode()) { int nCount = ClipHigh(pPlayer->ammoCount[9], pPlayer->aimTargetsCount); if (nCount > 0) { @@ -2203,7 +2203,7 @@ void WeaponProcess(PLAYER *pPlayer) { } if (pPlayer->newWeapon) { - if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->newWeapon) && !checkFired6or7(pPlayer) && !VanillaMode() && !DemoRecordStatus()) // skip banned weapons when underwater and using next/prev weapon key inputs + if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->newWeapon) && !checkFired6or7(pPlayer) && !VanillaMode()) // skip banned weapons when underwater and using next/prev weapon key inputs { if (prevNewWeaponVal == WeaponSel_Next || prevNewWeaponVal == WeaponSel_Prev) // if player switched weapons { @@ -2254,7 +2254,7 @@ void WeaponProcess(PLAYER *pPlayer) { pPlayer->newWeapon = 12; } } - else if ((pPlayer->newWeapon == 7) && !VanillaMode() && !DemoRecordStatus()) + else if ((pPlayer->newWeapon == 7) && !VanillaMode()) { if ((pPlayer->curWeapon == 7) && (pPlayer->weaponState == 2)) // fix spray can state glitch when switching from spray to tnt and back quickly { @@ -2577,10 +2577,10 @@ void WeaponProcess(PLAYER *pPlayer) { case 5: if (powerupCheck(pPlayer, kPwUpTwoGuns)) // by NoOne: allow napalm launcher alt fire act like in v1.0x versions - if (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus()) StartQAV(pPlayer, 123, nClientFireNapalm2, 0); + if (gGameOptions.weaponsV10x && !VanillaMode()) StartQAV(pPlayer, 123, nClientFireNapalm2, 0); else StartQAV(pPlayer, 122, nClientAltFireNapalm, 0); else - StartQAV(pPlayer, 91, (gGameOptions.weaponsV10x && !VanillaMode() && !DemoRecordStatus()) ? nClientFireNapalm : nClientAltFireNapalm, 0); + StartQAV(pPlayer, 91, (gGameOptions.weaponsV10x && !VanillaMode()) ? nClientFireNapalm : nClientAltFireNapalm, 0); return; case 2: if (CheckAmmo(pPlayer, 1, 8)) @@ -2625,7 +2625,7 @@ void teslaHit(spritetype *pMissile, int a2) int nDist = 300; int nSector = pMissile->sectnum; int nOwner = pMissile->owner; - const bool newSectCheckMethod = !cl_bloodvanillaexplosions && !VanillaMode() && !DemoRecordStatus(); // use new sector checking logic + const bool newSectCheckMethod = !cl_bloodvanillaexplosions && !VanillaMode(); // use new sector checking logic GetClosestSpriteSectors(nSector, x, y, nDist, sectmap, nullptr, newSectCheckMethod); bool v4 = true; DBloodActor* actor = nullptr; From 8ec6cdaf91a4cd5c75bd123f39f479dd0cb071b6 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Sat, 21 Aug 2021 20:53:38 +1000 Subject: [PATCH 11/12] Renamed SpidPoisonTarget to SpidPoisonPlayer --- source/games/blood/src/aispid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index acd5c4edc..ced581fcb 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -44,7 +44,7 @@ AISTATE spidBite = { kAiStateChase, 6, nSpidBiteClient, 60, NULL, NULL, NULL, &s AISTATE spidJump = { kAiStateChase, 8, nSpidJumpClient, 60, NULL, aiMoveForward, NULL, &spidChase }; AISTATE spidBirth = { kAiStateOther, 0, nSpidBirthClient, 60, NULL, NULL, NULL, &spidIdle }; -static char SpidPoisonTarget(XSPRITE *pXDude, int nBlind, int max) +static char SpidPoisonPlayer(XSPRITE *pXDude, int nBlind, int max) { assert(pXDude != NULL); int nDude = pXDude->reference; @@ -90,11 +90,11 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) break; case kDudeSpiderRed: actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); - if (Chance(0x5000)) SpidPoisonTarget(pXTarget, 4, 16); + if (Chance(0x5000)) SpidPoisonPlayer(pXTarget, 4, 16); break; case kDudeSpiderBlack: actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); - SpidPoisonTarget(pXTarget, 8, 16); + SpidPoisonPlayer(pXTarget, 8, 16); break; case kDudeSpiderMother: { actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); @@ -103,9 +103,9 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) dy += Random2(2000); dz += Random2(2000); actFireVector(pSprite, 0, 0, dx, dy, dz, kVectorSpiderBite); - SpidPoisonTarget(pXTarget, 8, 16); - } + SpidPoisonPlayer(pXTarget, 8, 16); break; + } } } From 72225c9b8cbc9d632c5eb27209fb05f3503110f3 Mon Sep 17 00:00:00 2001 From: carnivoroussociety <38839485+carnivoroussociety@users.noreply.github.com> Date: Sun, 22 Aug 2021 17:49:02 +1000 Subject: [PATCH 12/12] Added various missing item/ammo types to common_game.h Renamed kAmmoItemVoodooDoll->kItemAmmoVoodooDoll Renamed kMissileFireballNapam->kMissileFireballNapalm --- source/games/blood/src/actor.cpp | 8 ++++---- source/games/blood/src/aiunicult.cpp | 6 +++--- source/games/blood/src/common_game.h | 22 ++++++++++++++++++++-- source/games/blood/src/weapon.cpp | 6 +++--- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 53d4c7494..7035739d8 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2540,7 +2540,7 @@ void actInit(bool bSaveLoad) { if (act->s().type == kItemWeaponVoodooDoll) { - act->s().type = kAmmoItemVoodooDoll; + act->s().type = kItemAmmoVoodooDoll; break; } } @@ -4012,7 +4012,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) break; case kMissileFireball: - case kMissileFireballNapam: + case kMissileFireballNapalm: if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo)) { if (pThingInfo && pSpriteHit->type == kThingTNTBarrel && actorHit->x().burnTime == 0) @@ -5556,7 +5556,7 @@ void actExplodeSprite(spritetype *pSprite) switch (pSprite->type) { - case kMissileFireballNapam: + case kMissileFireballNapalm: nType = kExplosionNapalm; seqSpawn(4, 3, nXSprite, -1); if (Chance(0x8000)) @@ -6719,7 +6719,7 @@ void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) { seqSpawn(2, 3, nXSprite, -1); sfxPlay3DSound(pMissile, 493, 0, 0); break; - case kMissileFireballNapam: + case kMissileFireballNapalm: seqSpawn(61, 3, nXSprite, nNapalmClient); sfxPlay3DSound(pMissile, 441, 0, 0); break; diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 841e2760f..4e9ad295f 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -619,7 +619,7 @@ static void unicultThinkChase(DBloodActor* actor) mdist = 2500; fallthrough__; case kMissileFireball: - case kMissileFireballNapam: + case kMissileFireballNapalm: case kMissileFireballCerberus: case kMissileFireballTchernobog: if (mdist == defDist) mdist = 3000; @@ -834,7 +834,7 @@ static void unicultThinkChase(DBloodActor* actor) case kMissileTeslaAlt: case kMissileFlareAlt: case kMissileFireball: - case kMissileFireballNapam: + case kMissileFireballNapalm: case kMissileFireballCerberus: case kMissileFireballTchernobog: { // allow attack if dude is far from object, but target is close to it @@ -1328,7 +1328,7 @@ void scaleDamage(XSPRITE* pXSprite) { curScale[kDmgSpirit] = 32 + Random(18); break; case kMissileFireball: - case kMissileFireballNapam: + case kMissileFireballNapalm: case kMissileFireballCerberus: case kMissileFireballTchernobog: curScale[kDmgBurn] = 50; diff --git a/source/games/blood/src/common_game.h b/source/games/blood/src/common_game.h index 192a42c4e..3d0eb9479 100644 --- a/source/games/blood/src/common_game.h +++ b/source/games/blood/src/common_game.h @@ -172,17 +172,35 @@ enum { // (weapons) kItemWeaponBase = 40, + kItemWeaponRandom = kItemWeaponBase, kItemWeaponSawedoff = 41, kItemWeaponTommygun = 42, + kItemWeaponFlarePistol = 43, kItemWeaponVoodooDoll = 44, + kItemWeaponTeslaCannon = 45, + kItemWeaponNapalmLauncher = 46, + kItemWeaponPitchfork = 47, + kItemWeaponSprayCan = 48, + kItemWeaponTNT = 49, kItemWeaponLifeLeech = 50, kItemWeaponMax = 51, // items (ammos) kItemAmmoBase = 60, + kItemAmmoSprayCan = kItemAmmoBase, + kItemAmmoTNTBundle = 62, + kItemAmmoTNTBox = 63, + kItemAmmoProxBombBundle = 64, + kItemAmmoRemoteBombBundle = 65, + kItemAmmoTrappedSoul = 66, kItemAmmoSawedoffFew = 67, + kItemAmmoSawedoffBox = 68, kItemAmmoTommygunFew = 69, - kAmmoItemVoodooDoll = 70, + kItemAmmoVoodooDoll = 70, + kItemAmmoTommygunDrum = 72, + kItemAmmoTeslaCharge = 73, + kItemAmmoFlares = 76, + kItemAmmoGasolineCan = 79, kItemAmmoMax = 81, kItemBase = 100, @@ -302,7 +320,7 @@ enum { kMissilePukeGreen = 309, kMissileUnused = 310, kMissileArcGargoyle = 311, - kMissileFireballNapam = 312, + kMissileFireballNapalm = 312, kMissileFireballCerberus = 313, kMissileFireballTchernobog = 314, kMissileLifeLeechRegular = 315, diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index ee19f0953..f6c005e1c 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -1636,7 +1636,7 @@ void FireNapalm(int nTrigger, PLAYER *pPlayer) offset = 50; break; } - playerFireMissile(pPlayer, offset, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapam); + playerFireMissile(pPlayer, offset, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapalm); sfxPlay3DSound(pSprite, 480, 2, 0); UseAmmo(pPlayer, 4, 1); pPlayer->flashEffect = 1; @@ -1645,8 +1645,8 @@ void FireNapalm(int nTrigger, PLAYER *pPlayer) void FireNapalm2(int , PLAYER *pPlayer) { spritetype *pSprite = pPlayer->pSprite; - playerFireMissile(pPlayer, -120, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapam); - playerFireMissile(pPlayer, 120, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapam); + playerFireMissile(pPlayer, -120, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapalm); + playerFireMissile(pPlayer, 120, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapalm); sfxPlay3DSound(pSprite, 480, 2, 0); UseAmmo(pPlayer, 4, 2); pPlayer->flashEffect = 1;