2020-05-21 20:40:46 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
|
2020-06-28 07:03:31 +00:00
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-05-21 20:40:46 +00:00
|
|
|
|
|
|
|
This file is part of Enhanced Duke Nukem 3D version 1.5 - Atomic Edition
|
|
|
|
|
|
|
|
Duke Nukem 3D is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2020-10-13 19:44:05 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2020-05-21 20:40:46 +00:00
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Original Source: 1996 - Todd Replogle
|
|
|
|
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|
|
|
|
|
|
|
EDuke enhancements integrated: 04/13/2003 - Matt Saettler
|
|
|
|
|
|
|
|
Note: EDuke source was in transition. Changes are in-progress in the
|
|
|
|
source as it is released.
|
|
|
|
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#include "ns.h"
|
|
|
|
#include "global.h"
|
2020-07-06 09:39:39 +00:00
|
|
|
#include "prediction.h"
|
2020-07-03 21:56:14 +00:00
|
|
|
#include "names_d.h"
|
2020-11-04 06:01:25 +00:00
|
|
|
#include "dukeactor.h"
|
2021-05-30 21:00:06 +00:00
|
|
|
#include "gamefuncs.h"
|
2020-05-21 20:40:46 +00:00
|
|
|
|
2020-09-26 15:43:34 +00:00
|
|
|
EXTERN_CVAR(Bool, wt_commentary)
|
2020-08-15 08:25:30 +00:00
|
|
|
|
2020-10-13 19:44:05 +00:00
|
|
|
BEGIN_DUKE_NS
|
2020-05-21 20:40:46 +00:00
|
|
|
|
2022-08-07 08:25:15 +00:00
|
|
|
void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothratio)
|
2020-05-21 20:40:46 +00:00
|
|
|
{
|
2022-08-07 08:25:15 +00:00
|
|
|
int k, p;
|
2020-10-13 19:44:05 +00:00
|
|
|
int l, t1, t3, t4;
|
|
|
|
tspritetype* t;
|
2021-08-30 06:12:39 +00:00
|
|
|
DDukeActor* h;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2022-08-07 08:25:15 +00:00
|
|
|
for (unsigned j = 0; j < tsprites.Size(); j++)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-08-07 08:25:15 +00:00
|
|
|
t = tsprites.get(j);
|
2021-12-04 18:08:50 +00:00
|
|
|
h = static_cast<DDukeActor*>(t->ownerActor);
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
switch (t->picnum)
|
|
|
|
{
|
|
|
|
case DEVELOPERCOMMENTARY:
|
|
|
|
case DEVELOPERCOMMENTARY + 1:
|
|
|
|
if (isWorldTour() && !wt_commentary)
|
|
|
|
t->xrepeat = t->yrepeat = 0;
|
|
|
|
break;
|
|
|
|
case BLOODPOOL:
|
|
|
|
case PUKE:
|
|
|
|
case FOOTPRINTS:
|
|
|
|
case FOOTPRINTS2:
|
|
|
|
case FOOTPRINTS3:
|
|
|
|
case FOOTPRINTS4:
|
|
|
|
if (t->shade == 127) continue;
|
|
|
|
break;
|
|
|
|
case RESPAWNMARKERRED:
|
|
|
|
case RESPAWNMARKERYELLOW:
|
|
|
|
case RESPAWNMARKERGREEN:
|
|
|
|
if (ud.marker == 0)
|
|
|
|
t->xrepeat = t->yrepeat = 0;
|
|
|
|
continue;
|
|
|
|
case CHAIR3:
|
2020-12-01 22:57:39 +00:00
|
|
|
if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0)
|
|
|
|
{
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-05-21 20:40:46 +00:00
|
|
|
break;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
|
|
|
|
if (k > 4)
|
|
|
|
{
|
|
|
|
k = 8 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum = h->spr.picnum + k;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case BLOODSPLAT1:
|
|
|
|
case BLOODSPLAT2:
|
|
|
|
case BLOODSPLAT3:
|
|
|
|
case BLOODSPLAT4:
|
|
|
|
if (t->pal == 6)
|
|
|
|
{
|
|
|
|
t->shade = -127;
|
|
|
|
continue;
|
|
|
|
}
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-13 19:44:05 +00:00
|
|
|
case BULLETHOLE:
|
|
|
|
case CRACK1:
|
|
|
|
case CRACK2:
|
|
|
|
case CRACK3:
|
|
|
|
case CRACK4:
|
|
|
|
t->shade = 16;
|
|
|
|
continue;
|
|
|
|
case NEON1:
|
|
|
|
case NEON2:
|
|
|
|
case NEON3:
|
|
|
|
case NEON4:
|
|
|
|
case NEON5:
|
|
|
|
case NEON6:
|
|
|
|
continue;
|
|
|
|
case GREENSLIME:
|
|
|
|
case GREENSLIME + 1:
|
|
|
|
case GREENSLIME + 2:
|
|
|
|
case GREENSLIME + 3:
|
|
|
|
case GREENSLIME + 4:
|
|
|
|
case GREENSLIME + 5:
|
|
|
|
case GREENSLIME + 6:
|
|
|
|
case GREENSLIME + 7:
|
|
|
|
break;
|
|
|
|
default:
|
2021-12-18 15:45:05 +00:00
|
|
|
if (((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER)
|
2020-10-13 19:44:05 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-12-30 15:24:51 +00:00
|
|
|
if (t->sectp != nullptr)
|
2021-12-30 15:58:48 +00:00
|
|
|
t->shade = clamp<int>(t->sectp->ceilingstat & CSTAT_SECTOR_SKY ? t->sectp->ceilingshade : t->sectp->floorshade, -127, 127);
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-11-09 23:05:42 +00:00
|
|
|
//Between drawrooms() and drawmasks() is the perfect time to animate sprites
|
2022-08-07 08:25:15 +00:00
|
|
|
for (unsigned j = 0; j < tsprites.Size(); j++)
|
2021-11-09 23:05:42 +00:00
|
|
|
{
|
2022-08-07 08:25:15 +00:00
|
|
|
t = tsprites.get(j);
|
2021-12-04 18:08:50 +00:00
|
|
|
h = static_cast<DDukeActor*>(t->ownerActor);
|
2020-10-23 15:37:19 +00:00
|
|
|
auto OwnerAc = h->GetOwner();
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
switch (h->spr.picnum)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
case SECTOREFFECTOR:
|
|
|
|
if (t->lotag == 27 && ud.recstat == 1)
|
|
|
|
{
|
2021-02-18 10:46:36 +00:00
|
|
|
t->picnum = 11 + ((PlayClock >> 3) & 1);
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_YCENTER;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
t->xrepeat = t->yrepeat = 0;
|
|
|
|
break;
|
|
|
|
case NATURALLIGHTNING:
|
|
|
|
t->shade = -127;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (t->statnum == 99) continue;
|
2021-12-21 19:04:37 +00:00
|
|
|
if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner())
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-02-04 16:56:56 +00:00
|
|
|
t->add_int_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.X - ps[h->spr.yvel].__int_opos.X, 16));
|
|
|
|
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].__int_pos.Y - ps[h->spr.yvel].__int_opos.Y, 16));
|
|
|
|
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].__int_opos.Z, ps[h->spr.yvel].__int_pos.Z, smoothratio));
|
2022-02-02 19:03:02 +00:00
|
|
|
t->add_int_z(PHEIGHT_DUKE);
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2022-01-17 23:54:10 +00:00
|
|
|
else if (!actorflag(h, SFLAG_NOINTERPOLATE))
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-02-03 23:04:45 +00:00
|
|
|
t->pos = h->interpolatedvec3(smoothratio);
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sectp = h->sector();
|
2020-10-23 18:38:45 +00:00
|
|
|
t1 = h->temp_data[1];
|
|
|
|
t3 = h->temp_data[3];
|
|
|
|
t4 = h->temp_data[4];
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
switch (h->spr.picnum)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
case DUKELYINGDEAD:
|
2022-02-02 19:03:02 +00:00
|
|
|
t->add_int_z(24 << 8);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case BLOODPOOL:
|
|
|
|
case FOOTPRINTS:
|
|
|
|
case FOOTPRINTS2:
|
|
|
|
case FOOTPRINTS3:
|
|
|
|
case FOOTPRINTS4:
|
|
|
|
if (t->pal == 6)
|
|
|
|
t->shade = -127;
|
|
|
|
case PUKE:
|
|
|
|
case MONEY:
|
|
|
|
case MONEY + 1:
|
|
|
|
case MAIL:
|
|
|
|
case MAIL + 1:
|
|
|
|
case PAPER:
|
|
|
|
case PAPER + 1:
|
|
|
|
break;
|
|
|
|
case FORCESPHERE:
|
2021-12-21 21:28:13 +00:00
|
|
|
if (t->statnum == STAT_MISC && OwnerAc)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2021-11-07 13:36:39 +00:00
|
|
|
int sqa =
|
2020-10-13 19:44:05 +00:00
|
|
|
getangle(
|
2022-02-04 16:52:41 +00:00
|
|
|
OwnerAc->int_pos().X - ps[screenpeek].__int_pos.X,
|
|
|
|
OwnerAc->int_pos().Y - ps[screenpeek].__int_pos.Y);
|
2021-11-07 13:36:39 +00:00
|
|
|
int sqb =
|
2020-10-13 19:44:05 +00:00
|
|
|
getangle(
|
2022-02-02 18:49:57 +00:00
|
|
|
OwnerAc->int_pos().X - t->int_pos().X,
|
|
|
|
OwnerAc->int_pos().Y - t->int_pos().Y);
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
if (abs(getincangle(sqa, sqb)) > 512)
|
2021-12-21 21:28:13 +00:00
|
|
|
if (ldist(OwnerAc, t) < ldist(ps[screenpeek].GetActor(), OwnerAc))
|
2020-10-13 19:44:05 +00:00
|
|
|
t->xrepeat = t->yrepeat = 0;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
case BURNING:
|
|
|
|
case BURNING2:
|
2021-12-21 21:28:13 +00:00
|
|
|
if (OwnerAc && OwnerAc->spr.statnum == STAT_PLAYER)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2021-12-21 21:28:13 +00:00
|
|
|
if (display_mirror == 0 && OwnerAc->spr.yvel == screenpeek && ps[screenpeek].over_shoulder_on == 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
t->xrepeat = 0;
|
|
|
|
else
|
|
|
|
{
|
2022-02-02 18:49:57 +00:00
|
|
|
t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y);
|
2022-02-02 19:03:02 +00:00
|
|
|
t->set_int_x(OwnerAc->int_pos().X + bcos(t->ang, -10));
|
|
|
|
t->set_int_y(OwnerAc->int_pos().Y + bsin(t->ang, -10));
|
2020-05-21 20:40:46 +00:00
|
|
|
}
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATOMICHEALTH:
|
2022-02-02 19:03:02 +00:00
|
|
|
t->add_int_z(-(4 << 8));
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case CRYSTALAMMO:
|
2021-02-18 10:46:36 +00:00
|
|
|
t->shade = bsin(PlayClock << 4, -10);
|
2020-10-13 19:44:05 +00:00
|
|
|
continue;
|
|
|
|
case VIEWSCREEN:
|
|
|
|
case VIEWSCREEN2:
|
2021-12-07 16:09:28 +00:00
|
|
|
if (camsprite != nullptr && h->GetHitOwner() && h->GetHitOwner()->temp_data[0] == 1)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
t->picnum = STATIC;
|
2021-12-18 17:07:41 +00:00
|
|
|
t->cstat |= randomFlip();
|
2020-10-13 19:44:05 +00:00
|
|
|
t->xrepeat += 8;
|
|
|
|
t->yrepeat += 8;
|
|
|
|
}
|
2021-12-07 16:09:28 +00:00
|
|
|
else if (camsprite && camsprite == h->GetHitOwner())
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
t->picnum = TILE_VIEWSCR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SHRINKSPARK:
|
2021-02-18 10:46:36 +00:00
|
|
|
t->picnum = SHRINKSPARK + ((PlayClock >> 4) & 3);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case GROWSPARK:
|
2021-02-18 10:46:36 +00:00
|
|
|
t->picnum = GROWSPARK + ((PlayClock >> 4) & 3);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case RPG:
|
2021-12-21 19:04:37 +00:00
|
|
|
if (hw_models && md_tilehasmodel(h->spr.picnum, h->spr.pal) >= 0)
|
2020-12-01 22:57:39 +00:00
|
|
|
{
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2022-01-31 18:21:49 +00:00
|
|
|
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
|
2020-10-13 19:44:05 +00:00
|
|
|
if (k > 6)
|
|
|
|
{
|
|
|
|
k = 12 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
t->picnum = RPG + k;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RECON:
|
2021-12-21 19:04:37 +00:00
|
|
|
if (hw_models && md_tilehasmodel(h->spr.picnum, h->spr.pal) >= 0)
|
2020-12-01 22:57:39 +00:00
|
|
|
{
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2022-01-31 18:21:49 +00:00
|
|
|
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
|
2020-10-23 18:38:45 +00:00
|
|
|
if (h->temp_data[0] < 4)
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
|
|
|
|
else k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
if (k > 6)
|
|
|
|
{
|
|
|
|
k = 12 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
if (abs(t3) > 64) k += 7;
|
|
|
|
t->picnum = RECON + k;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case APLAYER:
|
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
p = h->spr.yvel;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2022-02-02 23:01:57 +00:00
|
|
|
if (t->pal == 1) t->add_int_z(-(18 << 8));
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_TRANSLUCENT;
|
2021-11-21 07:50:04 +00:00
|
|
|
#if 0 // multiplayer only
|
2020-10-13 19:44:05 +00:00
|
|
|
if (screenpeek == myconnectindex && numplayers >= 2)
|
|
|
|
{
|
2021-04-11 06:45:19 +00:00
|
|
|
t->x = interpolatedvalue(omyx, myx, smoothratio);
|
|
|
|
t->y = interpolatedvalue(omyy, myy, smoothratio);
|
2021-04-15 08:02:16 +00:00
|
|
|
t->z = interpolatedvalue(omyz, myz, smoothratio) + PHEIGHT_DUKE;
|
2021-04-11 06:45:19 +00:00
|
|
|
t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild();
|
2021-11-21 08:05:58 +00:00
|
|
|
t->sector = mycursectnum;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-11-21 07:50:04 +00:00
|
|
|
#endif
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->spr.extra > 0 && ps[p].curr_weapon > 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-08-07 08:25:15 +00:00
|
|
|
auto newtspr = tsprites.newTSprite();
|
|
|
|
*newtspr = *t;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
newtspr->statnum = 99;
|
|
|
|
|
|
|
|
newtspr->yrepeat = (t->yrepeat >> 3);
|
|
|
|
if (t->yrepeat < 4) t->yrepeat = 4;
|
|
|
|
|
|
|
|
newtspr->shade = t->shade;
|
|
|
|
newtspr->cstat = 0;
|
|
|
|
|
|
|
|
switch (ps[p].curr_weapon)
|
|
|
|
{
|
|
|
|
case PISTOL_WEAPON: newtspr->picnum = FIRSTGUNSPRITE; break;
|
|
|
|
case SHOTGUN_WEAPON: newtspr->picnum = SHOTGUNSPRITE; break;
|
|
|
|
case CHAINGUN_WEAPON: newtspr->picnum = CHAINGUNSPRITE; break;
|
|
|
|
case RPG_WEAPON: newtspr->picnum = RPGSPRITE; break;
|
|
|
|
case HANDREMOTE_WEAPON:
|
|
|
|
case HANDBOMB_WEAPON: newtspr->picnum = HEAVYHBOMB; break;
|
|
|
|
case TRIPBOMB_WEAPON: newtspr->picnum = TRIPBOMBSPRITE; break;
|
|
|
|
case GROW_WEAPON: newtspr->picnum = GROWSPRITEICON; break;
|
|
|
|
case SHRINKER_WEAPON: newtspr->picnum = SHRINKERSPRITE; break;
|
|
|
|
case FREEZE_WEAPON: newtspr->picnum = FREEZESPRITE; break;
|
|
|
|
case FLAMETHROWER_WEAPON: //Twentieth Anniversary World Tour
|
|
|
|
if (isWorldTour())
|
2021-11-14 23:06:07 +00:00
|
|
|
newtspr->picnum = FLAMETHROWERSPRITE;
|
|
|
|
break;
|
2020-10-13 19:44:05 +00:00
|
|
|
case DEVISTATOR_WEAPON: newtspr->picnum = DEVISTATORSPRITE; break;
|
2020-05-21 20:40:46 +00:00
|
|
|
}
|
|
|
|
|
2020-11-02 23:01:35 +00:00
|
|
|
if (h->GetOwner())
|
2022-02-04 16:52:41 +00:00
|
|
|
newtspr->set_int_z(ps[p].__int_pos.Z - (12 << 8));
|
2022-02-02 19:03:02 +00:00
|
|
|
else newtspr->set_int_z(h->int_pos().Z - (51 << 8));
|
2020-10-13 19:44:05 +00:00
|
|
|
if (ps[p].curr_weapon == HANDBOMB_WEAPON)
|
|
|
|
{
|
|
|
|
newtspr->xrepeat = 10;
|
|
|
|
newtspr->yrepeat = 10;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
newtspr->xrepeat = 16;
|
|
|
|
newtspr->yrepeat = 16;
|
|
|
|
}
|
|
|
|
newtspr->pal = 0;
|
|
|
|
}
|
2020-05-21 20:40:46 +00:00
|
|
|
|
2020-11-02 23:01:35 +00:00
|
|
|
if (!h->GetOwner())
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2021-12-21 19:04:37 +00:00
|
|
|
if (hw_models && md_tilehasmodel(h->spr.picnum, h->spr.pal) >= 0)
|
2020-12-01 22:57:39 +00:00
|
|
|
{
|
2020-05-21 20:40:46 +00:00
|
|
|
k = 0;
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 7;
|
2020-10-13 19:44:05 +00:00
|
|
|
if (k > 4)
|
|
|
|
{
|
|
|
|
k = 8 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-05-21 20:40:46 +00:00
|
|
|
}
|
|
|
|
|
2021-12-30 15:58:48 +00:00
|
|
|
if (t->sectp->lotag == 2) k += 1795 - 1405;
|
2022-02-04 00:00:28 +00:00
|
|
|
else if ((h->floorz - h->spr.pos.Z) > 64) k += 60;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
t->picnum += k;
|
|
|
|
t->pal = ps[p].palookup;
|
|
|
|
|
|
|
|
goto PALONLY;
|
|
|
|
}
|
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (ps[p].on_crane == nullptr && (h->sector()->lotag & 0x7ff) != 1)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-02-04 00:00:28 +00:00
|
|
|
double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3;
|
|
|
|
if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0)
|
|
|
|
h->spr.yoffset = (int8_t)(v * (1/REPEAT_SCALE) / h->spr.yrepeat);
|
2021-12-21 19:04:37 +00:00
|
|
|
else h->spr.yoffset = 0;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[p].newOwner != nullptr)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2020-11-29 12:54:58 +00:00
|
|
|
t4 = ScriptCode[gs.actorinfo[APLAYER].scriptaddress + 1];
|
2020-10-13 19:44:05 +00:00
|
|
|
t3 = 0;
|
2020-11-29 12:54:58 +00:00
|
|
|
t1 = ScriptCode[gs.actorinfo[APLAYER].scriptaddress + 2];
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ud.cameraactor == nullptr && ps[p].newOwner == nullptr)
|
2020-11-02 23:01:35 +00:00
|
|
|
if (h->GetOwner() && display_mirror == 0 && ps[p].over_shoulder_on == 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek))
|
|
|
|
{
|
2021-12-04 18:08:50 +00:00
|
|
|
t->ownerActor = nullptr;
|
2020-10-13 19:44:05 +00:00
|
|
|
t->xrepeat = t->yrepeat = 0;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
PALONLY:
|
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->floorpal)
|
|
|
|
copyfloorpal(t, sectp);
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2020-11-02 23:01:35 +00:00
|
|
|
if (!h->GetOwner()) continue;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2022-02-04 00:00:28 +00:00
|
|
|
if (t->pos.Z > h->floorz && t->xrepeat < 32)
|
|
|
|
t->pos.Z = h->floorz;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case JIBS1:
|
|
|
|
case JIBS2:
|
|
|
|
case JIBS3:
|
|
|
|
case JIBS4:
|
|
|
|
case JIBS5:
|
|
|
|
case JIBS6:
|
|
|
|
case HEADJIB1:
|
|
|
|
case LEGJIB1:
|
|
|
|
case ARMJIB1:
|
|
|
|
case LIZMANHEAD1:
|
|
|
|
case LIZMANARM1:
|
|
|
|
case LIZMANLEG1:
|
|
|
|
case DUKELEG:
|
|
|
|
case DUKEGUN:
|
|
|
|
case DUKETORSO:
|
|
|
|
if (t->pal == 6) t->shade = -120;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
case SCRAP1:
|
|
|
|
case SCRAP2:
|
|
|
|
case SCRAP3:
|
|
|
|
case SCRAP4:
|
|
|
|
case SCRAP5:
|
|
|
|
case SCRAP6:
|
|
|
|
case SCRAP6 + 1:
|
|
|
|
case SCRAP6 + 2:
|
|
|
|
case SCRAP6 + 3:
|
|
|
|
case SCRAP6 + 4:
|
|
|
|
case SCRAP6 + 5:
|
|
|
|
case SCRAP6 + 6:
|
|
|
|
case SCRAP6 + 7:
|
|
|
|
|
2021-12-27 22:52:16 +00:00
|
|
|
if (h->attackertype == BLIMP && t->picnum == SCRAP1 && h->spr.yvel >= 0)
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum = h->spr.yvel;
|
2020-10-23 18:38:45 +00:00
|
|
|
else t->picnum += h->temp_data[0];
|
2020-10-13 19:44:05 +00:00
|
|
|
t->shade -= 6;
|
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->floorpal)
|
|
|
|
copyfloorpal(t, sectp);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WATERBUBBLE:
|
2021-12-30 15:58:48 +00:00
|
|
|
if (t->sectp->floorpicnum == FLOORSLIME)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
t->pal = 7;
|
|
|
|
break;
|
|
|
|
}
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-13 19:44:05 +00:00
|
|
|
default:
|
|
|
|
|
2022-01-19 10:23:38 +00:00
|
|
|
if (sectp->floorpal && !actorflag(h, SFLAG2_NOFLOORPAL))
|
2021-11-06 22:05:25 +00:00
|
|
|
copyfloorpal(t, sectp);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-01-29 09:45:36 +00:00
|
|
|
if (gs.actorinfo[h->spr.picnum].scriptaddress && !actorflag(h, SFLAG2_DONTANIMATE))
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
if (t4)
|
|
|
|
{
|
|
|
|
l = ScriptCode[t4 + 2];
|
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
if (hw_models && md_tilehasmodel(h->spr.picnum, h->spr.pal) >= 0)
|
2020-12-01 22:57:39 +00:00
|
|
|
{
|
2020-10-13 19:44:05 +00:00
|
|
|
k = 0;
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
|
|
|
else switch (l)
|
|
|
|
{
|
2020-10-13 19:44:05 +00:00
|
|
|
case 2:
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 1;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
case 4:
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 7) & 7;
|
2020-10-13 19:44:05 +00:00
|
|
|
if (k > 3)
|
|
|
|
{
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
k = 7 - k;
|
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
2022-01-31 18:21:49 +00:00
|
|
|
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - k) & 2047) >> 8) & 7;
|
2020-10-13 19:44:05 +00:00
|
|
|
if (k > 4)
|
|
|
|
{
|
|
|
|
k = 8 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2022-01-31 18:21:49 +00:00
|
|
|
k = getangle(h->int_pos().X - x, h->int_pos().Y - y);
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - k) & 2047) / 170);
|
2020-10-13 19:44:05 +00:00
|
|
|
if (k > 6)
|
|
|
|
{
|
|
|
|
k = 12 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case 8:
|
2021-12-21 19:04:37 +00:00
|
|
|
k = (((h->spr.ang + 3072 + 128 - a) & 2047) >> 8) & 7;
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-05-21 20:40:46 +00:00
|
|
|
break;
|
2020-10-13 19:44:05 +00:00
|
|
|
default:
|
|
|
|
k = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
t->picnum += k + ScriptCode[t4] + l * t3;
|
|
|
|
|
|
|
|
if (l > 0)
|
2021-12-11 08:56:28 +00:00
|
|
|
{
|
|
|
|
while (t->picnum >= 0 && t->picnum < MAXTILES && !tileGetTexture(t->picnum)->isValid())
|
2020-10-13 19:44:05 +00:00
|
|
|
t->picnum -= l; //Hack, for actors
|
2021-12-11 08:56:28 +00:00
|
|
|
}
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2020-10-23 18:38:45 +00:00
|
|
|
if (h->dispicnum >= 0)
|
|
|
|
h->dispicnum = t->picnum;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
else if (display_mirror == 1)
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
if (h->spr.statnum == STAT_DUMMYPLAYER || badguy(h) || (h->spr.picnum == APLAYER && h->GetOwner()))
|
2022-01-12 23:42:34 +00:00
|
|
|
{
|
2021-12-21 19:04:37 +00:00
|
|
|
if (t->statnum != 99 && h->spr.picnum != EXPLOSION2 && h->spr.picnum != HANGLIGHT && h->spr.picnum != DOMELITE)
|
2022-01-12 23:42:34 +00:00
|
|
|
{
|
2021-12-21 19:04:37 +00:00
|
|
|
if (h->spr.picnum != HOTMEAT)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-08-07 08:25:15 +00:00
|
|
|
if (r_shadows && !(h->spr.cstat2 & CSTAT2_SPRITE_NOSHADOW))
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
int daz;
|
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
if ((sectp->lotag & 0xff) > 2 || h->spr.statnum == 4 || h->spr.statnum == 5 || h->spr.picnum == DRONE || h->spr.picnum == COMMANDER)
|
2022-02-02 23:46:04 +00:00
|
|
|
daz = sectp->int_floorz();
|
2020-10-13 19:44:05 +00:00
|
|
|
else
|
2022-02-03 23:36:51 +00:00
|
|
|
daz = h->actor_int_floorz();
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
|
2022-02-04 16:52:41 +00:00
|
|
|
if ((h->int_pos().Z - daz) < (8 << 8) && ps[screenpeek].__int_pos.Z < daz)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2022-08-07 08:25:15 +00:00
|
|
|
auto shadowspr = tsprites.newTSprite();
|
2020-10-13 19:44:05 +00:00
|
|
|
*shadowspr = *t;
|
|
|
|
|
|
|
|
shadowspr->statnum = 99;
|
|
|
|
|
|
|
|
shadowspr->yrepeat = (t->yrepeat >> 3);
|
|
|
|
if (t->yrepeat < 4) t->yrepeat = 4;
|
|
|
|
shadowspr->shade = 127;
|
2021-12-18 15:02:15 +00:00
|
|
|
shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2022-02-02 19:03:02 +00:00
|
|
|
shadowspr->set_int_z(daz);
|
2020-10-13 19:44:05 +00:00
|
|
|
shadowspr->pal = 4;
|
|
|
|
|
2020-12-01 22:57:39 +00:00
|
|
|
if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2020-12-01 22:57:39 +00:00
|
|
|
shadowspr->yrepeat = 0;
|
|
|
|
// 512:trans reverse
|
|
|
|
//1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues
|
|
|
|
shadowspr->clipdist |= TSPR_FLAGS_MDHACK;
|
2021-12-18 16:00:22 +00:00
|
|
|
shadowspr->cstat |= CSTAT_SPRITE_TRANS_FLIP;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Alter the shadow's position so that it appears behind the sprite itself.
|
2022-02-04 16:52:41 +00:00
|
|
|
int look = getangle(shadowspr->int_pos().X - ps[screenpeek].__int_pos.X, shadowspr->int_pos().Y - ps[screenpeek].__int_pos.Y);
|
2022-02-02 19:03:02 +00:00
|
|
|
shadowspr->add_int_x(bcos(look, -9));
|
|
|
|
shadowspr->add_int_y(bsin(look, -9));
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ps[screenpeek].heat_amount > 0 && ps[screenpeek].heat_on)
|
|
|
|
{
|
|
|
|
t->pal = 6;
|
|
|
|
t->shade = 0;
|
|
|
|
}
|
|
|
|
}
|
2022-01-12 23:42:34 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-13 19:44:05 +00:00
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
switch (h->spr.picnum)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
|
|
|
case LASERLINE:
|
2021-12-21 21:28:13 +00:00
|
|
|
if (!OwnerAc) break;
|
2021-12-30 15:58:48 +00:00
|
|
|
if (t->sectp->lotag == 2) t->pal = 8;
|
2022-02-02 19:03:02 +00:00
|
|
|
t->set_int_z(OwnerAc->int_pos().Z - (3 << 8));
|
2020-11-29 12:54:58 +00:00
|
|
|
if (gs.lasermode == 2 && ps[screenpeek].heat_on == 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
t->yrepeat = 0;
|
2022-01-19 09:48:18 +00:00
|
|
|
t->shade = -127;
|
|
|
|
break;
|
2020-10-13 19:44:05 +00:00
|
|
|
case EXPLOSION2:
|
|
|
|
case EXPLOSION2BOT:
|
|
|
|
case FREEZEBLAST:
|
|
|
|
case ATOMICHEALTH:
|
|
|
|
case FIRELASER:
|
|
|
|
case SHRINKSPARK:
|
|
|
|
case GROWSPARK:
|
|
|
|
case CHAINGUN:
|
|
|
|
case SHRINKEREXPLOSION:
|
|
|
|
case RPG:
|
|
|
|
case FLOORFLAME:
|
|
|
|
if (t->picnum == EXPLOSION2)
|
|
|
|
{
|
|
|
|
ps[screenpeek].visibility = -127;
|
2021-02-18 10:46:36 +00:00
|
|
|
lastvisinc = PlayClock + 32;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
t->shade = -127;
|
|
|
|
break;
|
|
|
|
case FIRE:
|
|
|
|
case FIRE2:
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_YCENTER;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-13 19:44:05 +00:00
|
|
|
case BURNING:
|
|
|
|
case BURNING2:
|
2021-12-21 21:28:13 +00:00
|
|
|
if (!OwnerAc) break;
|
2022-01-26 23:41:33 +00:00
|
|
|
if (!actorflag(OwnerAc, SFLAG_NOFLOORFIRE))
|
2022-02-02 23:46:04 +00:00
|
|
|
t->set_int_z(t->sectp->int_floorz());
|
2020-10-13 19:44:05 +00:00
|
|
|
t->shade = -127;
|
|
|
|
break;
|
|
|
|
case COOLEXPLOSION1:
|
|
|
|
t->shade = -127;
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum += (h->spr.shade >> 1);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case PLAYERONWATER:
|
2021-12-21 19:04:37 +00:00
|
|
|
if (hw_models && md_tilehasmodel(h->spr.picnum, h->spr.pal) >= 0)
|
2020-12-01 22:57:39 +00:00
|
|
|
{
|
2020-10-13 19:44:05 +00:00
|
|
|
k = 0;
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-13 19:44:05 +00:00
|
|
|
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
|
|
|
|
if (k > 4)
|
|
|
|
{
|
|
|
|
k = 8 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum = h->spr.picnum + k + ((h->temp_data[0] < 4) * 5);
|
2021-12-21 21:28:13 +00:00
|
|
|
if (OwnerAc) t->shade = OwnerAc->spr.shade;
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WATERSPLASH2:
|
|
|
|
t->picnum = WATERSPLASH2 + t1;
|
|
|
|
break;
|
|
|
|
case REACTOR2:
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum = h->spr.picnum + h->temp_data[2];
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case SHELL:
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum = h->spr.picnum + (h->temp_data[0] & 1);
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-13 19:44:05 +00:00
|
|
|
case SHOTGUNSHELL:
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat |= (CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
|
|
|
|
if (h->temp_data[0] > 1) t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
|
|
|
if (h->temp_data[0] > 2) t->cstat &= ~(CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP);
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
case FRAMEEFFECT1:
|
2021-12-21 21:28:13 +00:00
|
|
|
if (OwnerAc && OwnerAc->spr.statnum < MAXSTATUS)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2021-12-21 21:28:13 +00:00
|
|
|
if (OwnerAc->spr.picnum == APLAYER)
|
2020-11-02 22:53:55 +00:00
|
|
|
if (ud.cameraactor == nullptr)
|
2021-12-21 21:28:13 +00:00
|
|
|
if (screenpeek == OwnerAc->spr.yvel && display_mirror == 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2021-12-04 18:08:50 +00:00
|
|
|
t->ownerActor = nullptr;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-21 21:28:13 +00:00
|
|
|
if ((OwnerAc->spr.cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
2020-10-13 19:44:05 +00:00
|
|
|
{
|
2020-10-23 15:37:19 +00:00
|
|
|
t->picnum = OwnerAc->dispicnum;
|
2021-12-21 21:28:13 +00:00
|
|
|
t->pal = OwnerAc->spr.pal;
|
|
|
|
t->shade = OwnerAc->spr.shade;
|
|
|
|
t->ang = OwnerAc->spr.ang;
|
|
|
|
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CAMERA1:
|
|
|
|
case RAT:
|
2021-12-21 19:04:37 +00:00
|
|
|
if (hw_models && md_tilehasmodel(h->spr.picnum, h->spr.pal) >= 0)
|
2020-12-01 22:57:39 +00:00
|
|
|
{
|
2021-12-18 16:00:22 +00:00
|
|
|
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
2020-12-01 22:57:39 +00:00
|
|
|
}
|
2020-10-13 19:44:05 +00:00
|
|
|
|
|
|
|
k = (((t->ang + 3072 + 128 - a) & 2047) >> 8) & 7;
|
|
|
|
if (k > 4)
|
|
|
|
{
|
|
|
|
k = 8 - k;
|
2021-12-18 15:02:15 +00:00
|
|
|
t->cstat |= CSTAT_SPRITE_XFLIP;
|
2020-10-13 19:44:05 +00:00
|
|
|
}
|
2021-12-18 16:00:22 +00:00
|
|
|
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
2021-12-21 19:04:37 +00:00
|
|
|
t->picnum = h->spr.picnum + k;
|
2020-10-13 19:44:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-10-23 18:38:45 +00:00
|
|
|
h->dispicnum = t->picnum;
|
2021-12-30 15:58:48 +00:00
|
|
|
if (t->sectp->floorpicnum == MIRROR)
|
2020-10-13 19:44:05 +00:00
|
|
|
t->xrepeat = t->yrepeat = 0;
|
|
|
|
}
|
2020-05-21 20:40:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-23 15:01:37 +00:00
|
|
|
END_DUKE_NS
|