- renamed a few functions with disasm names.

This commit is contained in:
Christoph Oelckers 2020-11-21 18:33:31 +01:00
parent a319687373
commit c13dd52e34
5 changed files with 54 additions and 54 deletions

View file

@ -59,7 +59,7 @@ AISTATE genRecoil = {kAiStateRecoil, 5, -1, 20, NULL, NULL, NULL, &genIdle };
const int dword_138BB0[5] = {0x2000, 0x4000, 0x8000, 0xa000, 0xe000};
bool sub_5BDA8(spritetype *pSprite, int nSeq)
bool dudeIsPlayingSeq(spritetype *pSprite, int nSeq)
{
if (pSprite->statnum == kStatDude && pSprite->type >= kDudeBase && pSprite->type < kDudeMax)
{
@ -920,11 +920,11 @@ int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_T
case kDudeCultistTNT:
if (nDmgType != DAMAGE_TYPE_1)
{
if (!sub_5BDA8(pSprite, 14) && !pXSprite->medium)
if (!dudeIsPlayingSeq(pSprite, 14) && !pXSprite->medium)
aiNewState(pSprite, pXSprite, &cultistDodge);
else if (sub_5BDA8(pSprite, 14) && !pXSprite->medium)
else if (dudeIsPlayingSeq(pSprite, 14) && !pXSprite->medium)
aiNewState(pSprite, pXSprite, &cultistProneDodge);
else if (sub_5BDA8(pSprite, 13) && (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo))
else if (dudeIsPlayingSeq(pSprite, 13) && (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo))
aiNewState(pSprite, pXSprite, &cultistSwimDodge);
}
else if (nDmgType == DAMAGE_TYPE_1 && pXSprite->health <= (unsigned int)pDudeInfo->fleeHealth/* && (pXSprite->at17_6 != 1 || pXSprite->at17_6 != 2)*/)
@ -1048,13 +1048,13 @@ int aiDamageSprite(spritetype *pSprite, XSPRITE *pXSprite, int nSource, DAMAGE_T
if (!dudeIsMelee(pXSprite)) {
if (inIdle(pXSprite->aiState) || Chance(getDodgeChance(pSprite))) {
if (!spriteIsUnderwater(pSprite, false)) {
if (!canDuck(pSprite) || !sub_5BDA8(pSprite, 14)) aiGenDudeNewState(pSprite, &genDudeDodgeShortL);
if (!canDuck(pSprite) || !dudeIsPlayingSeq(pSprite, 14)) aiGenDudeNewState(pSprite, &genDudeDodgeShortL);
else aiGenDudeNewState(pSprite, &genDudeDodgeShortD);
if (Chance(0x0200))
playGenDudeSound(pSprite, kGenDudeSndGotHit);
} else if (sub_5BDA8(pSprite, 13)) {
} else if (dudeIsPlayingSeq(pSprite, 13)) {
aiGenDudeNewState(pSprite, &genDudeDodgeShortW);
}
}

View file

@ -90,7 +90,7 @@ extern DUDEEXTRA gDudeExtra[];
extern int gDudeSlope[];
extern int cumulDamage[];
bool sub_5BDA8(spritetype *pSprite, int nSeq);
bool dudeIsPlayingSeq(spritetype *pSprite, int nSeq);
void aiPlay3DSound(spritetype *pSprite, int a2, AI_SFX_PRIORITY a3, int a4);
void aiNewState(spritetype *pSprite, XSPRITE *pXSprite, AISTATE *pAIState);
void aiChooseDirection(spritetype *pSprite, XSPRITE *pXSprite, int a3);

View file

@ -346,37 +346,37 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
switch (hit)
{
case -1:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTProneFire);
else if (sub_5BDA8(pSprite, 13) && (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo))
else if (dudeIsPlayingSeq(pSprite, 13) && (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo))
aiNewState(pSprite, pXSprite, &cultistTSwimFire);
break;
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistShotgun)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistTSwimFire);
}
else
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistDodge);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistProneDodge);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSwimDodge);
}
break;
default:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistTSwimFire);
@ -414,9 +414,9 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
switch (hit)
{
case -1:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
@ -424,27 +424,27 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistTommy)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
}
else
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistDodge);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistProneDodge);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSwimDodge);
}
break;
default:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
@ -482,9 +482,9 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
switch (hit)
{
case -1:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTsFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTsProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistTsSwimFire);
@ -492,27 +492,27 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistTommy)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTsFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTsProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistTsSwimFire);
}
else
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistDodge);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistProneDodge);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSwimDodge);
}
break;
default:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTsFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistTsProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistTsSwimFire);
@ -594,9 +594,9 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
switch (hit)
{
case -1:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
@ -604,27 +604,27 @@ static void cultThinkChase(spritetype *pSprite, XSPRITE *pXSprite)
case 3:
if (pSprite->type != sprite[gHitInfo.hitsprite].type && sprite[gHitInfo.hitsprite].type != kDudeCultistTommy)
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);
}
else
{
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistDodge);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistProneDodge);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSwimDodge);
}
break;
default:
if (!sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
if (!dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSFire);
else if (sub_5BDA8(pSprite, 14) && pXSprite->medium == kMediumNormal)
else if (dudeIsPlayingSeq(pSprite, 14) && pXSprite->medium == kMediumNormal)
aiNewState(pSprite, pXSprite, &cultistSProneFire);
else if (pXSprite->medium == kMediumWater || pXSprite->medium == kMediumGoo)
aiNewState(pSprite, pXSprite, &cultistSSwimFire);

View file

@ -909,9 +909,9 @@ static void unicultThinkChase( spritetype* pSprite, XSPRITE* pXSprite ) {
int checkAttackState(spritetype* pSprite, XSPRITE* pXSprite) {
UNREFERENCED_PARAMETER(pXSprite);
if (sub_5BDA8(pSprite, 14) || spriteIsUnderwater(pSprite,false))
if (dudeIsPlayingSeq(pSprite, 14) || spriteIsUnderwater(pSprite,false))
{
if ( !sub_5BDA8(pSprite, 14) || spriteIsUnderwater(pSprite,false))
if ( !dudeIsPlayingSeq(pSprite, 14) || spriteIsUnderwater(pSprite,false))
{
if (spriteIsUnderwater(pSprite,false))
{

View file

@ -1793,7 +1793,7 @@ char WeaponFindLoaded(PLAYER *pPlayer, int *a2)
return v4;
}
int sub_4F0E0(PLAYER *pPlayer)
int processSprayCan(PLAYER *pPlayer)
{
switch (pPlayer->weaponState)
{
@ -1831,7 +1831,7 @@ int sub_4F0E0(PLAYER *pPlayer)
return 0;
}
char sub_4F200(PLAYER *pPlayer)
char processTNT(PLAYER *pPlayer)
{
switch (pPlayer->weaponState)
{
@ -1869,7 +1869,7 @@ char sub_4F200(PLAYER *pPlayer)
return 0;
}
char sub_4F320(PLAYER *pPlayer)
char processProxy(PLAYER *pPlayer)
{
switch (pPlayer->weaponState)
{
@ -1886,7 +1886,7 @@ char sub_4F320(PLAYER *pPlayer)
return 0;
}
char sub_4F3A0(PLAYER *pPlayer)
char processRemote(PLAYER *pPlayer)
{
switch (pPlayer->weaponState)
{
@ -1902,7 +1902,7 @@ char sub_4F3A0(PLAYER *pPlayer)
return 0;
}
char sub_4F414(PLAYER *pPlayer)
char processLeech(PLAYER *pPlayer)
{
switch (pPlayer->weaponState)
{
@ -1926,7 +1926,7 @@ char sub_4F414(PLAYER *pPlayer)
return 0;
}
char sub_4F484(PLAYER *pPlayer)
char processTesla(PLAYER *pPlayer)
{
switch (pPlayer->weaponState)
{
@ -2019,19 +2019,19 @@ void WeaponProcess(PLAYER *pPlayer) {
switch (pPlayer->curWeapon)
{
case 7:
if (sub_4F0E0(pPlayer))
if (processSprayCan(pPlayer))
return;
break;
case 6:
if (sub_4F200(pPlayer))
if (processTNT(pPlayer))
return;
break;
case 11:
if (sub_4F320(pPlayer))
if (processProxy(pPlayer))
return;
break;
case 12:
if (sub_4F3A0(pPlayer))
if (processRemote(pPlayer))
return;
break;
}
@ -2042,11 +2042,11 @@ void WeaponProcess(PLAYER *pPlayer) {
switch (pPlayer->curWeapon)
{
case 9:
if (sub_4F414(pPlayer))
if (processLeech(pPlayer))
return;
break;
case 8:
if (sub_4F484(pPlayer))
if (processTesla(pPlayer))
return;
break;
}