mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- global search & replace of ->s-> with ->spr.
This is the largest part of uses of DDukeActor's 's' pointer.
This commit is contained in:
parent
0284ec1cb0
commit
55cb5aaac6
29 changed files with 1208 additions and 1208 deletions
|
@ -137,7 +137,7 @@ void se40code(int x, int y, int z, binangle a, fixedhoriz h, int smoothratio)
|
|||
DukeStatIterator it(STAT_RAROR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
switch (act->s->lotag - tag + 40)
|
||||
switch (act->spr.lotag - tag + 40)
|
||||
{
|
||||
//case 40:
|
||||
//case 41:
|
||||
|
@ -147,7 +147,7 @@ void se40code(int x, int y, int z, binangle a, fixedhoriz h, int smoothratio)
|
|||
case 43:
|
||||
case 44:
|
||||
case 45:
|
||||
if (ps[screenpeek].cursector == act->s->sector())
|
||||
if (ps[screenpeek].cursector == act->spr.sector())
|
||||
SE40_Draw(tag, act->s, x, y, z, a, h, smoothratio);
|
||||
break;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
ChangeActorSect(act, geosectorwarp[gs]);
|
||||
SetActor(act, { act->s->x -= geox[gs], act->s->y -= geoy[gs], act->s->z });
|
||||
SetActor(act, { act->spr.x -= geox[gs], act->spr.y -= geoy[gs], act->spr.z });
|
||||
}
|
||||
if (geosector[gs] == sectp)
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
ChangeActorSect(act, geosector[gs]);
|
||||
SetActor(act, { act->s->x += geox[gs], act->s->y += geoy[gs], act->s->z });
|
||||
SetActor(act, { act->spr.x += geox[gs], act->spr.y += geoy[gs], act->spr.z });
|
||||
}
|
||||
}
|
||||
fi.animatesprites(pm_tsprite, pm_spritesortcnt, cposx, cposy, cang.asbuild(), smoothratio);
|
||||
|
@ -249,7 +249,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
ChangeActorSect(act, geosectorwarp2[gs]);
|
||||
SetActor(act, { act->s->x -= geox2[gs], act->s->y -= geoy2[gs], act->s->z });
|
||||
SetActor(act, { act->spr.x -= geox2[gs], act->spr.y -= geoy2[gs], act->spr.z });
|
||||
}
|
||||
if (geosector[gs] == sectp)
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ static void geometryEffect(int cposx, int cposy, int cposz, binangle cang, fixed
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
ChangeActorSect(act, geosector[gs]);
|
||||
SetActor(act, { act->s->x += geox2[gs], act->s->y += geoy2[gs], act->s->z });
|
||||
SetActor(act, { act->spr.x += geox2[gs], act->spr.y += geoy2[gs], act->spr.z });
|
||||
}
|
||||
}
|
||||
fi.animatesprites(pm_tsprite, pm_spritesortcnt, cposx, cposy, cang.asbuild(), smoothratio);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -91,7 +91,7 @@ bool floorspace_d(sectortype* sectp)
|
|||
|
||||
void check_fta_sounds_d(DDukeActor* actor)
|
||||
{
|
||||
if (actor->s->extra > 0) switch (actor->s->picnum)
|
||||
if (actor->spr.extra > 0) switch (actor->spr.picnum)
|
||||
{
|
||||
case LIZTROOPONTOILET:
|
||||
case LIZTROOPJUSTSIT:
|
||||
|
@ -133,18 +133,18 @@ void check_fta_sounds_d(DDukeActor* actor)
|
|||
S_PlaySound(BOS1_RECOG);
|
||||
break;
|
||||
case BOSS2:
|
||||
if (actor->s->pal == 1)
|
||||
if (actor->spr.pal == 1)
|
||||
S_PlaySound(BOS2_RECOG);
|
||||
else S_PlaySound(WHIPYOURASS);
|
||||
break;
|
||||
case BOSS3:
|
||||
if (actor->s->pal == 1)
|
||||
if (actor->spr.pal == 1)
|
||||
S_PlaySound(BOS3_RECOG);
|
||||
else S_PlaySound(RIPHEADNECK);
|
||||
break;
|
||||
case BOSS4:
|
||||
case BOSS4STAYPUT:
|
||||
if (actor->s->pal == 1)
|
||||
if (actor->spr.pal == 1)
|
||||
S_PlaySound(BOS4_RECOG);
|
||||
S_PlaySound(BOSS4_FIRSTSEE);
|
||||
break;
|
||||
|
@ -315,12 +315,12 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
auto spri2 = act2->s;
|
||||
if (isWorldTour() && Owner)
|
||||
{
|
||||
if (Owner->s->picnum == APLAYER && spri2->picnum == APLAYER && ud.coop != 0 && ud.ffire == 0 && Owner != act2)
|
||||
if (Owner->spr.picnum == APLAYER && spri2->picnum == APLAYER && ud.coop != 0 && ud.ffire == 0 && Owner != act2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spri->picnum == FLAMETHROWERFLAME && ((Owner->s->picnum == FIREFLY && spri2->picnum == FIREFLY) || (Owner->s->picnum == BOSS5 && spri2->picnum == BOSS5)))
|
||||
if (spri->picnum == FLAMETHROWERFLAME && ((Owner->spr.picnum == FIREFLY && spri2->picnum == FIREFLY) || (Owner->spr.picnum == BOSS5 && spri2->picnum == BOSS5)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
{
|
||||
if (spri->picnum == SHRINKSPARK || spri->picnum == FLAMETHROWERFLAME)
|
||||
act2->picnum = spri->picnum;
|
||||
else if (spri->picnum != FIREBALL || !Owner || Owner->s->picnum != APLAYER)
|
||||
else if (spri->picnum != FIREBALL || !Owner || Owner->spr.picnum != APLAYER)
|
||||
{
|
||||
if (spri->picnum == LAVAPOOL)
|
||||
act2->picnum = FLAMETHROWERFLAME;
|
||||
|
@ -413,13 +413,13 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
}
|
||||
else if (spri->extra == 0) act2->extra = 0;
|
||||
|
||||
if (spri2->picnum != RADIUSEXPLOSION && Owner && Owner->s->statnum < MAXSTATUS)
|
||||
if (spri2->picnum != RADIUSEXPLOSION && Owner && Owner->spr.statnum < MAXSTATUS)
|
||||
{
|
||||
if (spri2->picnum == APLAYER)
|
||||
{
|
||||
int p = spri2->yvel;
|
||||
|
||||
if (isWorldTour() && act2->picnum == FLAMETHROWERFLAME && Owner->s->picnum == APLAYER)
|
||||
if (isWorldTour() && act2->picnum == FLAMETHROWERFLAME && Owner->spr.picnum == APLAYER)
|
||||
{
|
||||
ps[p].numloogs = -1 - spri->yvel;
|
||||
}
|
||||
|
@ -588,13 +588,13 @@ void guts_d(DDukeActor* actor, int gtype, int n, int p)
|
|||
auto spawned = EGS(s->sector(), s->x + (r5 & 255) - 128, s->y + (r4 & 255) - 128, gutz - (r3 & 8191), gtype, -32, sx, sy, a, 48 + (r2 & 31), -512 - (r1 & 2047), ps[p].GetActor(), 5);
|
||||
if (spawned)
|
||||
{
|
||||
if (spawned->s->picnum == JIBS2)
|
||||
if (spawned->spr.picnum == JIBS2)
|
||||
{
|
||||
spawned->s->xrepeat >>= 2;
|
||||
spawned->s->yrepeat >>= 2;
|
||||
spawned->spr.xrepeat >>= 2;
|
||||
spawned->spr.yrepeat >>= 2;
|
||||
}
|
||||
if (pal != 0)
|
||||
spawned->s->pal = pal;
|
||||
spawned->spr.pal = pal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ void movefta_d(void)
|
|||
ssect = psect = s->sector();
|
||||
|
||||
auto pa = ps[p].GetActor();
|
||||
if (pa->s->extra > 0)
|
||||
if (pa->spr.extra > 0)
|
||||
{
|
||||
if (x < 30000)
|
||||
{
|
||||
|
@ -712,7 +712,7 @@ DDukeActor* ifhitsectors_d(sectortype* sect)
|
|||
DukeStatIterator it(STAT_MISC);
|
||||
while (auto a1 = it.Next())
|
||||
{
|
||||
if (a1->s->picnum == EXPLOSION2 && sect == a1->s->sector())
|
||||
if (a1->spr.picnum == EXPLOSION2 && sect == a1->spr.sector())
|
||||
return a1;
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -741,7 +741,7 @@ int ifhitbyweapon_d(DDukeActor *actor)
|
|||
p = spri->yvel;
|
||||
|
||||
if (hitowner &&
|
||||
hitowner->s->picnum == APLAYER &&
|
||||
hitowner->spr.picnum == APLAYER &&
|
||||
ud.coop == 1 &&
|
||||
ud.ffire == 0)
|
||||
return -1;
|
||||
|
@ -756,7 +756,7 @@ int ifhitbyweapon_d(DDukeActor *actor)
|
|||
|
||||
ps[p].wackedbyactor = hitowner;
|
||||
|
||||
if (hitowner->s->picnum == APLAYER && p != hitowner->PlayerIndex())
|
||||
if (hitowner->spr.picnum == APLAYER && p != hitowner->PlayerIndex())
|
||||
{
|
||||
ps[p].frag_ps = hitowner->PlayerIndex();
|
||||
}
|
||||
|
@ -796,7 +796,7 @@ int ifhitbyweapon_d(DDukeActor *actor)
|
|||
|
||||
spri->extra -= actor->extra;
|
||||
auto Owner = actor->GetOwner();
|
||||
if (spri->picnum != RECON && Owner && Owner->s->statnum < MAXSTATUS)
|
||||
if (spri->picnum != RECON && Owner && Owner->spr.statnum < MAXSTATUS)
|
||||
actor->SetOwner(hitowner);
|
||||
}
|
||||
|
||||
|
@ -823,7 +823,7 @@ int ifhitbyweapon_d(DDukeActor *actor)
|
|||
spri->extra = 0;
|
||||
ps[p].wackedbyactor = hitowner;
|
||||
|
||||
if (hitowner->s->picnum == APLAYER && hitowner != ps[p].GetActor())
|
||||
if (hitowner->spr.picnum == APLAYER && hitowner != ps[p].GetActor())
|
||||
ps[p].frag_ps = hitowner->PlayerIndex(); // set the proper player index here - this previously set the sprite index...
|
||||
|
||||
actor->SetHitOwner(ps[p].GetActor());
|
||||
|
@ -866,12 +866,12 @@ void movefallers_d(void)
|
|||
DukeStatIterator itj(STAT_FALLER);
|
||||
while (auto a2 = itj.Next())
|
||||
{
|
||||
if (a2->s->hitag == s->hitag)
|
||||
if (a2->spr.hitag == s->hitag)
|
||||
{
|
||||
a2->temp_data[0] = 1;
|
||||
a2->s->cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (a2->s->picnum == CEILINGSTEAM || a2->s->picnum == STEAM)
|
||||
a2->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
a2->spr.cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (a2->spr.picnum == CEILINGSTEAM || a2->spr.picnum == STEAM)
|
||||
a2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -975,16 +975,16 @@ static void movetripbomb(DDukeActor *actor)
|
|||
auto spawned = spawn(actor, EXPLOSION2);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->ang = s->ang;
|
||||
spawned->s->xvel = 348;
|
||||
spawned->spr.ang = s->ang;
|
||||
spawned->spr.xvel = 348;
|
||||
ssp(spawned, CLIPMASK0);
|
||||
}
|
||||
|
||||
DukeStatIterator it(STAT_MISC);
|
||||
while (auto a1 = it.Next())
|
||||
{
|
||||
if (a1->s->picnum == LASERLINE && s->hitag == a1->s->hitag)
|
||||
a1->s->xrepeat = a1->s->yrepeat = 0;
|
||||
if (a1->spr.picnum == LASERLINE && s->hitag == a1->spr.hitag)
|
||||
a1->spr.xrepeat = a1->spr.yrepeat = 0;
|
||||
}
|
||||
deletesprite(actor);
|
||||
}
|
||||
|
@ -1042,13 +1042,13 @@ static void movetripbomb(DDukeActor *actor)
|
|||
auto spawned = spawn(actor, LASERLINE);
|
||||
if (spawned)
|
||||
{
|
||||
SetActor(spawned, spawned->s->pos);
|
||||
spawned->s->hitag = s->hitag;
|
||||
spawned->temp_data[1] = spawned->s->z;
|
||||
SetActor(spawned, spawned->spr.pos);
|
||||
spawned->spr.hitag = s->hitag;
|
||||
spawned->temp_data[1] = spawned->spr.z;
|
||||
|
||||
if (x < 1024)
|
||||
{
|
||||
spawned->s->xrepeat = x >> 5;
|
||||
spawned->spr.xrepeat = x >> 5;
|
||||
break;
|
||||
}
|
||||
x -= 1024;
|
||||
|
@ -1125,9 +1125,9 @@ static void movecrack(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto a1 = it.Next())
|
||||
{
|
||||
if (s->hitag == a1->s->hitag && (a1->s->picnum == OOZFILTER || a1->s->picnum == SEENINE))
|
||||
if (a1->s->shade != -32)
|
||||
a1->s->shade = -32;
|
||||
if (s->hitag == a1->spr.hitag && (a1->spr.picnum == OOZFILTER || a1->spr.picnum == SEENINE))
|
||||
if (a1->spr.shade != -32)
|
||||
a1->spr.shade = -32;
|
||||
}
|
||||
detonate(actor, EXPLOSION2);
|
||||
}
|
||||
|
@ -1153,25 +1153,25 @@ static void movefireext(DDukeActor* actor)
|
|||
|
||||
for (int k = 0; k < 16; k++)
|
||||
{
|
||||
auto spawned = EGS(actor->s->sector(), actor->s->x, actor->s->y, actor->s->z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->s->zvel >> 2), actor, 5);
|
||||
if(spawned) spawned->s->pal = 2;
|
||||
auto spawned = EGS(actor->spr.sector(), actor->spr.x, actor->spr.y, actor->spr.z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (actor->spr.zvel >> 2), actor, 5);
|
||||
if(spawned) spawned->spr.pal = 2;
|
||||
}
|
||||
|
||||
spawn(actor, EXPLOSION2);
|
||||
S_PlayActorSound(PIPEBOMB_EXPLODE, actor);
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, actor);
|
||||
|
||||
if (actor->s->hitag > 0)
|
||||
if (actor->spr.hitag > 0)
|
||||
{
|
||||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto a1 = it.Next())
|
||||
{
|
||||
if (actor->s->hitag == a1->s->hitag && (a1->s->picnum == OOZFILTER || a1->s->picnum == SEENINE))
|
||||
if (a1->s->shade != -32)
|
||||
a1->s->shade = -32;
|
||||
if (actor->spr.hitag == a1->spr.hitag && (a1->spr.picnum == OOZFILTER || a1->spr.picnum == SEENINE))
|
||||
if (a1->spr.shade != -32)
|
||||
a1->spr.shade = -32;
|
||||
}
|
||||
|
||||
int x = actor->s->extra;
|
||||
int x = actor->spr.extra;
|
||||
spawn(actor, EXPLOSION2);
|
||||
fi.hitradius(actor, gs.pipebombblastradius, x >> 2, x - (x >> 1), x - (x >> 2), x);
|
||||
S_PlayActorSound(PIPEBOMB_EXPLODE, actor);
|
||||
|
@ -1193,7 +1193,7 @@ static void movefireext(DDukeActor* actor)
|
|||
static void moveviewscreen(DDukeActor* actor)
|
||||
{
|
||||
const int VIEWSCR_DIST = 8192; // was originally 2048, was increased to this by EDuke32 and RedNukem.
|
||||
if (actor->s->xrepeat == 0) deletesprite(actor);
|
||||
if (actor->spr.xrepeat == 0) deletesprite(actor);
|
||||
else
|
||||
{
|
||||
int x;
|
||||
|
@ -1203,7 +1203,7 @@ static void moveviewscreen(DDukeActor* actor)
|
|||
if (x >= VIEWSCR_DIST && camsprite == actor)
|
||||
{
|
||||
camsprite = nullptr;
|
||||
actor->s->yvel = 0;
|
||||
actor->spr.yvel = 0;
|
||||
actor->temp_data[0] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1327,7 +1327,7 @@ void movestandables_d(void)
|
|||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
int picnum = act->s->picnum;
|
||||
int picnum = act->spr.picnum;
|
||||
|
||||
if (!act->insector())
|
||||
{
|
||||
|
@ -1456,7 +1456,7 @@ static bool movefireball(DDukeActor* actor)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!Owner || Owner->s->picnum != FIREBALL)
|
||||
if (!Owner || Owner->spr.picnum != FIREBALL)
|
||||
{
|
||||
if (actor->temp_data[0] >= 1 && actor->temp_data[0] < 6)
|
||||
{
|
||||
|
@ -1509,15 +1509,15 @@ static bool movefireball(DDukeActor* actor)
|
|||
static bool weaponhitsprite(DDukeActor* proj, DDukeActor *targ, bool fireball)
|
||||
{
|
||||
auto s = proj->s;
|
||||
if (s->picnum == FREEZEBLAST && targ->s->pal == 1)
|
||||
if (badguy(targ) || targ->s->picnum == APLAYER)
|
||||
if (s->picnum == FREEZEBLAST && targ->spr.pal == 1)
|
||||
if (badguy(targ) || targ->spr.picnum == APLAYER)
|
||||
{
|
||||
auto spawned = spawn(targ, TRANSPORTERSTAR);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->pal = 1;
|
||||
spawned->s->xrepeat = 32;
|
||||
spawned->s->yrepeat = 32;
|
||||
spawned->spr.pal = 1;
|
||||
spawned->spr.xrepeat = 32;
|
||||
spawned->spr.yrepeat = 32;
|
||||
}
|
||||
|
||||
deletesprite(proj);
|
||||
|
@ -1527,12 +1527,12 @@ static bool weaponhitsprite(DDukeActor* proj, DDukeActor *targ, bool fireball)
|
|||
if (!isWorldTour() || s->picnum != FIREBALL || fireball)
|
||||
fi.checkhitsprite(targ, proj);
|
||||
|
||||
if (targ->s->picnum == APLAYER)
|
||||
if (targ->spr.picnum == APLAYER)
|
||||
{
|
||||
int p = targ->s->yvel;
|
||||
int p = targ->spr.yvel;
|
||||
auto Owner = proj->GetOwner();
|
||||
|
||||
if (ud.multimode >= 2 && fireball && Owner && Owner->s->picnum == APLAYER)
|
||||
if (ud.multimode >= 2 && fireball && Owner && Owner->spr.picnum == APLAYER)
|
||||
{
|
||||
ps[p].numloogs = -1 - s->yvel;
|
||||
}
|
||||
|
@ -1632,7 +1632,7 @@ static bool weaponhitsector(DDukeActor* proj, const vec3_t& oldpos, bool firebal
|
|||
{
|
||||
spawned->SetOwner(proj);
|
||||
spawned->SetHitOwner(proj);
|
||||
spawned->s->yvel = s->yvel;
|
||||
spawned->spr.yvel = s->yvel;
|
||||
}
|
||||
deletesprite(proj);
|
||||
return true;
|
||||
|
@ -1688,7 +1688,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
if (proj->picnum != BOSS2 && s->xrepeat >= 10 && s->sector()->lotag != 2)
|
||||
{
|
||||
auto spawned = spawn(proj, SMALLSMOKE);
|
||||
if (spawned) spawned->s->z += (1 << 8);
|
||||
if (spawned) spawned->spr.z += (1 << 8);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1703,7 +1703,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
MulScale(k, bsin(s->ang), 14), ll, CLIPMASK1, coll);
|
||||
|
||||
if (s->picnum == RPG && proj->temp_actor != nullptr)
|
||||
if (FindDistance2D(s->x - proj->temp_actor->s->x, s->y - proj->temp_actor->s->y) < 256)
|
||||
if (FindDistance2D(s->x - proj->temp_actor->spr.x, s->y - proj->temp_actor->spr.y) < 256)
|
||||
coll.setSprite(proj->temp_actor);
|
||||
|
||||
if (!s->insector())
|
||||
|
@ -1740,8 +1740,8 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
s->xrepeat, s->yrepeat, 0, 0, 0, proj->GetOwner(), 5);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->s->pal = s->pal;
|
||||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.pal = s->pal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1752,7 +1752,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
{
|
||||
if (s->picnum == COOLEXPLOSION1)
|
||||
{
|
||||
if (coll.type == kHitSprite && coll.actor()->s->picnum != APLAYER)
|
||||
if (coll.type == kHitSprite && coll.actor()->spr.picnum != APLAYER)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1760,7 +1760,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
s->zvel = 0;
|
||||
}
|
||||
|
||||
bool fireball = (isWorldTour() && s->picnum == FIREBALL && (!proj->GetOwner() || proj->GetOwner()->s->picnum != FIREBALL));
|
||||
bool fireball = (isWorldTour() && s->picnum == FIREBALL && (!proj->GetOwner() || proj->GetOwner()->spr.picnum != FIREBALL));
|
||||
|
||||
if (coll.type == kHitSprite)
|
||||
{
|
||||
|
@ -1793,12 +1793,12 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
auto k = spawn(proj, EXPLOSION2);
|
||||
if (k)
|
||||
{
|
||||
k->s->xrepeat = k->s->yrepeat = s->xrepeat >> 1;
|
||||
k->spr.xrepeat = k->spr.yrepeat = s->xrepeat >> 1;
|
||||
if (coll.type == kHitSector)
|
||||
{
|
||||
if (s->zvel < 0)
|
||||
{
|
||||
k->s->cstat |= CSTAT_SPRITE_YFLIP; k->s->z += (72 << 8);
|
||||
k->spr.cstat |= CSTAT_SPRITE_YFLIP; k->spr.z += (72 << 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1806,7 +1806,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
if (fireball)
|
||||
{
|
||||
auto spawned = spawn(proj, EXPLOSION2);
|
||||
if (spawned) spawned->s->xrepeat = spawned->s->yrepeat = (short)(s->xrepeat >> 1);
|
||||
if (spawned) spawned->spr.xrepeat = spawned->spr.yrepeat = (short)(s->xrepeat >> 1);
|
||||
}
|
||||
}
|
||||
if (s->picnum != COOLEXPLOSION1)
|
||||
|
@ -1846,7 +1846,7 @@ void moveweapons_d(void)
|
|||
}
|
||||
|
||||
|
||||
switch(act->s->picnum)
|
||||
switch(act->spr.picnum)
|
||||
{
|
||||
case RADIUSEXPLOSION:
|
||||
case KNEE:
|
||||
|
@ -1857,14 +1857,14 @@ void moveweapons_d(void)
|
|||
continue;
|
||||
|
||||
case FREEZEBLAST:
|
||||
if (act->s->yvel < 1 || act->s->extra < 2 || (act->s->xvel|act->s->zvel) == 0)
|
||||
if (act->spr.yvel < 1 || act->spr.extra < 2 || (act->spr.xvel|act->spr.zvel) == 0)
|
||||
{
|
||||
auto spawned = spawn(act,TRANSPORTERSTAR);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->pal = 1;
|
||||
spawned->s->xrepeat = 32;
|
||||
spawned->s->yrepeat = 32;
|
||||
spawned->spr.pal = 1;
|
||||
spawned->spr.xrepeat = 32;
|
||||
spawned->spr.yrepeat = 32;
|
||||
}
|
||||
deletesprite(act);
|
||||
continue;
|
||||
|
@ -1872,7 +1872,7 @@ void moveweapons_d(void)
|
|||
[[fallthrough]];
|
||||
case FIREBALL:
|
||||
// Twentieth Anniversary World Tour
|
||||
if (act->s->picnum == FIREBALL && !isWorldTour()) break;
|
||||
if (act->spr.picnum == FIREBALL && !isWorldTour()) break;
|
||||
[[fallthrough]];
|
||||
case SHRINKSPARK:
|
||||
case RPG:
|
||||
|
@ -1949,10 +1949,10 @@ void movetransports_d(void)
|
|||
if (ps[k].cursector == Owner->sector())
|
||||
{
|
||||
ps[k].frag_ps = p;
|
||||
ps[k].GetActor()->s->extra = 0;
|
||||
ps[k].GetActor()->spr.extra = 0;
|
||||
}
|
||||
|
||||
ps[p].angle.ang = buildang(Owner->s->ang);
|
||||
ps[p].angle.ang = buildang(Owner->spr.ang);
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
{
|
||||
|
@ -1961,9 +1961,9 @@ void movetransports_d(void)
|
|||
ps[p].transporter_hold = 13;
|
||||
}
|
||||
|
||||
ps[p].bobposx = ps[p].oposx = ps[p].pos.x = Owner->s->x;
|
||||
ps[p].bobposy = ps[p].oposy = ps[p].pos.y = Owner->s->y;
|
||||
ps[p].oposz = ps[p].pos.z = Owner->s->z - gs.playerheight;
|
||||
ps[p].bobposx = ps[p].oposx = ps[p].pos.x = Owner->spr.x;
|
||||
ps[p].bobposy = ps[p].oposy = ps[p].pos.y = Owner->spr.y;
|
||||
ps[p].oposz = ps[p].pos.z = Owner->spr.z - gs.playerheight;
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(spr2->sector());
|
||||
|
@ -1983,16 +1983,16 @@ void movetransports_d(void)
|
|||
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) ||
|
||||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
|
||||
{
|
||||
ps[p].oposx = ps[p].pos.x += Owner->s->x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->s->y - spr->y;
|
||||
ps[p].oposx = ps[p].pos.x += Owner->spr.x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->spr.y - spr->y;
|
||||
|
||||
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
|
||||
ps[p].pos.z = Owner->s->z - 6144;
|
||||
else ps[p].pos.z = Owner->s->z + 6144;
|
||||
ps[p].pos.z = Owner->spr.z - 6144;
|
||||
else ps[p].pos.z = Owner->spr.z + 6144;
|
||||
ps[p].oposz = ps[p].pos.z;
|
||||
|
||||
auto pa = ps[p].GetActor();
|
||||
pa->s->opos = ps[p].pos;
|
||||
pa->spr.opos = ps[p].pos;
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(Owner->sector());
|
||||
|
@ -2010,7 +2010,7 @@ void movetransports_d(void)
|
|||
{
|
||||
FX_StopAllSounds();
|
||||
}
|
||||
if (ps[p].GetActor()->s->extra > 0)
|
||||
if (ps[p].GetActor()->spr.extra > 0)
|
||||
S_PlayActorSound(DUKE_UNDERWATER, act2);
|
||||
ps[p].oposz = ps[p].pos.z =
|
||||
Owner->sector()->ceilingz + (7 << 8);
|
||||
|
@ -2039,8 +2039,8 @@ void movetransports_d(void)
|
|||
|
||||
if (k == 1)
|
||||
{
|
||||
ps[p].oposx = ps[p].pos.x += Owner->s->x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->s->y - spr->y;
|
||||
ps[p].oposx = ps[p].pos.x += Owner->spr.x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->spr.y - spr->y;
|
||||
|
||||
if (!Owner || Owner->GetOwner() != Owner)
|
||||
ps[p].transporter_hold = -2;
|
||||
|
@ -2056,7 +2056,7 @@ void movetransports_d(void)
|
|||
for (int l = 0; l < 9; l++)
|
||||
{
|
||||
auto q = spawn(ps[p].GetActor(), WATERBUBBLE);
|
||||
if (q) q->s->z += krand() & 16383;
|
||||
if (q) q->spr.z += krand() & 16383;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2140,8 +2140,8 @@ void movetransports_d(void)
|
|||
auto k = spawn(act2, WATERSPLASH2);
|
||||
if (k && sectlotag == 1 && spr2->statnum == 4)
|
||||
{
|
||||
k->s->xvel = spr2->xvel >> 1;
|
||||
k->s->ang = spr2->ang;
|
||||
k->spr.xvel = spr2->xvel >> 1;
|
||||
k->spr.ang = spr2->ang;
|
||||
ssp(k, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -2151,12 +2151,12 @@ void movetransports_d(void)
|
|||
case 0:
|
||||
if (onfloorz)
|
||||
{
|
||||
if (spr2->statnum == STAT_PROJECTILE || (checkcursectnums(spr->sector()) == -1 && checkcursectnums(Owner->s->sector()) == -1))
|
||||
if (spr2->statnum == STAT_PROJECTILE || (checkcursectnums(spr->sector()) == -1 && checkcursectnums(Owner->spr.sector()) == -1))
|
||||
{
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z -= spr->z - Owner->sector()->floorz;
|
||||
spr2->ang = Owner->s->ang;
|
||||
spr2->ang = Owner->spr.ang;
|
||||
|
||||
spr2->backupang();
|
||||
|
||||
|
@ -2180,9 +2180,9 @@ void movetransports_d(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->z = Owner->s->z + 4096;
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->spr.z + 4096;
|
||||
|
||||
spr2->backupz();
|
||||
|
||||
|
@ -2190,8 +2190,8 @@ void movetransports_d(void)
|
|||
}
|
||||
break;
|
||||
case 1:
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->sector()->ceilingz + ll;
|
||||
|
||||
spr2->backupz();
|
||||
|
@ -2200,8 +2200,8 @@ void movetransports_d(void)
|
|||
|
||||
break;
|
||||
case 2:
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->sector()->floorz - ll;
|
||||
|
||||
spr2->backupz();
|
||||
|
@ -2291,7 +2291,7 @@ static void greenslime(DDukeActor *actor)
|
|||
for (j = 16; j >= 0; j--)
|
||||
{
|
||||
auto k = EGS(s->sector(), s->x, s->y, s->z, GLASSPIECES + (j % 3), -32, 36, 36, krand() & 2047, 32 + (krand() & 63), 1024 - (krand() & 1023), actor, 5);
|
||||
k->s->pal = 1;
|
||||
k->spr.pal = 1;
|
||||
}
|
||||
ps[p].actors_killed++;
|
||||
S_PlayActorSound(GLASS_BREAKING, actor);
|
||||
|
@ -2313,7 +2313,7 @@ static void greenslime(DDukeActor *actor)
|
|||
|
||||
if (t[0] == -4) //On the player
|
||||
{
|
||||
if (ps[p].GetActor()->s->extra < 1)
|
||||
if (ps[p].GetActor()->spr.extra < 1)
|
||||
{
|
||||
t[0] = 0;
|
||||
return;
|
||||
|
@ -2323,13 +2323,13 @@ static void greenslime(DDukeActor *actor)
|
|||
|
||||
s->ang = ps[p].angle.ang.asbuild();
|
||||
|
||||
if ((PlayerInput(p, SB_FIRE) || (ps[p].quick_kick > 0)) && ps[p].GetActor()->s->extra > 0)
|
||||
if ((PlayerInput(p, SB_FIRE) || (ps[p].quick_kick > 0)) && ps[p].GetActor()->spr.extra > 0)
|
||||
if (ps[p].quick_kick > 0 || (ps[p].curr_weapon != HANDREMOTE_WEAPON && ps[p].curr_weapon != HANDBOMB_WEAPON && ps[p].curr_weapon != TRIPBOMB_WEAPON && ps[p].ammo_amount[ps[p].curr_weapon] >= 0))
|
||||
{
|
||||
for (x = 0; x < 8; x++)
|
||||
{
|
||||
auto j = EGS(s->sector(), s->x, s->y, s->z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (s->zvel >> 2), actor, 5);
|
||||
j->s->pal = 6;
|
||||
j->spr.pal = 6;
|
||||
}
|
||||
|
||||
S_PlayActorSound(SLIM_DYING, actor);
|
||||
|
@ -2337,7 +2337,7 @@ static void greenslime(DDukeActor *actor)
|
|||
if ((krand() & 255) < 32)
|
||||
{
|
||||
auto j = spawn(actor, BLOODPOOL);
|
||||
if (j) j->s->pal = 0;
|
||||
if (j) j->spr.pal = 0;
|
||||
}
|
||||
ps[p].actors_killed++;
|
||||
t[0] = -3;
|
||||
|
@ -2370,7 +2370,7 @@ static void greenslime(DDukeActor *actor)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto ac = it.Next())
|
||||
{
|
||||
if (ac->s->picnum == CAMERA1) ac->s->yvel = 0;
|
||||
if (ac->spr.picnum == CAMERA1) ac->spr.yvel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2383,7 +2383,7 @@ static void greenslime(DDukeActor *actor)
|
|||
if (t[3] == 5)
|
||||
{
|
||||
auto psp = ps[p].GetActor();
|
||||
psp->s->extra += -(5 + (krand() & 3));
|
||||
psp->spr.extra += -(5 + (krand() & 3));
|
||||
S_PlayActorSound(SLIM_ATTACK, actor);
|
||||
}
|
||||
|
||||
|
@ -2438,13 +2438,13 @@ static void greenslime(DDukeActor *actor)
|
|||
if ((krand() & 255) < 32)
|
||||
{
|
||||
auto j = spawn(actor, BLOODPOOL);
|
||||
if (j) j->s->pal = 0;
|
||||
if (j) j->spr.pal = 0;
|
||||
}
|
||||
|
||||
for (x = 0; x < 8; x++)
|
||||
{
|
||||
auto j = EGS(s->sector(), s->x, s->y, s->z - (8 << 8), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (s->zvel >> 2), actor, 5);
|
||||
if (j) j->s->pal = 6;
|
||||
if (j) j->spr.pal = 6;
|
||||
}
|
||||
t[0] = -3;
|
||||
deletesprite(actor);
|
||||
|
@ -2478,13 +2478,13 @@ static void greenslime(DDukeActor *actor)
|
|||
makeitfall(actor);
|
||||
if (s5)
|
||||
{
|
||||
s5->s->xvel = 0;
|
||||
s5->spr.xvel = 0;
|
||||
|
||||
int l = s5->s->ang;
|
||||
int l = s5->spr.ang;
|
||||
|
||||
s->z = s5->s->z;
|
||||
s->x = s5->s->x + bcos(l, -11);
|
||||
s->y = s5->s->y + bsin(l, -11);
|
||||
s->z = s5->spr.z;
|
||||
s->x = s5->spr.x + bcos(l, -11);
|
||||
s->y = s5->spr.y + bsin(l, -11);
|
||||
|
||||
s->picnum = GREENSLIME + 2 + (global_random & 1);
|
||||
|
||||
|
@ -2497,7 +2497,7 @@ static void greenslime(DDukeActor *actor)
|
|||
t[0] = -1;
|
||||
x = ldist(actor, s5);
|
||||
if (x < 768) {
|
||||
s5->s->xrepeat = 0;
|
||||
s5->spr.xrepeat = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2511,9 +2511,9 @@ static void greenslime(DDukeActor *actor)
|
|||
DukeSectIterator it(actor->sector());
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (gs.actorinfo[a2->s->picnum].flags & SFLAG_GREENSLIMEFOOD)
|
||||
if (gs.actorinfo[a2->spr.picnum].flags & SFLAG_GREENSLIMEFOOD)
|
||||
{
|
||||
if (ldist(actor, a2) < 768 && (abs(s->z - a2->s->z) < 8192)) //Gulp them
|
||||
if (ldist(actor, a2) < 768 && (abs(s->z - a2->spr.z) < 8192)) //Gulp them
|
||||
{
|
||||
actor->temp_actor = a2;
|
||||
t[0] = -2;
|
||||
|
@ -2640,7 +2640,7 @@ static void flamethrowerflame(DDukeActor *actor)
|
|||
t[0]++;
|
||||
if (sectp->lotag == 2)
|
||||
{
|
||||
spawn(actor, EXPLOSION2)->s->shade = 127;
|
||||
spawn(actor, EXPLOSION2)->spr.shade = 127;
|
||||
deletesprite(actor);
|
||||
return;
|
||||
}
|
||||
|
@ -2660,7 +2660,7 @@ static void flamethrowerflame(DDukeActor *actor)
|
|||
t[3] = krand() % 10;
|
||||
if (t[0] > 30)
|
||||
{
|
||||
spawn(actor, EXPLOSION2)->s->shade = 127;
|
||||
spawn(actor, EXPLOSION2)->spr.shade = 127;
|
||||
deletesprite(actor);
|
||||
return;
|
||||
}
|
||||
|
@ -2696,7 +2696,7 @@ static void flamethrowerflame(DDukeActor *actor)
|
|||
if (coll.type == kHitSprite)
|
||||
{
|
||||
fi.checkhitsprite(coll.actor(), actor);
|
||||
if (coll.actor()->s->picnum == APLAYER)
|
||||
if (coll.actor()->spr.picnum == APLAYER)
|
||||
S_PlayActorSound(PISTOL_BODYHIT, coll.actor());
|
||||
}
|
||||
else if (coll.type == kHitWall)
|
||||
|
@ -2814,7 +2814,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
goto DETONATEB;
|
||||
}
|
||||
|
||||
if ( Owner && Owner->s->picnum == APLAYER)
|
||||
if ( Owner && Owner->spr.picnum == APLAYER)
|
||||
l = Owner->PlayerIndex();
|
||||
else l = -1;
|
||||
|
||||
|
@ -2917,7 +2917,7 @@ DETONATEB:
|
|||
if (ps[p].gotweapon[HANDBOMB_WEAPON] == 0 || Owner == ps[p].GetActor())
|
||||
fi.addweapon(&ps[p], HANDBOMB_WEAPON);
|
||||
|
||||
if (!Owner || Owner->s->picnum != APLAYER)
|
||||
if (!Owner || Owner->spr.picnum != APLAYER)
|
||||
{
|
||||
SetPlayerPal(&ps[p], PalEntry(32, 0, 32, 0));
|
||||
}
|
||||
|
@ -2997,11 +2997,11 @@ void moveactors_d(void)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->lotag == s->lotag &&
|
||||
act2->s->picnum == s->picnum)
|
||||
if (act2->spr.lotag == s->lotag &&
|
||||
act2->spr.picnum == s->picnum)
|
||||
{
|
||||
if ((act2->s->hitag && !(act2->s->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) ||
|
||||
(!act2->s->hitag && (act2->s->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
|
||||
if ((act2->spr.hitag && !(act2->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) ||
|
||||
(!act2->spr.hitag && (act2->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR))
|
||||
)
|
||||
{
|
||||
k = 0;
|
||||
|
@ -3133,19 +3133,19 @@ static void fireflyflyingeffect(DDukeActor *actor)
|
|||
execute(actor, p, x);
|
||||
|
||||
auto Owner = actor->GetOwner();
|
||||
if (!Owner || Owner->s->picnum != FIREFLY)
|
||||
if (!Owner || Owner->spr.picnum != FIREFLY)
|
||||
{
|
||||
deletesprite(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Owner->s->xrepeat >= 24 || Owner->s->pal == 1)
|
||||
actor->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
if (Owner->spr.xrepeat >= 24 || Owner->spr.pal == 1)
|
||||
actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
else
|
||||
actor->s->cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
|
||||
double dx = Owner->s->x - ps[p].GetActor()->s->x;
|
||||
double dy = Owner->s->y - ps[p].GetActor()->s->y;
|
||||
double dx = Owner->spr.x - ps[p].GetActor()->spr.x;
|
||||
double dy = Owner->spr.y - ps[p].GetActor()->spr.y;
|
||||
double dist = sqrt(dx * dx + dy * dy);
|
||||
if (dist != 0.0)
|
||||
{
|
||||
|
@ -3153,11 +3153,11 @@ static void fireflyflyingeffect(DDukeActor *actor)
|
|||
dy /= dist;
|
||||
}
|
||||
|
||||
actor->s->x = (int) (Owner->s->x - (dx * -10.0));
|
||||
actor->s->y = (int) (Owner->s->y - (dy * -10.0));
|
||||
actor->s->z = Owner->s->z + 2048;
|
||||
actor->spr.x = (int) (Owner->spr.x - (dx * -10.0));
|
||||
actor->spr.y = (int) (Owner->spr.y - (dy * -10.0));
|
||||
actor->spr.z = Owner->spr.z + 2048;
|
||||
|
||||
if (Owner->s->extra <= 0)
|
||||
if (Owner->spr.extra <= 0)
|
||||
{
|
||||
deletesprite(actor);
|
||||
}
|
||||
|
@ -3253,7 +3253,7 @@ void moveexplosions_d(void) // STATNUM 5
|
|||
if (x < 512)
|
||||
{
|
||||
SetPlayerPal(&ps[p], PalEntry(32, 32, 0, 0));
|
||||
ps[p].GetActor()->s->extra -= 4;
|
||||
ps[p].GetActor()->spr.extra -= 4;
|
||||
}
|
||||
[[fallthrough]];
|
||||
|
||||
|
@ -3386,15 +3386,15 @@ void handle_se06_d(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if ((act2->s->lotag == 14) && (sh == act2->s->hitag) && (act2->temp_data[0] == t[0]))
|
||||
if ((act2->spr.lotag == 14) && (sh == act2->spr.hitag) && (act2->temp_data[0] == t[0]))
|
||||
{
|
||||
act2->s->xvel = s->xvel;
|
||||
act2->spr.xvel = s->xvel;
|
||||
//if( t[4] == 1 )
|
||||
{
|
||||
if (act2->temp_data[5] == 0)
|
||||
act2->temp_data[5] = dist(act2, actor);
|
||||
int x = Sgn(dist(act2, actor) - act2->temp_data[5]);
|
||||
if (act2->s->extra)
|
||||
if (act2->spr.extra)
|
||||
x = -x;
|
||||
s->xvel += x;
|
||||
}
|
||||
|
@ -3450,8 +3450,8 @@ static void handle_se28(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_DEFAULT);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->picnum == NATURALLIGHTNING && act2->s->hitag == s->hitag)
|
||||
act2->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
if (act2->spr.picnum == NATURALLIGHTNING && act2->spr.hitag == s->hitag)
|
||||
act2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
}
|
||||
else if (t[2] > (t[1] >> 3) && t[2] < (t[1] >> 2))
|
||||
|
@ -3467,11 +3467,11 @@ static void handle_se28(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_DEFAULT);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->picnum == NATURALLIGHTNING && act2->s->hitag == s->hitag)
|
||||
if (act2->spr.picnum == NATURALLIGHTNING && act2->spr.hitag == s->hitag)
|
||||
{
|
||||
if (rnd(32) && (t[2] & 1))
|
||||
{
|
||||
act2->s->cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
spawn(act2, SMALLSMOKE);
|
||||
|
||||
int x;
|
||||
|
@ -3483,12 +3483,12 @@ static void handle_se28(DDukeActor* actor)
|
|||
if (S_CheckActorSoundPlaying(psa, DUKE_LONGTERM_PAIN) < 1)
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, psa);
|
||||
S_PlayActorSound(SHORT_CIRCUIT, psa);
|
||||
psa->s->extra -= 8 + (krand() & 7);
|
||||
psa->spr.extra -= 8 + (krand() & 7);
|
||||
SetPlayerPal(&ps[p], PalEntry(32, 16, 0, 0));
|
||||
}
|
||||
return;
|
||||
}
|
||||
else act2->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
else act2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3511,7 +3511,7 @@ void moveeffectors_d(void) //STATNUM 3
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
auto sc = act->sector();
|
||||
switch (act->s->lotag)
|
||||
switch (act->spr.lotag)
|
||||
{
|
||||
case SE_0_ROTATING_SECTOR:
|
||||
handle_se00(act, LASERLINE);
|
||||
|
@ -3636,9 +3636,9 @@ void moveeffectors_d(void) //STATNUM 3
|
|||
break;
|
||||
|
||||
case SE_29_WAVES:
|
||||
act->s->hitag += 64;
|
||||
l = MulScale(act->s->yvel, bsin(act->s->hitag), 12);
|
||||
sc->floorz = act->s->z + l;
|
||||
act->spr.hitag += 64;
|
||||
l = MulScale(act->spr.yvel, bsin(act->spr.hitag), 12);
|
||||
sc->floorz = act->spr.z + l;
|
||||
break;
|
||||
case SE_31_FLOOR_RISE_FALL: // True Drop Floor
|
||||
handle_se31(act, true);
|
||||
|
@ -3681,11 +3681,11 @@ void moveeffectors_d(void) //STATNUM 3
|
|||
it.Reset(STAT_EFFECTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag != SE_29_WAVES) continue;
|
||||
if (act->spr.lotag != SE_29_WAVES) continue;
|
||||
auto sc = act->sector();
|
||||
if (sc->wallnum != 4) continue;
|
||||
auto wal = sc->firstWall() + 2;
|
||||
alignflorslope(act->s->sector(), wal->x, wal->y, wal->nextSector()->floorz);
|
||||
alignflorslope(act->spr.sector(), wal->x, wal->y, wal->nextSector()->floorz);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3913,7 +3913,7 @@ bool spawnweapondebris_d(int picnum, int dnum)
|
|||
|
||||
void respawnhitag_d(DDukeActor* actor)
|
||||
{
|
||||
switch (actor->s->picnum)
|
||||
switch (actor->spr.picnum)
|
||||
{
|
||||
case FEM1:
|
||||
case FEM2:
|
||||
|
@ -3928,19 +3928,19 @@ void respawnhitag_d(DDukeActor* actor)
|
|||
case PODFEM1:
|
||||
case NAKED1:
|
||||
case STATUE:
|
||||
if (actor->s->yvel) fi.operaterespawns(actor->s->yvel);
|
||||
if (actor->spr.yvel) fi.operaterespawns(actor->spr.yvel);
|
||||
break;
|
||||
default:
|
||||
if (actor->s->hitag >= 0) fi.operaterespawns(actor->s->hitag);
|
||||
if (actor->spr.hitag >= 0) fi.operaterespawns(actor->spr.hitag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void checktimetosleep_d(DDukeActor *actor)
|
||||
{
|
||||
if (actor->s->statnum == STAT_STANDABLE)
|
||||
if (actor->spr.statnum == STAT_STANDABLE)
|
||||
{
|
||||
switch (actor->s->picnum)
|
||||
switch (actor->spr.picnum)
|
||||
{
|
||||
case RUBBERCAN:
|
||||
case EXPLODINGBARREL:
|
||||
|
|
|
@ -94,7 +94,7 @@ bool floorspace_r(sectortype* sectp)
|
|||
|
||||
void check_fta_sounds_r(DDukeActor* actor)
|
||||
{
|
||||
if (actor->s->extra > 0) switch (actor->s->picnum)
|
||||
if (actor->spr.extra > 0) switch (actor->spr.picnum)
|
||||
{
|
||||
case COOT: // LIZTROOP
|
||||
if (!isRRRA() && (krand() & 3) == 2)
|
||||
|
@ -343,7 +343,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
fi.checkhitsprite(act2, actor);
|
||||
|
||||
if (spri2->picnum != RADIUSEXPLOSION &&
|
||||
Owner && Owner->s->statnum < MAXSTATUS)
|
||||
Owner && Owner->spr.statnum < MAXSTATUS)
|
||||
{
|
||||
if (spri2->picnum == APLAYER)
|
||||
{
|
||||
|
@ -493,7 +493,7 @@ void guts_r(DDukeActor* actor, int gtype, int n, int p)
|
|||
// TRANSITIONAL: owned by a player???
|
||||
auto spawned = EGS(s->sector(), s->x + (r5 & 255) - 128, s->y + (r4 & 255) - 128, gutz - (r3 & 8191), gtype, -32, sx >> 1, sy >> 1, a, 48 + (r2 & 31), -512 - (r1 & 2047), ps[p].GetActor(), 5);
|
||||
if (spawned && pal != 0)
|
||||
spawned->s->pal = pal;
|
||||
spawned->spr.pal = pal;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -519,7 +519,7 @@ void movefta_r(void)
|
|||
|
||||
ssect = psect = s->sector();
|
||||
|
||||
if (ps[p].GetActor()->s->extra > 0)
|
||||
if (ps[p].GetActor()->spr.extra > 0)
|
||||
{
|
||||
if (x < 30000)
|
||||
{
|
||||
|
@ -626,7 +626,7 @@ DDukeActor* ifhitsectors_r(sectortype* sect)
|
|||
DukeStatIterator it(STAT_MISC);
|
||||
while (auto a1 = it.Next())
|
||||
{
|
||||
if (a1->s->picnum == EXPLOSION2 || (a1->s->picnum == EXPLOSION3 && sect == a1->s->sector()))
|
||||
if (a1->spr.picnum == EXPLOSION2 || (a1->spr.picnum == EXPLOSION3 && sect == a1->spr.sector()))
|
||||
return a1;
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -655,7 +655,7 @@ int ifhitbyweapon_r(DDukeActor *actor)
|
|||
p = actor->PlayerIndex();
|
||||
|
||||
if (hitowner &&
|
||||
hitowner->s->picnum == APLAYER &&
|
||||
hitowner->spr.picnum == APLAYER &&
|
||||
ud.coop == 1 &&
|
||||
ud.ffire == 0)
|
||||
return -1;
|
||||
|
@ -670,7 +670,7 @@ int ifhitbyweapon_r(DDukeActor *actor)
|
|||
|
||||
ps[p].wackedbyactor = hitowner;
|
||||
|
||||
if (hitowner->s->picnum == APLAYER && p != hitowner->PlayerIndex())
|
||||
if (hitowner->spr.picnum == APLAYER && p != hitowner->PlayerIndex())
|
||||
{
|
||||
ps[p].frag_ps = hitowner->PlayerIndex();
|
||||
}
|
||||
|
@ -707,7 +707,7 @@ int ifhitbyweapon_r(DDukeActor *actor)
|
|||
return -1;
|
||||
|
||||
spri->extra -= actor->extra;
|
||||
if (spri->picnum != RECON && actor->GetOwner() && actor->GetOwner()->s->statnum < MAXSTATUS)
|
||||
if (spri->picnum != RECON && actor->GetOwner() && actor->GetOwner()->spr.statnum < MAXSTATUS)
|
||||
actor->SetOwner(hitowner);
|
||||
}
|
||||
|
||||
|
@ -729,7 +729,7 @@ int ifhitbyweapon_r(DDukeActor *actor)
|
|||
void respawn_rrra(DDukeActor* oldact, DDukeActor* newact)
|
||||
{
|
||||
auto newspr = newact->s;
|
||||
newspr->pal = oldact->s->pal;
|
||||
newspr->pal = oldact->spr.pal;
|
||||
if (newspr->picnum == MAMA)
|
||||
{
|
||||
if (newspr->pal == 30)
|
||||
|
@ -768,7 +768,7 @@ void respawn_rrra(DDukeActor* oldact, DDukeActor* newact)
|
|||
deletesprite(oldact);
|
||||
return;
|
||||
}
|
||||
oldact->s->extra = (66 - 13);
|
||||
oldact->spr.extra = (66 - 13);
|
||||
newspr->pal = 0;
|
||||
}
|
||||
|
||||
|
@ -802,12 +802,12 @@ void movefallers_r(void)
|
|||
DukeStatIterator it(STAT_FALLER);
|
||||
while (auto ac2 = it.Next())
|
||||
{
|
||||
if (ac2->s->hitag == s->hitag)
|
||||
if (ac2->spr.hitag == s->hitag)
|
||||
{
|
||||
ac2->temp_data[0] = 1;
|
||||
ac2->s->cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (ac2->s->picnum == CEILINGSTEAM || ac2->s->picnum == STEAM)
|
||||
ac2->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
ac2->spr.cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (ac2->spr.picnum == CEILINGSTEAM || ac2->spr.picnum == STEAM)
|
||||
ac2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -891,9 +891,9 @@ static void movecrack(DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto a1 = it.Next())
|
||||
{
|
||||
if (s->hitag == a1->s->hitag && (a1->s->picnum == OOZFILTER || a1->s->picnum == SEENINE))
|
||||
if (a1->s->shade != -32)
|
||||
a1->s->shade = -32;
|
||||
if (s->hitag == a1->spr.hitag && (a1->spr.picnum == OOZFILTER || a1->spr.picnum == SEENINE))
|
||||
if (a1->spr.shade != -32)
|
||||
a1->spr.shade = -32;
|
||||
}
|
||||
detonate(actor, EXPLOSION2);
|
||||
}
|
||||
|
@ -981,7 +981,7 @@ void movestandables_r(void)
|
|||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
int picnum = act->s->picnum;
|
||||
int picnum = act->spr.picnum;
|
||||
|
||||
if (!act->insector())
|
||||
{
|
||||
|
@ -1084,7 +1084,7 @@ static void chickenarrow(DDukeActor* actor)
|
|||
if (actor->picnum != BOSS2 && s->xrepeat >= 10 && s->sector()->lotag != 2)
|
||||
{
|
||||
auto spawned = spawn(actor, SMALLSMOKE);
|
||||
if (spawned) spawned->s->z += (1 << 8);
|
||||
if (spawned) spawned->spr.z += (1 << 8);
|
||||
if ((krand() & 15) == 2)
|
||||
{
|
||||
spawn(actor, MONEY);
|
||||
|
@ -1093,12 +1093,12 @@ static void chickenarrow(DDukeActor* actor)
|
|||
DDukeActor* ts = actor->seek_actor;
|
||||
if (!ts) return;
|
||||
|
||||
if (ts->s->extra <= 0)
|
||||
if (ts->spr.extra <= 0)
|
||||
actor->seek_actor = nullptr;
|
||||
if (actor->seek_actor && s->hitag > 5)
|
||||
{
|
||||
int ang, ang2, ang3;
|
||||
ang = getangle(ts->s->x - s->x, ts->s->y - s->y);
|
||||
ang = getangle(ts->spr.x - s->x, ts->spr.y - s->y);
|
||||
ang2 = ang - s->ang;
|
||||
ang3 = abs(ang2);
|
||||
if (ang2 < 100)
|
||||
|
@ -1135,24 +1135,24 @@ static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const vec3_t &ol
|
|||
auto s = proj->s;
|
||||
if (isRRRA())
|
||||
{
|
||||
if (targ->s->picnum == MINION
|
||||
if (targ->spr.picnum == MINION
|
||||
&& (s->picnum == RPG || s->picnum == RPG2)
|
||||
&& targ->s->pal == 19)
|
||||
&& targ->spr.pal == 19)
|
||||
{
|
||||
S_PlayActorSound(RPG_EXPLODE, proj);
|
||||
spawn(proj, EXPLOSION2)->s->pos = oldpos;
|
||||
spawn(proj, EXPLOSION2)->spr.pos = oldpos;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (s->picnum == FREEZEBLAST && targ->s->pal == 1)
|
||||
if (badguy(targ) || targ->s->picnum == APLAYER)
|
||||
else if (s->picnum == FREEZEBLAST && targ->spr.pal == 1)
|
||||
if (badguy(targ) || targ->spr.picnum == APLAYER)
|
||||
{
|
||||
auto star = spawn(proj, TRANSPORTERSTAR);
|
||||
if (star)
|
||||
{
|
||||
star->s->pal = 1;
|
||||
star->s->xrepeat = 32;
|
||||
star->s->yrepeat = 32;
|
||||
star->spr.pal = 1;
|
||||
star->spr.xrepeat = 32;
|
||||
star->spr.yrepeat = 32;
|
||||
}
|
||||
|
||||
deletesprite(proj);
|
||||
|
@ -1161,14 +1161,14 @@ static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const vec3_t &ol
|
|||
|
||||
fi.checkhitsprite(targ, proj);
|
||||
|
||||
if (targ->s->picnum == APLAYER)
|
||||
if (targ->spr.picnum == APLAYER)
|
||||
{
|
||||
int p = targ->s->yvel;
|
||||
int p = targ->spr.yvel;
|
||||
S_PlayActorSound(PISTOL_BODYHIT, targ);
|
||||
|
||||
if (s->picnum == SPIT)
|
||||
{
|
||||
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->s->picnum == MAMA)
|
||||
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA)
|
||||
{
|
||||
guts_r(proj, RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(proj, RABBITJIBB, 2, myconnectindex);
|
||||
|
@ -1206,7 +1206,7 @@ static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const vec3_t &ol
|
|||
static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
|
||||
{
|
||||
auto s = proj->s;
|
||||
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->s->picnum == MAMA)
|
||||
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA)
|
||||
{
|
||||
guts_r(proj, RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(proj, RABBITJIBB, 2, myconnectindex);
|
||||
|
@ -1253,16 +1253,16 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
|
|||
s->x += bcos(s->ang, -7);
|
||||
s->y += bsin(s->ang, -7);
|
||||
auto Owner = proj->GetOwner();
|
||||
if (!isRRRA() || !Owner || (Owner->s->picnum != CHEER && Owner->s->picnum != CHEERSTAYPUT))
|
||||
if (!isRRRA() || !Owner || (Owner->spr.picnum != CHEER && Owner->spr.picnum != CHEERSTAYPUT))
|
||||
{
|
||||
auto j = spawn(proj, CIRCLESTUCK);
|
||||
if (j)
|
||||
{
|
||||
j->s->xrepeat = 8;
|
||||
j->s->yrepeat = 8;
|
||||
j->s->cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
j->s->ang = (j->s->ang + 512) & 2047;
|
||||
j->s->clipdist = MulScale(s->xrepeat, tileWidth(s->picnum), 7);
|
||||
j->spr.xrepeat = 8;
|
||||
j->spr.yrepeat = 8;
|
||||
j->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
j->spr.ang = (j->spr.ang + 512) & 2047;
|
||||
j->spr.clipdist = MulScale(s->xrepeat, tileWidth(s->picnum), 7);
|
||||
}
|
||||
}
|
||||
deletesprite(proj);
|
||||
|
@ -1294,7 +1294,7 @@ bool weaponhitsector(DDukeActor *proj, const vec3_t& oldpos)
|
|||
auto s = proj->s;
|
||||
SetActor(proj, oldpos);
|
||||
|
||||
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->s->picnum == MAMA)
|
||||
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA)
|
||||
{
|
||||
guts_r(proj, RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(proj, RABBITJIBB, 2, myconnectindex);
|
||||
|
@ -1367,7 +1367,7 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
case RPG:
|
||||
if (proj->picnum != BOSS2 && s->xrepeat >= 10 && s->sector()->lotag != 2)
|
||||
{
|
||||
spawn(proj, SMALLSMOKE)->s->z += (1 << 8);
|
||||
spawn(proj, SMALLSMOKE)->spr.z += (1 << 8);
|
||||
}
|
||||
break;
|
||||
case RPG2:
|
||||
|
@ -1386,7 +1386,7 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
makeitfall(proj);
|
||||
if (s->xrepeat >= 10 && s->sector()->lotag != 2)
|
||||
{
|
||||
spawn(proj, SMALLSMOKE)->s->z += (1 << 8);
|
||||
spawn(proj, SMALLSMOKE)->spr.z += (1 << 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1397,7 +1397,7 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
MulScale(k, bsin(s->ang), 14), ll, CLIPMASK1, coll);
|
||||
|
||||
if ((s->picnum == RPG || (isRRRA() && isIn(s->picnum, RPG2, RRTILE1790))) && proj->temp_actor != nullptr)
|
||||
if (FindDistance2D(s->x - proj->temp_actor->s->x, s->y - proj->temp_actor->s->y) < 256)
|
||||
if (FindDistance2D(s->x - proj->temp_actor->spr.x, s->y - proj->temp_actor->spr.y) < 256)
|
||||
coll.setSprite(proj->temp_actor);
|
||||
|
||||
if (!s->insector()) // || (isRR() && s->sector()->filler == 800))
|
||||
|
@ -1434,8 +1434,8 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
|
||||
if (x)
|
||||
{
|
||||
x->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
x->s->pal = s->pal;
|
||||
x->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
x->spr.pal = s->pal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1467,13 +1467,13 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
auto k = spawn(proj, 1441);
|
||||
if (k)
|
||||
{
|
||||
k->s->xrepeat = k->s->yrepeat = s->xrepeat >> 1;
|
||||
k->spr.xrepeat = k->spr.yrepeat = s->xrepeat >> 1;
|
||||
if (coll.type == kHitSector)
|
||||
{
|
||||
if (s->zvel < 0)
|
||||
{
|
||||
k->s->cstat |= CSTAT_SPRITE_YFLIP;
|
||||
k->s->z += (72 << 8);
|
||||
k->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
||||
k->spr.z += (72 << 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1504,7 +1504,7 @@ void moveweapons_r(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
switch (proj->s->picnum)
|
||||
switch (proj->spr.picnum)
|
||||
{
|
||||
case RADIUSEXPLOSION:
|
||||
deletesprite(proj);
|
||||
|
@ -1514,14 +1514,14 @@ void moveweapons_r(void)
|
|||
continue;
|
||||
|
||||
case FREEZEBLAST:
|
||||
if (proj->s->yvel < 1 || proj->s->extra < 2 || (proj->s->xvel | proj->s->zvel) == 0)
|
||||
if (proj->spr.yvel < 1 || proj->spr.extra < 2 || (proj->spr.xvel | proj->spr.zvel) == 0)
|
||||
{
|
||||
auto star = spawn(proj, TRANSPORTERSTAR);
|
||||
if (star)
|
||||
{
|
||||
star->s->pal = 1;
|
||||
star->s->xrepeat = 32;
|
||||
star->s->yrepeat = 32;
|
||||
star->spr.pal = 1;
|
||||
star->spr.xrepeat = 32;
|
||||
star->spr.yrepeat = 32;
|
||||
}
|
||||
deletesprite(proj);
|
||||
continue;
|
||||
|
@ -1610,10 +1610,10 @@ void movetransports_r(void)
|
|||
if (ps[k].cursector == Owner->sector())
|
||||
{
|
||||
ps[k].frag_ps = p;
|
||||
ps[k].GetActor()->s->extra = 0;
|
||||
ps[k].GetActor()->spr.extra = 0;
|
||||
}
|
||||
|
||||
ps[p].angle.ang = buildang(Owner->s->ang);
|
||||
ps[p].angle.ang = buildang(Owner->spr.ang);
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
{
|
||||
|
@ -1622,9 +1622,9 @@ void movetransports_r(void)
|
|||
ps[p].transporter_hold = 13;
|
||||
}
|
||||
|
||||
ps[p].bobposx = ps[p].oposx = ps[p].pos.x = Owner->s->x;
|
||||
ps[p].bobposy = ps[p].oposy = ps[p].pos.y = Owner->s->y;
|
||||
ps[p].oposz = ps[p].pos.z = Owner->s->z - (gs.playerheight - (4 << 8));
|
||||
ps[p].bobposx = ps[p].oposx = ps[p].pos.x = Owner->spr.x;
|
||||
ps[p].bobposy = ps[p].oposy = ps[p].pos.y = Owner->spr.y;
|
||||
ps[p].oposz = ps[p].pos.z = Owner->spr.z - (gs.playerheight - (4 << 8));
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
ps[p].setCursector(spr2->sector());
|
||||
|
@ -1641,12 +1641,12 @@ void movetransports_r(void)
|
|||
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) ||
|
||||
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
|
||||
{
|
||||
ps[p].oposx = ps[p].pos.x += Owner->s->x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->s->y - spr->y;
|
||||
ps[p].oposx = ps[p].pos.x += Owner->spr.x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->spr.y - spr->y;
|
||||
|
||||
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
|
||||
ps[p].pos.z = Owner->s->z - 6144;
|
||||
else ps[p].pos.z = Owner->s->z + 6144;
|
||||
ps[p].pos.z = Owner->spr.z - 6144;
|
||||
else ps[p].pos.z = Owner->spr.z + 6144;
|
||||
ps[p].oposz = ps[p].pos.z;
|
||||
|
||||
ChangeActorSect(act2, Owner->sector());
|
||||
|
@ -1669,7 +1669,7 @@ void movetransports_r(void)
|
|||
if (onfloorz && sectlotag == 161 && ps[p].pos.z < (sectp->ceilingz + (6 << 8)))
|
||||
{
|
||||
k = 2;
|
||||
if (ps[p].GetActor()->s->extra <= 0) break;
|
||||
if (ps[p].GetActor()->spr.extra <= 0) break;
|
||||
ps[p].oposz = ps[p].pos.z =
|
||||
Owner->sector()->floorz - (49 << 8);
|
||||
}
|
||||
|
@ -1694,7 +1694,7 @@ void movetransports_r(void)
|
|||
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.z < (sectp->ceilingz + (6 << 8)))
|
||||
{
|
||||
k = 1;
|
||||
if (ps[p].GetActor()->s->extra <= 0) break;
|
||||
if (ps[p].GetActor()->spr.extra <= 0) break;
|
||||
if (screenpeek == p)
|
||||
{
|
||||
FX_StopAllSounds();
|
||||
|
@ -1707,8 +1707,8 @@ void movetransports_r(void)
|
|||
|
||||
if (k == 1)
|
||||
{
|
||||
ps[p].oposx = ps[p].pos.x += Owner->s->x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->s->y - spr->y;
|
||||
ps[p].oposx = ps[p].pos.x += Owner->spr.x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->spr.y - spr->y;
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
ps[p].transporter_hold = -2;
|
||||
|
@ -1721,8 +1721,8 @@ void movetransports_r(void)
|
|||
}
|
||||
else if (isRRRA() && k == 2)
|
||||
{
|
||||
ps[p].oposx = ps[p].pos.x += Owner->s->x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->s->y - spr->y;
|
||||
ps[p].oposx = ps[p].pos.x += Owner->spr.x - spr->x;
|
||||
ps[p].oposy = ps[p].pos.y += Owner->spr.y - spr->y;
|
||||
|
||||
if (Owner->GetOwner() != Owner)
|
||||
ps[p].transporter_hold = -2;
|
||||
|
@ -1825,8 +1825,8 @@ void movetransports_r(void)
|
|||
auto k = spawn(act2, WATERSPLASH2);
|
||||
if (k && sectlotag == 1 && spr2->statnum == 4)
|
||||
{
|
||||
k->s->xvel = spr2->xvel >> 1;
|
||||
k->s->ang = spr2->ang;
|
||||
k->spr.xvel = spr2->xvel >> 1;
|
||||
k->spr.ang = spr2->ang;
|
||||
ssp(k, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -1836,12 +1836,12 @@ void movetransports_r(void)
|
|||
case ST_0_NO_EFFECT:
|
||||
if (onfloorz)
|
||||
{
|
||||
if (checkcursectnums(spr->sector()) == -1 && checkcursectnums(Owner->s->sector()) == -1)
|
||||
if (checkcursectnums(spr->sector()) == -1 && checkcursectnums(Owner->spr.sector()) == -1)
|
||||
{
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z -= spr->z - Owner->sector()->floorz;
|
||||
spr2->ang = Owner->s->ang;
|
||||
spr2->ang = Owner->spr.ang;
|
||||
|
||||
spr2->backupang();
|
||||
|
||||
|
@ -1862,9 +1862,9 @@ void movetransports_r(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->z = Owner->s->z + 4096;
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->spr.z + 4096;
|
||||
|
||||
spr2->backupz();
|
||||
|
||||
|
@ -1872,8 +1872,8 @@ void movetransports_r(void)
|
|||
}
|
||||
break;
|
||||
case ST_1_ABOVE_WATER:
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->sector()->ceilingz + ll;
|
||||
|
||||
spr2->backupz();
|
||||
|
@ -1882,8 +1882,8 @@ void movetransports_r(void)
|
|||
|
||||
break;
|
||||
case ST_2_UNDERWATER:
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->sector()->floorz - ll;
|
||||
|
||||
spr2->backupz();
|
||||
|
@ -1894,8 +1894,8 @@ void movetransports_r(void)
|
|||
|
||||
case 160:
|
||||
if (!isRRRA()) break;
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->sector()->ceilingz + ll2;
|
||||
|
||||
spr2->backupz();
|
||||
|
@ -1908,8 +1908,8 @@ void movetransports_r(void)
|
|||
break;
|
||||
case 161:
|
||||
if (!isRRRA()) break;
|
||||
spr2->x += (Owner->s->x - spr->x);
|
||||
spr2->y += (Owner->s->y - spr->y);
|
||||
spr2->x += (Owner->spr.x - spr->x);
|
||||
spr2->y += (Owner->spr.y - spr->y);
|
||||
spr2->z = Owner->sector()->floorz - ll2;
|
||||
|
||||
spr2->backupz();
|
||||
|
@ -2302,7 +2302,7 @@ static void rrra_specialstats()
|
|||
it.Reset(123);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag == 5)
|
||||
if (act->spr.lotag == 5)
|
||||
if (!S_CheckSoundPlaying(330))
|
||||
S_PlayActorSound(330, act);
|
||||
}
|
||||
|
@ -2339,9 +2339,9 @@ void rr_specialstats()
|
|||
DukeStatIterator it2(STAT_DEFAULT);
|
||||
while (auto act2 = it2.Next())
|
||||
{
|
||||
if (act2->s->picnum == 128)
|
||||
if (act2->s->hitag == 999)
|
||||
act2->s->picnum = 127;
|
||||
if (act2->spr.picnum == 128)
|
||||
if (act2->spr.hitag == 999)
|
||||
act2->spr.picnum = 127;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2359,7 +2359,7 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
spawn(act, RRTILE3190)->s->ang = s->ang;
|
||||
spawn(act, RRTILE3190)->spr.ang = s->ang;
|
||||
s->lotag = 128;
|
||||
}
|
||||
break;
|
||||
|
@ -2367,7 +2367,7 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
spawn(act, RRTILE3192)->s->ang = s->ang;
|
||||
spawn(act, RRTILE3192)->spr.ang = s->ang;
|
||||
s->lotag = 256;
|
||||
}
|
||||
break;
|
||||
|
@ -2392,7 +2392,7 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
spawn(act, RRTILE3120)->s->ang = s->ang;
|
||||
spawn(act, RRTILE3120)->spr.ang = s->ang;
|
||||
s->lotag = 448;
|
||||
}
|
||||
break;
|
||||
|
@ -2400,7 +2400,7 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
spawn(act, RRTILE3122)->s->ang = s->ang;
|
||||
spawn(act, RRTILE3122)->spr.ang = s->ang;
|
||||
s->lotag = 64;
|
||||
}
|
||||
break;
|
||||
|
@ -2408,7 +2408,7 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
spawn(act, RRTILE3123)->s->ang = s->ang;
|
||||
spawn(act, RRTILE3123)->spr.ang = s->ang;
|
||||
s->lotag = 512;
|
||||
}
|
||||
break;
|
||||
|
@ -2416,7 +2416,7 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
spawn(act, RRTILE3124)->s->ang = s->ang;
|
||||
spawn(act, RRTILE3124)->spr.ang = s->ang;
|
||||
s->lotag = 224;
|
||||
}
|
||||
break;
|
||||
|
@ -2476,12 +2476,12 @@ void rr_specialstats()
|
|||
DukeStatIterator it2(108);
|
||||
while (auto act2 = it2.Next())
|
||||
{
|
||||
if (act2->s->picnum == RRTILE297)
|
||||
if (act2->spr.picnum == RRTILE297)
|
||||
{
|
||||
ps[p].angle.ang = buildang(act2->s->ang);
|
||||
ps[p].bobposx = ps[p].oposx = ps[p].pos.x = act2->s->x;
|
||||
ps[p].bobposy = ps[p].oposy = ps[p].pos.y = act2->s->y;
|
||||
ps[p].oposz = ps[p].pos.z = act2->s->z - (36 << 8);
|
||||
ps[p].angle.ang = buildang(act2->spr.ang);
|
||||
ps[p].bobposx = ps[p].oposx = ps[p].pos.x = act2->spr.x;
|
||||
ps[p].bobposy = ps[p].oposy = ps[p].pos.y = act2->spr.y;
|
||||
ps[p].oposz = ps[p].pos.z = act2->spr.z - (36 << 8);
|
||||
auto pact = ps[p].GetActor();
|
||||
ChangeActorSect(pact, act2->sector());
|
||||
ps[p].setCursector(pact->sector());
|
||||
|
@ -2602,7 +2602,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
goto DETONATEB;
|
||||
}
|
||||
|
||||
if (Owner && Owner->s->picnum == APLAYER)
|
||||
if (Owner && Owner->spr.picnum == APLAYER)
|
||||
l = Owner->PlayerIndex();
|
||||
else l = -1;
|
||||
|
||||
|
@ -2707,14 +2707,14 @@ DETONATEB:
|
|||
if (ps[p].gotweapon[DYNAMITE_WEAPON] == 0 || Owner == ps[p].GetActor())
|
||||
fi.addweapon(&ps[p], DYNAMITE_WEAPON);
|
||||
|
||||
if (!Owner || Owner->s->picnum != APLAYER)
|
||||
if (!Owner || Owner->spr.picnum != APLAYER)
|
||||
{
|
||||
SetPlayerPal(&ps[p], PalEntry(32, 0, 32, 0));
|
||||
}
|
||||
|
||||
if (Owner && (Owner->picnum != HEAVYHBOMB || ud.respawn_items == 0 || Owner->s->picnum == APLAYER))
|
||||
if (Owner && (Owner->picnum != HEAVYHBOMB || ud.respawn_items == 0 || Owner->spr.picnum == APLAYER))
|
||||
{
|
||||
if (s->picnum == HEAVYHBOMB && Owner->s->picnum != APLAYER && ud.coop)
|
||||
if (s->picnum == HEAVYHBOMB && Owner->spr.picnum != APLAYER && ud.coop)
|
||||
return;
|
||||
deletesprite(actor);
|
||||
return;
|
||||
|
@ -2771,15 +2771,15 @@ static int henstand(DDukeActor *actor)
|
|||
{
|
||||
auto hitact = coll.actor();
|
||||
fi.checkhitsprite(actor, hitact);
|
||||
if (hitact->s->picnum == HEN)
|
||||
if (hitact->spr.picnum == HEN)
|
||||
{
|
||||
auto ns = spawn(hitact, HENSTAND);
|
||||
deletesprite(hitact);
|
||||
if (ns)
|
||||
{
|
||||
ns->s->xvel = 32;
|
||||
ns->s->lotag = 40;
|
||||
ns->s->ang = s->ang;
|
||||
ns->spr.xvel = 32;
|
||||
ns->spr.lotag = 40;
|
||||
ns->spr.ang = s->ang;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2954,7 +2954,7 @@ void moveactors_r(void)
|
|||
if (sectp->lotag == 1)
|
||||
{
|
||||
auto j = spawn(act, WATERSPLASH2);
|
||||
if (j) j->s->z = j->sector()->floorz;
|
||||
if (j) j->spr.z = j->sector()->floorz;
|
||||
}
|
||||
deletesprite(act);
|
||||
continue;
|
||||
|
@ -3194,7 +3194,7 @@ void moveexplosions_r(void) // STATNUM 5
|
|||
if (x < 512)
|
||||
{
|
||||
SetPlayerPal(&ps[p], PalEntry(32, 32, 0, 0));
|
||||
ps[p].GetActor()->s->extra -= 4;
|
||||
ps[p].GetActor()->spr.extra -= 4;
|
||||
}
|
||||
[[fallthrough]];
|
||||
|
||||
|
@ -3366,25 +3366,25 @@ void handle_se06_r(DDukeActor *actor)
|
|||
auto ns = spawn(actor, HULK);
|
||||
if (ns)
|
||||
{
|
||||
ns->s->z = ns->sector()->ceilingz;
|
||||
ns->s->pal = 33;
|
||||
ns->spr.z = ns->sector()->ceilingz;
|
||||
ns->spr.pal = 33;
|
||||
}
|
||||
if (!hulkspawn)
|
||||
{
|
||||
ns = EGS(s->sector(), s->x, s->y, s->sector()->ceilingz + 119428, 3677, -8, 16, 16, 0, 0, 0, actor, 5);
|
||||
if (ns)
|
||||
{
|
||||
ns->s->cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
|
||||
ns->s->pal = 7;
|
||||
ns->s->xrepeat = 80;
|
||||
ns->s->yrepeat = 255;
|
||||
ns->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
|
||||
ns->spr.pal = 7;
|
||||
ns->spr.xrepeat = 80;
|
||||
ns->spr.yrepeat = 255;
|
||||
}
|
||||
ns = spawn(actor, 296);
|
||||
if (ns)
|
||||
{
|
||||
ns->s->cstat = 0;
|
||||
ns->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
ns->s->z = s->sector()->floorz - 6144;
|
||||
ns->spr.cstat = 0;
|
||||
ns->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
ns->spr.z = s->sector()->floorz - 6144;
|
||||
}
|
||||
deletesprite(actor);
|
||||
return;
|
||||
|
@ -3398,7 +3398,7 @@ void handle_se06_r(DDukeActor *actor)
|
|||
DukeSectIterator it(actor->sector());
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (a2->s->picnum == UFOBEAM && ufospawn && ++ufocnt == 64)
|
||||
if (a2->spr.picnum == UFOBEAM && ufospawn && ++ufocnt == 64)
|
||||
{
|
||||
int pn;
|
||||
ufocnt = 0;
|
||||
|
@ -3424,7 +3424,7 @@ void handle_se06_r(DDukeActor *actor)
|
|||
}
|
||||
else pn = UFO1_RRRA;
|
||||
auto ns = spawn(actor, pn);
|
||||
if (ns) ns->s->z = ns->sector()->ceilingz;
|
||||
if (ns) ns->spr.z = ns->sector()->ceilingz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3432,15 +3432,15 @@ void handle_se06_r(DDukeActor *actor)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if ((act2->s->lotag == 14) && (sh == act2->s->hitag) && (act2->temp_data[0] == t[0]))
|
||||
if ((act2->spr.lotag == 14) && (sh == act2->spr.hitag) && (act2->temp_data[0] == t[0]))
|
||||
{
|
||||
act2->s->xvel = s->xvel;
|
||||
act2->spr.xvel = s->xvel;
|
||||
// if( t[4] == 1 )
|
||||
{
|
||||
if (act2->temp_data[5] == 0)
|
||||
act2->temp_data[5] = dist(act2, actor);
|
||||
int x = Sgn(dist(act2, actor) - act2->temp_data[5]);
|
||||
if (act2->s->extra) x = -x;
|
||||
if (act2->spr.extra) x = -x;
|
||||
s->xvel += x;
|
||||
}
|
||||
act2->temp_data[4] = t[4];
|
||||
|
@ -3465,7 +3465,7 @@ void moveeffectors_r(void) //STATNUM 3
|
|||
while (auto act = it.Next())
|
||||
{
|
||||
auto sc = act->sector();
|
||||
int st = act->s->lotag;
|
||||
int st = act->spr.lotag;
|
||||
|
||||
auto t = &act->temp_data[0];
|
||||
|
||||
|
@ -3602,9 +3602,9 @@ void moveeffectors_r(void) //STATNUM 3
|
|||
break;
|
||||
|
||||
case SE_29_WAVES:
|
||||
act->s->hitag += 64;
|
||||
l = MulScale(act->s->yvel, bsin(act->s->hitag), 12);
|
||||
sc->floorz = act->s->z + l;
|
||||
act->spr.hitag += 64;
|
||||
l = MulScale(act->spr.yvel, bsin(act->spr.hitag), 12);
|
||||
sc->floorz = act->spr.z + l;
|
||||
break;
|
||||
|
||||
case SE_31_FLOOR_RISE_FALL: // True Drop Floor
|
||||
|
@ -3648,7 +3648,7 @@ void moveeffectors_r(void) //STATNUM 3
|
|||
it.Reset(STAT_EFFECTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag != SE_29_WAVES) continue;
|
||||
if (act->spr.lotag != SE_29_WAVES) continue;
|
||||
auto sc = act->sector();
|
||||
if (sc->wallnum != 4) continue;
|
||||
auto wal = sc->firstWall() + 2;
|
||||
|
@ -3665,9 +3665,9 @@ void moveeffectors_r(void) //STATNUM 3
|
|||
|
||||
int adjustfall(DDukeActor *actor, int c)
|
||||
{
|
||||
if ((actor->s->picnum == BIKERB || actor->s->picnum == CHEERB) && c == gs.gravity)
|
||||
if ((actor->spr.picnum == BIKERB || actor->spr.picnum == CHEERB) && c == gs.gravity)
|
||||
c = gs.gravity>>2;
|
||||
else if (actor->s->picnum == BIKERBV2 && c == gs.gravity)
|
||||
else if (actor->spr.picnum == BIKERBV2 && c == gs.gravity)
|
||||
c = gs.gravity>>3;
|
||||
return c;
|
||||
}
|
||||
|
@ -4103,34 +4103,34 @@ void destroyit(DDukeActor *actor)
|
|||
DukeSectIterator it1(actor->sector());
|
||||
while (auto a2 = it1.Next())
|
||||
{
|
||||
if (a2->s->picnum == RRTILE63)
|
||||
if (a2->spr.picnum == RRTILE63)
|
||||
{
|
||||
lotag = a2->s->lotag;
|
||||
lotag = a2->spr.lotag;
|
||||
spr = a2;
|
||||
if (a2->s->hitag)
|
||||
hitag = a2->s->hitag;
|
||||
if (a2->spr.hitag)
|
||||
hitag = a2->spr.hitag;
|
||||
}
|
||||
}
|
||||
DukeStatIterator it(STAT_DESTRUCT);
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
auto it_sect = a2->s->sector();
|
||||
if (hitag && hitag == a2->s->hitag)
|
||||
auto it_sect = a2->spr.sector();
|
||||
if (hitag && hitag == a2->spr.hitag)
|
||||
{
|
||||
DukeSectIterator its(it_sect);
|
||||
while (auto a3 = its.Next())
|
||||
{
|
||||
if (a3->s->picnum == DESTRUCTO)
|
||||
if (a3->spr.picnum == DESTRUCTO)
|
||||
{
|
||||
a3->picnum = SHOTSPARK1;
|
||||
a3->extra = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spr && spr->s->sector() != it_sect)
|
||||
if (lotag == a2->s->lotag)
|
||||
if (spr && spr->spr.sector() != it_sect)
|
||||
if (lotag == a2->spr.lotag)
|
||||
{
|
||||
auto sect = spr->s->sector();
|
||||
auto sect = spr->spr.sector();
|
||||
|
||||
auto destsect = spr->sector();
|
||||
auto srcsect = it_sect;
|
||||
|
@ -4175,10 +4175,10 @@ void destroyit(DDukeActor *actor)
|
|||
destsect->extra = srcsect->extra;
|
||||
}
|
||||
}
|
||||
it1.Reset(actor->s->sector());
|
||||
it1.Reset(actor->spr.sector());
|
||||
while (auto a2 = it1.Next())
|
||||
{
|
||||
switch (a2->s->picnum)
|
||||
switch (a2->spr.picnum)
|
||||
{
|
||||
case DESTRUCTO:
|
||||
case RRTILE63:
|
||||
|
@ -4215,24 +4215,24 @@ bool spawnweapondebris_r(int picnum, int dnum)
|
|||
|
||||
void respawnhitag_r(DDukeActor *actor)
|
||||
{
|
||||
switch (actor->s->picnum)
|
||||
switch (actor->spr.picnum)
|
||||
{
|
||||
case FEM10:
|
||||
case NAKED1:
|
||||
case STATUE:
|
||||
if (actor->s->yvel) fi.operaterespawns(actor->s->yvel);
|
||||
if (actor->spr.yvel) fi.operaterespawns(actor->spr.yvel);
|
||||
break;
|
||||
default:
|
||||
if (actor->s->hitag >= 0) fi.operaterespawns(actor->s->hitag);
|
||||
if (actor->spr.hitag >= 0) fi.operaterespawns(actor->spr.hitag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void checktimetosleep_r(DDukeActor *actor)
|
||||
{
|
||||
if (actor->s->statnum == STAT_STANDABLE)
|
||||
if (actor->spr.statnum == STAT_STANDABLE)
|
||||
{
|
||||
switch (actor->s->picnum)
|
||||
switch (actor->spr.picnum)
|
||||
{
|
||||
case RUBBERCAN:
|
||||
case EXPLODINGBARREL:
|
||||
|
|
|
@ -330,7 +330,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
#endif
|
||||
}
|
||||
|
||||
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->s->extra > 0 && ps[p].curr_weapon > 0)
|
||||
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->spr.extra > 0 && ps[p].curr_weapon > 0)
|
||||
{
|
||||
auto newtspr = &tsprite[spritesortcnt++];
|
||||
newtspr = t;
|
||||
|
|
|
@ -371,7 +371,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
#endif
|
||||
}
|
||||
|
||||
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->s->extra > 0 && ps[p].curr_weapon > 0)
|
||||
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->spr.extra > 0 && ps[p].curr_weapon > 0)
|
||||
{
|
||||
auto newtspr = &tsprite[spritesortcnt++];
|
||||
newtspr = t;
|
||||
|
|
|
@ -39,17 +39,17 @@ void ballreturn(DDukeActor *ball)
|
|||
DukeStatIterator it(STAT_BOWLING);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == RRTILE281 && ball->s->sector() == act->s->sector())
|
||||
if (act->spr.picnum == RRTILE281 && ball->spr.sector() == act->spr.sector())
|
||||
{
|
||||
DukeStatIterator it2(STAT_BOWLING);
|
||||
while (auto act2 = it2.Next())
|
||||
{
|
||||
if (act2->s->picnum == BOWLINGBALLSPOT && act->s->hitag == act2->s->hitag)
|
||||
if (act2->spr.picnum == BOWLINGBALLSPOT && act->spr.hitag == act2->spr.hitag)
|
||||
spawn(act2, BOWLINGBALLSPRITE);
|
||||
if (act2->s->picnum == BOWLINGPINSPOT && act->s->hitag == act2->s->hitag && act2->s->lotag == 0)
|
||||
if (act2->spr.picnum == BOWLINGPINSPOT && act->spr.hitag == act2->spr.hitag && act2->spr.lotag == 0)
|
||||
{
|
||||
act2->s->lotag = 100;
|
||||
act2->s->extra++;
|
||||
act2->spr.lotag = 100;
|
||||
act2->spr.extra++;
|
||||
pinsectorresetdown(act2->sector());
|
||||
}
|
||||
}
|
||||
|
@ -91,14 +91,14 @@ int checkpins(sectortype* sect)
|
|||
DukeSectIterator it(sect);
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (a2->s->picnum == BOWLINGPIN)
|
||||
if (a2->spr.picnum == BOWLINGPIN)
|
||||
{
|
||||
pin++;
|
||||
pins[a2->s->lotag] = true;
|
||||
pins[a2->spr.lotag] = true;
|
||||
}
|
||||
if (a2->s->picnum == BOWLINGPINSPOT)
|
||||
if (a2->spr.picnum == BOWLINGPINSPOT)
|
||||
{
|
||||
tag = a2->s->hitag;
|
||||
tag = a2->spr.hitag;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,31 +170,31 @@ void resetpins(sectortype* sect)
|
|||
DukeSectIterator it(sect);
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (a2->s->picnum == BOWLINGPIN)
|
||||
if (a2->spr.picnum == BOWLINGPIN)
|
||||
deletesprite(a2);
|
||||
}
|
||||
it.Reset(sect);
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (a2->s->picnum == 283)
|
||||
if (a2->spr.picnum == 283)
|
||||
{
|
||||
auto spawned = spawn(a2, BOWLINGPIN);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->lotag = a2->s->lotag;
|
||||
if (spawned->s->lotag == 3 || spawned->s->lotag == 5)
|
||||
spawned->spr.lotag = a2->spr.lotag;
|
||||
if (spawned->spr.lotag == 3 || spawned->spr.lotag == 5)
|
||||
{
|
||||
spawned->s->clipdist = (1 + (krand() % 1)) * 16 + 32;
|
||||
spawned->spr.clipdist = (1 + (krand() % 1)) * 16 + 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawned->s->clipdist = (1 + (krand() % 1)) * 16 + 32;
|
||||
spawned->spr.clipdist = (1 + (krand() % 1)) * 16 + 32;
|
||||
}
|
||||
spawned->s->ang -= ((krand() & 32) - (krand() & 64)) & 2047;
|
||||
spawned->spr.ang -= ((krand() & 32) - (krand() & 64)) & 2047;
|
||||
}
|
||||
}
|
||||
if (a2->s->picnum == 280)
|
||||
tag = a2->s->hitag;
|
||||
if (a2->spr.picnum == 280)
|
||||
tag = a2->spr.hitag;
|
||||
}
|
||||
if (tag)
|
||||
{
|
||||
|
|
|
@ -96,9 +96,9 @@ static int ccmd_spawn(CCmdFuncPtr parm)
|
|||
auto spawned = spawn(ps[myconnectindex].GetActor(), picnum);
|
||||
if (spawned)
|
||||
{
|
||||
if (set & 1) spawned->s->pal = (uint8_t)pal;
|
||||
if (set & 2) spawned->s->cstat = ESpriteFlags::FromInt(cstat);
|
||||
if (set & 4) spawned->s->ang = ang;
|
||||
if (set & 1) spawned->spr.pal = (uint8_t)pal;
|
||||
if (set & 2) spawned->spr.cstat = ESpriteFlags::FromInt(cstat);
|
||||
if (set & 4) spawned->spr.ang = ang;
|
||||
if (set & 8) SetActor(spawned, { x, y, z });
|
||||
|
||||
if (spawned->sector() == nullptr)
|
||||
|
|
|
@ -67,12 +67,12 @@ static const char *cheatGod(int myconnectindex, int state)
|
|||
auto act = p->GetActor();
|
||||
|
||||
p->resurrected = true;
|
||||
act->s->extra = gs.max_player_health;
|
||||
act->spr.extra = gs.max_player_health;
|
||||
act->extra = 0;
|
||||
if (ud.god)
|
||||
{
|
||||
if (isRRRA()) S_PlaySound(218, CHAN_AUTO, CHANF_UI);
|
||||
act->s->cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
||||
act->temp_data[0] = 0;
|
||||
act->temp_data[1] = 0;
|
||||
|
@ -81,9 +81,9 @@ static const char *cheatGod(int myconnectindex, int state)
|
|||
act->temp_data[4] = 0;
|
||||
act->temp_data[5] = 0;
|
||||
|
||||
act->s->hitag = 0;
|
||||
act->s->lotag = 0;
|
||||
act->s->pal =
|
||||
act->spr.hitag = 0;
|
||||
act->spr.lotag = 0;
|
||||
act->spr.pal =
|
||||
ps[myconnectindex].palookup;
|
||||
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_GODMODE_ON);
|
||||
|
@ -91,7 +91,7 @@ static const char *cheatGod(int myconnectindex, int state)
|
|||
else
|
||||
{
|
||||
ud.god = 0;
|
||||
act->s->extra = gs.max_player_health;
|
||||
act->spr.extra = gs.max_player_health;
|
||||
act->extra = -1;
|
||||
ps[myconnectindex].last_extra = gs.max_player_health;
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_GODMODE_OFF);
|
||||
|
@ -123,9 +123,9 @@ static const char *cheatKfc(int player)
|
|||
auto spr = spawn(ps[player].GetActor(), TILE_HEN);
|
||||
if (spr)
|
||||
{
|
||||
spr->s->pal = 1;
|
||||
spr->s->xrepeat = spr->s->xrepeat << 2;
|
||||
spr->s->yrepeat = spr->s->yrepeat << 2;
|
||||
spr->spr.pal = 1;
|
||||
spr->spr.xrepeat = spr->spr.xrepeat << 2;
|
||||
spr->spr.yrepeat = spr->spr.yrepeat << 2;
|
||||
}
|
||||
}
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_KFC);
|
||||
|
@ -200,7 +200,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
|
|||
memset(ps[player].gotweapon, 0, sizeof(ps[player].gotweapon));
|
||||
ps[player].curr_weapon = KNEE_WEAPON;
|
||||
ps[player].nocheat = 1;
|
||||
ps[player].GetActor()->s->extra = 1;
|
||||
ps[player].GetActor()->spr.extra = 1;
|
||||
return quoteMgr.GetQuote(QUOTE_YERFUCKED);
|
||||
|
||||
case CHT_AARON:
|
||||
|
@ -476,7 +476,7 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
|
|||
int type = ReadByte(stream);
|
||||
if (skip) return;
|
||||
|
||||
if (numplayers != 1 || gamestate != GS_LEVEL || ps[player].GetActor()->s->extra <= 0)
|
||||
if (numplayers != 1 || gamestate != GS_LEVEL || ps[player].GetActor()->spr.extra <= 0)
|
||||
{
|
||||
Printf("give: Cannot give while dead or not in a single-player game.\n");
|
||||
return;
|
||||
|
@ -490,7 +490,7 @@ static void cmd_Give(int player, uint8_t** stream, bool skip)
|
|||
break;
|
||||
|
||||
case GIVE_HEALTH:
|
||||
ps[player].GetActor()->s->extra = gs.max_player_health << 1;
|
||||
ps[player].GetActor()->spr.extra = gs.max_player_health << 1;
|
||||
break;
|
||||
|
||||
case GIVE_WEAPONS:
|
||||
|
|
|
@ -92,7 +92,7 @@ bool GameInterface::CanSave()
|
|||
{
|
||||
if (ud.recstat == 2 || gamestate != GS_LEVEL) return false;
|
||||
auto &myplayer = ps[myconnectindex];
|
||||
return (myplayer.GetActor()->s->extra > 0);
|
||||
return (myplayer.GetActor()->spr.extra > 0);
|
||||
}
|
||||
|
||||
bool GameInterface::StartGame(FNewGameStartup& gs)
|
||||
|
|
|
@ -16,7 +16,7 @@ inline DDukeActor* player_struct::GetActor()
|
|||
|
||||
inline int player_struct::GetPlayerNum()
|
||||
{
|
||||
return actor->s->yvel;
|
||||
return actor->spr.yvel;
|
||||
}
|
||||
|
||||
DDukeActor* spawn(DDukeActor* spawner, int type);
|
||||
|
@ -33,12 +33,12 @@ inline int dist(DDukeActor* s1, DDukeActor* s2)
|
|||
|
||||
inline int badguy(DDukeActor* pSprite)
|
||||
{
|
||||
return badguypic(pSprite->s->picnum);
|
||||
return badguypic(pSprite->spr.picnum);
|
||||
}
|
||||
|
||||
inline int bossguy(DDukeActor* pSprite)
|
||||
{
|
||||
return bossguypic(pSprite->s->picnum);
|
||||
return bossguypic(pSprite->spr.picnum);
|
||||
}
|
||||
|
||||
// old interface versions of already changed functions
|
||||
|
|
|
@ -250,7 +250,7 @@ void drawoverlays(double smoothratio)
|
|||
{
|
||||
fi.displayweapon(screenpeek, smoothratio);
|
||||
if (pp->over_shoulder_on == 0)
|
||||
fi.displaymasks(screenpeek, pp->GetActor()->s->pal == 1 || !pp->insector() ? 1 : pp->cursector->floorpal, smoothratio);
|
||||
fi.displaymasks(screenpeek, pp->GetActor()->spr.pal == 1 || !pp->insector() ? 1 : pp->cursector->floorpal, smoothratio);
|
||||
}
|
||||
if (!isRR())
|
||||
moveclouds(smoothratio);
|
||||
|
|
|
@ -1041,7 +1041,7 @@ void DoSector(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
if (lVar1 == g_iThisActorID)
|
||||
{
|
||||
// if they've asked for 'this', then use 'this'...
|
||||
iSector = sActor->s->sectno();
|
||||
iSector = sActor->spr.sectno();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1414,7 +1414,7 @@ static int ifcanshoottarget(DDukeActor *actor, int g_p, int g_x)
|
|||
{
|
||||
int sclip, angdif;
|
||||
|
||||
if (badguy(actor) && actor->s->xrepeat > 56)
|
||||
if (badguy(actor) && actor->spr.xrepeat > 56)
|
||||
{
|
||||
sclip = 3084;
|
||||
angdif = 48;
|
||||
|
@ -1433,21 +1433,21 @@ static int ifcanshoottarget(DDukeActor *actor, int g_p, int g_x)
|
|||
}
|
||||
if (j > sclip)
|
||||
{
|
||||
if (hit != nullptr && hit->s->picnum == actor->s->picnum)
|
||||
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
|
||||
j = 0;
|
||||
else
|
||||
{
|
||||
actor->s->ang += angdif; j = hitasprite(actor, &hit); actor->s->ang -= angdif;
|
||||
actor->spr.ang += angdif; j = hitasprite(actor, &hit); actor->spr.ang -= angdif;
|
||||
if (j > sclip)
|
||||
{
|
||||
if (hit != nullptr && hit->s->picnum == actor->s->picnum)
|
||||
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
|
||||
j = 0;
|
||||
else
|
||||
{
|
||||
actor->s->ang -= angdif; j = hitasprite(actor, &hit); actor->s->ang += angdif;
|
||||
actor->spr.ang -= angdif; j = hitasprite(actor, &hit); actor->spr.ang += angdif;
|
||||
if (j > 768)
|
||||
{
|
||||
if (hit != nullptr && hit->s->picnum == actor->s->picnum)
|
||||
if (hit != nullptr && hit->spr.picnum == actor->spr.picnum)
|
||||
j = 0;
|
||||
else j = 1;
|
||||
}
|
||||
|
@ -1481,7 +1481,7 @@ static bool ifcansee(DDukeActor* actor, int pnum)
|
|||
if (ps[pnum].holoduke_on != nullptr && !isRR())
|
||||
{
|
||||
tosee = ps[pnum].holoduke_on;
|
||||
j = cansee(spr->x, spr->y, spr->z - (krand() & ((32 << 8) - 1)), spr->sector(), tosee->s->x, tosee->s->y, tosee->s->z, tosee->sector());
|
||||
j = cansee(spr->x, spr->y, spr->z - (krand() & ((32 << 8) - 1)), spr->sector(), tosee->spr.x, tosee->spr.y, tosee->spr.z, tosee->sector());
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
|
@ -1493,7 +1493,7 @@ static bool ifcansee(DDukeActor* actor, int pnum)
|
|||
else tosee = ps[pnum].GetActor(); // holoduke not on. look for player
|
||||
|
||||
// can they see player, (or player's holoduke)
|
||||
j = cansee(spr->x, spr->y, spr->z - (krand() & ((47 << 8))), spr->sector(), tosee->s->x, tosee->s->y, tosee->s->z - ((isRR()? 28 : 24) << 8), tosee->sector());
|
||||
j = cansee(spr->x, spr->y, spr->z - (krand() & ((47 << 8))), spr->sector(), tosee->spr.x, tosee->spr.y, tosee->spr.z - ((isRR()? 28 : 24) << 8), tosee->sector());
|
||||
|
||||
if (j == 0)
|
||||
{
|
||||
|
@ -1505,8 +1505,8 @@ static bool ifcansee(DDukeActor* actor, int pnum)
|
|||
{
|
||||
// else, they did see it.
|
||||
// save where we were looking..
|
||||
actor->lastvx = tosee->s->x;
|
||||
actor->lastvy = tosee->s->y;
|
||||
actor->lastvx = tosee->spr.x;
|
||||
actor->lastvy = tosee->spr.y;
|
||||
}
|
||||
|
||||
if (j == 1 && (spr->statnum == STAT_ACTOR || spr->statnum == STAT_STANDABLE))
|
||||
|
@ -1963,7 +1963,7 @@ int ParseState::parse(void)
|
|||
case concmd_isdrunk: // todo: move out to player_r.
|
||||
insptr++;
|
||||
ps[g_p].drink_amt += *insptr;
|
||||
j = ps[g_p].GetActor()->s->extra;
|
||||
j = ps[g_p].GetActor()->spr.extra;
|
||||
if (j > 0)
|
||||
j += *insptr;
|
||||
if (j > gs.max_player_health * 2)
|
||||
|
@ -1982,14 +1982,14 @@ int ParseState::parse(void)
|
|||
ps[g_p].last_extra = j;
|
||||
}
|
||||
|
||||
ps[g_p].GetActor()->s->extra = j;
|
||||
ps[g_p].GetActor()->spr.extra = j;
|
||||
}
|
||||
if (ps[g_p].drink_amt > 100)
|
||||
ps[g_p].drink_amt = 100;
|
||||
|
||||
if (ps[g_p].GetActor()->s->extra >= gs.max_player_health)
|
||||
if (ps[g_p].GetActor()->spr.extra >= gs.max_player_health)
|
||||
{
|
||||
ps[g_p].GetActor()->s->extra = gs.max_player_health;
|
||||
ps[g_p].GetActor()->spr.extra = gs.max_player_health;
|
||||
ps[g_p].last_extra = gs.max_player_health;
|
||||
}
|
||||
insptr++;
|
||||
|
@ -2005,7 +2005,7 @@ int ParseState::parse(void)
|
|||
case concmd_larrybird:
|
||||
insptr++;
|
||||
ps[g_p].pos.z = ps[g_p].GetActor()->sector()->ceilingz;
|
||||
ps[g_p].GetActor()->s->z = ps[g_p].pos.z;
|
||||
ps[g_p].GetActor()->spr.z = ps[g_p].pos.z;
|
||||
break;
|
||||
case concmd_destroyit:
|
||||
insptr++;
|
||||
|
@ -2021,7 +2021,7 @@ int ParseState::parse(void)
|
|||
ps[g_p].drink_amt -= *insptr;
|
||||
if (ps[g_p].drink_amt < 0)
|
||||
ps[g_p].drink_amt = 0;
|
||||
j = ps[g_p].GetActor()->s->extra;
|
||||
j = ps[g_p].GetActor()->spr.extra;
|
||||
if (g_sp->picnum != TILE_ATOMICHEALTH)
|
||||
{
|
||||
if (j > gs.max_player_health && *insptr > 0)
|
||||
|
@ -2058,7 +2058,7 @@ int ParseState::parse(void)
|
|||
ps[g_p].last_extra = j;
|
||||
}
|
||||
|
||||
ps[g_p].GetActor()->s->extra = j;
|
||||
ps[g_p].GetActor()->spr.extra = j;
|
||||
}
|
||||
|
||||
insptr++;
|
||||
|
@ -2079,12 +2079,12 @@ int ParseState::parse(void)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if (j->s->picnum == TILE_CAMERA1)
|
||||
j->s->yvel = 0;
|
||||
if (j->spr.picnum == TILE_CAMERA1)
|
||||
j->spr.yvel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
j = ps[g_p].GetActor()->s->extra;
|
||||
j = ps[g_p].GetActor()->spr.extra;
|
||||
|
||||
if(g_sp->picnum != TILE_ATOMICHEALTH)
|
||||
{
|
||||
|
@ -2122,7 +2122,7 @@ int ParseState::parse(void)
|
|||
ps[g_p].last_extra = j;
|
||||
}
|
||||
|
||||
ps[g_p].GetActor()->s->extra = j;
|
||||
ps[g_p].GetActor()->spr.extra = j;
|
||||
}
|
||||
|
||||
insptr++;
|
||||
|
@ -2200,9 +2200,9 @@ int ParseState::parse(void)
|
|||
if (l)
|
||||
{
|
||||
if (weap)
|
||||
l->s->yvel = gs.weaponsandammosprites[j % 14];
|
||||
else l->s->yvel = -1;
|
||||
l->s->pal = g_sp->pal;
|
||||
l->spr.yvel = gs.weaponsandammosprites[j % 14];
|
||||
else l->spr.yvel = -1;
|
||||
l->spr.pal = g_sp->pal;
|
||||
}
|
||||
}
|
||||
insptr++;
|
||||
|
@ -2436,7 +2436,7 @@ int ParseState::parse(void)
|
|||
j = 1;
|
||||
else if( (l& pkicking) && ( ps[g_p].quick_kick > 0 || ( ps[g_p].curr_weapon == KNEE_WEAPON && ps[g_p].kickback_pic > 0 ) ) )
|
||||
j = 1;
|
||||
else if( (l& pshrunk) && ps[g_p].GetActor()->s->xrepeat < (isRR() ? 8 : 32))
|
||||
else if( (l& pshrunk) && ps[g_p].GetActor()->spr.xrepeat < (isRR() ? 8 : 32))
|
||||
j = 1;
|
||||
else if( (l& pjetpack) && ps[g_p].jetpack_on )
|
||||
j = 1;
|
||||
|
@ -2444,9 +2444,9 @@ int ParseState::parse(void)
|
|||
j = 1;
|
||||
else if( (l& ponground) && ps[g_p].on_ground)
|
||||
j = 1;
|
||||
else if( (l& palive) && ps[g_p].GetActor()->s->xrepeat > (isRR() ? 8 : 32) && ps[g_p].GetActor()->s->extra > 0 && ps[g_p].timebeforeexit == 0 )
|
||||
else if( (l& palive) && ps[g_p].GetActor()->spr.xrepeat > (isRR() ? 8 : 32) && ps[g_p].GetActor()->spr.extra > 0 && ps[g_p].timebeforeexit == 0 )
|
||||
j = 1;
|
||||
else if( (l& pdead) && ps[g_p].GetActor()->s->extra <= 0)
|
||||
else if( (l& pdead) && ps[g_p].GetActor()->spr.extra <= 0)
|
||||
j = 1;
|
||||
else if( (l& pfacing) )
|
||||
{
|
||||
|
@ -2740,7 +2740,7 @@ int ParseState::parse(void)
|
|||
}
|
||||
case concmd_ifphealthl:
|
||||
insptr++;
|
||||
parseifelse( ps[g_p].GetActor()->s->extra < *insptr);
|
||||
parseifelse( ps[g_p].GetActor()->spr.extra < *insptr);
|
||||
break;
|
||||
|
||||
case concmd_ifpinventory:
|
||||
|
@ -2817,8 +2817,8 @@ int ParseState::parse(void)
|
|||
}
|
||||
case concmd_pstomp:
|
||||
insptr++;
|
||||
if( ps[g_p].knee_incs == 0 && ps[g_p].GetActor()->s->xrepeat >= (isRR()? 9: 40) )
|
||||
if( cansee(g_sp->x,g_sp->y,g_sp->z-(4<<8),g_sp->sector(),ps[g_p].pos.x,ps[g_p].pos.y,ps[g_p].pos.z+(16<<8),ps[g_p].GetActor()->s->sector()) )
|
||||
if( ps[g_p].knee_incs == 0 && ps[g_p].GetActor()->spr.xrepeat >= (isRR()? 9: 40) )
|
||||
if( cansee(g_sp->x,g_sp->y,g_sp->z-(4<<8),g_sp->sector(),ps[g_p].pos.x,ps[g_p].pos.y,ps[g_p].pos.z+(16<<8),ps[g_p].GetActor()->spr.sector()) )
|
||||
{
|
||||
ps[g_p].knee_incs = 1;
|
||||
if(ps[g_p].weapon_pos == 0)
|
||||
|
@ -2967,7 +2967,7 @@ int ParseState::parse(void)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if (j->s->picnum == lType)
|
||||
if (j->spr.picnum == lType)
|
||||
{
|
||||
lTemp = ldist(g_ac, j);
|
||||
if (lTemp < lMaxDist)
|
||||
|
@ -3010,7 +3010,7 @@ int ParseState::parse(void)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if (j->s->picnum == lType)
|
||||
if (j->spr.picnum == lType)
|
||||
{
|
||||
lTemp = ldist(g_ac, j);
|
||||
if (lTemp < lMaxDist)
|
||||
|
@ -3696,7 +3696,7 @@ void LoadActor(DDukeActor *actor, int p, int x)
|
|||
s.g_ac = actor;
|
||||
s.g_t = &s.g_ac->temp_data[0]; // Sprite's 'extra' data
|
||||
|
||||
auto addr = gs.tileinfo[actor->s->picnum].loadeventscriptptr;
|
||||
auto addr = gs.tileinfo[actor->spr.picnum].loadeventscriptptr;
|
||||
if (addr == 0) return;
|
||||
|
||||
s.killit_flag = 0;
|
||||
|
@ -3724,14 +3724,14 @@ void LoadActor(DDukeActor *actor, int p, int x)
|
|||
{
|
||||
fi.move(actor, p, x);
|
||||
|
||||
if (actor->s->statnum == STAT_ACTOR)
|
||||
if (actor->spr.statnum == STAT_ACTOR)
|
||||
{
|
||||
if (badguy(actor))
|
||||
{
|
||||
if (actor->s->xrepeat > 60) return;
|
||||
if (ud.respawn_monsters == 1 && actor->s->extra <= 0) return;
|
||||
if (actor->spr.xrepeat > 60) return;
|
||||
if (ud.respawn_monsters == 1 && actor->spr.extra <= 0) return;
|
||||
}
|
||||
else if (ud.respawn_items == 1 && (actor->s->cstat & CSTAT_SPRITE_INVISIBLE)) return;
|
||||
else if (ud.respawn_items == 1 && (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) return;
|
||||
|
||||
if (actor->timetosleep > 1)
|
||||
actor->timetosleep--;
|
||||
|
@ -3739,7 +3739,7 @@ void LoadActor(DDukeActor *actor, int p, int x)
|
|||
ChangeActorStat(actor, STAT_ZOMBIEACTOR);
|
||||
}
|
||||
|
||||
else if (actor->s->statnum == 6)
|
||||
else if (actor->spr.statnum == 6)
|
||||
{
|
||||
#if 0
|
||||
switch (actor->s.picnum)
|
||||
|
@ -3775,7 +3775,7 @@ void LoadActor(DDukeActor *actor, int p, int x)
|
|||
|
||||
void execute(DDukeActor *actor,int p,int x)
|
||||
{
|
||||
if (gs.actorinfo[actor->s->picnum].scriptaddress == 0) return;
|
||||
if (gs.actorinfo[actor->spr.picnum].scriptaddress == 0) return;
|
||||
|
||||
int done;
|
||||
|
||||
|
@ -3785,8 +3785,8 @@ void execute(DDukeActor *actor,int p,int x)
|
|||
s.g_ac = actor;
|
||||
s.g_t = &actor->temp_data[0]; // Sprite's 'extra' data
|
||||
|
||||
if (gs.actorinfo[actor->s->picnum].scriptaddress == 0) return;
|
||||
s.insptr = &ScriptCode[4 + (gs.actorinfo[actor->s->picnum].scriptaddress)];
|
||||
if (gs.actorinfo[actor->spr.picnum].scriptaddress == 0) return;
|
||||
s.insptr = &ScriptCode[4 + (gs.actorinfo[actor->spr.picnum].scriptaddress)];
|
||||
|
||||
s.killit_flag = 0;
|
||||
|
||||
|
@ -3806,11 +3806,11 @@ void execute(DDukeActor *actor,int p,int x)
|
|||
int increment = ptr[3];
|
||||
int delay = ptr[4];
|
||||
|
||||
actor->s->lotag += TICSPERFRAME;
|
||||
if (actor->s->lotag > delay)
|
||||
actor->spr.lotag += TICSPERFRAME;
|
||||
if (actor->spr.lotag > delay)
|
||||
{
|
||||
s.g_t[2]++;
|
||||
actor->s->lotag = 0;
|
||||
actor->spr.lotag = 0;
|
||||
s.g_t[3] += increment;
|
||||
}
|
||||
if (abs(s.g_t[3]) >= abs(numframes * increment))
|
||||
|
@ -3832,14 +3832,14 @@ void execute(DDukeActor *actor,int p,int x)
|
|||
{
|
||||
fi.move(actor, p, x);
|
||||
|
||||
if (actor->s->statnum == STAT_ACTOR)
|
||||
if (actor->spr.statnum == STAT_ACTOR)
|
||||
{
|
||||
if (badguy(actor))
|
||||
{
|
||||
if (actor->s->xrepeat > 60) goto quit;
|
||||
if (ud.respawn_monsters == 1 && actor->s->extra <= 0) goto quit;
|
||||
if (actor->spr.xrepeat > 60) goto quit;
|
||||
if (ud.respawn_monsters == 1 && actor->spr.extra <= 0) goto quit;
|
||||
}
|
||||
else if (ud.respawn_items == 1 && (actor->s->cstat & CSTAT_SPRITE_INVISIBLE)) goto quit;
|
||||
else if (ud.respawn_items == 1 && (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) goto quit;
|
||||
|
||||
if (actor->timetosleep > 1)
|
||||
actor->timetosleep--;
|
||||
|
@ -3847,7 +3847,7 @@ void execute(DDukeActor *actor,int p,int x)
|
|||
ChangeActorStat(actor, STAT_ZOMBIEACTOR);
|
||||
}
|
||||
|
||||
else if (actor->s->statnum == STAT_STANDABLE)
|
||||
else if (actor->spr.statnum == STAT_STANDABLE)
|
||||
fi.checktimetosleep(actor);
|
||||
}
|
||||
quit:
|
||||
|
|
|
@ -107,7 +107,7 @@ int animatefist(int gs, player_struct* p, double look_anghalf, double looking_ar
|
|||
|
||||
int animateknee(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel, int pal)
|
||||
{
|
||||
if (p->knee_incs > 11 || p->knee_incs == 0 || p->GetActor()->s->extra <= 0) return 0;
|
||||
if (p->knee_incs > 11 || p->knee_incs == 0 || p->GetActor()->spr.extra <= 0) return 0;
|
||||
|
||||
static const int8_t knee_y[] = { 0,-8,-16,-32,-64,-84,-108,-108,-108,-72,-32,-8 };
|
||||
|
||||
|
@ -126,7 +126,7 @@ int animateknee(int gs, player_struct* p, double look_anghalf, double looking_ar
|
|||
|
||||
int animateknuckles(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel, int pal)
|
||||
{
|
||||
if (isWW2GI() || p->over_shoulder_on != 0 || p->knuckle_incs == 0 || p->GetActor()->s->extra <= 0) return 0;
|
||||
if (isWW2GI() || p->over_shoulder_on != 0 || p->knuckle_incs == 0 || p->GetActor()->spr.extra <= 0) return 0;
|
||||
|
||||
static const uint8_t knuckle_frames[] = { 0,1,2,2,3,3,3,2,2,1,0 };
|
||||
|
||||
|
@ -178,7 +178,7 @@ static int animatetip(int gs, player_struct* p, double look_anghalf, double look
|
|||
|
||||
int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_arc, double horiz16th, double plravel)
|
||||
{
|
||||
if(p->access_incs == 0 || p->GetActor()->s->extra <= 0) return 0;
|
||||
if(p->access_incs == 0 || p->GetActor()->spr.extra <= 0) return 0;
|
||||
|
||||
static const int8_t access_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16};
|
||||
|
||||
|
@ -186,7 +186,7 @@ int animateaccess(int gs, player_struct* p, double look_anghalf, double looking_
|
|||
|
||||
int pal;
|
||||
if (p->access_spritenum != nullptr)
|
||||
pal = p->access_spritenum->s->pal;
|
||||
pal = p->access_spritenum->spr.pal;
|
||||
else pal = 0;
|
||||
|
||||
if((p->access_incs-3) > 0 && (p->access_incs-3)>>3)
|
||||
|
@ -241,22 +241,22 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
looking_arc = p->angle.looking_arc(smoothratio);
|
||||
hard_landing *= 8.;
|
||||
|
||||
gun_pos -= fabs(p->GetActor()->s->xrepeat < 32 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10));
|
||||
gun_pos -= fabs(p->GetActor()->spr.xrepeat < 32 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10));
|
||||
gun_pos -= hard_landing;
|
||||
|
||||
weapon_xoffset = (160)-90;
|
||||
weapon_xoffset -= bcosf(weapon_sway * 0.5) * (1. / 1536.);
|
||||
weapon_xoffset -= 58 + p->weapon_ang;
|
||||
|
||||
shade = p->GetActor()->s->shade;
|
||||
shade = p->GetActor()->spr.shade;
|
||||
if(shade > 24) shade = 24;
|
||||
|
||||
pal = !p->insector() ? 0 : p->GetActor()->s->pal == 1 ? 1 : p->cursector->floorpal;
|
||||
pal = !p->insector() ? 0 : p->GetActor()->spr.pal == 1 ? 1 : p->cursector->floorpal;
|
||||
if (pal == 0)
|
||||
pal = p->palookup;
|
||||
|
||||
auto adjusted_arc = looking_arc - hard_landing;
|
||||
bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s->pal != 1 && p->GetActor()->s->extra <= 0);
|
||||
bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->spr.pal != 1 && p->GetActor()->spr.extra <= 0);
|
||||
bool playerAnims = animatefist(shade, p, look_anghalf, looking_arc, plravel, pal) || animateknuckles(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) ||
|
||||
animatetip(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel, pal) || animateaccess(shade, p, look_anghalf, adjusted_arc, horiz16th, plravel);
|
||||
|
||||
|
@ -300,13 +300,13 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
}
|
||||
}
|
||||
|
||||
if (p->GetActor()->s->xrepeat < 40)
|
||||
if (p->GetActor()->spr.xrepeat < 40)
|
||||
{
|
||||
static int fistsign;
|
||||
//shrunken..
|
||||
if (p->jetpack_on == 0)
|
||||
{
|
||||
i = p->GetActor()->s->xvel;
|
||||
i = p->GetActor()->spr.xvel;
|
||||
looking_arc += 32 - (i >> 1);
|
||||
fistsign += i >> 1;
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
gun_pos -= bsinf(kickback_pic * 128., -12);
|
||||
}
|
||||
|
||||
if (*kb > 0 && p->GetActor()->s->pal != 1)
|
||||
if (*kb > 0 && p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += 1 - (rand() & 3);
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
if (*kb > 0)
|
||||
gun_pos -= bsinf(kickback_pic * 128., -12);
|
||||
|
||||
if (*kb > 0 && p->GetActor()->s->pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
||||
if (*kb > 0 && p->GetActor()->spr.pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
||||
|
||||
if (*kb == 0)
|
||||
{
|
||||
|
@ -650,7 +650,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
if (*kb > 0)
|
||||
gun_pos -= bsinf(kickback_pic * 128., -12);
|
||||
|
||||
if (*kb > 0 && p->GetActor()->s->pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
||||
if (*kb > 0 && p->GetActor()->spr.pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
||||
|
||||
hud_drawpal(weapon_xoffset + 168 - look_anghalf, looking_arc + 260 - gun_pos, CHAINGUN, shade, o, pal);
|
||||
switch(*kb)
|
||||
|
@ -662,9 +662,9 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
if (*kb > 4 && *kb < 12)
|
||||
{
|
||||
i = 0;
|
||||
if (p->GetActor()->s->pal != 1) i = rand() & 7;
|
||||
if (p->GetActor()->spr.pal != 1) i = rand() & 7;
|
||||
hud_drawpal(i + weapon_xoffset - 4 + 140 - look_anghalf,i + looking_arc - (kickback_pic / 2.) + 208 - gun_pos, CHAINGUN + 5 + ((*kb - 4) / 5),shade,o,pal);
|
||||
if (p->GetActor()->s->pal != 1) i = rand() & 7;
|
||||
if (p->GetActor()->spr.pal != 1) i = rand() & 7;
|
||||
hud_drawpal(i + weapon_xoffset - 4 + 184 - look_anghalf,i + looking_arc - (kickback_pic / 2.) + 208 - gun_pos, CHAINGUN + 5 + ((*kb - 4) / 5),shade,o,pal);
|
||||
}
|
||||
if (*kb < 8)
|
||||
|
@ -911,7 +911,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
{
|
||||
static const uint8_t cat_frames[] = { 0,0,1,1,2,2 };
|
||||
|
||||
if (p->GetActor()->s->pal != 1)
|
||||
if (p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += rand() & 3;
|
||||
looking_arc += rand() & 3;
|
||||
|
@ -961,7 +961,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
else
|
||||
{
|
||||
// the 'active' display.
|
||||
if (p->GetActor()->s->pal != 1)
|
||||
if (p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += rand() & 3;
|
||||
gun_pos += (rand() & 3);
|
||||
|
@ -1033,7 +1033,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (p->GetActor()->s->pal != 1)
|
||||
if (p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += rand() & 3;
|
||||
gun_pos += (rand() & 3);
|
||||
|
@ -1122,7 +1122,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (p->GetActor()->s->pal != 1)
|
||||
if (p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += rand() & 3;
|
||||
gun_pos += (rand() & 3);
|
||||
|
@ -1166,7 +1166,7 @@ void displayweapon_d(int snum, double smoothratio)
|
|||
else
|
||||
{
|
||||
static const uint8_t cat_frames[] = { 0, 0, 1, 1, 2, 2 };
|
||||
if (p->GetActor()->s->pal != 1)
|
||||
if (p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += krand() & 1;
|
||||
looking_arc += krand() & 1;
|
||||
|
|
|
@ -137,7 +137,7 @@ void displayweapon_r(int snum, double smoothratio)
|
|||
looking_arc = p->angle.looking_arc(smoothratio);
|
||||
hard_landing *= 8.;
|
||||
|
||||
gun_pos -= fabs(p->GetActor()->s->xrepeat < 8 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10));
|
||||
gun_pos -= fabs(p->GetActor()->spr.xrepeat < 8 ? bsinf(weapon_sway * 4., -9) : bsinf(weapon_sway * 0.5, -10));
|
||||
gun_pos -= hard_landing;
|
||||
|
||||
weapon_xoffset = (160)-90;
|
||||
|
@ -147,12 +147,12 @@ void displayweapon_r(int snum, double smoothratio)
|
|||
if (p->insector() && p->cursector->shadedsector == 1)
|
||||
shade = 16;
|
||||
else
|
||||
shade = p->GetActor()->s->shade;
|
||||
shade = p->GetActor()->spr.shade;
|
||||
if(shade > 24) shade = 24;
|
||||
|
||||
pal = !p->insector()? 0 : p->GetActor()->s->pal == 1? 1 : p->cursector->floorpal;
|
||||
pal = !p->insector()? 0 : p->GetActor()->spr.pal == 1? 1 : p->cursector->floorpal;
|
||||
|
||||
if(p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s->pal != 1 && p->GetActor()->s->extra <= 0))
|
||||
if(p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->spr.pal != 1 && p->GetActor()->spr.extra <= 0))
|
||||
return;
|
||||
|
||||
if(p->last_weapon >= 0)
|
||||
|
@ -162,7 +162,7 @@ void displayweapon_r(int snum, double smoothratio)
|
|||
j = 14-p->quick_kick;
|
||||
if(j != 14)
|
||||
{
|
||||
if(p->GetActor()->s->pal == 1)
|
||||
if(p->GetActor()->spr.pal == 1)
|
||||
pal = 1;
|
||||
else
|
||||
pal = p->palookup;
|
||||
|
@ -289,12 +289,12 @@ void displayweapon_r(int snum, double smoothratio)
|
|||
return;
|
||||
}
|
||||
|
||||
if (p->GetActor()->s->xrepeat < 8)
|
||||
if (p->GetActor()->spr.xrepeat < 8)
|
||||
{
|
||||
static int fistsign;
|
||||
if (p->jetpack_on == 0)
|
||||
{
|
||||
i = p->GetActor()->s->xvel;
|
||||
i = p->GetActor()->spr.xvel;
|
||||
looking_arc += 32 - (i >> 1);
|
||||
fistsign += i >> 1;
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ void displayweapon_r(int snum, double smoothratio)
|
|||
if (*kb > 0)
|
||||
gun_pos -= bsinf((*kb) << 7, -12);
|
||||
|
||||
if (*kb > 0 && p->GetActor()->s->pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
||||
if (*kb > 0 && p->GetActor()->spr.pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
||||
|
||||
switch (*kb)
|
||||
{
|
||||
|
@ -812,7 +812,7 @@ void displayweapon_r(int snum, double smoothratio)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (p->GetActor()->s->pal != 1)
|
||||
if (p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
weapon_xoffset += rand() & 3;
|
||||
gun_pos += (rand() & 3);
|
||||
|
|
|
@ -39,7 +39,7 @@ inline int bossguy(spritetype const* const pSprite)
|
|||
|
||||
inline int actorflag(DDukeActor * actor, int mask)
|
||||
{
|
||||
return (((gs.actorinfo[actor->s->picnum].flags) & mask) != 0);
|
||||
return (((gs.actorinfo[actor->spr.picnum].flags) & mask) != 0);
|
||||
}
|
||||
|
||||
inline int actorfella(DDukeActor* actor)
|
||||
|
@ -70,14 +70,14 @@ inline void settileflag(int flag, const std::initializer_list<short>& types)
|
|||
|
||||
inline bool wallswitchcheck(DDukeActor* s)
|
||||
{
|
||||
return !!(gs.tileinfo[s->s->picnum].flags & TFLAG_WALLSWITCH);
|
||||
return !!(gs.tileinfo[s->spr.picnum].flags & TFLAG_WALLSWITCH);
|
||||
}
|
||||
|
||||
inline int checkcursectnums(sectortype* se)
|
||||
{
|
||||
int i;
|
||||
for(i=connecthead;i>=0;i=connectpoint2[i])
|
||||
if(ps[i].GetActor() && ps[i].GetActor()->s->sector() == se ) return i;
|
||||
if(ps[i].GetActor() && ps[i].GetActor()->spr.sector() == se ) return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,18 +77,18 @@ void hud_input(int plnum)
|
|||
{
|
||||
if (PlayerInput(plnum, SB_QUICK_KICK) && p->last_pissed_time == 0)
|
||||
{
|
||||
if (!isRRRA() || p->GetActor()->s->extra > 0)
|
||||
if (!isRRRA() || p->GetActor()->spr.extra > 0)
|
||||
{
|
||||
p->last_pissed_time = 4000;
|
||||
S_PlayActorSound(437, pact);
|
||||
if (p->GetActor()->s->extra <= gs.max_player_health - gs.max_player_health / 10)
|
||||
if (p->GetActor()->spr.extra <= gs.max_player_health - gs.max_player_health / 10)
|
||||
{
|
||||
p->GetActor()->s->extra += 2;
|
||||
p->last_extra = p->GetActor()->s->extra;
|
||||
p->GetActor()->spr.extra += 2;
|
||||
p->last_extra = p->GetActor()->spr.extra;
|
||||
p->resurrected = true;
|
||||
}
|
||||
else if (p->GetActor()->s->extra < gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
else if (p->GetActor()->spr.extra < gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ void hud_input(int plnum)
|
|||
|
||||
// Don't go on if paused or dead.
|
||||
if (paused) return;
|
||||
if (p->GetActor()->s->extra <= 0) return;
|
||||
if (p->GetActor()->spr.extra <= 0) return;
|
||||
|
||||
// Activate an inventory item. This just forwards to the other inventory bits. If the inventory selector was taken out of the playsim this could be removed.
|
||||
if (PlayerInput(plnum, SB_INVUSE) && p->newOwner == nullptr)
|
||||
|
@ -290,8 +290,8 @@ void hud_input(int plnum)
|
|||
p->pos.z + (30 << 8), TILE_APLAYER, -64, 0, 0, p->angle.ang.asbuild(), 0, 0, nullptr, 10);
|
||||
pactor->temp_data[3] = pactor->temp_data[4] = 0;
|
||||
p->holoduke_on = pactor;
|
||||
pactor->s->yvel = plnum;
|
||||
pactor->s->extra = 0;
|
||||
pactor->spr.yvel = plnum;
|
||||
pactor->spr.extra = 0;
|
||||
FTA(QUOTE_HOLODUKE_ON, p);
|
||||
S_PlayActorSound(TELEPORTER, p->holoduke_on);
|
||||
}
|
||||
|
@ -307,12 +307,12 @@ void hud_input(int plnum)
|
|||
}
|
||||
else // In RR this means drinking whiskey.
|
||||
{
|
||||
if (p->holoduke_amount > 0 && p->GetActor()->s->extra < gs.max_player_health)
|
||||
if (p->holoduke_amount > 0 && p->GetActor()->spr.extra < gs.max_player_health)
|
||||
{
|
||||
p->holoduke_amount -= 400;
|
||||
p->GetActor()->s->extra += 5;
|
||||
if (p->GetActor()->s->extra > gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
p->GetActor()->spr.extra += 5;
|
||||
if (p->GetActor()->spr.extra > gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
|
||||
p->drink_amt += 5;
|
||||
p->inven_icon = 3;
|
||||
|
@ -340,18 +340,18 @@ void hud_input(int plnum)
|
|||
madenoise(plnum);
|
||||
if (p->cursector->lotag == 857)
|
||||
{
|
||||
if (p->GetActor()->s->extra <= gs.max_player_health)
|
||||
if (p->GetActor()->spr.extra <= gs.max_player_health)
|
||||
{
|
||||
p->GetActor()->s->extra += 10;
|
||||
if (p->GetActor()->s->extra >= gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
p->GetActor()->spr.extra += 10;
|
||||
if (p->GetActor()->spr.extra >= gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (p->GetActor()->s->extra + 1 <= gs.max_player_health)
|
||||
if (p->GetActor()->spr.extra + 1 <= gs.max_player_health)
|
||||
{
|
||||
p->GetActor()->s->extra++;
|
||||
p->GetActor()->spr.extra++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -364,21 +364,21 @@ void hud_input(int plnum)
|
|||
OnEvent(EVENT_USEMEDKIT, plnum, nullptr, -1);
|
||||
if (GetGameVarID(g_iReturnVarID, nullptr, plnum).value() == 0)
|
||||
{
|
||||
if (p->firstaid_amount > 0 && p->GetActor()->s->extra < gs.max_player_health)
|
||||
if (p->firstaid_amount > 0 && p->GetActor()->spr.extra < gs.max_player_health)
|
||||
{
|
||||
if (!isRR())
|
||||
{
|
||||
int j = gs.max_player_health - p->GetActor()->s->extra;
|
||||
int j = gs.max_player_health - p->GetActor()->spr.extra;
|
||||
|
||||
if (p->firstaid_amount > j)
|
||||
{
|
||||
p->firstaid_amount -= j;
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
p->inven_icon = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->GetActor()->s->extra += p->firstaid_amount;
|
||||
p->GetActor()->spr.extra += p->firstaid_amount;
|
||||
p->firstaid_amount = 0;
|
||||
checkavailinven(p);
|
||||
}
|
||||
|
@ -390,19 +390,19 @@ void hud_input(int plnum)
|
|||
if (p->firstaid_amount > j)
|
||||
{
|
||||
p->firstaid_amount -= j;
|
||||
p->GetActor()->s->extra += j;
|
||||
if (p->GetActor()->s->extra > gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
p->GetActor()->spr.extra += j;
|
||||
if (p->GetActor()->spr.extra > gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
p->inven_icon = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->GetActor()->s->extra += p->firstaid_amount;
|
||||
p->GetActor()->spr.extra += p->firstaid_amount;
|
||||
p->firstaid_amount = 0;
|
||||
checkavailinven(p);
|
||||
}
|
||||
if (p->GetActor()->s->extra > gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
if (p->GetActor()->spr.extra > gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
p->drink_amt += 10;
|
||||
if (p->drink_amt <= 100 && !S_CheckActorSoundPlaying(pact, DUKE_USEMEDKIT))
|
||||
S_PlayActorSound(DUKE_USEMEDKIT, pact);
|
||||
|
@ -445,7 +445,7 @@ void hud_input(int plnum)
|
|||
else
|
||||
{
|
||||
// eat cow pie
|
||||
if (p->jetpack_amount > 0 && p->GetActor()->s->extra < gs.max_player_health)
|
||||
if (p->jetpack_amount > 0 && p->GetActor()->spr.extra < gs.max_player_health)
|
||||
{
|
||||
if (!S_CheckActorSoundPlaying(pact, 429))
|
||||
S_PlayActorSound(429, pact);
|
||||
|
@ -465,12 +465,12 @@ void hud_input(int plnum)
|
|||
p->eat = 100;
|
||||
}
|
||||
|
||||
p->GetActor()->s->extra += 5;
|
||||
p->GetActor()->spr.extra += 5;
|
||||
|
||||
p->inven_icon = 4;
|
||||
|
||||
if (p->GetActor()->s->extra > gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
if (p->GetActor()->spr.extra > gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
|
||||
if (p->jetpack_amount <= 0)
|
||||
checkavailinven(p);
|
||||
|
@ -773,7 +773,7 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I
|
|||
|
||||
static void FinalizeInput(player_struct *p, InputPacket& input)
|
||||
{
|
||||
if (gamestate != GS_LEVEL || movementBlocked(p) || p->GetActor()->s->extra <= 0 || (p->dead_flag && !ud.god && !p->resurrected))
|
||||
if (gamestate != GS_LEVEL || movementBlocked(p) || p->GetActor()->spr.extra <= 0 || (p->dead_flag && !ud.god && !p->resurrected))
|
||||
{
|
||||
// neutralize all movement when not in a game, blocked or in automap follow mode
|
||||
loc.fvel = loc.svel = 0;
|
||||
|
@ -833,7 +833,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
|
||||
if (!SyncInput())
|
||||
{
|
||||
if (p->GetActor()->s->extra > 0)
|
||||
if (p->GetActor()->spr.extra > 0)
|
||||
{
|
||||
// Do these in the same order as the old code.
|
||||
doslopetilting(p, scaleAdjust);
|
||||
|
@ -844,7 +844,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
|
||||
p->angle.processhelpers(scaleAdjust);
|
||||
p->horizon.processhelpers(scaleAdjust);
|
||||
p->GetActor()->s->ang = p->angle.ang.asbuild();
|
||||
p->GetActor()->spr.ang = p->angle.ang.asbuild();
|
||||
}
|
||||
|
||||
if (packet)
|
||||
|
|
|
@ -68,8 +68,8 @@ void PlayerColorChanged(void)
|
|||
{
|
||||
pp.palookup = ud.user_pals[myconnectindex] = playercolor2lookup(playercolor);
|
||||
}
|
||||
if (pp.GetActor()->s->picnum == TILE_APLAYER && pp.GetActor()->s->pal != 1)
|
||||
pp.GetActor()->s->pal = ud.user_pals[myconnectindex];
|
||||
if (pp.GetActor()->spr.picnum == TILE_APLAYER && pp.GetActor()->spr.pal != 1)
|
||||
pp.GetActor()->spr.pal = ud.user_pals[myconnectindex];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -101,8 +101,8 @@ void quickkill(struct player_struct* p)
|
|||
SetPlayerPal(p, PalEntry(48, 48, 48, 48));
|
||||
|
||||
auto pa = p->GetActor();
|
||||
pa->s->extra = 0;
|
||||
pa->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
pa->spr.extra = 0;
|
||||
pa->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
if (ud.god == 0) fi.guts(pa, TILE_JIBS6, 8, myconnectindex);
|
||||
return;
|
||||
}
|
||||
|
@ -376,16 +376,16 @@ void dokneeattack(int snum, const std::initializer_list<int> & respawnlist)
|
|||
fi.guts(p->actorsqu, TILE_JIBS6, 7, myconnectindex);
|
||||
spawn(p->actorsqu, TILE_BLOODPOOL);
|
||||
S_PlayActorSound(SQUISHED, p->actorsqu);
|
||||
if (isIn(p->actorsqu->s->picnum, respawnlist))
|
||||
if (isIn(p->actorsqu->spr.picnum, respawnlist))
|
||||
{
|
||||
if (p->actorsqu->s->yvel)
|
||||
fi.operaterespawns(p->actorsqu->s->yvel);
|
||||
if (p->actorsqu->spr.yvel)
|
||||
fi.operaterespawns(p->actorsqu->spr.yvel);
|
||||
}
|
||||
|
||||
if (p->actorsqu->s->picnum == TILE_APLAYER)
|
||||
if (p->actorsqu->spr.picnum == TILE_APLAYER)
|
||||
{
|
||||
quickkill(&ps[p->actorsqu->s->yvel]);
|
||||
ps[p->actorsqu->s->yvel].frag_ps = snum;
|
||||
quickkill(&ps[p->actorsqu->spr.yvel]);
|
||||
ps[p->actorsqu->spr.yvel].frag_ps = snum;
|
||||
}
|
||||
else if (badguy(p->actorsqu->s))
|
||||
{
|
||||
|
@ -493,9 +493,9 @@ void footprints(int snum)
|
|||
DukeSectIterator it(s->sector());
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == TILE_FOOTPRINTS || act->s->picnum == TILE_FOOTPRINTS2 || act->s->picnum == TILE_FOOTPRINTS3 || act->s->picnum == TILE_FOOTPRINTS4)
|
||||
if (abs(act->s->x - p->pos.x) < 384)
|
||||
if (abs(act->s->y - p->pos.y) < 384)
|
||||
if (act->spr.picnum == TILE_FOOTPRINTS || act->spr.picnum == TILE_FOOTPRINTS2 || act->spr.picnum == TILE_FOOTPRINTS3 || act->spr.picnum == TILE_FOOTPRINTS4)
|
||||
if (abs(act->spr.x - p->pos.x) < 384)
|
||||
if (abs(act->spr.y - p->pos.y) < 384)
|
||||
{
|
||||
j = 1;
|
||||
break;
|
||||
|
@ -516,8 +516,8 @@ void footprints(int snum)
|
|||
}
|
||||
if (fprint)
|
||||
{
|
||||
fprint->s->pal = p->footprintpal;
|
||||
fprint->s->shade = (int8_t)p->footprintshade;
|
||||
fprint->spr.pal = p->footprintpal;
|
||||
fprint->spr.shade = (int8_t)p->footprintshade;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1019,7 +1019,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
|
|||
DukeSectIterator it(hit.hitWall->nextSector());
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->statnum == STAT_EFFECTOR && act2->s->lotag == SE_13_EXPLOSIVE)
|
||||
if (act2->spr.statnum == STAT_EFFECTOR && act2->spr.lotag == SE_13_EXPLOSIVE)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1033,17 +1033,17 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
|
|||
auto spawned = spawn(actor, atwith);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->xvel = -12;
|
||||
spawned->spr.xvel = -12;
|
||||
auto delta = hit.hitWall->delta();
|
||||
spawned->s->ang = getangle(-delta.x, -delta.y) + 512; // note the '-' sign here!
|
||||
spawned->s->x = hit.hitpos.x;
|
||||
spawned->s->y = hit.hitpos.y;
|
||||
spawned->s->z = hit.hitpos.z;
|
||||
spawned->s->cstat |= randomXFlip();
|
||||
spawned->spr.ang = getangle(-delta.x, -delta.y) + 512; // note the '-' sign here!
|
||||
spawned->spr.x = hit.hitpos.x;
|
||||
spawned->spr.y = hit.hitpos.y;
|
||||
spawned->spr.z = hit.hitpos.z;
|
||||
spawned->spr.cstat |= randomXFlip();
|
||||
ssp(spawned, CLIPMASK0);
|
||||
SetActor(spawned, spawned->s->pos);
|
||||
SetActor(spawned, spawned->spr.pos);
|
||||
if (s->picnum == OOZFILTER || s->picnum == NEWBEAST)
|
||||
spawned->s->pal = 6;
|
||||
spawned->spr.pal = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1220,7 +1220,7 @@ DEFINE_FIELD_X(DukePlayer, player_struct, holoduke_on)
|
|||
DEFINE_ACTION_FUNCTION(_DukePlayer, IsFrozen)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(player_struct);
|
||||
ACTION_RETURN_BOOL(self->GetActor()->s->pal == 1 && self->last_extra < 2);
|
||||
ACTION_RETURN_BOOL(self->GetActor()->spr.pal == 1 && self->last_extra < 2);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_DukePlayer, GetGameVar)
|
||||
|
|
|
@ -54,9 +54,9 @@ void incur_damage_d(struct player_struct* p)
|
|||
{
|
||||
int damage = 0L, shield_damage = 0L;
|
||||
|
||||
p->GetActor()->s->extra -= p->extra_extra8 >> 8;
|
||||
p->GetActor()->spr.extra -= p->extra_extra8 >> 8;
|
||||
|
||||
damage = p->GetActor()->s->extra - p->last_extra;
|
||||
damage = p->GetActor()->spr.extra - p->last_extra;
|
||||
|
||||
if (damage < 0)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ void incur_damage_d(struct player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
p->GetActor()->s->extra = p->last_extra + damage;
|
||||
p->GetActor()->spr.extra = p->last_extra + damage;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,10 +185,10 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
|
|||
else
|
||||
{
|
||||
zvel = -MulScale(ps[p].horizon.sum().asq16(), 81, 16);
|
||||
if (ps[p].GetActor()->s->xvel != 0)
|
||||
if (ps[p].GetActor()->spr.xvel != 0)
|
||||
vel = (int)((((512 - (1024
|
||||
- abs(abs(getangle(sx - ps[p].oposx, sy - ps[p].oposy) - sa) - 1024)))
|
||||
* 0.001953125f) * ps[p].GetActor()->s->xvel) + 400);
|
||||
* 0.001953125f) * ps[p].GetActor()->spr.xvel) + 400);
|
||||
if (s->sector()->lotag == 2 && (krand() % 5) == 0)
|
||||
spawned = spawn(actor, WATERBUBBLE);
|
||||
}
|
||||
|
@ -197,30 +197,30 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, int sx, int sy, int
|
|||
{
|
||||
spawned = spawn(actor, FLAMETHROWERFLAME);
|
||||
if (!spawned) return;
|
||||
spawned->s->xvel = (short)vel;
|
||||
spawned->s->zvel = (short)zvel;
|
||||
spawned->spr.xvel = (short)vel;
|
||||
spawned->spr.zvel = (short)zvel;
|
||||
}
|
||||
|
||||
spawned->s->x = sx + bsin(sa + 630) / 448;
|
||||
spawned->s->y = sy + bsin(sa + 112) / 448;
|
||||
spawned->s->z = sz - 256;
|
||||
spawned->s->setsector(s->sector());
|
||||
spawned->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->s->ang = sa;
|
||||
spawned->s->xrepeat = 2;
|
||||
spawned->s->yrepeat = 2;
|
||||
spawned->s->clipdist = 40;
|
||||
spawned->s->yvel = p;
|
||||
spawned->spr.x = sx + bsin(sa + 630) / 448;
|
||||
spawned->spr.y = sy + bsin(sa + 112) / 448;
|
||||
spawned->spr.z = sz - 256;
|
||||
spawned->spr.setsector(s->sector());
|
||||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.ang = sa;
|
||||
spawned->spr.xrepeat = 2;
|
||||
spawned->spr.yrepeat = 2;
|
||||
spawned->spr.clipdist = 40;
|
||||
spawned->spr.yvel = p;
|
||||
spawned->SetOwner(actor);
|
||||
|
||||
if (p == -1)
|
||||
{
|
||||
if (s->picnum == BOSS5)
|
||||
{
|
||||
spawned->s->x -= bsin(sa) / 56;
|
||||
spawned->s->y += bcos(sa) / 56;
|
||||
spawned->s->xrepeat = 10;
|
||||
spawned->s->yrepeat = 10;
|
||||
spawned->spr.x -= bsin(sa) / 56;
|
||||
spawned->spr.y += bcos(sa) / 56;
|
||||
spawned->spr.xrepeat = 10;
|
||||
spawned->spr.yrepeat = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,8 +248,8 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
{
|
||||
int x;
|
||||
auto pactor = ps[findplayer(actor, &x)].GetActor();
|
||||
zvel = ((pactor->s->z - sz) << 8) / (x + 1);
|
||||
sa = getangle(pactor->s->x - sx, pactor->s->y - sy);
|
||||
zvel = ((pactor->spr.z - sz) << 8) / (x + 1);
|
||||
sa = getangle(pactor->spr.x - sx, pactor->spr.y - sy);
|
||||
}
|
||||
|
||||
hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
|
||||
|
@ -264,18 +264,18 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
auto knee = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4);
|
||||
if (knee)
|
||||
{
|
||||
knee->s->extra += (krand() & 7);
|
||||
knee->spr.extra += (krand() & 7);
|
||||
if (p >= 0)
|
||||
{
|
||||
auto k = spawn(knee, SMALLSMOKE);
|
||||
if (k) k->s->z -= (8 << 8);
|
||||
if (k) k->spr.z -= (8 << 8);
|
||||
S_PlayActorSound(KICK_HIT, knee);
|
||||
}
|
||||
|
||||
if (p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400)
|
||||
knee->s->extra += (gs.max_player_health >> 2);
|
||||
knee->spr.extra += (gs.max_player_health >> 2);
|
||||
}
|
||||
if (hit.actor() && hit.actor()->s->picnum != ACCESSSWITCH && hit.actor()->s->picnum != ACCESSSWITCH2)
|
||||
if (hit.actor() && hit.actor()->spr.picnum != ACCESSSWITCH && hit.actor()->spr.picnum != ACCESSSWITCH2)
|
||||
{
|
||||
fi.checkhitsprite(hit.actor(), knee);
|
||||
if (p >= 0) fi.checkhitswitch(p, nullptr, hit.actor());
|
||||
|
@ -300,12 +300,12 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
auto splash = spawn(ps[p].GetActor(), WATERSPLASH2);
|
||||
if (splash)
|
||||
{
|
||||
splash->s->x = hit.hitpos.x;
|
||||
splash->s->y = hit.hitpos.y;
|
||||
splash->s->ang = ps[p].angle.ang.asbuild(); // Total tweek
|
||||
splash->s->xvel = 32;
|
||||
splash->spr.x = hit.hitpos.x;
|
||||
splash->spr.y = hit.hitpos.y;
|
||||
splash->spr.ang = ps[p].angle.ang.asbuild(); // Total tweek
|
||||
splash->spr.xvel = 32;
|
||||
ssp(actor, CLIPMASK0);
|
||||
splash->s->xvel = 0;
|
||||
splash->spr.xvel = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -340,8 +340,8 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) + (5 << 8);
|
||||
switch (aimed->s->picnum)
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) + (5 << 8);
|
||||
switch (aimed->spr.picnum)
|
||||
{
|
||||
case GREENSLIME:
|
||||
case GREENSLIME + 1:
|
||||
|
@ -355,8 +355,8 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
dal -= (8 << 8);
|
||||
break;
|
||||
}
|
||||
zvel = ((aimed->s->z - sz - dal) << 8) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
zvel = ((aimed->spr.z - sz - dal) << 8) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
|
||||
if (isWW2GI())
|
||||
|
@ -420,8 +420,8 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
spark = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4);
|
||||
if (!spark) return;
|
||||
|
||||
spark->s->extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
spark->s->extra += (krand() % 6);
|
||||
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
spark->spr.extra += (krand() % 6);
|
||||
|
||||
if (hit.hitWall == nullptr && hit.actor() == nullptr)
|
||||
{
|
||||
|
@ -429,8 +429,8 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
if (hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY)
|
||||
{
|
||||
spark->s->xrepeat = 0;
|
||||
spark->s->yrepeat = 0;
|
||||
spark->spr.xrepeat = 0;
|
||||
spark->spr.yrepeat = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -442,29 +442,29 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
if (hit.actor())
|
||||
{
|
||||
fi.checkhitsprite(hit.actor(), spark);
|
||||
if (hit.actor()->s->picnum == TILE_APLAYER && (ud.coop != 1 || ud.ffire == 1))
|
||||
if (hit.actor()->spr.picnum == TILE_APLAYER && (ud.coop != 1 || ud.ffire == 1))
|
||||
{
|
||||
spark->s->xrepeat = spark->s->yrepeat = 0;
|
||||
spark->spr.xrepeat = spark->spr.yrepeat = 0;
|
||||
auto jib = spawn(spark, JIBS6);
|
||||
if (jib)
|
||||
{
|
||||
jib->s->z += (4 << 8);
|
||||
jib->s->xvel = 16;
|
||||
jib->s->xrepeat = jib->s->yrepeat = 24;
|
||||
jib->s->ang += 64 - (krand() & 127);
|
||||
jib->spr.z += (4 << 8);
|
||||
jib->spr.xvel = 16;
|
||||
jib->spr.xrepeat = jib->spr.yrepeat = 24;
|
||||
jib->spr.ang += 64 - (krand() & 127);
|
||||
}
|
||||
}
|
||||
else spawn(spark, SMALLSMOKE);
|
||||
|
||||
if (p >= 0 && (
|
||||
hit.actor()->s->picnum == DIPSWITCH ||
|
||||
hit.actor()->s->picnum == DIPSWITCH + 1 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH2 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH2 + 1 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH3 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH3 + 1 ||
|
||||
hit.actor()->s->picnum == HANDSWITCH ||
|
||||
hit.actor()->s->picnum == HANDSWITCH + 1))
|
||||
hit.actor()->spr.picnum == DIPSWITCH ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH + 1 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH2 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH2 + 1 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH3 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH3 + 1 ||
|
||||
hit.actor()->spr.picnum == HANDSWITCH ||
|
||||
hit.actor()->spr.picnum == HANDSWITCH + 1))
|
||||
{
|
||||
fi.checkhitswitch(p, nullptr, hit.actor());
|
||||
return;
|
||||
|
@ -504,7 +504,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeSectIterator it(hit.hitWall->nextSector());
|
||||
while (auto l = it.Next())
|
||||
{
|
||||
if (l->s->statnum == 3 && l->s->lotag == 13)
|
||||
if (l->spr.statnum == 3 && l->spr.lotag == 13)
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
}
|
||||
|
@ -512,16 +512,16 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeStatIterator it(STAT_MISC);
|
||||
while (auto l = it.Next())
|
||||
{
|
||||
if (l->s->picnum == BULLETHOLE)
|
||||
if (l->spr.picnum == BULLETHOLE)
|
||||
if (dist(l, spark) < (12 + (krand() & 7)))
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
auto hole = spawn(spark, BULLETHOLE);
|
||||
if (hole)
|
||||
{
|
||||
hole->s->xvel = -1;
|
||||
hole->spr.xvel = -1;
|
||||
auto delta = hit.hitWall->delta();
|
||||
hole->s->ang = getangle(-delta.x, -delta.y) + 512;
|
||||
hole->spr.ang = getangle(-delta.x, -delta.y) + 512;
|
||||
ssp(hole, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -541,14 +541,14 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
spark = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4);
|
||||
if (spark)
|
||||
{
|
||||
spark->s->extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
|
||||
if (hit.actor())
|
||||
{
|
||||
fi.checkhitsprite(hit.actor(), spark);
|
||||
if (hit.actor()->s->picnum != TILE_APLAYER)
|
||||
if (hit.actor()->spr.picnum != TILE_APLAYER)
|
||||
spawn(spark, SMALLSMOKE);
|
||||
else spark->s->xrepeat = spark->s->yrepeat = 0;
|
||||
else spark->spr.xrepeat = spark->spr.yrepeat = 0;
|
||||
}
|
||||
else if (hit.hitWall)
|
||||
fi.checkhitwall(spark, hit.hitWall, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SHOTSPARK1);
|
||||
|
@ -600,9 +600,9 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) - (12 << 8);
|
||||
zvel = ((aimed->s->z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) - (12 << 8);
|
||||
zvel = ((aimed->spr.z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else
|
||||
zvel = -MulScale(ps[p].horizon.sum().asq16(), 98, 16);
|
||||
|
@ -649,23 +649,23 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
{
|
||||
auto spawned = EGS(sect, sx, sy, sz, atwith, -127, sizx, sizy, sa, vel, zvel, actor, 4);
|
||||
if (!spawned) return;
|
||||
spawned->s->extra += (krand() & 7);
|
||||
spawned->spr.extra += (krand() & 7);
|
||||
|
||||
if (atwith == COOLEXPLOSION1)
|
||||
{
|
||||
spawned->s->shade = 0;
|
||||
spawned->spr.shade = 0;
|
||||
if (s->picnum == BOSS2)
|
||||
{
|
||||
l = spawned->s->xvel;
|
||||
spawned->s->xvel = 1024;
|
||||
l = spawned->spr.xvel;
|
||||
spawned->spr.xvel = 1024;
|
||||
ssp(spawned, CLIPMASK0);
|
||||
spawned->s->xvel = l;
|
||||
spawned->s->ang += 128 - (krand() & 255);
|
||||
spawned->spr.xvel = l;
|
||||
spawned->spr.ang += 128 - (krand() & 255);
|
||||
}
|
||||
}
|
||||
|
||||
spawned->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->s->clipdist = 4;
|
||||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.clipdist = 4;
|
||||
|
||||
sa = s->ang + 32 - (krand() & 63);
|
||||
zvel = oldzvel + 512 - (krand() & 1023);
|
||||
|
@ -699,10 +699,10 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
|
|||
aimed = aim(actor, 48);
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) + (8 << 8);
|
||||
zvel = ((aimed->s->z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
if (aimed->s->picnum != RECON)
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) + (8 << 8);
|
||||
zvel = ((aimed->spr.z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
if (aimed->spr.picnum != RECON)
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else zvel = -MulScale(ps[p].horizon.sum().asq16(), 81, 16);
|
||||
if (atwith == RPG)
|
||||
|
@ -718,7 +718,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
|
|||
{
|
||||
int zoffs = (32 << 8);
|
||||
if (isWorldTour()) // Twentieth Anniversary World Tour
|
||||
zoffs = (int)((actor->s->yrepeat / 80.0f) * zoffs);
|
||||
zoffs = (int)((actor->spr.yrepeat / 80.0f) * zoffs);
|
||||
sz -= zoffs;
|
||||
}
|
||||
else if (s->picnum == BOSS2)
|
||||
|
@ -726,7 +726,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
|
|||
vel += 128;
|
||||
int zoffs = 24 << 8;
|
||||
if (isWorldTour()) // Twentieth Anniversary World Tour
|
||||
zoffs = (int)((actor->s->yrepeat / 80.0f) * zoffs);
|
||||
zoffs = (int)((actor->spr.yrepeat / 80.0f) * zoffs);
|
||||
sz += zoffs;
|
||||
}
|
||||
|
||||
|
@ -774,7 +774,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
|
|||
|
||||
if (isWorldTour()) // Twentieth Anniversary World Tour
|
||||
{
|
||||
float siz = actor->s->yrepeat / 80.0f;
|
||||
float siz = actor->spr.yrepeat / 80.0f;
|
||||
xoffs = int(xoffs * siz);
|
||||
yoffs = int(yoffs * siz);
|
||||
aoffs = int(aoffs * siz);
|
||||
|
@ -794,7 +794,7 @@ static void shootrpg(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, i
|
|||
int aoffs = 8 + (krand() & 255) - 128;
|
||||
|
||||
if (isWorldTour()) { // Twentieth Anniversary World Tour
|
||||
int siz = actor->s->yrepeat;
|
||||
int siz = actor->spr.yrepeat;
|
||||
xoffs = Scale(xoffs, siz, 80);
|
||||
yoffs = Scale(yoffs, siz, 80);
|
||||
aoffs = Scale(aoffs, siz, 80);
|
||||
|
@ -890,7 +890,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
int lLifetime = GetGameVar("STICKYBOMB_LIFETIME", NAM_GRENADE_LIFETIME, nullptr, p).value();
|
||||
int lLifetimeVar = GetGameVar("STICKYBOMB_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, nullptr, p).value();
|
||||
// set timer. blows up when at zero....
|
||||
bomb->s->extra = lLifetime
|
||||
bomb->spr.extra = lLifetime
|
||||
+ MulScale(krand(), lLifetimeVar, 14)
|
||||
- lLifetimeVar;
|
||||
}
|
||||
|
@ -899,13 +899,13 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
// this originally used the sprite index as tag to link the laser segments.
|
||||
// This value is never used again to reference an actor by index. Decouple this for robustness.
|
||||
ud.bomb_tag = (ud.bomb_tag + 1) & 32767;
|
||||
bomb->s->hitag = ud.bomb_tag;
|
||||
bomb->spr.hitag = ud.bomb_tag;
|
||||
S_PlayActorSound(LASERTRIP_ONWALL, bomb);
|
||||
bomb->s->xvel = -20;
|
||||
bomb->spr.xvel = -20;
|
||||
ssp(bomb, CLIPMASK0);
|
||||
bomb->s->cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
auto delta = hit.hitWall->delta();
|
||||
bomb->temp_data[5] = bomb->s->ang = getangle(-delta.x, -delta.y) - 512;
|
||||
bomb->temp_data[5] = bomb->spr.ang = getangle(-delta.x, -delta.y) - 512;
|
||||
|
||||
if (p >= 0)
|
||||
ps[p].ammo_amount[TRIPBOMB_WEAPON]--;
|
||||
|
@ -932,8 +932,8 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
|
|||
auto aimed = aim(actor, AUTO_AIM_ANGLE);
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) + (5 << 8);
|
||||
switch (aimed->s->picnum)
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) + (5 << 8);
|
||||
switch (aimed->spr.picnum)
|
||||
{
|
||||
case GREENSLIME:
|
||||
case GREENSLIME + 1:
|
||||
|
@ -947,8 +947,8 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
|
|||
dal -= (8 << 8);
|
||||
break;
|
||||
}
|
||||
zvel = ((aimed->s->z - sz - dal) << 8) / (ldist(ps[p].GetActor(), aimed));
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
zvel = ((aimed->spr.z - sz - dal) << 8) / (ldist(ps[p].GetActor(), aimed));
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -981,9 +981,9 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
|
|||
auto spark = EGS(sect, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, GROWSPARK, -16, 28, 28, sa, 0, 0, actor, 1);
|
||||
if (!spark) return;
|
||||
|
||||
spark->s->pal = 2;
|
||||
spark->s->cstat |= CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
|
||||
spark->s->xrepeat = spark->s->yrepeat = 1;
|
||||
spark->spr.pal = 2;
|
||||
spark->spr.cstat |= CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
|
||||
spark->spr.xrepeat = spark->spr.yrepeat = 1;
|
||||
|
||||
if (hit.hitWall == nullptr && hit.actor() == nullptr && hit.hitSector != nullptr)
|
||||
{
|
||||
|
@ -1077,13 +1077,13 @@ void shoot_d(DDukeActor* actor, int atwith)
|
|||
auto k = spawn(actor, atwith);
|
||||
if (k)
|
||||
{
|
||||
k->s->setsector(sect);
|
||||
k->s->x = sx;
|
||||
k->s->y = sy;
|
||||
k->s->z = sz;
|
||||
k->s->ang = sa;
|
||||
k->s->xvel = 500;
|
||||
k->s->zvel = 0;
|
||||
k->spr.setsector(sect);
|
||||
k->spr.x = sx;
|
||||
k->spr.y = sy;
|
||||
k->spr.z = sz;
|
||||
k->spr.ang = sa;
|
||||
k->spr.xvel = 500;
|
||||
k->spr.zvel = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1159,9 +1159,9 @@ void shoot_d(DDukeActor* actor, int atwith)
|
|||
auto aimed = isNamWW2GI() ? nullptr : aim(actor, AUTO_AIM_ANGLE);
|
||||
if (aimed)
|
||||
{
|
||||
dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1);
|
||||
zvel = ((aimed->s->z - sz - dal - (4 << 8)) * 768) / (ldist(ps[p].GetActor(), aimed));
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1);
|
||||
zvel = ((aimed->spr.z - sz - dal - (4 << 8)) * 768) / (ldist(ps[p].GetActor(), aimed));
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else zvel = -MulScale(ps[p].horizon.sum().asq16(), 98, 16);
|
||||
}
|
||||
|
@ -1180,8 +1180,8 @@ void shoot_d(DDukeActor* actor, int atwith)
|
|||
|
||||
if (j)
|
||||
{
|
||||
j->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
j->s->clipdist = 32;
|
||||
j->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
j->spr.clipdist = 32;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1201,7 +1201,7 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum
|
|||
{
|
||||
int i, j, k;
|
||||
auto p = &ps[snum];
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && p->GetActor()->s->xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && p->GetActor()->spr.xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
{
|
||||
if ((p->weapon_pos == 0 || (p->holster_weapon && p->weapon_pos == -9)))
|
||||
{
|
||||
|
@ -1331,7 +1331,7 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == HEAVYHBOMB && act->GetOwner() == p->GetActor())
|
||||
if (act->spr.picnum == HEAVYHBOMB && act->GetOwner() == p->GetActor())
|
||||
{
|
||||
p->gotweapon[HANDBOMB_WEAPON] = true;
|
||||
j = HANDREMOTE_WEAPON;
|
||||
|
@ -1453,7 +1453,7 @@ int doincrements_d(struct player_struct* p)
|
|||
int snum;
|
||||
|
||||
auto pact = p->GetActor();
|
||||
snum = pact->s->yvel;
|
||||
snum = pact->spr.yvel;
|
||||
|
||||
p->player_par++;
|
||||
|
||||
|
@ -1535,7 +1535,7 @@ int doincrements_d(struct player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
if (p->quick_kick > 0 && p->GetActor()->s->pal != 1)
|
||||
if (p->quick_kick > 0 && p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
p->last_quick_kick = p->quick_kick + 1;
|
||||
p->quick_kick--;
|
||||
|
@ -1545,17 +1545,17 @@ int doincrements_d(struct player_struct* p)
|
|||
else if (p->last_quick_kick > 0)
|
||||
p->last_quick_kick--;
|
||||
|
||||
if (p->access_incs && p->GetActor()->s->pal != 1)
|
||||
if (p->access_incs && p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
p->access_incs++;
|
||||
if (p->GetActor()->s->extra <= 0)
|
||||
if (p->GetActor()->spr.extra <= 0)
|
||||
p->access_incs = 12;
|
||||
if (p->access_incs == 12)
|
||||
{
|
||||
if (p->access_spritenum != nullptr)
|
||||
{
|
||||
fi.checkhitswitch(snum, nullptr, p->access_spritenum);
|
||||
switch (p->access_spritenum->s->pal)
|
||||
switch (p->access_spritenum->spr.pal)
|
||||
{
|
||||
case 0:p->got_access &= (0xffff - 0x1); break;
|
||||
case 21:p->got_access &= (0xffff - 0x2); break;
|
||||
|
@ -1652,7 +1652,7 @@ void checkweapons_d(struct player_struct* p)
|
|||
|
||||
if (isWW2GI())
|
||||
{
|
||||
int snum = p->GetActor()->s->yvel;
|
||||
int snum = p->GetActor()->spr.yvel;
|
||||
cw = aplWeaponWorksLike(p->curr_weapon, snum);
|
||||
}
|
||||
else
|
||||
|
@ -1827,8 +1827,8 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int
|
|||
else if (p->falling_counter > 9)
|
||||
{
|
||||
j = p->falling_counter;
|
||||
pact->s->extra -= j - (krand() & 3);
|
||||
if (pact->s->extra <= 0)
|
||||
pact->spr.extra -= j - (krand() & 3);
|
||||
if (pact->spr.extra <= 0)
|
||||
{
|
||||
S_PlayActorSound(SQUISHED, pact);
|
||||
SetPlayerPal(p, PalEntry(63, 63, 0, 0));
|
||||
|
@ -2006,11 +2006,11 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
|
|||
auto j = spawn(pact, WATERBUBBLE);
|
||||
if (j)
|
||||
{
|
||||
j->s->x += bcos(p->angle.ang.asbuild() + 64 - (global_random & 128), -6);
|
||||
j->s->y += bsin(p->angle.ang.asbuild() + 64 - (global_random & 128), -6);
|
||||
j->s->xrepeat = 3;
|
||||
j->s->yrepeat = 2;
|
||||
j->s->z = p->pos.z + (8 << 8);
|
||||
j->spr.x += bcos(p->angle.ang.asbuild() + 64 - (global_random & 128), -6);
|
||||
j->spr.y += bsin(p->angle.ang.asbuild() + 64 - (global_random & 128), -6);
|
||||
j->spr.xrepeat = 3;
|
||||
j->spr.yrepeat = 2;
|
||||
j->spr.z = p->pos.z + (8 << 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2224,21 +2224,21 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
|
||||
if (isNam())
|
||||
{
|
||||
spawned->s->extra = MulScale(krand(), NAM_GRENADE_LIFETIME_VAR, 14);
|
||||
spawned->spr.extra = MulScale(krand(), NAM_GRENADE_LIFETIME_VAR, 14);
|
||||
}
|
||||
|
||||
if (k == 15)
|
||||
{
|
||||
spawned->s->yvel = 3;
|
||||
spawned->s->z += (8 << 8);
|
||||
spawned->spr.yvel = 3;
|
||||
spawned->spr.z += (8 << 8);
|
||||
}
|
||||
|
||||
k = hits(pact);
|
||||
if (k < 512)
|
||||
{
|
||||
spawned->s->ang += 1024;
|
||||
spawned->s->zvel /= 3;
|
||||
spawned->s->xvel /= 3;
|
||||
spawned->spr.ang += 1024;
|
||||
spawned->spr.zvel /= 3;
|
||||
spawned->spr.xvel /= 3;
|
||||
}
|
||||
|
||||
p->hbomb_on = 1;
|
||||
|
@ -2364,9 +2364,9 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
auto j = spawn(pact, SHOTGUNSHELL);
|
||||
if (j)
|
||||
{
|
||||
j->s->ang += 1024;
|
||||
j->spr.ang += 1024;
|
||||
ssp(j, CLIPMASK0);
|
||||
j->s->ang += 1024;
|
||||
j->spr.ang += 1024;
|
||||
}
|
||||
p->kickback_pic++;
|
||||
break;
|
||||
|
@ -2392,10 +2392,10 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
auto j = spawn(pact, SHELL);
|
||||
if (j)
|
||||
{
|
||||
j->s->ang += 1024;
|
||||
j->s->ang &= 2047;
|
||||
j->s->xvel += 32;
|
||||
j->s->z += (3 << 8);
|
||||
j->spr.ang += 1024;
|
||||
j->spr.ang &= 2047;
|
||||
j->spr.xvel += 32;
|
||||
j->spr.z += (3 << 8);
|
||||
ssp(j, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -2546,7 +2546,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
fi.shoot(pact, FREEZEBLAST);
|
||||
checkavailweapon(p);
|
||||
}
|
||||
if (pact->s->xrepeat < 32)
|
||||
if (pact->spr.xrepeat < 32)
|
||||
{
|
||||
p->okickback_pic = p->kickback_pic = 0; break;
|
||||
}
|
||||
|
@ -2781,7 +2781,7 @@ void processinput_d(int snum)
|
|||
|
||||
if (chz.type == kHitSprite)
|
||||
{
|
||||
if (chz.actor()->s->statnum == 1 && chz.actor()->s->extra >= 0)
|
||||
if (chz.actor()->spr.statnum == 1 && chz.actor()->spr.extra >= 0)
|
||||
{
|
||||
chz.setNone();
|
||||
cz = p->truecz;
|
||||
|
@ -2790,15 +2790,15 @@ void processinput_d(int snum)
|
|||
|
||||
if (clz.type == kHitSprite)
|
||||
{
|
||||
if ((clz.actor()->s->cstat & (CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_BLOCK)) == (CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_BLOCK))
|
||||
if ((clz.actor()->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_BLOCK)) == (CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_BLOCK))
|
||||
{
|
||||
psectlotag = 0;
|
||||
p->footprintcount = 0;
|
||||
p->spritebridge = 1;
|
||||
}
|
||||
else if (badguy(clz.actor()) && clz.actor()->s->xrepeat > 24 && abs(s->z - clz.actor()->s->z) < (84 << 8))
|
||||
else if (badguy(clz.actor()) && clz.actor()->spr.xrepeat > 24 && abs(s->z - clz.actor()->spr.z) < (84 << 8))
|
||||
{
|
||||
j = getangle(clz.actor()->s->x - p->pos.x, clz.actor()->s->y - p->pos.y);
|
||||
j = getangle(clz.actor()->spr.x - p->pos.x, clz.actor()->spr.y - p->pos.y);
|
||||
p->posxv -= bcos(j, 4);
|
||||
p->posyv -= bsin(j, 4);
|
||||
}
|
||||
|
@ -2865,7 +2865,7 @@ void processinput_d(int snum)
|
|||
p->playerweaponsway(s->xvel);
|
||||
|
||||
s->xvel = clamp(ksqrt((p->pos.x - p->bobposx) * (p->pos.x - p->bobposx) + (p->pos.y - p->bobposy) * (p->pos.y - p->bobposy)), 0, 512);
|
||||
if (p->on_ground) p->bobcounter += p->GetActor()->s->xvel >> 1;
|
||||
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
|
||||
|
||||
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));
|
||||
|
||||
|
@ -2959,7 +2959,7 @@ void processinput_d(int snum)
|
|||
case 0:
|
||||
|
||||
if (clz.type == kHitSprite)
|
||||
j = clz.actor()->s->picnum;
|
||||
j = clz.actor()->spr.picnum;
|
||||
else
|
||||
j = psectp->floorpicnum;
|
||||
|
||||
|
@ -3073,7 +3073,7 @@ HORIZONLY:
|
|||
if (ud.clipping == 0 && psectp->lotag == 31)
|
||||
{
|
||||
auto secact = barrier_cast<DDukeActor*>(psectp->hitagactor);
|
||||
if (secact && secact->s->xvel && secact->temp_data[0] == 0)
|
||||
if (secact && secact->spr.xvel && secact->temp_data[0] == 0)
|
||||
{
|
||||
quickkill(p);
|
||||
return;
|
||||
|
|
|
@ -46,9 +46,9 @@ void incur_damage_r(struct player_struct* p)
|
|||
int damage = 0, shield_damage = 0;
|
||||
int gut = 0;
|
||||
|
||||
p->GetActor()->s->extra -= p->extra_extra8 >> 8;
|
||||
p->GetActor()->spr.extra -= p->extra_extra8 >> 8;
|
||||
|
||||
damage = p->GetActor()->s->extra - p->last_extra;
|
||||
damage = p->GetActor()->spr.extra - p->last_extra;
|
||||
if (damage < 0)
|
||||
{
|
||||
p->extra_extra8 = 0;
|
||||
|
@ -73,7 +73,7 @@ void incur_damage_r(struct player_struct* p)
|
|||
break;
|
||||
}
|
||||
|
||||
p->GetActor()->s->extra = p->last_extra + damage;
|
||||
p->GetActor()->spr.extra = p->last_extra + damage;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,8 +100,8 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
|
|||
{
|
||||
int x;
|
||||
auto pspr = ps[findplayer(actor, &x)].GetActor();
|
||||
zvel = ((pspr->s->z - sz) << 8) / (x + 1);
|
||||
sa = getangle(pspr->s->x - sx, pspr->s->y - sy);
|
||||
zvel = ((pspr->spr.z - sz) << 8) / (x + 1);
|
||||
sa = getangle(pspr->spr.x - sx, pspr->spr.y - sy);
|
||||
}
|
||||
|
||||
hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
|
||||
|
@ -112,12 +112,12 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
|
|||
DukeStatIterator its(STAT_EFFECTOR);
|
||||
while (auto effector = its.Next())
|
||||
{
|
||||
if (effector->s->sector() == hit.hitSector && effector->s->picnum == SECTOREFFECTOR && effector->GetOwner()
|
||||
&& effector->s->lotag == SE_7_TELEPORT)
|
||||
if (effector->spr.sector() == hit.hitSector && effector->spr.picnum == SECTOREFFECTOR && effector->GetOwner()
|
||||
&& effector->spr.lotag == SE_7_TELEPORT)
|
||||
{
|
||||
int nx, ny, nz;
|
||||
nx = hit.hitpos.x + (effector->GetOwner()->s->x - effector->s->x);
|
||||
ny = hit.hitpos.y + (effector->GetOwner()->s->y - effector->s->y);
|
||||
nx = hit.hitpos.x + (effector->GetOwner()->spr.x - effector->spr.x);
|
||||
ny = hit.hitpos.y + (effector->GetOwner()->spr.y - effector->spr.y);
|
||||
if (hit.hitSector->lotag == 161)
|
||||
{
|
||||
nz = effector->GetOwner()->sector()->floorz;
|
||||
|
@ -126,7 +126,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
|
|||
{
|
||||
nz = effector->GetOwner()->sector()->ceilingz;
|
||||
}
|
||||
hitscan({ nx, ny, nz }, effector->GetOwner()->s->sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
|
||||
hitscan({ nx, ny, nz }, effector->GetOwner()->spr.sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -143,26 +143,26 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
|
|||
{
|
||||
wpn = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SLINGBLADE, -15, 0, 0, sa, 32, 0, actor, 4);
|
||||
if (!wpn) return;
|
||||
wpn->s->extra += 50;
|
||||
wpn->spr.extra += 50;
|
||||
}
|
||||
else
|
||||
{
|
||||
wpn = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4);
|
||||
if (!wpn) return;
|
||||
wpn->s->extra += (krand() & 7);
|
||||
wpn->spr.extra += (krand() & 7);
|
||||
}
|
||||
if (p >= 0)
|
||||
{
|
||||
auto k = spawn(wpn, SMALLSMOKE);
|
||||
if (k) k->s->z -= (8 << 8);
|
||||
if (k) k->spr.z -= (8 << 8);
|
||||
if (atwith == KNEE) S_PlayActorSound(KICK_HIT, wpn);
|
||||
else if (isRRRA() && atwith == SLINGBLADE) S_PlayActorSound(260, wpn);
|
||||
}
|
||||
|
||||
if (p >= 0 && ps[p].steroids_amount > 0 && ps[p].steroids_amount < 400)
|
||||
wpn->s->extra += (gs.max_player_health >> 2);
|
||||
wpn->spr.extra += (gs.max_player_health >> 2);
|
||||
|
||||
if (hit.actor() && hit.actor()->s->picnum != ACCESSSWITCH && hit.actor()->s->picnum != ACCESSSWITCH2)
|
||||
if (hit.actor() && hit.actor()->spr.picnum != ACCESSSWITCH && hit.actor()->spr.picnum != ACCESSSWITCH2)
|
||||
{
|
||||
fi.checkhitsprite(hit.actor(), wpn);
|
||||
if (p >= 0) fi.checkhitswitch(p, nullptr, hit.actor());
|
||||
|
@ -186,12 +186,12 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
|
|||
auto splash = spawn(ps[p].GetActor(), WATERSPLASH2);
|
||||
if (splash)
|
||||
{
|
||||
splash->s->x = hit.hitpos.x;
|
||||
splash->s->y = hit.hitpos.y;
|
||||
splash->s->ang = ps[p].angle.ang.asbuild(); // Total tweek
|
||||
splash->s->xvel = 32;
|
||||
splash->spr.x = hit.hitpos.x;
|
||||
splash->spr.y = hit.hitpos.y;
|
||||
splash->spr.ang = ps[p].angle.ang.asbuild(); // Total tweek
|
||||
splash->spr.xvel = 32;
|
||||
ssp(actor, 0);
|
||||
splash->s->xvel = 0;
|
||||
splash->spr.xvel = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,9 +217,9 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
auto aimed = aim(actor, AUTO_AIM_ANGLE);
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) + (5 << 8);
|
||||
zvel = ((aimed->s->z - sz - dal) << 8) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) + (5 << 8);
|
||||
zvel = ((aimed->spr.z - sz - dal) << 8) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
|
||||
if (atwith == SHOTSPARK1)
|
||||
|
@ -269,12 +269,12 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeStatIterator its(STAT_EFFECTOR);
|
||||
while (auto effector = its.Next())
|
||||
{
|
||||
if (effector->s->sector() == hit.hitSector && effector->s->picnum == SECTOREFFECTOR && effector->GetOwner()
|
||||
&& effector->s->lotag == SE_7_TELEPORT)
|
||||
if (effector->spr.sector() == hit.hitSector && effector->spr.picnum == SECTOREFFECTOR && effector->GetOwner()
|
||||
&& effector->spr.lotag == SE_7_TELEPORT)
|
||||
{
|
||||
int nx, ny, nz;
|
||||
nx = hit.hitpos.x + (effector->GetOwner()->s->x - effector->s->x);
|
||||
ny = hit.hitpos.y + (effector->GetOwner()->s->y - effector->s->y);
|
||||
nx = hit.hitpos.x + (effector->GetOwner()->spr.x - effector->spr.x);
|
||||
ny = hit.hitpos.y + (effector->GetOwner()->spr.y - effector->spr.y);
|
||||
if (hit.hitSector->lotag == 161)
|
||||
{
|
||||
nz = effector->GetOwner()->sector()->floorz;
|
||||
|
@ -283,7 +283,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
nz = effector->GetOwner()->sector()->ceilingz;
|
||||
}
|
||||
hitscan({ nx, ny, nz }, effector->GetOwner()->s->sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
|
||||
hitscan({ nx, ny, nz }, effector->GetOwner()->spr.sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -306,8 +306,8 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
spark = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4);
|
||||
if (!spark) return;
|
||||
spark->s->extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
spark->s->extra += (krand() % 6);
|
||||
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
spark->spr.extra += (krand() % 6);
|
||||
|
||||
if (hit.hitWall == nullptr && hit.actor() == nullptr)
|
||||
{
|
||||
|
@ -315,8 +315,8 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
if (hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY)
|
||||
{
|
||||
spark->s->xrepeat = 0;
|
||||
spark->s->yrepeat = 0;
|
||||
spark->spr.xrepeat = 0;
|
||||
spark->spr.yrepeat = 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -328,33 +328,33 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
|
||||
if (hit.actor())
|
||||
{
|
||||
if (hit.actor()->s->picnum == 1930)
|
||||
if (hit.actor()->spr.picnum == 1930)
|
||||
return;
|
||||
fi.checkhitsprite(hit.actor(), spark);
|
||||
if (hit.actor()->s->picnum == TILE_APLAYER && (ud.coop != 1 || ud.ffire == 1))
|
||||
if (hit.actor()->spr.picnum == TILE_APLAYER && (ud.coop != 1 || ud.ffire == 1))
|
||||
{
|
||||
auto l = spawn(spark, JIBS6);
|
||||
spark->s->xrepeat = spark->s->yrepeat = 0;
|
||||
spark->spr.xrepeat = spark->spr.yrepeat = 0;
|
||||
if (l)
|
||||
{
|
||||
l->s->z += (4 << 8);
|
||||
l->s->xvel = 16;
|
||||
l->s->xrepeat = l->s->yrepeat = 24;
|
||||
l->s->ang += 64 - (krand() & 127);
|
||||
l->spr.z += (4 << 8);
|
||||
l->spr.xvel = 16;
|
||||
l->spr.xrepeat = l->spr.yrepeat = 24;
|
||||
l->spr.ang += 64 - (krand() & 127);
|
||||
}
|
||||
}
|
||||
else spawn(spark, SMALLSMOKE);
|
||||
|
||||
if (p >= 0 && (
|
||||
hit.actor()->s->picnum == DIPSWITCH ||
|
||||
hit.actor()->s->picnum == DIPSWITCH + 1 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH2 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH2 + 1 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH3 ||
|
||||
hit.actor()->s->picnum == DIPSWITCH3 + 1 ||
|
||||
(isRRRA() && hit.actor()->s->picnum == RRTILE8660) ||
|
||||
hit.actor()->s->picnum == HANDSWITCH ||
|
||||
hit.actor()->s->picnum == HANDSWITCH + 1))
|
||||
hit.actor()->spr.picnum == DIPSWITCH ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH + 1 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH2 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH2 + 1 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH3 ||
|
||||
hit.actor()->spr.picnum == DIPSWITCH3 + 1 ||
|
||||
(isRRRA() && hit.actor()->spr.picnum == RRTILE8660) ||
|
||||
hit.actor()->spr.picnum == HANDSWITCH ||
|
||||
hit.actor()->spr.picnum == HANDSWITCH + 1))
|
||||
{
|
||||
fi.checkhitswitch(p, nullptr, hit.actor());
|
||||
return;
|
||||
|
@ -397,7 +397,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeSectIterator it(hit.hitWall->nextSector());
|
||||
while (auto l = it.Next())
|
||||
{
|
||||
if (l->s->statnum == 3 && l->s->lotag == 13)
|
||||
if (l->spr.statnum == 3 && l->spr.lotag == 13)
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
}
|
||||
|
@ -405,16 +405,16 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
DukeStatIterator it(STAT_MISC);
|
||||
while (auto l = it.Next())
|
||||
{
|
||||
if (l->s->picnum == BULLETHOLE)
|
||||
if (l->spr.picnum == BULLETHOLE)
|
||||
if (dist(l, spark) < (12 + (krand() & 7)))
|
||||
goto SKIPBULLETHOLE;
|
||||
}
|
||||
auto l = spawn(spark, BULLETHOLE);
|
||||
if (l)
|
||||
{
|
||||
l->s->xvel = -1;
|
||||
l->spr.xvel = -1;
|
||||
auto delta = hit.hitWall->delta();
|
||||
l->s->ang = getangle(-delta.x, -delta.y) + 512;
|
||||
l->spr.ang = getangle(-delta.x, -delta.y) + 512;
|
||||
ssp(l, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -433,14 +433,14 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
spark = EGS(hit.hitSector, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4);
|
||||
if (!spark) return;
|
||||
spark->s->extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
|
||||
|
||||
if (hit.actor())
|
||||
{
|
||||
fi.checkhitsprite(hit.actor(), spark);
|
||||
if (hit.actor()->s->picnum != TILE_APLAYER)
|
||||
if (hit.actor()->spr.picnum != TILE_APLAYER)
|
||||
spawn(spark, SMALLSMOKE);
|
||||
else spark->s->xrepeat = spark->s->yrepeat = 0;
|
||||
else spark->spr.xrepeat = spark->spr.yrepeat = 0;
|
||||
}
|
||||
else if (hit.hitWall != nullptr)
|
||||
fi.checkhitwall(spark, hit.hitWall, hit.hitpos.x, hit.hitpos.y, hit.hitpos.z, SHOTSPARK1);
|
||||
|
@ -511,9 +511,9 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) - (12 << 8);
|
||||
zvel = ((aimed->s->z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) - (12 << 8);
|
||||
zvel = ((aimed->spr.z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -577,17 +577,17 @@ static void shootstuff(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
{
|
||||
auto j = EGS(sect, sx, sy, sz, atwith, -127, sizx, sizy, sa, vel, zvel, actor, 4);
|
||||
if (!j) return;
|
||||
j->s->extra += (krand() & 7);
|
||||
j->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
j->s->clipdist = 4;
|
||||
j->spr.extra += (krand() & 7);
|
||||
j->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
j->spr.clipdist = 4;
|
||||
|
||||
sa = s->ang + 32 - (krand() & 63);
|
||||
zvel = oldzvel + 512 - (krand() & 1023);
|
||||
|
||||
if (atwith == FIRELASER)
|
||||
{
|
||||
j->s->xrepeat = 8;
|
||||
j->s->yrepeat = 8;
|
||||
j->spr.xrepeat = 8;
|
||||
j->spr.yrepeat = 8;
|
||||
}
|
||||
|
||||
scount--;
|
||||
|
@ -622,15 +622,15 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
|
|||
{
|
||||
if (isRRRA() && atwith == RPG2)
|
||||
{
|
||||
if (aimed->s->picnum == HEN || aimed->s->picnum == HENSTAYPUT)
|
||||
if (aimed->spr.picnum == HEN || aimed->spr.picnum == HENSTAYPUT)
|
||||
act90 = ps[screenpeek].GetActor();
|
||||
else
|
||||
act90 = aimed;
|
||||
}
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) + (8 << 8);
|
||||
zvel = ((aimed->s->z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
if (aimed->s->picnum != RECON)
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) + (8 << 8);
|
||||
zvel = ((aimed->spr.z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
if (aimed->spr.picnum != RECON)
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else zvel = -MulScale(ps[p].horizon.sum().asq16(), 81, 16);
|
||||
if (atwith == RPG)
|
||||
|
@ -682,67 +682,67 @@ static void shootrpg(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
|
|||
{
|
||||
if (atwith == RRTILE1790)
|
||||
{
|
||||
spawned->s->extra = 10;
|
||||
spawned->s->zvel = -(10 << 8);
|
||||
spawned->spr.extra = 10;
|
||||
spawned->spr.zvel = -(10 << 8);
|
||||
}
|
||||
else if (atwith == RPG2)
|
||||
{
|
||||
spawned->seek_actor = act90;
|
||||
spawned->s->hitag = 0;
|
||||
spawned->spr.hitag = 0;
|
||||
fi.lotsofmoney(spawned, (krand() & 3) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
spawned->s->extra += (krand() & 7);
|
||||
spawned->spr.extra += (krand() & 7);
|
||||
if (atwith != FREEZEBLAST)
|
||||
spawned->temp_actor = aimed;
|
||||
else
|
||||
{
|
||||
spawned->s->yvel = gs.numfreezebounces;
|
||||
spawned->s->xrepeat >>= 1;
|
||||
spawned->s->yrepeat >>= 1;
|
||||
spawned->s->zvel -= (2 << 4);
|
||||
spawned->spr.yvel = gs.numfreezebounces;
|
||||
spawned->spr.xrepeat >>= 1;
|
||||
spawned->spr.yrepeat >>= 1;
|
||||
spawned->spr.zvel -= (2 << 4);
|
||||
}
|
||||
|
||||
if (p == -1)
|
||||
{
|
||||
if (s->picnum == HULK)
|
||||
{
|
||||
spawned->s->xrepeat = 8;
|
||||
spawned->s->yrepeat = 8;
|
||||
spawned->spr.xrepeat = 8;
|
||||
spawned->spr.yrepeat = 8;
|
||||
}
|
||||
else if (atwith != FREEZEBLAST)
|
||||
{
|
||||
spawned->s->xrepeat = 30;
|
||||
spawned->s->yrepeat = 30;
|
||||
spawned->s->extra >>= 2;
|
||||
spawned->spr.xrepeat = 30;
|
||||
spawned->spr.yrepeat = 30;
|
||||
spawned->spr.extra >>= 2;
|
||||
}
|
||||
}
|
||||
else if (ps[p].curr_weapon == TIT_WEAPON)
|
||||
{
|
||||
spawned->s->extra >>= 2;
|
||||
spawned->s->ang += 16 - (krand() & 31);
|
||||
spawned->s->zvel += 256 - (krand() & 511);
|
||||
spawned->spr.extra >>= 2;
|
||||
spawned->spr.ang += 16 - (krand() & 31);
|
||||
spawned->spr.zvel += 256 - (krand() & 511);
|
||||
|
||||
if (ps[p].hbomb_hold_delay)
|
||||
{
|
||||
spawned->s->x -= bsin(sa) / 644;
|
||||
spawned->s->y += bcos(sa) / 644;
|
||||
spawned->spr.x -= bsin(sa) / 644;
|
||||
spawned->spr.y += bcos(sa) / 644;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawned->s->x += bsin(sa, -8);
|
||||
spawned->s->y -= bcos(sa, -8);
|
||||
spawned->spr.x += bsin(sa, -8);
|
||||
spawned->spr.y -= bcos(sa, -8);
|
||||
}
|
||||
spawned->s->xrepeat >>= 1;
|
||||
spawned->s->yrepeat >>= 1;
|
||||
spawned->spr.xrepeat >>= 1;
|
||||
spawned->spr.yrepeat >>= 1;
|
||||
}
|
||||
|
||||
spawned->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
if (atwith == RPG || (atwith == RPG2 && isRRRA()))
|
||||
spawned->s->clipdist = 4;
|
||||
spawned->spr.clipdist = 4;
|
||||
else
|
||||
spawned->s->clipdist = 40;
|
||||
spawned->spr.clipdist = 40;
|
||||
|
||||
|
||||
}
|
||||
|
@ -782,9 +782,9 @@ static void shootwhip(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
|
||||
if (aimed)
|
||||
{
|
||||
int dal = ((aimed->s->xrepeat * tileHeight(aimed->s->picnum)) << 1) - (12 << 8);
|
||||
zvel = ((aimed->s->z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->s->x - sx, aimed->s->y - sy);
|
||||
int dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) << 1) - (12 << 8);
|
||||
zvel = ((aimed->spr.z - sz - dal) * vel) / ldist(ps[p].GetActor(), aimed);
|
||||
sa = getangle(aimed->spr.x - sx, aimed->spr.y - sy);
|
||||
}
|
||||
else
|
||||
zvel = -MulScale(ps[p].horizon.sum().asq16(), 98, 16);
|
||||
|
@ -812,9 +812,9 @@ static void shootwhip(DDukeActor* actor, int p, int sx, int sy, int sz, int sa,
|
|||
{
|
||||
auto j = EGS(sect, sx, sy, sz, atwith, -127, sizx, sizy, sa, vel, zvel, actor, 4);
|
||||
if (!j) return;
|
||||
j->s->extra += (krand() & 7);
|
||||
j->s->cstat = CSTAT_SPRITE_YCENTER;
|
||||
j->s->clipdist = 4;
|
||||
j->spr.extra += (krand() & 7);
|
||||
j->spr.cstat = CSTAT_SPRITE_YCENTER;
|
||||
j->spr.clipdist = 4;
|
||||
|
||||
sa = s->ang + 32 - (krand() & 63);
|
||||
zvel = oldzvel + 512 - (krand() & 1023);
|
||||
|
@ -902,9 +902,9 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
auto j = spawn(actor, atwith);
|
||||
if (j)
|
||||
{
|
||||
j->s->xvel = 32;
|
||||
j->s->ang = s->ang;
|
||||
j->s->z -= (5 << 8);
|
||||
j->spr.xvel = 32;
|
||||
j->spr.ang = s->ang;
|
||||
j->spr.z -= (5 << 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -913,9 +913,9 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
auto j = spawn(actor, atwith);
|
||||
if (j)
|
||||
{
|
||||
j->s->xvel = 250;
|
||||
j->s->ang = s->ang;
|
||||
j->s->z -= (15 << 8);
|
||||
j->spr.xvel = 250;
|
||||
j->spr.ang = s->ang;
|
||||
j->spr.z -= (15 << 8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -984,7 +984,7 @@ void selectweapon_r(int snum, int weap)
|
|||
{
|
||||
int i, j, k;
|
||||
auto p = &ps[snum];
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && p->GetActor()->s->xrepeat > 8 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
if (p->last_pissed_time <= (26 * 218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && p->GetActor()->spr.xrepeat > 8 && p->access_incs == 0 && p->knee_incs == 0)
|
||||
{
|
||||
if ((p->weapon_pos == 0 || (p->holster_weapon && p->weapon_pos == -9)))
|
||||
{
|
||||
|
@ -1091,7 +1091,7 @@ void selectweapon_r(int snum, int weap)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == HEAVYHBOMB && act->GetOwner() == p->GetActor())
|
||||
if (act->spr.picnum == HEAVYHBOMB && act->GetOwner() == p->GetActor())
|
||||
{
|
||||
p->gotweapon[DYNAMITE_WEAPON] = true;
|
||||
j = THROWINGDYNAMITE_WEAPON;
|
||||
|
@ -1257,7 +1257,7 @@ int doincrements_r(struct player_struct* p)
|
|||
{
|
||||
BellTime--;
|
||||
if (BellTime == 0 && BellSprite)
|
||||
BellSprite->s->picnum++;
|
||||
BellSprite->spr.picnum++;
|
||||
}
|
||||
if (chickenphase > 0)
|
||||
chickenphase--;
|
||||
|
@ -1269,7 +1269,7 @@ int doincrements_r(struct player_struct* p)
|
|||
}
|
||||
}
|
||||
|
||||
snum = p->GetActor()->s->yvel;
|
||||
snum = p->GetActor()->spr.yvel;
|
||||
|
||||
p->player_par++;
|
||||
if (p->yehaa_timer)
|
||||
|
@ -1396,17 +1396,17 @@ int doincrements_r(struct player_struct* p)
|
|||
S_PlayActorSound(DUKE_TAKEPILLS, pact);
|
||||
}
|
||||
|
||||
if (p->access_incs && p->GetActor()->s->pal != 1)
|
||||
if (p->access_incs && p->GetActor()->spr.pal != 1)
|
||||
{
|
||||
p->access_incs++;
|
||||
if (p->GetActor()->s->extra <= 0)
|
||||
if (p->GetActor()->spr.extra <= 0)
|
||||
p->access_incs = 12;
|
||||
if (p->access_incs == 12)
|
||||
{
|
||||
if (p->access_spritenum != nullptr)
|
||||
{
|
||||
fi.checkhitswitch(snum, nullptr, p->access_spritenum);
|
||||
switch (p->access_spritenum->s->pal)
|
||||
switch (p->access_spritenum->spr.pal)
|
||||
{
|
||||
case 0:p->keys[1] = 1; break;
|
||||
case 21:p->keys[2] = 1; break;
|
||||
|
@ -1510,7 +1510,7 @@ void checkweapons_r(struct player_struct* p)
|
|||
auto j = spawn(p->GetActor(), 7220);
|
||||
if (j)
|
||||
{
|
||||
j->s->ang = p->angle.ang.asbuild();
|
||||
j->spr.ang = p->angle.ang.asbuild();
|
||||
j->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON];
|
||||
}
|
||||
p->OnMotorcycle = 0;
|
||||
|
@ -1529,7 +1529,7 @@ void checkweapons_r(struct player_struct* p)
|
|||
auto j = spawn(p->GetActor(), 7233);
|
||||
if (j)
|
||||
{
|
||||
j->s->ang = p->angle.ang.asbuild();
|
||||
j->spr.ang = p->angle.ang.asbuild();
|
||||
j->saved_ammo = p->ammo_amount[BOAT_WEAPON];
|
||||
}
|
||||
p->OnBoat = 0;
|
||||
|
@ -1569,16 +1569,16 @@ void checkweapons_r(struct player_struct* p)
|
|||
if (j) switch (i)
|
||||
{
|
||||
case 1:
|
||||
j->s->lotag = 100;
|
||||
j->spr.lotag = 100;
|
||||
break;
|
||||
case 2:
|
||||
j->s->lotag = 101;
|
||||
j->spr.lotag = 101;
|
||||
break;
|
||||
case 3:
|
||||
j->s->lotag = 102;
|
||||
j->spr.lotag = 102;
|
||||
break;
|
||||
case 4:
|
||||
j->s->lotag = 103;
|
||||
j->spr.lotag = 103;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2355,12 +2355,12 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz)
|
|||
auto j = spawn(pact, WATERBUBBLE);
|
||||
if (j)
|
||||
{
|
||||
j->s->x += bcos(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6);
|
||||
j->s->y += bsin(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6);
|
||||
j->s->xrepeat = 3;
|
||||
j->s->yrepeat = 2;
|
||||
j->s->z = p->pos.z + (8 << 8);
|
||||
j->s->cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
|
||||
j->spr.x += bcos(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6);
|
||||
j->spr.y += bsin(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6);
|
||||
j->spr.xrepeat = 3;
|
||||
j->spr.yrepeat = 2;
|
||||
j->spr.z = p->pos.z + (8 << 8);
|
||||
j->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2764,16 +2764,16 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
{
|
||||
if (k == 15)
|
||||
{
|
||||
spawned->s->yvel = 3;
|
||||
spawned->s->z += (8 << 8);
|
||||
spawned->spr.yvel = 3;
|
||||
spawned->spr.z += (8 << 8);
|
||||
}
|
||||
|
||||
k = hits(p->GetActor());
|
||||
if (k < 512)
|
||||
{
|
||||
spawned->s->ang += 1024;
|
||||
spawned->s->zvel /= 3;
|
||||
spawned->s->xvel /= 3;
|
||||
spawned->spr.ang += 1024;
|
||||
spawned->spr.zvel /= 3;
|
||||
spawned->spr.xvel /= 3;
|
||||
}
|
||||
|
||||
p->hbomb_on = 1;
|
||||
|
@ -2987,10 +2987,10 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
if (j)
|
||||
{
|
||||
|
||||
j->s->ang += 1024;
|
||||
j->s->ang &= 2047;
|
||||
j->s->xvel += 32;
|
||||
j->s->z += (3 << 8);
|
||||
j->spr.ang += 1024;
|
||||
j->spr.ang &= 2047;
|
||||
j->spr.xvel += 32;
|
||||
j->spr.z += (3 << 8);
|
||||
ssp(j, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -3391,8 +3391,8 @@ void processinput_r(int snum)
|
|||
DukeSectIterator it(psectp);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->picnum == RRTILE380)
|
||||
if (act2->s->z - (8 << 8) < p->pos.z)
|
||||
if (act2->spr.picnum == RRTILE380)
|
||||
if (act2->spr.z - (8 << 8) < p->pos.z)
|
||||
psectlotag = 2;
|
||||
}
|
||||
}
|
||||
|
@ -3440,12 +3440,12 @@ void processinput_r(int snum)
|
|||
|
||||
if (chz.type == kHitSprite)
|
||||
{
|
||||
if (chz.actor()->s->statnum == 1 && chz.actor()->s->extra >= 0)
|
||||
if (chz.actor()->spr.statnum == 1 && chz.actor()->spr.extra >= 0)
|
||||
{
|
||||
chz.setNone();
|
||||
cz = p->truecz;
|
||||
}
|
||||
else if (chz.actor()->s->picnum == LADDER)
|
||||
else if (chz.actor()->spr.picnum == LADDER)
|
||||
{
|
||||
if (!p->stairs)
|
||||
{
|
||||
|
@ -3463,7 +3463,7 @@ void processinput_r(int snum)
|
|||
|
||||
if (clz.type == kHitSprite)
|
||||
{
|
||||
if ((clz.actor()->s->cstat & (CSTAT_SPRITE_ALIGNMENT_FLOOR| CSTAT_SPRITE_BLOCK)) == (CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_BLOCK))
|
||||
if ((clz.actor()->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_FLOOR| CSTAT_SPRITE_BLOCK)) == (CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_BLOCK))
|
||||
{
|
||||
psectlotag = 0;
|
||||
p->footprintcount = 0;
|
||||
|
@ -3485,28 +3485,28 @@ void processinput_r(int snum)
|
|||
p->MotoSpeed -= p->MotoSpeed / 16.;
|
||||
}
|
||||
}
|
||||
else if (badguy(clz.actor()) && clz.actor()->s->xrepeat > 24 && abs(s->z - clz.actor()->s->z) < (84 << 8))
|
||||
else if (badguy(clz.actor()) && clz.actor()->spr.xrepeat > 24 && abs(s->z - clz.actor()->spr.z) < (84 << 8))
|
||||
{
|
||||
int j = getangle(clz.actor()->s->x - p->pos.x, clz.actor()->s->y - p->pos.y);
|
||||
int j = getangle(clz.actor()->spr.x - p->pos.x, clz.actor()->spr.y - p->pos.y);
|
||||
p->posxv -= bcos(j, 4);
|
||||
p->posyv -= bsin(j, 4);
|
||||
}
|
||||
if (clz.actor()->s->picnum == LADDER)
|
||||
if (clz.actor()->spr.picnum == LADDER)
|
||||
{
|
||||
if (!p->stairs)
|
||||
{
|
||||
p->stairs = 10;
|
||||
if ((actions & SB_CROUCH) && !p->OnMotorcycle)
|
||||
{
|
||||
cz = clz.actor()->s->z;
|
||||
cz = clz.actor()->spr.z;
|
||||
chz.setNone();
|
||||
fz = clz.actor()->s->z + (4 << 8);
|
||||
fz = clz.actor()->spr.z + (4 << 8);
|
||||
}
|
||||
}
|
||||
else
|
||||
p->stairs--;
|
||||
}
|
||||
else if (clz.actor()->s->picnum == TOILET || clz.actor()->s->picnum == RRTILE2121)
|
||||
else if (clz.actor()->spr.picnum == TOILET || clz.actor()->spr.picnum == RRTILE2121)
|
||||
{
|
||||
if ((actions & SB_CROUCH) && !p->OnMotorcycle)
|
||||
//if (Sound[436].num == 0)
|
||||
|
@ -3578,7 +3578,7 @@ void processinput_r(int snum)
|
|||
p->playerweaponsway(s->xvel);
|
||||
|
||||
s->xvel = clamp(ksqrt((p->pos.x - p->bobposx) * (p->pos.x - p->bobposx) + (p->pos.y - p->bobposy) * (p->pos.y - p->bobposy)), 0, 512);
|
||||
if (p->on_ground) p->bobcounter += p->GetActor()->s->xvel >> 1;
|
||||
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
|
||||
|
||||
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));
|
||||
|
||||
|
@ -3686,7 +3686,7 @@ void processinput_r(int snum)
|
|||
case 0:
|
||||
|
||||
if (clz.type == kHitSprite)
|
||||
j = clz.actor()->s->picnum;
|
||||
j = clz.actor()->spr.picnum;
|
||||
else j = psectp->floorpicnum;
|
||||
break;
|
||||
case 1:
|
||||
|
@ -3847,33 +3847,33 @@ HORIZONLY:
|
|||
}
|
||||
else if (badguy(clip.actor()))
|
||||
{
|
||||
if (clip.actor()->s->statnum != 1)
|
||||
if (clip.actor()->spr.statnum != 1)
|
||||
{
|
||||
clip.actor()->timetosleep = 0;
|
||||
if (clip.actor()->s->picnum == BILLYRAY)
|
||||
if (clip.actor()->spr.picnum == BILLYRAY)
|
||||
S_PlayActorSound(404, clip.actor());
|
||||
else
|
||||
check_fta_sounds_r(clip.actor());
|
||||
ChangeActorStat(clip.actor(), 1);
|
||||
}
|
||||
}
|
||||
else if (!isRRRA() && clip.actor()->s->picnum == RRTILE3410)
|
||||
else if (!isRRRA() && clip.actor()->spr.picnum == RRTILE3410)
|
||||
{
|
||||
quickkill(p);
|
||||
S_PlayActorSound(446, pact);
|
||||
}
|
||||
if (isRRRA())
|
||||
{
|
||||
if (clip.actor()->s->picnum == RRTILE3410)
|
||||
if (clip.actor()->spr.picnum == RRTILE3410)
|
||||
{
|
||||
quickkill(p);
|
||||
S_PlayActorSound(446, pact);
|
||||
}
|
||||
else if (clip.actor()->s->picnum == RRTILE2443 && clip.actor()->s->pal == 19)
|
||||
else if (clip.actor()->spr.picnum == RRTILE2443 && clip.actor()->spr.pal == 19)
|
||||
{
|
||||
clip.actor()->s->pal = 0;
|
||||
clip.actor()->spr.pal = 0;
|
||||
p->DrugMode = 5;
|
||||
ps[snum].GetActor()->s->extra = gs.max_player_health;
|
||||
ps[snum].GetActor()->spr.extra = gs.max_player_health;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3910,7 +3910,7 @@ HORIZONLY:
|
|||
if (ud.clipping == 0 && psectp->lotag == ST_31_TWO_WAY_TRAIN)
|
||||
{
|
||||
auto act = barrier_cast<DDukeActor*>(psectp->hitagactor);
|
||||
if (act && act->s->xvel && act->temp_data[0] == 0)
|
||||
if (act && act->spr.xvel && act->temp_data[0] == 0)
|
||||
{
|
||||
quickkill(p);
|
||||
return;
|
||||
|
@ -4041,9 +4041,9 @@ void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
|
|||
{
|
||||
if (motosprite)
|
||||
{
|
||||
p->pos.x = motosprite->s->x;
|
||||
p->pos.y = motosprite->s->y;
|
||||
p->angle.ang = buildang(motosprite->s->ang);
|
||||
p->pos.x = motosprite->spr.x;
|
||||
p->pos.y = motosprite->spr.y;
|
||||
p->angle.ang = buildang(motosprite->spr.ang);
|
||||
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo;
|
||||
deletesprite(motosprite);
|
||||
}
|
||||
|
@ -4101,9 +4101,9 @@ void OffMotorcycle(struct player_struct *p)
|
|||
auto spawned = spawn(p->GetActor(), EMPTYBIKE);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->ang = p->angle.ang.asbuild();
|
||||
spawned->s->xvel += p->angle.ang.bcos(7);
|
||||
spawned->s->yvel += p->angle.ang.bsin(7);
|
||||
spawned->spr.ang = p->angle.ang.asbuild();
|
||||
spawned->spr.xvel += p->angle.ang.bcos(7);
|
||||
spawned->spr.yvel += p->angle.ang.bsin(7);
|
||||
spawned->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON];
|
||||
}
|
||||
}
|
||||
|
@ -4121,9 +4121,9 @@ void OnBoat(struct player_struct *p, DDukeActor* boat)
|
|||
{
|
||||
if (boat)
|
||||
{
|
||||
p->pos.x = boat->s->x;
|
||||
p->pos.y = boat->s->y;
|
||||
p->angle.ang = buildang(boat->s->ang);
|
||||
p->pos.x = boat->spr.x;
|
||||
p->pos.y = boat->spr.y;
|
||||
p->angle.ang = buildang(boat->spr.ang);
|
||||
p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo;
|
||||
deletesprite(boat);
|
||||
}
|
||||
|
@ -4168,9 +4168,9 @@ void OffBoat(struct player_struct *p)
|
|||
auto spawned = spawn(p->GetActor(), EMPTYBOAT);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->ang = p->angle.ang.asbuild();
|
||||
spawned->s->xvel += p->angle.ang.bcos(7);
|
||||
spawned->s->yvel += p->angle.ang.bsin(7);
|
||||
spawned->spr.ang = p->angle.ang.asbuild();
|
||||
spawned->spr.xvel += p->angle.ang.bcos(7);
|
||||
spawned->spr.yvel += p->angle.ang.bsin(7);
|
||||
spawned->saved_ammo = p->ammo_amount[BOAT_WEAPON];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,18 +117,18 @@ void DoSpawn(struct player_struct *p, int snum)
|
|||
if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE2 ) )
|
||||
{
|
||||
// like shotgun shells
|
||||
j->s->ang += 1024;
|
||||
j->spr.ang += 1024;
|
||||
ssp(j,CLIPMASK0);
|
||||
j->s->ang += 1024;
|
||||
j->spr.ang += 1024;
|
||||
// p->kickback_pic++;
|
||||
}
|
||||
else if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE3 ) )
|
||||
{
|
||||
// like chaingun shells
|
||||
j->s->ang += 1024;
|
||||
j->s->ang &= 2047;
|
||||
j->s->xvel += 32;
|
||||
j->s->z += (3<<8);
|
||||
j->spr.ang += 1024;
|
||||
j->spr.ang &= 2047;
|
||||
j->spr.xvel += 32;
|
||||
j->spr.z += (3<<8);
|
||||
ssp(j,CLIPMASK0);
|
||||
}
|
||||
|
||||
|
@ -353,23 +353,23 @@ void operateweapon_ww(int snum, ESyncBits actions)
|
|||
int lGrenadeLifetime = GetGameVar("GRENADE_LIFETIME", NAM_GRENADE_LIFETIME, nullptr, snum).value();
|
||||
int lGrenadeLifetimeVar = GetGameVar("GRENADE_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, nullptr, snum).value();
|
||||
// set timer. blows up when at zero....
|
||||
j->s->extra = lGrenadeLifetime
|
||||
j->spr.extra = lGrenadeLifetime
|
||||
+ MulScale(krand(), lGrenadeLifetimeVar, 14)
|
||||
- lGrenadeLifetimeVar;
|
||||
}
|
||||
|
||||
if (k == 15)
|
||||
{
|
||||
j->s->yvel = 3;
|
||||
j->s->z += (8 << 8);
|
||||
j->spr.yvel = 3;
|
||||
j->spr.z += (8 << 8);
|
||||
}
|
||||
|
||||
k = hits(p->GetActor());
|
||||
if (k < 512)
|
||||
{
|
||||
j->s->ang += 1024;
|
||||
j->s->zvel /= 3;
|
||||
j->s->xvel /= 3;
|
||||
j->spr.ang += 1024;
|
||||
j->spr.zvel /= 3;
|
||||
j->spr.xvel /= 3;
|
||||
}
|
||||
|
||||
p->hbomb_on = 1;
|
||||
|
|
|
@ -256,7 +256,7 @@ void cacheit_d(void)
|
|||
DukeSectIterator it(§);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if (j->s->xrepeat != 0 && j->s->yrepeat != 0 && (j->s->cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
||||
if (j->spr.xrepeat != 0 && j->spr.yrepeat != 0 && (j->spr.cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
||||
cachespritenum(j->s);
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ void prelevel_d(int g, TArray<DDukeActor*>& actors)
|
|||
DukeStatIterator it1(STAT_EFFECTOR);
|
||||
while (auto ac = it1.Next())
|
||||
{
|
||||
if (ac->s->lotag == 12 && ac->s->hitag == spr->lotag)
|
||||
if (ac->spr.lotag == 12 && ac->spr.hitag == spr->lotag)
|
||||
ac->temp_data[0] = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -394,7 +394,7 @@ void cacheit_r(void)
|
|||
DukeSectIterator it(§);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if(j->s->xrepeat != 0 && j->s->yrepeat != 0 && (j->s->cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
||||
if(j->spr.xrepeat != 0 && j->spr.yrepeat != 0 && (j->spr.cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
||||
cachespritenum(j->s);
|
||||
}
|
||||
}
|
||||
|
@ -706,7 +706,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
DukeStatIterator it1(STAT_EFFECTOR);
|
||||
while (auto j = it1.Next())
|
||||
{
|
||||
if (j->s->lotag == 12 && j->s->hitag == spr->lotag)
|
||||
if (j->spr.lotag == 12 && j->spr.hitag == spr->lotag)
|
||||
j->temp_data[0] = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -297,7 +297,7 @@ void displayrooms(int snum, double smoothratio)
|
|||
else
|
||||
{
|
||||
// Fixme: This should get the aspect ratio from the backend, not the current viewport size.
|
||||
int i = DivScale(1, isRR() ? 64 : p->GetActor()->s->yrepeat + 28, 22);
|
||||
int i = DivScale(1, isRR() ? 64 : p->GetActor()->spr.yrepeat + 28, 22);
|
||||
int viewingaspect = !isRRRA() || !p->DrugMode ? xs_CRoundToInt(double(i) * tan(r_fov * (pi::pi() / 360.))) : getdrugmode(p, i);
|
||||
renderSetAspect(MulScale(viewingaspect, viewingrange, 16), yxaspect);
|
||||
|
||||
|
@ -386,7 +386,7 @@ void displayrooms(int snum, double smoothratio)
|
|||
cang += buildang((2 - ((earthquaketime) & 2)) << 2);
|
||||
}
|
||||
|
||||
if (p->GetActor()->s->pal == 1) cposz -= (18 << 8);
|
||||
if (p->GetActor()->spr.pal == 1) cposz -= (18 << 8);
|
||||
|
||||
else if (p->spritebridge == 0 && p->newOwner == nullptr)
|
||||
{
|
||||
|
|
|
@ -120,17 +120,17 @@ int check_activator_motion(int lotag)
|
|||
DukeStatIterator it(STAT_ACTIVATOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag == lotag)
|
||||
if (act->spr.lotag == lotag)
|
||||
{
|
||||
for (int j = animatecnt - 1; j >= 0; j--)
|
||||
if (act->s->sector() == animatesect[j])
|
||||
if (act->spr.sector() == animatesect[j])
|
||||
return(1);
|
||||
|
||||
DukeStatIterator it1(STAT_EFFECTOR);
|
||||
while (auto act2 = it1.Next())
|
||||
{
|
||||
if (act->s->sector() == act2->s->sector())
|
||||
switch (act2->s->lotag)
|
||||
if (act->spr.sector() == act2->spr.sector())
|
||||
switch (act2->spr.lotag)
|
||||
{
|
||||
case SE_11_SWINGING_DOOR:
|
||||
case SE_30_TWO_WAY_TRAIN:
|
||||
|
@ -217,7 +217,7 @@ int findplayer(const DDukeActor* actor, int* d)
|
|||
{
|
||||
int j, closest_player;
|
||||
int x, closest;
|
||||
auto s = &actor->s->pos;
|
||||
auto s = &actor->spr.pos;
|
||||
|
||||
if (ud.multimode < 2)
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ int findplayer(const DDukeActor* actor, int* d)
|
|||
for (j = connecthead; j >= 0; j = connectpoint2[j])
|
||||
{
|
||||
x = abs(ps[j].oposx - s->x) + abs(ps[j].oposy - s->y) + ((abs(ps[j].oposz - s->z + (28 << 8))) >> 4);
|
||||
if (x < closest && ps[j].GetActor()->s->extra > 0)
|
||||
if (x < closest && ps[j].GetActor()->spr.extra > 0)
|
||||
{
|
||||
closest_player = j;
|
||||
closest = x;
|
||||
|
@ -257,7 +257,7 @@ int findotherplayer(int p, int* d)
|
|||
closest_player = p;
|
||||
|
||||
for (j = connecthead; j >= 0; j = connectpoint2[j])
|
||||
if (p != j && ps[j].GetActor()->s->extra > 0)
|
||||
if (p != j && ps[j].GetActor()->spr.extra > 0)
|
||||
{
|
||||
x = abs(ps[j].oposx - ps[p].pos.x) + abs(ps[j].oposy - ps[p].pos.y) + (abs(ps[j].oposz - ps[p].pos.z) >> 4);
|
||||
|
||||
|
@ -358,10 +358,10 @@ void doanimations(void)
|
|||
DukeSectIterator it(dasectp);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->statnum != STAT_EFFECTOR)
|
||||
if (act->spr.statnum != STAT_EFFECTOR)
|
||||
{
|
||||
act->s->backupz();
|
||||
act->s->z += v;
|
||||
act->spr.backupz();
|
||||
act->spr.z += v;
|
||||
act->floorz = dasectp->floorz + v;
|
||||
}
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ int setanimation(sectortype* animsect, int animtype, sectortype* animtarget, int
|
|||
|
||||
bool activatewarpelevators(DDukeActor* actor, int d) //Parm = sectoreffectornum
|
||||
{
|
||||
auto sect = actor->s->sector();
|
||||
auto sect = actor->spr.sector();
|
||||
|
||||
// See if the sector exists
|
||||
|
||||
|
@ -457,9 +457,9 @@ bool activatewarpelevators(DDukeActor* actor, int d) //Parm = sectoreffectornum
|
|||
DDukeActor *act2;
|
||||
while ((act2 = it.Next()))
|
||||
{
|
||||
if (act2->s->lotag == SE_17_WARP_ELEVATOR || (isRRRA() && act2->s->lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL))
|
||||
if (act2->s->hitag == actor->s->hitag)
|
||||
if ((abs(sect->floorz - actor->temp_data[2]) > act2->s->yvel) ||
|
||||
if (act2->spr.lotag == SE_17_WARP_ELEVATOR || (isRRRA() && act2->spr.lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL))
|
||||
if (act2->spr.hitag == actor->spr.hitag)
|
||||
if ((abs(sect->floorz - actor->temp_data[2]) > act2->spr.yvel) ||
|
||||
(act2->sector()->hitag == (sect->hitag - d)))
|
||||
break;
|
||||
}
|
||||
|
@ -480,8 +480,8 @@ bool activatewarpelevators(DDukeActor* actor, int d) //Parm = sectoreffectornum
|
|||
it.Reset(STAT_EFFECTOR);
|
||||
while ((act2 = it.Next()))
|
||||
{
|
||||
if (act2->s->lotag == SE_17_WARP_ELEVATOR || (isRRRA() && act2->s->lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL))
|
||||
if (act2->s->hitag == actor->s->hitag)
|
||||
if (act2->spr.lotag == SE_17_WARP_ELEVATOR || (isRRRA() && act2->spr.lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL))
|
||||
if (act2->spr.hitag == actor->spr.hitag)
|
||||
{
|
||||
act2->temp_data[0] = d;
|
||||
act2->temp_data[1] = d; //Make all check warp
|
||||
|
@ -588,17 +588,17 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
|
|||
|
||||
static void handle_st15(sectortype* sptr, DDukeActor* actor)
|
||||
{
|
||||
if (actor->s->picnum != TILE_APLAYER) return;
|
||||
if (actor->spr.picnum != TILE_APLAYER) return;
|
||||
|
||||
DukeSectIterator it(sptr);
|
||||
DDukeActor* a2;
|
||||
while ((a2 = it.Next()))
|
||||
{
|
||||
if (a2->s->picnum == SECTOREFFECTOR && a2->s->lotag == ST_17_PLATFORM_UP) break;
|
||||
if (a2->spr.picnum == SECTOREFFECTOR && a2->spr.lotag == ST_17_PLATFORM_UP) break;
|
||||
}
|
||||
if (!a2) return;
|
||||
|
||||
if (actor->s->sector() == sptr)
|
||||
if (actor->spr.sector() == sptr)
|
||||
{
|
||||
if (activatewarpelevators(a2, -1))
|
||||
activatewarpelevators(a2, 1);
|
||||
|
@ -608,7 +608,7 @@ static void handle_st15(sectortype* sptr, DDukeActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (sptr->floorz > a2->s->z)
|
||||
if (sptr->floorz > a2->spr.z)
|
||||
activatewarpelevators(a2, -1);
|
||||
else
|
||||
activatewarpelevators(a2, 1);
|
||||
|
@ -685,8 +685,8 @@ static void handle_st29(sectortype* sptr, DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if ((act2->s->lotag == 22) &&
|
||||
(act2->s->hitag == sptr->hitag))
|
||||
if ((act2->spr.lotag == 22) &&
|
||||
(act2->spr.hitag == sptr->hitag))
|
||||
{
|
||||
act2->sector()->extra = -act2->sector()->extra;
|
||||
|
||||
|
@ -719,9 +719,9 @@ REDODOOR:
|
|||
DukeSectIterator it(sptr);
|
||||
while ((a2 = it.Next()))
|
||||
{
|
||||
if (a2->s->statnum == 3 && a2->s->lotag == 9)
|
||||
if (a2->spr.statnum == 3 && a2->spr.lotag == 9)
|
||||
{
|
||||
j = a2->s->z;
|
||||
j = a2->spr.z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ static void handle_st23(sectortype* sptr, DDukeActor* actor)
|
|||
DDukeActor* act2;
|
||||
while ((act2 = it.Next()))
|
||||
{
|
||||
if (act2->s->lotag == SE_11_SWINGING_DOOR && act2->s->sector() == sptr && !act2->temp_data[4])
|
||||
if (act2->spr.lotag == SE_11_SWINGING_DOOR && act2->spr.sector() == sptr && !act2->temp_data[4])
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -834,7 +834,7 @@ static void handle_st23(sectortype* sptr, DDukeActor* actor)
|
|||
|
||||
while (auto act3 = it.Next())
|
||||
{
|
||||
if (l == (act3->sector()->lotag & 0x8000) && act3->s->lotag == SE_11_SWINGING_DOOR && act2->s->hitag == act3->s->hitag && act3->temp_data[4])
|
||||
if (l == (act3->sector()->lotag & 0x8000) && act3->spr.lotag == SE_11_SWINGING_DOOR && act2->spr.hitag == act3->spr.hitag && act3->temp_data[4])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -843,7 +843,7 @@ static void handle_st23(sectortype* sptr, DDukeActor* actor)
|
|||
it.Reset(STAT_EFFECTOR);
|
||||
while (auto act3 = it.Next())
|
||||
{
|
||||
if (l == (act3->sector()->lotag & 0x8000) && act3->s->lotag == SE_11_SWINGING_DOOR && act2->s->hitag == act3->s->hitag)
|
||||
if (l == (act3->sector()->lotag & 0x8000) && act3->spr.lotag == SE_11_SWINGING_DOOR && act2->spr.hitag == act3->spr.hitag)
|
||||
{
|
||||
if (act3->sector()->lotag & 0x8000) act3->sector()->lotag &= 0x7fff;
|
||||
else act3->sector()->lotag |= 0x8000;
|
||||
|
@ -871,7 +871,7 @@ static void handle_st25(sectortype* sptr, DDukeActor* actor)
|
|||
DDukeActor* act2;
|
||||
while ((act2 = it.Next()))
|
||||
{
|
||||
if (act2->s->lotag == 15 && act2->s->sector() == sptr)
|
||||
if (act2->spr.lotag == 15 && act2->spr.sector() == sptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -883,12 +883,12 @@ static void handle_st25(sectortype* sptr, DDukeActor* actor)
|
|||
it.Reset(STAT_EFFECTOR);
|
||||
while (auto act3 = it.Next())
|
||||
{
|
||||
if (act3->s->hitag == act2->s->hitag)
|
||||
if (act3->spr.hitag == act2->spr.hitag)
|
||||
{
|
||||
if (act3->s->lotag == 15)
|
||||
if (act3->spr.lotag == 15)
|
||||
{
|
||||
act3->sector()->lotag ^= 0x8000; // Toggle the open or close
|
||||
act3->s->ang += 1024;
|
||||
act3->spr.ang += 1024;
|
||||
if (act3->temp_data[4]) callsound(act3->sector(), act3);
|
||||
callsound(act3->sector(), act3);
|
||||
if (act3->sector()->lotag & 0x8000) act3->temp_data[4] = 1;
|
||||
|
@ -909,7 +909,7 @@ static void handle_st27(sectortype* sptr, DDukeActor* actor)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if ((act2->s->lotag & 0xff) == 20 && act2->s->sector() == sptr) //Bridge
|
||||
if ((act2->spr.lotag & 0xff) == 20 && act2->spr.sector() == sptr) //Bridge
|
||||
{
|
||||
|
||||
sptr->lotag ^= 0x8000;
|
||||
|
@ -935,9 +935,9 @@ static void handle_st28(sectortype* sptr, DDukeActor* actor)
|
|||
DukeSectIterator it(sptr);
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (a2->s->statnum == 3 && (a2->s->lotag & 0xff) == 21)
|
||||
if (a2->spr.statnum == 3 && (a2->spr.lotag & 0xff) == 21)
|
||||
{
|
||||
j = a2->s->hitag;
|
||||
j = a2->spr.hitag;
|
||||
break; //Found it
|
||||
}
|
||||
}
|
||||
|
@ -946,8 +946,8 @@ static void handle_st28(sectortype* sptr, DDukeActor* actor)
|
|||
DukeStatIterator it1(STAT_EFFECTOR);
|
||||
while (auto act3 = it.Next())
|
||||
{
|
||||
if ((act3->s->lotag & 0xff) == 21 && !act3->temp_data[0] &&
|
||||
(act3->s->hitag) == j)
|
||||
if ((act3->spr.lotag & 0xff) == 21 && !act3->temp_data[0] &&
|
||||
(act3->spr.hitag) == j)
|
||||
act3->temp_data[0] = 1;
|
||||
}
|
||||
callsound(sptr, actor);
|
||||
|
@ -985,8 +985,8 @@ void operatesectors(sectortype* sptr, DDukeActor *actor)
|
|||
auto act = barrier_cast<DDukeActor*>(sptr->hitagactor);
|
||||
if (!act) break;
|
||||
if (act->tempang == 0 || act->tempang == 256) callsound(sptr, actor);
|
||||
if (act->s->extra == 1) act->s->extra = 3;
|
||||
else act->s->extra = 1;
|
||||
if (act->spr.extra == 1) act->spr.extra = 3;
|
||||
else act->spr.extra = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1102,9 +1102,9 @@ void operateactivators(int low, int plnum)
|
|||
DukeStatIterator it(STAT_ACTIVATOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag == low)
|
||||
if (act->spr.lotag == low)
|
||||
{
|
||||
if (act->s->picnum == ACTIVATORLOCKED)
|
||||
if (act->spr.picnum == ACTIVATORLOCKED)
|
||||
{
|
||||
act->sector()->lotag ^= 16384;
|
||||
|
||||
|
@ -1117,7 +1117,7 @@ void operateactivators(int low, int plnum)
|
|||
}
|
||||
else
|
||||
{
|
||||
switch (act->s->hitag)
|
||||
switch (act->spr.hitag)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
@ -1140,7 +1140,7 @@ void operateactivators(int low, int plnum)
|
|||
DukeSectIterator it(act->sector());
|
||||
while (auto a2 = it.Next())
|
||||
{
|
||||
if (a2->s->statnum == 3) switch (a2->s->lotag)
|
||||
if (a2->spr.statnum == 3) switch (a2->spr.lotag)
|
||||
{
|
||||
case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
|
||||
if (isRRRA()) break;
|
||||
|
@ -1177,8 +1177,8 @@ void operatemasterswitches(int low)
|
|||
DukeStatIterator it(STAT_STANDABLE);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->picnum == MASTERSWITCH && act2->s->lotag == low && act2->s->yvel == 0)
|
||||
act2->s->yvel = 1;
|
||||
if (act2->spr.picnum == MASTERSWITCH && act2->spr.lotag == low && act2->spr.yvel == 0)
|
||||
act2->spr.yvel = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ void operateforcefields_common(DDukeActor *effector, int low, const std::initial
|
|||
{
|
||||
wal->cstat = 0;
|
||||
|
||||
if (effector && effector->s->picnum == SECTOREFFECTOR && effector->s->lotag == 30)
|
||||
if (effector && effector->spr.picnum == SECTOREFFECTOR && effector->spr.lotag == 30)
|
||||
wal->lotag = 0;
|
||||
}
|
||||
else
|
||||
|
@ -1237,12 +1237,12 @@ void allignwarpelevators(void)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag == SE_17_WARP_ELEVATOR && act->s->shade > 16)
|
||||
if (act->spr.lotag == SE_17_WARP_ELEVATOR && act->spr.shade > 16)
|
||||
{
|
||||
DukeStatIterator it1(STAT_EFFECTOR);
|
||||
while (auto act2 = it1.Next())
|
||||
{
|
||||
if ((act2->s->lotag) == SE_17_WARP_ELEVATOR && act != act2 && act->s->hitag == act2->s->hitag)
|
||||
if ((act2->spr.lotag) == SE_17_WARP_ELEVATOR && act != act2 && act->spr.hitag == act2->spr.hitag)
|
||||
{
|
||||
act2->sector()->floorz = act->sector()->floorz;
|
||||
act2->sector()->ceilingz = act->sector()->ceilingz;
|
||||
|
|
|
@ -191,17 +191,17 @@ void operaterespawns_d(int low)
|
|||
DukeStatIterator it(STAT_FX);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag == low) switch (act->s->picnum)
|
||||
if (act->spr.lotag == low) switch (act->spr.picnum)
|
||||
{
|
||||
case RESPAWN:
|
||||
if (badguypic(act->s->hitag) && ud.monsters_off) break;
|
||||
if (badguypic(act->spr.hitag) && ud.monsters_off) break;
|
||||
|
||||
auto star = spawn(act, TRANSPORTERSTAR);
|
||||
if (star)
|
||||
{
|
||||
star->s->z -= (32 << 8);
|
||||
star->spr.z -= (32 << 8);
|
||||
|
||||
act->s->extra = 66 - 12; // Just a way to killit
|
||||
act->spr.extra = 66 - 12; // Just a way to killit
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -237,13 +237,13 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
|
|||
|
||||
if (act)
|
||||
{
|
||||
lotag = act->s->lotag;
|
||||
lotag = act->spr.lotag;
|
||||
if (lotag == 0) return 0;
|
||||
hitag = act->s->hitag;
|
||||
sx = act->s->x;
|
||||
sy = act->s->y;
|
||||
picnum = act->s->picnum;
|
||||
switchpal = act->s->pal;
|
||||
hitag = act->spr.hitag;
|
||||
sx = act->spr.x;
|
||||
sy = act->spr.y;
|
||||
picnum = act->spr.picnum;
|
||||
switchpal = act->spr.pal;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
|
|||
if (act)
|
||||
{
|
||||
StopCommentary();
|
||||
act->s->picnum = DEVELOPERCOMMENTARY;
|
||||
act->spr.picnum = DEVELOPERCOMMENTARY;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -277,7 +277,7 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
|
|||
if (act)
|
||||
{
|
||||
if (StartCommentary(lotag, act))
|
||||
act->s->picnum = DEVELOPERCOMMENTARY+1;
|
||||
act->spr.picnum = DEVELOPERCOMMENTARY+1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -555,9 +555,9 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto other = it.Next())
|
||||
{
|
||||
if (other->s->hitag == lotag)
|
||||
if (other->spr.hitag == lotag)
|
||||
{
|
||||
switch (other->s->lotag)
|
||||
switch (other->spr.lotag)
|
||||
{
|
||||
case SE_12_LIGHT_SWITCH:
|
||||
other->sector()->floorpal = 0;
|
||||
|
@ -623,9 +623,9 @@ void activatebysector_d(sectortype* sect, DDukeActor* activator)
|
|||
DukeSectIterator it(sect);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == ACTIVATOR)
|
||||
if (act->spr.picnum == ACTIVATOR)
|
||||
{
|
||||
operateactivators(act->s->lotag, -1);
|
||||
operateactivators(act->spr.lotag, -1);
|
||||
didit = 1;
|
||||
// return;
|
||||
}
|
||||
|
@ -686,14 +686,14 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
else
|
||||
{
|
||||
if (atwith == CHAINGUN)
|
||||
spawned = EGS(sptr, x, y, z, FORCERIPPLE, -127, 16 + spr->s->xrepeat, 16 + spr->s->yrepeat, 0, 0, 0, spr, 5);
|
||||
spawned = EGS(sptr, x, y, z, FORCERIPPLE, -127, 16 + spr->spr.xrepeat, 16 + spr->spr.yrepeat, 0, 0, 0, spr, 5);
|
||||
else spawned = EGS(sptr, x, y, z, FORCERIPPLE, -127, 32, 32, 0, 0, 0, spr, 5);
|
||||
}
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER;
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER;
|
||||
auto delta = wal->delta();
|
||||
spawned->s->ang = getangle(-delta.x, -delta.y) - 512;
|
||||
spawned->spr.ang = getangle(-delta.x, -delta.y) - 512;
|
||||
|
||||
S_PlayActorSound(SOMETHINGHITFORCE, spawned);
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
auto spawned = EGS(sptr, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, spr, 3);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->lotag = SE_128_GLASS_BREAKING;
|
||||
spawned->spr.lotag = SE_128_GLASS_BREAKING;
|
||||
spawned->temp_data[1] = 5;
|
||||
spawned->temp_walls[0] = wal;
|
||||
S_PlayActorSound(GLASS_BREAKING, spawned);
|
||||
|
@ -878,7 +878,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto effector = it.Next())
|
||||
{
|
||||
if (effector->s->hitag == wal->lotag && effector->s->lotag == 3)
|
||||
if (effector->spr.hitag == wal->lotag && effector->spr.lotag == 3)
|
||||
{
|
||||
effector->temp_data[2] = j;
|
||||
effector->temp_data[3] = darkestwall;
|
||||
|
@ -899,12 +899,12 @@ void checkplayerhurt_d(struct player_struct* p, const Collision& coll)
|
|||
{
|
||||
if (coll.type == kHitSprite)
|
||||
{
|
||||
switch (coll.actor()->s->picnum)
|
||||
switch (coll.actor()->spr.picnum)
|
||||
{
|
||||
case CACTUS:
|
||||
if (p->hurt_delay < 8)
|
||||
{
|
||||
p->GetActor()->s->extra -= 5;
|
||||
p->GetActor()->spr.extra -= 5;
|
||||
p->hurt_delay = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
|
||||
|
@ -923,7 +923,7 @@ void checkplayerhurt_d(struct player_struct* p, const Collision& coll)
|
|||
case W_FORCEFIELD:
|
||||
case W_FORCEFIELD + 1:
|
||||
case W_FORCEFIELD + 2:
|
||||
p->GetActor()->s->extra -= 5;
|
||||
p->GetActor()->spr.extra -= 5;
|
||||
|
||||
p->hurt_delay = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
|
@ -996,12 +996,12 @@ bool checkhitceiling_d(sectortype* sectp)
|
|||
DukeSectIterator it(sectp);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == SECTOREFFECTOR && act->s->lotag == 12)
|
||||
if (act->spr.picnum == SECTOREFFECTOR && act->spr.lotag == 12)
|
||||
{
|
||||
DukeStatIterator it1(STAT_EFFECTOR);
|
||||
while (auto act2 = it1.Next())
|
||||
{
|
||||
if (act2->s->hitag == act->s->hitag)
|
||||
if (act2->spr.hitag == act->spr.hitag)
|
||||
act2->temp_data[3] = 1;
|
||||
}
|
||||
break;
|
||||
|
@ -1013,7 +1013,7 @@ bool checkhitceiling_d(sectortype* sectp)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->hitag == (sectp->hitag) && act->s->lotag == 3)
|
||||
if (act->spr.hitag == (sectp->hitag) && act->spr.lotag == 3)
|
||||
{
|
||||
act->temp_data[2] = j;
|
||||
act->temp_data[4] = 1;
|
||||
|
@ -1114,7 +1114,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
for (k = 0; k < 64; k++)
|
||||
{
|
||||
auto j = EGS(s->sector(), s->x, s->y, s->z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (s->zvel >> 2), targ, 5);
|
||||
j->s->pal = 8;
|
||||
j->spr.pal = 8;
|
||||
}
|
||||
|
||||
if (s->picnum == CACTUS)
|
||||
|
@ -1314,7 +1314,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
}
|
||||
{
|
||||
auto j = spawn(targ, STEAM);
|
||||
if (j) j->s->z = s->sector()->floorz - (32 << 8);
|
||||
if (j) j->spr.z = s->sector()->floorz - (32 << 8);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1400,17 +1400,17 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
if (spawned)
|
||||
{
|
||||
if (pspr->pal == 6)
|
||||
spawned->s->pal = 6;
|
||||
spawned->s->z += (4 << 8);
|
||||
spawned->s->xvel = 16;
|
||||
spawned->s->xrepeat = spawned->s->yrepeat = 24;
|
||||
spawned->s->ang += 32 - (krand() & 63);
|
||||
spawned->spr.pal = 6;
|
||||
spawned->spr.z += (4 << 8);
|
||||
spawned->spr.xvel = 16;
|
||||
spawned->spr.xrepeat = spawned->spr.yrepeat = 24;
|
||||
spawned->spr.ang += 32 - (krand() & 63);
|
||||
}
|
||||
}
|
||||
|
||||
auto Owner = proj->GetOwner();
|
||||
|
||||
if (Owner && Owner->s->picnum == APLAYER && s->picnum != ROTATEGUN && s->picnum != DRONE)
|
||||
if (Owner && Owner->spr.picnum == APLAYER && s->picnum != ROTATEGUN && s->picnum != DRONE)
|
||||
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
|
||||
{
|
||||
fi.shoot(targ, BLOODSPLAT3);
|
||||
|
@ -1446,13 +1446,13 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
int hitpic = pspr->picnum;
|
||||
auto Owner = proj->GetOwner();
|
||||
if (Owner && Owner->s->picnum == APLAYER)
|
||||
if (Owner && Owner->spr.picnum == APLAYER)
|
||||
{
|
||||
if (s->picnum == APLAYER && ud.coop != 0 && ud.ffire == 0)
|
||||
return;
|
||||
|
||||
auto tOwner = targ->GetOwner();
|
||||
if (isWorldTour() && hitpic == FIREBALL && tOwner && tOwner->s->picnum != FIREBALL)
|
||||
if (isWorldTour() && hitpic == FIREBALL && tOwner && tOwner->spr.picnum != FIREBALL)
|
||||
hitpic = FLAMETHROWERFLAME;
|
||||
}
|
||||
|
||||
|
@ -1478,7 +1478,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if (j->s->picnum == CAMERA1) j->s->yvel = 0;
|
||||
if (j->spr.picnum == CAMERA1) j->spr.yvel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1486,7 +1486,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
return;
|
||||
|
||||
auto hitowner = targ->GetHitOwner();
|
||||
if (!hitowner || hitowner->s->picnum != APLAYER)
|
||||
if (!hitowner || hitowner->spr.picnum != APLAYER)
|
||||
if (ud.player_skill >= 3)
|
||||
pspr->extra += (pspr->extra >> 1);
|
||||
}
|
||||
|
@ -1516,7 +1516,7 @@ void clearcameras(int i, player_struct* p)
|
|||
DukeStatIterator it(STAT_ACTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == CAMERA1) act->s->yvel = 0;
|
||||
if (act->spr.picnum == CAMERA1) act->spr.yvel = 0;
|
||||
}
|
||||
}
|
||||
else if (p->newOwner != nullptr)
|
||||
|
@ -1572,7 +1572,7 @@ void checksectors_d(int snum)
|
|||
|
||||
//After this point the the player effects the map with space
|
||||
|
||||
if (chatmodeon || p->GetActor()->s->extra <= 0) return;
|
||||
if (chatmodeon || p->GetActor()->spr.extra <= 0) return;
|
||||
|
||||
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
||||
fi.lotsofmoney(p->GetActor(), 2);
|
||||
|
@ -1633,7 +1633,7 @@ void checksectors_d(int snum)
|
|||
neartag({ p->pos.x, p->pos.y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3);
|
||||
if (near.actor() != nullptr)
|
||||
{
|
||||
switch (near.actor()->s->picnum)
|
||||
switch (near.actor()->spr.picnum)
|
||||
{
|
||||
case FEM1:
|
||||
case FEM2:
|
||||
|
@ -1659,7 +1659,7 @@ void checksectors_d(int snum)
|
|||
|
||||
if (p->newOwner == nullptr && near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
||||
if (isanunderoperator(p->GetActor()->sector()->lotag))
|
||||
near.hitSector = p->GetActor()->s->sector();
|
||||
near.hitSector = p->GetActor()->spr.sector();
|
||||
|
||||
if (near.hitSector && (near.hitSector->lotag & 16384))
|
||||
return;
|
||||
|
@ -1679,7 +1679,7 @@ void checksectors_d(int snum)
|
|||
{
|
||||
if (fi.checkhitswitch(snum, nullptr, neartagsprite)) return;
|
||||
|
||||
switch (neartagsprite->s->picnum)
|
||||
switch (neartagsprite->spr.picnum)
|
||||
{
|
||||
case TOILET:
|
||||
case STALL:
|
||||
|
@ -1694,13 +1694,13 @@ void checksectors_d(int snum)
|
|||
p->holster_weapon = 1;
|
||||
p->weapon_pos = -1;
|
||||
}
|
||||
if (p->GetActor()->s->extra <= (gs.max_player_health - (gs.max_player_health / 10)))
|
||||
if (p->GetActor()->spr.extra <= (gs.max_player_health - (gs.max_player_health / 10)))
|
||||
{
|
||||
p->GetActor()->s->extra += gs.max_player_health / 10;
|
||||
p->last_extra = p->GetActor()->s->extra;
|
||||
p->GetActor()->spr.extra += gs.max_player_health / 10;
|
||||
p->last_extra = p->GetActor()->spr.extra;
|
||||
}
|
||||
else if (p->GetActor()->s->extra < gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
else if (p->GetActor()->spr.extra < gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
}
|
||||
else if (S_CheckActorSoundPlaying(neartagsprite, FLUSH_TOILET) == 0)
|
||||
S_PlayActorSound(FLUSH_TOILET, neartagsprite);
|
||||
|
@ -1715,9 +1715,9 @@ void checksectors_d(int snum)
|
|||
{
|
||||
neartagsprite->temp_data[0] = 1;
|
||||
neartagsprite->SetOwner(p->GetActor());
|
||||
p->buttonpalette = neartagsprite->s->pal;
|
||||
p->buttonpalette = neartagsprite->spr.pal;
|
||||
if (p->buttonpalette)
|
||||
ud.secretlevel = neartagsprite->s->lotag;
|
||||
ud.secretlevel = neartagsprite->spr.lotag;
|
||||
else ud.secretlevel = 0;
|
||||
}
|
||||
return;
|
||||
|
@ -1728,16 +1728,16 @@ void checksectors_d(int snum)
|
|||
neartagsprite->temp_data[0] = 1;
|
||||
neartagsprite->SetOwner(p->GetActor());
|
||||
|
||||
if (p->GetActor()->s->extra < gs.max_player_health)
|
||||
if (p->GetActor()->spr.extra < gs.max_player_health)
|
||||
{
|
||||
p->GetActor()->s->extra++;
|
||||
p->GetActor()->spr.extra++;
|
||||
S_PlayActorSound(DUKE_DRINKING, p->GetActor());
|
||||
}
|
||||
}
|
||||
return;
|
||||
case PLUG:
|
||||
S_PlayActorSound(SHORT_CIRCUIT, pact);
|
||||
p->GetActor()->s->extra -= 2 + (krand() & 3);
|
||||
p->GetActor()->spr.extra -= 2 + (krand() & 3);
|
||||
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
||||
break;
|
||||
case VIEWSCREEN:
|
||||
|
@ -1747,13 +1747,13 @@ void checksectors_d(int snum)
|
|||
while (auto acti = it.Next())
|
||||
{
|
||||
auto spr = acti->s;
|
||||
if (spr->picnum == CAMERA1 && spr->yvel == 0 && neartagsprite->s->hitag == spr->lotag)
|
||||
if (spr->picnum == CAMERA1 && spr->yvel == 0 && neartagsprite->spr.hitag == spr->lotag)
|
||||
{
|
||||
spr->yvel = 1; //Using this camera
|
||||
if (snum == screenpeek) S_PlaySound(MONITOR_ACTIVE);
|
||||
|
||||
neartagsprite->SetOwner(acti);
|
||||
neartagsprite->s->yvel = 1;
|
||||
neartagsprite->spr.yvel = 1;
|
||||
camsprite = neartagsprite;
|
||||
|
||||
// parallaxtype = 2;
|
||||
|
@ -1805,7 +1805,7 @@ void checksectors_d(int snum)
|
|||
DukeSectIterator it(near.hitSector);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == ACTIVATOR || act->s->picnum == MASTERSWITCH)
|
||||
if (act->spr.picnum == ACTIVATOR || act->spr.picnum == MASTERSWITCH)
|
||||
return;
|
||||
}
|
||||
operatesectors(near.hitSector, p->GetActor());
|
||||
|
@ -1817,7 +1817,7 @@ void checksectors_d(int snum)
|
|||
DukeSectIterator it(p->GetActor()->sector());
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == ACTIVATOR || act->s->picnum == MASTERSWITCH) return;
|
||||
if (act->spr.picnum == ACTIVATOR || act->spr.picnum == MASTERSWITCH) return;
|
||||
}
|
||||
operatesectors(p->GetActor()->sector(), p->GetActor());
|
||||
}
|
||||
|
|
|
@ -306,16 +306,16 @@ void operaterespawns_r(int low)
|
|||
DukeStatIterator it(STAT_FX);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->lotag == low) switch (act->s->picnum)
|
||||
if (act->spr.lotag == low) switch (act->spr.picnum)
|
||||
{
|
||||
case RESPAWN:
|
||||
{
|
||||
if (badguypic(act->s->hitag) && ud.monsters_off) break;
|
||||
if (badguypic(act->spr.hitag) && ud.monsters_off) break;
|
||||
|
||||
auto star = spawn(act, TRANSPORTERSTAR);
|
||||
if (star) star->s->z -= (32 << 8);
|
||||
if (star) star->spr.z -= (32 << 8);
|
||||
|
||||
act->s->extra = 66 - 12; // Just a way to killit
|
||||
act->spr.extra = 66 - 12; // Just a way to killit
|
||||
break;
|
||||
}
|
||||
case RRTILE7424:
|
||||
|
@ -356,13 +356,13 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
|||
|
||||
if (act)
|
||||
{
|
||||
lotag = act->s->lotag;
|
||||
lotag = act->spr.lotag;
|
||||
if (lotag == 0) return 0;
|
||||
hitag = act->s->hitag;
|
||||
sx = act->s->x;
|
||||
sy = act->s->y;
|
||||
picnum = act->s->picnum;
|
||||
switchpal = act->s->pal;
|
||||
hitag = act->spr.hitag;
|
||||
sx = act->spr.x;
|
||||
sy = act->spr.y;
|
||||
picnum = act->spr.picnum;
|
||||
switchpal = act->spr.pal;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -555,14 +555,14 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
|||
DukeStatIterator it1(107);
|
||||
while (auto other2 = it1.Next())
|
||||
{
|
||||
if (other2->s->picnum == RRTILE3410)
|
||||
if (other2->spr.picnum == RRTILE3410)
|
||||
{
|
||||
other2->s->picnum++;
|
||||
other2->s->hitag = 100;
|
||||
other2->s->extra = 0;
|
||||
other2->spr.picnum++;
|
||||
other2->spr.hitag = 100;
|
||||
other2->spr.extra = 0;
|
||||
S_PlayActorSound(474, other2);
|
||||
}
|
||||
else if (other2->s->picnum == RRTILE295)
|
||||
else if (other2->spr.picnum == RRTILE295)
|
||||
deletesprite(other2);
|
||||
}
|
||||
si->picnum++;
|
||||
|
@ -765,11 +765,11 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
|||
{
|
||||
BellTime = 132;
|
||||
BellSprite = act;
|
||||
act->s->picnum++;
|
||||
act->spr.picnum++;
|
||||
}
|
||||
else if (picnum == RRTILE8464)
|
||||
{
|
||||
act->s->picnum = act->s->picnum + 1;
|
||||
act->spr.picnum = act->spr.picnum + 1;
|
||||
if (hitag == 10001)
|
||||
{
|
||||
if (ps[snum].SeaSick == 0)
|
||||
|
@ -793,8 +793,8 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
|||
DukeSpriteIterator it;
|
||||
while (auto actt = it.Next())
|
||||
{
|
||||
int jpn = actt->s->picnum;
|
||||
int jht = actt->s->hitag;
|
||||
int jpn = actt->spr.picnum;
|
||||
int jht = actt->spr.hitag;
|
||||
if ((jpn == MULTISWITCH || jpn == MULTISWITCH2) && jht == 10000)
|
||||
{
|
||||
if (switchcount < 3)
|
||||
|
@ -814,11 +814,11 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
|||
S_PlaySound3D(78, act, &v);
|
||||
for (j = 0; j < switchcount; j++)
|
||||
{
|
||||
switches[j]->s->hitag = 0;
|
||||
switches[j]->spr.hitag = 0;
|
||||
if (picnum >= MULTISWITCH2)
|
||||
switches[j]->s->picnum = MULTISWITCH2 + 3;
|
||||
switches[j]->spr.picnum = MULTISWITCH2 + 3;
|
||||
else
|
||||
switches[j]->s->picnum = MULTISWITCH + 3;
|
||||
switches[j]->spr.picnum = MULTISWITCH + 3;
|
||||
checkhitswitch_r(snum, nullptr, switches[j]);
|
||||
}
|
||||
}
|
||||
|
@ -839,9 +839,9 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto other = it.Next())
|
||||
{
|
||||
if (other->s->hitag == lotag)
|
||||
if (other->spr.hitag == lotag)
|
||||
{
|
||||
switch (other->s->lotag)
|
||||
switch (other->spr.lotag)
|
||||
{
|
||||
case 46:
|
||||
case SE_47_LIGHT_SWITCH:
|
||||
|
@ -910,9 +910,9 @@ void activatebysector_r(sectortype* sect, DDukeActor* activator)
|
|||
DukeSectIterator it(sect);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == ACTIVATOR)
|
||||
if (act->spr.picnum == ACTIVATOR)
|
||||
{
|
||||
operateactivators(act->s->lotag, -1);
|
||||
operateactivators(act->spr.lotag, -1);
|
||||
// return;
|
||||
}
|
||||
}
|
||||
|
@ -1043,7 +1043,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
auto spawned = EGS(sptr, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, spr, 3);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->lotag = SE_128_GLASS_BREAKING;
|
||||
spawned->spr.lotag = SE_128_GLASS_BREAKING;
|
||||
spawned->temp_walls[0] = wal;
|
||||
S_PlayActorSound(GLASS_BREAKING, spawned);
|
||||
}
|
||||
|
@ -1064,7 +1064,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
auto spawned = EGS(sptr, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, spr, 3);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->s->lotag = SE_128_GLASS_BREAKING;
|
||||
spawned->spr.lotag = SE_128_GLASS_BREAKING;
|
||||
spawned->temp_data[1] = 2;
|
||||
spawned->temp_walls[0] = wal;
|
||||
S_PlayActorSound(GLASS_BREAKING, spawned);
|
||||
|
@ -1107,7 +1107,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
if (wl.twoSided()) wl.nextSector()->lotag = 0;
|
||||
}
|
||||
s->sector()->lotag = 0;
|
||||
S_StopSound(act->s->lotag);
|
||||
S_StopSound(act->spr.lotag);
|
||||
S_PlayActorSound(400, act);
|
||||
deletesprite(act);
|
||||
}
|
||||
|
@ -1366,7 +1366,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->hitag == wal->lotag && act->s->lotag == 3)
|
||||
if (act->spr.hitag == wal->lotag && act->spr.lotag == 3)
|
||||
{
|
||||
act->temp_data[2] = j;
|
||||
act->temp_data[3] = darkestwall;
|
||||
|
@ -1387,7 +1387,7 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
|
|||
{
|
||||
if (coll.type == kHitSprite)
|
||||
{
|
||||
switch (coll.actor()->s->picnum)
|
||||
switch (coll.actor()->spr.picnum)
|
||||
{
|
||||
case RRTILE2430:
|
||||
case RRTILE2431:
|
||||
|
@ -1398,7 +1398,7 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
|
|||
case RRTILE2455:
|
||||
if (isRRRA() && p->hurt_delay2 < 8)
|
||||
{
|
||||
p->GetActor()->s->extra -= 2;
|
||||
p->GetActor()->spr.extra -= 2;
|
||||
p->hurt_delay2 = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
|
||||
|
@ -1407,7 +1407,7 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
|
|||
case CACTUS:
|
||||
if (!isRRRA() && p->hurt_delay < 8)
|
||||
{
|
||||
p->GetActor()->s->extra -= 5;
|
||||
p->GetActor()->spr.extra -= 5;
|
||||
p->hurt_delay = 16;
|
||||
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
||||
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
|
||||
|
@ -1511,7 +1511,7 @@ bool checkhitceiling_r(sectortype* sectp)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act2 = it.Next())
|
||||
{
|
||||
if (act2->s->hitag == spr1->hitag)
|
||||
if (act2->spr.hitag == spr1->hitag)
|
||||
act2->temp_data[3] = 1;
|
||||
}
|
||||
break;
|
||||
|
@ -1929,10 +1929,10 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
DukeSpriteIterator it;
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == RRTILE8679 && act->s->pal == 4)
|
||||
if (act->spr.picnum == RRTILE8679 && act->spr.pal == 4)
|
||||
{
|
||||
if (act->s->lotag == s->lotag)
|
||||
act->s->picnum = RRTILE8680;
|
||||
if (act->spr.lotag == s->lotag)
|
||||
act->spr.picnum = RRTILE8680;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1955,8 +1955,8 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
DukeSpriteIterator it;
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == RRTILE8094)
|
||||
act->s->picnum = RRTILE5088;
|
||||
if (act->spr.picnum == RRTILE8094)
|
||||
act->spr.picnum = RRTILE5088;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1969,10 +1969,10 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
DukeSpriteIterator it;
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == RRTILE2431 && act->s->pal == 4)
|
||||
if (act->spr.picnum == RRTILE2431 && act->spr.pal == 4)
|
||||
{
|
||||
if (s->lotag == act->s->lotag)
|
||||
act->s->picnum = RRTILE2451;
|
||||
if (s->lotag == act->spr.lotag)
|
||||
act->spr.picnum = RRTILE2451;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1996,14 +1996,14 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
DukeSpriteIterator it;
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == RRTILE2451 && act->s->pal == 4)
|
||||
if (act->spr.picnum == RRTILE2451 && act->spr.pal == 4)
|
||||
{
|
||||
if (s->lotag == act->s->lotag)
|
||||
if (s->lotag == act->spr.lotag)
|
||||
{
|
||||
fi.guts(targ, RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(targ, RRTILE2465, 3, myconnectindex);
|
||||
act->s->xrepeat = 0;
|
||||
act->s->yrepeat = 0;
|
||||
act->spr.xrepeat = 0;
|
||||
act->spr.yrepeat = 0;
|
||||
s->xrepeat = 0;
|
||||
s->yrepeat = 0;
|
||||
}
|
||||
|
@ -2173,7 +2173,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
for (k = 0; k < 64; k++)
|
||||
{
|
||||
auto j = EGS(s->sector(), s->x, s->y, s->z - (krand() % (48 << 8)), SCRAP6 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (s->zvel >> 2), targ, 5);
|
||||
j->s->pal = 8;
|
||||
j->spr.pal = 8;
|
||||
}
|
||||
|
||||
if (s->picnum == CACTUS)
|
||||
|
@ -2331,7 +2331,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
}
|
||||
{
|
||||
auto j = spawn(targ, STEAM);
|
||||
if (j) j->s->z = s->sector()->floorz - (32 << 8);
|
||||
if (j) j->spr.z = s->sector()->floorz - (32 << 8);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2377,17 +2377,17 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
if (spawned)
|
||||
{
|
||||
if (pspr->pal == 6)
|
||||
spawned->s->pal = 6;
|
||||
spawned->s->z += (4 << 8);
|
||||
spawned->s->xvel = 16;
|
||||
spawned->s->xrepeat = spawned->s->yrepeat = 24;
|
||||
spawned->s->ang += 32 - (krand() & 63);
|
||||
spawned->spr.pal = 6;
|
||||
spawned->spr.z += (4 << 8);
|
||||
spawned->spr.xvel = 16;
|
||||
spawned->spr.xrepeat = spawned->spr.yrepeat = 24;
|
||||
spawned->spr.ang += 32 - (krand() & 63);
|
||||
}
|
||||
}
|
||||
|
||||
auto Owner = proj->GetOwner();
|
||||
|
||||
if (Owner && Owner->s->picnum == APLAYER && s->picnum != DRONE)
|
||||
if (Owner && Owner->spr.picnum == APLAYER && s->picnum != DRONE)
|
||||
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
|
||||
{
|
||||
fi.shoot(targ, BLOODSPLAT3);
|
||||
|
@ -2430,11 +2430,11 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
DukeStatIterator it(STAT_EFFECTOR);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == CAMERA1) act->s->yvel = 0;
|
||||
if (act->spr.picnum == CAMERA1) act->spr.yvel = 0;
|
||||
}
|
||||
}
|
||||
auto Owner = targ->GetHitOwner();
|
||||
if (!Owner || Owner->s->picnum != APLAYER)
|
||||
if (!Owner || Owner->spr.picnum != APLAYER)
|
||||
if (ud.player_skill >= 3)
|
||||
pspr->extra += (pspr->extra >> 1);
|
||||
}
|
||||
|
@ -2497,7 +2497,7 @@ void checksectors_r(int snum)
|
|||
|
||||
//After this point the the player effects the map with space
|
||||
|
||||
if (chatmodeon || p->GetActor()->s->extra <= 0) return;
|
||||
if (chatmodeon || p->GetActor()->spr.extra <= 0) return;
|
||||
|
||||
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
||||
fi.lotsofmoney(p->GetActor(), 2);
|
||||
|
@ -2591,7 +2591,7 @@ void checksectors_r(int snum)
|
|||
neartag({ p->pos.x, p->pos.y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3);
|
||||
if (near.actor() != nullptr)
|
||||
{
|
||||
switch (near.actor()->s->picnum)
|
||||
switch (near.actor()->spr.picnum)
|
||||
{
|
||||
case FEM10:
|
||||
case NAKED1:
|
||||
|
@ -2610,7 +2610,7 @@ void checksectors_r(int snum)
|
|||
|
||||
if (p->newOwner == nullptr && near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
||||
if (isanunderoperator(p->GetActor()->sector()->lotag))
|
||||
near.hitSector = p->GetActor()->s->sector();
|
||||
near.hitSector = p->GetActor()->spr.sector();
|
||||
|
||||
if (near.hitSector && (near.hitSector->lotag & 16384))
|
||||
return;
|
||||
|
@ -2630,7 +2630,7 @@ void checksectors_r(int snum)
|
|||
{
|
||||
if (fi.checkhitswitch(snum, nullptr, neartagsprite)) return;
|
||||
|
||||
switch (neartagsprite->s->picnum)
|
||||
switch (neartagsprite->spr.picnum)
|
||||
{
|
||||
case RRTILE8448:
|
||||
if (!isRRRA()) return;
|
||||
|
@ -2679,7 +2679,7 @@ void checksectors_r(int snum)
|
|||
case RRTILE8594:
|
||||
case RRTILE8595:
|
||||
if (!isRRRA()) return;
|
||||
neartagsprite->s->extra = 60;
|
||||
neartagsprite->spr.extra = 60;
|
||||
S_PlayActorSound(235, neartagsprite);
|
||||
return;
|
||||
|
||||
|
@ -2698,13 +2698,13 @@ void checksectors_r(int snum)
|
|||
p->holster_weapon = 1;
|
||||
p->weapon_pos = -1;
|
||||
}
|
||||
if (p->GetActor()->s->extra <= (gs.max_player_health - (gs.max_player_health / 10)))
|
||||
if (p->GetActor()->spr.extra <= (gs.max_player_health - (gs.max_player_health / 10)))
|
||||
{
|
||||
p->GetActor()->s->extra += gs.max_player_health / 10;
|
||||
p->last_extra = p->GetActor()->s->extra;
|
||||
p->GetActor()->spr.extra += gs.max_player_health / 10;
|
||||
p->last_extra = p->GetActor()->spr.extra;
|
||||
}
|
||||
else if (p->GetActor()->s->extra < gs.max_player_health)
|
||||
p->GetActor()->s->extra = gs.max_player_health;
|
||||
else if (p->GetActor()->spr.extra < gs.max_player_health)
|
||||
p->GetActor()->spr.extra = gs.max_player_health;
|
||||
}
|
||||
else if (S_CheckActorSoundPlaying(pact, DUKE_GRUNT) == 0)
|
||||
S_PlayActorSound(DUKE_GRUNT, pact);
|
||||
|
@ -2715,16 +2715,16 @@ void checksectors_r(int snum)
|
|||
neartagsprite->temp_data[0] = 1;
|
||||
neartagsprite->SetOwner(p->GetActor());
|
||||
|
||||
if (p->GetActor()->s->extra < gs.max_player_health)
|
||||
if (p->GetActor()->spr.extra < gs.max_player_health)
|
||||
{
|
||||
p->GetActor()->s->extra++;
|
||||
p->GetActor()->spr.extra++;
|
||||
S_PlayActorSound(DUKE_DRINKING, pact);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case PLUG:
|
||||
S_PlayActorSound(SHORT_CIRCUIT, pact);
|
||||
p->GetActor()->s->extra -= 2 + (krand() & 3);
|
||||
p->GetActor()->spr.extra -= 2 + (krand() & 3);
|
||||
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
||||
break;
|
||||
}
|
||||
|
@ -2756,7 +2756,7 @@ void checksectors_r(int snum)
|
|||
DukeSectIterator it(near.hitSector);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == ACTIVATOR || act->s->picnum == MASTERSWITCH)
|
||||
if (act->spr.picnum == ACTIVATOR || act->spr.picnum == MASTERSWITCH)
|
||||
return;
|
||||
}
|
||||
if (haskey(near.hitSector, snum))
|
||||
|
@ -2777,11 +2777,11 @@ void checksectors_r(int snum)
|
|||
DukeSectIterator it(p->GetActor()->sector());
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == ACTIVATOR || act->s->picnum == MASTERSWITCH)
|
||||
if (act->spr.picnum == ACTIVATOR || act->spr.picnum == MASTERSWITCH)
|
||||
return;
|
||||
}
|
||||
if (haskey(near.hitSector, snum))
|
||||
operatesectors(p->GetActor()->s->sector(), p->GetActor());
|
||||
operatesectors(p->GetActor()->spr.sector(), p->GetActor());
|
||||
else
|
||||
{
|
||||
if (neartagsprite && neartagsprite->spriteextra > 3)
|
||||
|
@ -2922,7 +2922,7 @@ void tearitup(sectortype* sect)
|
|||
DukeSectIterator it(sect);
|
||||
while (auto act = it.Next())
|
||||
{
|
||||
if (act->s->picnum == DESTRUCTO)
|
||||
if (act->spr.picnum == DESTRUCTO)
|
||||
{
|
||||
act->picnum = SHOTSPARK1;
|
||||
act->extra = 1;
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
{
|
||||
UnloadSound(schan->SoundID);
|
||||
currentCommentarySound = 0;
|
||||
if (currentCommentarySprite) currentCommentarySprite->s->picnum = DEVELOPERCOMMENTARY;
|
||||
if (currentCommentarySprite) currentCommentarySprite->spr.picnum = DEVELOPERCOMMENTARY;
|
||||
I_SetRelativeVolume(1.0f);
|
||||
UnmuteSounds();
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ int S_DefineSound(unsigned index, const char *filename, int minpitch, int maxpit
|
|||
|
||||
inline bool S_IsAmbientSFX(DDukeActor* actor)
|
||||
{
|
||||
return (actor->s->picnum == MUSICANDSFX && actor->s->lotag < 999);
|
||||
return (actor->spr.picnum == MUSICANDSFX && actor->spr.lotag < 999);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -322,9 +322,9 @@ void S_GetCamera(vec3_t** c, int32_t* ca, sectortype** cs)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (c) *c = &ud.cameraactor->s->pos;
|
||||
if (cs) *cs = ud.cameraactor->s->sector();
|
||||
if (ca) *ca = ud.cameraactor->s->ang;
|
||||
if (c) *c = &ud.cameraactor->spr.pos;
|
||||
if (cs) *cs = ud.cameraactor->spr.sector();
|
||||
if (ca) *ca = ud.cameraactor->spr.ang;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -445,7 +445,7 @@ int S_PlaySound3D(int sndnum, DDukeActor* actor, const vec3_t* pos, int channel,
|
|||
|
||||
if (userflags & SF_TALK)
|
||||
{
|
||||
if (snd_speech == 0 || (ud.multimode > 1 && actor->s->picnum == TILE_APLAYER && actor->s->yvel != screenpeek && ud.coop != 1)) return -1;
|
||||
if (snd_speech == 0 || (ud.multimode > 1 && actor->spr.picnum == TILE_APLAYER && actor->spr.yvel != screenpeek && ud.coop != 1)) return -1;
|
||||
bool foundone = soundEngine->EnumerateChannels([&](FSoundChan* chan)
|
||||
{
|
||||
auto sid = chan->OrgID;
|
||||
|
@ -483,7 +483,7 @@ int S_PlaySound3D(int sndnum, DDukeActor* actor, const vec3_t* pos, int channel,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (sndist > 32767 && actor->s->picnum != MUSICANDSFX && (userflags & (SF_LOOP | SF_MSFX)) == 0)
|
||||
if (sndist > 32767 && actor->spr.picnum != MUSICANDSFX && (userflags & (SF_LOOP | SF_MSFX)) == 0)
|
||||
return -1;
|
||||
|
||||
if (underwater && (userflags & SF_TALK) == 0)
|
||||
|
@ -491,7 +491,7 @@ int S_PlaySound3D(int sndnum, DDukeActor* actor, const vec3_t* pos, int channel,
|
|||
}
|
||||
|
||||
bool is_playing = soundEngine->GetSoundPlayingInfo(SOURCE_Any, nullptr, sndnum+1);
|
||||
if (is_playing && actor->s->picnum != MUSICANDSFX)
|
||||
if (is_playing && actor->spr.picnum != MUSICANDSFX)
|
||||
S_StopSound(sndnum, actor);
|
||||
|
||||
int const repeatp = (userflags & SF_LOOP);
|
||||
|
@ -550,7 +550,7 @@ int S_PlaySound(int sndnum, int channel, EChanFlags flags, float vol)
|
|||
int S_PlayActorSound(int soundNum, DDukeActor* actor, int channel, EChanFlags flags)
|
||||
{
|
||||
return (actor == nullptr ? S_PlaySound(soundNum, channel, flags) :
|
||||
S_PlaySound3D(soundNum, actor, &actor->s->pos, channel, flags));
|
||||
S_PlaySound3D(soundNum, actor, &actor->spr.pos, channel, flags));
|
||||
}
|
||||
|
||||
void S_StopSound(int sndNum, DDukeActor* actor, int channel)
|
||||
|
@ -564,7 +564,7 @@ void S_StopSound(int sndNum, DDukeActor* actor, int channel)
|
|||
else soundEngine->StopSound(SOURCE_Actor, actor, channel, -1);
|
||||
|
||||
// StopSound kills the actor reference so this cannot be delayed until ChannelEnded gets called. At that point the actor may also not be valid anymore.
|
||||
if (S_IsAmbientSFX(actor) && actor->s->sector()->lotag < 3) // ST_2_UNDERWATER
|
||||
if (S_IsAmbientSFX(actor) && actor->spr.sector()->lotag < 3) // ST_2_UNDERWATER
|
||||
actor->temp_data[0] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
|
|||
|
||||
if (s_ow)
|
||||
{
|
||||
act->picnum = s_ow->s->picnum;
|
||||
act->picnum = s_ow->spr.picnum;
|
||||
act->floorz = s_ow->floorz;
|
||||
act->ceilingz = s_ow->ceilingz;
|
||||
}
|
||||
|
@ -122,8 +122,8 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
|
|||
s->hitag = 0;
|
||||
}
|
||||
|
||||
if (show2dsector[s->sectno()]) act->s->cstat2 |= CSTAT2_SPRITE_MAPPED;
|
||||
else act->s->cstat2 &= ~CSTAT2_SPRITE_MAPPED;
|
||||
if (show2dsector[s->sectno()]) act->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
|
||||
else act->spr.cstat2 &= ~CSTAT2_SPRITE_MAPPED;
|
||||
|
||||
act->sx() = {};
|
||||
act->sm() = {};
|
||||
|
@ -223,10 +223,10 @@ DDukeActor* spawn(DDukeActor* actj, int pn)
|
|||
{
|
||||
if (actj)
|
||||
{
|
||||
auto spawned = EGS(actj->s->sector(), actj->s->x, actj->s->y, actj->s->z, pn, 0, 0, 0, 0, 0, 0, actj, 0);
|
||||
auto spawned = EGS(actj->spr.sector(), actj->spr.x, actj->spr.y, actj->spr.z, pn, 0, 0, 0, 0, 0, 0, actj, 0);
|
||||
if (spawned)
|
||||
{
|
||||
spawned->picnum = actj->s->picnum;
|
||||
spawned->picnum = actj->spr.picnum;
|
||||
return fi.spawninit(actj, spawned, nullptr);
|
||||
}
|
||||
}
|
||||
|
@ -277,8 +277,8 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act)
|
|||
sp->clipdist = 80;
|
||||
if (actj)
|
||||
{
|
||||
if (actj->s->picnum == RESPAWN)
|
||||
act->tempang = sp->pal = actj->s->pal;
|
||||
if (actj->spr.picnum == RESPAWN)
|
||||
act->tempang = sp->pal = actj->spr.pal;
|
||||
ChangeActorStat(act, STAT_ACTOR);
|
||||
}
|
||||
else ChangeActorStat(act, STAT_ZOMBIEACTOR);
|
||||
|
@ -293,7 +293,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act)
|
|||
act->timetosleep = 0;
|
||||
|
||||
if (actj)
|
||||
sp->ang = actj->s->ang;
|
||||
sp->ang = actj->spr.ang;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -416,8 +416,8 @@ void initfootprint(DDukeActor* actj, DDukeActor* acti)
|
|||
else { sp->xrepeat = sp->yrepeat = 0; return; }
|
||||
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
|
||||
if ((ps[actj->s->yvel].footprintcount & 1)) sp->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
sp->ang = actj->s->ang;
|
||||
if ((ps[actj->spr.yvel].footprintcount & 1)) sp->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
sp->ang = actj->spr.ang;
|
||||
}
|
||||
|
||||
sp->z = sect->floorz;
|
||||
|
@ -545,10 +545,10 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor)
|
|||
{
|
||||
auto sp = actor->s;
|
||||
auto t = actor->temp_data;
|
||||
if (actj && (actj->s->statnum == 10 || actj->s->statnum == 1))
|
||||
if (actj && (actj->spr.statnum == 10 || actj->spr.statnum == 1))
|
||||
{
|
||||
sp->shade = 32;
|
||||
if (actj->s->pal != 1)
|
||||
if (actj->spr.pal != 1)
|
||||
{
|
||||
sp->pal = 2;
|
||||
sp->z -= (18 << 8);
|
||||
|
@ -645,8 +645,8 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
|
|||
|
||||
for(auto act2 : *actors)
|
||||
{
|
||||
if (act2->s->statnum < MAXSTATUS && act2->s->picnum == SECTOREFFECTOR && (act2->s->lotag == SE_7_TELEPORT || act2->s->lotag == SE_23_ONE_WAY_TELEPORT) &&
|
||||
actor != act2 && act2->s->hitag == sp->hitag)
|
||||
if (act2->spr.statnum < MAXSTATUS && act2->spr.picnum == SECTOREFFECTOR && (act2->spr.lotag == SE_7_TELEPORT || act2->spr.lotag == SE_23_ONE_WAY_TELEPORT) &&
|
||||
actor != act2 && act2->spr.hitag == sp->hitag)
|
||||
{
|
||||
actor->SetOwner(act2);
|
||||
break;
|
||||
|
@ -1067,17 +1067,17 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
|
|||
case SE_15_SLIDING_DOOR:
|
||||
case SE_16_REACTOR:
|
||||
case SE_26:
|
||||
setsectinterpolate(actor->s->sector());
|
||||
setsectinterpolate(actor->spr.sector());
|
||||
break;
|
||||
|
||||
case SE_29_WAVES:
|
||||
StartInterpolation(actor->s->sector(), Interp_Sect_Floorheinum);
|
||||
StartInterpolation(actor->s->sector(), Interp_Sect_Floorz);
|
||||
StartInterpolation(actor->spr.sector(), Interp_Sect_Floorheinum);
|
||||
StartInterpolation(actor->spr.sector(), Interp_Sect_Floorz);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((!isRR() && actor->s->lotag >= 40 && actor->s->lotag <= 45) ||
|
||||
(isRRRA() && actor->s->lotag >= 150 && actor->s->lotag <= 155))
|
||||
if ((!isRR() && actor->spr.lotag >= 40 && actor->spr.lotag <= 45) ||
|
||||
(isRRRA() && actor->spr.lotag >= 150 && actor->spr.lotag <= 155))
|
||||
ChangeActorStat(actor, STAT_RAROR);
|
||||
else
|
||||
ChangeActorStat(actor, STAT_EFFECTOR);
|
||||
|
@ -1146,7 +1146,7 @@ void spriteglass(DDukeActor* actor, int n)
|
|||
int a = krand() & 2047;
|
||||
int z = sp->z - ((krand() & 16) << 8);
|
||||
auto k = EGS(sp->sector(), sp->x, sp->y, z, TILE_GLASSPIECES + (j % 3), krand() & 15, 36, 36, a, 32 + (krand() & 63), -512 - (krand() & 2047), actor, 5);
|
||||
if (k) k->s->pal = sp->pal;
|
||||
if (k) k->spr.pal = sp->pal;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1198,7 +1198,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
|
|||
{
|
||||
a = krand() & 2047;
|
||||
auto k = EGS(sp->sector(), sp->x, sp->y, sp->z - (krand() & (63 << 8)), TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 2047), actor, 5);
|
||||
if (k) k->s->pal = krand() & 15;
|
||||
if (k) k->spr.pal = krand() & 15;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1219,7 +1219,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
|
|||
z = sp->z - (32 << 8) + (krand() & ((64 << 8) - 1));
|
||||
a = sp->ang - 1024;
|
||||
auto k = EGS(sp->sector(), x1, y1, z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 2047), actor, 5);
|
||||
if (k) k->s->pal = krand() & 7;
|
||||
if (k) k->spr.pal = krand() & 7;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue