2020-05-19 22:35:52 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2017-2019 Nuke.YKT
|
2020-06-28 07:03:31 +00:00
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-05-19 22:35:52 +00:00
|
|
|
|
|
|
|
This file is part of 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
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "ns.h"
|
|
|
|
#include "global.h"
|
2020-07-03 21:56:14 +00:00
|
|
|
#include "names_r.h"
|
2020-05-19 22:35:52 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-07-16 11:23:26 +00:00
|
|
|
inline static void hud_drawpal(double x, double y, int tilenum, int shade, int orientation, int p, int scale = 32768)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-07-25 07:02:47 +00:00
|
|
|
hud_drawsprite(x, y, scale, 0, tilenum, shade, p, 2 | orientation);
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 11:23:26 +00:00
|
|
|
inline static void rdmyospal(double x, double y, int tilenum, int shade, int orientation, int p)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-05-20 08:38:56 +00:00
|
|
|
hud_drawpal(x, y, tilenum, shade, orientation, p, 36700);
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 11:23:26 +00:00
|
|
|
inline static void rd2myospal(double x, double y, int tilenum, int shade, int orientation, int p)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-05-20 08:38:56 +00:00
|
|
|
hud_drawpal(x, y, tilenum, shade, orientation, p, 44040);
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
2020-07-16 11:23:26 +00:00
|
|
|
inline static void rd3myospal(double x, double y, int tilenum, int shade, int orientation, int p)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-05-20 08:38:56 +00:00
|
|
|
hud_drawpal(x, y, tilenum, shade, orientation, p, 47040);
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-08-31 17:06:53 +00:00
|
|
|
void displaymasks_r(int snum, double smoothratio)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-05-20 08:38:56 +00:00
|
|
|
short p;
|
|
|
|
|
|
|
|
if (sprite[ps[snum].i].pal == 1)
|
|
|
|
p = 1;
|
|
|
|
else
|
|
|
|
p = sector[ps[snum].cursectnum].floorpal;
|
|
|
|
|
|
|
|
if (ps[snum].scuba_on)
|
|
|
|
{
|
2020-09-16 14:42:44 +00:00
|
|
|
//int pin = 0;
|
2020-08-31 17:06:53 +00:00
|
|
|
// to get the proper clock value with regards to interpolation we have add a smoothratio based offset to the value.
|
|
|
|
double interpclock = ud.levelclock + (TICSPERFRAME/65536.) * smoothratio;
|
2020-09-16 14:42:44 +00:00
|
|
|
int pin = RS_STRETCH;
|
2020-08-31 17:06:53 +00:00
|
|
|
hud_drawsprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15), (200 - (tilesiz[SCUBAMASK].y >> 1) + (calcSinTableValue(interpclock) / 1024.)), 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin);
|
2020-07-16 11:23:26 +00:00
|
|
|
hud_drawsprite((320 - tilesiz[SCUBAMASK + 4].x), (200 - tilesiz[SCUBAMASK + 4].y), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin);
|
2020-07-26 16:35:47 +00:00
|
|
|
hud_drawsprite(tilesiz[SCUBAMASK + 4].x, (200 - tilesiz[SCUBAMASK + 4].y), 65536, 0, SCUBAMASK + 4, 0, p, 2 + 4 + 16 + pin);
|
2020-07-16 11:23:26 +00:00
|
|
|
hud_drawsprite(35, (-1), 65536, 0, SCUBAMASK + 3, 0, p, 2 + 16 + pin);
|
|
|
|
hud_drawsprite(285, 200, 65536, 1024, SCUBAMASK + 3, 0, p, 2 + 16 + pin);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-07-16 16:58:31 +00:00
|
|
|
void ShowMotorcycle(double x, double y, int tilenum, int shade, int orientation, int p, double a)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-08-03 01:06:23 +00:00
|
|
|
hud_drawsprite(x, y, 34816, a, tilenum, shade, p, 2 | orientation);
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-16 16:58:31 +00:00
|
|
|
void ShowBoat(double x, double y, int tilenum, int shade, int orientation, int p, double a)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-08-03 01:06:23 +00:00
|
|
|
hud_drawsprite(x, y, 66048, a, tilenum, shade, p, 2 | orientation);
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-08-02 03:43:45 +00:00
|
|
|
void displayweapon_r(int snum, double smoothratio)
|
2020-05-19 22:35:52 +00:00
|
|
|
{
|
2020-08-03 01:05:41 +00:00
|
|
|
int cw;
|
|
|
|
int i, j;
|
2020-08-04 07:10:44 +00:00
|
|
|
double weapon_sway, weapon_xoffset, gun_pos, looking_arc, look_anghalf, TiltStatus;
|
2020-05-20 08:38:56 +00:00
|
|
|
char o,pal;
|
|
|
|
signed char gs;
|
|
|
|
|
|
|
|
auto p = &ps[snum];
|
|
|
|
auto kb = &p->kickback_pic;
|
|
|
|
|
|
|
|
o = 0;
|
|
|
|
|
2020-10-07 12:13:21 +00:00
|
|
|
look_anghalf = getHalfLookAng(p->angle.olook_ang.asq16(), p->angle.look_ang.asq16(), cl_syncinput, smoothratio);
|
2020-08-03 06:27:14 +00:00
|
|
|
looking_arc = fabs(look_anghalf) / 4.5;
|
2020-08-03 01:05:41 +00:00
|
|
|
weapon_sway = p->oweapon_sway + fmulscale16((p->weapon_sway - p->oweapon_sway), smoothratio);
|
2020-08-04 07:10:44 +00:00
|
|
|
TiltStatus = !cl_syncinput ? p->TiltStatus : p->oTiltStatus + fmulscale16((p->TiltStatus - p->oTiltStatus), smoothratio);
|
2020-05-20 08:38:56 +00:00
|
|
|
|
|
|
|
if (shadedsector[p->cursectnum] == 1)
|
|
|
|
gs = 16;
|
|
|
|
else
|
|
|
|
gs = sprite[p->i].shade;
|
|
|
|
if(gs > 24) gs = 24;
|
|
|
|
|
2020-09-25 06:17:55 +00:00
|
|
|
if(p->newowner >= 0 || ud.camerasprite >= 0 || p->over_shoulder_on > 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0))
|
2020-05-20 08:38:56 +00:00
|
|
|
return;
|
|
|
|
|
2020-08-03 01:05:41 +00:00
|
|
|
int opos = p->oweapon_pos * p->oweapon_pos;
|
|
|
|
int npos = p->weapon_pos * p->weapon_pos;
|
|
|
|
gun_pos = 80 - (opos + fmulscale16(npos - opos, smoothratio));
|
2020-05-20 08:38:56 +00:00
|
|
|
|
|
|
|
weapon_xoffset = (160)-90;
|
2020-08-03 01:05:41 +00:00
|
|
|
weapon_xoffset -= calcSinTableValue((weapon_sway / 2.) + 512) / (1024. + 512.);
|
2020-05-20 08:38:56 +00:00
|
|
|
weapon_xoffset -= 58 + p->weapon_ang;
|
|
|
|
if( sprite[p->i].xrepeat < 8 )
|
2020-08-03 01:05:41 +00:00
|
|
|
gun_pos -= fabs(calcSinTableValue(weapon_sway * 4.) / 512.);
|
|
|
|
else gun_pos -= fabs(calcSinTableValue(weapon_sway / 2.) / 1024.);
|
2020-05-20 08:38:56 +00:00
|
|
|
|
2020-08-03 07:27:09 +00:00
|
|
|
gun_pos -= (p->ohard_landing + fmulscale16(p->hard_landing - p->ohard_landing, smoothratio)) * 8.;
|
2020-05-20 08:38:56 +00:00
|
|
|
|
|
|
|
if(p->last_weapon >= 0)
|
|
|
|
cw = p->last_weapon;
|
|
|
|
else cw = p->curr_weapon;
|
|
|
|
|
|
|
|
j = 14-p->quick_kick;
|
|
|
|
if(j != 14)
|
|
|
|
{
|
|
|
|
if(sprite[p->i].pal == 1)
|
|
|
|
pal = 1;
|
|
|
|
else
|
|
|
|
pal = p->palookup;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p->OnMotorcycle)
|
|
|
|
{
|
|
|
|
int temp_kb;
|
|
|
|
if (numplayers == 1)
|
|
|
|
{
|
|
|
|
if (*kb)
|
|
|
|
{
|
|
|
|
gs = 0;
|
|
|
|
if (*kb == 1)
|
|
|
|
{
|
|
|
|
if ((krand()&1) == 1)
|
|
|
|
temp_kb = MOTOHIT+1;
|
|
|
|
else
|
|
|
|
temp_kb = MOTOHIT+2;
|
|
|
|
}
|
|
|
|
else if (*kb == 4)
|
|
|
|
{
|
|
|
|
if ((krand()&1) == 1)
|
|
|
|
temp_kb = MOTOHIT+3;
|
|
|
|
else
|
|
|
|
temp_kb = MOTOHIT+4;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
temp_kb = MOTOHIT;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
temp_kb = MOTOHIT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (*kb)
|
|
|
|
{
|
|
|
|
gs = 0;
|
|
|
|
if (*kb == 1)
|
|
|
|
temp_kb = MOTOHIT+1;
|
|
|
|
else if (*kb == 2)
|
|
|
|
temp_kb = MOTOHIT+2;
|
|
|
|
else if (*kb == 3)
|
|
|
|
temp_kb = MOTOHIT+3;
|
|
|
|
else if (*kb == 4)
|
|
|
|
temp_kb = MOTOHIT+4;
|
|
|
|
else
|
|
|
|
temp_kb = MOTOHIT;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
temp_kb = MOTOHIT;
|
|
|
|
}
|
|
|
|
if (sprite[p->i].pal == 1)
|
|
|
|
pal = 1;
|
|
|
|
else
|
|
|
|
pal = sector[p->cursectnum].floorpal;
|
|
|
|
|
2020-08-04 07:10:44 +00:00
|
|
|
if (TiltStatus >= 0)
|
|
|
|
ShowMotorcycle(160-look_anghalf, 174, temp_kb, gs, 0, pal, TiltStatus*5);
|
2020-05-20 08:38:56 +00:00
|
|
|
else if (p->TiltStatus < 0)
|
2020-08-04 07:10:44 +00:00
|
|
|
ShowMotorcycle(160-look_anghalf, 174, temp_kb, gs, 0, pal, TiltStatus*5+2047);
|
2020-05-20 08:38:56 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (p->OnBoat)
|
|
|
|
{
|
|
|
|
int temp2, temp_kb, temp3;
|
|
|
|
temp2 = 0;
|
2020-08-04 07:10:44 +00:00
|
|
|
if (TiltStatus > 0)
|
2020-05-20 08:38:56 +00:00
|
|
|
{
|
|
|
|
if (*kb == 0)
|
|
|
|
temp_kb = BOATHIT+1;
|
|
|
|
else if (*kb <= 3)
|
|
|
|
{
|
|
|
|
temp_kb = BOATHIT+5;
|
|
|
|
temp2 = 1;
|
|
|
|
}
|
|
|
|
else if (*kb <= 6)
|
|
|
|
{
|
|
|
|
temp_kb = BOATHIT+6;
|
|
|
|
temp2 = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
temp_kb = BOATHIT+1;
|
|
|
|
}
|
2020-08-04 07:10:44 +00:00
|
|
|
else if (TiltStatus < 0)
|
2020-05-20 08:38:56 +00:00
|
|
|
{
|
|
|
|
if (*kb == 0)
|
|
|
|
temp_kb = BOATHIT+2;
|
|
|
|
else if (*kb <= 3)
|
|
|
|
{
|
|
|
|
temp_kb = BOATHIT+7;
|
|
|
|
temp2 = 1;
|
|
|
|
}
|
|
|
|
else if (*kb <= 6)
|
|
|
|
{
|
|
|
|
temp_kb = BOATHIT+8;
|
|
|
|
temp2 = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
temp_kb = BOATHIT+2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (*kb == 0)
|
|
|
|
temp_kb = BOATHIT;
|
|
|
|
else if (*kb <= 3)
|
|
|
|
{
|
|
|
|
temp_kb = BOATHIT+3;
|
|
|
|
temp2 = 1;
|
|
|
|
}
|
|
|
|
else if (*kb <= 6)
|
|
|
|
{
|
|
|
|
temp_kb = BOATHIT+4;
|
|
|
|
temp2 = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
temp_kb = BOATHIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sprite[p->i].pal == 1)
|
|
|
|
pal = 1;
|
|
|
|
else
|
|
|
|
pal = sector[p->cursectnum].floorpal;
|
|
|
|
|
|
|
|
if (p->NotOnWater)
|
|
|
|
temp3 = 170;
|
|
|
|
else
|
|
|
|
temp3 = 170 + (*kb>>2);
|
|
|
|
|
|
|
|
if (temp2)
|
|
|
|
gs = -96;
|
|
|
|
|
2020-08-04 07:10:44 +00:00
|
|
|
if (TiltStatus >= 0)
|
|
|
|
ShowBoat(160-look_anghalf, temp3, temp_kb, gs, 0, pal, TiltStatus);
|
2020-05-20 08:38:56 +00:00
|
|
|
else if (p->TiltStatus < 0)
|
2020-08-04 07:10:44 +00:00
|
|
|
ShowBoat(160-look_anghalf, temp3, temp_kb, gs, 0, pal, TiltStatus+2047);
|
2020-05-20 08:38:56 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( sprite[p->i].xrepeat < 8 )
|
|
|
|
{
|
|
|
|
static int fistsign;
|
|
|
|
if(p->jetpack_on == 0 )
|
|
|
|
{
|
|
|
|
i = sprite[p->i].xvel;
|
|
|
|
looking_arc += 32-(i>>1);
|
|
|
|
fistsign += i>>1;
|
|
|
|
}
|
|
|
|
cw = weapon_xoffset;
|
2020-08-03 01:05:41 +00:00
|
|
|
weapon_xoffset += calcSinTableValue(fistsign) / 1024.;
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_draw(weapon_xoffset+250-look_anghalf,
|
2020-08-03 01:05:41 +00:00
|
|
|
looking_arc+258-abs(calcSinTableValue(fistsign) / 256.),
|
2020-05-20 08:38:56 +00:00
|
|
|
FIST,gs,o);
|
|
|
|
weapon_xoffset = cw;
|
2020-08-03 01:05:41 +00:00
|
|
|
weapon_xoffset -= calcSinTableValue(fistsign) / 1024.;
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_draw(weapon_xoffset+40-look_anghalf,
|
2020-08-03 01:05:41 +00:00
|
|
|
looking_arc+200+abs(calcSinTableValue(fistsign) / 256.),
|
2020-05-20 08:38:56 +00:00
|
|
|
FIST,gs,o|4);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int pin = 0;
|
|
|
|
|
|
|
|
if (sprite[p->i].pal == 1)
|
|
|
|
pal = 1;
|
|
|
|
else
|
|
|
|
pal = sector[p->cursectnum].floorpal;
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaycrowbar = [&]
|
|
|
|
{
|
|
|
|
static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 };
|
|
|
|
static const short kb_ox[] = { 310,342,364,418,350,316,282,288,0,0 };
|
|
|
|
static const short kb_oy[] = { 300,362,320,268,248,248,277,420,0,0 };
|
2020-08-03 01:05:41 +00:00
|
|
|
double x;
|
2020-05-20 08:38:56 +00:00
|
|
|
short y;
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12);
|
|
|
|
y = 200 - (244 - kb_oy[kb_frames[*kb]]);
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x - look_anghalf, looking_arc + y - gun_pos,
|
2020-05-20 08:38:56 +00:00
|
|
|
KNEE + kb_frames[*kb], gs, 0, pal);
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displayslingblade = [&]
|
|
|
|
{
|
|
|
|
static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 };
|
|
|
|
static const short kb_ox[] = { 580,676,310,491,356,210,310,614 };
|
|
|
|
static const short kb_oy[] = { 369,363,300,323,371,400,300,440 };
|
2020-08-03 01:05:41 +00:00
|
|
|
double x;
|
|
|
|
short y;
|
2020-05-20 08:38:56 +00:00
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12);
|
|
|
|
y = 210 - (244 - kb_oy[kb_frames[*kb]]);
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x - look_anghalf + 20, looking_arc + y - gun_pos - 80,
|
2020-05-20 08:38:56 +00:00
|
|
|
SLINGBLADE + kb_frames[*kb], gs, 0, pal);
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaybowlingball = [&]
|
|
|
|
{
|
|
|
|
weapon_xoffset += 8;
|
|
|
|
gun_pos -= 10;
|
|
|
|
if (p->ammo_amount[BOWLING_WEAPON])
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(weapon_xoffset + 162 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 214 - gun_pos + (*kb << 3), BOWLINGBALLH, gs, o, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + 162 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 214 - gun_pos, HANDTHROW + 5, gs, o, pal);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaypowderkeg = [&]
|
|
|
|
{
|
|
|
|
weapon_xoffset += 8;
|
|
|
|
gun_pos -= 10;
|
|
|
|
if (p->ammo_amount[POWDERKEG_WEAPON])
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + 180 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 214 - gun_pos + (*kb << 3), POWDERH, gs, o, pal);
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + 90 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 214 - gun_pos + (*kb << 3), POWDERH, gs, o | 4, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + 162 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 214 - gun_pos, HANDTHROW + 5, gs, o, pal);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaycrossbow = [&]
|
|
|
|
{
|
2020-09-16 14:42:44 +00:00
|
|
|
//if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R;
|
2020-05-20 08:38:56 +00:00
|
|
|
static const uint8_t kb_frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 };
|
|
|
|
if (kb_frames[*kb] == 2 || kb_frames[*kb] == 3)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 200) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
else if (kb_frames[*kb] == 1)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 200) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], 0, o | pin, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 210) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 255 - gun_pos, RPGGUN + kb_frames[*kb], gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaychicken = [&]
|
|
|
|
{
|
2020-09-16 14:42:44 +00:00
|
|
|
//if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R;
|
2020-05-20 08:38:56 +00:00
|
|
|
if (*kb)
|
|
|
|
{
|
|
|
|
static const uint8_t kb_frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 };
|
|
|
|
if (kb_frames[*kb] == 2 || kb_frames[*kb] == 3)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 200) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
else if (kb_frames[*kb] == 1)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 200) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], 0, o | pin, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 210) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 255 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ud.multimode < 2)
|
|
|
|
{
|
|
|
|
if (chickenphase)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 210) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
else if ((krand() & 15) == 5)
|
|
|
|
{
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(327, p->i);
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 210) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o | pin, pal);
|
|
|
|
chickenphase = 6;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 210) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 225 - gun_pos, RPGGUN2, gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal((weapon_xoffset + 210) - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 225 - gun_pos, RPGGUN2, gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displayshotgun = [&]
|
|
|
|
{
|
|
|
|
weapon_xoffset -= 8;
|
|
|
|
|
|
|
|
if (sprite[p->i].pal == 1)
|
|
|
|
pal = 1;
|
|
|
|
else
|
|
|
|
pal = sector[p->cursectnum].floorpal;
|
|
|
|
|
|
|
|
{
|
2020-08-03 01:05:41 +00:00
|
|
|
double x;
|
2020-05-20 08:38:56 +00:00
|
|
|
short y;
|
|
|
|
static const short kb_frames3[] = { 0,0,1,1,2,2,5,5,6,6,7,7,8,8,0,0,0,0,0,0,0 };
|
|
|
|
static const short kb_frames2[] = { 0,0,3,3,4,4,5,5,6,6,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 };
|
|
|
|
static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 };
|
|
|
|
static const short kb_ox[] = { 300,300,300,300,300,330,320,310,305,306,302 };
|
|
|
|
static const short kb_oy[] = { 315,300,302,305,302,302,303,306,302,404,384 };
|
|
|
|
short tm;
|
|
|
|
tm = 180;
|
|
|
|
if (p->shotgun_state[1])
|
|
|
|
{
|
|
|
|
if ((*kb) < 26)
|
|
|
|
{
|
|
|
|
if (kb_frames[*kb] == 3 || kb_frames[*kb] == 4)
|
|
|
|
gs = 0;
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames[*kb]]);
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 64 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
y + looking_arc - gun_pos, SHOTGUN + kb_frames[*kb], gs, 0, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (kb_frames[*kb] > 0)
|
|
|
|
{
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames[(*kb) - 11]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames[(*kb) - 11]]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames[*kb]]);
|
|
|
|
}
|
|
|
|
switch (*kb)
|
|
|
|
{
|
|
|
|
case 23:
|
|
|
|
y += 60;
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
y += 30;
|
|
|
|
break;
|
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 64 - look_anghalf, y + looking_arc - gun_pos, SHOTGUN + kb_frames[*kb], gs, 0, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
if (kb_frames[*kb] == 21)
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 96 - look_anghalf, y + looking_arc - gun_pos, SHOTGUNSHELLS, gs, 0, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((*kb) < 16)
|
|
|
|
{
|
|
|
|
if (p->shotgun_state[0])
|
|
|
|
{
|
|
|
|
if (kb_frames2[*kb] == 3 || kb_frames2[*kb] == 4)
|
|
|
|
gs = 0;
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames2[*kb]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames2[*kb]]);
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 64 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
y + looking_arc - gun_pos, SHOTGUN + kb_frames2[*kb], gs, 0, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (kb_frames3[*kb] == 1 || kb_frames3[*kb] == 2)
|
|
|
|
gs = 0;
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames3[*kb]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames3[*kb]]);
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 64 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
y + looking_arc - gun_pos, SHOTGUN + kb_frames3[*kb], gs, 0, pal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (p->shotgun_state[0])
|
|
|
|
{
|
|
|
|
if (kb_frames2[*kb] > 0)
|
|
|
|
{
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames2[(*kb) - 11]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames2[(*kb) - 11]]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x = weapon_xoffset + ((kb_ox[kb_frames2[*kb]] >> 1) - 12);
|
|
|
|
y = tm - (244 - kb_oy[kb_frames2[*kb]]);
|
|
|
|
}
|
|
|
|
switch (*kb)
|
|
|
|
{
|
|
|
|
case 23:
|
|
|
|
y += 60;
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
y += 30;
|
|
|
|
break;
|
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 64 - look_anghalf, y + looking_arc - gun_pos, SHOTGUN + kb_frames2[*kb], gs, 0, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
if (kb_frames2[*kb] == 21)
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(x + 96 - look_anghalf, y + looking_arc - gun_pos, SHOTGUNSHELLS, gs, 0, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displayrifle = [&]
|
|
|
|
{
|
|
|
|
if (*kb > 0)
|
2020-08-03 01:05:41 +00:00
|
|
|
gun_pos -= calcSinTableValue((*kb) << 7) / 4096.;
|
2020-05-20 08:38:56 +00:00
|
|
|
|
|
|
|
if (*kb > 0 && sprite[p->i].pal != 1) weapon_xoffset += 1 - (rand() & 3);
|
|
|
|
|
|
|
|
switch (*kb)
|
|
|
|
{
|
|
|
|
case 0:
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(weapon_xoffset + 178 - look_anghalf + 30, looking_arc + 233 - gun_pos + 5,
|
2020-05-20 08:38:56 +00:00
|
|
|
CHAINGUN, gs, o, pal);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
gs = 0;
|
|
|
|
if (*kb < 8)
|
|
|
|
{
|
|
|
|
i = rand() & 7;
|
2020-08-03 06:27:14 +00:00
|
|
|
hud_drawpal(weapon_xoffset + 178 - look_anghalf + 30, looking_arc + 233 - gun_pos + 5,
|
2020-05-20 08:38:56 +00:00
|
|
|
CHAINGUN + 1, gs, o, pal);
|
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
else hud_drawpal(weapon_xoffset + 178 - look_anghalf + 30, looking_arc + 233 - gun_pos + 5,
|
2020-05-20 08:38:56 +00:00
|
|
|
CHAINGUN + 2, gs, o, pal);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaypistol = [&]
|
|
|
|
{
|
|
|
|
if ((*kb) < 22)
|
|
|
|
{
|
|
|
|
static const uint8_t kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,6,6,6,6,5,5,4,4,3,3,0,0 };
|
|
|
|
static const short kb_ox[] = { 194,190,185,208,215,215,216,216,201,170 };
|
|
|
|
static const short kb_oy[] = { 256,249,248,238,228,218,208,256,245,258 };
|
2020-08-03 01:05:41 +00:00
|
|
|
double x;
|
2020-05-20 08:38:56 +00:00
|
|
|
short y;
|
|
|
|
|
|
|
|
x = weapon_xoffset + (kb_ox[kb_frames[*kb]] - 12);
|
|
|
|
y = 244 - (244 - kb_oy[kb_frames[*kb]]);
|
|
|
|
|
|
|
|
if (kb_frames[*kb])
|
|
|
|
gs = 0;
|
|
|
|
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(x - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
y + looking_arc - gun_pos, FIRSTGUN + kb_frames[*kb], gs, 0, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static const short kb_frames[] = { 0,0,1,1,2,2,2,2,2,2,2,2,2,2,2,1,1,0,0 };
|
|
|
|
static const short kb_ox[] = { 244,244,244 };
|
|
|
|
static const short kb_oy[] = { 256,249,248 };
|
2020-08-03 01:05:41 +00:00
|
|
|
double x;
|
2020-05-20 08:38:56 +00:00
|
|
|
short dx;
|
|
|
|
short y;
|
|
|
|
short dy;
|
|
|
|
|
|
|
|
x = weapon_xoffset + (kb_ox[kb_frames[(*kb) - 22]] - 12);
|
|
|
|
y = 244 - (244 - kb_oy[kb_frames[(*kb) - 22]]);
|
|
|
|
switch (*kb)
|
|
|
|
{
|
|
|
|
case 28:
|
|
|
|
dy = 10;
|
|
|
|
dx = 5;
|
|
|
|
break;
|
|
|
|
case 29:
|
|
|
|
dy = 20;
|
|
|
|
dx = 10;
|
|
|
|
break;
|
|
|
|
case 30:
|
|
|
|
dy = 30;
|
|
|
|
dx = 15;
|
|
|
|
break;
|
|
|
|
case 31:
|
|
|
|
dy = 40;
|
|
|
|
dx = 20;
|
|
|
|
break;
|
|
|
|
case 32:
|
|
|
|
dy = 50;
|
|
|
|
dx = 25;
|
|
|
|
break;
|
|
|
|
case 33:
|
|
|
|
dy = 40;
|
|
|
|
dx = 20;
|
|
|
|
break;
|
|
|
|
case 34:
|
|
|
|
dy = 30;
|
|
|
|
dx = 15;
|
|
|
|
break;
|
|
|
|
case 35:
|
|
|
|
dy = 20;
|
|
|
|
dx = 10;
|
|
|
|
break;
|
|
|
|
case 36:
|
|
|
|
dy = 10;
|
|
|
|
dx = 5;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
dy = 0;
|
|
|
|
dx = 0;
|
|
|
|
break;
|
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(x - look_anghalf - dx,
|
2020-05-20 08:38:56 +00:00
|
|
|
y + looking_arc - gun_pos + dy, FIRSTGUNRELOAD + kb_frames[(*kb) - 22], gs, 0, pal);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaydynamite = [&]
|
|
|
|
{
|
|
|
|
gun_pos -= 9 * (*kb);
|
|
|
|
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + 190 - look_anghalf, looking_arc + 260 - gun_pos, HANDTHROW, gs, o, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaythrowingdynamite = [&]
|
|
|
|
{
|
|
|
|
int dx;
|
|
|
|
int x;
|
|
|
|
int dy;
|
|
|
|
dx = 25;
|
|
|
|
x = 100;
|
|
|
|
dy = 20;
|
|
|
|
if ((*kb) < 20)
|
|
|
|
{
|
2020-09-16 14:42:44 +00:00
|
|
|
//if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R;
|
2020-05-20 08:38:56 +00:00
|
|
|
static const int8_t remote_frames[] = { 1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,5,5,6,6,6 };
|
|
|
|
|
|
|
|
if (*kb)
|
|
|
|
{
|
|
|
|
if ((*kb) < 5)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + x + 190 - look_anghalf - dx,
|
2020-07-06 19:16:59 +00:00
|
|
|
looking_arc + 258 - gun_pos - 64 + p->detonate_count - dy, RRTILE1752, 0, o | pin, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + x + 190 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 258 - gun_pos - dy, HANDTHROW + remote_frames[*kb], gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((*kb) < 5)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + x + 190 - look_anghalf - dx,
|
2020-07-06 19:16:59 +00:00
|
|
|
looking_arc + 258 - gun_pos - 64 + p->detonate_count - dy, RRTILE1752, 0, o | pin, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + x + 190 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 258 - gun_pos - dy, HANDTHROW + 1, gs, o | pin, pal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaytits = [&]
|
|
|
|
{
|
|
|
|
if (*kb)
|
|
|
|
{
|
|
|
|
gs = 0;
|
2020-08-03 06:27:14 +00:00
|
|
|
rd3myospal(150 + (weapon_xoffset / 2.) - look_anghalf, 266 + (looking_arc / 2.) - gun_pos, DEVISTATOR, gs, o, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
|
|
|
else
|
2020-08-03 06:27:14 +00:00
|
|
|
rd3myospal(150 + (weapon_xoffset / 2.) - look_anghalf, 266 + (looking_arc / 2.) - gun_pos, DEVISTATOR + 1, gs, o, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displayblaster = [&]
|
|
|
|
{
|
2020-09-16 14:42:44 +00:00
|
|
|
//if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R;
|
2020-05-20 08:38:56 +00:00
|
|
|
if ((*kb))
|
|
|
|
{
|
|
|
|
char cat_frames[] = { 0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
|
2020-08-03 06:27:14 +00:00
|
|
|
rdmyospal(weapon_xoffset + 260 - look_anghalf, looking_arc + 215 - gun_pos, FREEZE + cat_frames[*kb], -32, o | pin, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
}
|
2020-08-03 06:27:14 +00:00
|
|
|
else rdmyospal(weapon_xoffset + 260 - look_anghalf, looking_arc + 215 - gun_pos, FREEZE, gs, o | pin, pal);
|
2020-05-20 08:38:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
auto displaysaw = [&]
|
|
|
|
{
|
|
|
|
weapon_xoffset += 28;
|
|
|
|
looking_arc += 18;
|
|
|
|
if ((*kb) == 0)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rd2myospal(weapon_xoffset + 188 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 240 - gun_pos, SHRINKER, gs, o, pal);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sprite[p->i].pal != 1)
|
|
|
|
{
|
|
|
|
weapon_xoffset += rand() & 3;
|
|
|
|
gun_pos += (rand() & 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cw == BUZZSAW_WEAPON)
|
|
|
|
{
|
2020-08-03 06:27:14 +00:00
|
|
|
rd2myospal(weapon_xoffset + 184 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 240 - gun_pos, GROWSPARK + ((*kb) & 2), gs, o, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
signed char kb_frames[] = { 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0 };
|
|
|
|
short frm = kb_frames[*kb];
|
2020-08-03 06:27:14 +00:00
|
|
|
rd2myospal(weapon_xoffset + 184 - look_anghalf,
|
2020-05-20 08:38:56 +00:00
|
|
|
looking_arc + 240 - gun_pos, SHRINKER + frm, gs, o, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
switch (cw)
|
|
|
|
{
|
|
|
|
case KNEE_WEAPON:
|
|
|
|
displaycrowbar();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SLINGBLADE_WEAPON:
|
|
|
|
displayslingblade();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case POWDERKEG_WEAPON:
|
|
|
|
displaypowderkeg();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BOWLING_WEAPON:
|
|
|
|
displaybowlingball();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CROSSBOW_WEAPON:
|
|
|
|
displaycrossbow();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CHICKEN_WEAPON:
|
|
|
|
displaychicken();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SHOTGUN_WEAPON:
|
|
|
|
displayshotgun();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RIFLEGUN_WEAPON:
|
|
|
|
displayrifle();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PISTOL_WEAPON:
|
|
|
|
displaypistol();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DYNAMITE_WEAPON:
|
|
|
|
displaydynamite();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case THROWINGDYNAMITE_WEAPON:
|
|
|
|
displaythrowingdynamite();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TIT_WEAPON:
|
|
|
|
displaytits();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MOTORCYCLE_WEAPON:
|
|
|
|
case BOAT_WEAPON:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ALIENBLASTER_WEAPON:
|
|
|
|
displayblaster();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case THROWSAW_WEAPON:
|
|
|
|
case BUZZSAW_WEAPON:
|
|
|
|
displaysaw();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-05-19 22:35:52 +00:00
|
|
|
}
|
|
|
|
|
2020-08-31 17:06:53 +00:00
|
|
|
END_DUKE_NS
|