- Exhumed: Converted out most remaining files.

This commit is contained in:
Mitchell Richters 2023-04-16 17:08:33 +10:00
parent 34e984d836
commit d8441f712e
21 changed files with 136 additions and 134 deletions

View file

@ -302,7 +302,7 @@ struct RA
TObjPtr<DExhumedActor*> pTarget;
int16_t nAction;
int16_t nFrame;
uint16_t nFrame;
int16_t nRun;
int16_t nState;
int nPlayer;

View file

@ -122,20 +122,20 @@ void AIAnubis::Tick(RunListEvent* ev)
{
const auto ap = ev->pObjActor;
const int nAction = ap->nAction;
const int nSeq = getSeqFromId(kSeqAnubis, AnubisSeq[nAction].nSeqId);
const int nFrame = getSeqFrame(nSeq, ap->nFrame);
const int nFlag = getSeqFrameFlags(nFrame);
const auto& anubisSeq = getSequence(ap->nSeqFile, AnubisSeq[nAction].nSeqId);
const auto& seqFrame = anubisSeq[ap->nFrame];
bool bVal = false;
if (nAction < 11)
Gravity(ap);
seq_MoveSequence(ap, nSeq, ap->nFrame);
playFrameSound(ap, seqFrame);
ap->spr.picnum = seq_GetSeqPicnum2(nSeq, ap->nFrame);
ap->spr.picnum = seqFrame.chunks[0].picnum;
ap->nFrame++;
if (ap->nFrame >= getSeqFrameCount(nSeq))
if (ap->nFrame >= anubisSeq.Size())
{
ap->nFrame = 0;
bVal = true;
@ -247,7 +247,7 @@ void AIAnubis::Tick(RunListEvent* ev)
{
ap->nAction = 1;
}
else if (nFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, ap, 7);
}
@ -263,7 +263,7 @@ void AIAnubis::Tick(RunListEvent* ev)
ap->vel.XY() = ap->spr.Angles.Yaw.ToVector() * 256;
ap->nFrame = 0;
}
else if (nFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
BuildBullet(ap, 8, INT_MAX, ap->spr.Angles.Yaw, pTarget, 1);
}

View file

