diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 4eaefe544..2e6cbc4e3 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -2675,7 +2675,7 @@ void actInit(bool bSaveLoad) { spritetype* pSprite = &sprite[nSprite]; XSPRITE *pXSprite = &xsprite[pSprite->extra]; int nType = pSprite->type - kThingBase; - pXSprite->health = thingInfo[nType].health << 4; + pXSprite->health = thingInfo[nType].startHealth << 4; pSprite->clipdist = thingInfo[nType].clipdist; pSprite->flags = thingInfo[nType].flags; if (pSprite->flags & kPhysGravity) pSprite->flags |= kPhysFalling; @@ -3213,8 +3213,8 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType, } for (int p = connecthead; p >= 0; p = connectpoint2[p]) { - if (gPlayer[p].at2ee == pSprite->index && gPlayer[p].at1fe > 0) - gPlayer[p].at2ee = -1; + if (gPlayer[p].fraggerId == pSprite->index && gPlayer[p].deathTime > 0) + gPlayer[p].fraggerId = -1; } if (pSprite->type != kDudeCultistBeast) trTriggerSprite(pSprite->index, pXSprite, kCmdOff); @@ -3224,7 +3224,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType, if (IsPlayerSprite(pKillerSprite)) { PLAYER *pPlayer = &gPlayer[pKillerSprite->type - kDudePlayer1]; if (gGameOptions.nGameType == 1) - pPlayer->at2c6++; + pPlayer->fragCount++; } } else if (gGameOptions.nGameType == 1 && IsPlayerSprite(pKillerSprite) && pSprite->statnum == kStatDude) { switch (pSprite->type) { @@ -3235,7 +3235,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType, break; default: PLAYER* pKillerPlayer = &gPlayer[pKillerSprite->type - kDudePlayer1]; - pKillerPlayer->at2c6++; + pKillerPlayer->fragCount++; break; } @@ -3709,7 +3709,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in break; case kStatThing: dassert(pSprite->type >= kThingBase && pSprite->type < kThingMax); - int nType = pSprite->type - kThingBase; int nDamageFactor = thingInfo[nType].at17[damageType]; + int nType = pSprite->type - kThingBase; int nDamageFactor = thingInfo[nType].dmgControl[damageType]; if (!nDamageFactor) return 0; else if (nDamageFactor != 256) @@ -3741,9 +3741,9 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in case kThingBloodBits: case kThingBloodChunks: case kThingZombieHead: - if (damageType == 3 && pSourcePlayer && gFrameClock > pSourcePlayer->at312 && Chance(0x4000)) { + if (damageType == 3 && pSourcePlayer && gFrameClock > pSourcePlayer->laughCount && Chance(0x4000)) { sfxPlay3DSound(pSourcePlayer->pSprite, gPlayerGibThingComments[Random(10)], 0, 2); - pSourcePlayer->at312 = (int)gFrameClock+3600; + pSourcePlayer->laughCount = (int)gFrameClock+3600; } break; case kTrapMachinegun: @@ -3876,7 +3876,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) DAMAGE_TYPE rand1 = (DAMAGE_TYPE)Random(7); int rand2 = (7 + Random(7)) << 4; int nDamage = actDamageSprite(nOwner, pSpriteHit, rand1, rand2); - if ((pThingInfo && pThingInfo->at17[DAMAGE_TYPE_1] != 0) || (pDudeInfo && pDudeInfo->at70[DAMAGE_TYPE_1] != 0)) + if ((pThingInfo && pThingInfo->dmgControl[DAMAGE_TYPE_1] != 0) || (pDudeInfo && pDudeInfo->at70[DAMAGE_TYPE_1] != 0)) actBurnSprite(pMissile->owner, pXSpriteHit, 360); // by NoOne: make Life Leech heal user, just like it was in 1.0x versions @@ -3968,7 +3968,7 @@ void actImpactMissile(spritetype *pMissile, int hitCode) sfxKill3DSound(pMissile, -1, -1); if ((hitCode == 3 && pSpriteHit) && (pThingInfo || pDudeInfo)) { int nOwner = actSpriteOwnerToSpriteId(pMissile); - if ((pThingInfo && pThingInfo->at17[DAMAGE_TYPE_1] != 0) || (pDudeInfo && pDudeInfo->at70[DAMAGE_TYPE_1] != 0)) { + if ((pThingInfo && pThingInfo->dmgControl[DAMAGE_TYPE_1] != 0) || (pDudeInfo && pDudeInfo->at70[DAMAGE_TYPE_1] != 0)) { if (pThingInfo && pSpriteHit->type == kThingTNTBarrel && pXSpriteHit->burnTime == 0) evPost(nSpriteHit, 3, 0, kCallbackFXFlameLick); @@ -4241,7 +4241,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite) } } - if (!IsPlayerSprite(pSprite) || gPlayer[pSprite->type - kDudePlayer1].at31a == 0) { + if (!IsPlayerSprite(pSprite) || gPlayer[pSprite->type - kDudePlayer1].godMode == 0) { switch (pSprite2->type) { case kDudeTchernobog: actDamageSprite(pSprite2->index, pSprite, DAMAGE_TYPE_3, pXSprite->health << 2); @@ -4407,8 +4407,8 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite) switch (pSprite2->type) { case kThingKickablePail: if (pPlayer) { - if (pPlayer->at30e > gFrameClock) return; - pPlayer->at30e = (int)gFrameClock+60; + if (pPlayer->kickPower > gFrameClock) return; + pPlayer->kickPower = (int)gFrameClock+60; } actKickObject(pSprite, pSprite2); sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum); @@ -4416,8 +4416,8 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite) break; case kThingZombieHead: if (pPlayer) { - if (pPlayer->at30e > gFrameClock) return; - pPlayer->at30e = (int)gFrameClock+60; + if (pPlayer->kickPower > gFrameClock) return; + pPlayer->kickPower = (int)gFrameClock+60; } actKickObject(pSprite, pSprite2); sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum); @@ -4555,7 +4555,7 @@ int MoveThing(spritetype *pSprite) } if ((gSpriteHit[nXSprite].hit&0xc000) == 0x8000) { int nHitWall = gSpriteHit[nXSprite].hit&0x3fff; - actWallBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], nHitWall, pThingInfo->at7); + actWallBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], nHitWall, pThingInfo->elastic); switch (pSprite->type) { case kThingZombieHead: sfxPlay3DSound(pSprite, 607, 0, 0); @@ -4614,8 +4614,8 @@ int MoveThing(spritetype *pSprite) { pSprite->flags |= 4; - int vax = actFloorBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], (int*)&v20, pSprite->sectnum, pThingInfo->at7); - int nDamage = mulscale(vax, vax, 30)-pThingInfo->atb; + int vax = actFloorBounceVector((int*)&xvel[nSprite], (int*)&yvel[nSprite], (int*)&v20, pSprite->sectnum, pThingInfo->elastic); + int nDamage = mulscale(vax, vax, 30)-pThingInfo->dmgResist; if (nDamage > 0) actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_0, nDamage); zvel[nSprite] = v20; @@ -4902,9 +4902,9 @@ void MoveDude(spritetype *pSprite) zvel[nSprite] += vc; } } - if (pPlayer && zvel[nSprite] > 0x155555 && !pPlayer->at31b && pXSprite->height > 0) + if (pPlayer && zvel[nSprite] > 0x155555 && !pPlayer->fallScream && pXSprite->height > 0) { - pPlayer->at31b = 1; + pPlayer->fallScream = 1; sfxPlay3DSound(pSprite, 719, 0, 0); } vec3_t const oldpos = pSprite->pos; @@ -4932,11 +4932,11 @@ void MoveDude(spritetype *pSprite) case kMarkerLowGoo: pXSprite->medium = kMediumNormal; if (pPlayer) { - pPlayer->at2f = 0; - pPlayer->at302 = 0; - if (!pPlayer->at31c && pPlayer->atc.buttonFlags.jump) { + pPlayer->posture = 0; + pPlayer->bubbleTime = 0; + if (!pPlayer->canJump && pPlayer->input.buttonFlags.jump) { zvel[nSprite] = -0x6aaaa; - pPlayer->at31c = 1; + pPlayer->canJump = 1; } sfxPlay3DSound(pSprite, 721, -1, 0); } else { @@ -4969,9 +4969,9 @@ void MoveDude(spritetype *pSprite) if (nXUpper >= 0) pPlayer->nWaterPal = xsprite[nXUpper].data2; - pPlayer->at2f = 1; + pPlayer->posture = 1; pXSprite->burnTime = 0; - pPlayer->at302 = klabs(zvel[nSprite]) >> 12; + pPlayer->bubbleTime = klabs(zvel[nSprite]) >> 12; evPost(nSprite, 3, 0, kCallbackPlayerBubble); sfxPlay3DSound(pSprite, 720, -1, 0); } @@ -5050,7 +5050,7 @@ void MoveDude(spritetype *pSprite) { pPlayer->changeTargetKin = 1; pXSprite->burnTime = 0; - pPlayer->at302 = klabs(zvel[nSprite])>>12; + pPlayer->bubbleTime = klabs(zvel[nSprite])>>12; evPost(nSprite, 3, 0, kCallbackPlayerBubble); sfxPlay3DSound(pSprite, 720, -1, 0); } @@ -5140,7 +5140,7 @@ void MoveDude(spritetype *pSprite) int nDamage = mulscale(vax, vax, 30); if (pPlayer) { - pPlayer->at31b = 0; + pPlayer->fallScream = 0; if (nDamage > (15<<4) && (pSprite->flags&4)) playerLandingSound(pPlayer); @@ -5274,7 +5274,7 @@ int MoveMissile(spritetype *pSprite) { int nTargetAngle = getangle(-(pTarget->y-pSprite->y), pTarget->x-pSprite->x); int UNUSED(nAngle) = getangle(xvel[nSprite]>>12,yvel[nSprite]>>12); - int vx = missileInfo[pSprite->type - kMissileBase].at2; + int vx = missileInfo[pSprite->type - kMissileBase].velocity; int vy = 0; RotatePoint(&vx, &vy, (nTargetAngle+1536)&2047, 0, 0); xvel[nSprite] = vx; @@ -5471,7 +5471,7 @@ void actExplodeSprite(spritetype *pSprite) { XSPRITE *pXSprite = &xsprite[nXSprite]; pXSprite->state = 1; - pXSprite->health = thingInfo[0].health<<4; + pXSprite->health = thingInfo[0].startHealth<<4; } else actPostSprite(pSprite->index, kStatFree); @@ -5536,15 +5536,15 @@ void actExplodeSprite(spritetype *pSprite) int nSprite = pSprite->index; xvel[nSprite] = yvel[nSprite] = zvel[nSprite] = 0; actPostSprite(nSprite, kStatExplosion); - pSprite->xrepeat = pSprite->yrepeat = explodeInfo[nType].at0; + pSprite->xrepeat = pSprite->yrepeat = explodeInfo[nType].repeat; pSprite->flags &= ~3; pSprite->type = nType; EXPLOSION *pExplodeInfo = &explodeInfo[nType]; xsprite[nXSprite].target = 0; - xsprite[nXSprite].data1 = pExplodeInfo->atf; - xsprite[nXSprite].data2 = pExplodeInfo->at13; - xsprite[nXSprite].data3 = pExplodeInfo->at17; + xsprite[nXSprite].data1 = pExplodeInfo->ticks; + xsprite[nXSprite].data2 = pExplodeInfo->quakeEffect; + xsprite[nXSprite].data3 = pExplodeInfo->flashEffect; } void actActivateGibObject(spritetype *pSprite, XSPRITE *pXSprite) @@ -5713,9 +5713,10 @@ void actProcessSprites(void) // process playing 3-rd side qavs for player(s) if (gQavPlayerIndex > -1) { if (sprite[gQavPlayerIndex].extra >= 0) { - XSPRITE* pXSprite = &xsprite[sprite[gQavPlayerIndex].extra]; + XSPRITE* pXSprite = &xsprite[sprite[gQavPlayerIndex].extra]; PLAYER* pPlayer = getPlayerById(pXSprite->data1); + if (pPlayer->curWeapon != 0) pPlayer->curWeapon = 0; if (((int)gFrameClock & pXSprite->busyTime) == 0) { - if (pXSprite->waitTime <= 0 || pXSprite->sysData1-- > 0) StartQAV(getPlayerById(pXSprite->data1), kFreeQAVEntry); + if (pXSprite->waitTime <= 0 || pXSprite->sysData1-- > 0) StartQAV(pPlayer, kFreeQAVEntry); else evPost(gQavPlayerIndex, 3, 0, kCmdOff); } } else { @@ -5778,7 +5779,7 @@ void actProcessSprites(void) pPlayer2 = &gPlayer[pSprite2->type - kDudePlayer1]; if (nSprite2 == nOwner || pSprite2->type == kDudeZombieAxeBuried || pSprite2->type == kDudeRat || pSprite2->type == kDudeBat) continue; - if (gGameOptions.nGameType == 3 && pPlayer2 && pPlayer->at2ea == pPlayer2->at2ea) + if (gGameOptions.nGameType == 3 && pPlayer2 && pPlayer->teamId == pPlayer2->teamId) continue; if (gGameOptions.nGameType == 1 && pPlayer2) continue; @@ -5999,20 +6000,20 @@ void actProcessSprites(void) { if (pXSprite->data1 && CheckProximity(pDude, x, y, z, nSector, radius)) { - if (pExplodeInfo->at1 && pXSprite->target == 0) + if (pExplodeInfo->dmg && pXSprite->target == 0) { pXSprite->target = 1; - actDamageSprite(nOwner, pDude, DAMAGE_TYPE_0, (pExplodeInfo->at1+Random(pExplodeInfo->at2))<<4); + actDamageSprite(nOwner, pDude, DAMAGE_TYPE_0, (pExplodeInfo->dmg+Random(pExplodeInfo->dmgRng))<<4); } if (pExplodeInfo->dmgType) ConcussSprite(nOwner, pDude, x, y, z, pExplodeInfo->dmgType); - if (pExplodeInfo->atb) + if (pExplodeInfo->burnTime) { dassert(pDude->extra > 0 && pDude->extra < kMaxXSprites); XSPRITE *pXDude = &xsprite[pDude->extra]; if (!pXDude->burnTime) evPost(nSprite2, 3, 0, kCallbackFXFlameLick); - actBurnSprite(pSprite->owner, pXDude, pExplodeInfo->atb<<2); + actBurnSprite(pSprite->owner, pXDude, pExplodeInfo->burnTime<<2); } } } @@ -6033,13 +6034,13 @@ void actProcessSprites(void) { if (pExplodeInfo->dmgType) ConcussSprite(nOwner, pThing, x, y, z, pExplodeInfo->dmgType); - if (pExplodeInfo->atb) + if (pExplodeInfo->burnTime) { dassert(pThing->extra > 0 && pThing->extra < kMaxXSprites); XSPRITE *pXThing = &xsprite[pThing->extra]; if (pThing->type == kThingTNTBarrel && !pXThing->burnTime) evPost(nSprite2, 3, 0, kCallbackFXFlameLick); - actBurnSprite(pSprite->owner, pXThing, pExplodeInfo->atb<<2); + actBurnSprite(pSprite->owner, pXThing, pExplodeInfo->burnTime<<2); } } } @@ -6068,7 +6069,7 @@ void actProcessSprites(void) int dz = (z - pSprite2->z)>>8; int nDist = dx*dx+dy*dy+dz*dz+0x40000; int t = divscale16(pXSprite->data2, nDist); - gPlayer[p].at35a += t; + gPlayer[p].flickerEffect += t; } // By NoOne: if data4 > 0, do not remove explosion. This can be useful when designer wants put explosion generator in map manually @@ -6297,36 +6298,36 @@ void actProcessSprites(void) if (IsPlayerSprite(pSprite)) { PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1]; - if (pPlayer->at34e) + if (pPlayer->voodooTargets) sub_41250(pPlayer); - if (pPlayer->at376 && Chance(0x8000)) + if (pPlayer->hand && Chance(0x8000)) actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_4, 12); - if (pPlayer->at87) + if (pPlayer->isUnderwater) { char bActive = packItemActive(pPlayer, 1); - if (bActive || pPlayer->at31a) - pPlayer->at2f2 = 1200; + if (bActive || pPlayer->godMode) + pPlayer->underwaterTime = 1200; else - pPlayer->at2f2 = ClipLow(pPlayer->at2f2-4, 0); - if (pPlayer->at2f2 < 1080 && packCheckItem(pPlayer, 1) && !bActive) + pPlayer->underwaterTime = ClipLow(pPlayer->underwaterTime-4, 0); + if (pPlayer->underwaterTime < 1080 && packCheckItem(pPlayer, 1) && !bActive) packUseItem(pPlayer, 1); - if (!pPlayer->at2f2) + if (!pPlayer->underwaterTime) { - pPlayer->at36e += 4; - if (Chance(pPlayer->at36e)) + pPlayer->chokeEffect += 4; + if (Chance(pPlayer->chokeEffect)) actDamageSprite(nSprite, pSprite, DAMAGE_TYPE_4, 3<<4); } else - pPlayer->at36e = 0; + pPlayer->chokeEffect = 0; if (xvel[nSprite] || yvel[nSprite]) sfxPlay3DSound(pSprite, 709, 100, 2); - pPlayer->at302 = ClipLow(pPlayer->at302-4, 0); + pPlayer->bubbleTime = ClipLow(pPlayer->bubbleTime-4, 0); } else if (gGameOptions.nGameType == 0) { - if (pPlayer->pXSprite->health > 0 && pPlayer->at30a >= 1200 && Chance(0x200)) + if (pPlayer->pXSprite->health > 0 && pPlayer->restTime >= 1200 && Chance(0x200)) { - pPlayer->at30a = -1; + pPlayer->restTime = -1; sfxPlay3DSound(pSprite, 3100+Random(11), 0, 2); } } @@ -6552,19 +6553,19 @@ spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType) dassert(nXThing > 0 && nXThing < kMaxXSprites); XSPRITE *pXThing = &xsprite[nXThing]; THINGINFO *pThingInfo = &thingInfo[nType]; - pXThing->health = pThingInfo->health<<4; + pXThing->health = pThingInfo->startHealth<<4; pSprite->clipdist = pThingInfo->clipdist; pSprite->flags = pThingInfo->flags; if (pSprite->flags & 2) pSprite->flags |= 4; - pSprite->cstat |= pThingInfo->atf; - pSprite->picnum = pThingInfo->at11; - pSprite->shade = pThingInfo->at13; - pSprite->pal = pThingInfo->at14; - if (pThingInfo->at15) - pSprite->xrepeat = pThingInfo->at15; - if (pThingInfo->at16) - pSprite->yrepeat = pThingInfo->at16; + pSprite->cstat |= pThingInfo->cstat; + pSprite->picnum = pThingInfo->picnum; + pSprite->shade = pThingInfo->shade; + pSprite->pal = pThingInfo->pal; + if (pThingInfo->xrepeat) + pSprite->xrepeat = pThingInfo->xrepeat; + if (pThingInfo->yrepeat) + pSprite->yrepeat = pThingInfo->yrepeat; SetBitString(show2dsprite, pSprite->index); switch (nThingType) { case kThingVoodooHead: @@ -6659,7 +6660,7 @@ spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, int x = pSprite->x+mulscale30(a2, Cos(pSprite->ang+512)); int y = pSprite->y+mulscale30(a2, Sin(pSprite->ang+512)); int z = pSprite->z+a3; - int clipdist = pMissileInfo->atd+pSprite->clipdist; + int clipdist = pMissileInfo->clipDist+pSprite->clipdist; x += mulscale28(clipdist, Cos(pSprite->ang)); y += mulscale28(clipdist, Sin(pSprite->ang)); int hit = HitScan(pSprite, z, x-pSprite->x, y-pSprite->y, 0, CLIPMASK0, clipdist); @@ -6673,25 +6674,25 @@ spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, } else { - x = gHitInfo.hitx-mulscale28(pMissileInfo->atd<<1, Cos(pSprite->ang)); - y = gHitInfo.hity-mulscale28(pMissileInfo->atd<<1, Sin(pSprite->ang)); + x = gHitInfo.hitx-mulscale28(pMissileInfo->clipDist<<1, Cos(pSprite->ang)); + y = gHitInfo.hity-mulscale28(pMissileInfo->clipDist<<1, Sin(pSprite->ang)); } } spritetype *pMissile = actSpawnSprite(pSprite->sectnum, x, y, z, 5, 1); int nMissile = pMissile->index; SetBitString(show2dsprite, nMissile); pMissile->type = nType; - pMissile->shade = pMissileInfo->atc; + pMissile->shade = pMissileInfo->shade; pMissile->pal = 0; - pMissile->clipdist = pMissileInfo->atd; + pMissile->clipdist = pMissileInfo->clipDist; pMissile->flags = 1; - pMissile->xrepeat = pMissileInfo->ata; - pMissile->yrepeat = pMissileInfo->atb; + pMissile->xrepeat = pMissileInfo->xrepeat; + pMissile->yrepeat = pMissileInfo->yrepeat; pMissile->picnum = pMissileInfo->picnum; - pMissile->ang = (pSprite->ang+pMissileInfo->at6)&2047; - xvel[nMissile] = mulscale(pMissileInfo->at2, a4, 14); - yvel[nMissile] = mulscale(pMissileInfo->at2, a5, 14); - zvel[nMissile] = mulscale(pMissileInfo->at2, a6, 14); + pMissile->ang = (pSprite->ang+pMissileInfo->angleOfs)&2047; + xvel[nMissile] = mulscale(pMissileInfo->velocity, a4, 14); + yvel[nMissile] = mulscale(pMissileInfo->velocity, a5, 14); + zvel[nMissile] = mulscale(pMissileInfo->velocity, a6, 14); actPropagateSpriteOwner(pMissile, pSprite); pMissile->cstat |= 1; int nXSprite = pMissile->extra; @@ -6944,9 +6945,9 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, int z = gHitInfo.hitz-mulscale(a6, 256, 14); int nSurf = surfType[wall[nWall].picnum]; dassert(nSurf < kSurfMax); - if (pVectorData->at1d[nSurf].at0 >= 0) + if (pVectorData->surfHit[nSurf].fx1 >= 0) { - spritetype *pFX = gFX.fxSpawn(pVectorData->at1d[nSurf].at0, nSector, x, y, z, 0); + spritetype *pFX = gFX.fxSpawn(pVectorData->surfHit[nSurf].fx1, nSector, x, y, z, 0); if (pFX) { pFX->ang = (GetWallAngle(nWall)+512)&2047; @@ -6982,7 +6983,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, int shift = 4; if (vectorType == VECTOR_TYPE_0 && !IsPlayerSprite(pSprite)) shift = 3; - actDamageSprite(nShooter, pSprite, pVectorData->at0, pVectorData->at1<dmgType, pVectorData->dmg<extra; if (nXSprite > 0) { @@ -6993,19 +6994,19 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, if (pSprite->statnum == kStatThing) { int t = thingInfo[pSprite->type-kThingBase].mass; - if (t > 0 && pVectorData->at5) + if (t > 0 && pVectorData->impulse) { - int t2 = divscale(pVectorData->at5, t, 8); + int t2 = divscale(pVectorData->impulse, t, 8); xvel[nSprite] += mulscale16(a4, t2); yvel[nSprite] += mulscale16(a5, t2); zvel[nSprite] += mulscale16(a6, t2); } - if (pVectorData->at11) + if (pVectorData->burnTime) { XSPRITE *pXSprite = &xsprite[nXSprite]; if (!pXSprite->burnTime) evPost(nSprite, 3, 0, kCallbackFXFlameLick); - actBurnSprite(actSpriteIdToOwnerId(nShooter), pXSprite, pVectorData->at11); + actBurnSprite(actSpriteIdToOwnerId(nShooter), pXSprite, pVectorData->burnTime); } } if (pSprite->statnum == kStatDude) @@ -7021,21 +7022,21 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, } } - if (t > 0 && pVectorData->at5) + if (t > 0 && pVectorData->impulse) { - int t2 = divscale(pVectorData->at5, t, 8); + int t2 = divscale(pVectorData->impulse, t, 8); xvel[nSprite] += mulscale16(a4, t2); yvel[nSprite] += mulscale16(a5, t2); zvel[nSprite] += mulscale16(a6, t2); } - if (pVectorData->at11) + if (pVectorData->burnTime) { XSPRITE *pXSprite = &xsprite[nXSprite]; if (!pXSprite->burnTime) evPost(nSprite, 3, 0, kCallbackFXFlameLick); - actBurnSprite(actSpriteIdToOwnerId(nShooter), pXSprite, pVectorData->at11); + actBurnSprite(actSpriteIdToOwnerId(nShooter), pXSprite, pVectorData->burnTime); } - if (Chance(pVectorData->atd)) + if (Chance(pVectorData->fxChance)) { int t = gVectorData[19].maxDist; a4 += Random3(4000); @@ -7054,8 +7055,8 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, int z = gHitInfo.hitz - mulscale(a6, 16<<4, 14); int nSurf = surfType[wall[nWall].picnum]; VECTORDATA *pVectorData = &gVectorData[19]; - FX_ID t2 = pVectorData->at1d[nSurf].at1; - FX_ID t3 = pVectorData->at1d[nSurf].at2; + FX_ID t2 = pVectorData->surfHit[nSurf].fx2; + FX_ID t3 = pVectorData->surfHit[nSurf].fx3; spritetype *pFX = NULL; if (t2 > FX_NONE && (t3 == FX_NONE || Chance(0x4000))) pFX = gFX.fxSpawn(t2, nSector, x, y, z, 0); @@ -7071,23 +7072,23 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, } } } - for (int i = 0; i < pVectorData->at15; i++) - if (Chance(pVectorData->at19)) - fxSpawnBlood(pSprite, pVectorData->at1<<4); + for (int i = 0; i < pVectorData->bloodSplats; i++) + if (Chance(pVectorData->splatChance)) + fxSpawnBlood(pSprite, pVectorData->dmg<<4); } // by NoOne: add impulse for sprites from physics list - if (gPhysSpritesCount > 0 && pVectorData->at5) { + if (gPhysSpritesCount > 0 && pVectorData->impulse) { int nIndex = isDebris(pSprite->index); if (nIndex != -1 && (xsprite[pSprite->extra].physAttr & kPhysDebrisVector)) { - int impulse = divscale(pVectorData->at5, ClipLow(gSpriteMass[pSprite->extra].mass, 10), 6); + int impulse = divscale(pVectorData->impulse, ClipLow(gSpriteMass[pSprite->extra].mass, 10), 6); xvel[nSprite] += mulscale16(a4, impulse); yvel[nSprite] += mulscale16(a5, impulse); zvel[nSprite] += mulscale16(a6, impulse); - if (pVectorData->at11 != 0) { + if (pVectorData->burnTime != 0) { if (!xsprite[nXSprite].burnTime) evPost(nSprite, 3, 0, kCallbackFXFlameLick); - actBurnSprite(actSpriteIdToOwnerId(nShooter), &xsprite[nXSprite], pVectorData->at11); + actBurnSprite(actSpriteIdToOwnerId(nShooter), &xsprite[nXSprite], pVectorData->burnTime); } if (pSprite->type >= kThingBase && pSprite->type < kThingMax) @@ -7101,12 +7102,12 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, } } dassert(nSurf < kSurfMax); - if (pVectorData->at1d[nSurf].at1 >= 0) - gFX.fxSpawn(pVectorData->at1d[nSurf].at1, nSector, x, y, z, 0); - if (pVectorData->at1d[nSurf].at2 >= 0) - gFX.fxSpawn(pVectorData->at1d[nSurf].at2, nSector, x, y, z, 0); - if (pVectorData->at1d[nSurf].at3 >= 0) - sfxPlay3DSound(x, y, z, pVectorData->at1d[nSurf].at3, nSector); + if (pVectorData->surfHit[nSurf].fx2 >= 0) + gFX.fxSpawn(pVectorData->surfHit[nSurf].fx2, nSector, x, y, z, 0); + if (pVectorData->surfHit[nSurf].fx3 >= 0) + gFX.fxSpawn(pVectorData->surfHit[nSurf].fx3, nSector, x, y, z, 0); + if (pVectorData->surfHit[nSurf].fxSnd >= 0) + sfxPlay3DSound(x, y, z, pVectorData->surfHit[nSurf].fxSnd, nSector); } void FireballSeqCallback(int, int nXSprite) @@ -7179,7 +7180,7 @@ void TreeToGibCallback(int, int nXSprite) pXSprite->data1 = 15; pXSprite->data2 = 0; pXSprite->data3 = 0; - pXSprite->health = thingInfo[17].health; + pXSprite->health = thingInfo[17].startHealth; pXSprite->data4 = 312; pSprite->cstat |= 257; } @@ -7193,7 +7194,7 @@ void DudeToGibCallback1(int, int nXSprite) pXSprite->data1 = 8; pXSprite->data2 = 0; pXSprite->data3 = 0; - pXSprite->health = thingInfo[26].health; + pXSprite->health = thingInfo[26].startHealth; pXSprite->data4 = 319; pXSprite->triggerOnce = 0; pXSprite->isTriggered = 0; @@ -7211,7 +7212,7 @@ void DudeToGibCallback2(int, int nXSprite) pXSprite->data1 = 3; pXSprite->data2 = 0; pXSprite->data3 = 0; - pXSprite->health = thingInfo[26].health; + pXSprite->health = thingInfo[26].startHealth; pXSprite->data4 = 319; pXSprite->triggerOnce = 0; pXSprite->isTriggered = 0; diff --git a/source/blood/src/actor.h b/source/blood/src/actor.h index a51202a88..5a71b7293 100644 --- a/source/blood/src/actor.h +++ b/source/blood/src/actor.h @@ -38,6 +38,7 @@ enum DAMAGE_TYPE { DAMAGE_TYPE_4, DAMAGE_TYPE_5, DAMAGE_TYPE_6, // Tesla + kDamageMax = 7, }; enum VECTOR_TYPE { @@ -69,101 +70,101 @@ enum VECTOR_TYPE { struct THINGINFO { - short health; // health - short mass; // mass - unsigned char clipdist; // clipdist - short flags; // flags - int at7; // elasticity - int atb; // damage resistance - short atf; // cstat - short at11; // picnum - char at13; // shade - unsigned char at14; // pal - unsigned char at15; // xrepeat - unsigned char at16; // yrepeat - int at17[7]; // damage + short startHealth; + short mass; + unsigned char clipdist; + short flags; + int elastic; // elasticity + int dmgResist; // damage resistance + short cstat; + short picnum; + char shade; + unsigned char pal; + unsigned char xrepeat; // xrepeat + unsigned char yrepeat; // yrepeat + int dmgControl[kDamageMax]; // damage bool allowThrow; // By NoOne: indicates if kDudeModernCustom can throw it }; struct AMMOITEMDATA { - short at0; - short picnum; // startHealth - char shade; // mass - char at5; - unsigned char xrepeat; // at6 - unsigned char yrepeat; // at7 - short at8; - unsigned char ata; - unsigned char atb; + short cstat; + short picnum; + char shade; + char pal; + unsigned char xrepeat; + unsigned char yrepeat; + short count; + unsigned char type; + unsigned char weaponType; }; struct WEAPONITEMDATA { - short at0; - short picnum; // startHealth - char shade; // mass - char at5; - unsigned char xrepeat; // at6 - unsigned char yrepeat; // at7 - short at8; - short ata; - short atc; + short cstat; + short picnum; + char shade; + char pal; + unsigned char xrepeat; + unsigned char yrepeat; + short type; + short ammoType; + short count; }; struct ITEMDATA { - short at0; // unused? - short picnum; // startHealth - char shade; // mass - char at5; // unused? - unsigned char xrepeat; // at6 - unsigned char yrepeat; // at7 - short at8; + short cstat; + short picnum; + char shade; + char pal; + unsigned char xrepeat; + unsigned char yrepeat; + short packSlot; }; struct MissileType { short picnum; - int at2; // speed - int at6; // angle - unsigned char ata; // xrepeat - unsigned char atb; // yrepeat - char atc; // shade - unsigned char atd; // clipdist + int velocity; + int angleOfs; + unsigned char xrepeat; + unsigned char yrepeat; + char shade; + unsigned char clipDist; int fireSound[2]; // By NoOne: predefined fire sounds. used by kDudeModernCustom, but can be used for something else. }; struct EXPLOSION { - unsigned char at0; - char at1; // dmg - char at2; // dmg rnd + unsigned char repeat; + char dmg; + char dmgRng; int radius; // radius int dmgType; - int atb; - int atf; - int at13; - int at17; + int burnTime; + int ticks; + int quakeEffect; + int flashEffect; }; -struct VECTORDATA_at1d { - FX_ID at0; - FX_ID at1; - FX_ID at2; - int at3; +struct SURFHIT { + FX_ID fx1; + FX_ID fx2; + FX_ID fx3; + int fxSnd; }; struct VECTORDATA { - DAMAGE_TYPE at0; - int at1; // damage - int at5; - int maxDist; // range - int atd; - int at11; // burn - int at15; // blood splats - int at19; // blood splat chance - VECTORDATA_at1d at1d[15]; + DAMAGE_TYPE dmgType; + int dmg; // damage + int impulse; + int maxDist; + int fxChance; + int burnTime; // burn + int bloodSplats; // blood splats + int splatChance; // blood splat chance + SURFHIT surfHit[15]; int fireSound[2]; // By NoOne: predefined fire sounds. used by kDudeModernCustom, but can be used for something else. }; diff --git a/source/blood/src/ai.cpp b/source/blood/src/ai.cpp index 05a0c8371..4e09740c7 100644 --- a/source/blood/src/ai.cpp +++ b/source/blood/src/ai.cpp @@ -1359,7 +1359,7 @@ void aiThinkTarget(spritetype *pSprite, XSPRITE *pXSprite) for (int p = connecthead; p >= 0; p = connectpoint2[p]) { PLAYER *pPlayer = &gPlayer[p]; - if (pSprite->owner == pPlayer->at5b || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) + if (pSprite->owner == pPlayer->nSprite || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) continue; int x = pPlayer->pSprite->x; int y = pPlayer->pSprite->y; @@ -1375,7 +1375,7 @@ void aiThinkTarget(spritetype *pSprite, XSPRITE *pXSprite) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); return; } @@ -1398,7 +1398,7 @@ void sub_5F15C(spritetype *pSprite, XSPRITE *pXSprite) for (int p = connecthead; p >= 0; p = connectpoint2[p]) { PLAYER *pPlayer = &gPlayer[p]; - if (pSprite->owner == pPlayer->at5b || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) + if (pSprite->owner == pPlayer->nSprite || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) continue; int x = pPlayer->pSprite->x; int y = pPlayer->pSprite->y; @@ -1414,7 +1414,7 @@ void sub_5F15C(spritetype *pSprite, XSPRITE *pXSprite) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); return; } diff --git a/source/blood/src/aibat.cpp b/source/blood/src/aibat.cpp index db1bb065a..c78d71f4b 100644 --- a/source/blood/src/aibat.cpp +++ b/source/blood/src/aibat.cpp @@ -128,7 +128,7 @@ static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); } else if (nDist < pDudeInfo->hearDist) diff --git a/source/blood/src/aibeast.cpp b/source/blood/src/aibeast.cpp index 8c92ba3a1..55b7e30a7 100644 --- a/source/blood/src/aibeast.cpp +++ b/source/blood/src/aibeast.cpp @@ -155,7 +155,7 @@ static void StompSeqCallback(int, int nXSprite) else nDamage = v1c + ((vc-nDist2)*v10)/vc; if (IsPlayerSprite(pSprite2)) - gPlayer[pSprite2->type-kDudePlayer1].at37f += nDamage*4; + gPlayer[pSprite2->type-kDudePlayer1].quakeEffect += nDamage*4; actDamageSprite(nSprite, pSprite2, DAMAGE_TYPE_0, nDamage<<4); } } @@ -184,7 +184,7 @@ static void StompSeqCallback(int, int nXSprite) else nDamage = v1c + ((vc-nDist2)*v10)/vc; if (IsPlayerSprite(pSprite2)) - gPlayer[pSprite2->type-kDudePlayer1].at37f += nDamage*4; + gPlayer[pSprite2->type-kDudePlayer1].quakeEffect += nDamage*4; actDamageSprite(nSprite, pSprite2, DAMAGE_TYPE_0, nDamage<<4); } } diff --git a/source/blood/src/aiboneel.cpp b/source/blood/src/aiboneel.cpp index 27547e631..526f2f147 100644 --- a/source/blood/src/aiboneel.cpp +++ b/source/blood/src/aiboneel.cpp @@ -142,7 +142,7 @@ static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite) if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { pDudeExtraE->at4 = 0; - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); } else if (nDist < pDudeInfo->hearDist) diff --git a/source/blood/src/aicerber.cpp b/source/blood/src/aicerber.cpp index 9153da8e8..aa7bd46e2 100644 --- a/source/blood/src/aicerber.cpp +++ b/source/blood/src/aicerber.cpp @@ -316,7 +316,7 @@ static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite) if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { pDudeExtraE->at0 = 0; - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); } else if (nDist < pDudeInfo->hearDist) diff --git a/source/blood/src/aicult.cpp b/source/blood/src/aicult.cpp index 4fab0c4b7..317bfae86 100644 --- a/source/blood/src/aicult.cpp +++ b/source/blood/src/aicult.cpp @@ -330,7 +330,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) switch (pSprite->type) { case kDudeCultistTommy: if (nDist < 0x1e00 && nDist > 0xe00 && klabs(nDeltaAngle) < 85 && !TargetNearExplosion(pTarget) - && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].at2e + && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); @@ -398,7 +398,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) break; case kDudeCultistShotgun: if (nDist < 0x2c00 && nDist > 0x1400 && !TargetNearExplosion(pTarget) - && (pTarget->flags&2) && gGameOptions.nDifficulty >= 2 && IsPlayerSprite(pTarget) && !gPlayer[pTarget->type-kDudePlayer1].at2e + && (pTarget->flags&2) && gGameOptions.nDifficulty >= 2 && IsPlayerSprite(pTarget) && !gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); @@ -466,7 +466,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) break; case kDudeCultistTesla: if (nDist < 0x1e00 && nDist > 0xe00 && !TargetNearExplosion(pTarget) - && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].at2e + && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); @@ -578,7 +578,7 @@ static void thinkChase(spritetype *pSprite, XSPRITE *pXSprite) break; case kDudeCultistBeast: if (nDist < 0x1e00 && nDist > 0xe00 && !TargetNearExplosion(pTarget) - && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].at2e + && (pTarget->flags&2) && gGameOptions.nDifficulty > 2 && IsPlayerSprite(pTarget) && gPlayer[pTarget->type-kDudePlayer1].isRunning && Chance(0x8000)) { int hit = HitScan(pSprite, pSprite->z, dx, dy, 0, CLIPMASK1, 0); diff --git a/source/blood/src/aigarg.cpp b/source/blood/src/aigarg.cpp index 063f94eca..e396820ae 100644 --- a/source/blood/src/aigarg.cpp +++ b/source/blood/src/aigarg.cpp @@ -265,7 +265,7 @@ static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite) if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { pDudeExtraE->at4 = 0; - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); } else if (nDist < pDudeInfo->hearDist) diff --git a/source/blood/src/aighost.cpp b/source/blood/src/aighost.cpp index f0d310d74..fd9be1e3e 100644 --- a/source/blood/src/aighost.cpp +++ b/source/blood/src/aighost.cpp @@ -240,7 +240,7 @@ static void thinkTarget(spritetype *pSprite, XSPRITE *pXSprite) if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { pDudeExtraE->at4 = 0; - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); return; } diff --git a/source/blood/src/aihand.cpp b/source/blood/src/aihand.cpp index b3374be0c..bf77d3bd3 100644 --- a/source/blood/src/aihand.cpp +++ b/source/blood/src/aihand.cpp @@ -68,9 +68,9 @@ static void HandJumpSeqCallback(int, int nXSprite) if (IsPlayerSprite(pTarget)) { PLAYER *pPlayer = &gPlayer[pTarget->type-kDudePlayer1]; - if (!pPlayer->at376) + if (!pPlayer->hand) { - pPlayer->at376 = 1; + pPlayer->hand = 1; actPostSprite(pSprite->index, kStatFree); } } diff --git a/source/blood/src/aispid.cpp b/source/blood/src/aispid.cpp index 78166d2c0..f83299bec 100644 --- a/source/blood/src/aispid.cpp +++ b/source/blood/src/aispid.cpp @@ -77,9 +77,9 @@ static char sub_70D30(XSPRITE *pXDude, int a2, int a3) if (IsPlayerSprite(pDude)) { PLAYER *pPlayer = &gPlayer[pDude->type-kDudePlayer1]; - if (a3 > pPlayer->at36a) + if (a3 > pPlayer->blindEffect) { - pPlayer->at36a = ClipHigh(pPlayer->at36a+a2, a3); + pPlayer->blindEffect = ClipHigh(pPlayer->blindEffect+a2, a3); return 1; } } @@ -110,7 +110,7 @@ static void SpidBiteSeqCallback(int, int nXSprite) switch (pSprite->type) { case kDudeSpiderBrown: actFireVector(pSprite, 0, 0, dx, dy, dz, VECTOR_TYPE_17); - if (IsPlayerSprite(pTarget) && !pPlayer->at31a && powerupCheck(pPlayer, kPwUpDeathMask) <= 0 && Chance(0x4000)) + if (IsPlayerSprite(pTarget) && !pPlayer->godMode && powerupCheck(pPlayer, kPwUpDeathMask) <= 0 && Chance(0x4000)) powerupActivate(pPlayer, kPwUpDeliriumShroom); break; case kDudeSpiderRed: diff --git a/source/blood/src/aitchern.cpp b/source/blood/src/aitchern.cpp index 8e5503ddf..1ef148d80 100644 --- a/source/blood/src/aitchern.cpp +++ b/source/blood/src/aitchern.cpp @@ -282,7 +282,7 @@ static void sub_725A4(spritetype *pSprite, XSPRITE *pXSprite) if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { pDudeExtraE->at0 = 0; - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); } else if (nDist < pDudeInfo->hearDist) diff --git a/source/blood/src/aiunicult.cpp b/source/blood/src/aiunicult.cpp index 74dadd9d2..803e6d0d0 100644 --- a/source/blood/src/aiunicult.cpp +++ b/source/blood/src/aiunicult.cpp @@ -274,7 +274,7 @@ static void ThrowThing(int nXIndex, bool impact) { pThing = actFireThing(pSprite, 0, 0, (dz / 128) - zThrow, thingType, divscale(dist / 540, 120, 23)); if (pThing == NULL) return; - if (pThinkInfo->at11 < 0 && pThing->type != kModernThingThrowableRock) pThing->picnum = 0; + if (pThinkInfo->picnum < 0 && pThing->type != kModernThingThrowableRock) pThing->picnum = 0; pThing->owner = pSprite->xvel; switch (thingType) { case kThingNapalmBall: @@ -1031,17 +1031,17 @@ bool doExplosion(spritetype* pSprite, int nType) { spritetype* pExplosion = actSpawnSprite(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, 2, true); int nSeq = 4; int nSnd = 304; EXPLOSION* pExpl = &explodeInfo[nType]; - pExplosion->yrepeat = pExpl->at0; - pExplosion->xrepeat = pExpl->at0; + pExplosion->yrepeat = pExpl->repeat; + pExplosion->xrepeat = pExpl->repeat; pExplosion->type = nType; pExplosion->cstat |= CSTAT_SPRITE_INVISIBLE | CSTAT_SPRITE_ALIGNMENT_SLAB; pExplosion->owner = pSprite->xvel; if (pExplosion->extra >= 0) { xsprite[pExplosion->extra].target = 0; - xsprite[pExplosion->extra].data1 = pExpl->atf; - xsprite[pExplosion->extra].data2 = pExpl->at13; - xsprite[pExplosion->extra].data3 = pExpl->at17; + xsprite[pExplosion->extra].data1 = pExpl->ticks; + xsprite[pExplosion->extra].data2 = pExpl->quakeEffect; + xsprite[pExplosion->extra].data3 = pExpl->flashEffect; if (nType == 0) { nSeq = 3; nSnd = 303; pExplosion->z = pSprite->z; } diff --git a/source/blood/src/aizomba.cpp b/source/blood/src/aizomba.cpp index 57a47f025..47802f6e5 100644 --- a/source/blood/src/aizomba.cpp +++ b/source/blood/src/aizomba.cpp @@ -230,7 +230,7 @@ static void myThinkTarget(spritetype *pSprite, XSPRITE *pXSprite) { PLAYER *pPlayer = &gPlayer[p]; int nOwner = (pSprite->owner & 0x1000) ? (pSprite->owner&0xfff) : -1; - if (nOwner == pPlayer->at5b || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) + if (nOwner == pPlayer->nSprite || pPlayer->pXSprite->health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0) continue; int x = pPlayer->pSprite->x; int y = pPlayer->pSprite->y; @@ -246,7 +246,7 @@ static void myThinkTarget(spritetype *pSprite, XSPRITE *pXSprite) int nDeltaAngle = ((getangle(dx,dy)+1024-pSprite->ang)&2047)-1024; if (nDist < pDudeInfo->seeDist && klabs(nDeltaAngle) <= pDudeInfo->periphery) { - aiSetTarget(pXSprite, pPlayer->at5b); + aiSetTarget(pXSprite, pPlayer->nSprite); aiActivateDude(pSprite, pXSprite); } else if (nDist < pDudeInfo->hearDist) diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index ba184840c..ffc56bd24 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -700,14 +700,14 @@ void StartLevel(GAMEOPTIONS *gameOptions) PLAYER *pPlayer = &gPlayer[i]; pPlayer->pXSprite->health &= 0xf000; pPlayer->pXSprite->health |= gHealthTemp[i]; - pPlayer->at26 = gPlayerTemp[i].at26; - pPlayer->atbd = gPlayerTemp[i].atbd; - pPlayer->atc3 = gPlayerTemp[i].atc3; - pPlayer->atc7 = gPlayerTemp[i].atc7; - pPlayer->at2a = gPlayerTemp[i].at2a; - pPlayer->at1b1 = gPlayerTemp[i].at1b1; - pPlayer->atbf = gPlayerTemp[i].atbf; - pPlayer->atbe = gPlayerTemp[i].atbe; + pPlayer->weaponQav = gPlayerTemp[i].weaponQav; + pPlayer->curWeapon = gPlayerTemp[i].curWeapon; + pPlayer->weaponState = gPlayerTemp[i].weaponState; + pPlayer->weaponAmmo = gPlayerTemp[i].weaponAmmo; + pPlayer->qavCallback = gPlayerTemp[i].qavCallback; + pPlayer->qavLoop = gPlayerTemp[i].qavLoop; + pPlayer->weaponTimer = gPlayerTemp[i].weaponTimer; + pPlayer->nextWeapon = gPlayerTemp[i].nextWeapon; } } gameOptions->uGameFlags &= ~3; @@ -716,7 +716,7 @@ void StartLevel(GAMEOPTIONS *gameOptions) InitMirrors(); gFrameClock = 0; trInit(); - if (!bVanilla && !gMe->packInfo[1].at0) // if diving suit is not active, turn off reverb sound effect + if (!bVanilla && !gMe->packSlots[1].isActive) // if diving suit is not active, turn off reverb sound effect sfxSetReverb(0); ambInit(); sub_79760(); @@ -835,7 +835,7 @@ void LocalKeys(void) gViewIndex = connectpoint2[gViewIndex]; if (gViewIndex == -1) gViewIndex = connecthead; - if (oldViewIndex == gViewIndex || gMe->at2ea == gPlayer[gViewIndex].at2ea) + if (oldViewIndex == gViewIndex || gMe->teamId == gPlayer[gViewIndex].teamId) break; } while (oldViewIndex != gViewIndex); gView = &gPlayer[gViewIndex]; @@ -958,15 +958,15 @@ void ProcessFrame(void) char buffer[128]; for (int i = connecthead; i >= 0; i = connectpoint2[i]) { - gPlayer[i].atc.buttonFlags = gFifoInput[gNetFifoTail&255][i].buttonFlags; - gPlayer[i].atc.keyFlags.word |= gFifoInput[gNetFifoTail&255][i].keyFlags.word; - gPlayer[i].atc.useFlags.byte |= gFifoInput[gNetFifoTail&255][i].useFlags.byte; + gPlayer[i].input.buttonFlags = gFifoInput[gNetFifoTail&255][i].buttonFlags; + gPlayer[i].input.keyFlags.word |= gFifoInput[gNetFifoTail&255][i].keyFlags.word; + gPlayer[i].input.useFlags.byte |= gFifoInput[gNetFifoTail&255][i].useFlags.byte; if (gFifoInput[gNetFifoTail&255][i].newWeapon) - gPlayer[i].atc.newWeapon = gFifoInput[gNetFifoTail&255][i].newWeapon; - gPlayer[i].atc.forward = gFifoInput[gNetFifoTail&255][i].forward; - gPlayer[i].atc.q16turn = gFifoInput[gNetFifoTail&255][i].q16turn; - gPlayer[i].atc.strafe = gFifoInput[gNetFifoTail&255][i].strafe; - gPlayer[i].atc.q16mlook = gFifoInput[gNetFifoTail&255][i].q16mlook; + gPlayer[i].input.newWeapon = gFifoInput[gNetFifoTail&255][i].newWeapon; + gPlayer[i].input.forward = gFifoInput[gNetFifoTail&255][i].forward; + gPlayer[i].input.q16turn = gFifoInput[gNetFifoTail&255][i].q16turn; + gPlayer[i].input.strafe = gFifoInput[gNetFifoTail&255][i].strafe; + gPlayer[i].input.q16mlook = gFifoInput[gNetFifoTail&255][i].q16mlook; } gNetFifoTail++; if (!(gFrame&((gSyncRate<<3)-1))) @@ -977,9 +977,9 @@ void ProcessFrame(void) } for (int i = connecthead; i >= 0; i = connectpoint2[i]) { - if (gPlayer[i].atc.keyFlags.quit) + if (gPlayer[i].input.keyFlags.quit) { - gPlayer[i].atc.keyFlags.quit = 0; + gPlayer[i].input.keyFlags.quit = 0; netBroadcastPlayerLogoff(i); if (i == myconnectindex) { @@ -991,15 +991,15 @@ void ProcessFrame(void) return; } } - if (gPlayer[i].atc.keyFlags.restart) + if (gPlayer[i].input.keyFlags.restart) { - gPlayer[i].atc.keyFlags.restart = 0; + gPlayer[i].input.keyFlags.restart = 0; levelRestart(); return; } - if (gPlayer[i].atc.keyFlags.pause) + if (gPlayer[i].input.keyFlags.pause) { - gPlayer[i].atc.keyFlags.pause = 0; + gPlayer[i].input.keyFlags.pause = 0; gPaused = !gPaused; if (gPaused && gGameOptions.nGameType > 0 && numplayers > 1) { @@ -1033,7 +1033,7 @@ void ProcessFrame(void) viewUpdateDelirium(); viewUpdateShake(); sfxUpdate3DSounds(); - if (gMe->at376 == 1) + if (gMe->hand == 1) { #define CHOKERATE 8 #define TICRATE 30 diff --git a/source/blood/src/callback.cpp b/source/blood/src/callback.cpp index f09d81aa7..6012f8eb1 100644 --- a/source/blood/src/callback.cpp +++ b/source/blood/src/callback.cpp @@ -293,11 +293,11 @@ void PlayerBubble(int nSprite) // 10 { PLAYER *pPlayer = &gPlayer[pSprite->type-kDudePlayer1]; dassert(pPlayer != NULL); - if (!pPlayer->at302) + if (!pPlayer->bubbleTime) return; int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); - for (int i = 0; i < (pPlayer->at302>>6); i++) + for (int i = 0; i < (pPlayer->bubbleTime>>6); i++) { int nDist = (pSprite->xrepeat*(tilesiz[pSprite->picnum].x/2))>>2; int nAngle = Random(2048); @@ -369,7 +369,7 @@ void FinishHim(int nSprite) // 13 spritetype* pSprite = &sprite[nSprite]; int nXSprite = pSprite->extra; XSPRITE* pXSprite = &xsprite[nXSprite]; - if (playerSeqPlaying(&gPlayer[pSprite->type - kDudePlayer1], 16) && pXSprite->target == gMe->at5b) + if (playerSeqPlaying(&gPlayer[pSprite->type - kDudePlayer1], 16) && pXSprite->target == gMe->nSprite) sndStartSample(3313, -1, 1, 0); } @@ -586,7 +586,7 @@ void sub_76A08(spritetype *pSprite, spritetype *pSprite2, PLAYER *pPlayer) // ?? if (pPlayer) { playerResetInertia(pPlayer); - pPlayer->at6b = pPlayer->at73 = 0; + pPlayer->zViewVel = pPlayer->zWeaponVel = 0; } } @@ -642,11 +642,11 @@ void DropVoodoo(int nSprite) // unused { if (gGameOptions.nGameType == 1) continue; - if (gGameOptions.nGameType == 3 && pPlayer->at2ea == pPlayer2->at2ea) + if (gGameOptions.nGameType == 3 && pPlayer->teamId == pPlayer2->teamId) continue; int t = 0x8000/ClipLow(gNetPlayers-1, 1); if (!powerupCheck(pPlayer2, kPwUpDeathMask)) - t += ((3200-pPlayer2->at33e[2])<<15)/3200; + t += ((3200-pPlayer2->armor[2])<<15)/3200; if (Chance(t) || nNextSprite < 0) { int nDmg = actDamageSprite(nOwner, pSprite2, DAMAGE_TYPE_5, pXSprite->data1<<4); @@ -732,7 +732,7 @@ void UniMissileBurst(int nSprite) // 22 pBurst->flags = pSprite->flags; pBurst->xrepeat = pSprite->xrepeat / 2; pBurst->yrepeat = pSprite->yrepeat / 2; - pBurst->ang = ((pSprite->ang + missileInfo[pSprite->type - kMissileBase].at6) & 2047); + pBurst->ang = ((pSprite->ang + missileInfo[pSprite->type - kMissileBase].angleOfs) & 2047); pBurst->owner = pSprite->owner; actBuildMissile(pBurst, pBurst->extra, pSprite->xvel); diff --git a/source/blood/src/choke.cpp b/source/blood/src/choke.cpp index 0aec5c0cd..1d3c7011b 100644 --- a/source/blood/src/choke.cpp +++ b/source/blood/src/choke.cpp @@ -131,10 +131,10 @@ void CChoke::sub_84218() void sub_84230(PLAYER *pPlayer) { int t = gGameOptions.nDifficulty+2; - if (pPlayer->at372 < 64) - pPlayer->at372 = ClipHigh(pPlayer->at372+t, 64); - if (pPlayer->at372 > (7-gGameOptions.nDifficulty)*5) - pPlayer->at36a = ClipHigh(pPlayer->at36a+t*4, 128); + if (pPlayer->handTime < 64) + pPlayer->handTime = ClipHigh(pPlayer->handTime+t, 64); + if (pPlayer->handTime > (7-gGameOptions.nDifficulty)*5) + pPlayer->blindEffect = ClipHigh(pPlayer->blindEffect+t*4, 128); } CChoke gChoke; diff --git a/source/blood/src/db.h b/source/blood/src/db.h index 55c525059..32f2ff398 100644 --- a/source/blood/src/db.h +++ b/source/blood/src/db.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -#define kMaxXSprites 2048 +#define kMaxXSprites 16384 #define kMaxXWalls 512 #define kMaxXSectors 512 @@ -38,7 +38,7 @@ extern bool gModernMap; struct AISTATE; struct XSPRITE { - //int at0; + //int isActive; unsigned int atb_2 : 2; // unused // unsigned int atb_6 : 1; // unused // let's use these to add more data unsigned int ate_5 : 2; // unused // fields in the future? must be signed also diff --git a/source/blood/src/endgame.cpp b/source/blood/src/endgame.cpp index d8d601197..3307f7e8c 100644 --- a/source/blood/src/endgame.cpp +++ b/source/blood/src/endgame.cpp @@ -225,7 +225,7 @@ void CKillMgr::Draw(void) viewDrawText(3, pBuffer, 85, 50+8*i, -128, 0, 0, 1); sprintf(pBuffer, "%s", gProfile[i].name); viewDrawText(3, pBuffer, 100, 50+8*i, -128, 0, 0, 1); - sprintf(pBuffer, "%d", gPlayer[i].at2c6); + sprintf(pBuffer, "%d", gPlayer[i].fragCount); viewDrawText(3, pBuffer, 210, 50+8*i, -128, 0, 0, 1); } } diff --git a/source/blood/src/loadsave.cpp b/source/blood/src/loadsave.cpp index 4ca32c4bf..4c7265365 100644 --- a/source/blood/src/loadsave.cpp +++ b/source/blood/src/loadsave.cpp @@ -127,7 +127,7 @@ void LoadSave::LoadGame(char *pzFile) InitSectorFX(); viewInitializePrediction(); PreloadCache(); - if (!bVanilla && !gMe->packInfo[1].at0) // if diving suit is not active, turn off reverb sound effect + if (!bVanilla && !gMe->packSlots[1].isActive) // if diving suit is not active, turn off reverb sound effect sfxSetReverb(0); ambInit(); #ifdef YAX_ENABLE @@ -150,7 +150,7 @@ void LoadSave::LoadGame(char *pzFile) gBufferJitter = 0; bOutOfSync = 0; for (int i = 0; i < gNetPlayers; i++) - playerSetRace(&gPlayer[i], gPlayer[i].at5f); + playerSetRace(&gPlayer[i], gPlayer[i].lifeMode); if (VanillaMode()) viewSetMessage(""); else diff --git a/source/blood/src/map2d.cpp b/source/blood/src/map2d.cpp index 87aa0943d..943919d01 100644 --- a/source/blood/src/map2d.cpp +++ b/source/blood/src/map2d.cpp @@ -133,14 +133,14 @@ void sub_2541C(int x, int y, int z, short a) for (int i = connecthead; i >= 0; i = connectpoint2[i]) { - if (gViewMap.bFollowMode || gView->at57 != i) + if (gViewMap.bFollowMode || gView->nPlayer != i) { PLAYER *pPlayer = &gPlayer[i]; spritetype *pSprite = pPlayer->pSprite; int px = pSprite->x-x; int py = pSprite->y-y; int pa = (pSprite->ang-a)&2047; - if (i == gView->at57) + if (i == gView->nPlayer) { px = 0; py = 0; @@ -148,7 +148,7 @@ void sub_2541C(int x, int y, int z, short a) } int x1 = dmulscale16(px, nCos, -py, nSin); int y1 = dmulscale16(py, nCos2, px, nSin2); - if (i == gView->at57 || gGameOptions.nGameType == 1) + if (i == gView->nPlayer || gGameOptions.nGameType == 1) { int nTile = pSprite->picnum; int ceilZ, ceilHit, floorZ, floorHit; diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index 4508a5291..000aa5304 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -69,7 +69,7 @@ void sub_5A944(char key) void SetGodMode(bool god) { playerSetGodMode(gMe, god); - if (gMe->at31a) + if (gMe->godMode) viewSetMessage("You are immortal."); else viewSetMessage("You are mortal."); @@ -92,11 +92,11 @@ void packStuff(PLAYER *pPlayer) void packClear(PLAYER *pPlayer) { - pPlayer->at321 = 0; + pPlayer->packItemId = 0; for (int i = 0; i < 5; i++) { - pPlayer->packInfo[i].at0 = 0; - pPlayer->packInfo[i].at1 = 0; + pPlayer->packSlots[i].isActive = 0; + pPlayer->packSlots[i].curAmount = 0; } } @@ -105,13 +105,13 @@ void SetAmmo(bool stat) if (stat) { for (int i = 0; i < 12; i++) - gMe->at181[i] = gAmmoInfo[i].at0; + gMe->ammCount[i] = gAmmoInfo[i].max; viewSetMessage("You have full ammo."); } else { for (int i = 0; i < 12; i++) - gMe->at181[i] = 0; + gMe->ammCount[i] = 0; viewSetMessage("You have no ammo."); } } @@ -120,7 +120,7 @@ void SetWeapons(bool stat) { for (int i = 0; i < 14; i++) { - gMe->atcb[i] = stat; + gMe->hasWeapon[i] = stat; } SetAmmo(stat); if (stat) @@ -130,9 +130,9 @@ void SetWeapons(bool stat) if (!VanillaMode()) { // Keep the pitchfork to avoid freeze - gMe->atcb[1] = 1; - gMe->atbd = 0; - gMe->atbe = 1; + gMe->hasWeapon[1] = 1; + gMe->curWeapon = 0; + gMe->nextWeapon = 1; } viewSetMessage("You have no weapons."); } @@ -166,13 +166,13 @@ void SetArmor(bool stat) nAmount = 0; } for (int i = 0; i < 3; i++) - gMe->at33e[i] = nAmount; + gMe->armor[i] = nAmount; } void SetKeys(bool stat) { for (int i = 1; i <= 6; i++) - gMe->at88[i] = stat; + gMe->hasKey[i] = stat; if (stat) viewSetMessage("You have all keys."); else @@ -209,7 +209,7 @@ void SetWooMode(bool stat) if (powerupCheck(gMe, kPwUpTwoGuns)) { if (!VanillaMode()) - gMe->at202[kPwUpTwoGuns] = 0; + gMe->pwUpTime[kPwUpTwoGuns] = 0; powerupDeactivate(gMe, kPwUpTwoGuns); } } @@ -227,8 +227,8 @@ void ToggleBoots(void) viewSetMessage("You have no Jumping Boots."); if (!VanillaMode()) { - gMe->at202[kPwUpJumpBoots] = 0; - gMe->packInfo[4].at1 = 0; + gMe->pwUpTime[kPwUpJumpBoots] = 0; + gMe->packSlots[4].curAmount = 0; } powerupDeactivate(gMe, kPwUpJumpBoots); } @@ -236,7 +236,7 @@ void ToggleBoots(void) { viewSetMessage("You have the Jumping Boots."); if (!VanillaMode()) - gMe->at202[kPwUpJumpBoots] = gPowerUpInfo[kPwUpJumpBoots].bonusTime; + gMe->pwUpTime[kPwUpJumpBoots] = gPowerUpInfo[kPwUpJumpBoots].bonusTime; powerupActivate(gMe, kPwUpJumpBoots); } } @@ -247,7 +247,7 @@ void ToggleInvisibility(void) { viewSetMessage("You are visible."); if (!VanillaMode()) - gMe->at202[kPwUpShadowCloak] = 0; + gMe->pwUpTime[kPwUpShadowCloak] = 0; powerupDeactivate(gMe, kPwUpShadowCloak); } else @@ -263,7 +263,7 @@ void ToggleInvulnerability(void) { viewSetMessage("You are vulnerable."); if (!VanillaMode()) - gMe->at202[kPwUpDeathMask] = 0; + gMe->pwUpTime[kPwUpDeathMask] = 0; powerupDeactivate(gMe, kPwUpDeathMask); } else @@ -279,7 +279,7 @@ void ToggleDelirium(void) { viewSetMessage("You are not delirious."); if (!VanillaMode()) - gMe->at202[kPwUpDeliriumShroom] = 0; + gMe->pwUpTime[kPwUpDeliriumShroom] = 0; powerupDeactivate(gMe, kPwUpDeliriumShroom); } else @@ -769,7 +769,7 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs) SetClipMode(!gNoClip); break; case kCheatMpkfa: - SetGodMode(!gMe->at31a); + SetGodMode(!gMe->godMode); break; case kCheatCapInMyAss: SetGodMode(false); @@ -781,36 +781,36 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs) SetWeapons(true); break; case kCheatKevorkian: - actDamageSprite(gMe->at5b, gMe->pSprite, DAMAGE_TYPE_2, 8000); + actDamageSprite(gMe->nSprite, gMe->pSprite, DAMAGE_TYPE_2, 8000); viewSetMessage("Kevorkian approves."); break; case kCheatMcGee: { if (!gMe->pXSprite->burnTime) - evPost(gMe->at5b, 3, 0, kCallbackFXFlameLick); - actBurnSprite(actSpriteIdToOwnerId(gMe->at5b), gMe->pXSprite, 2400); + evPost(gMe->nSprite, 3, 0, kCallbackFXFlameLick); + actBurnSprite(actSpriteIdToOwnerId(gMe->nSprite), gMe->pXSprite, 2400); viewSetMessage("You're fired!"); break; } case kCheatEdmark: - actDamageSprite(gMe->at5b, gMe->pSprite, DAMAGE_TYPE_3, 8000); + actDamageSprite(gMe->nSprite, gMe->pSprite, DAMAGE_TYPE_3, 8000); viewSetMessage("Ahhh...those were the days."); break; case kCheatKrueger: { actHealDude(gMe->pXSprite, 200, 200); - gMe->at33e[1] = VanillaMode() ? 200 : 3200; + gMe->armor[1] = VanillaMode() ? 200 : 3200; if (!gMe->pXSprite->burnTime) - evPost(gMe->at5b, 3, 0, kCallbackFXFlameLick); - actBurnSprite(actSpriteIdToOwnerId(gMe->at5b), gMe->pXSprite, 2400); + evPost(gMe->nSprite, 3, 0, kCallbackFXFlameLick); + actBurnSprite(actSpriteIdToOwnerId(gMe->nSprite), gMe->pXSprite, 2400); viewSetMessage("Flame retardant!"); break; } case kCheatSterno: - gMe->at36a = 250; + gMe->blindEffect = 250; break; - case kCheat14: // quake (causing a little flicker), not used by any cheat code (dead code) - gMe->at35a = 360; + case kCheat14: // quakeEffect (causing a little flickerEffect), not used by any cheat code (dead code) + gMe->flickerEffect = 360; break; case kCheatSpork: actHealDude(gMe->pXSprite, 200, 200); @@ -823,16 +823,16 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs) { viewSetMessage("You have half armor."); for (int i = 0; i < 3; i++) - gMe->at33e[i] = 1600; + gMe->armor[i] = 1600; } break; case kCheatFrankenstein: - gMe->packInfo[0].at1 = 100; + gMe->packSlots[0].curAmount = 100; break; case kCheatCheeseHead: - gMe->packInfo[1].at1 = 100; + gMe->packSlots[1].curAmount = 100; if (!VanillaMode()) - gMe->at202[kPwUpDivingSuit] = gPowerUpInfo[kPwUpDivingSuit].bonusTime; + gMe->pwUpTime[kPwUpDivingSuit] = gPowerUpInfo[kPwUpDivingSuit].bonusTime; break; case kCheatTequila: ToggleWooMode(); @@ -883,9 +883,9 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs) break; case kCheatCousteau: actHealDude(gMe->pXSprite,200,200); - gMe->packInfo[1].at1 = 100; + gMe->packSlots[1].curAmount = 100; if (!VanillaMode()) - gMe->at202[kPwUpDivingSuit] = gPowerUpInfo[kPwUpDivingSuit].bonusTime; + gMe->pwUpTime[kPwUpDivingSuit] = gPowerUpInfo[kPwUpDivingSuit].bonusTime; break; case kCheatForkYou: SetInfiniteAmmo(false); @@ -898,9 +898,9 @@ void CCheatMgr::Process(CCheatMgr::CHEATCODE nCheatCode, char* pzArgs) SetWooMode(true); powerupActivate(gMe, kPwUpDeliriumShroom); gMe->pXSprite->health = 16; - gMe->atcb[1] = 1; - gMe->atbd = 0; - gMe->atbe = 1; + gMe->hasWeapon[1] = 1; + gMe->curWeapon = 0; + gMe->nextWeapon = 1; break; default: break; diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index 5da4387b9..e0bd53ce9 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -263,7 +263,7 @@ void CalcGameChecksum(void) gChecksum[0] = wrand(); for (int p = connecthead; p >= 0; p = connectpoint2[p]) { - int *pBuffer = &gPlayer[p].at22; + int *pBuffer = &gPlayer[p].used1; int sum = 0; int length = ((char*)&gPlayer[p+1]-(char*)pBuffer)/4; while (length--) @@ -1394,12 +1394,12 @@ void faketimerhandler(void) void netPlayerQuit(int nPlayer) { char buffer[128]; - sprintf(buffer, "%s left the game with %d frags.", gProfile[nPlayer].name, gPlayer[nPlayer].at2c6); + sprintf(buffer, "%s left the game with %d frags.", gProfile[nPlayer].name, gPlayer[nPlayer].fragCount); viewSetMessage(buffer); if (gGameStarted) { seqKill(3, gPlayer[nPlayer].pSprite->extra); - actPostSprite(gPlayer[nPlayer].at5b, kStatFree); + actPostSprite(gPlayer[nPlayer].nSprite, kStatFree); if (nPlayer == gViewIndex) gViewIndex = myconnectindex; gView = &gPlayer[gViewIndex]; diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 2d92cd8f4..460211304 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -396,7 +396,7 @@ static int osdcmd_god(osdcmdptr_t UNUSED(parm)) UNREFERENCED_CONST_PARAMETER(parm); if (numplayers == 1 && gGameStarted) { - SetGodMode(!gMe->at31a); + SetGodMode(!gMe->godMode); gCheatMgr.m_bPlayerCheated = true; } else diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index b9f01c1d2..805b46911 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -137,7 +137,7 @@ int gDefaultAccel[] = { }; -POSTURE gPosture[4][3] = { +POSTURE gPosture[kModeMax][kPostureMax] = { // normal human { @@ -442,7 +442,7 @@ int powerupCheck(PLAYER *pPlayer, int nPowerUp) int nPack = powerupToPackItem(nPowerUp); if (nPack >= 0 && !packItemActive(pPlayer, nPack)) return 0; - return pPlayer->at202[nPowerUp]; + return pPlayer->pwUpTime[nPowerUp]; } bool isGrown(spritetype* pSprite) { @@ -478,10 +478,10 @@ bool resetPlayerSize(PLAYER* pPlayer) { void deactivateSizeShrooms(PLAYER* pPlayer) { powerupDeactivate(pPlayer, kPwUpGrowShroom); - pPlayer->at202[kPwUpGrowShroom] = 0; + pPlayer->pwUpTime[kPwUpGrowShroom] = 0; powerupDeactivate(pPlayer, kPwUpShrinkShroom); - pPlayer->at202[kPwUpShrinkShroom] = 0; + pPlayer->pwUpTime[kPwUpShrinkShroom] = 0; } @@ -503,11 +503,11 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp) { if (powerupCheck(pPlayer, nPowerUp) > 0 && gPowerUpInfo[nPowerUp].pickupOnce) return 0; - if (!pPlayer->at202[nPowerUp]) - pPlayer->at202[nPowerUp] = gPowerUpInfo[nPowerUp].bonusTime; + if (!pPlayer->pwUpTime[nPowerUp]) + pPlayer->pwUpTime[nPowerUp] = gPowerUpInfo[nPowerUp].bonusTime; int nPack = powerupToPackItem(nPowerUp); if (nPack >= 0) - pPlayer->packInfo[nPack].at0 = 1; + pPlayer->packSlots[nPack].isActive = 1; switch (nPowerUp + kItemBase) { case kItemModernMapLevel: @@ -525,7 +525,7 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp) growPlayerSize(pPlayer, 2); if (powerupCheck(&gPlayer[pPlayer->pSprite->type - kDudePlayer1], kPwUpShadowCloak) > 0) { powerupDeactivate(pPlayer, kPwUpShadowCloak); - pPlayer->at202[kPwUpShadowCloak] = 0; + pPlayer->pwUpTime[kPwUpShadowCloak] = 0; } if (ceilIsTooLow(pPlayer->pSprite)) @@ -534,7 +534,7 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp) break; case kItemFeatherFall: case kItemJumpBoots: - pPlayer->ata1[0]++; + pPlayer->damageControl[0]++; break; case kItemReflectShots: // reflective shots if (pPlayer == gMe && gGameOptions.nGameType == 0) @@ -542,21 +542,21 @@ char powerupActivate(PLAYER *pPlayer, int nPowerUp) break; case kItemDeathMask: for (int i = 0; i < 7; i++) - pPlayer->ata1[i]++; + pPlayer->damageControl[i]++; break; case kItemDivingSuit: // diving suit - pPlayer->ata1[4]++; + pPlayer->damageControl[4]++; if (pPlayer == gMe && gGameOptions.nGameType == 0) sfxSetReverb(1); break; case kItemGasMask: - pPlayer->ata1[4]++; + pPlayer->damageControl[4]++; break; case kItemArmorAsbest: - pPlayer->ata1[1]++; + pPlayer->damageControl[1]++; break; case kItemTwoGuns: - pPlayer->atc.newWeapon = pPlayer->atbd; + pPlayer->input.newWeapon = pPlayer->curWeapon; WeaponRaise(pPlayer); break; } @@ -568,7 +568,7 @@ void powerupDeactivate(PLAYER *pPlayer, int nPowerUp) { int nPack = powerupToPackItem(nPowerUp); if (nPack >= 0) - pPlayer->packInfo[nPack].at0 = 0; + pPlayer->packSlots[nPack].isActive = 0; switch (nPowerUp + kItemBase) { case kItemShroomShrink: @@ -583,29 +583,29 @@ void powerupDeactivate(PLAYER *pPlayer, int nPowerUp) break; case kItemFeatherFall: case kItemJumpBoots: - pPlayer->ata1[0]--; + pPlayer->damageControl[0]--; break; case kItemDeathMask: for (int i = 0; i < 7; i++) - pPlayer->ata1[i]--; + pPlayer->damageControl[i]--; break; case kItemDivingSuit: - pPlayer->ata1[4]--; - if (pPlayer == gMe && VanillaMode() ? true : pPlayer->at202[24] == 0) + pPlayer->damageControl[4]--; + if (pPlayer == gMe && VanillaMode() ? true : pPlayer->pwUpTime[24] == 0) sfxSetReverb(0); break; case kItemReflectShots: - if (pPlayer == gMe && VanillaMode() ? true : pPlayer->packInfo[1].at0 == 0) + if (pPlayer == gMe && VanillaMode() ? true : pPlayer->packSlots[1].isActive == 0) sfxSetReverb(0); break; case kItemGasMask: - pPlayer->ata1[4]--; + pPlayer->damageControl[4]--; break; case kItemArmorAsbest: - pPlayer->ata1[1]--; + pPlayer->damageControl[1]--; break; case kItemTwoGuns: - pPlayer->atc.newWeapon = pPlayer->atbd; + pPlayer->input.newWeapon = pPlayer->curWeapon; WeaponRaise(pPlayer); break; } @@ -621,29 +621,29 @@ void powerupSetState(PLAYER *pPlayer, int nPowerUp, char bState) void powerupProcess(PLAYER *pPlayer) { - pPlayer->at31d = ClipLow(pPlayer->at31d-4, 0); + pPlayer->packItemTime = ClipLow(pPlayer->packItemTime-4, 0); for (int i = kMaxPowerUps-1; i >= 0; i--) { int nPack = powerupToPackItem(i); if (nPack >= 0) { - if (pPlayer->packInfo[nPack].at0) + if (pPlayer->packSlots[nPack].isActive) { - pPlayer->at202[i] = ClipLow(pPlayer->at202[i]-4, 0); - if (pPlayer->at202[i]) - pPlayer->packInfo[nPack].at1 = (100*pPlayer->at202[i])/gPowerUpInfo[i].bonusTime; + pPlayer->pwUpTime[i] = ClipLow(pPlayer->pwUpTime[i]-4, 0); + if (pPlayer->pwUpTime[i]) + pPlayer->packSlots[nPack].curAmount = (100*pPlayer->pwUpTime[i])/gPowerUpInfo[i].bonusTime; else { powerupDeactivate(pPlayer, i); - if (pPlayer->at321 == nPack) - pPlayer->at321 = 0; + if (pPlayer->packItemId == nPack) + pPlayer->packItemId = 0; } } } - else if (pPlayer->at202[i] > 0) + else if (pPlayer->pwUpTime[i] > 0) { - pPlayer->at202[i] = ClipLow(pPlayer->at202[i]-4, 0); - if (!pPlayer->at202[i]) + pPlayer->pwUpTime[i] = ClipLow(pPlayer->pwUpTime[i]-4, 0); + if (!pPlayer->pwUpTime[i]) powerupDeactivate(pPlayer, i); } } @@ -653,7 +653,7 @@ void powerupClear(PLAYER *pPlayer) { for (int i = kMaxPowerUps-1; i >= 0; i--) { - pPlayer->at202[i] = 0; + pPlayer->pwUpTime[i] = 0; } } @@ -705,16 +705,16 @@ char packAddItem(PLAYER *pPlayer, unsigned int nPack) { if (nPack <= 4) { - if (pPlayer->packInfo[nPack].at1 >= 100) + if (pPlayer->packSlots[nPack].curAmount >= 100) return 0; - pPlayer->packInfo[nPack].at1 = 100; + pPlayer->packSlots[nPack].curAmount = 100; int nPowerUp = packItemToPowerup(nPack); if (nPowerUp >= 0) - pPlayer->at202[nPowerUp] = gPowerUpInfo[nPowerUp].bonusTime; - if (pPlayer->at321 == -1) - pPlayer->at321 = nPack; - if (!pPlayer->packInfo[pPlayer->at321].at1) - pPlayer->at321 = nPack; + pPlayer->pwUpTime[nPowerUp] = gPowerUpInfo[nPowerUp].bonusTime; + if (pPlayer->packItemId == -1) + pPlayer->packItemId = nPack; + if (!pPlayer->packSlots[pPlayer->packItemId].curAmount) + pPlayer->packItemId = nPack; } else ThrowError("Unhandled pack item %d", nPack); @@ -723,19 +723,19 @@ char packAddItem(PLAYER *pPlayer, unsigned int nPack) int packCheckItem(PLAYER *pPlayer, int nPack) { - return pPlayer->packInfo[nPack].at1; + return pPlayer->packSlots[nPack].curAmount; } char packItemActive(PLAYER *pPlayer, int nPack) { - return pPlayer->packInfo[nPack].at0; + return pPlayer->packSlots[nPack].isActive; } void packUseItem(PLAYER *pPlayer, int nPack) { char v4 = 0; int nPowerUp = -1; - if (pPlayer->packInfo[nPack].at1 > 0) + if (pPlayer->packSlots[nPack].curAmount > 0) { switch (nPack) { @@ -745,9 +745,9 @@ void packUseItem(PLAYER *pPlayer, int nPack) unsigned int health = pXSprite->health>>4; if (health < 100) { - int heal = ClipHigh(100-health, pPlayer->packInfo[0].at1); + int heal = ClipHigh(100-health, pPlayer->packSlots[0].curAmount); actHealDude(pXSprite, heal, 100); - pPlayer->packInfo[0].at1 -= heal; + pPlayer->packSlots[0].curAmount -= heal; } break; } @@ -772,41 +772,41 @@ void packUseItem(PLAYER *pPlayer, int nPack) return; } } - pPlayer->at31d = 0; + pPlayer->packItemTime = 0; if (v4) - powerupSetState(pPlayer, nPowerUp, pPlayer->packInfo[nPack].at0); + powerupSetState(pPlayer, nPowerUp, pPlayer->packSlots[nPack].isActive); } void packPrevItem(PLAYER *pPlayer) { - if (pPlayer->at31d > 0) + if (pPlayer->packItemTime > 0) { - for (int nPrev = ClipLow(pPlayer->at321-1,0); nPrev >= 0; nPrev--) + for (int nPrev = ClipLow(pPlayer->packItemId-1,0); nPrev >= 0; nPrev--) { - if (pPlayer->packInfo[nPrev].at1) + if (pPlayer->packSlots[nPrev].curAmount) { - pPlayer->at321 = nPrev; + pPlayer->packItemId = nPrev; break; } } } - pPlayer->at31d = 600; + pPlayer->packItemTime = 600; } void packNextItem(PLAYER *pPlayer) { - if (pPlayer->at31d > 0) + if (pPlayer->packItemTime > 0) { - for (int nNext = ClipHigh(pPlayer->at321+1,5); nNext < 5; nNext++) + for (int nNext = ClipHigh(pPlayer->packItemId+1,5); nNext < 5; nNext++) { - if (pPlayer->packInfo[nNext].at1) + if (pPlayer->packSlots[nNext].curAmount) { - pPlayer->at321 = nNext; + pPlayer->packItemId = nNext; break; } } } - pPlayer->at31d = 600; + pPlayer->packItemTime = 600; } char playerSeqPlaying(PLAYER * pPlayer, int nSeq) @@ -822,13 +822,13 @@ void playerSetRace(PLAYER *pPlayer, int nLifeMode) dassert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown); DUDEINFO *pDudeInfo = pPlayer->pDudeInfo; *pDudeInfo = gPlayerTemplate[nLifeMode]; - pPlayer->at5f = nLifeMode; + pPlayer->lifeMode = nLifeMode; // By NoOne: don't forget to change clipdist for grow and shrink modes pPlayer->pSprite->clipdist = pDudeInfo->clipdist; for (int i = 0; i < 7; i++) - pDudeInfo->at70[i] = mulscale8(Handicap[gProfile[pPlayer->at57].skill], pDudeInfo->startDamage[i]); + pDudeInfo->at70[i] = mulscale8(Handicap[gProfile[pPlayer->nPlayer].skill], pDudeInfo->startDamage[i]); } void playerSetGodMode(PLAYER *pPlayer, char bGodMode) @@ -836,29 +836,29 @@ void playerSetGodMode(PLAYER *pPlayer, char bGodMode) if (bGodMode) { for (int i = 0; i < 7; i++) - pPlayer->ata1[i]++; + pPlayer->damageControl[i]++; } else { for (int i = 0; i < 7; i++) - pPlayer->ata1[i]--; + pPlayer->damageControl[i]--; } - pPlayer->at31a = bGodMode; + pPlayer->godMode = bGodMode; } void playerResetInertia(PLAYER *pPlayer) { - POSTURE *pPosture = &gPosture[pPlayer->at5f][pPlayer->at2f]; - pPlayer->at67 = pPlayer->pSprite->z-pPosture->at24; - pPlayer->at6f = pPlayer->pSprite->z-pPosture->at28; - viewBackupView(pPlayer->at57); + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][pPlayer->posture]; + pPlayer->zView = pPlayer->pSprite->z-pPosture->eyeAboveZ; + pPlayer->zWeapon = pPlayer->pSprite->z-pPosture->weaponAboveZ; + viewBackupView(pPlayer->nPlayer); } void playerCorrectInertia(PLAYER* pPlayer, vec3_t const *oldpos) { - pPlayer->at67 += pPlayer->pSprite->z-oldpos->z; - pPlayer->at6f += pPlayer->pSprite->z-oldpos->z; - viewCorrectViewOffsets(pPlayer->at57, oldpos); + pPlayer->zView += pPlayer->pSprite->z-oldpos->z; + pPlayer->zWeapon += pPlayer->pSprite->z-oldpos->z; + viewCorrectViewOffsets(pPlayer->nPlayer, oldpos); } void playerResetPowerUps(PLAYER* pPlayer) @@ -866,14 +866,14 @@ void playerResetPowerUps(PLAYER* pPlayer) for (int i = 0; i < kMaxPowerUps; i++) { if (!VanillaMode() && (i == kPwUpJumpBoots || i == kPwUpDivingSuit || i == kPwUpCrystalBall || i == kPwUpBeastVision)) continue; - pPlayer->at202[i] = 0; + pPlayer->pwUpTime[i] = 0; } } void playerStart(int nPlayer) { PLAYER* pPlayer = &gPlayer[nPlayer]; - GINPUT* pInput = &pPlayer->atc; + GINPUT* pInput = &pPlayer->input; ZONE* pStartZone = NULL; // normal start position @@ -885,7 +885,7 @@ void playerStart(int nPlayer) else if (gGameOptions.nGameType == 3 && gTeamsSpawnUsed == true) { int maxRetries = 5; while (maxRetries-- > 0) { - if (pPlayer->at2ea == 0) pStartZone = &gStartZoneTeam1[Random(3)]; + if (pPlayer->teamId == 0) pStartZone = &gStartZoneTeam1[Random(3)]; else pStartZone = &gStartZoneTeam2[Random(3)]; if (maxRetries != 0) { @@ -911,7 +911,7 @@ void playerStart(int nPlayer) XSPRITE *pXSprite = &xsprite[pSprite->extra]; pPlayer->pSprite = pSprite; pPlayer->pXSprite = pXSprite; - pPlayer->at5b = pSprite->index; + pPlayer->nSprite = pSprite->index; DUDEINFO *pDudeInfo = &dudeInfo[kDudePlayer1 + nPlayer - kDudeBase]; pPlayer->pDudeInfo = pDudeInfo; playerSetRace(pPlayer, kModeHuman); @@ -921,7 +921,7 @@ void playerStart(int nPlayer) int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); pSprite->z -= bottom - pSprite->z; - pSprite->pal = 11+(pPlayer->at2ea&3); + pSprite->pal = 11+(pPlayer->teamId&3); pPlayer->angold = pSprite->ang = pStartZone->ang; pPlayer->q16ang = fix16_from_int(pSprite->ang); pSprite->type = kDudePlayer1+nPlayer; @@ -931,49 +931,49 @@ void playerStart(int nPlayer) pXSprite->burnSource = -1; pPlayer->pXSprite->health = pDudeInfo->startHealth<<4; pPlayer->pSprite->cstat &= (unsigned short)~32768; - pPlayer->at63 = 0; + pPlayer->bloodlust = 0; pPlayer->q16horiz = 0; pPlayer->q16slopehoriz = 0; pPlayer->q16look = 0; - pPlayer->at83 = 0; - pPlayer->at2ee = -1; - pPlayer->at2f2 = 1200; - pPlayer->at2f6 = 0; - pPlayer->at2fa = 0; - pPlayer->at2fe = 0; - pPlayer->at302 = 0; + pPlayer->slope = 0; + pPlayer->fraggerId = -1; + pPlayer->underwaterTime = 1200; + pPlayer->bloodTime = 0; + pPlayer->gooTime = 0; + pPlayer->wetTime = 0; + pPlayer->bubbleTime = 0; pPlayer->at306 = 0; - pPlayer->at30a = 0; - pPlayer->at30e = 0; - pPlayer->at312 = 0; - pPlayer->at316 = 0; - pPlayer->at2f = 0; + pPlayer->restTime = 0; + pPlayer->kickPower = 0; + pPlayer->laughCount = 0; + pPlayer->spin = 0; + pPlayer->posture = 0; pPlayer->voodooTarget = -1; - pPlayer->at34e = 0; - pPlayer->at352 = 0; - pPlayer->at356 = 0; + pPlayer->voodooTargets = 0; + pPlayer->voodooVar1 = 0; + pPlayer->vodooVar2 = 0; playerResetInertia(pPlayer); - pPlayer->at73 = 0; - pPlayer->at1ca.dx = 0x4000; - pPlayer->at1ca.dy = 0; - pPlayer->at1ca.dz = 0; - pPlayer->at1d6 = -1; - pPlayer->at6b = pPlayer->at73; + pPlayer->zWeaponVel = 0; + pPlayer->relAim.dx = 0x4000; + pPlayer->relAim.dy = 0; + pPlayer->relAim.dz = 0; + pPlayer->aimTarget = -1; + pPlayer->zViewVel = pPlayer->zWeaponVel; if (!(gGameOptions.nGameType == 1 && gGameOptions.bKeepKeysOnRespawn)) for (int i = 0; i < 8; i++) - pPlayer->at88[i] = gGameOptions.nGameType >= 2; - pPlayer->at90 = 0; + pPlayer->hasKey[i] = gGameOptions.nGameType >= 2; + pPlayer->hasFlag = 0; for (int i = 0; i < 8; i++) - pPlayer->at91[i] = -1; + pPlayer->used2[i] = -1; for (int i = 0; i < 7; i++) - pPlayer->ata1[i] = 0; - if (pPlayer->at31a) + pPlayer->damageControl[i] = 0; + if (pPlayer->godMode) playerSetGodMode(pPlayer, 1); gInfiniteAmmo = 0; gFullMap = 0; - pPlayer->at1ba = 0; - pPlayer->at1fe = 0; - pPlayer->atbe = 0; + pPlayer->throwPower = 0; + pPlayer->deathTime = 0; + pPlayer->nextWeapon = 0; xvel[pSprite->index] = yvel[pSprite->index] = zvel[pSprite->index] = 0; pInput->q16turn = 0; pInput->keyFlags.word = 0; @@ -982,18 +982,18 @@ void playerStart(int nPlayer) pInput->q16mlook = 0; pInput->buttonFlags.byte = 0; pInput->useFlags.byte = 0; - pPlayer->at35a = 0; - pPlayer->at37f = 0; - pPlayer->at35e = 0; - pPlayer->at362 = 0; - pPlayer->at366 = 0; - pPlayer->at36a = 0; - pPlayer->at36e = 0; - pPlayer->at372 = 0; - pPlayer->atbf = 0; - pPlayer->atc3 = 0; - pPlayer->at26 = -1; - pPlayer->at376 = 0; + pPlayer->flickerEffect = 0; + pPlayer->quakeEffect = 0; + pPlayer->tiltEffect = 0; + pPlayer->visibility = 0; + pPlayer->painEffect = 0; + pPlayer->blindEffect = 0; + pPlayer->chokeEffect = 0; + pPlayer->handTime = 0; + pPlayer->weaponTimer = 0; + pPlayer->weaponState = 0; + pPlayer->weaponQav = -1; + pPlayer->hand = 0; pPlayer->nWaterPal = 0; playerResetPowerUps(pPlayer); @@ -1006,7 +1006,7 @@ void playerStart(int nPlayer) } if (IsUnderwaterSector(pSprite->sectnum)) { - pPlayer->at2f = 1; + pPlayer->posture = 1; pPlayer->pXSprite->medium = kMediumWater; } } @@ -1022,41 +1022,41 @@ void playerReset(PLAYER *pPlayer) dassert(pPlayer != NULL); for (int i = 0; i < 14; i++) { - pPlayer->atcb[i] = gInfiniteAmmo; - pPlayer->atd9[i] = 0; + pPlayer->hasWeapon[i] = gInfiniteAmmo; + pPlayer->weaponMode[i] = 0; } - pPlayer->atcb[1] = 1; - pPlayer->atbd = 0; - pPlayer->at2a = -1; - pPlayer->atc.newWeapon = 1; + pPlayer->hasWeapon[1] = 1; + pPlayer->curWeapon = 0; + pPlayer->qavCallback = -1; + pPlayer->input.newWeapon = 1; for (int i = 0; i < 14; i++) { - pPlayer->at111[0][i] = dword_136400[i]; - pPlayer->at111[1][i] = dword_136438[i]; + pPlayer->weaponOrder[0][i] = dword_136400[i]; + pPlayer->weaponOrder[1][i] = dword_136438[i]; } for (int i = 0; i < 12; i++) { if (gInfiniteAmmo) - pPlayer->at181[i] = gAmmoInfo[i].at0; + pPlayer->ammCount[i] = gAmmoInfo[i].max; else - pPlayer->at181[i] = 0; + pPlayer->ammCount[i] = 0; } for (int i = 0; i < 3; i++) - pPlayer->at33e[i] = 0; - pPlayer->atbf = 0; - pPlayer->atc3 = 0; - pPlayer->at26 = -1; - pPlayer->at1b1 = 0; - pPlayer->at321 = -1; + pPlayer->armor[i] = 0; + pPlayer->weaponTimer = 0; + pPlayer->weaponState = 0; + pPlayer->weaponQav = -1; + pPlayer->qavLoop = 0; + pPlayer->packItemId = -1; for (int i = 0; i < 5; i++) { - pPlayer->packInfo[i].at0 = 0; - pPlayer->packInfo[i].at1 = 0; + pPlayer->packSlots[i].isActive = 0; + pPlayer->packSlots[i].curAmount = 0; } for (int i = 0; i < 4; i++) { for (int a = 0; a < 3; a++) - gPosture[i][a].at0 = gPosture[i][a].at4 = gPosture[i][a].at8 = gDefaultAccel[a]; + gPosture[i][a].frontAccel = gPosture[i][a].sideAccel = gPosture[i][a].backAccel = gDefaultAccel[a]; } } @@ -1068,14 +1068,14 @@ void playerInit(int nPlayer, unsigned int a2) PLAYER *pPlayer = &gPlayer[nPlayer]; if (!(a2&1)) memset(pPlayer, 0, sizeof(PLAYER)); - pPlayer->at57 = nPlayer; - pPlayer->at2ea = nPlayer; + pPlayer->nPlayer = nPlayer; + pPlayer->teamId = nPlayer; if (gGameOptions.nGameType == 3) - pPlayer->at2ea = nPlayer&1; - pPlayer->at2c6 = 0; + pPlayer->teamId = nPlayer&1; + pPlayer->fragCount = 0; memset(dword_21EFB0, 0, sizeof(dword_21EFB0)); memset(dword_21EFD0, 0, sizeof(dword_21EFD0)); - memset(pPlayer->at2ca, 0, sizeof(pPlayer->at2ca)); + memset(pPlayer->fragInfo, 0, sizeof(pPlayer->fragInfo)); if (!(a2&1)) playerReset(pPlayer); } @@ -1087,7 +1087,7 @@ char sub_3A158(PLAYER *a1, spritetype *a2) if (a2 && a2->index == nSprite) continue; spritetype *pSprite = &sprite[nSprite]; - if (pSprite->type == kThingDroppedLifeLeech && actOwnerIdToSpriteId(pSprite->owner) == a1->at5b) + if (pSprite->type == kThingDroppedLifeLeech && actOwnerIdToSpriteId(pSprite->owner) == a1->nSprite) return 1; } return 0; @@ -1122,35 +1122,35 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { if (gGameOptions.nGameType != 3 || pItem->extra <= 0) return 0; XSPRITE * pXItem = &xsprite[pItem->extra]; if (pItem->type == kItemFlagABase) { - if (pPlayer->at2ea == 1) { - if ((pPlayer->at90 & 1) == 0 && pXItem->state) { - pPlayer->at90 |= 1; - pPlayer->at91[0] = pItem->index; + if (pPlayer->teamId == 1) { + if ((pPlayer->hasFlag & 1) == 0 && pXItem->state) { + pPlayer->hasFlag |= 1; + pPlayer->used2[0] = pItem->index; trTriggerSprite(pItem->index, pXItem, kCmdOff); - sprintf(buffer, "%s stole Blue Flag", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s stole Blue Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8007, 255, 2, 0); viewSetMessage(buffer); } } - if (pPlayer->at2ea == 0) { + if (pPlayer->teamId == 0) { - if ((pPlayer->at90 & 1) != 0 && !pXItem->state) { - pPlayer->at90 &= ~1; - pPlayer->at91[0] = -1; + if ((pPlayer->hasFlag & 1) != 0 && !pXItem->state) { + pPlayer->hasFlag &= ~1; + pPlayer->used2[0] = -1; trTriggerSprite(pItem->index, pXItem, kCmdOn); - sprintf(buffer, "%s returned Blue Flag", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s returned Blue Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8003, 255, 2, 0); viewSetMessage(buffer); } - if ((pPlayer->at90 & 2) != 0 && pXItem->state) { - pPlayer->at90 &= ~2; - pPlayer->at91[1] = -1; - dword_21EFB0[pPlayer->at2ea] += 10; - dword_21EFD0[pPlayer->at2ea] += 240; + if ((pPlayer->hasFlag & 2) != 0 && pXItem->state) { + pPlayer->hasFlag &= ~2; + pPlayer->used2[1] = -1; + dword_21EFB0[pPlayer->teamId] += 10; + dword_21EFD0[pPlayer->teamId] += 240; evSend(0, 0, 81, kCmdOn); - sprintf(buffer, "%s captured Red Flag!", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s captured Red Flag!", gProfile[pPlayer->nPlayer].name); sndStartSample(8001, 255, 2, 0); viewSetMessage(buffer); #if 0 @@ -1166,35 +1166,35 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { } else if (pItem->type == kItemFlagBBase) { - if (pPlayer->at2ea == 0) { - if ((pPlayer->at90 & 2) == 0 && pXItem->state) { - pPlayer->at90 |= 2; - pPlayer->at91[1] = pItem->index; + if (pPlayer->teamId == 0) { + if ((pPlayer->hasFlag & 2) == 0 && pXItem->state) { + pPlayer->hasFlag |= 2; + pPlayer->used2[1] = pItem->index; trTriggerSprite(pItem->index, pXItem, kCmdOff); - sprintf(buffer, "%s stole Red Flag", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s stole Red Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8006, 255, 2, 0); viewSetMessage(buffer); } } - if (pPlayer->at2ea == 1) { - if ((pPlayer->at90 & 2) != 0 && !pXItem->state) + if (pPlayer->teamId == 1) { + if ((pPlayer->hasFlag & 2) != 0 && !pXItem->state) { - pPlayer->at90 &= ~2; - pPlayer->at91[1] = -1; + pPlayer->hasFlag &= ~2; + pPlayer->used2[1] = -1; trTriggerSprite(pItem->index, pXItem, kCmdOn); - sprintf(buffer, "%s returned Red Flag", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s returned Red Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8002, 255, 2, 0); viewSetMessage(buffer); } - if ((pPlayer->at90 & 1) != 0 && pXItem->state) + if ((pPlayer->hasFlag & 1) != 0 && pXItem->state) { - pPlayer->at90 &= ~1; - pPlayer->at91[0] = -1; - dword_21EFB0[pPlayer->at2ea] += 10; - dword_21EFD0[pPlayer->at2ea] += 240; + pPlayer->hasFlag &= ~1; + pPlayer->used2[0] = -1; + dword_21EFB0[pPlayer->teamId] += 10; + dword_21EFD0[pPlayer->teamId] += 240; evSend(0, 0, 80, kCmdOn); - sprintf(buffer, "%s captured Blue Flag!", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s captured Blue Flag!", gProfile[pPlayer->nPlayer].name); sndStartSample(8000, 255, 2, 0); viewSetMessage(buffer); #if 0 @@ -1212,15 +1212,15 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { case kItemFlagA: if (gGameOptions.nGameType != 3) return 0; evKill(pItem->index, 3, kCallbackReturnFlag); - pPlayer->at90 |= 1; - pPlayer->at91[0] = pItem->index; + pPlayer->hasFlag |= 1; + pPlayer->used2[0] = pItem->index; gBlueFlagDropped = false; break; case kItemFlagB: if (gGameOptions.nGameType != 3) return 0; evKill(pItem->index, 3, kCallbackReturnFlag); - pPlayer->at90 |= 2; - pPlayer->at91[1] = pItem->index; + pPlayer->hasFlag |= 2; + pPlayer->used2[1] = pItem->index; gRedFlagDropped = false; break; case kItemArmorBasic: @@ -1229,18 +1229,18 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { case kItemArmorSpirit: case kItemArmorSuper: { ARMORDATA *pArmorData = &armorData[pItem->type - kItemArmorBasic]; bool pickedUp = false; - if (pPlayer->at33e[1] < pArmorData->atc) { - pPlayer->at33e[1] = ClipHigh(pPlayer->at33e[1]+pArmorData->at8, pArmorData->atc); + if (pPlayer->armor[1] < pArmorData->atc) { + pPlayer->armor[1] = ClipHigh(pPlayer->armor[1]+pArmorData->at8, pArmorData->atc); pickedUp = true; } - if (pPlayer->at33e[0] < pArmorData->at4) { - pPlayer->at33e[0] = ClipHigh(pPlayer->at33e[0]+pArmorData->at0, pArmorData->at4); + if (pPlayer->armor[0] < pArmorData->at4) { + pPlayer->armor[0] = ClipHigh(pPlayer->armor[0]+pArmorData->at0, pArmorData->at4); pickedUp = true; } - if (pPlayer->at33e[2] < pArmorData->at14) { - pPlayer->at33e[2] = ClipHigh(pPlayer->at33e[2]+pArmorData->at10, pArmorData->at14); + if (pPlayer->armor[2] < pArmorData->at14) { + pPlayer->armor[2] = ClipHigh(pPlayer->armor[2]+pArmorData->at10, pArmorData->at14); pickedUp = true; } @@ -1249,7 +1249,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { break; } case kItemCrystalBall: - if (gGameOptions.nGameType == 0 || !packAddItem(pPlayer, gItemData[nType].at8)) return 0; + if (gGameOptions.nGameType == 0 || !packAddItem(pPlayer, gItemData[nType].packSlot)) return 0; break; case kItemKeySkull: case kItemKeyEye: @@ -1258,8 +1258,8 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { case kItemKeySpider: case kItemKeyMoon: case kItemKeyKey7: - if (pPlayer->at88[pItem->type-99]) return 0; - pPlayer->at88[pItem->type-99] = 1; + if (pPlayer->hasKey[pItem->type-99]) return 0; + pPlayer->hasKey[pItem->type-99] = 1; pickupSnd = 781; break; case kItemHealthMedPouch: @@ -1278,7 +1278,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { case kItemJumpBoots: case kItemDivingSuit: case kItemBeastVision: - if (!packAddItem(pPlayer, gItemData[nType].at8)) return 0; + if (!packAddItem(pPlayer, gItemData[nType].packSlot)) return 0; break; default: if (!powerupActivate(pPlayer, nType)) return 0; @@ -1291,49 +1291,49 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) { char PickupAmmo(PLAYER* pPlayer, spritetype* pAmmo) { AMMOITEMDATA* pAmmoItemData = &gAmmoItemData[pAmmo->type - kItemAmmoBase]; - int nAmmoType = pAmmoItemData->ata; + int nAmmoType = pAmmoItemData->type; - if (pPlayer->at181[nAmmoType] >= gAmmoInfo[nAmmoType].at0) return 0; + if (pPlayer->ammCount[nAmmoType] >= gAmmoInfo[nAmmoType].max) return 0; else if (!gModernMap || pAmmo->extra < 0 || xsprite[pAmmo->extra].data1 <= 0) - pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType]+pAmmoItemData->at8, gAmmoInfo[nAmmoType].at0); + pPlayer->ammCount[nAmmoType] = ClipHigh(pPlayer->ammCount[nAmmoType]+pAmmoItemData->count, gAmmoInfo[nAmmoType].max); // by NoOne: allow custom amount for item else - pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + xsprite[pAmmo->extra].data1, gAmmoInfo[nAmmoType].at0); + pPlayer->ammCount[nAmmoType] = ClipHigh(pPlayer->ammCount[nAmmoType] + xsprite[pAmmo->extra].data1, gAmmoInfo[nAmmoType].max); - if (pAmmoItemData->atb) pPlayer->atcb[pAmmoItemData->atb] = 1; + if (pAmmoItemData->weaponType) pPlayer->hasWeapon[pAmmoItemData->weaponType] = 1; sfxPlay3DSound(pPlayer->pSprite, 782, -1, 0); return 1; } char PickupWeapon(PLAYER *pPlayer, spritetype *pWeapon) { WEAPONITEMDATA *pWeaponItemData = &gWeaponItemData[pWeapon->type - kItemWeaponBase]; - int nWeaponType = pWeaponItemData->at8; - int nAmmoType = pWeaponItemData->ata; - if (!pPlayer->atcb[nWeaponType] || gGameOptions.nWeaponSettings == 2 || gGameOptions.nWeaponSettings == 3) { + int nWeaponType = pWeaponItemData->type; + int nAmmoType = pWeaponItemData->ammoType; + if (!pPlayer->hasWeapon[nWeaponType] || gGameOptions.nWeaponSettings == 2 || gGameOptions.nWeaponSettings == 3) { if (pWeapon->type == kItemWeaponLifeLeech && gGameOptions.nGameType > 1 && sub_3A158(pPlayer, NULL)) return 0; - pPlayer->atcb[nWeaponType] = 1; + pPlayer->hasWeapon[nWeaponType] = 1; if (nAmmoType == -1) return 0; // By NoOne: allow to set custom ammo count for weapon pickups if (!gModernMap || pWeapon->extra < 0 || xsprite[pWeapon->extra].data1 <= 0) - pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + pWeaponItemData->atc, gAmmoInfo[nAmmoType].at0); + pPlayer->ammCount[nAmmoType] = ClipHigh(pPlayer->ammCount[nAmmoType] + pWeaponItemData->count, gAmmoInfo[nAmmoType].max); else - pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + xsprite[pWeapon->extra].data1, gAmmoInfo[nAmmoType].at0); + pPlayer->ammCount[nAmmoType] = ClipHigh(pPlayer->ammCount[nAmmoType] + xsprite[pWeapon->extra].data1, gAmmoInfo[nAmmoType].max); int nNewWeapon = WeaponUpgrade(pPlayer, nWeaponType); - if (nNewWeapon != pPlayer->atbd) { - pPlayer->atc3 = 0; - pPlayer->atbe = nNewWeapon; + if (nNewWeapon != pPlayer->curWeapon) { + pPlayer->weaponState = 0; + pPlayer->nextWeapon = nNewWeapon; } sfxPlay3DSound(pPlayer->pSprite, 777, -1, 0); return 1; } - if (!actGetRespawnTime(pWeapon) || nAmmoType == -1 || pPlayer->at181[nAmmoType] >= gAmmoInfo[nAmmoType].at0) return 0; + if (!actGetRespawnTime(pWeapon) || nAmmoType == -1 || pPlayer->ammCount[nAmmoType] >= gAmmoInfo[nAmmoType].max) return 0; else if (!gModernMap || pWeapon->extra < 0 || xsprite[pWeapon->extra].data1 <= 0) - pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType]+pWeaponItemData->atc, gAmmoInfo[nAmmoType].at0); + pPlayer->ammCount[nAmmoType] = ClipHigh(pPlayer->ammCount[nAmmoType]+pWeaponItemData->count, gAmmoInfo[nAmmoType].max); else - pPlayer->at181[nAmmoType] = ClipHigh(pPlayer->at181[nAmmoType] + xsprite[pWeapon->extra].data1, gAmmoInfo[nAmmoType].at0); + pPlayer->ammCount[nAmmoType] = ClipHigh(pPlayer->ammCount[nAmmoType] + xsprite[pWeapon->extra].data1, gAmmoInfo[nAmmoType].max); sfxPlay3DSound(pPlayer->pSprite, 777, -1, 0); return 1; @@ -1375,7 +1375,7 @@ void PickUp(PLAYER *pPlayer, spritetype *pSprite) if (!actCheckRespawn(pSprite)) actPostSprite(pSprite->index, kStatFree); - pPlayer->at377 = 30; + pPlayer->pickupEffect = 30; if (pPlayer == gMe) { if (customMsg > 0) trTextOver(customMsg - 1); else viewSetMessage(buffer, 0, MESSAGE_PRIORITY_PICKUP); @@ -1427,8 +1427,8 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3) spritetype *pSprite = pPlayer->pSprite; int x = Cos(pSprite->ang)>>16; int y = Sin(pSprite->ang)>>16; - int z = pPlayer->at83; - int hit = HitScan(pSprite, pPlayer->at67, x, y, z, 0x10000040, 128); + int z = pPlayer->slope; + int hit = HitScan(pSprite, pPlayer->zView, x, y, z, 0x10000040, 128); int hitDist = approxDist(pSprite->x-gHitInfo.hitx, pSprite->y-gHitInfo.hity)>>4; if (hitDist < 64) { @@ -1445,7 +1445,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3) { if (gGameOptions.nGameType > 1 && sub_3A158(pPlayer, pSprite)) return -1; - pXSprite->data4 = pPlayer->at57; + pXSprite->data4 = pPlayer->nPlayer; pXSprite->isTriggered = 0; } } @@ -1501,45 +1501,45 @@ void ProcessInput(PLAYER *pPlayer) { spritetype *pSprite = pPlayer->pSprite; XSPRITE *pXSprite = pPlayer->pXSprite; - int nSprite = pPlayer->at5b; - POSTURE *pPosture = &gPosture[pPlayer->at5f][pPlayer->at2f]; - GINPUT *pInput = &pPlayer->atc; - pPlayer->at2e = pInput->syncFlags.run; + int nSprite = pPlayer->nSprite; + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][pPlayer->posture]; + GINPUT *pInput = &pPlayer->input; + pPlayer->isRunning = pInput->syncFlags.run; if (pInput->buttonFlags.byte || pInput->forward || pInput->strafe || pInput->q16turn) - pPlayer->at30a = 0; - else if (pPlayer->at30a >= 0) - pPlayer->at30a += 4; + pPlayer->restTime = 0; + else if (pPlayer->restTime >= 0) + pPlayer->restTime += 4; WeaponProcess(pPlayer); if (pXSprite->health == 0) { char bSeqStat = playerSeqPlaying(pPlayer, 16); - if (pPlayer->at2ee != -1) + if (pPlayer->fraggerId != -1) { - pPlayer->angold = pSprite->ang = getangle(sprite[pPlayer->at2ee].x - pSprite->x, sprite[pPlayer->at2ee].y - pSprite->y); + pPlayer->angold = pSprite->ang = getangle(sprite[pPlayer->fraggerId].x - pSprite->x, sprite[pPlayer->fraggerId].y - pSprite->y); pPlayer->q16ang = fix16_from_int(pSprite->ang); } - pPlayer->at1fe += 4; + pPlayer->deathTime += 4; if (!bSeqStat) { if (bVanilla) - pPlayer->q16horiz = fix16_from_int(mulscale16(0x8000-(Cos(ClipHigh(pPlayer->at1fe*8, 1024))>>15), 120)); + pPlayer->q16horiz = fix16_from_int(mulscale16(0x8000-(Cos(ClipHigh(pPlayer->deathTime*8, 1024))>>15), 120)); else - pPlayer->q16horiz = mulscale16(0x8000-(Cos(ClipHigh(pPlayer->at1fe*8, 1024))>>15), F16(120)); + pPlayer->q16horiz = mulscale16(0x8000-(Cos(ClipHigh(pPlayer->deathTime*8, 1024))>>15), F16(120)); } - if (pPlayer->atbd) - pInput->newWeapon = pPlayer->atbd; + if (pPlayer->curWeapon) + pInput->newWeapon = pPlayer->curWeapon; if (pInput->keyFlags.action) { if (bSeqStat) { - if (pPlayer->at1fe > 360) + if (pPlayer->deathTime > 360) seqSpawn(pPlayer->pDudeInfo->seqStartID+14, 3, pPlayer->pSprite->extra, nPlayerSurviveClient); } else if (seqGetStatus(3, pPlayer->pSprite->extra) < 0) { if (pPlayer->pSprite) pPlayer->pSprite->type = kThingBloodChunks; - actPostSprite(pPlayer->at5b, kStatThing); + actPostSprite(pPlayer->nSprite, kStatThing); seqSpawn(pPlayer->pDudeInfo->seqStartID+15, 3, pPlayer->pSprite->extra, -1); playerReset(pPlayer); if (gGameOptions.nGameType == 0 && numplayers == 1) @@ -1549,13 +1549,13 @@ void ProcessInput(PLAYER *pPlayer) pInput->keyFlags.restart = 1; } else - playerStart(pPlayer->at57); + playerStart(pPlayer->nPlayer); } pInput->keyFlags.action = 0; } return; } - if (pPlayer->at2f == 1) + if (pPlayer->posture == 1) { int x = Cos(pSprite->ang); int y = Sin(pSprite->ang); @@ -1563,16 +1563,16 @@ void ProcessInput(PLAYER *pPlayer) { int forward = pInput->forward; if (forward > 0) - forward = mulscale8(pPosture->at0, forward); + forward = mulscale8(pPosture->frontAccel, forward); else - forward = mulscale8(pPosture->at8, forward); + forward = mulscale8(pPosture->backAccel, forward); xvel[nSprite] += mulscale30(forward, x); yvel[nSprite] += mulscale30(forward, y); } if (pInput->strafe) { int strafe = pInput->strafe; - strafe = mulscale8(pPosture->at4, strafe); + strafe = mulscale8(pPosture->sideAccel, strafe); xvel[nSprite] += mulscale30(strafe, y); yvel[nSprite] -= mulscale30(strafe, x); } @@ -1588,9 +1588,9 @@ void ProcessInput(PLAYER *pPlayer) { int forward = pInput->forward; if (forward > 0) - forward = mulscale8(pPosture->at0, forward); + forward = mulscale8(pPosture->frontAccel, forward); else - forward = mulscale8(pPosture->at8, forward); + forward = mulscale8(pPosture->backAccel, forward); if (pXSprite->height) forward = mulscale16(forward, speed); xvel[nSprite] += mulscale30(forward, x); @@ -1599,7 +1599,7 @@ void ProcessInput(PLAYER *pPlayer) if (pInput->strafe) { int strafe = pInput->strafe; - strafe = mulscale8(pPosture->at4, strafe); + strafe = mulscale8(pPosture->sideAccel, strafe); if (pXSprite->height) strafe = mulscale16(strafe, speed); xvel[nSprite] += mulscale30(strafe, y); @@ -1610,26 +1610,26 @@ void ProcessInput(PLAYER *pPlayer) pPlayer->q16ang = (pPlayer->q16ang+pInput->q16turn)&0x7ffffff; if (pInput->keyFlags.spin180) { - if (!pPlayer->at316) - pPlayer->at316 = -1024; + if (!pPlayer->spin) + pPlayer->spin = -1024; pInput->keyFlags.spin180 = 0; } - if (pPlayer->at316 < 0) + if (pPlayer->spin < 0) { int speed; - if (pPlayer->at2f == 1) + if (pPlayer->posture == 1) speed = 64; else speed = 128; - pPlayer->at316 = ClipLow(pPlayer->at316+speed, 0); + pPlayer->spin = ClipLow(pPlayer->spin+speed, 0); pPlayer->q16ang += fix16_from_int(speed); } pPlayer->q16ang = (pPlayer->q16ang+fix16_from_int(pSprite->ang-pPlayer->angold))&0x7ffffff; pPlayer->angold = pSprite->ang = fix16_to_int(pPlayer->q16ang); if (!pInput->buttonFlags.jump) - pPlayer->at31c = 0; + pPlayer->canJump = 0; - switch (pPlayer->at2f) + switch (pPlayer->posture) { case 1: if (pInput->buttonFlags.jump) @@ -1639,10 +1639,10 @@ void ProcessInput(PLAYER *pPlayer) break; case 2: if (!pInput->buttonFlags.crouch) - pPlayer->at2f = 0; + pPlayer->posture = 0; break; default: - if (!pPlayer->at31c && pInput->buttonFlags.jump && pXSprite->height == 0) + if (!pPlayer->canJump && pInput->buttonFlags.jump && pXSprite->height == 0) { sfxPlay3DSound(pSprite, 700, 0, 0); if (packItemActive(pPlayer, 4)) @@ -1654,12 +1654,12 @@ void ProcessInput(PLAYER *pPlayer) if (isShrinked(pPlayer->pSprite)) zvel[nSprite] -= -200000; else if (isGrown(pPlayer->pSprite)) zvel[nSprite] += -250000; - pPlayer->at31c = 1; + pPlayer->canJump = 1; } if (pInput->buttonFlags.crouch) - pPlayer->at2f = 2; + pPlayer->posture = 2; break; } if (pInput->keyFlags.action) @@ -1678,7 +1678,7 @@ void ProcessInput(PLAYER *pPlayer) viewSetMessage("It's locked"); sndStartSample(3062, 255, 2, 0); } - if (!key || pPlayer->at88[key]) + if (!key || pPlayer->hasKey[key]) trTriggerSector(a2, pXSector, kCmdSpritePush); else if (pPlayer == gMe) { @@ -1696,7 +1696,7 @@ void ProcessInput(PLAYER *pPlayer) viewSetMessage("It's locked"); sndStartSample(3062, 255, 2, 0); } - if (!key || pPlayer->at88[key]) + if (!key || pPlayer->hasKey[key]) trTriggerWall(a2, pXWall, kCmdWallPush); else if (pPlayer == gMe) { @@ -1711,7 +1711,7 @@ void ProcessInput(PLAYER *pPlayer) int key = pXSprite->key; if (pXSprite->locked && pPlayer == gMe && pXSprite->lockMsg) trTextOver(pXSprite->lockMsg); - if (!key || pPlayer->at88[key]) + if (!key || pPlayer->hasKey[key]) trTriggerSprite(a2, pXSprite, kCmdSpritePush); else if (pPlayer == gMe) { @@ -1721,9 +1721,9 @@ void ProcessInput(PLAYER *pPlayer) break; } } - if (pPlayer->at372 > 0) - pPlayer->at372 = ClipLow(pPlayer->at372-4*(6-gGameOptions.nDifficulty), 0); - if (pPlayer->at372 <= 0 && pPlayer->at376) + if (pPlayer->handTime > 0) + pPlayer->handTime = ClipLow(pPlayer->handTime-4*(6-gGameOptions.nDifficulty), 0); + if (pPlayer->handTime <= 0 && pPlayer->hand) { spritetype *pSprite2 = actSpawnDude(pPlayer->pSprite, kDudeHand, pPlayer->pSprite->clipdist<<1, 0); pSprite2->ang = (pPlayer->pSprite->ang+1024)&2047; @@ -1733,7 +1733,7 @@ void ProcessInput(PLAYER *pPlayer) xvel[pSprite2->index] = xvel[nSprite] + mulscale14(0x155555, x); yvel[pSprite2->index] = yvel[nSprite] + mulscale14(0x155555, y); zvel[pSprite2->index] = zvel[nSprite]; - pPlayer->at376 = 0; + pPlayer->hand = 0; } pInput->keyFlags.action = 0; } @@ -1814,7 +1814,7 @@ void ProcessInput(PLAYER *pPlayer) if (klabs(pPlayer->q16slopehoriz) < 4) pPlayer->q16slopehoriz = 0; } - pPlayer->at83 = (-fix16_to_int(pPlayer->q16horiz))<<7; + pPlayer->slope = (-fix16_to_int(pPlayer->q16horiz))<<7; if (pInput->keyFlags.prevItem) { pInput->keyFlags.prevItem = 0; @@ -1828,37 +1828,37 @@ void ProcessInput(PLAYER *pPlayer) if (pInput->keyFlags.useItem) { pInput->keyFlags.useItem = 0; - if (pPlayer->packInfo[pPlayer->at321].at1 > 0) - packUseItem(pPlayer, pPlayer->at321); + if (pPlayer->packSlots[pPlayer->packItemId].curAmount > 0) + packUseItem(pPlayer, pPlayer->packItemId); } if (pInput->useFlags.useBeastVision) { pInput->useFlags.useBeastVision = 0; - if (pPlayer->packInfo[3].at1 > 0) + if (pPlayer->packSlots[3].curAmount > 0) packUseItem(pPlayer, 3); } if (pInput->useFlags.useCrystalBall) { pInput->useFlags.useCrystalBall = 0; - if (pPlayer->packInfo[2].at1 > 0) + if (pPlayer->packSlots[2].curAmount > 0) packUseItem(pPlayer, 2); } if (pInput->useFlags.useJumpBoots) { pInput->useFlags.useJumpBoots = 0; - if (pPlayer->packInfo[4].at1 > 0) + if (pPlayer->packSlots[4].curAmount > 0) packUseItem(pPlayer, 4); } if (pInput->useFlags.useMedKit) { pInput->useFlags.useMedKit = 0; - if (pPlayer->packInfo[0].at1 > 0) + if (pPlayer->packSlots[0].curAmount > 0) packUseItem(pPlayer, 0); } if (pInput->keyFlags.holsterWeapon) { pInput->keyFlags.holsterWeapon = 0; - if (pPlayer->atbd) + if (pPlayer->curWeapon) { WeaponLower(pPlayer); viewSetMessage("Holstering weapon"); @@ -1870,10 +1870,10 @@ void ProcessInput(PLAYER *pPlayer) void playerProcess(PLAYER *pPlayer) { spritetype *pSprite = pPlayer->pSprite; - int nSprite = pPlayer->at5b; + int nSprite = pPlayer->nSprite; int nXSprite = pSprite->extra; XSPRITE *pXSprite = pPlayer->pXSprite; - POSTURE *pPosture = &gPosture[pPlayer->at5f][pPlayer->at2f]; + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][pPlayer->posture]; powerupProcess(pPlayer); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); @@ -1898,85 +1898,85 @@ void playerProcess(PLAYER *pPlayer) } ProcessInput(pPlayer); int nSpeed = approxDist(xvel[nSprite], yvel[nSprite]); - pPlayer->at6b = interpolate(pPlayer->at6b, zvel[nSprite], 0x7000); - int dz = pPlayer->pSprite->z-pPosture->at24-pPlayer->at67; + pPlayer->zViewVel = interpolate(pPlayer->zViewVel, zvel[nSprite], 0x7000); + int dz = pPlayer->pSprite->z-pPosture->eyeAboveZ-pPlayer->zView; if (dz > 0) - pPlayer->at6b += mulscale16(dz<<8, 0xa000); + pPlayer->zViewVel += mulscale16(dz<<8, 0xa000); else - pPlayer->at6b += mulscale16(dz<<8, 0x1800); - pPlayer->at67 += pPlayer->at6b>>8; - pPlayer->at73 = interpolate(pPlayer->at73, zvel[nSprite], 0x5000); - dz = pPlayer->pSprite->z-pPosture->at28-pPlayer->at6f; + pPlayer->zViewVel += mulscale16(dz<<8, 0x1800); + pPlayer->zView += pPlayer->zViewVel>>8; + pPlayer->zWeaponVel = interpolate(pPlayer->zWeaponVel, zvel[nSprite], 0x5000); + dz = pPlayer->pSprite->z-pPosture->weaponAboveZ-pPlayer->zWeapon; if (dz > 0) - pPlayer->at73 += mulscale16(dz<<8, 0x8000); + pPlayer->zWeaponVel += mulscale16(dz<<8, 0x8000); else - pPlayer->at73 += mulscale16(dz<<8, 0xc00); - pPlayer->at6f += pPlayer->at73>>8; - pPlayer->at37 = ClipLow(pPlayer->at37-4, 0); + pPlayer->zWeaponVel += mulscale16(dz<<8, 0xc00); + pPlayer->zWeapon += pPlayer->zWeaponVel>>8; + pPlayer->bobPhase = ClipLow(pPlayer->bobPhase-4, 0); nSpeed >>= 16; - if (pPlayer->at2f == 1) + if (pPlayer->posture == 1) { - pPlayer->at3b = (pPlayer->at3b+17)&2047; - pPlayer->at4b = (pPlayer->at4b+17)&2047; - pPlayer->at3f = mulscale30(pPosture->at14*10, Sin(pPlayer->at3b*2)); - pPlayer->at43 = mulscale30(pPosture->at18*pPlayer->at37, Sin(pPlayer->at3b-256)); - pPlayer->at4f = mulscale30(pPosture->at1c*pPlayer->at37, Sin(pPlayer->at4b*2)); - pPlayer->at53 = mulscale30(pPosture->at20*pPlayer->at37, Sin(pPlayer->at4b-0x155)); + pPlayer->bobAmp = (pPlayer->bobAmp+17)&2047; + pPlayer->swayAmp = (pPlayer->swayAmp+17)&2047; + pPlayer->bobHeight = mulscale30(pPosture->bobV*10, Sin(pPlayer->bobAmp*2)); + pPlayer->bobWidth = mulscale30(pPosture->bobH*pPlayer->bobPhase, Sin(pPlayer->bobAmp-256)); + pPlayer->swayHeight = mulscale30(pPosture->swayV*pPlayer->bobPhase, Sin(pPlayer->swayAmp*2)); + pPlayer->swayWidth = mulscale30(pPosture->swayH*pPlayer->bobPhase, Sin(pPlayer->swayAmp-0x155)); } else { if (pXSprite->height < 256) { - pPlayer->at3b = (pPlayer->at3b+pPosture->atc[pPlayer->at2e]*4) & 2047; - pPlayer->at4b = (pPlayer->at4b+(pPosture->atc[pPlayer->at2e]*4)/2) & 2047; - if (pPlayer->at2e) + pPlayer->bobAmp = (pPlayer->bobAmp+pPosture->pace[pPlayer->isRunning]*4) & 2047; + pPlayer->swayAmp = (pPlayer->swayAmp+(pPosture->pace[pPlayer->isRunning]*4)/2) & 2047; + if (pPlayer->isRunning) { - if (pPlayer->at37 < 60) - pPlayer->at37 = ClipHigh(pPlayer->at37+nSpeed, 60); + if (pPlayer->bobPhase < 60) + pPlayer->bobPhase = ClipHigh(pPlayer->bobPhase+nSpeed, 60); } else { - if (pPlayer->at37 < 30) - pPlayer->at37 = ClipHigh(pPlayer->at37+nSpeed, 30); + if (pPlayer->bobPhase < 30) + pPlayer->bobPhase = ClipHigh(pPlayer->bobPhase+nSpeed, 30); } } - pPlayer->at3f = mulscale30(pPosture->at14*pPlayer->at37, Sin(pPlayer->at3b*2)); - pPlayer->at43 = mulscale30(pPosture->at18*pPlayer->at37, Sin(pPlayer->at3b-256)); - pPlayer->at4f = mulscale30(pPosture->at1c*pPlayer->at37, Sin(pPlayer->at4b*2)); - pPlayer->at53 = mulscale30(pPosture->at20*pPlayer->at37, Sin(pPlayer->at4b-0x155)); + pPlayer->bobHeight = mulscale30(pPosture->bobV*pPlayer->bobPhase, Sin(pPlayer->bobAmp*2)); + pPlayer->bobWidth = mulscale30(pPosture->bobH*pPlayer->bobPhase, Sin(pPlayer->bobAmp-256)); + pPlayer->swayHeight = mulscale30(pPosture->swayV*pPlayer->bobPhase, Sin(pPlayer->swayAmp*2)); + pPlayer->swayWidth = mulscale30(pPosture->swayH*pPlayer->bobPhase, Sin(pPlayer->swayAmp-0x155)); } - pPlayer->at35a = 0; - pPlayer->at37f = ClipLow(pPlayer->at37f-4, 0); - pPlayer->at35e = ClipLow(pPlayer->at35e-4, 0); - pPlayer->at362 = ClipLow(pPlayer->at362-4, 0); - pPlayer->at366 = ClipLow(pPlayer->at366-4, 0); - pPlayer->at36a = ClipLow(pPlayer->at36a-4, 0); - pPlayer->at377 = ClipLow(pPlayer->at377-4, 0); + pPlayer->flickerEffect = 0; + pPlayer->quakeEffect = ClipLow(pPlayer->quakeEffect-4, 0); + pPlayer->tiltEffect = ClipLow(pPlayer->tiltEffect-4, 0); + pPlayer->visibility = ClipLow(pPlayer->visibility-4, 0); + pPlayer->painEffect = ClipLow(pPlayer->painEffect-4, 0); + pPlayer->blindEffect = ClipLow(pPlayer->blindEffect-4, 0); + pPlayer->pickupEffect = ClipLow(pPlayer->pickupEffect-4, 0); if (pPlayer == gMe && gMe->pXSprite->health == 0) - pPlayer->at376 = 0; + pPlayer->hand = 0; if (!pXSprite->health) return; - pPlayer->at87 = 0; - if (pPlayer->at2f == 1) + pPlayer->isUnderwater = 0; + if (pPlayer->posture == 1) { - pPlayer->at87 = 1; + pPlayer->isUnderwater = 1; int nSector = pSprite->sectnum; int nLink = gLowerLink[nSector]; if (nLink > 0 && (sprite[nLink].type == kMarkerLowGoo || sprite[nLink].type == kMarkerLowWater)) { - if (getceilzofslope(nSector, pSprite->x, pSprite->y) > pPlayer->at67) - pPlayer->at87 = 0; + if (getceilzofslope(nSector, pSprite->x, pSprite->y) > pPlayer->zView) + pPlayer->isUnderwater = 0; } } - if (!pPlayer->at87) + if (!pPlayer->isUnderwater) { - pPlayer->at2f2 = 1200; - pPlayer->at36e = 0; + pPlayer->underwaterTime = 1200; + pPlayer->chokeEffect = 0; if (packItemActive(pPlayer, 1)) packUseItem(pPlayer, 1); } int nType = kDudePlayer1-kDudeBase; - switch (pPlayer->at2f) + switch (pPlayer->posture) { case 1: seqSpawn(dudeInfo[nType].seqStartID+9, 3, nXSprite, -1); @@ -1995,13 +1995,13 @@ void playerProcess(PLAYER *pPlayer) spritetype *playerFireMissile(PLAYER *pPlayer, int a2, int a3, int a4, int a5, int a6) { - return actFireMissile(pPlayer->pSprite, a2, pPlayer->at6f-pPlayer->pSprite->z, a3, a4, a5, a6); + return actFireMissile(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, a3, a4, a5, a6); } spritetype * playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5) { dassert(thingType >= kThingBase && thingType < kThingMax); - return actFireThing(pPlayer->pSprite, a2, pPlayer->at6f-pPlayer->pSprite->z, pPlayer->at83+a3, thingType, a5); + return actFireThing(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5); } void playerFrag(PLAYER *pKiller, PLAYER *pVictim) @@ -2016,23 +2016,23 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim) dassert(nVictim >= 0 && nVictim < kMaxPlayers); if (myconnectindex == connecthead) { - sprintf(buffer, "frag %d killed %d\n", pKiller->at57+1, pVictim->at57+1); + sprintf(buffer, "frag %d killed %d\n", pKiller->nPlayer+1, pVictim->nPlayer+1); sub_7AC28(buffer); buffer[0] = 0; } if (nKiller == nVictim) { - pVictim->at2ee = -1; + pVictim->fraggerId = -1; if (VanillaMode() || gGameOptions.nGameType != 1) { - pVictim->at2c6--; - pVictim->at2ca[nVictim]--; + pVictim->fragCount--; + pVictim->fragInfo[nVictim]--; } if (gGameOptions.nGameType == 3) - dword_21EFB0[pVictim->at2ea]--; + dword_21EFB0[pVictim->teamId]--; int nMessage = Random(5); int nSound = gSuicide[nMessage].at4; - if (pVictim == gMe && gMe->at372 <= 0) + if (pVictim == gMe && gMe->handTime <= 0) { sprintf(buffer, "You killed yourself!"); if (gGameOptions.nGameType > 0 && nSound >= 0) @@ -2047,17 +2047,17 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim) { if (VanillaMode() || gGameOptions.nGameType != 1) { - pKiller->at2c6++; - pKiller->at2ca[nKiller]++; + pKiller->fragCount++; + pKiller->fragInfo[nKiller]++; } if (gGameOptions.nGameType == 3) { - if (pKiller->at2ea == pVictim->at2ea) - dword_21EFB0[pKiller->at2ea]--; + if (pKiller->teamId == pVictim->teamId) + dword_21EFB0[pKiller->teamId]--; else { - dword_21EFB0[pKiller->at2ea]++; - dword_21EFD0[pKiller->at2ea]+=120; + dword_21EFB0[pKiller->teamId]++; + dword_21EFD0[pKiller->teamId]+=120; } } int nMessage = Random(25); @@ -2079,8 +2079,8 @@ void FragPlayer(PLAYER *pPlayer, int nSprite) { PLAYER *pKiller = &gPlayer[pSprite->type-kDudePlayer1]; playerFrag(pKiller, pPlayer); - int nTeam1 = pKiller->at2ea&1; - int nTeam2 = pPlayer->at2ea&1; + int nTeam1 = pKiller->teamId&1; + int nTeam2 = pPlayer->teamId&1; if (nTeam1 == 0) { if (nTeam1 != nTeam2) @@ -2102,7 +2102,7 @@ int playerDamageArmor(PLAYER *pPlayer, DAMAGE_TYPE nType, int nDamage) { DAMAGEINFO *pDamageInfo = &damageInfo[nType]; int nArmorType = pDamageInfo->at0; - if (nArmorType >= 0 && pPlayer->at33e[nArmorType]) + if (nArmorType >= 0 && pPlayer->armor[nArmorType]) { #if 0 int vbp = (nDamage*7)/8-nDamage/4; @@ -2110,11 +2110,11 @@ int playerDamageArmor(PLAYER *pPlayer, DAMAGE_TYPE nType, int nDamage) int t = nDamage/4 + vbp * v8 / 3200; v8 -= t; #endif - int v8 = pPlayer->at33e[nArmorType]; + int v8 = pPlayer->armor[nArmorType]; int t = scale(v8, 0, 3200, nDamage/4, (nDamage*7)/8); v8 -= t; nDamage -= t; - pPlayer->at33e[nArmorType] = ClipLow(v8, 0); + pPlayer->armor[nArmorType] = ClipLow(v8, 0); } return nDamage; } @@ -2126,22 +2126,22 @@ spritetype *sub_40A94(PLAYER *pPlayer, int a2) switch (a2) { case kItemFlagA: - pPlayer->at90 &= ~1; + pPlayer->hasFlag &= ~1; pSprite = actDropObject(pPlayer->pSprite, kItemFlagA); if (pSprite) - pSprite->owner = pPlayer->at91[0]; + pSprite->owner = pPlayer->used2[0]; gBlueFlagDropped = true; - sprintf(buffer, "%s dropped Blue Flag", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s dropped Blue Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8005, 255, 2, 0); viewSetMessage(buffer); break; case kItemFlagB: - pPlayer->at90 &= ~2; + pPlayer->hasFlag &= ~2; pSprite = actDropObject(pPlayer->pSprite, kItemFlagB); if (pSprite) - pSprite->owner = pPlayer->at91[1]; + pSprite->owner = pPlayer->used2[1]; gRedFlagDropped = true; - sprintf(buffer, "%s dropped Red Flag", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s dropped Red Flag", gProfile[pPlayer->nPlayer].name); sndStartSample(8004, 255, 2, 0); viewSetMessage(buffer); break; @@ -2153,10 +2153,10 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in { dassert(nSource < kMaxSprites); dassert(pPlayer != NULL); - if (pPlayer->ata1[nDamageType]) + if (pPlayer->damageControl[nDamageType]) return 0; nDamage = playerDamageArmor(pPlayer, nDamageType, nDamage); - pPlayer->at366 = ClipHigh(pPlayer->at366+(nDamage>>3), 600); + pPlayer->painEffect = ClipHigh(pPlayer->painEffect+(nDamage>>3), 600); spritetype *pSprite = pPlayer->pSprite; XSPRITE *pXSprite = pPlayer->pXSprite; @@ -2217,21 +2217,21 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in nSound = pDamageInfo->at4[0]; else nSound = pDamageInfo->at4[Random(3)]; - if (nDamageType == DAMAGE_TYPE_4 && pXSprite->medium == kMediumWater && !pPlayer->at376) + if (nDamageType == DAMAGE_TYPE_4 && pXSprite->medium == kMediumWater && !pPlayer->hand) nSound = 714; sfxPlay3DSound(pSprite, nSound, 0, 6); return nDamage; } sfxKill3DSound(pPlayer->pSprite, -1, 441); - if (gGameOptions.nGameType == 3 && pPlayer->at90) { - if (pPlayer->at90&1) sub_40A94(pPlayer, kItemFlagA); - if (pPlayer->at90&2) sub_40A94(pPlayer, kItemFlagB); + if (gGameOptions.nGameType == 3 && pPlayer->hasFlag) { + if (pPlayer->hasFlag&1) sub_40A94(pPlayer, kItemFlagA); + if (pPlayer->hasFlag&2) sub_40A94(pPlayer, kItemFlagB); } - pPlayer->at1fe = 0; - pPlayer->at1b1 = 0; - pPlayer->atbd = 0; - pPlayer->at2ee = nSource; - pPlayer->at34e = 0; + pPlayer->deathTime = 0; + pPlayer->qavLoop = 0; + pPlayer->curWeapon = 0; + pPlayer->fraggerId = nSource; + pPlayer->voodooTargets = 0; if (nDamageType == DAMAGE_TYPE_3 && nDamage < (9<<4)) nDamageType = DAMAGE_TYPE_0; switch (nDamageType) @@ -2279,8 +2279,8 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in pSprite->flags |= 7; for (int p = connecthead; p >= 0; p = connectpoint2[p]) { - if (gPlayer[p].at2ee == nSprite && gPlayer[p].at1fe > 0) - gPlayer[p].at2ee = -1; + if (gPlayer[p].fraggerId == nSprite && gPlayer[p].deathTime > 0) + gPlayer[p].fraggerId = -1; } FragPlayer(pPlayer, nSource); trTriggerSprite(nSprite, pXSprite, kCmdOff); @@ -2296,27 +2296,27 @@ int UseAmmo(PLAYER *pPlayer, int nAmmoType, int nDec) return 9999; if (nAmmoType == -1) return 9999; - pPlayer->at181[nAmmoType] = ClipLow(pPlayer->at181[nAmmoType]-nDec, 0); - return pPlayer->at181[nAmmoType]; + pPlayer->ammCount[nAmmoType] = ClipLow(pPlayer->ammCount[nAmmoType]-nDec, 0); + return pPlayer->ammCount[nAmmoType]; } void sub_41250(PLAYER *pPlayer) { - int v4 = pPlayer->at1be.dz; - int dz = pPlayer->at6f-pPlayer->pSprite->z; + int v4 = pPlayer->aim.dz; + int dz = pPlayer->zWeapon-pPlayer->pSprite->z; if (UseAmmo(pPlayer, 9, 0) < 8) { - pPlayer->at34e = 0; + pPlayer->voodooTargets = 0; return; } for (int i = 0; i < 4; i++) { - int ang1 = (pPlayer->at352+pPlayer->at356)&2047; + int ang1 = (pPlayer->voodooVar1+pPlayer->vodooVar2)&2047; actFireVector(pPlayer->pSprite, 0, dz, Cos(ang1)>>16, Sin(ang1)>>16, v4, VECTOR_TYPE_21); - int ang2 = (pPlayer->at352+2048-pPlayer->at356)&2047; + int ang2 = (pPlayer->voodooVar1+2048-pPlayer->vodooVar2)&2047; actFireVector(pPlayer->pSprite, 0, dz, Cos(ang2)>>16, Sin(ang2)>>16, v4, VECTOR_TYPE_21); } - pPlayer->at34e = ClipLow(pPlayer->at34e-1, 0); + pPlayer->voodooTargets = ClipLow(pPlayer->voodooTargets-1, 0); } void playerLandingSound(PLAYER *pPlayer) @@ -2367,10 +2367,10 @@ void PlayerSurvive(int, int nXSprite) viewSetMessage("I LIVE...AGAIN!!"); else { - sprintf(buffer, "%s lives again!", gProfile[pPlayer->at57].name); + sprintf(buffer, "%s lives again!", gProfile[pPlayer->nPlayer].name); viewSetMessage(buffer); } - pPlayer->atc.newWeapon = 1; + pPlayer->input.newWeapon = 1; } } } @@ -2383,7 +2383,7 @@ void PlayerKneelsOver(int, int nXSprite) if (gPlayer[p].pXSprite == pXSprite) { PLAYER *pPlayer = &gPlayer[p]; - playerDamageSprite(pPlayer->at2ee, pPlayer, DAMAGE_TYPE_5, 500<<4); + playerDamageSprite(pPlayer->fraggerId, pPlayer, DAMAGE_TYPE_5, 500<<4); return; } } @@ -2404,7 +2404,7 @@ void PlayerLoadSave::Load(void) Read(&gPlayer, sizeof(gPlayer)); for (int i = 0; i < gNetPlayers; i++) { - gPlayer[i].pSprite = &sprite[gPlayer[i].at5b]; + gPlayer[i].pSprite = &sprite[gPlayer[i].nSprite]; gPlayer[i].pXSprite = &xsprite[gPlayer[i].pSprite->extra]; gPlayer[i].pDudeInfo = &dudeInfo[gPlayer[i].pSprite->type-kDudeBase]; } diff --git a/source/blood/src/player.h b/source/blood/src/player.h index 5b35f6937..e33ef73f7 100644 --- a/source/blood/src/player.h +++ b/source/blood/src/player.h @@ -35,124 +35,136 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS -enum LifeMode { - kModeHuman = 0, - kModeBeast, - kModeHumanShrink, - kModeHumanGrown, +// life modes of the player +enum { +kModeHuman = 0, +kModeBeast = 1, +kModeHumanShrink = 2, +kModeHumanGrown = 3, +kModeMax = 4, +}; + +// postures +enum { +kPostureStand = 0, +kPostureCrouch = 1, +kPostureSwim = 2, +kPostureMax = 3, }; struct PACKINFO { - char at0; // is active (0/1) - int at1 = 0; // remaining percent + bool isActive; // is active (0/1) + int curAmount = 0; // remaining percent }; struct PLAYER { spritetype *pSprite; XSPRITE *pXSprite; DUDEINFO *pDudeInfo; - GINPUT atc; - //short atc; // INPUT + GINPUT input; + //short input; // INPUT //char at10; // forward //short at11; // turn //char hearDist; // strafe - //int at14; // buttonFlags - //unsigned int at18; // keyFlags - //char at1c; // useFlags; - //char at20; // newWeapon + //int bobV; // buttonFlags + //unsigned int bobH; // keyFlags + //char swayV; // useFlags; + //char swayH; // newWeapon //char at21; // mlook - int at22; - int at26; // weapon qav - int at2a; // qav callback - char at2e; // run - int at2f; // state - int at33; // unused? - int at37; - int at3b; - int at3f; // bob height - int at43; // bob width - int at47; - int at4b; - int at4f; // bob sway y - int at53; // bob sway x - int at57; // Connect id - int at5b; // spritenum - int at5f; // life mode - int at63; - int at67; // view z - int at6b; - int at6f; // weapon z - int at73; + int used1; // something related to game checksum + int weaponQav; + int qavCallback; + bool isRunning; + int posture; // stand, crouch, swim + int unused1; // --> useless + int bobPhase; + int bobAmp; + int bobHeight; + int bobWidth; + int swayPhase; + int swayAmp; + int swayHeight; + int swayWidth; + int nPlayer; // Connect id + int nSprite; + int lifeMode; + int bloodlust; // ---> useless + int zView; + int zViewVel; + int zWeapon; + int zWeaponVel; fix16_t q16look; int q16horiz; // horiz int q16slopehoriz; // horizoff - int at83; - char at87; // underwater - char at88[8]; // keys - char at90; // flag capture - short at91[8]; - int ata1[7]; - char atbd; // weapon - char atbe; // pending weapon - int atbf, atc3, atc7; - char atcb[14]; // hasweapon - int atd9[14]; - int at111[2][14]; + int slope; + bool isUnderwater; + bool hasKey[8]; + char hasFlag; + short used2[8]; // ?? + int damageControl[7]; + char curWeapon; + char nextWeapon; + int weaponTimer; + int weaponState; + int weaponAmmo; + bool hasWeapon[14]; + int weaponMode[14]; + int weaponOrder[2][14]; //int at149[14]; - int at181[12]; // ammo - char at1b1; - int at1b2; - int at1b6; - int at1ba; - Aim at1be; // world + int ammCount[12]; + bool qavLoop; + int fuseTime; + int throwTime; + int throwPower; + Aim aim; // world //int at1c6; - Aim at1ca; // relative - //int at1ca; + Aim relAim; // relative + //int relAim; //int at1ce; //int at1d2; - int at1d6; // aim target sprite - int at1da; - short at1de[16]; - int at1fe; - int at202[kMaxPowerUps]; // [13]: cloak of invisibility, [14]: death mask (invulnerability), [15]: jump boots, [17]: guns akimbo, [18]: diving suit, [21]: crystal ball, [24]: reflective shots, [25]: beast vision, [26]: cloak of shadow - int at2c6; // frags - int at2ca[8]; - int at2ea; // color (team) - int at2ee; // killer - int at2f2; - int at2f6; - int at2fa; - int at2fe; - int at302; - int at306; - int at30a; - int at30e; - int at312; - int at316; - char at31a; // God mode - char at31b; // Fall scream - char at31c; - int at31d; // pack timer - int at321; // pack id 1: diving suit, 2: crystal ball, 3: beast vision 4: jump boots - PACKINFO packInfo[5]; // at325 [1]: diving suit, [2]: crystal ball, [3]: beast vision [4]: jump boots - int at33e[3]; // armor + int aimTarget; // aim target sprite + int aimTargetsCount; + short aimTargets[16]; + int deathTime; + int pwUpTime[kMaxPowerUps]; + int fragCount; + int fragInfo[8]; + int teamId; + int fraggerId; + int underwaterTime; + int bloodTime; // --> useless + int gooTime; // --> useless + int wetTime; // --> useless + int bubbleTime; + int at306; // --> useless + int restTime; + int kickPower; + int laughCount; + int spin; // turning around + bool godMode; + bool fallScream; + bool canJump; + int packItemTime; // pack timer + int packItemId; // pack id 1: diving suit, 2: crystal ball, 3: beast vision 4: jump boots + PACKINFO packSlots[5]; // at325 [1]: diving suit, [2]: crystal ball, [3]: beast vision [4]: jump boots + int armor[3]; // armor //int at342; //int at346; - int voodooTarget; // at34a - int at34e; - int at352; - int at356; - int at35a; // quake - int at35e; // tilt - int at362; // light - int at366; // pain - int at36a; // blind - int at36e; // choke - int at372; - char at376; // hand - int at377; - char at37b; // weapon flash - int at37f; // quake2 + int voodooTarget; + int voodooTargets; // --> useless + int voodooVar1; // --> useless + int vodooVar2; // --> useless + int flickerEffect; + int tiltEffect; + int visibility; + int painEffect; + int blindEffect; + int chokeEffect; + int handTime; + bool hand; // if true, there is hand start choking the player + int pickupEffect; + bool flashEffect; // if true, reduce pPlayer->visibility counter + int quakeEffect; fix16_t q16ang; int angold; int player_par; @@ -161,22 +173,23 @@ struct PLAYER { // by NoOne: defaut player movement speeds of all move states for gPosture extern int gDefaultAccel[12]; - struct POSTURE { - int at0; - int at4; - int at8; - int atc[2]; - int at14; - int at18; - int at1c; - int at20; - int at24; - int at28; - int at2c; - int at30; + int frontAccel; + int sideAccel; + int backAccel; + int pace[2]; + int bobV; + int bobH; + int swayV; + int swayH; + int eyeAboveZ; + int weaponAboveZ; + int xOffset; + int zOffset; }; +extern POSTURE gPosture[kModeMax][kPostureMax]; + struct PROFILE { int nAutoAim; int nWeaponSwitch; @@ -185,20 +198,17 @@ struct PROFILE { }; struct AMMOINFO { - int at0; - signed char at4; + int max; + signed char vectorType; }; -struct POWERUPINFO -{ +struct POWERUPINFO { short picnum; bool pickupOnce; int bonusTime; int maxTime; }; -extern POSTURE gPosture[4][3]; - extern PLAYER gPlayer[kMaxPlayers]; extern PLAYER *gMe, *gView; @@ -225,7 +235,7 @@ inline bool IsTargetTeammate(PLAYER* pSourcePlayer, spritetype* pTargetSprite) { if (gGameOptions.nGameType == 1) return true; - if (gGameOptions.nGameType == 3 && (pSourcePlayer->at2ea & 3) == (pTargetPlayer->at2ea & 3)) + if (gGameOptions.nGameType == 3 && (pSourcePlayer->teamId & 3) == (pTargetPlayer->teamId & 3)) return true; } } diff --git a/source/blood/src/triggers.cpp b/source/blood/src/triggers.cpp index 0df3a3948..7251b8e75 100644 --- a/source/blood/src/triggers.cpp +++ b/source/blood/src/triggers.cpp @@ -296,12 +296,12 @@ void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event) PLAYER *pPlayer = &gPlayer[nPlayer]; if (pPlayer->pXSprite->health > 0) { - pPlayer->at181[8] = ClipHigh(pPlayer->at181[8]+pXSprite->data3, gAmmoInfo[8].at0); - pPlayer->atcb[9] = 1; - if (pPlayer->atbd != 9) + pPlayer->ammCount[8] = ClipHigh(pPlayer->ammCount[8]+pXSprite->data3, gAmmoInfo[8].max); + pPlayer->hasWeapon[9] = 1; + if (pPlayer->curWeapon != 9) { - pPlayer->atc3 = 0; - pPlayer->atbe = 9; + pPlayer->weaponState = 0; + pPlayer->nextWeapon = 9; } evKill(pSprite->index, 3); } @@ -826,7 +826,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kCmdOff: if (gQavPlayerIndex == nSprite) { pXSprite->sysData1 = 0; - pPlayer->atc.newWeapon = pPlayer->atbd = pXSprite->data4; + pPlayer->input.newWeapon = pPlayer->curWeapon = pXSprite->data4; gQavPlayerIndex = -1; WeaponRaise(pPlayer); } @@ -836,7 +836,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) QAV* pQav = NULL; DICTNODE* hQav = gSysRes.Lookup(pXSprite->data2, "QAV"); if (hQav) { - pXSprite->data4 = pPlayer->atbd; + pXSprite->data4 = pPlayer->curWeapon; if (gQavPlayerIndex > -1 && gQavPlayerIndex != nSprite && sprite[gQavPlayerIndex].extra >= 0) { pXSprite->data4 = xsprite[sprite[gQavPlayerIndex].extra].data4; xsprite[sprite[gQavPlayerIndex].extra].data4 = 0; @@ -845,7 +845,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) WeaponLower(pPlayer); pQav = (QAV*)gSysRes.Load(hQav); weaponQAV[kFreeQAVEntry] = pQav; - pXSprite->busyTime = (((pQav->at10) / 12) * 120) / 10; + pXSprite->busyTime = ((((pQav->at10) / 12) * 120) / 10) - 12; //pXSprite->busyTime = (((pQav->nFrames * pQav->ticksPerFrame) / 12) * 120) / 10; pXSprite->sysData1 = pXSprite->waitTime; // how many times animation should be played gQavPlayerIndex = nSprite; @@ -863,7 +863,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) case kCmdNumberic: // player life form if (pXSprite->data2 >= kModeHuman || pXSprite->data2 <= kModeHumanShrink) { playerSetRace(pPlayer, pXSprite->data2); - switch (pPlayer->at5f) { + switch (pPlayer->lifeMode) { case kModeHuman: case kModeBeast: resetPlayerSize(pPlayer); @@ -878,42 +878,43 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) } break; case kCmdNumberic + 1: // player movement speed (for all players ATM) - for (int i = (pSprite->flags & kModernTypeFlag1) ? pPlayer->at5f : 0; i < 4; i++) { + for (int i = (pSprite->flags & kModernTypeFlag1) ? pPlayer->lifeMode : 0; i < 4; i++) { for (int a = 0; a < 3; a++) { int speed = pXSprite->data2 << 1; if (speed > 0) speed = ClipRange(mulscale8(gDefaultAccel[a], speed), 0, 65535); else if (speed < 0) speed = gDefaultAccel[a]; - gPosture[i][a].at0 = gPosture[i][a].at4 = gPosture[i][a].at8 = speed; + gPosture[i][a].frontAccel = gPosture[i][a].sideAccel = gPosture[i][a].backAccel = speed; - viewSetSystemMessage("%d", speed); + //viewSetSystemMessage("%d", speed); } if (pSprite->flags & kModernTypeFlag1) // for current lifeform only break; } + viewSetSystemMessage("MOVEMENT: %d", gPosture[0][0].frontAccel); break; case kCmdNumberic + 2: // player screen effects if (pXSprite->data3 < 0) break; switch (pXSprite->data2) { case 1: // tilting - pPlayer->at35e = pXSprite->data3; + pPlayer->tiltEffect = pXSprite->data3; break; case 2: // pain - pPlayer->at366 = pXSprite->data3; + pPlayer->painEffect = pXSprite->data3; break; case 3: // blind - pPlayer->at36a = pXSprite->data3; + pPlayer->blindEffect = pXSprite->data3; break; case 4: // pickup - pPlayer->at377 = pXSprite->data3; + pPlayer->pickupEffect = pXSprite->data3; break; - case 5: // quake - pPlayer->at37f = pXSprite->data3; + case 5: // quakeEffect + pPlayer->quakeEffect = pXSprite->data3; break; case 6: // visibility - pPlayer->at362 = pXSprite->data3; + pPlayer->visibility = pXSprite->data3; break; } break; @@ -1120,7 +1121,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) int dy = (pSprite->y - pPlayerSprite->y)>>4; int dz = (pSprite->z - pPlayerSprite->z)>>8; int nDist = dx*dx+dy*dy+dz*dz+0x40000; - gPlayer[p].at37f = divscale16(pXSprite->data1, nDist); + gPlayer[p].quakeEffect = divscale16(pXSprite->data1, nDist); } break; case kThingTNTBarrel: @@ -1209,7 +1210,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event) break; case kSoundPlayer: if (gGameOptions.nGameType != 0 || gMe->pXSprite->health <= 0) break; - gMe->at30a = 0; sndStartSample(pXSprite->data1, -1, 1, 0); + gMe->restTime = 0; sndStartSample(pXSprite->data1, -1, 1, 0); break; case kThingObjectGib: case kThingObjectExplode: @@ -1567,7 +1568,7 @@ void useTeleportTarget(XSPRITE* pXSource, spritetype* pSprite) { playerResetInertia(pPlayer); if (pXSource->data2 == 1) { - pPlayer->at6b = pPlayer->at73 = 0; + pPlayer->zViewVel = pPlayer->zWeaponVel = 0; } } } @@ -2618,7 +2619,7 @@ void OperateTeleport(unsigned int nSector, XSECTOR *pXSector) if (pPlayer) { playerResetInertia(pPlayer); - pPlayer->at6b = pPlayer->at73 = 0; + pPlayer->zViewVel = pPlayer->zWeaponVel = 0; } } } diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 303933b8c..17c6e062a 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -250,11 +250,11 @@ void viewInitializePrediction(void) predict.at20 = gMe->q16look; predict.at24 = gMe->q16horiz; predict.at28 = gMe->q16slopehoriz; - predict.at2c = gMe->at83; - predict.at6f = gMe->at31c; - predict.at70 = gMe->at2e; - predict.at72 = gMe->at87; - predict.at71 = gMe->atc.buttonFlags.jump; + predict.at2c = gMe->slope; + predict.at6f = gMe->canJump; + predict.at70 = gMe->isRunning; + predict.at72 = gMe->isUnderwater; + predict.at71 = gMe->input.buttonFlags.jump; predict.at50 = gMe->pSprite->x; predict.at54 = gMe->pSprite->y; predict.at58 = gMe->pSprite->z; @@ -264,23 +264,23 @@ void viewInitializePrediction(void) predict.at60 = yvel[gMe->pSprite->index]; predict.at64 = zvel[gMe->pSprite->index]; predict.at6a = gMe->pXSprite->height; - predict.at48 = gMe->at2f; - predict.at4c = gMe->at316; - predict.at6e = gMe->atc.keyFlags.lookCenter; + predict.at48 = gMe->posture; + predict.at4c = gMe->spin; + predict.at6e = gMe->input.keyFlags.lookCenter; memcpy(&predict.at75,&gSpriteHit[gMe->pSprite->extra],sizeof(SPRITEHIT)); - predict.at0 = gMe->at37; - predict.at4 = gMe->at3b; - predict.at8 = gMe->at3f; - predict.atc = gMe->at43; - predict.at10 = gMe->at47; - predict.at14 = gMe->at4b; - predict.at18 = gMe->at4f; - predict.at1c = gMe->at53; - predict.at34 = gMe->at6f-gMe->at67-(12<<8); - predict.at38 = gMe->at67; - predict.at3c = gMe->at6b; - predict.at40 = gMe->at6f; - predict.at44 = gMe->at73; + predict.at0 = gMe->bobPhase; + predict.at4 = gMe->bobAmp; + predict.at8 = gMe->bobHeight; + predict.atc = gMe->bobWidth; + predict.at10 = gMe->swayPhase; + predict.at14 = gMe->swayAmp; + predict.at18 = gMe->swayHeight; + predict.at1c = gMe->swayWidth; + predict.at34 = gMe->zWeapon-gMe->zView-(12<<8); + predict.at38 = gMe->zView; + predict.at3c = gMe->zViewVel; + predict.at40 = gMe->zWeapon; + predict.at44 = gMe->zWeaponVel; predictOld = predict; } @@ -298,13 +298,13 @@ void viewUpdatePrediction(GINPUT *pInput) void sub_158B4(PLAYER *pPlayer) { - predict.at38 = predict.at58 - gPosture[pPlayer->at5f][predict.at48].at24; - predict.at40 = predict.at58 - gPosture[pPlayer->at5f][predict.at48].at28; + predict.at38 = predict.at58 - gPosture[pPlayer->lifeMode][predict.at48].eyeAboveZ; + predict.at40 = predict.at58 - gPosture[pPlayer->lifeMode][predict.at48].weaponAboveZ; } void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput) { - POSTURE *pPosture = &gPosture[pPlayer->at5f][predict.at48]; + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][predict.at48]; predict.at70 = pInput->syncFlags.run; predict.at70 = 0; predict.at71 = pInput->buttonFlags.jump; @@ -316,16 +316,16 @@ void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput) { int forward = pInput->forward; if (forward > 0) - forward = mulscale8(pPosture->at0, forward); + forward = mulscale8(pPosture->frontAccel, forward); else - forward = mulscale8(pPosture->at8, forward); + forward = mulscale8(pPosture->backAccel, forward); predict.at5c += mulscale30(forward, x); predict.at60 += mulscale30(forward, y); } if (pInput->strafe) { int strafe = pInput->strafe; - strafe = mulscale8(pPosture->at4, strafe); + strafe = mulscale8(pPosture->sideAccel, strafe); predict.at5c += mulscale30(strafe, y); predict.at60 -= mulscale30(strafe, x); } @@ -341,9 +341,9 @@ void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput) { int forward = pInput->forward; if (forward > 0) - forward = mulscale8(pPosture->at0, forward); + forward = mulscale8(pPosture->frontAccel, forward); else - forward = mulscale8(pPosture->at8, forward); + forward = mulscale8(pPosture->backAccel, forward); if (predict.at6a) forward = mulscale16(forward, speed); predict.at5c += mulscale30(forward, x); @@ -352,7 +352,7 @@ void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput) if (pInput->strafe) { int strafe = pInput->strafe; - strafe = mulscale8(pPosture->at4, strafe); + strafe = mulscale8(pPosture->sideAccel, strafe); if (predict.at6a) strafe = mulscale16(strafe, speed); predict.at5c += mulscale30(strafe, y); @@ -486,7 +486,7 @@ void fakePlayerProcess(PLAYER *pPlayer, GINPUT *pInput) { spritetype *pSprite = pPlayer->pSprite; XSPRITE *pXSprite = pPlayer->pXSprite; - POSTURE *pPosture = &gPosture[pPlayer->at5f][predict.at48]; + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][predict.at48]; int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); @@ -510,7 +510,7 @@ void fakePlayerProcess(PLAYER *pPlayer, GINPUT *pInput) int nSpeed = approxDist(predict.at5c, predict.at60); predict.at3c = interpolate(predict.at3c, predict.at64, 0x7000); - int dz = predict.at58-pPosture->at24-predict.at38; + int dz = predict.at58-pPosture->eyeAboveZ-predict.at38; if (dz > 0) predict.at3c += mulscale16(dz<<8, 0xa000); else @@ -518,7 +518,7 @@ void fakePlayerProcess(PLAYER *pPlayer, GINPUT *pInput) predict.at38 += predict.at3c>>8; predict.at44 = interpolate(predict.at44, predict.at64, 0x5000); - dz = predict.at58-pPosture->at28-predict.at40; + dz = predict.at58-pPosture->weaponAboveZ-predict.at40; if (dz > 0) predict.at44 += mulscale16(dz<<8, 0x8000); else @@ -534,17 +534,17 @@ void fakePlayerProcess(PLAYER *pPlayer, GINPUT *pInput) { predict.at4 = (predict.at4+17)&2047; predict.at14 = (predict.at14+17)&2047; - predict.at8 = mulscale30(10*pPosture->at14,Sin(predict.at4*2)); - predict.atc = mulscale30(predict.at0*pPosture->at18,Sin(predict.at4-256)); - predict.at18 = mulscale30(predict.at0*pPosture->at1c,Sin(predict.at14*2)); - predict.at1c = mulscale30(predict.at0*pPosture->at20,Sin(predict.at14-0x155)); + predict.at8 = mulscale30(10*pPosture->bobV,Sin(predict.at4*2)); + predict.atc = mulscale30(predict.at0*pPosture->bobH,Sin(predict.at4-256)); + predict.at18 = mulscale30(predict.at0*pPosture->swayV,Sin(predict.at14*2)); + predict.at1c = mulscale30(predict.at0*pPosture->swayH,Sin(predict.at14-0x155)); } else { if (pXSprite->height < 256) { - predict.at4 = (predict.at4+(pPosture->atc[predict.at70]*4))&2047; - predict.at14 = (predict.at14+(pPosture->atc[predict.at70]*4)/2)&2047; + predict.at4 = (predict.at4+(pPosture->pace[predict.at70]*4))&2047; + predict.at14 = (predict.at14+(pPosture->pace[predict.at70]*4)/2)&2047; if (predict.at70) { if (predict.at0 < 60) @@ -556,10 +556,10 @@ void fakePlayerProcess(PLAYER *pPlayer, GINPUT *pInput) predict.at0 = ClipHigh(predict.at0 + nSpeed, 30); } } - predict.at8 = mulscale30(predict.at0*pPosture->at14,Sin(predict.at4*2)); - predict.atc = mulscale30(predict.at0*pPosture->at18,Sin(predict.at4-256)); - predict.at18 = mulscale30(predict.at0*pPosture->at1c,Sin(predict.at14*2)); - predict.at1c = mulscale30(predict.at0*pPosture->at20,Sin(predict.at14-0x155)); + predict.at8 = mulscale30(predict.at0*pPosture->bobV,Sin(predict.at4*2)); + predict.atc = mulscale30(predict.at0*pPosture->bobH,Sin(predict.at4-256)); + predict.at18 = mulscale30(predict.at0*pPosture->swayV,Sin(predict.at14*2)); + predict.at1c = mulscale30(predict.at0*pPosture->swayH,Sin(predict.at14-0x155)); } if (!pXSprite->health) return; @@ -889,15 +889,15 @@ void viewBackupView(int nPlayer) pView->at30 = pPlayer->q16ang; pView->at50 = pPlayer->pSprite->x; pView->at54 = pPlayer->pSprite->y; - pView->at38 = pPlayer->at67; - pView->at34 = pPlayer->at6f-pPlayer->at67-0xc00; + pView->at38 = pPlayer->zView; + pView->at34 = pPlayer->zWeapon-pPlayer->zView-0xc00; pView->at24 = pPlayer->q16horiz; pView->at28 = pPlayer->q16slopehoriz; - pView->at2c = pPlayer->at83; - pView->at8 = pPlayer->at3f; - pView->atc = pPlayer->at43; - pView->at18 = pPlayer->at4f; - pView->at1c = pPlayer->at53; + pView->at2c = pPlayer->slope; + pView->at8 = pPlayer->bobHeight; + pView->atc = pPlayer->bobWidth; + pView->at18 = pPlayer->swayHeight; + pView->at1c = pPlayer->swayWidth; } void viewCorrectViewOffsets(int nPlayer, vec3_t const *oldpos) @@ -1185,7 +1185,7 @@ void viewDrawStats(PLAYER *pPlayer, int x, int y) if (gGameOptions.nGameType != 3) sprintf(buffer, "K:%d/%d", gKillMgr.at4, gKillMgr.at0); else - sprintf(buffer, "K:%d", pPlayer->at2c6); + sprintf(buffer, "K:%d", pPlayer->fragCount); viewDrawText(3, buffer, x, y, 20, 0, 0, true, 256); y += nHeight+1; sprintf(buffer, "S:%d/%d", gSecretMgr.at4+gSecretMgr.at8, gSecretMgr.at0); @@ -1236,12 +1236,12 @@ void viewDrawPowerUps(PLAYER* pPlayer) // kPwUpShrinkShroom - (shrinks player size, works only if gModernMap == true) POWERUPDISPLAY powerups[5]; - powerups[0] = { gPowerUpInfo[kPwUpShadowCloak].picnum, 0.4f, 0, pPlayer->at202[kPwUpShadowCloak] }; // invisibility - powerups[1] = { gPowerUpInfo[kPwUpReflectShots].picnum, 0.4f, 5, pPlayer->at202[kPwUpReflectShots] }; - powerups[2] = { gPowerUpInfo[kPwUpDeathMask].picnum, 0.3f, 9, pPlayer->at202[kPwUpDeathMask] }; // invulnerability - powerups[3] = { gPowerUpInfo[kPwUpTwoGuns].picnum, 0.3f, 5, pPlayer->at202[kPwUpTwoGuns] }; + powerups[0] = { gPowerUpInfo[kPwUpShadowCloak].picnum, 0.4f, 0, pPlayer->pwUpTime[kPwUpShadowCloak] }; // invisibility + powerups[1] = { gPowerUpInfo[kPwUpReflectShots].picnum, 0.4f, 5, pPlayer->pwUpTime[kPwUpReflectShots] }; + powerups[2] = { gPowerUpInfo[kPwUpDeathMask].picnum, 0.3f, 9, pPlayer->pwUpTime[kPwUpDeathMask] }; // invulnerability + powerups[3] = { gPowerUpInfo[kPwUpTwoGuns].picnum, 0.3f, 5, pPlayer->pwUpTime[kPwUpTwoGuns] }; // does nothing, only appears at near the end of Cryptic Passage's Lost Monastery (CP04) - powerups[4] = { gPowerUpInfo[kPwUpShadowCloakUseless].picnum, 0.4f, 9, pPlayer->at202[kPwUpShadowCloakUseless] }; + powerups[4] = { gPowerUpInfo[kPwUpShadowCloakUseless].picnum, 0.4f, 9, pPlayer->pwUpTime[kPwUpShadowCloakUseless] }; sortPowerUps(powerups); @@ -1284,13 +1284,13 @@ void viewDrawMapTitle(void) void viewDrawPack(PLAYER *pPlayer, int x, int y) { int packs[5]; - if (pPlayer->at31d) + if (pPlayer->packItemTime) { int nPacks = 0; int width = 0; for (int i = 0; i < 5; i++) { - if (pPlayer->packInfo[i].at1) + if (pPlayer->packSlots[i].curAmount) { packs[nPacks++] = i; width += tilesiz[gPackIcons[i]].x + 1; @@ -1304,38 +1304,38 @@ void viewDrawPack(PLAYER *pPlayer, int x, int y) DrawStatSprite(2568, x+1, y-8); DrawStatSprite(2568, x+1, y-6); DrawStatSprite(gPackIcons[nPack], x+1, y+1); - if (nPack == pPlayer->at321) + if (nPack == pPlayer->packItemId) DrawStatMaskedSprite(2559, x+1, y+1); int nShade; - if (pPlayer->packInfo[nPack].at0) + if (pPlayer->packSlots[nPack].isActive) nShade = 4; else nShade = 24; - DrawStatNumber("%3d", pPlayer->packInfo[nPack].at1, 2250, x-4, y-13, nShade, 0); + DrawStatNumber("%3d", pPlayer->packSlots[nPack].curAmount, 2250, x-4, y-13, nShade, 0); x += tilesiz[gPackIcons[nPack]].x + 1; } } - if (pPlayer->at31d != dword_14C508) + if (pPlayer->packItemTime != dword_14C508) { viewUpdatePages(); } - dword_14C508 = pPlayer->at31d; + dword_14C508 = pPlayer->packItemTime; } void DrawPackItemInStatusBar(PLAYER *pPlayer, int x, int y, int x2, int y2, int nStat) { - if (pPlayer->at321 < 0) return; + if (pPlayer->packItemId < 0) return; - DrawStatSprite(gPackIcons[pPlayer->at321], x, y, 0, 0, nStat); - DrawStatNumber("%3d", pPlayer->packInfo[pPlayer->at321].at1, 2250, x2, y2, 0, 0, nStat); + DrawStatSprite(gPackIcons[pPlayer->packItemId], x, y, 0, 0, nStat); + DrawStatNumber("%3d", pPlayer->packSlots[pPlayer->packItemId].curAmount, 2250, x2, y2, 0, 0, nStat); } void DrawPackItemInStatusBar2(PLAYER *pPlayer, int x, int y, int x2, int y2, int nStat, int nScale) { - if (pPlayer->at321 < 0) return; + if (pPlayer->packItemId < 0) return; - DrawStatMaskedSprite(gPackIcons2[pPlayer->at321].nTile, x, y+gPackIcons2[pPlayer->at321].nYOffs, 0, 0, nStat, gPackIcons2[pPlayer->at321].nScale); - DrawStatNumber("%3d", pPlayer->packInfo[pPlayer->at321].at1, kSBarNumberInv, x2, y2, 0, 0, nStat, nScale); + DrawStatMaskedSprite(gPackIcons2[pPlayer->packItemId].nTile, x, y+gPackIcons2[pPlayer->packItemId].nYOffs, 0, 0, nStat, gPackIcons2[pPlayer->packItemId].nScale); + DrawStatNumber("%3d", pPlayer->packSlots[pPlayer->packItemId].curAmount, kSBarNumberInv, x2, y2, 0, 0, nStat, nScale); } void viewDrawPlayerSlots(void) @@ -1358,7 +1358,7 @@ void viewDrawPlayerFrags(void) { int x = 80 * (i & 3); int y = 9 * (i / 4); - int col = gPlayer[p].at2ea & 3; + int col = gPlayer[p].teamId & 3; char* name = gProfile[p].name; if (gProfile[p].skill == 2) sprintf(gTempStr, "%s", name); @@ -1366,7 +1366,7 @@ void viewDrawPlayerFrags(void) sprintf(gTempStr, "%s [%d]", name, gProfile[p].skill); Bstrupr(gTempStr); viewDrawText(4, gTempStr, x + 4, y + 1, -128, 11 + col, 0, 0); - sprintf(gTempStr, "%2d", gPlayer[p].at2c6); + sprintf(gTempStr, "%2d", gPlayer[p].fragCount); viewDrawText(4, gTempStr, x + 76, y + 1, -128, 11 + col, 2, 0); } } @@ -1378,7 +1378,7 @@ void viewDrawPlayerFlags(void) { int x = 80 * (i & 3); int y = 9 * (i / 4); - int col = gPlayer[p].at2ea & 3; + int col = gPlayer[p].teamId & 3; char* name = gProfile[p].name; if (gProfile[p].skill == 2) sprintf(gTempStr, "%s", name); @@ -1389,13 +1389,13 @@ void viewDrawPlayerFlags(void) sprintf(gTempStr, "F"); x += 76; - if (gPlayer[p].at90 & 2) + if (gPlayer[p].hasFlag & 2) { viewDrawText(4, gTempStr, x, y + 1, -128, 12, 2, 0); x -= 6; } - if (gPlayer[p].at90 & 1) + if (gPlayer[p].hasFlag & 1) viewDrawText(4, gTempStr, x, y + 1, -128, 11, 2, 0); } } @@ -1454,19 +1454,19 @@ void viewDrawCtfHud(ClockTicks arg) int redFlagCarrierColor = 0; for (int i = 0, p = connecthead; p >= 0; i++, p = connectpoint2[p]) { - if ((gPlayer[p].at90 & 1) != 0) + if ((gPlayer[p].hasFlag & 1) != 0) { blueFlagTaken = true; - blueFlagCarrierColor = gPlayer[p].at2ea & 3; + blueFlagCarrierColor = gPlayer[p].teamId & 3; } - if ((gPlayer[p].at90 & 2) != 0) + if ((gPlayer[p].hasFlag & 2) != 0) { redFlagTaken = true; - redFlagCarrierColor = gPlayer[p].at2ea & 3; + redFlagCarrierColor = gPlayer[p].teamId & 3; } } - bool meHaveBlueFlag = gMe->at90 & 1; + bool meHaveBlueFlag = gMe->hasFlag & 1; DrawStatMaskedSprite(meHaveBlueFlag ? 3558 : 3559, 320, 75, 0, 10, 512, 65536 * 0.35); if (gBlueFlagDropped) DrawStatMaskedSprite(2332, 305, 83, 0, 10, 512, 65536); @@ -1474,7 +1474,7 @@ void viewDrawCtfHud(ClockTicks arg) DrawStatMaskedSprite(4097, 307, 77, 0, blueFlagCarrierColor ? 2 : 10, 512, 65536); flashTeamScore(arg, 0, true); - bool meHaveRedFlag = gMe->at90 & 2; + bool meHaveRedFlag = gMe->hasFlag & 2; DrawStatMaskedSprite(meHaveRedFlag ? 3558 : 3559, 320, 110, 0, 2, 512, 65536 * 0.35); if (gRedFlagDropped) DrawStatMaskedSprite(2332, 305, 117, 0, 2, 512, 65536); @@ -1492,7 +1492,7 @@ void UpdateStatusBar(ClockTicks arg) if (gGameOptions.nGameType == 3) { - if (pPlayer->at2ea & 1) + if (pPlayer->teamId & 1) nPalette = 7; else nPalette = 10; @@ -1504,43 +1504,43 @@ void UpdateStatusBar(ClockTicks arg) { DrawStatMaskedSprite(2169, 12, 195, 0, 0, 256, (int)(65536*0.56)); DrawStatNumber("%d", pXSprite->health>>4, kSBarNumberHealth, 28, 187, 0, 0, 256); - if (pPlayer->at33e[1]) + if (pPlayer->armor[1]) { DrawStatMaskedSprite(2578, 70, 186, 0, 0, 256, (int)(65536*0.5)); - DrawStatNumber("%3d", pPlayer->at33e[1]>>4, kSBarNumberArmor2, 83, 187, 0, 0, 256, (int)(65536*0.65)); + DrawStatNumber("%3d", pPlayer->armor[1]>>4, kSBarNumberArmor2, 83, 187, 0, 0, 256, (int)(65536*0.65)); } - if (pPlayer->at33e[0]) + if (pPlayer->armor[0]) { DrawStatMaskedSprite(2586, 112, 195, 0, 0, 256, (int)(65536*0.5)); - DrawStatNumber("%3d", pPlayer->at33e[0]>>4, kSBarNumberArmor1, 125, 187, 0, 0, 256, (int)(65536*0.65)); + DrawStatNumber("%3d", pPlayer->armor[0]>>4, kSBarNumberArmor1, 125, 187, 0, 0, 256, (int)(65536*0.65)); } - if (pPlayer->at33e[2]) + if (pPlayer->armor[2]) { DrawStatMaskedSprite(2602, 155, 196, 0, 0, 256, (int)(65536*0.5)); - DrawStatNumber("%3d", pPlayer->at33e[2]>>4, kSBarNumberArmor3, 170, 187, 0, 0, 256, (int)(65536*0.65)); + DrawStatNumber("%3d", pPlayer->armor[2]>>4, kSBarNumberArmor3, 170, 187, 0, 0, 256, (int)(65536*0.65)); } DrawPackItemInStatusBar2(pPlayer, 225, 194, 240, 187, 512, (int)(65536*0.7)); - if (pPlayer->atbd && pPlayer->atc7 != -1) + if (pPlayer->curWeapon && pPlayer->weaponAmmo != -1) { - int num = pPlayer->at181[pPlayer->atc7]; - if (pPlayer->atc7 == 6) + int num = pPlayer->ammCount[pPlayer->weaponAmmo]; + if (pPlayer->weaponAmmo == 6) num /= 10; - if ((unsigned int)gAmmoIcons[pPlayer->atc7].nTile < kMaxTiles) - DrawStatMaskedSprite(gAmmoIcons[pPlayer->atc7].nTile, 304, 192+gAmmoIcons[pPlayer->atc7].nYOffs, - 0, 0, 512, gAmmoIcons[pPlayer->atc7].nScale); + if ((unsigned int)gAmmoIcons[pPlayer->weaponAmmo].nTile < kMaxTiles) + DrawStatMaskedSprite(gAmmoIcons[pPlayer->weaponAmmo].nTile, 304, 192+gAmmoIcons[pPlayer->weaponAmmo].nYOffs, + 0, 0, 512, gAmmoIcons[pPlayer->weaponAmmo].nScale); DrawStatNumber("%3d", num, kSBarNumberAmmo, 267, 187, 0, 0, 512); } for (int i = 0; i < 6; i++) { - if (pPlayer->at88[i+1]) + if (pPlayer->hasKey[i+1]) DrawStatMaskedSprite(2552+i, 260+10*i, 170, 0, 0, 512, (int)(65536*0.25)); } - if (pPlayer->at1ba) - TileHGauge(2260, 124, 175-10, pPlayer->at1ba, 65536); + if (pPlayer->throwPower) + TileHGauge(2260, 124, 175-10, pPlayer->throwPower, 65536); else viewDrawPack(pPlayer, 166, 200-tilesiz[2201].y/2-30); viewDrawStats(pPlayer, 2, 140); @@ -1548,8 +1548,8 @@ void UpdateStatusBar(ClockTicks arg) } else if (gViewSize <= 2) { - if (pPlayer->at1ba) - TileHGauge(2260, 124, 175, pPlayer->at1ba, 65536); + if (pPlayer->throwPower) + TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536); else viewDrawPack(pPlayer, 166, 200-tilesiz[2201].y/2); } @@ -1560,28 +1560,28 @@ void UpdateStatusBar(ClockTicks arg) { DrawStatNumber("%3d", pXSprite->health>>4, 2190, 8, 183, 0, 0, 256); } - if (pPlayer->atbd && pPlayer->atc7 != -1) + if (pPlayer->curWeapon && pPlayer->weaponAmmo != -1) { - int num = pPlayer->at181[pPlayer->atc7]; - if (pPlayer->atc7 == 6) + int num = pPlayer->ammCount[pPlayer->weaponAmmo]; + if (pPlayer->weaponAmmo == 6) num /= 10; DrawStatNumber("%3d", num, 2240, 42, 183, 0, 0, 256); } DrawStatSprite(2173, 284, 187, 16, nPalette, 512); - if (pPlayer->at33e[1]) + if (pPlayer->armor[1]) { - TileHGauge(2207, 250, 175, pPlayer->at33e[1], 3200, 512); - DrawStatNumber("%3d", pPlayer->at33e[1]>>4, 2230, 255, 178, 0, 0, 512); + TileHGauge(2207, 250, 175, pPlayer->armor[1], 3200, 512); + DrawStatNumber("%3d", pPlayer->armor[1]>>4, 2230, 255, 178, 0, 0, 512); } - if (pPlayer->at33e[0]) + if (pPlayer->armor[0]) { - TileHGauge(2209, 250, 183, pPlayer->at33e[0], 3200, 512); - DrawStatNumber("%3d", pPlayer->at33e[0]>>4, 2230, 255, 186, 0, 0, 512); + TileHGauge(2209, 250, 183, pPlayer->armor[0], 3200, 512); + DrawStatNumber("%3d", pPlayer->armor[0]>>4, 2230, 255, 186, 0, 0, 512); } - if (pPlayer->at33e[2]) + if (pPlayer->armor[2]) { - TileHGauge(2208, 250, 191, pPlayer->at33e[2], 3200, 512); - DrawStatNumber("%3d", pPlayer->at33e[2]>>4, 2230, 255, 194, 0, 0, 512); + TileHGauge(2208, 250, 191, pPlayer->armor[2], 3200, 512); + DrawStatNumber("%3d", pPlayer->armor[2]>>4, 2230, 255, 194, 0, 0, 512); } DrawPackItemInStatusBar(pPlayer, 286, 186, 302, 183, 512); @@ -1600,7 +1600,7 @@ void UpdateStatusBar(ClockTicks arg) x = 73+(i>>1)*10; nStat |= 256; } - if (pPlayer->at88[i+1]) + if (pPlayer->hasKey[i+1]) DrawStatSprite(nTile, x, y, 0, 0, nStat); #if 0 else @@ -1619,10 +1619,10 @@ void UpdateStatusBar(ClockTicks arg) { DrawStatNumber("%3d", pXSprite->health>>4, 2190, 86, 183, 0, 0); } - if (pPlayer->atbd && pPlayer->atc7 != -1) + if (pPlayer->curWeapon && pPlayer->weaponAmmo != -1) { - int num = pPlayer->at181[pPlayer->atc7]; - if (pPlayer->atc7 == 6) + int num = pPlayer->ammCount[pPlayer->weaponAmmo]; + if (pPlayer->weaponAmmo == 6) num /= 10; DrawStatNumber("%3d", num, 2240, 216, 183, 0, 0); } @@ -1630,10 +1630,10 @@ void UpdateStatusBar(ClockTicks arg) { int x = 135+((i-1)/3)*23; int y = 182+((i-1)%3)*6; - int num = pPlayer->at181[i]; + int num = pPlayer->ammCount[i]; if (i == 6) num /= 10; - if (i == pPlayer->atc7) + if (i == pPlayer->weaponAmmo) { DrawStatNumber("%3d", num, 2230, x, y, -128, 10); } @@ -1643,38 +1643,38 @@ void UpdateStatusBar(ClockTicks arg) } } - if (pPlayer->atc7 == 10) + if (pPlayer->weaponAmmo == 10) { - DrawStatNumber("%2d", pPlayer->at181[10], 2230, 291, 194, -128, 10); + DrawStatNumber("%2d", pPlayer->ammCount[10], 2230, 291, 194, -128, 10); } else { - DrawStatNumber("%2d", pPlayer->at181[10], 2230, 291, 194, 32, 10); + DrawStatNumber("%2d", pPlayer->ammCount[10], 2230, 291, 194, 32, 10); } - if (pPlayer->atc7 == 11) + if (pPlayer->weaponAmmo == 11) { - DrawStatNumber("%2d", pPlayer->at181[11], 2230, 309, 194, -128, 10); + DrawStatNumber("%2d", pPlayer->ammCount[11], 2230, 309, 194, -128, 10); } else { - DrawStatNumber("%2d", pPlayer->at181[11], 2230, 309, 194, 32, 10); + DrawStatNumber("%2d", pPlayer->ammCount[11], 2230, 309, 194, 32, 10); } - if (pPlayer->at33e[1]) + if (pPlayer->armor[1]) { - TileHGauge(2207, 44, 174, pPlayer->at33e[1], 3200); - DrawStatNumber("%3d", pPlayer->at33e[1]>>4, 2230, 50, 177, 0, 0); + TileHGauge(2207, 44, 174, pPlayer->armor[1], 3200); + DrawStatNumber("%3d", pPlayer->armor[1]>>4, 2230, 50, 177, 0, 0); } - if (pPlayer->at33e[0]) + if (pPlayer->armor[0]) { - TileHGauge(2209, 44, 182, pPlayer->at33e[0], 3200); - DrawStatNumber("%3d", pPlayer->at33e[0]>>4, 2230, 50, 185, 0, 0); + TileHGauge(2209, 44, 182, pPlayer->armor[0], 3200); + DrawStatNumber("%3d", pPlayer->armor[0]>>4, 2230, 50, 185, 0, 0); } - if (pPlayer->at33e[2]) + if (pPlayer->armor[2]) { - TileHGauge(2208, 44, 190, pPlayer->at33e[2], 3200); - DrawStatNumber("%3d", pPlayer->at33e[2]>>4, 2230, 50, 193, 0, 0); + TileHGauge(2208, 44, 190, pPlayer->armor[2], 3200); + DrawStatNumber("%3d", pPlayer->armor[2]>>4, 2230, 50, 193, 0, 0); } sprintf(gTempStr, "v%s", GetVersionString()); viewDrawText(3, gTempStr, 20, 191, 32, 0, 1, 0); @@ -1684,16 +1684,16 @@ void UpdateStatusBar(ClockTicks arg) int nTile = 2220+i; int x = 73+(i&1)*173; int y = 171+(i>>1)*11; - if (pPlayer->at88[i+1]) + if (pPlayer->hasKey[i+1]) DrawStatSprite(nTile, x, y); else DrawStatSprite(nTile, x, y, 40, 5); } - DrawStatMaskedSprite(2202, 118, 185, pPlayer->at2e ? 16 : 40); - DrawStatMaskedSprite(2202, 201, 185, pPlayer->at2e ? 16 : 40); - if (pPlayer->at1ba) + DrawStatMaskedSprite(2202, 118, 185, pPlayer->isRunning ? 16 : 40); + DrawStatMaskedSprite(2202, 201, 185, pPlayer->isRunning ? 16 : 40); + if (pPlayer->throwPower) { - TileHGauge(2260, 124, 175, pPlayer->at1ba, 65536); + TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536); } viewDrawStats(pPlayer, 2, 140); viewDrawPowerUps(pPlayer); @@ -2151,17 +2151,17 @@ uspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect) { dassert(pTSprite->type >= kDudePlayer1 && pTSprite->type <= kDudePlayer8); PLAYER *pPlayer = &gPlayer[pTSprite->type-kDudePlayer1]; - if (gWeaponIcon[pPlayer->atbd].nTile < 0) break; + if (gWeaponIcon[pPlayer->curWeapon].nTile < 0) break; uspritetype *pNSprite = viewInsertTSprite(pTSprite->sectnum, 32767, pTSprite); int top, bottom; GetSpriteExtents((spritetype *)pTSprite, &top, &bottom); pNSprite->x = pTSprite->x; pNSprite->y = pTSprite->y; pNSprite->z = pTSprite->z-(32<<8); - pNSprite->picnum = gWeaponIcon[pPlayer->atbd].nTile; + pNSprite->picnum = gWeaponIcon[pPlayer->curWeapon].nTile; pNSprite->shade = pTSprite->shade; - pNSprite->xrepeat = gWeaponIcon[pPlayer->atbd].xRepeat; - pNSprite->yrepeat = gWeaponIcon[pPlayer->atbd].yRepeat; + pNSprite->xrepeat = gWeaponIcon[pPlayer->curWeapon].xRepeat; + pNSprite->yrepeat = gWeaponIcon[pPlayer->curWeapon].yRepeat; break; } } @@ -2459,7 +2459,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t case kMissileFlareAlt: if (pTSprite->statnum == kStatFlare) { dassert(pTXSprite != NULL); - if (pTXSprite->target == gView->at5b) { + if (pTXSprite->target == gView->nSprite) { pTSprite->xrepeat = 0; break; } @@ -2507,7 +2507,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t pTSprite->shade = -128; pTSprite->pal = 5; } else if (powerupCheck(pPlayer, kPwUpDoppleganger)) { - pTSprite->pal = 11+(gView->at2ea&3); + pTSprite->pal = 11+(gView->teamId&3); } if (powerupCheck(pPlayer, kPwUpReflectShots)) { @@ -2518,18 +2518,18 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t viewAddEffect(nTSprite, VIEW_EFFECT_12); } - if (pPlayer->at37b && (gView != pPlayer || gViewPos != VIEWPOS_0)) { + if (pPlayer->flashEffect && (gView != pPlayer || gViewPos != VIEWPOS_0)) { uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_14); if (pNTSprite) { - POSTURE *pPosture = &gPosture[pPlayer->at5f][pPlayer->at2f]; - pNTSprite->x += mulscale28(pPosture->at30, Cos(pTSprite->ang)); - pNTSprite->y += mulscale28(pPosture->at30, Sin(pTSprite->ang)); - pNTSprite->z = pPlayer->pSprite->z-pPosture->at2c; + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][pPlayer->posture]; + pNTSprite->x += mulscale28(pPosture->zOffset, Cos(pTSprite->ang)); + pNTSprite->y += mulscale28(pPosture->zOffset, Sin(pTSprite->ang)); + pNTSprite->z = pPlayer->pSprite->z-pPosture->xOffset; } } - if (pPlayer->at90 > 0 && gGameOptions.nGameType == 3) { - if (pPlayer->at90&1) { + if (pPlayer->hasFlag > 0 && gGameOptions.nGameType == 3) { + if (pPlayer->hasFlag&1) { uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_16); if (pNTSprite) { @@ -2537,7 +2537,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t pNTSprite->cstat |= 4; } } - if (pPlayer->at90&2) { + if (pPlayer->hasFlag&2) { uspritetype *pNTSprite = viewAddEffect(nTSprite, VIEW_EFFECT_16); if (pNTSprite) { @@ -2850,21 +2850,21 @@ void UpdateDacs(int nPalette, bool bNoTint) } if (!bNoTint) { - nRed += gView->at377; - nGreen += gView->at377; - nBlue -= gView->at377; + nRed += gView->pickupEffect; + nGreen += gView->pickupEffect; + nBlue -= gView->pickupEffect; - nRed += ClipHigh(gView->at366, 85)*2; - nGreen -= ClipHigh(gView->at366, 85)*3; - nBlue -= ClipHigh(gView->at366, 85)*3; + nRed += ClipHigh(gView->painEffect, 85)*2; + nGreen -= ClipHigh(gView->painEffect, 85)*3; + nBlue -= ClipHigh(gView->painEffect, 85)*3; - nRed -= gView->at36a; - nGreen -= gView->at36a; - nBlue -= gView->at36a; + nRed -= gView->blindEffect; + nGreen -= gView->blindEffect; + nBlue -= gView->blindEffect; - nRed -= gView->at36e>>6; - nGreen -= gView->at36e>>5; - nBlue -= gView->at36e>>6; + nRed -= gView->chokeEffect>>6; + nGreen -= gView->chokeEffect>>5; + nBlue -= gView->chokeEffect>>6; } nRed = ClipRange(nRed, -255, 255); nGreen = ClipRange(nGreen, -255, 255); @@ -2888,21 +2888,21 @@ void UpdateDacs(int nPalette, bool bNoTint) int nRed = baseDAC[i].red; int nGreen = baseDAC[i].green; int nBlue = baseDAC[i].blue; - nRed += gView->at377; - nGreen += gView->at377; - nBlue -= gView->at377; + nRed += gView->pickupEffect; + nGreen += gView->pickupEffect; + nBlue -= gView->pickupEffect; - nRed += ClipHigh(gView->at366, 85)*2; - nGreen -= ClipHigh(gView->at366, 85)*3; - nBlue -= ClipHigh(gView->at366, 85)*3; + nRed += ClipHigh(gView->painEffect, 85)*2; + nGreen -= ClipHigh(gView->painEffect, 85)*3; + nBlue -= ClipHigh(gView->painEffect, 85)*3; - nRed -= gView->at36a; - nGreen -= gView->at36a; - nBlue -= gView->at36a; + nRed -= gView->blindEffect; + nGreen -= gView->blindEffect; + nBlue -= gView->blindEffect; - nRed -= gView->at36e>>6; - nGreen -= gView->at36e>>5; - nBlue -= gView->at36e>>6; + nRed -= gView->chokeEffect>>6; + nGreen -= gView->chokeEffect>>5; + nBlue -= gView->chokeEffect>>6; newDAC[i].red = ClipRange(nRed, 0, 255); newDAC[i].green = ClipRange(nGreen, 0, 255); @@ -2980,9 +2980,9 @@ void viewUpdateShake(void) shakeZ = 0; shakeBobX = 0; shakeBobY = 0; - if (gView->at35a) + if (gView->flickerEffect) { - int nValue = ClipHigh(gView->at35a * 8, 2000); + int nValue = ClipHigh(gView->flickerEffect * 8, 2000); shakeHoriz += QRandom2(nValue >> 8); shakeAngle += QRandom2(nValue >> 8); shakeX += QRandom2(nValue >> 4); @@ -2991,9 +2991,9 @@ void viewUpdateShake(void) shakeBobX += QRandom2(nValue); shakeBobY += QRandom2(nValue); } - if (gView->at37f) + if (gView->quakeEffect) { - int nValue = ClipHigh(gView->at37f * 8, 2000); + int nValue = ClipHigh(gView->quakeEffect * 8, 2000); shakeHoriz += QRandom2(nValue >> 8); shakeAngle += QRandom2(nValue >> 8); shakeX += QRandom2(nValue >> 4); @@ -3083,15 +3083,15 @@ void viewDrawScreen(void) renderSetAspect(Blrintf(float(viewingrange) * tanf(gFov * (PI/360.f))), yxaspect); int cX = gView->pSprite->x; int cY = gView->pSprite->y; - int cZ = gView->at67; - int zDelta = gView->at6f-gView->at67-(12<<8); + int cZ = gView->zView; + int zDelta = gView->zWeapon-gView->zView-(12<<8); fix16_t cA = gView->q16ang; fix16_t q16horiz = gView->q16horiz; fix16_t q16slopehoriz = gView->q16slopehoriz; - int v74 = gView->at43; - int v8c = gView->at3f; - int v4c = gView->at53; - int v48 = gView->at4f; + int v74 = gView->bobWidth; + int v8c = gView->bobHeight; + int v4c = gView->swayWidth; + int v48 = gView->swayHeight; int nSectnum = gView->pSprite->sectnum; if (cl_interpolate) { @@ -3134,7 +3134,7 @@ void viewDrawScreen(void) cZ += shakeZ; v4c += shakeBobX; v48 += shakeBobY; - q16horiz += fix16_from_int(mulscale30(0x40000000-Cos(gView->at35e<<2), 30)); + q16horiz += fix16_from_int(mulscale30(0x40000000-Cos(gView->tiltEffect<<2), 30)); if (gViewPos == 0) { if (cl_viewhbob) @@ -3224,22 +3224,22 @@ void viewDrawScreen(void) renderSetAspect(65536, 78643); int vd8 = pOther->pSprite->x; int vd4 = pOther->pSprite->y; - int vd0 = pOther->at67; + int vd0 = pOther->zView; int vcc = pOther->pSprite->sectnum; int v50 = pOther->pSprite->ang; int v54 = 0; - if (pOther->at35a) + if (pOther->flickerEffect) { - int nValue = ClipHigh(pOther->at35a*8, 2000); + int nValue = ClipHigh(pOther->flickerEffect*8, 2000); v54 += QRandom2(nValue>>8); v50 += QRandom2(nValue>>8); vd8 += QRandom2(nValue>>4); vd4 += QRandom2(nValue>>4); vd0 += QRandom2(nValue); } - if (pOther->at37f) + if (pOther->quakeEffect) { - int nValue = ClipHigh(pOther->at37f*8, 2000); + int nValue = ClipHigh(pOther->quakeEffect*8, 2000); v54 += QRandom2(nValue >> 8); v50 += QRandom2(nValue >> 8); vd8 += QRandom2(nValue >> 4); @@ -3254,7 +3254,7 @@ void viewDrawScreen(void) } memcpy(bakMirrorGotpic, gotpic+510, 2); memcpy(gotpic+510, otherMirrorGotpic, 2); - g_visibility = (int32_t)(ClipLow(gVisibility-32*pOther->at362, 0) * (numplayers > 1 ? 1.f : r_ambientlightrecip)); + g_visibility = (int32_t)(ClipLow(gVisibility-32*pOther->visibility, 0) * (numplayers > 1 ? 1.f : r_ambientlightrecip)); int vc4, vc8; getzsofslope(vcc, vd8, vd4, &vc8, &vc4); if (vd0 >= vc4) @@ -3324,7 +3324,7 @@ RORHACKOTHER: } nSprite = nextspritestat[nSprite]; } - g_visibility = (int32_t)(ClipLow(gVisibility - 32 * gView->at362 - unk, 0) * (numplayers > 1 ? 1.f : r_ambientlightrecip)); + g_visibility = (int32_t)(ClipLow(gVisibility - 32 * gView->visibility - unk, 0) * (numplayers > 1 ? 1.f : r_ambientlightrecip)); cA = (cA + interpolateangfix16(fix16_from_int(deliriumTurnO), fix16_from_int(deliriumTurn), gInterpolate)) & 0x7ffffff; int vfc, vf8; getzsofslope(nSectnum, cX, cY, &vfc, &vf8); @@ -3504,7 +3504,7 @@ RORHACK: if (powerupCheck(gView, kPwUpDeathMask) > 0) nPalette = 4; else if(powerupCheck(gView, kPwUpReflectShots) > 0) nPalette = 1; - else if (gView->at87) { + else if (gView->isUnderwater) { if (gView->nWaterPal) nPalette = gView->nWaterPal; else { if (gView->pXSprite->medium == kMediumWater) nPalette = 1; @@ -3518,15 +3518,15 @@ RORHACK: gViewMap.sub_25DB0(gView->pSprite); } viewDrawInterface(delta); - int zn = ((gView->at6f-gView->at67-(12<<8))>>7)+220; + int zn = ((gView->zWeapon-gView->zView-(12<<8))>>7)+220; PLAYER *pPSprite = &gPlayer[gMe->pSprite->type-kDudePlayer1]; - if (pPSprite->at376 == 1) + if (pPSprite->hand == 1) { //static int lastClock; gChoke.sub_84110(160, zn); //if ((gGameClock % 5) == 0 && gGameClock != lastClock) //{ - // gChoke.at1c(pPSprite); + // gChoke.swayV(pPSprite); //} //lastClock = gGameClock; } @@ -3574,7 +3574,7 @@ RORHACK: } else if (gView != gMe) { - sprintf(gTempStr, "] %s [", gProfile[gView->at57].name); + sprintf(gTempStr, "] %s [", gProfile[gView->nPlayer].name); viewDrawText(0, gTempStr, 160, 10, 0, 0, 1, 0); } if (errMsg[0]) diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 82a978892..fa6d66846 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -136,10 +136,10 @@ void QAV::PlaySound3D(spritetype *pSprite, int nSound, int a3, int a4) char sub_4B1A4(PLAYER *pPlayer) { - switch (pPlayer->atbd) + switch (pPlayer->curWeapon) { case 7: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 5: case 6: @@ -147,7 +147,7 @@ char sub_4B1A4(PLAYER *pPlayer) } break; case 6: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 4: case 5: @@ -170,11 +170,11 @@ char sub_4B1FC(PLAYER *pPlayer, int a2, int a3, int a4) return 1; if (a3 == -1) return 1; - if (a2 == 12 && pPlayer->atc7 == 11 && pPlayer->atc3 == 11) + if (a2 == 12 && pPlayer->weaponAmmo == 11 && pPlayer->weaponState == 11) return 1; if (a2 == 9 && pPlayer->pXSprite->health > 0) return 1; - return pPlayer->at181[a3] >= a4; + return pPlayer->ammCount[a3] >= a4; } char CheckAmmo(PLAYER *pPlayer, int a2, int a3) @@ -183,11 +183,11 @@ char CheckAmmo(PLAYER *pPlayer, int a2, int a3) return 1; if (a2 == -1) return 1; - if (pPlayer->atbd == 12 && pPlayer->atc7 == 11 && pPlayer->atc3 == 11) + if (pPlayer->curWeapon == 12 && pPlayer->weaponAmmo == 11 && pPlayer->weaponState == 11) return 1; - if (pPlayer->atbd == 9 && pPlayer->pXSprite->health >= (a3<<4)) + if (pPlayer->curWeapon == 9 && pPlayer->pXSprite->health >= (a3<<4)) return 1; - return pPlayer->at181[a2] >= a3; + return pPlayer->ammCount[a2] >= a3; } char sub_4B2C8(PLAYER *pPlayer, int a2, int a3) @@ -196,23 +196,23 @@ char sub_4B2C8(PLAYER *pPlayer, int a2, int a3) return 1; if (a2 == -1) return 1; - return pPlayer->at181[a2] >= a3; + return pPlayer->ammCount[a2] >= a3; } void SpawnBulletEject(PLAYER *pPlayer, int a2, int a3) { - POSTURE *pPosture = &gPosture[pPlayer->at5f][pPlayer->at2f]; - pPlayer->at67 = pPlayer->pSprite->z-pPosture->at24; - int dz = pPlayer->at6f-(pPlayer->at6f-pPlayer->at67)/2; + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][pPlayer->posture]; + pPlayer->zView = pPlayer->pSprite->z-pPosture->eyeAboveZ; + int dz = pPlayer->zWeapon-(pPlayer->zWeapon-pPlayer->zView)/2; sub_74818(pPlayer->pSprite, dz, a2, a3); } void SpawnShellEject(PLAYER *pPlayer, int a2, int a3) { - POSTURE *pPosture = &gPosture[pPlayer->at5f][pPlayer->at2f]; - pPlayer->at67 = pPlayer->pSprite->z-pPosture->at24; - int t = pPlayer->at6f - pPlayer->at67; - int dz = pPlayer->at6f-t+(t>>2); + POSTURE *pPosture = &gPosture[pPlayer->lifeMode][pPlayer->posture]; + pPlayer->zView = pPlayer->pSprite->z-pPosture->eyeAboveZ; + int t = pPlayer->zWeapon - pPlayer->zView; + int dz = pPlayer->zWeapon-t+(t>>2); sub_74A18(pPlayer->pSprite, dz, a2, a3); } @@ -231,14 +231,14 @@ void WeaponInit(void) void WeaponDraw(PLAYER *pPlayer, int a2, int a3, int a4, int a5) { dassert(pPlayer != NULL); - if (pPlayer->at26 == -1) + if (pPlayer->weaponQav == -1) return; - QAV *pQAV = weaponQAV[pPlayer->at26]; + QAV *pQAV = weaponQAV[pPlayer->weaponQav]; int v4; - if (pPlayer->atbf == 0) + if (pPlayer->weaponTimer == 0) v4 = (int)totalclock%pQAV->at10; else - v4 = pQAV->at10-pPlayer->atbf; + v4 = pQAV->at10-pPlayer->weaponTimer; pQAV->x = a3; pQAV->y = a4; int flags = 2; @@ -254,24 +254,24 @@ void WeaponDraw(PLAYER *pPlayer, int a2, int a3, int a4, int a5) void WeaponPlay(PLAYER *pPlayer) { dassert(pPlayer != NULL); - if (pPlayer->at26 == -1) + if (pPlayer->weaponQav == -1) return; - QAV *pQAV = weaponQAV[pPlayer->at26]; + QAV *pQAV = weaponQAV[pPlayer->weaponQav]; pQAV->nSprite = pPlayer->pSprite->index; - int nTicks = pQAV->at10 - pPlayer->atbf; - pQAV->Play(nTicks-4, nTicks, pPlayer->at2a, pPlayer); + int nTicks = pQAV->at10 - pPlayer->weaponTimer; + pQAV->Play(nTicks-4, nTicks, pPlayer->qavCallback, pPlayer); } void StartQAV(PLAYER *pPlayer, int nWeaponQAV, int a3 = -1, char a4 = 0) { dassert(nWeaponQAV < kQAVEnd); - pPlayer->at26 = nWeaponQAV; - pPlayer->atbf = weaponQAV[nWeaponQAV]->at10; - pPlayer->at2a = a3; - pPlayer->at1b1 = a4; + pPlayer->weaponQav = nWeaponQAV; + pPlayer->weaponTimer = weaponQAV[nWeaponQAV]->at10; + pPlayer->qavCallback = a3; + pPlayer->qavLoop = a4; weaponQAV[nWeaponQAV]->Preload(); WeaponPlay(pPlayer); - pPlayer->atbf -= 4; + pPlayer->weaponTimer -= 4; } struct WEAPONTRACK @@ -309,15 +309,15 @@ void UpdateAimVector(PLAYER * pPlayer) spritetype *pPSprite = pPlayer->pSprite; int x = pPSprite->x; int y = pPSprite->y; - int z = pPlayer->at6f; + int z = pPlayer->zWeapon; Aim aim; aim.dx = Cos(pPSprite->ang)>>16; aim.dy = Sin(pPSprite->ang)>>16; - aim.dz = pPlayer->at83; - WEAPONTRACK *pWeaponTrack = &gWeaponTrack[pPlayer->atbd]; + aim.dz = pPlayer->slope; + WEAPONTRACK *pWeaponTrack = &gWeaponTrack[pPlayer->curWeapon]; int nTarget = -1; - pPlayer->at1da = 0; - if (gProfile[pPlayer->at57].nAutoAim == 1 || (gProfile[pPlayer->at57].nAutoAim == 2 && !pWeaponTrack->bIsProjectile) || pPlayer->atbd == 10 || pPlayer->atbd == 9) + pPlayer->aimTargetsCount = 0; + if (gProfile[pPlayer->nPlayer].nAutoAim == 1 || (gProfile[pPlayer->nPlayer].nAutoAim == 2 && !pWeaponTrack->bIsProjectile) || pPlayer->curWeapon == 10 || pPlayer->curWeapon == 9) { int nClosest = 0x7fffffff; for (nSprite = headspritestat[kStatDude]; nSprite >= 0; nSprite = nextspritestat[nSprite]) @@ -346,7 +346,7 @@ void UpdateAimVector(PLAYER * pPlayer) } int lx = x + mulscale30(Cos(pPSprite->ang), nDist); int ly = y + mulscale30(Sin(pPSprite->ang), nDist); - int lz = z + mulscale(pPlayer->at83, nDist, 10); + int lz = z + mulscale(pPlayer->slope, nDist, 10); int zRange = mulscale(9460, nDist, 10); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); @@ -355,8 +355,8 @@ void UpdateAimVector(PLAYER * pPlayer) int angle = getangle(x2-x,y2-y); if (klabs(((angle-pPSprite->ang+1024)&2047)-1024) > pWeaponTrack->at8) continue; - if (pPlayer->at1da < 16 && cansee(x,y,z,pPSprite->sectnum,x2,y2,z2,pSprite->sectnum)) - pPlayer->at1de[pPlayer->at1da++] = nSprite; + if (pPlayer->aimTargetsCount < 16 && cansee(x,y,z,pPSprite->sectnum,x2,y2,z2,pSprite->sectnum)) + pPlayer->aimTargets[pPlayer->aimTargetsCount++] = nSprite; // Inlined? int dz = (lz-z2)>>8; int dy = (ly-y2)>>4; @@ -396,7 +396,7 @@ void UpdateAimVector(PLAYER * pPlayer) continue; int lx = x + mulscale30(Cos(pPSprite->ang), nDist); int ly = y + mulscale30(Sin(pPSprite->ang), nDist); - int lz = z + mulscale(pPlayer->at83, nDist, 10); + int lz = z + mulscale(pPlayer->slope, nDist, 10); int zRange = mulscale10(9460, nDist); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); @@ -405,8 +405,8 @@ void UpdateAimVector(PLAYER * pPlayer) int angle = getangle(dx,dy); if (klabs(((angle-pPSprite->ang+1024)&2047)-1024) > pWeaponTrack->atc) continue; - if (pPlayer->at1da < 16 && cansee(x,y,z,pPSprite->sectnum,pSprite->x,pSprite->y,pSprite->z,pSprite->sectnum)) - pPlayer->at1de[pPlayer->at1da++] = nSprite; + if (pPlayer->aimTargetsCount < 16 && cansee(x,y,z,pPSprite->sectnum,pSprite->x,pSprite->y,pSprite->z,pSprite->sectnum)) + pPlayer->aimTargets[pPlayer->aimTargetsCount++] = nSprite; // Inlined? int dz2 = (lz-z2)>>8; int dy2 = (ly-y2)>>4; @@ -428,14 +428,14 @@ void UpdateAimVector(PLAYER * pPlayer) Aim aim2; aim2 = aim; RotateVector((int*)&aim2.dx, (int*)&aim2.dy, -pPSprite->ang); - aim2.dz -= pPlayer->at83; - pPlayer->at1ca.dx = interpolate(pPlayer->at1ca.dx, aim2.dx, pWeaponTrack->at0); - pPlayer->at1ca.dy = interpolate(pPlayer->at1ca.dy, aim2.dy, pWeaponTrack->at0); - pPlayer->at1ca.dz = interpolate(pPlayer->at1ca.dz, aim2.dz, pWeaponTrack->at4); - pPlayer->at1be = pPlayer->at1ca; - RotateVector((int*)&pPlayer->at1be.dx, (int*)&pPlayer->at1be.dy, pPSprite->ang); - pPlayer->at1be.dz += pPlayer->at83; - pPlayer->at1d6 = nTarget; + aim2.dz -= pPlayer->slope; + pPlayer->relAim.dx = interpolate(pPlayer->relAim.dx, aim2.dx, pWeaponTrack->at0); + pPlayer->relAim.dy = interpolate(pPlayer->relAim.dy, aim2.dy, pWeaponTrack->at0); + pPlayer->relAim.dz = interpolate(pPlayer->relAim.dz, aim2.dz, pWeaponTrack->at4); + pPlayer->aim = pPlayer->relAim; + RotateVector((int*)&pPlayer->aim.dx, (int*)&pPlayer->aim.dy, pPSprite->ang); + pPlayer->aim.dz += pPlayer->slope; + pPlayer->aimTarget = nTarget; } struct t_WeaponModes @@ -464,32 +464,32 @@ t_WeaponModes weaponModes[] = { void WeaponRaise(PLAYER *pPlayer) { dassert(pPlayer != NULL); - int prevWeapon = pPlayer->atbd; - pPlayer->atbd = pPlayer->atc.newWeapon; - pPlayer->atc.newWeapon = 0; - pPlayer->atc7 = weaponModes[pPlayer->atbd].at4; - switch (pPlayer->atbd) + int prevWeapon = pPlayer->curWeapon; + pPlayer->curWeapon = pPlayer->input.newWeapon; + pPlayer->input.newWeapon = 0; + pPlayer->weaponAmmo = weaponModes[pPlayer->curWeapon].at4; + switch (pPlayer->curWeapon) { case 1: // pitchfork - pPlayer->atc3 = 0; + pPlayer->weaponState = 0; StartQAV(pPlayer, 0, -1, 0); break; case 7: // spraycan - if (pPlayer->atc3 == 2) + if (pPlayer->weaponState == 2) { - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; StartQAV(pPlayer, 8, -1, 0); } else { - pPlayer->atc3 = 0; + pPlayer->weaponState = 0; StartQAV(pPlayer, 4, -1, 0); } break; case 6: // dynamite if (gInfiniteAmmo || sub_4B2C8(pPlayer, 5, 1)) { - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; if (prevWeapon == 7) StartQAV(pPlayer, 16, -1, 0); else @@ -499,65 +499,65 @@ void WeaponRaise(PLAYER *pPlayer) case 11: // proximity if (gInfiniteAmmo || sub_4B2C8(pPlayer, 10, 1)) { - pPlayer->atc3 = 7; + pPlayer->weaponState = 7; StartQAV(pPlayer, 25, -1, 0); } break; case 12: // remote if (gInfiniteAmmo || sub_4B2C8(pPlayer, 11, 1)) { - pPlayer->atc3 = 10; + pPlayer->weaponState = 10; StartQAV(pPlayer, 31, -1, 0); } else { StartQAV(pPlayer, 32, -1, 0); - pPlayer->atc3 = 11; + pPlayer->weaponState = 11; } break; case 3: // sawed off if (powerupCheck(pPlayer, kPwUpTwoGuns)) { - if (gInfiniteAmmo || pPlayer->at181[2] >= 4) + if (gInfiniteAmmo || pPlayer->ammCount[2] >= 4) StartQAV(pPlayer, 59, -1, 0); else StartQAV(pPlayer, 50, -1, 0); - if (gInfiniteAmmo || pPlayer->at181[2] >= 4) - pPlayer->atc3 = 7; - else if (pPlayer->at181[2] > 1) - pPlayer->atc3 = 3; - else if (pPlayer->at181[2] > 0) - pPlayer->atc3 = 2; + if (gInfiniteAmmo || pPlayer->ammCount[2] >= 4) + pPlayer->weaponState = 7; + else if (pPlayer->ammCount[2] > 1) + pPlayer->weaponState = 3; + else if (pPlayer->ammCount[2] > 0) + pPlayer->weaponState = 2; else - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; } else { - if (gInfiniteAmmo || pPlayer->at181[2] > 1) - pPlayer->atc3 = 3; - else if (pPlayer->at181[2] > 0) - pPlayer->atc3 = 2; + if (gInfiniteAmmo || pPlayer->ammCount[2] > 1) + pPlayer->weaponState = 3; + else if (pPlayer->ammCount[2] > 0) + pPlayer->weaponState = 2; else - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 50, -1, 0); } break; case 4: // tommy gun if (powerupCheck(pPlayer, kPwUpTwoGuns) && sub_4B2C8(pPlayer, 3, 2)) { - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 69, -1, 0); } else { - pPlayer->atc3 = 0; + pPlayer->weaponState = 0; StartQAV(pPlayer, 64, -1, 0); } break; case 10: // voodoo if (gInfiniteAmmo || sub_4B2C8(pPlayer, 9, 1)) { - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 100, -1, 0); } break; @@ -565,18 +565,18 @@ void WeaponRaise(PLAYER *pPlayer) if (powerupCheck(pPlayer, kPwUpTwoGuns) && sub_4B2C8(pPlayer, 1, 2)) { StartQAV(pPlayer, 45, -1, 0); - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; } else { StartQAV(pPlayer, 41, -1, 0); - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; } break; case 8: // tesla cannon if (sub_4B2C8(pPlayer, 7, 1)) { - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; if (powerupCheck(pPlayer, kPwUpTwoGuns)) StartQAV(pPlayer, 82, -1, 0); else @@ -584,7 +584,7 @@ void WeaponRaise(PLAYER *pPlayer) } else { - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; StartQAV(pPlayer, 74, -1, 0); } break; @@ -592,20 +592,20 @@ void WeaponRaise(PLAYER *pPlayer) if (powerupCheck(pPlayer, kPwUpTwoGuns)) { StartQAV(pPlayer, 120, -1, 0); - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; } else { StartQAV(pPlayer, 89, -1, 0); - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; } break; case 9: // life leech - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 111, -1, 0); break; case 13: // beast - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 93, -1, 0); break; } @@ -616,9 +616,9 @@ void WeaponLower(PLAYER *pPlayer) dassert(pPlayer != NULL); if (sub_4B1A4(pPlayer)) return; - pPlayer->at1ba = 0; - int prevState = pPlayer->atc3; - switch (pPlayer->atbd) + pPlayer->throwPower = 0; + int prevState = pPlayer->weaponState; + switch (pPlayer->curWeapon) { case 1: StartQAV(pPlayer, 3, -1, 0); @@ -631,32 +631,32 @@ void WeaponLower(PLAYER *pPlayer) StartQAV(pPlayer, 7, -1, 0); break; case 2: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; WeaponRaise(pPlayer); return; case 4: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 11, -1, 0); - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; WeaponLower(pPlayer); break; case 3: - if (pPlayer->atc.newWeapon == 6) + if (pPlayer->input.newWeapon == 6) { - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 11, -1, 0); return; } - else if (pPlayer->atc.newWeapon == 7) + else if (pPlayer->input.newWeapon == 7) { - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 11, -1, 0); - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; WeaponLower(pPlayer); } else { - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 11, -1, 0); } break; @@ -672,9 +672,9 @@ void WeaponLower(PLAYER *pPlayer) WeaponRaise(pPlayer); break; case 3: - if (pPlayer->atc.newWeapon == 7) + if (pPlayer->input.newWeapon == 7) { - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 17, -1, 0); } else @@ -712,13 +712,13 @@ void WeaponLower(PLAYER *pPlayer) StartQAV(pPlayer, 58, -1, 0); break; case 4: - if (powerupCheck(pPlayer, kPwUpTwoGuns) && pPlayer->atc3 == 1) + if (powerupCheck(pPlayer, kPwUpTwoGuns) && pPlayer->weaponState == 1) StartQAV(pPlayer, 72, -1, 0); else StartQAV(pPlayer, 68, -1, 0); break; case 2: - if (powerupCheck(pPlayer, kPwUpTwoGuns) && pPlayer->atc3 == 3) + if (powerupCheck(pPlayer, kPwUpTwoGuns) && pPlayer->weaponState == 3) StartQAV(pPlayer, 49, -1, 0); else StartQAV(pPlayer, 44, -1, 0); @@ -745,8 +745,8 @@ void WeaponLower(PLAYER *pPlayer) StartQAV(pPlayer, 99, -1, 0); break; } - pPlayer->atbd = 0; - pPlayer->at1b1 = 0; + pPlayer->curWeapon = 0; + pPlayer->qavLoop = 0; } void WeaponUpdateState(PLAYER *pPlayer) @@ -754,8 +754,8 @@ void WeaponUpdateState(PLAYER *pPlayer) static int lastWeapon = 0; static int lastState = 0; XSPRITE *pXSprite = pPlayer->pXSprite; - int va = pPlayer->atbd; - int vb = pPlayer->atc3; + int va = pPlayer->curWeapon; + int vb = pPlayer->weaponState; if (va != lastWeapon || vb != lastState) { lastWeapon = va; @@ -764,36 +764,36 @@ void WeaponUpdateState(PLAYER *pPlayer) switch (lastWeapon) { case 1: - pPlayer->at26 = 1; + pPlayer->weaponQav = 1; break; case 7: switch (vb) { case 0: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 5, -1, 0); break; case 1: if (CheckAmmo(pPlayer, 6, 1)) { - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; StartQAV(pPlayer, 8, -1, 0); } else - pPlayer->at26 = 6; + pPlayer->weaponQav = 6; break; case 3: - pPlayer->at26 = 9; + pPlayer->weaponQav = 9; break; case 4: if (CheckAmmo(pPlayer, 6, 1)) { - pPlayer->at26 = 9; - pPlayer->atc3 = 3; + pPlayer->weaponQav = 9; + pPlayer->weaponState = 3; } else { - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 11, -1, 0); } sfxKill3DSound(pPlayer->pSprite, -1, 441); @@ -804,27 +804,27 @@ void WeaponUpdateState(PLAYER *pPlayer) switch (vb) { case 1: - if (pPlayer->atc7 == 5 && CheckAmmo(pPlayer, 5, 1)) + if (pPlayer->weaponAmmo == 5 && CheckAmmo(pPlayer, 5, 1)) { - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; StartQAV(pPlayer, 16, -1, 0); } break; case 0: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 5, -1, 0); break; case 2: - if (pPlayer->at181[5] > 0) + if (pPlayer->ammCount[5] > 0) { - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; StartQAV(pPlayer, 16, -1, 0); } else - pPlayer->at26 = 6; + pPlayer->weaponQav = 6; break; case 3: - pPlayer->at26 = 20; + pPlayer->weaponQav = 20; break; } break; @@ -832,10 +832,10 @@ void WeaponUpdateState(PLAYER *pPlayer) switch (vb) { case 7: - pPlayer->at26 = 27; + pPlayer->weaponQav = 27; break; case 8: - pPlayer->atc3 = 7; + pPlayer->weaponState = 7; StartQAV(pPlayer, 25, -1, 0); break; } @@ -844,19 +844,19 @@ void WeaponUpdateState(PLAYER *pPlayer) switch (vb) { case 10: - pPlayer->at26 = 36; + pPlayer->weaponQav = 36; break; case 11: - pPlayer->at26 = 37; + pPlayer->weaponQav = 37; break; case 12: - if (pPlayer->at181[11] > 0) + if (pPlayer->ammCount[11] > 0) { - pPlayer->atc3 = 10; + pPlayer->weaponState = 10; StartQAV(pPlayer, 31, -1, 0); } else - pPlayer->atc3 = -1; + pPlayer->weaponState = -1; break; } break; @@ -865,77 +865,77 @@ void WeaponUpdateState(PLAYER *pPlayer) { case 6: if (powerupCheck(pPlayer, kPwUpTwoGuns) && (gInfiniteAmmo || CheckAmmo(pPlayer, 2, 4))) - pPlayer->atc3 = 7; + pPlayer->weaponState = 7; else - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; break; case 7: - pPlayer->at26 = 60; + pPlayer->weaponQav = 60; break; case 1: if (CheckAmmo(pPlayer, 2, 1)) { sfxPlay3DSound(pPlayer->pSprite, 410, 3, 2); StartQAV(pPlayer, 57, nClientEjectShell, 0); - if (gInfiniteAmmo || pPlayer->at181[2] > 1) - pPlayer->atc3 = 3; + if (gInfiniteAmmo || pPlayer->ammCount[2] > 1) + pPlayer->weaponState = 3; else - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; } else - pPlayer->at26 = 51; + pPlayer->weaponQav = 51; break; case 2: - pPlayer->at26 = 52; + pPlayer->weaponQav = 52; break; case 3: - pPlayer->at26 = 53; + pPlayer->weaponQav = 53; break; } break; case 4: if (powerupCheck(pPlayer, kPwUpTwoGuns) && sub_4B2C8(pPlayer, 3, 2)) { - pPlayer->at26 = 70; - pPlayer->atc3 = 1; + pPlayer->weaponQav = 70; + pPlayer->weaponState = 1; } else { - pPlayer->at26 = 65; - pPlayer->atc3 = 0; + pPlayer->weaponQav = 65; + pPlayer->weaponState = 0; } break; case 2: if (powerupCheck(pPlayer, kPwUpTwoGuns)) { if (vb == 3 && sub_4B2C8(pPlayer, 1, 2)) - pPlayer->at26 = 46; + pPlayer->weaponQav = 46; else { - pPlayer->at26 = 42; - pPlayer->atc3 = 2; + pPlayer->weaponQav = 42; + pPlayer->weaponState = 2; } } else - pPlayer->at26 = 42; + pPlayer->weaponQav = 42; break; case 10: - if (pXSprite->height < 256 && klabs(pPlayer->at4f) > 768) - pPlayer->at26 = 102; + if (pXSprite->height < 256 && klabs(pPlayer->swayHeight) > 768) + pPlayer->weaponQav = 102; else - pPlayer->at26 = 101; + pPlayer->weaponQav = 101; break; case 8: switch (vb) { case 2: if (sub_4B2C8(pPlayer, 7, 10) && powerupCheck(pPlayer, kPwUpTwoGuns)) - pPlayer->at26 = 83; + pPlayer->weaponQav = 83; else - pPlayer->at26 = 75; + pPlayer->weaponQav = 75; break; case 3: - pPlayer->at26 = 76; + pPlayer->weaponQav = 76; break; } break; @@ -944,12 +944,12 @@ void WeaponUpdateState(PLAYER *pPlayer) { case 3: if (powerupCheck(pPlayer, kPwUpTwoGuns) && (gInfiniteAmmo || CheckAmmo(pPlayer,4, 4))) - pPlayer->at26 = 121; + pPlayer->weaponQav = 121; else - pPlayer->at26 = 90; + pPlayer->weaponQav = 90; break; case 2: - pPlayer->at26 = 90; + pPlayer->weaponQav = 90; break; } break; @@ -957,29 +957,29 @@ void WeaponUpdateState(PLAYER *pPlayer) switch (vb) { case 2: - pPlayer->at26 = 112; + pPlayer->weaponQav = 112; break; } break; case 13: - pPlayer->at26 = 94; + pPlayer->weaponQav = 94; break; } } void FirePitchfork(int, PLAYER *pPlayer) { - Aim *aim = &pPlayer->at1be; + Aim *aim = &pPlayer->aim; int r1 = Random2(2000); int r2 = Random2(2000); int r3 = Random2(2000); for (int i = 0; i < 4; i++) - actFireVector(pPlayer->pSprite, (2*i-3)*40, pPlayer->at6f-pPlayer->pSprite->z, aim->dx+r1, aim->dy+r2, aim->dz+r3, VECTOR_TYPE_0); + actFireVector(pPlayer->pSprite, (2*i-3)*40, pPlayer->zWeapon-pPlayer->pSprite->z, aim->dx+r1, aim->dy+r2, aim->dz+r3, VECTOR_TYPE_0); } void FireSpray(int, PLAYER *pPlayer) { - playerFireMissile(pPlayer, 0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFlameSpray); + playerFireMissile(pPlayer, 0, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFlameSpray); UseAmmo(pPlayer, 6, 4); if (CheckAmmo(pPlayer, 6, 1)) sfxPlay3DSound(pPlayer->pSprite, 441, 1, 2); @@ -990,18 +990,18 @@ void FireSpray(int, PLAYER *pPlayer) void ThrowCan(int, PLAYER *pPlayer) { sfxKill3DSound(pPlayer->pSprite, -1, 441); - int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666; + int nSpeed = mulscale16(pPlayer->throwPower, 0x177777)+0x66666; sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0); spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedSpray, nSpeed); if (pSprite) { sfxPlay3DSound(pSprite, 441, 0, 0); - evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); int nXSprite = pSprite->extra; XSPRITE *pXSprite = &xsprite[nXSprite]; pXSprite->Impact = 1; - UseAmmo(pPlayer, 6, gAmmoItemData[0].at8); - pPlayer->at1ba = 0; + UseAmmo(pPlayer, 6, gAmmoItemData[0].count); + pPlayer->throwPower = 0; } } @@ -1011,8 +1011,8 @@ void DropCan(int, PLAYER *pPlayer) spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0); if (pSprite) { - evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn); - UseAmmo(pPlayer, 6, gAmmoItemData[0].at8); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); + UseAmmo(pPlayer, 6, gAmmoItemData[0].count); } } @@ -1021,33 +1021,33 @@ void ExplodeCan(int, PLAYER *pPlayer) sfxKill3DSound(pPlayer->pSprite, -1, 441); spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0); evPost(pSprite->index, 3, 0, kCmdOn); - UseAmmo(pPlayer, 6, gAmmoItemData[0].at8); + UseAmmo(pPlayer, 6, gAmmoItemData[0].count); StartQAV(pPlayer, 15, -1); - pPlayer->atbd = 0; - pPlayer->at1ba = 0; + pPlayer->curWeapon = 0; + pPlayer->throwPower = 0; } void ThrowBundle(int, PLAYER *pPlayer) { sfxKill3DSound(pPlayer->pSprite, 16, -1); - int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666; + int nSpeed = mulscale16(pPlayer->throwPower, 0x177777)+0x66666; sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0); spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedTNTBundle, nSpeed); int nXSprite = pSprite->extra; XSPRITE *pXSprite = &xsprite[nXSprite]; - if (pPlayer->at1b2 < 0) + if (pPlayer->fuseTime < 0) pXSprite->Impact = 1; else - evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); UseAmmo(pPlayer, 5, 1); - pPlayer->at1ba = 0; + pPlayer->throwPower = 0; } void DropBundle(int, PLAYER *pPlayer) { sfxKill3DSound(pPlayer->pSprite, 16, -1); spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0); - evPost(pSprite->index, 3, pPlayer->at1b2, kCmdOn); + evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn); UseAmmo(pPlayer, 5, 1); } @@ -1058,18 +1058,18 @@ void ExplodeBundle(int, PLAYER *pPlayer) evPost(pSprite->index, 3, 0, kCmdOn); UseAmmo(pPlayer, 5, 1); StartQAV(pPlayer, 24, -1, 0); - pPlayer->atbd = 0; - pPlayer->at1ba = 0; + pPlayer->curWeapon = 0; + pPlayer->throwPower = 0; } void ThrowProx(int, PLAYER *pPlayer) { - int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666; + int nSpeed = mulscale16(pPlayer->throwPower, 0x177777)+0x66666; sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0); spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedProxBomb, nSpeed); evPost(pSprite->index, 3, 240, kCmdOn); UseAmmo(pPlayer, 10, 1); - pPlayer->at1ba = 0; + pPlayer->throwPower = 0; } void DropProx(int, PLAYER *pPlayer) @@ -1081,14 +1081,14 @@ void DropProx(int, PLAYER *pPlayer) void ThrowRemote(int, PLAYER *pPlayer) { - int nSpeed = mulscale16(pPlayer->at1ba, 0x177777)+0x66666; + int nSpeed = mulscale16(pPlayer->throwPower, 0x177777)+0x66666; sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0); spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedRemoteBomb, nSpeed); int nXSprite = pSprite->extra; XSPRITE *pXSprite = &xsprite[nXSprite]; pXSprite->rxID = 90+(pPlayer->pSprite->type-kDudePlayer1); UseAmmo(pPlayer, 11, 1); - pPlayer->at1ba = 0; + pPlayer->throwPower = 0; } void DropRemote(int, PLAYER *pPlayer) @@ -1113,14 +1113,14 @@ void FireShotgun(int nTrigger, PLAYER *pPlayer) if (nTrigger == 1) { sfxPlay3DSound(pPlayer->pSprite, 411, 2, 0); - pPlayer->at35e = 30; - pPlayer->at362 = 20; + pPlayer->tiltEffect = 30; + pPlayer->visibility = 20; } else { sfxPlay3DSound(pPlayer->pSprite, 412, 2, 0); - pPlayer->at35e = 50; - pPlayer->at362 = 40; + pPlayer->tiltEffect = 50; + pPlayer->visibility = 40; } int n = nTrigger<<4; for (int i = 0; i < n; i++) @@ -1141,10 +1141,10 @@ void FireShotgun(int nTrigger, PLAYER *pPlayer) r3 = Random3(1500); nType = VECTOR_TYPE_4; } - actFireVector(pPlayer->pSprite, 0, pPlayer->at6f-pPlayer->pSprite->z, pPlayer->at1be.dx+r1, pPlayer->at1be.dy+r2, pPlayer->at1be.dz+r3, nType); + actFireVector(pPlayer->pSprite, 0, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->aim.dx+r1, pPlayer->aim.dy+r2, pPlayer->aim.dz+r3, nType); } - UseAmmo(pPlayer, pPlayer->atc7, nTrigger); - pPlayer->at37b = 1; + UseAmmo(pPlayer, pPlayer->weaponAmmo, nTrigger); + pPlayer->flashEffect = 1; } void EjectShell(int, PLAYER *pPlayer) @@ -1155,7 +1155,7 @@ void EjectShell(int, PLAYER *pPlayer) void FireTommy(int nTrigger, PLAYER *pPlayer) { - Aim *aim = &pPlayer->at1be; + Aim *aim = &pPlayer->aim; sfxPlay3DSound(pPlayer->pSprite, 431, -1, 0); switch (nTrigger) { @@ -1164,9 +1164,9 @@ void FireTommy(int nTrigger, PLAYER *pPlayer) int r1 = Random3(400); int r2 = Random3(1200); int r3 = Random3(1200); - actFireVector(pPlayer->pSprite, 0, pPlayer->at6f-pPlayer->pSprite->z, aim->dx+r3, aim->dy+r2, aim->dz+r1, VECTOR_TYPE_5); + actFireVector(pPlayer->pSprite, 0, pPlayer->zWeapon-pPlayer->pSprite->z, aim->dx+r3, aim->dy+r2, aim->dz+r1, VECTOR_TYPE_5); SpawnBulletEject(pPlayer, -15, -45); - pPlayer->at362 = 20; + pPlayer->visibility = 20; break; } case 2: @@ -1174,19 +1174,19 @@ void FireTommy(int nTrigger, PLAYER *pPlayer) int r1 = Random3(400); int r2 = Random3(1200); int r3 = Random3(1200); - actFireVector(pPlayer->pSprite, -120, pPlayer->at6f-pPlayer->pSprite->z, aim->dx+r3, aim->dy+r2, aim->dz+r1, VECTOR_TYPE_5); + actFireVector(pPlayer->pSprite, -120, pPlayer->zWeapon-pPlayer->pSprite->z, aim->dx+r3, aim->dy+r2, aim->dz+r1, VECTOR_TYPE_5); SpawnBulletEject(pPlayer, -140, -45); r1 = Random3(400); r2 = Random3(1200); r3 = Random3(1200); - actFireVector(pPlayer->pSprite, 120, pPlayer->at6f-pPlayer->pSprite->z, aim->dx+r3, aim->dy+r2, aim->dz+r1, VECTOR_TYPE_5); + actFireVector(pPlayer->pSprite, 120, pPlayer->zWeapon-pPlayer->pSprite->z, aim->dx+r3, aim->dy+r2, aim->dz+r1, VECTOR_TYPE_5); SpawnBulletEject(pPlayer, 140, 45); - pPlayer->at362 = 30; + pPlayer->visibility = 30; break; } } - UseAmmo(pPlayer, pPlayer->atc7, nTrigger); - pPlayer->at37b = 1; + UseAmmo(pPlayer, pPlayer->weaponAmmo, nTrigger); + pPlayer->flashEffect = 1; } #define kMaxSpread 14 @@ -1194,7 +1194,7 @@ void FireTommy(int nTrigger, PLAYER *pPlayer) void FireSpread(int nTrigger, PLAYER *pPlayer) { dassert(nTrigger > 0 && nTrigger <= kMaxSpread); - Aim *aim = &pPlayer->at1be; + Aim *aim = &pPlayer->aim; int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047; int dx = Cos(angle)>>16; int dy = Sin(angle)>>16; @@ -1203,19 +1203,19 @@ void FireSpread(int nTrigger, PLAYER *pPlayer) r1 = Random3(300); r2 = Random3(600); r3 = Random3(600); - actFireVector(pPlayer->pSprite, 0, pPlayer->at6f-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); + actFireVector(pPlayer->pSprite, 0, pPlayer->zWeapon-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); r1 = Random2(90); r2 = Random2(30); SpawnBulletEject(pPlayer, r2, r1); - pPlayer->at362 = 20; - UseAmmo(pPlayer, pPlayer->atc7, 1); - pPlayer->at37b = 1; + pPlayer->visibility = 20; + UseAmmo(pPlayer, pPlayer->weaponAmmo, 1); + pPlayer->flashEffect = 1; } void AltFireSpread(int nTrigger, PLAYER *pPlayer) { dassert(nTrigger > 0 && nTrigger <= kMaxSpread); - Aim *aim = &pPlayer->at1be; + Aim *aim = &pPlayer->aim; int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047; int dx = Cos(angle)>>16; int dy = Sin(angle)>>16; @@ -1224,27 +1224,27 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer) r1 = Random3(300); r2 = Random3(600); r3 = Random3(600); - actFireVector(pPlayer->pSprite, -120, pPlayer->at6f-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); + actFireVector(pPlayer->pSprite, -120, pPlayer->zWeapon-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); r1 = Random2(45); r2 = Random2(120); SpawnBulletEject(pPlayer, r2, r1); r1 = Random3(300); r2 = Random3(600); r3 = Random3(600); - actFireVector(pPlayer->pSprite, 120, pPlayer->at6f-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); + actFireVector(pPlayer->pSprite, 120, pPlayer->zWeapon-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); r1 = Random2(-45); r2 = Random2(-120); SpawnBulletEject(pPlayer, r2, r1); - pPlayer->at35e = 20; - pPlayer->at362 = 30; - UseAmmo(pPlayer, pPlayer->atc7, 2); - pPlayer->at37b = 1; + pPlayer->tiltEffect = 20; + pPlayer->visibility = 30; + UseAmmo(pPlayer, pPlayer->weaponAmmo, 2); + pPlayer->flashEffect = 1; } void AltFireSpread2(int nTrigger, PLAYER *pPlayer) { dassert(nTrigger > 0 && nTrigger <= kMaxSpread); - Aim *aim = &pPlayer->at1be; + Aim *aim = &pPlayer->aim; int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047; int dx = Cos(angle)>>16; int dy = Sin(angle)>>16; @@ -1255,20 +1255,20 @@ void AltFireSpread2(int nTrigger, PLAYER *pPlayer) r1 = Random3(300); r2 = Random3(600); r3 = Random3(600); - actFireVector(pPlayer->pSprite, -120, pPlayer->at6f-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); + actFireVector(pPlayer->pSprite, -120, pPlayer->zWeapon-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); r1 = Random2(45); r2 = Random2(120); SpawnBulletEject(pPlayer, r2, r1); r1 = Random3(300); r2 = Random3(600); r3 = Random3(600); - actFireVector(pPlayer->pSprite, 120, pPlayer->at6f-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); + actFireVector(pPlayer->pSprite, 120, pPlayer->zWeapon-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); r1 = Random2(-45); r2 = Random2(-120); SpawnBulletEject(pPlayer, r2, r1); - pPlayer->at35e = 30; - pPlayer->at362 = 45; - UseAmmo(pPlayer, pPlayer->atc7, 2); + pPlayer->tiltEffect = 30; + pPlayer->visibility = 45; + UseAmmo(pPlayer, pPlayer->weaponAmmo, 2); } else { @@ -1276,19 +1276,19 @@ void AltFireSpread2(int nTrigger, PLAYER *pPlayer) r1 = Random3(300); r2 = Random3(600); r3 = Random3(600); - actFireVector(pPlayer->pSprite, 0, pPlayer->at6f-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); + actFireVector(pPlayer->pSprite, 0, pPlayer->zWeapon-pPlayer->pSprite->z, dx+r3, dy+r2, aim->dz+r1, VECTOR_TYPE_3); r1 = Random2(90); r2 = Random2(30); SpawnBulletEject(pPlayer, r2, r1); - pPlayer->at35e = 20; - pPlayer->at362 = 30; - UseAmmo(pPlayer, pPlayer->atc7, 1); + pPlayer->tiltEffect = 20; + pPlayer->visibility = 30; + UseAmmo(pPlayer, pPlayer->weaponAmmo, 1); } - pPlayer->at37b = 1; + pPlayer->flashEffect = 1; if (!sub_4B2C8(pPlayer, 3, 1)) { WeaponLower(pPlayer); - pPlayer->atc3 = -1; + pPlayer->weaponState = -1; } } @@ -1305,11 +1305,11 @@ void FireFlare(int nTrigger, PLAYER *pPlayer) offset = 120; break; } - playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFlareRegular); + playerFireMissile(pPlayer, offset, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFlareRegular); UseAmmo(pPlayer, 1, 1); sfxPlay3DSound(pSprite, 420, 2, 0); - pPlayer->at362 = 30; - pPlayer->at37b = 1; + pPlayer->visibility = 30; + pPlayer->flashEffect = 1; } void AltFireFlare(int nTrigger, PLAYER *pPlayer) @@ -1325,17 +1325,17 @@ void AltFireFlare(int nTrigger, PLAYER *pPlayer) offset = 120; break; } - playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFlareAlt); + playerFireMissile(pPlayer, offset, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFlareAlt); UseAmmo(pPlayer, 1, 8); sfxPlay3DSound(pSprite, 420, 2, 0); - pPlayer->at362 = 45; - pPlayer->at37b = 1; + pPlayer->visibility = 45; + pPlayer->flashEffect = 1; } void FireVoodoo(int nTrigger, PLAYER *pPlayer) { nTrigger--; - int nSprite = pPlayer->at5b; + int nSprite = pPlayer->nSprite; spritetype *pSprite = pPlayer->pSprite; if (nTrigger == 4) { @@ -1382,7 +1382,7 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer) if (IsPlayerSprite(pTarget)) { PLAYER *pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1]; - pOtherPlayer->at36a = 128; + pOtherPlayer->blindEffect = 128; } UseAmmo(pPlayer, 9, nDamage/4); break; @@ -1397,28 +1397,28 @@ 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()) { - int nCount = ClipHigh(pPlayer->at181[9], pPlayer->at1da); + int nCount = ClipHigh(pPlayer->ammCount[9], pPlayer->aimTargetsCount); if (nCount > 0) { - for (int i = 0; i < pPlayer->at1da; i++) + for (int i = 0; i < pPlayer->aimTargetsCount; i++) { - int nTarget = pPlayer->at1de[i]; + int nTarget = pPlayer->aimTargets[i]; spritetype* pTarget = &sprite[nTarget]; if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pTarget)) continue; int nDist = approxDist(pTarget->x - pPlayer->pSprite->x, pTarget->y - pPlayer->pSprite->y); if (nDist > 0 && nDist < 51200) { - int vc = pPlayer->at181[9] >> 3; - int v8 = pPlayer->at181[9] << 1; + int vc = pPlayer->ammCount[9] >> 3; + int v8 = pPlayer->ammCount[9] << 1; int nDamage = (v8 + Random(vc)) << 4; nDamage = (nDamage * ((51200 - nDist) + 1)) / 51200; - nDamage = actDamageSprite(pPlayer->at5b, pTarget, DAMAGE_TYPE_5, nDamage); + nDamage = actDamageSprite(pPlayer->nSprite, pTarget, DAMAGE_TYPE_5, nDamage); if (IsPlayerSprite(pTarget)) { PLAYER* pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1]; - if (!pOtherPlayer->at31a || !powerupCheck(pOtherPlayer, kPwUpDeathMask)) + if (!pOtherPlayer->godMode || !powerupCheck(pOtherPlayer, kPwUpDeathMask)) powerupActivate(pOtherPlayer, kPwUpDeliriumShroom); } fxSpawnBlood(pTarget, 0); @@ -1427,18 +1427,18 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer) } UseAmmo(pPlayer, 9, 20); - pPlayer->atc3 = 0; + pPlayer->weaponState = 0; return; } - //int nAmmo = pPlayer->at181[9]; - int nCount = ClipHigh(pPlayer->at181[9], pPlayer->at1da); + //int nAmmo = pPlayer->ammCount[9]; + int nCount = ClipHigh(pPlayer->ammCount[9], pPlayer->aimTargetsCount); if (nCount > 0) { - int v4 = pPlayer->at181[9] - (pPlayer->at181[9] / nCount) * nCount; - for (int i = 0; i < pPlayer->at1da; i++) + int v4 = pPlayer->ammCount[9] - (pPlayer->ammCount[9] / nCount) * nCount; + for (int i = 0; i < pPlayer->aimTargetsCount; i++) { - int nTarget = pPlayer->at1de[i]; + int nTarget = pPlayer->aimTargets[i]; spritetype* pTarget = &sprite[nTarget]; if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pTarget)) continue; @@ -1447,25 +1447,25 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer) int nDist = approxDist(pTarget->x - pPlayer->pSprite->x, pTarget->y - pPlayer->pSprite->y); if (nDist > 0 && nDist < 51200) { - int vc = pPlayer->at181[9] >> 3; - int v8 = pPlayer->at181[9] << 1; + int vc = pPlayer->ammCount[9] >> 3; + int v8 = pPlayer->ammCount[9] << 1; int nDamage = (v8 + Random2(vc)) << 4; nDamage = (nDamage * ((51200 - nDist) + 1)) / 51200; - nDamage = actDamageSprite(pPlayer->at5b, pTarget, DAMAGE_TYPE_5, nDamage); + nDamage = actDamageSprite(pPlayer->nSprite, pTarget, DAMAGE_TYPE_5, nDamage); UseAmmo(pPlayer, 9, nDamage); if (IsPlayerSprite(pTarget)) { PLAYER* pOtherPlayer = &gPlayer[pTarget->type - kDudePlayer1]; - if (!pOtherPlayer->at31a || !powerupCheck(pOtherPlayer, kPwUpDeathMask)) + if (!pOtherPlayer->godMode || !powerupCheck(pOtherPlayer, kPwUpDeathMask)) powerupActivate(pOtherPlayer, kPwUpDeliriumShroom); } fxSpawnBlood(pTarget, 0); } } } - UseAmmo(pPlayer, 9, pPlayer->at181[9]); - pPlayer->atcb[10] = 0; - pPlayer->atc3 = -1; + UseAmmo(pPlayer, 9, pPlayer->ammCount[9]); + pPlayer->hasWeapon[10] = 0; + pPlayer->weaponState = -1; } } @@ -1478,11 +1478,11 @@ void DropVoodoo(int nTrigger, PLAYER *pPlayer) { int nXSprite = pSprite->extra; XSPRITE *pXSprite = &xsprite[nXSprite]; - pXSprite->data1 = pPlayer->at181[9]; + pXSprite->data1 = pPlayer->ammCount[9]; evPost(pSprite->index, 3, 90, kCallbackDropVoodoo); - UseAmmo(pPlayer, 6, gAmmoItemData[0].at8); - UseAmmo(pPlayer, 9, pPlayer->at181[9]); - pPlayer->atcb[10] = 0; + UseAmmo(pPlayer, 6, gAmmoItemData[0].count); + UseAmmo(pPlayer, 9, pPlayer->ammCount[9]); + pPlayer->hasWeapon[10] = 0; } } @@ -1517,17 +1517,17 @@ void FireTesla(int nTrigger, PLAYER *pPlayer) pMissile = &teslaMissile[0]; if (!sub_4B2C8(pPlayer, 7, pMissile->at8)) { - pPlayer->atc3 = -1; - pPlayer->at26 = 76; - pPlayer->at37b = 0; + pPlayer->weaponState = -1; + pPlayer->weaponQav = 76; + pPlayer->flashEffect = 0; return; } } - playerFireMissile(pPlayer, pMissile->at0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, pMissile->at4); + playerFireMissile(pPlayer, pMissile->at0, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, pMissile->at4); UseAmmo(pPlayer, 7, pMissile->at8); sfxPlay3DSound(pSprite, pMissile->atc, 1, 0); - pPlayer->at362 = pMissile->at10; - pPlayer->at37b = pMissile->at14; + pPlayer->visibility = pMissile->at10; + pPlayer->flashEffect = pMissile->at14; } } @@ -1535,11 +1535,11 @@ void AltFireTesla(int nTrigger, PLAYER *pPlayer) { UNREFERENCED_PARAMETER(nTrigger); spritetype *pSprite = pPlayer->pSprite; - playerFireMissile(pPlayer, 0, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileTeslaAlt); - UseAmmo(pPlayer, pPlayer->atc7, 35); + playerFireMissile(pPlayer, 0, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileTeslaAlt); + UseAmmo(pPlayer, pPlayer->weaponAmmo, 35); sfxPlay3DSound(pSprite, 471, 2, 0); - pPlayer->at362 = 40; - pPlayer->at37b = 1; + pPlayer->visibility = 40; + pPlayer->flashEffect = 1; } void FireNapalm(int nTrigger, PLAYER *pPlayer) @@ -1555,21 +1555,21 @@ void FireNapalm(int nTrigger, PLAYER *pPlayer) offset = 50; break; } - playerFireMissile(pPlayer, offset, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFireballNapam); + playerFireMissile(pPlayer, offset, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFireballNapam); sfxPlay3DSound(pSprite, 480, 2, 0); UseAmmo(pPlayer, 4, 1); - pPlayer->at37b = 1; + pPlayer->flashEffect = 1; } void FireNapalm2(int nTrigger, PLAYER *pPlayer) { UNREFERENCED_PARAMETER(nTrigger); spritetype *pSprite = pPlayer->pSprite; - playerFireMissile(pPlayer, -120, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.dz, kMissileFireballNapam); - playerFireMissile(pPlayer, 120, pPlayer->at1be.dx, pPlayer->at1be.dy, pPlayer->at1be.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, kMissileFireballNapam); sfxPlay3DSound(pSprite, 480, 2, 0); UseAmmo(pPlayer, 4, 2); - pPlayer->at37b = 1; + pPlayer->flashEffect = 1; } void AltFireNapalm(int nTrigger, PLAYER *pPlayer) @@ -1581,14 +1581,14 @@ void AltFireNapalm(int nTrigger, PLAYER *pPlayer) if (pMissile) { XSPRITE *pXSprite = &xsprite[pMissile->extra]; - pXSprite->data4 = ClipHigh(pPlayer->at181[4], 12); + pXSprite->data4 = ClipHigh(pPlayer->ammCount[4], 12); UseAmmo(pPlayer, 4, pXSprite->data4); seqSpawn(22, 3, pMissile->extra, -1); actBurnSprite(actSpriteIdToOwnerId(pPlayer->pSprite->index), pXSprite, 600); evPost(pMissile->index, 3, 0, kCallbackFXFlameLick); sfxPlay3DSound(pMissile, 480, 2, 0); - pPlayer->at362 = 30; - pPlayer->at37b = 1; + pPlayer->visibility = 30; + pPlayer->flashEffect = 1; } } @@ -1599,18 +1599,18 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer) int r1 = Random2(2000); int r2 = Random2(2000); int r3 = Random2(1000); - spritetype *pMissile = playerFireMissile(pPlayer, 0, pPlayer->at1be.dx+r1, pPlayer->at1be.dy+r2, pPlayer->at1be.dz+r3, 315); + spritetype *pMissile = playerFireMissile(pPlayer, 0, pPlayer->aim.dx+r1, pPlayer->aim.dy+r2, pPlayer->aim.dz+r3, 315); if (pMissile) { XSPRITE *pXSprite = &xsprite[pMissile->extra]; - pXSprite->target = pPlayer->at1d6; + pXSprite->target = pPlayer->aimTarget; pMissile->ang = (nTrigger==2) ? 1024 : 0; } if (sub_4B2C8(pPlayer, 8, 1)) UseAmmo(pPlayer, 8, 1); else - actDamageSprite(pPlayer->at5b, pPlayer->pSprite, DAMAGE_TYPE_5, 16); - pPlayer->at362 = ClipHigh(pPlayer->at362+5, 50); + actDamageSprite(pPlayer->nSprite, pPlayer->pSprite, DAMAGE_TYPE_5, 16); + pPlayer->visibility = ClipHigh(pPlayer->visibility+5, 50); } void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer) @@ -1625,15 +1625,15 @@ void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer) pXSprite->Push = 1; pXSprite->Proximity = 1; pXSprite->DudeLockout = 1; - pXSprite->data4 = ClipHigh(pPlayer->at181[4], 12); + pXSprite->data4 = ClipHigh(pPlayer->ammCount[4], 12); pXSprite->stateTimer = 1; evPost(pMissile->index, 3, 120, kCallbackLeechStateTimer); if (gGameOptions.nGameType <= 1) { - int nAmmo = pPlayer->at181[8]; + int nAmmo = pPlayer->ammCount[8]; if (nAmmo < 25 && pPlayer->pXSprite->health > ((25-nAmmo)<<4)) { - actDamageSprite(pPlayer->at5b, pPlayer->pSprite, DAMAGE_TYPE_5, ((25-nAmmo)<<4)); + actDamageSprite(pPlayer->nSprite, pPlayer->pSprite, DAMAGE_TYPE_5, ((25-nAmmo)<<4)); nAmmo = 25; } pXSprite->data3 = nAmmo; @@ -1641,10 +1641,10 @@ void AltFireLifeLeech(int nTrigger, PLAYER *pPlayer) } else { - pXSprite->data3 = pPlayer->at181[8]; - pPlayer->at181[8] = 0; + pXSprite->data3 = pPlayer->ammCount[8]; + pPlayer->ammCount[8] = 0; } - pPlayer->atcb[9] = 0; + pPlayer->hasWeapon[9] = 0; } } @@ -1654,7 +1654,7 @@ void FireBeast(int nTrigger, PLAYER * pPlayer) int r1 = Random2(2000); int r2 = Random2(2000); int r3 = Random2(2000); - actFireVector(pPlayer->pSprite, 0, pPlayer->at6f-pPlayer->pSprite->z, pPlayer->at1be.dx+r1, pPlayer->at1be.dy+r2, pPlayer->at1be.dz+r3, VECTOR_TYPE_9); + actFireVector(pPlayer->pSprite, 0, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->aim.dx+r1, pPlayer->aim.dy+r2, pPlayer->aim.dz+r3, VECTOR_TYPE_9); } char gWeaponUpgrade[][13] = { @@ -1675,8 +1675,8 @@ char gWeaponUpgrade[][13] = { char WeaponUpgrade(PLAYER *pPlayer, char newWeapon) { - char weapon = pPlayer->atbd; - if (!sub_4B1A4(pPlayer) && (gProfile[pPlayer->at57].nWeaponSwitch&1) && (gWeaponUpgrade[pPlayer->atbd][newWeapon] || (gProfile[pPlayer->at57].nWeaponSwitch&2))) + char weapon = pPlayer->curWeapon; + if (!sub_4B1A4(pPlayer) && (gProfile[pPlayer->nPlayer].nWeaponSwitch&1) && (gWeaponUpgrade[pPlayer->curWeapon][newWeapon] || (gProfile[pPlayer->nPlayer].nWeaponSwitch&2))) weapon = newWeapon; return weapon; } @@ -1686,14 +1686,14 @@ int OrderPrev[] = { 12, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1 }; char WeaponFindNext(PLAYER *pPlayer, int *a2, char bDir) { - int weapon = pPlayer->atbd; + int weapon = pPlayer->curWeapon; do { if (bDir) weapon = OrderNext[weapon]; else weapon = OrderPrev[weapon]; - if (weaponModes[weapon].at0 && pPlayer->atcb[weapon]) + if (weaponModes[weapon].at0 && pPlayer->hasWeapon[weapon]) { if (weapon == 9) { @@ -1706,8 +1706,8 @@ char WeaponFindNext(PLAYER *pPlayer, int *a2, char bDir) break; } } - } while (weapon != pPlayer->atbd); - if (weapon == pPlayer->atbd) + } while (weapon != pPlayer->curWeapon); + if (weapon == pPlayer->curWeapon) { if (!weaponModes[weapon].at0 || !CheckAmmo(pPlayer, weaponModes[weapon].at4, 1)) weapon = 1; @@ -1721,14 +1721,14 @@ char WeaponFindLoaded(PLAYER *pPlayer, int *a2) { char v4 = 1; int v14 = 0; - if (weaponModes[pPlayer->atbd].at0 > 1) + if (weaponModes[pPlayer->curWeapon].at0 > 1) { - for (int i = 0; i < weaponModes[pPlayer->atbd].at0; i++) + for (int i = 0; i < weaponModes[pPlayer->curWeapon].at0; i++) { - if (CheckAmmo(pPlayer, weaponModes[pPlayer->atbd].at4, 1)) + if (CheckAmmo(pPlayer, weaponModes[pPlayer->curWeapon].at4, 1)) { v14 = i; - v4 = pPlayer->atbd; + v4 = pPlayer->curWeapon; break; } } @@ -1738,8 +1738,8 @@ char WeaponFindLoaded(PLAYER *pPlayer, int *a2) int vc = 0; for (int i = 0; i < 14; i++) { - int weapon = pPlayer->at111[vc][i]; - if (pPlayer->atcb[weapon]) + int weapon = pPlayer->weaponOrder[vc][i]; + if (pPlayer->hasWeapon[weapon]) { for (int j = 0; j < weaponModes[weapon].at0; j++) { @@ -1760,34 +1760,34 @@ char WeaponFindLoaded(PLAYER *pPlayer, int *a2) char sub_4F0E0(PLAYER *pPlayer) { - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 5: - if (!pPlayer->atc.buttonFlags.shoot2) - pPlayer->atc3 = 6; + if (!pPlayer->input.buttonFlags.shoot2) + pPlayer->weaponState = 6; return 1; case 6: - if (pPlayer->atc.buttonFlags.shoot2) + if (pPlayer->input.buttonFlags.shoot2) { - pPlayer->atc3 = 3; - pPlayer->at1b2 = pPlayer->atbf; + pPlayer->weaponState = 3; + pPlayer->fuseTime = pPlayer->weaponTimer; StartQAV(pPlayer, 13, nClientDropCan, 0); } - else if (pPlayer->atc.buttonFlags.shoot) + else if (pPlayer->input.buttonFlags.shoot) { - pPlayer->atc3 = 7; - pPlayer->at1b2 = 0; - pPlayer->at1b6 = (int)gFrameClock; + pPlayer->weaponState = 7; + pPlayer->fuseTime = 0; + pPlayer->throwTime = (int)gFrameClock; } return 1; case 7: { - pPlayer->at1ba = ClipHigh(divscale16((int)gFrameClock-pPlayer->at1b6,240), 65536); - if (!pPlayer->atc.buttonFlags.shoot) + pPlayer->throwPower = ClipHigh(divscale16((int)gFrameClock-pPlayer->throwTime,240), 65536); + if (!pPlayer->input.buttonFlags.shoot) { - if (!pPlayer->at1b2) - pPlayer->at1b2 = pPlayer->atbf; - pPlayer->atc3 = 1; + if (!pPlayer->fuseTime) + pPlayer->fuseTime = pPlayer->weaponTimer; + pPlayer->weaponState = 1; StartQAV(pPlayer, 14, nClientThrowCan, 0); } return 1; @@ -1798,34 +1798,34 @@ char sub_4F0E0(PLAYER *pPlayer) char sub_4F200(PLAYER *pPlayer) { - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 4: - if (!pPlayer->atc.buttonFlags.shoot2) - pPlayer->atc3 = 5; + if (!pPlayer->input.buttonFlags.shoot2) + pPlayer->weaponState = 5; return 1; case 5: - if (pPlayer->atc.buttonFlags.shoot2) + if (pPlayer->input.buttonFlags.shoot2) { - pPlayer->atc3 = 1; - pPlayer->at1b2 = pPlayer->atbf; + pPlayer->weaponState = 1; + pPlayer->fuseTime = pPlayer->weaponTimer; StartQAV(pPlayer, 22, nClientDropBundle, 0); } - else if (pPlayer->atc.buttonFlags.shoot) + else if (pPlayer->input.buttonFlags.shoot) { - pPlayer->atc3 = 6; - pPlayer->at1b2 = 0; - pPlayer->at1b6 = (int)gFrameClock; + pPlayer->weaponState = 6; + pPlayer->fuseTime = 0; + pPlayer->throwTime = (int)gFrameClock; } return 1; case 6: { - pPlayer->at1ba = ClipHigh(divscale16((int)gFrameClock-pPlayer->at1b6,240), 65536); - if (!pPlayer->atc.buttonFlags.shoot) + pPlayer->throwPower = ClipHigh(divscale16((int)gFrameClock-pPlayer->throwTime,240), 65536); + if (!pPlayer->input.buttonFlags.shoot) { - if (!pPlayer->at1b2) - pPlayer->at1b2 = pPlayer->atbf; - pPlayer->atc3 = 1; + if (!pPlayer->fuseTime) + pPlayer->fuseTime = pPlayer->weaponTimer; + pPlayer->weaponState = 1; StartQAV(pPlayer, 23, nClientThrowBundle, 0); } return 1; @@ -1836,14 +1836,14 @@ char sub_4F200(PLAYER *pPlayer) char sub_4F320(PLAYER *pPlayer) { - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 9: - pPlayer->at1ba = ClipHigh(divscale16((int)gFrameClock-pPlayer->at1b6,240), 65536); - pPlayer->atbf = 0; - if (!pPlayer->atc.buttonFlags.shoot) + pPlayer->throwPower = ClipHigh(divscale16((int)gFrameClock-pPlayer->throwTime,240), 65536); + pPlayer->weaponTimer = 0; + if (!pPlayer->input.buttonFlags.shoot) { - pPlayer->atc3 = 8; + pPlayer->weaponState = 8; StartQAV(pPlayer, 29, nClientThrowProx, 0); } break; @@ -1853,13 +1853,13 @@ char sub_4F320(PLAYER *pPlayer) char sub_4F3A0(PLAYER *pPlayer) { - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 13: - pPlayer->at1ba = ClipHigh(divscale16((int)gFrameClock-pPlayer->at1b6,240), 65536); - if (!pPlayer->atc.buttonFlags.shoot) + pPlayer->throwPower = ClipHigh(divscale16((int)gFrameClock-pPlayer->throwTime,240), 65536); + if (!pPlayer->input.buttonFlags.shoot) { - pPlayer->atc3 = 11; + pPlayer->weaponState = 11; StartQAV(pPlayer, 39, nClientThrowRemote, 0); } break; @@ -1869,22 +1869,22 @@ char sub_4F3A0(PLAYER *pPlayer) char sub_4F414(PLAYER *pPlayer) { - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 4: - pPlayer->atc3 = 6; + pPlayer->weaponState = 6; StartQAV(pPlayer, 114, nClientFireLifeLeech, 1); return 1; case 6: - if (!pPlayer->atc.buttonFlags.shoot2) + if (!pPlayer->input.buttonFlags.shoot2) { - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 118, -1, 0); return 1; } break; case 8: - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 118, -1, 0); return 1; } @@ -1893,19 +1893,19 @@ char sub_4F414(PLAYER *pPlayer) char sub_4F484(PLAYER *pPlayer) { - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 4: - pPlayer->atc3 = 5; + pPlayer->weaponState = 5; if (sub_4B2C8(pPlayer, 7, 10) && powerupCheck(pPlayer, kPwUpTwoGuns)) StartQAV(pPlayer, 84, nClientFireTesla, 1); else StartQAV(pPlayer, 77, nClientFireTesla, 1); return 1; case 5: - if (!pPlayer->atc.buttonFlags.shoot) + if (!pPlayer->input.buttonFlags.shoot) { - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; if (sub_4B2C8(pPlayer, 7, 10) && powerupCheck(pPlayer, kPwUpTwoGuns)) StartQAV(pPlayer, 87, -1, 0); else @@ -1914,7 +1914,7 @@ char sub_4F484(PLAYER *pPlayer) } break; case 7: - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; if (sub_4B2C8(pPlayer, 7, 10) && powerupCheck(pPlayer, kPwUpTwoGuns)) StartQAV(pPlayer, 87, -1, 0); else @@ -1926,53 +1926,53 @@ char sub_4F484(PLAYER *pPlayer) void WeaponProcess(PLAYER *pPlayer) { - pPlayer->at37b = ClipLow(pPlayer->at37b-1, 0); + pPlayer->flashEffect = ClipLow(pPlayer->flashEffect-1, 0); if (pPlayer->pXSprite->health == 0) { - pPlayer->at1b1 = 0; + pPlayer->qavLoop = 0; sfxKill3DSound(pPlayer->pSprite, 1, -1); } - if (pPlayer->at87 && BannedUnderwater(pPlayer->atbd)) + if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->curWeapon)) { if (sub_4B1A4(pPlayer)) { - if (pPlayer->atbd == 7) + if (pPlayer->curWeapon == 7) { - pPlayer->at1b2 = pPlayer->atbf; + pPlayer->fuseTime = pPlayer->weaponTimer; DropCan(1, pPlayer); - pPlayer->atc3 = 3; + pPlayer->weaponState = 3; } - else if (pPlayer->atbd == 6) + else if (pPlayer->curWeapon == 6) { - pPlayer->at1b2 = pPlayer->atbf; + pPlayer->fuseTime = pPlayer->weaponTimer; DropBundle(1, pPlayer); - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; } } WeaponLower(pPlayer); - pPlayer->at1ba = 0; + pPlayer->throwPower = 0; } WeaponPlay(pPlayer); UpdateAimVector(pPlayer); - pPlayer->atbf -= 4; - char bShoot = pPlayer->atc.buttonFlags.shoot; - char bShoot2 = pPlayer->atc.buttonFlags.shoot2; - if (pPlayer->at1b1 && pPlayer->pXSprite->health > 0) + pPlayer->weaponTimer -= 4; + char bShoot = pPlayer->input.buttonFlags.shoot; + char bShoot2 = pPlayer->input.buttonFlags.shoot2; + if (pPlayer->qavLoop && pPlayer->pXSprite->health > 0) { - if (bShoot && CheckAmmo(pPlayer, pPlayer->atc7, 1)) + if (bShoot && CheckAmmo(pPlayer, pPlayer->weaponAmmo, 1)) { - while (pPlayer->atbf <= 0) - pPlayer->atbf += weaponQAV[pPlayer->at26]->at10; + while (pPlayer->weaponTimer <= 0) + pPlayer->weaponTimer += weaponQAV[pPlayer->weaponQav]->at10; } else { - pPlayer->atbf = 0; - pPlayer->at1b1 = 0; + pPlayer->weaponTimer = 0; + pPlayer->qavLoop = 0; } return; } - pPlayer->atbf = ClipLow(pPlayer->atbf, 0); - switch (pPlayer->atbd) + pPlayer->weaponTimer = ClipLow(pPlayer->weaponTimer, 0); + switch (pPlayer->curWeapon) { case 7: if (sub_4F0E0(pPlayer)) @@ -1991,11 +1991,11 @@ void WeaponProcess(PLAYER *pPlayer) return; break; } - if (pPlayer->atbf > 0) + if (pPlayer->weaponTimer > 0) return; - if (pPlayer->pXSprite->health == 0 || pPlayer->atbd == 0) - pPlayer->at26 = -1; - switch (pPlayer->atbd) + if (pPlayer->pXSprite->health == 0 || pPlayer->curWeapon == 0) + pPlayer->weaponQav = -1; + switch (pPlayer->curWeapon) { case 9: if (sub_4F414(pPlayer)) @@ -2006,114 +2006,114 @@ void WeaponProcess(PLAYER *pPlayer) return; break; } - if (pPlayer->atbe) + if (pPlayer->nextWeapon) { sfxKill3DSound(pPlayer->pSprite, -1, 441); - pPlayer->atc3 = 0; - pPlayer->atc.newWeapon = pPlayer->atbe; - pPlayer->atbe = 0; + pPlayer->weaponState = 0; + pPlayer->input.newWeapon = pPlayer->nextWeapon; + pPlayer->nextWeapon = 0; } - if (pPlayer->atc.keyFlags.nextWeapon) + if (pPlayer->input.keyFlags.nextWeapon) { - pPlayer->atc.keyFlags.nextWeapon = 0; - pPlayer->atc3 = 0; - pPlayer->atbe = 0; + pPlayer->input.keyFlags.nextWeapon = 0; + pPlayer->weaponState = 0; + pPlayer->nextWeapon = 0; int t; char weapon = WeaponFindNext(pPlayer, &t, 1); - pPlayer->atd9[weapon] = t; - if (pPlayer->atbd) + pPlayer->weaponMode[weapon] = t; + if (pPlayer->curWeapon) { WeaponLower(pPlayer); - pPlayer->atbe = weapon; + pPlayer->nextWeapon = weapon; return; } - pPlayer->atc.newWeapon = weapon; + pPlayer->input.newWeapon = weapon; } - if (pPlayer->atc.keyFlags.prevWeapon) + if (pPlayer->input.keyFlags.prevWeapon) { - pPlayer->atc.keyFlags.prevWeapon = 0; - pPlayer->atc3 = 0; - pPlayer->atbe = 0; + pPlayer->input.keyFlags.prevWeapon = 0; + pPlayer->weaponState = 0; + pPlayer->nextWeapon = 0; int t; char weapon = WeaponFindNext(pPlayer, &t, 0); - pPlayer->atd9[weapon] = t; - if (pPlayer->atbd) + pPlayer->weaponMode[weapon] = t; + if (pPlayer->curWeapon) { WeaponLower(pPlayer); - pPlayer->atbe = weapon; + pPlayer->nextWeapon = weapon; return; } - pPlayer->atc.newWeapon = weapon; + pPlayer->input.newWeapon = weapon; } - if (pPlayer->atc3 == -1) + if (pPlayer->weaponState == -1) { - pPlayer->atc3 = 0; + pPlayer->weaponState = 0; int t; char weapon = WeaponFindLoaded(pPlayer, &t); - pPlayer->atd9[weapon] = t; - if (pPlayer->atbd) + pPlayer->weaponMode[weapon] = t; + if (pPlayer->curWeapon) { WeaponLower(pPlayer); - pPlayer->atbe = weapon; + pPlayer->nextWeapon = weapon; return; } - pPlayer->atc.newWeapon = weapon; + pPlayer->input.newWeapon = weapon; } - if (pPlayer->atc.newWeapon) + if (pPlayer->input.newWeapon) { - if (pPlayer->atc.newWeapon == 6) + if (pPlayer->input.newWeapon == 6) { - if (pPlayer->atbd == 6) + if (pPlayer->curWeapon == 6) { if (sub_4B2C8(pPlayer, 10, 1)) - pPlayer->atc.newWeapon = 11; + pPlayer->input.newWeapon = 11; else if (sub_4B2C8(pPlayer, 11, 1)) - pPlayer->atc.newWeapon = 12; + pPlayer->input.newWeapon = 12; } - else if (pPlayer->atbd == 11) + else if (pPlayer->curWeapon == 11) { if (sub_4B2C8(pPlayer, 11, 1)) - pPlayer->atc.newWeapon = 12; - else if (sub_4B2C8(pPlayer, 5, 1) && pPlayer->at87 == 0) - pPlayer->atc.newWeapon = 6; + pPlayer->input.newWeapon = 12; + else if (sub_4B2C8(pPlayer, 5, 1) && pPlayer->isUnderwater == 0) + pPlayer->input.newWeapon = 6; } - else if (pPlayer->atbd == 12) + else if (pPlayer->curWeapon == 12) { - if (sub_4B2C8(pPlayer, 5, 1) && pPlayer->at87 == 0) - pPlayer->atc.newWeapon = 6; + if (sub_4B2C8(pPlayer, 5, 1) && pPlayer->isUnderwater == 0) + pPlayer->input.newWeapon = 6; else if (sub_4B2C8(pPlayer, 10, 1)) - pPlayer->atc.newWeapon = 11; + pPlayer->input.newWeapon = 11; } else { - if (sub_4B2C8(pPlayer, 5, 1) && pPlayer->at87 == 0) - pPlayer->atc.newWeapon = 6; + if (sub_4B2C8(pPlayer, 5, 1) && pPlayer->isUnderwater == 0) + pPlayer->input.newWeapon = 6; else if (sub_4B2C8(pPlayer, 10, 1)) - pPlayer->atc.newWeapon = 11; + pPlayer->input.newWeapon = 11; else if (sub_4B2C8(pPlayer, 11, 1)) - pPlayer->atc.newWeapon = 12; + pPlayer->input.newWeapon = 12; } } - if (pPlayer->pXSprite->health == 0 || pPlayer->atcb[pPlayer->atc.newWeapon] == 0) + if (pPlayer->pXSprite->health == 0 || pPlayer->hasWeapon[pPlayer->input.newWeapon] == 0) { - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; return; } - if (pPlayer->at87 && BannedUnderwater(pPlayer->atc.newWeapon) && !sub_4B1A4(pPlayer)) + if (pPlayer->isUnderwater && BannedUnderwater(pPlayer->input.newWeapon) && !sub_4B1A4(pPlayer)) { - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; return; } - int nWeapon = pPlayer->atc.newWeapon; + int nWeapon = pPlayer->input.newWeapon; int v4c = weaponModes[nWeapon].at0; - if (!pPlayer->atbd) + if (!pPlayer->curWeapon) { int nAmmoType = weaponModes[nWeapon].at4; if (v4c > 1) { if (CheckAmmo(pPlayer, nAmmoType, 1) || nAmmoType == 11) WeaponRaise(pPlayer); - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; } else { @@ -2121,111 +2121,111 @@ void WeaponProcess(PLAYER *pPlayer) WeaponRaise(pPlayer); else { - pPlayer->atc3 = 0; + pPlayer->weaponState = 0; int t; char weapon = WeaponFindLoaded(pPlayer, &t); - pPlayer->atd9[weapon] = t; - if (pPlayer->atbd) + pPlayer->weaponMode[weapon] = t; + if (pPlayer->curWeapon) { WeaponLower(pPlayer); - pPlayer->atbe = weapon; + pPlayer->nextWeapon = weapon; return; } - pPlayer->atc.newWeapon = weapon; + pPlayer->input.newWeapon = weapon; } } return; } - if (nWeapon == pPlayer->atbd && v4c <= 1) + if (nWeapon == pPlayer->curWeapon && v4c <= 1) { - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; return; } int i = 0; - if (nWeapon == pPlayer->atbd) + if (nWeapon == pPlayer->curWeapon) i = 1; for (; i <= v4c; i++) { - int v6c = (pPlayer->atd9[nWeapon]+i)%v4c; + int v6c = (pPlayer->weaponMode[nWeapon]+i)%v4c; if (sub_4B1FC(pPlayer, nWeapon, weaponModes[nWeapon].at4, 1)) { WeaponLower(pPlayer); - pPlayer->atd9[nWeapon] = v6c; + pPlayer->weaponMode[nWeapon] = v6c; return; } } - pPlayer->atc.newWeapon = 0; + pPlayer->input.newWeapon = 0; return; } - if (pPlayer->atbd && !CheckAmmo(pPlayer, pPlayer->atc7, 1) && pPlayer->atc7 != 11) + if (pPlayer->curWeapon && !CheckAmmo(pPlayer, pPlayer->weaponAmmo, 1) && pPlayer->weaponAmmo != 11) { - pPlayer->atc3 = -1; + pPlayer->weaponState = -1; return; } if (bShoot) { - switch (pPlayer->atbd) + switch (pPlayer->curWeapon) { case 1: StartQAV(pPlayer, 2, nClientFirePitchfork, 0); return; case 7: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 3: - pPlayer->atc3 = 4; + pPlayer->weaponState = 4; StartQAV(pPlayer, 10, nClientFireSpray, 1); return; } break; case 6: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 3: - pPlayer->atc3 = 6; - pPlayer->at1b2 = -1; - pPlayer->at1b6 = (int)gFrameClock; + pPlayer->weaponState = 6; + pPlayer->fuseTime = -1; + pPlayer->throwTime = (int)gFrameClock; StartQAV(pPlayer, 21, nClientExplodeBundle, 0); return; } break; case 11: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 7: - pPlayer->at26 = 27; - pPlayer->atc3 = 9; - pPlayer->at1b6 = (int)gFrameClock; + pPlayer->weaponQav = 27; + pPlayer->weaponState = 9; + pPlayer->throwTime = (int)gFrameClock; return; } break; case 12: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 10: - pPlayer->at26 = 36; - pPlayer->atc3 = 13; - pPlayer->at1b6 = (int)gFrameClock; + pPlayer->weaponQav = 36; + pPlayer->weaponState = 13; + pPlayer->throwTime = (int)gFrameClock; return; case 11: - pPlayer->atc3 = 12; + pPlayer->weaponState = 12; StartQAV(pPlayer, 40, nClientFireRemote, 0); return; } break; case 3: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 7: - pPlayer->atc3 = 6; + pPlayer->weaponState = 6; StartQAV(pPlayer, 61, nClientFireShotgun, 0); return; case 3: - pPlayer->atc3 = 2; + pPlayer->weaponState = 2; StartQAV(pPlayer, 54, nClientFireShotgun, 0); return; case 2: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 55, nClientFireShotgun, 0); return; } @@ -2250,17 +2250,17 @@ void WeaponProcess(PLAYER *pPlayer) for (i = 0; nChance[i] < nRand; i++) { } - pPlayer->voodooTarget = pPlayer->at1d6; + pPlayer->voodooTarget = pPlayer->aimTarget; if (pPlayer->voodooTarget == -1 || sprite[pPlayer->voodooTarget].statnum != kStatDude) i = 4; StartQAV(pPlayer,103+i, nClientFireVoodoo, 0); return; } case 8: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 2: - pPlayer->atc3 = 4; + pPlayer->weaponState = 4; if (sub_4B2C8(pPlayer, 7, 10) && powerupCheck(pPlayer, kPwUpTwoGuns)) StartQAV(pPlayer, 84, nClientFireTesla, 0); else @@ -2291,82 +2291,82 @@ void WeaponProcess(PLAYER *pPlayer) } if (bShoot2) { - switch (pPlayer->atbd) + switch (pPlayer->curWeapon) { case 1: StartQAV(pPlayer, 2, nClientFirePitchfork, 0); return; case 7: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 3: - pPlayer->atc3 = 5; + pPlayer->weaponState = 5; StartQAV(pPlayer, 12, nClientExplodeCan, 0); return; } break; case 6: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 3: - pPlayer->atc3 = 4; + pPlayer->weaponState = 4; StartQAV(pPlayer, 21, nClientExplodeBundle, 0); return; case 7: - pPlayer->atc3 = 8; + pPlayer->weaponState = 8; StartQAV(pPlayer, 28, nClientDropProx, 0); return; case 10: - pPlayer->atc3 = 11; + pPlayer->weaponState = 11; StartQAV(pPlayer, 38, nClientDropRemote, 0); return; case 11: - if (pPlayer->at181[11] > 0) + if (pPlayer->ammCount[11] > 0) { - pPlayer->atc3 = 10; + pPlayer->weaponState = 10; StartQAV(pPlayer, 30, -1, 0); } return; } break; case 11: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 7: - pPlayer->atc3 = 8; + pPlayer->weaponState = 8; StartQAV(pPlayer, 28, nClientDropProx, 0); return; } break; case 12: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 10: - pPlayer->atc3 = 11; + pPlayer->weaponState = 11; StartQAV(pPlayer, 38, nClientDropRemote, 0); return; case 11: - if (pPlayer->at181[11] > 0) + if (pPlayer->ammCount[11] > 0) { - pPlayer->atc3 = 10; + pPlayer->weaponState = 10; StartQAV(pPlayer, 30, -1, 0); } return; } break; case 3: - switch (pPlayer->atc3) + switch (pPlayer->weaponState) { case 7: - pPlayer->atc3 = 6; + pPlayer->weaponState = 6; StartQAV(pPlayer, 62, nClientFireShotgun, 0); return; case 3: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 56, nClientFireShotgun, 0); return; case 2: - pPlayer->atc3 = 1; + pPlayer->weaponState = 1; StartQAV(pPlayer, 55, nClientFireShotgun, 0); return; } @@ -2439,7 +2439,7 @@ void WeaponProcess(PLAYER *pPlayer) { StartQAV(pPlayer, 119, -1, 0); AltFireLifeLeech(1, pPlayer); - pPlayer->atc3 = -1; + pPlayer->weaponState = -1; } return; }