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] 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,