@ -49,8 +49,9 @@ void BuildFishLimb(DExhumedActor* pActor, int anim)
{
auto pChunkActor = insertActor(pActor->sector(), 99);
pChunkActor->nSeqFile = "fish";
pChunkActor->nCount = anim + 40;
pChunkActor->nFrame = RandomSize(3) % getSeqFrameCount(getSeqFromId(kSeqFish, pChunkActor->nCount));
pChunkActor->nFrame = RandomSize(3) % getSequence(pChunkActor->nSeqFile, pChunkActor->nCount).Size();
pChunkActor->spr.pos = pActor->spr.pos;
pChunkActor->spr.cstat = 0;
@ -74,8 +75,6 @@ void BuildFishLimb(DExhumedActor* pActor, int anim)
pChunkActor->spr.extra = -1;
pChunkActor->spr.intowner = runlist_AddRunRec(pChunkActor->spr.lotag - 1, pChunkActor, 0x200000);
pChunkActor->spr.hitag = runlist_AddRunRec(NewRun, pChunkActor, 0x200000);
pChunkActor->nSeqFile = "fish";
}
//---------------------------------------------------------------------------
@ -89,15 +88,15 @@ void AIFishLimb::Tick(RunListEvent* ev)
auto pActor = ev->pObjActor;
if (!pActor) return;
int nSeq = getSeqFromId(kSeqFish, pActor->nCount);
const auto& fishSeq = getSequence(pActor->nSeqFile, pActor->nCount);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
pActor->spr.picnum = fishSeq[pActor->nFrame].chunks[0].picnum;
Gravity(pActor);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= fishSeq.Size())
{
pActor->nFrame = 0;
if (RandomBit()) {
@ -360,14 +359,15 @@ void AIFish::Tick(RunListEvent* ev)
Gravity(pActor);
}
int nSeq = getSeqFromId(kSeqFish, FishSeq[nAction].nSeqId);
const auto& fishSeq = getSequence(pActor->nSeqFile, FishSeq[nAction].nSeqId);
const auto& seqFrame = fishSeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq)) {
if (pActor->nFrame >= fishSeq.Size()) {
pActor->nFrame = 0;
}

View file

@ -258,10 +258,11 @@ void AIGrenade::Tick(RunListEvent* ev)
auto pActor = ev->pObjActor;
if (!pActor) return;
int nSeq = pActor->nFrame ? getSeqFromId(kSeqGrenBoom) : getSeqFromId(kSeqGrenRoll, pActor->nIndex);
const auto& grenadeSeq = pActor->nFrame ? getSequence("grenboom") : getSequence("grenroll", pActor->nIndex);
const auto& seqFrame = grenadeSeq[pActor->nHealth >> 8];
seq_MoveSequence(pActor, nSeq, pActor->nHealth >> 8);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nHealth >> 8);
playFrameSound(pActor, seqFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
pActor->nIndex2--;
if (!pActor->nIndex2)
@ -301,11 +302,11 @@ void AIGrenade::Tick(RunListEvent* ev)
if (ebp < 0)
{
pActor->nHealth += getSeqFrameCount(nSeq) << 8;
pActor->nHealth += grenadeSeq.Size() << 8;
}
else
{
if (ebp >= getSeqFrameCount(nSeq))
if (ebp >= (signed)grenadeSeq.Size())
{
if (pActor->nFrame)
{

View file

@ -214,21 +214,20 @@ void AILavaDude::Tick(RunListEvent* ev)
if (!pActor) return;
int nAction = pActor->nAction;
int nSeq = getSeqFromId(kSeqLavag, LavadudeSeq[nAction].nSeqId);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
int var_38 = pActor->nFrame;
const auto& lavadudeSeq = getSequence(pActor->nSeqFile, LavadudeSeq[nAction].nSeqId);
const auto& seqFrame = lavadudeSeq[pActor->nFrame];
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, var_38));
pActor->spr.picnum = seqFrame.chunks[0].picnum;
int var_1C = 0;
if (nAction)
{
seq_MoveSequence(pActor, nSeq, var_38);
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= lavadudeSeq.Size())
{
var_1C = 1;
pActor->nFrame = 0;
@ -341,7 +340,7 @@ void AILavaDude::Tick(RunListEvent* ev)
case 3:
{
if ((nFlag & 0x80) && pTarget)
if ((seqFrame.flags & 0x80) && pTarget)
{
BuildBullet(pActor, 10, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
}
@ -368,7 +367,7 @@ void AILavaDude::Tick(RunListEvent* ev)
case 5:
{
if (nFlag & 0x40)
if (seqFrame.flags & 0x40)
{
auto pLimbSprite = BuildLavaLimb(pActor, pActor->nFrame, 250);
D3PlayFX(StaticSound[kSound26], pLimbSprite);
@ -376,7 +375,7 @@ void AILavaDude::Tick(RunListEvent* ev)
if (pActor->nFrame)
{
if (nFlag & 0x80)
if (seqFrame.flags & 0x80)
{
int ecx = 0;
do

View file

@ -200,20 +200,20 @@ void AILion::Tick(RunListEvent* ev)
Gravity(pActor);
}
int nSeq = getSeqFromId(kSeqLion, LionSeq[nAction].nSeqId);
const auto& lionSeq = getSequence(pActor->nSeqFile, LionSeq[nAction].nSeqId);
const auto& seqFrame = lionSeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= lionSeq.Size())
{
pActor->nFrame = 0;
bVal = true;
}
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame));
DExhumedActor* pTarget = pActor->pTarget;
auto nMov = MoveCreatureWithCaution(pActor);
@ -338,7 +338,7 @@ void AILion::Tick(RunListEvent* ev)
{
pActor->nAction = 2;
}
else if (nFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, pActor, 10);
}

View file

@ -141,19 +141,17 @@ void AIMummy::Tick(RunListEvent* ev)
Gravity(pActor);
int nSeq = getSeqFromId(kSeqMummy, MummySeq[nAction].nSeqId);
const auto& mummySeq = getSequence(pActor->nSeqFile, MummySeq[nAction].nSeqId);
const auto& seqFrame = mummySeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
int nFrame = getSeqFrame(nSeq, pActor->nFrame);
int nFrameFlag = getSeqFrameFlags(nFrame);
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
playFrameSound(pActor, seqFrame);
bool bVal = false;
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= mummySeq.Size())
{
pActor->nFrame = 0;
@ -316,7 +314,7 @@ void AIMummy::Tick(RunListEvent* ev)
pActor->nAction = 1;
pActor->nFrame = 0;
}
else if (nFrameFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, pActor, 5);
}
@ -334,7 +332,7 @@ void AIMummy::Tick(RunListEvent* ev)
pActor->pTarget = nullptr;
return;
}
else if (nFrameFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
SetQuake(pActor, 100);

View file

@ -2178,13 +2178,9 @@ void DoDrips()
{
DExhumedActor* pActor = sDrip[i].pActor;
if (!pActor) continue;
int nSeqOffset = getSeqFromId(kSeqDrips);
if (!(pActor->sector()->Flag & kSectLava)) {
nSeqOffset++;
}
seq_MoveSequence(pActor, nSeqOffset, RandomSize(2) % getSeqFrameCount(nSeqOffset));
const auto& dripSeq = getSequence("drips", !(pActor->sector()->Flag & kSectLava));
playFrameSound(pActor, dripSeq[RandomSize(2) % dripSeq.Size()]);
sDrip[i].nCount = RandomSize(8) + 90;
}

View file

@ -1916,12 +1916,15 @@ static bool doPlayerDeathRestart(Player* const pPlayer)
static void doPlayerActionSequence(Player* const pPlayer)
{
const auto pPlayerActor = pPlayer->pActor;
const auto nSeq = getSeqFromId(pPlayer->nSeq, PlayerSeq[pPlayer->nAction].nSeqId);
seq_MoveSequence(pPlayerActor, nSeq, pPlayer->nSeqSize);
const auto& playerSeq = getSequence(pPlayerActor->nSeqFile, PlayerSeq[pPlayer->nAction].nSeqId);
const auto& seqFrame = playerSeq[pPlayer->nSeqSize];
const auto seqSize = playerSeq.Size();
playFrameSound(pPlayerActor, seqFrame);
pPlayer->nSeqSize++;
if (pPlayer->nSeqSize < getSeqFrameCount(nSeq))
if (pPlayer->nSeqSize < seqSize)
return;
pPlayer->nSeqSize = 0;
@ -1931,13 +1934,13 @@ static void doPlayerActionSequence(Player* const pPlayer)
default:
break;
case 3:
pPlayer->nSeqSize = getSeqFrameCount(nSeq) - 1;
pPlayer->nSeqSize = seqSize - 1;
break;
case 4:
pPlayer->nAction = 0;
break;
case 16:
pPlayer->nSeqSize = getSeqFrameCount(nSeq) - 1;
pPlayer->nSeqSize = seqSize - 1;
if (pPlayerActor->spr.pos.Z < pPlayerActor->sector()->floorz)
pPlayerActor->spr.pos.Z++;

View file

@ -55,7 +55,7 @@ struct Player
int16_t nDouble;
int16_t nInvisible;
int16_t nTorch;
int16_t nSeqSize;
uint16_t nSeqSize;
int16_t nAction;
int16_t bIsMummified;
int16_t invincibility;

View file

@ -73,7 +73,7 @@ struct Queen
TObjPtr<DExhumedActor*> pActor;
TObjPtr<DExhumedActor*> pTarget;
int16_t nHealth;
int16_t nFrame;
uint16_t nFrame;
int16_t nAction;
int16_t nAction2;
int16_t nIndex;
@ -86,7 +86,7 @@ struct Egg
TObjPtr<DExhumedActor*> pActor;
TObjPtr<DExhumedActor*> pTarget;
int16_t nHealth;
int16_t nFrame;
uint16_t nFrame;
int16_t nAction;
int16_t nRun;
int16_t nCounter;
@ -97,7 +97,7 @@ struct Head
TObjPtr<DExhumedActor*> pActor;
TObjPtr<DExhumedActor*> pTarget;
int16_t nHealth;
int16_t nFrame;
uint16_t nFrame;
int16_t nAction;
int16_t nRun;
int16_t nIndex;
@ -543,16 +543,17 @@ void AIQueenEgg::Tick(RunListEvent* ev)
Gravity(pActor);
}
int nSeq = getSeqFromId(kSeqQueenEgg, EggSeq[nAction].nSeqId);
const auto& eggSeq = getSequence(pActor->nSeqFile, EggSeq[nAction].nSeqId);
const auto& seqFrame = eggSeq[pEgg->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pEgg->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
if (nAction != 4)
{
seq_MoveSequence(pActor, nSeq, pEgg->nFrame);
playFrameSound(pActor, seqFrame);
pEgg->nFrame++;
if (pEgg->nFrame >= getSeqFrameCount(nSeq))
if (pEgg->nFrame >= eggSeq.Size())
{
pEgg->nFrame = 0;
bVal = true;
@ -801,14 +802,15 @@ void AIQueenHead::Tick(RunListEvent* ev)
Gravity(pActor);
}
int nSeq = getSeqFromId(kSeqQueen, HeadSeq[QueenHead.nAction].nSeqId);
const auto& queenSeq = getSequence(pActor->nSeqFile, HeadSeq[QueenHead.nAction].nSeqId);
const auto& seqFrame = queenSeq[QueenHead.nFrame];
seq_MoveSequence(pActor, nSeq, QueenHead.nFrame);
playFrameSound(pActor, seqFrame);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, QueenHead.nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
QueenHead.nFrame++;
if (QueenHead.nFrame >= getSeqFrameCount(nSeq))
if (QueenHead.nFrame >= queenSeq.Size())
{
QueenHead.nFrame = 0;
var_14 = 1;
@ -1233,21 +1235,20 @@ void AIQueen::Tick(RunListEvent* ev)
Gravity(pActor);
}
int nSeq = getSeqFromId(kSeqQueen, QueenSeq[nAction].nSeqId);
const auto& queenSeq = getSequence(pActor->nSeqFile, QueenSeq[nAction].nSeqId);
const auto& seqFrame = queenSeq[QueenList[nQueen].nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, QueenList[nQueen].nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
seq_MoveSequence(pActor, nSeq, QueenList[nQueen].nFrame);
playFrameSound(pActor, seqFrame);
QueenList[nQueen].nFrame++;
if (QueenList[nQueen].nFrame >= getSeqFrameCount(nSeq))
if (QueenList[nQueen].nFrame >= queenSeq.Size())
{
QueenList[nQueen].nFrame = 0;
bVal = true;
}
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, QueenList[nQueen].nFrame));
if (pActor != nullptr)
{
if (nAction < 7)
@ -1392,7 +1393,7 @@ void AIQueen::Tick(RunListEvent* ev)
}
else
{
if (nFlag & 0x80)
if (seqFrame.flags & 0x80)
{
QueenList[nQueen].nIndex2--;

View file

@ -210,21 +210,23 @@ void AIRa::Tick(RunListEvent* ev)
int nPlayer = RunData[ev->nRun].nObjIndex;
int nCurrentWeapon = PlayerList[nPlayer].nCurrentWeapon;
int nSeq = getSeqFromId(kSeqEyeHit, RaSeq[Ra[nPlayer].nAction].nSeqId);
DExhumedActor* pActor = Ra[nPlayer].pActor;
if (!pActor) return;
const auto& raSeq = getSequence(Ra[nPlayer].pActor->nSeqFile, RaSeq[Ra[nPlayer].nAction].nSeqId);
const auto& seqFrame = raSeq[Ra[nPlayer].nFrame];
bool bVal = false;
Ra[nPlayer].pTarget = PlayerList[nPlayer].pTarget;
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, Ra[nPlayer].nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
if (Ra[nPlayer].nAction)
{
seq_MoveSequence(pActor, nSeq, Ra[nPlayer].nFrame);
playFrameSound(pActor, seqFrame);
Ra[nPlayer].nFrame++;
if (Ra[nPlayer].nFrame >= getSeqFrameCount(nSeq))
if (Ra[nPlayer].nFrame >= raSeq.Size())
{
Ra[nPlayer].nFrame = 0;
bVal = true;

View file

@ -246,13 +246,15 @@ void AIRat::Tick(RunListEvent* ev)
bool bVal = false;
int nSeq = getSeqFromId(kSeqRat, RatSeq[nAction].nSeqId);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
const auto& ratSeq = getSequence(pActor->nSeqFile, RatSeq[nAction].nSeqId);
const auto& seqFrame = ratSeq[pActor->nFrame];
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= ratSeq.Size())
{
bVal = true;
pActor->nFrame = 0;

View file

@ -192,9 +192,10 @@ void AIRex::Tick(RunListEvent* ev)
Gravity(pActor);
int nSeq = getSeqFromId(kSeqRex, RexSeq[nAction].nSeqId);
const auto& rexSeq = getSequence(pActor->nSeqFile, RexSeq[nAction].nSeqId);
const auto& seqFrame = rexSeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
int ecx = 2;
@ -205,18 +206,16 @@ void AIRex::Tick(RunListEvent* ev)
// moves the mouth open and closed as it's idle?
while (--ecx != -1)
{
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= rexSeq.Size())
{
pActor->nFrame = 0;
bVal = true;
}
}
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame));
DExhumedActor* pTarget = pActor->pTarget;
switch (nAction)
@ -405,7 +404,7 @@ void AIRex::Tick(RunListEvent* ev)
{
if (PlotCourseToSprite(pActor, pTarget) < 48)
{
if (nFlag & 0x80)
if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, pActor, 15);
}

View file

@ -212,19 +212,19 @@ void AIRoach::Tick(RunListEvent* ev)
Gravity(pActor);
int nSeq = getSeqFromId(kSeqRoach, RoachSeq[nAction].nSeqId);
const auto& roachSeq = getSequence(pActor->nSeqFile, RoachSeq[nAction].nSeqId);
const auto& seqFrame = roachSeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= roachSeq.Size())
{
bVal = true;
pActor->nFrame = 0;
}
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame));
DExhumedActor* pTarget = pActor->pTarget;
if (nAction > 5) {
@ -364,7 +364,7 @@ void AIRoach::Tick(RunListEvent* ev)
}
else
{
if (nFlag & 0x80)
if (seqFrame.flags & 0x80)
{
BuildBullet(pActor, 13, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
}

View file

@ -207,20 +207,20 @@ void AIScorp::Tick(RunListEvent* ev)
Gravity(pActor);
}
int nSeq = getSeqFromId(kSeqScorp, ScorpSeq[nAction].nSeqId);
const auto& scorpSeq = getSequence(pActor->nSeqFile, ScorpSeq[nAction].nSeqId);
const auto& seqFrame = scorpSeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= scorpSeq.Size())
{
pActor->nFrame = 0;
bVal = true;
}
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame));
pTarget = pActor->pTarget;
switch (nAction)
@ -313,7 +313,7 @@ void AIScorp::Tick(RunListEvent* ev)
{
pActor->nAction = 1;
}
else if (nFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, pActor, 7);
}
@ -338,7 +338,7 @@ void AIScorp::Tick(RunListEvent* ev)
}
}
if (!(nFlag & 0x80)) {
if (!(seqFrame.flags & 0x80)) {
return;
}

View file

@ -144,7 +144,7 @@ void AISoul::Tick(RunListEvent* ev)
auto pActor = ev->pObjActor;
if (!pActor) return;
seq_MoveSequence(pActor, getSeqFromId(kSeqSet, 75), 0);
playFrameSound(pActor, getSequence("set", 75)[0]);
if (pActor->spr.scale.X < 0.5)
{
@ -270,9 +270,11 @@ void AISet::Tick(RunListEvent* ev)
Gravity(pActor);
int nSeq = getSeqFromId(kSeqSet, SetSeq[nAction].nSeqId);
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
const auto& setSeq = getSequence(pActor->nSeqFile, SetSeq[nAction].nSeqId);
const auto& seqFrame = setSeq[pActor->nFrame];
pActor->spr.picnum = seqFrame.chunks[0].picnum;
playFrameSound(pActor, seqFrame);
if (nAction == 3)
{
@ -282,13 +284,12 @@ void AISet::Tick(RunListEvent* ev)
}
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= setSeq.Size())
{
pActor->nFrame = 0;
bVal = true;
}
int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame));
DExhumedActor* pTarget = pActor->pTarget;
if (pTarget && nAction < 10)
@ -378,7 +379,7 @@ void AISet::Tick(RunListEvent* ev)
{
if (pTarget != nullptr)
{
if ((nFlag & 0x10) && (nMov.exbits & kHitAux2))
if ((seqFrame.flags & 0x10) && (nMov.exbits & kHitAux2))
{
SetQuake(pActor, 100);
}
@ -506,7 +507,7 @@ void AISet::Tick(RunListEvent* ev)
{
pActor->nAction = 3;
}
else if (nFlag & 0x80)
else if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, pActor, 5);
}
@ -527,7 +528,7 @@ void AISet::Tick(RunListEvent* ev)
case 6:
{
if (nFlag & 0x80)
if (seqFrame.flags & 0x80)
{
auto pBullet = BuildBullet(pActor, 11, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1);
if (pBullet)
@ -568,7 +569,7 @@ void AISet::Tick(RunListEvent* ev)
{
if (bVal)
{
pActor->nFrame = getSeqFrameCount(nSeq) - 1;
pActor->nFrame = setSeq.Size() - 1;
}
if (nMov.exbits & kHitAux2)
@ -604,7 +605,7 @@ void AISet::Tick(RunListEvent* ev)
case 10:
{
if (nFlag & 0x80)
if (seqFrame.flags & 0x80)
{
pActor->spr.pos.Z -= GetActorHeight(pActor);
BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqSet, 76, 0));

View file

@ -339,7 +339,7 @@ void AISnake::Tick(RunListEvent* ev)
DExhumedActor* pActor = SnakeList[nSnake].pSprites[0];
if (!pActor) return;
seq_MoveSequence(pActor, getSeqFromId(kSeqSnakehed), 0);
playFrameSound(pActor, getSequence("snakehed")[0]);
DExhumedActor* pEnemySprite = SnakeList[nSnake].pEnemy;

View file

@ -718,8 +718,9 @@ void UpdateCreepySounds()
{
if (nCreaturesKilled < nCreaturesTotal && !(PlayerList[nLocalPlayer].pPlayerViewSect->Flag & 0x2000))
{
int vsi = seq_GetFrameSound(getSeqFromId(kSeqCreepy), totalmoves % getSeqFrameCount(getSeqFromId(kSeqCreepy)));
if (vsi >= 0 && (vsi & 0x1ff) < kMaxSounds)
const auto& creepySeq = getSequence("creepy");
const auto seqFrameSound = creepySeq[totalmoves % creepySeq.Size()].sound;
if (seqFrameSound >= 0 && (seqFrameSound & 0x1ff) < kMaxSounds)
{
DVector2 adder;
adder.X = ((totalmoves + 32) & 31) / 16.;
@ -732,7 +733,7 @@ void UpdateCreepySounds()
auto sp = PlayerList[nLocalPlayer].pActor->spr.pos + adder;
creepy = GetSoundPos(sp);
auto soundid = FSoundID::fromInt((vsi & 0x1ff) + 1);
auto soundid = FSoundID::fromInt((seqFrameSound & 0x1ff) + 1);
if (!soundEngine->isValidSoundId(soundid))
{
@ -740,8 +741,7 @@ void UpdateCreepySounds()
}
int nVolume = 255;
int v10 = (vsi & 0xe00) >> 9;
vsi &= 0x1ff;
int v10 = (seqFrameSound & 0xe00) >> 9;
int nPitch = 0;
if (v10) nPitch = -(totalmoves & ((1 << v10) - 1)) * 16;

View file

@ -119,16 +119,15 @@ void AISpider::Tick(RunListEvent* ev)
}
}
int nSeq = getSeqFromId(kSeqSpider, SpiderSeq[nAction].nSeqId);
const auto& spiderSeq = getSequence(spp->nSeqFile, SpiderSeq[nAction].nSeqId);
const auto& seqFrame = spiderSeq[spp->nFrame];
spp->spr.picnum = seq_GetSeqPicnum2(nSeq, spp->nFrame);
spp->spr.picnum = seqFrame.chunks[0].picnum;
seq_MoveSequence(spp, nSeq, spp->nFrame);
int nFrameFlag = getSeqFrameFlags(getSeqFrame(nSeq, spp->nFrame));
playFrameSound(spp, seqFrame);
spp->nFrame++;
if (spp->nFrame >= getSeqFrameCount(nSeq)) {
if (spp->nFrame >= spiderSeq.Size()) {
spp->nFrame = 0;
}
@ -253,7 +252,7 @@ void AISpider::Tick(RunListEvent* ev)
{
if (pTarget)
{
if (nFrameFlag & 0x80)
if (seqFrame.flags & 0x80)
{
runlist_DamageEnemy(pTarget, spp, 3);
D3PlayFX(StaticSound[kSound38], spp);

View file

@ -215,14 +215,15 @@ void AIWasp::Tick(RunListEvent* ev)
bool bVal = false;
int nSeq = getSeqFromId(kSeqWasp, WaspSeq[nAction].nSeqId);
const auto& waspSeq = getSequence(pActor->nSeqFile, WaspSeq[nAction].nSeqId);
const auto& seqFrame = waspSeq[pActor->nFrame];
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
pActor->spr.picnum = seqFrame.chunks[0].picnum;
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
playFrameSound(pActor, seqFrame);
pActor->nFrame++;
if (pActor->nFrame >= getSeqFrameCount(nSeq))
if (pActor->nFrame >= waspSeq.Size())
{
pActor->nFrame = 0;
bVal = true;