Refactor:

- PLAYER.H structs
- ACTOR.H  structs

# Conflicts:
#	source/blood/src/db.h
#	source/blood/src/player.h
This commit is contained in:
Grind Core 2019-10-21 22:46:41 +03:00 committed by Christoph Oelckers
parent a829f1cb52
commit b6c16abf6f
30 changed files with 1466 additions and 1453 deletions

View file

@ -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<<shift);
actDamageSprite(nShooter, pSprite, pVectorData->dmgType, pVectorData->dmg<<shift);
int nXSprite = pSprite->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;

View file

@ -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.
};

View file

@ -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;
}

View file

@ -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)

View file

@ -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);
}
}

View file

@ -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)

View file

@ -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)

View file

@ -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);

View file

@ -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)

View file

@ -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;
}

View file

@ -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);
}
}

View file

@ -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:

View file

@ -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)

View file

@ -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; }

View file

@ -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)

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -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

View file

@ -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);
}
}

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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;
}
}

View file

@ -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;
}
}
}

View file

@ -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])

File diff suppressed because it is too large Load diff