- second batch of Exhumed's s().

This commit is contained in:
Christoph Oelckers 2021-12-23 17:26:44 +01:00
parent 6f0e7e3784
commit cd6bb5305e
11 changed files with 94 additions and 107 deletions

View file

@ -136,42 +136,41 @@ void AIAnim::Tick(RunListEvent* ev)
if (pIgniter)
{
auto pSpriteB = &pIgniter->s();
pActor->spr.pos.X = pSpriteB->pos.X;
pActor->spr.pos.Y = pSpriteB->pos.Y;
pActor->spr.pos.Z = pSpriteB->pos.Z;
pActor->spr.pos.X = pIgniter->spr.pos.X;
pActor->spr.pos.Y = pIgniter->spr.pos.Y;
pActor->spr.pos.Z = pIgniter->spr.pos.Z;
if (pSpriteB->sector() != pActor->spr.sector())
if (pIgniter->spr.sector() != pActor->spr.sector())
{
if (!pSpriteB->sector())
if (!pIgniter->spr.sector())
{
DestroyAnim(pActor);
return;
}
else
{
ChangeActorSect(pActor, pSpriteB->sector());
ChangeActorSect(pActor, pIgniter->spr.sector());
}
}
if (!nIndex)
{
if (pSpriteB->cstat != CSTAT_SPRITE_INVISIBLE)
if (pIgniter->spr.cstat != CSTAT_SPRITE_INVISIBLE)
{
int hitag2 = pSpriteB->hitag;
pSpriteB->hitag--;
int hitag2 = pIgniter->spr.hitag;
pIgniter->spr.hitag--;
if (hitag2 >= 15)
{
runlist_DamageEnemy(pIgniter, nullptr, (pSpriteB->hitag - 14) * 2);
runlist_DamageEnemy(pIgniter, nullptr, (pIgniter->spr.hitag - 14) * 2);
if (pSpriteB->shade < 100)
if (pIgniter->spr.shade < 100)
{
pSpriteB->pal = 0;
pSpriteB->shade++;
pIgniter->spr.pal = 0;
pIgniter->spr.shade++;
}
if (!(pSpriteB->cstat & CSTAT_SPRITE_BLOCK_ALL)) // was 101 (decimal), GDX had 0x101 which appears to be correct.
if (!(pIgniter->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) // was 101 (decimal), GDX had 0x101 which appears to be correct.
{
DestroyAnim(pActor);
return;
@ -179,13 +178,13 @@ void AIAnim::Tick(RunListEvent* ev)
}
else
{
pSpriteB->hitag = 1;
pIgniter->spr.hitag = 1;
DestroyAnim(pActor);
}
}
else
{
pSpriteB->hitag = 1;
pIgniter->spr.hitag = 1;
DestroyAnim(pActor);
}
}

View file

@ -384,9 +384,9 @@ void AIAnubis::Damage(RunListEvent* ev)
if (ev->pOtherActor == nullptr) {
return;
}
auto pTarget = &ev->pOtherActor->s();
auto statnum = ev->pOtherActor->spr.statnum;
if (pTarget->statnum == 100 || pTarget->statnum < 199)
if (statnum == 100 || statnum < 199)
{
if (!RandomSize(5)) {
ap->pTarget = ev->pOtherActor;
@ -398,14 +398,13 @@ void AIAnubis::Damage(RunListEvent* ev)
if (nAction >= 6 && nAction <= 10)
{
auto pDrumActor = insertActor(ap->spr.sector(), kStatAnubisDrum);
auto pDrumSprite = &pDrumActor->s();
pDrumSprite->pos.X = ap->spr.pos.X;
pDrumSprite->pos.Y = ap->spr.pos.Y;
pDrumSprite->pos.Z = pDrumSprite->sector()->floorz;
pDrumSprite->xrepeat = 40;
pDrumSprite->yrepeat = 40;
pDrumSprite->shade = -64;
pDrumActor->spr.pos.X = ap->spr.pos.X;
pDrumActor->spr.pos.Y = ap->spr.pos.Y;
pDrumActor->spr.pos.Z = pDrumActor->spr.sector()->floorz;
pDrumActor->spr.xrepeat = 40;
pDrumActor->spr.yrepeat = 40;
pDrumActor->spr.shade = -64;
BuildObject(pDrumActor, 2, 0);
}

View file

@ -207,9 +207,8 @@ void DoRedAlert(int nVal)
{
if (nVal)
{
auto spri = &ac->s();
PlayFXAtXYZ(StaticSound[kSoundAlarm], spri->pos.X, spri->pos.Y, spri->pos.Z);
AddFlash(spri->sector(), spri->pos.X, spri->pos.Y, spri->pos.Z, 192);
PlayFXAtXYZ(StaticSound[kSoundAlarm], ac->spr.pos.X, ac->spr.pos.Y, ac->spr.pos.Z);
AddFlash(ac->spr.sector(), ac->spr.pos.X, ac->spr.pos.Y, ac->spr.pos.Z, 192);
}
}
}

View file

@ -43,36 +43,35 @@ static actionSeq FishSeq[] = {
void BuildFishLimb(DExhumedActor* pActor, int anim)
{
auto pChunkActor = insertActor(pActor->spr.sector(), 99);
auto pSprite2 = &pChunkActor->s();
pChunkActor->nCount = anim + 40;
pChunkActor->nFrame = RandomSize(3) % SeqSize[SeqOffsets[kSeqFish] + anim + 40];
pSprite2->pos.X = pActor->spr.pos.X;
pSprite2->pos.Y = pActor->spr.pos.Y;
pSprite2->pos.Z = pActor->spr.pos.Z;
pSprite2->cstat = 0;
pSprite2->shade = -12;
pSprite2->pal = 0;
pSprite2->xvel = (RandomSize(5) - 16) << 8;
pSprite2->yvel = (RandomSize(5) - 16) << 8;
pSprite2->xrepeat = 64;
pSprite2->yrepeat = 64;
pSprite2->xoffset = 0;
pSprite2->yoffset = 0;
pSprite2->zvel = (-(RandomByte() + 512)) * 2;
pChunkActor->spr.pos.X = pActor->spr.pos.X;
pChunkActor->spr.pos.Y = pActor->spr.pos.Y;
pChunkActor->spr.pos.Z = pActor->spr.pos.Z;
pChunkActor->spr.cstat = 0;
pChunkActor->spr.shade = -12;
pChunkActor->spr.pal = 0;
pChunkActor->spr.xvel = (RandomSize(5) - 16) << 8;
pChunkActor->spr.yvel = (RandomSize(5) - 16) << 8;
pChunkActor->spr.xrepeat = 64;
pChunkActor->spr.yrepeat = 64;
pChunkActor->spr.xoffset = 0;
pChunkActor->spr.yoffset = 0;
pChunkActor->spr.zvel = (-(RandomByte() + 512)) * 2;
seq_GetSeqPicnum(kSeqFish, pChunkActor->nCount, 0);
pSprite2->picnum = anim;
pSprite2->lotag = runlist_HeadRun() + 1;
pSprite2->clipdist = 0;
pChunkActor->spr.picnum = anim;
pChunkActor->spr.lotag = runlist_HeadRun() + 1;
pChunkActor->spr.clipdist = 0;
// GrabTimeSlot(3);
pSprite2->extra = -1;
pSprite2->owner = runlist_AddRunRec(pSprite2->lotag - 1, pChunkActor, 0x200000);
pSprite2->hitag = runlist_AddRunRec(NewRun, pChunkActor, 0x200000);
pChunkActor->spr.extra = -1;
pChunkActor->spr.owner = runlist_AddRunRec(pChunkActor->spr.lotag - 1, pChunkActor, 0x200000);
pChunkActor->spr.hitag = runlist_AddRunRec(NewRun, pChunkActor, 0x200000);
}
void BuildBlood(int x, int y, int z, sectortype* pSector)
@ -463,11 +462,11 @@ void AIFish::Tick(RunListEvent* ev)
else if (coll.type == kHitSprite)
{
auto pHitSpr = &coll.actor()->s();
if (pHitSpr->statnum == 100)
auto pHitAct = coll.actor();
if (pHitAct->spr.statnum == 100)
{
pActor->pTarget = coll.actor();
pActor->spr.ang = GetMyAngle(pHitSpr->pos.X - pActor->spr.pos.X, pHitSpr->pos.Y - pActor->spr.pos.Y);
pActor->spr.ang = GetMyAngle(pHitAct->spr.pos.X - pActor->spr.pos.X, pHitAct->spr.pos.Y - pActor->spr.pos.Y);
if (nAction != 3)
{

View file

@ -40,31 +40,30 @@ static actionSeq LavadudeSeq[] = {
DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, int ebx)
{
auto pLimbActor = insertActor(pActor->spr.sector(), 118);
auto pLimbSprite = &pLimbActor->s();
pLimbSprite->pos.X = pActor->spr.pos.X;
pLimbSprite->pos.Y = pActor->spr.pos.Y;
pLimbSprite->pos.Z = pActor->spr.pos.Z - RandomLong() % ebx;
pLimbSprite->cstat = 0;
pLimbSprite->shade = -127;
pLimbSprite->pal = 1;
pLimbSprite->xvel = (RandomSize(5) - 16) << 8;
pLimbSprite->yvel = (RandomSize(5) - 16) << 8;
pLimbSprite->zvel = 2560 - (RandomSize(5) << 8);
pLimbSprite->xoffset = 0;
pLimbSprite->yoffset = 0;
pLimbSprite->xrepeat = 90;
pLimbSprite->yrepeat = 90;
pLimbSprite->picnum = (move & 3) % 3;
pLimbSprite->hitag = 0;
pLimbSprite->lotag = runlist_HeadRun() + 1;
pLimbSprite->clipdist = 0;
pLimbActor->spr.pos.X = pActor->spr.pos.X;
pLimbActor->spr.pos.Y = pActor->spr.pos.Y;
pLimbActor->spr.pos.Z = pActor->spr.pos.Z - RandomLong() % ebx;
pLimbActor->spr.cstat = 0;
pLimbActor->spr.shade = -127;
pLimbActor->spr.pal = 1;
pLimbActor->spr.xvel = (RandomSize(5) - 16) << 8;
pLimbActor->spr.yvel = (RandomSize(5) - 16) << 8;
pLimbActor->spr.zvel = 2560 - (RandomSize(5) << 8);
pLimbActor->spr.xoffset = 0;
pLimbActor->spr.yoffset = 0;
pLimbActor->spr.xrepeat = 90;
pLimbActor->spr.yrepeat = 90;
pLimbActor->spr.picnum = (move & 3) % 3;
pLimbActor->spr.hitag = 0;
pLimbActor->spr.lotag = runlist_HeadRun() + 1;
pLimbActor->spr.clipdist = 0;
// GrabTimeSlot(3);
pLimbSprite->extra = -1;
pLimbSprite->owner = runlist_AddRunRec(pLimbSprite->lotag - 1, pLimbActor, 0x160000);
pLimbSprite->hitag = runlist_AddRunRec(NewRun, pLimbActor, 0x160000);
pLimbActor->spr.extra = -1;
pLimbActor->spr.owner = runlist_AddRunRec(pLimbActor->spr.lotag - 1, pLimbActor, 0x160000);
pLimbActor->spr.hitag = runlist_AddRunRec(NewRun, pLimbActor, 0x160000);
return pLimbActor;
}

View file

@ -49,10 +49,9 @@ void DrawMap(double const smoothratio)
if (!nFreeze && automapMode != am_off)
{
auto pPlayerActor = PlayerList[nLocalPlayer].Actor();
auto psp = &pPlayerActor->s();
int x = psp->interpolatedx(smoothratio);
int y = psp->interpolatedy(smoothratio);
int x = pPlayerActor->spr.interpolatedx(smoothratio);
int y = pPlayerActor->spr.interpolatedy(smoothratio);
int ang = (!SyncInput() ? PlayerList[nLocalPlayer].angle.sum() : PlayerList[nLocalPlayer].angle.interpolatedsum(smoothratio)).asbuild();
DrawOverheadMap(x, y, ang, smoothratio);
}

View file

@ -99,17 +99,15 @@ void CheckMummyRevive(DExhumedActor* pActor)
if (pOther->nAction != 5) {
continue;
}
auto pSprite2 = &pOther->s();
int x = abs(pSprite2->pos.X - pActor->spr.pos.X) >> 8;
int y = abs(pSprite2->pos.Y - pActor->spr.pos.Y) >> 8;
int x = abs(pOther->spr.pos.X - pActor->spr.pos.X) >> 8;
int y = abs(pOther->spr.pos.Y - pActor->spr.pos.Y) >> 8;
if (x <= 20 && y <= 20)
{
if (cansee(pActor->spr.pos.X, pActor->spr.pos.Y, pActor->spr.pos.Z - 8192, pActor->spr.sector(),
pSprite2->pos.X, pSprite2->pos.Y, pSprite2->pos.Z - 8192, pSprite2->sector()))
pOther->spr.pos.X, pOther->spr.pos.Y, pOther->spr.pos.Z - 8192, pOther->spr.sector()))
{
pSprite2->cstat = 0;
pOther->spr.cstat = 0;
pOther->nAction = 6;
pOther->nFrame = 0;
}

View file

@ -86,9 +86,8 @@ void FreeRa(int nPlayer)
void BuildRa(int nPlayer)
{
auto pPlayerActor = PlayerList[nPlayer].Actor();
auto pPlayerSprite = &pPlayerActor->s();
auto pActor = insertActor(pPlayerSprite->sector(), 203);
auto pActor = insertActor(pPlayerActor->spr.sector(), 203);
pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE;
pActor->spr.xvel = 0;
@ -101,7 +100,7 @@ void BuildRa(int nPlayer)
pActor->spr.pal = 1;
pActor->spr.xrepeat = 64;
pActor->spr.yrepeat = 64;
pActor->spr.pos = pPlayerSprite->pos;
pActor->spr.pos = pPlayerActor->spr.pos;
// GrabTimeSlot(3);

View file

@ -137,8 +137,7 @@ DExhumedActor* FindFood(DExhumedActor* pActor)
DExhumedActor* pActor2 = nChunkSprite[RandomSize(7) % nChunkTotal];
if (pActor2 != nullptr)
{
auto pSprite2 = &pActor2->s();
if (cansee(x, y, z2, pSector, pSprite2->pos.X, pSprite2->pos.Y, pSprite2->pos.Z, pSprite2->sector())) {
if (cansee(x, y, z2, pSector, pActor2->spr.pos.X, pActor2->spr.pos.Y, pActor2->spr.pos.Z, pActor2->spr.sector())) {
return pActor2;
}
}
@ -151,10 +150,9 @@ DExhumedActor* FindFood(DExhumedActor* pActor)
DExhumedActor* pActor2 = nBodySprite[RandomSize(7) % nBodyTotal];
if (pActor2 != nullptr)
{
auto pSprite2 = &pActor2->s();
if (nPlayerPic == pSprite2->picnum)
if (nPlayerPic == pActor2->spr.picnum)
{
if (cansee(x, y, z, pSector, pSprite2->pos.X, pSprite2->pos.Y, pSprite2->pos.Z, pSprite2->sector())) {
if (cansee(x, y, z, pSector, pActor2->spr.pos.X, pActor2->spr.pos.Y, pActor2->spr.pos.Z, pActor2->spr.sector())) {
return pActor2;
}
}

View file

@ -336,9 +336,9 @@ void AIRex::Tick(RunListEvent* ev)
pActor->nAction = 3;
pActor->nFrame = 0;
auto pSprite2 = &nMov.actor()->s();
auto pHitActor = nMov.actor();
if (pSprite2->statnum && pSprite2->statnum < 107)
if (pHitActor->spr.statnum && pHitActor->spr.statnum < 107)
{
int nAngle = pActor->spr.ang;
@ -347,18 +347,18 @@ void AIRex::Tick(RunListEvent* ev)
int xVel = bcos(nAngle) * 15;
int yVel = bsin(nAngle) * 15;
if (pSprite2->statnum == 100)
if (pHitActor->spr.statnum == 100)
{
auto nPlayer = GetPlayerFromActor(nMov.actor());
PlayerList[nPlayer].nXDamage += (xVel << 4);
PlayerList[nPlayer].nYDamage += (yVel << 4);
pSprite2->zvel = -3584;
pHitActor->spr.zvel = -3584;
}
else
{
pSprite2->xvel += (xVel >> 3);
pSprite2->yvel += (yVel >> 3);
pSprite2->zvel = -2880;
pHitActor->spr.xvel += (xVel >> 3);
pHitActor->spr.yvel += (yVel >> 3);
pHitActor->spr.zvel = -2880;
}
}

View file

@ -1588,8 +1588,6 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag)
int runlist_CheckRadialDamage(DExhumedActor* pActor)
{
auto pRadialSpr = &pRadialActor->s();
if (pActor == pRadialActor) {
return 0;
}
@ -1598,7 +1596,7 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
return 0;
}
if (pActor->spr.statnum >= kMaxStatus || pRadialSpr->statnum >= kMaxStatus) {
if (pActor->spr.statnum >= kMaxStatus || pRadialActor->spr.statnum >= kMaxStatus) {
return 0;
}
@ -1606,9 +1604,9 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
return 0;
}
int x = (pActor->spr.pos.X - pRadialSpr->pos.X) >> 8;
int y = (pActor->spr.pos.Y - pRadialSpr->pos.Y) >> 8;
int z = (pActor->spr.pos.Z - pRadialSpr->pos.Z) >> 12;
int x = (pActor->spr.pos.X - pRadialActor->spr.pos.X) >> 8;
int y = (pActor->spr.pos.Y - pRadialActor->spr.pos.Y) >> 8;
int z = (pActor->spr.pos.Z - pRadialActor->spr.pos.Z) >> 12;
if (abs(x) > nDamageRadius) {
return 0;
@ -1643,10 +1641,10 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
if (((kStatExplodeTarget - pActor->spr.statnum) <= 1) ||
cansee(pRadialSpr->pos.X,
pRadialSpr->pos.Y,
pRadialSpr->pos.Z - 512,
pRadialSpr->sector(),
cansee(pRadialActor->spr.pos.X,
pRadialActor->spr.pos.Y,
pRadialActor->spr.pos.Z - 512,
pRadialActor->spr.sector(),
pActor->spr.pos.X,
pActor->spr.pos.Y,
pActor->spr.pos.Z - 8192,