mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 10:31:42 +00:00
Merge branch 'master' into opengl-improvements
This commit is contained in:
commit
106e1aa8d5
63 changed files with 3770 additions and 1922 deletions
|
@ -258,6 +258,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void I_RegisterSysCommands(void) {}
|
void I_RegisterSysCommands(void) {}
|
||||||
|
|
||||||
#include "../sdl/dosstr.c"
|
#include "../sdl/dosstr.c"
|
||||||
|
|
573
src/console.c
573
src/console.c
|
@ -84,19 +84,23 @@ UINT32 con_scalefactor; // text size scale factor
|
||||||
|
|
||||||
// hold 32 last lines of input for history
|
// hold 32 last lines of input for history
|
||||||
#define CON_MAXPROMPTCHARS 256
|
#define CON_MAXPROMPTCHARS 256
|
||||||
#define CON_PROMPTCHAR '>'
|
#define CON_PROMPTCHAR '$'
|
||||||
|
|
||||||
static char inputlines[32][CON_MAXPROMPTCHARS]; // hold last 32 prompt lines
|
static char inputlines[32][CON_MAXPROMPTCHARS]; // hold last 32 prompt lines
|
||||||
|
|
||||||
static INT32 inputline; // current input line number
|
static INT32 inputline; // current input line number
|
||||||
static INT32 inputhist; // line number of history input line to restore
|
static INT32 inputhist; // line number of history input line to restore
|
||||||
static size_t input_cx; // position in current input line
|
static size_t input_cur; // position of cursor in line
|
||||||
|
static size_t input_sel; // position of selection marker (I.E.: anything between this and input_cur is "selected")
|
||||||
|
static size_t input_len; // length of current line, used to bound cursor and such
|
||||||
|
// notice: input does NOT include the "$" at the start of the line. - 11/3/16
|
||||||
|
|
||||||
// protos.
|
// protos.
|
||||||
static void CON_InputInit(void);
|
static void CON_InputInit(void);
|
||||||
static void CON_RecalcSize(void);
|
static void CON_RecalcSize(void);
|
||||||
|
|
||||||
static void CONS_hudlines_Change(void);
|
static void CONS_hudlines_Change(void);
|
||||||
|
static void CONS_backcolor_Change(void);
|
||||||
static void CON_DrawBackpic(patch_t *pic, INT32 startx, INT32 destwidth);
|
static void CON_DrawBackpic(patch_t *pic, INT32 startx, INT32 destwidth);
|
||||||
//static void CON_DrawBackpic2(pic_t *pic, INT32 startx, INT32 destwidth);
|
//static void CON_DrawBackpic2(pic_t *pic, INT32 startx, INT32 destwidth);
|
||||||
|
|
||||||
|
@ -129,10 +133,12 @@ static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}
|
||||||
// whether to use console background picture, or translucent mode
|
// whether to use console background picture, or translucent mode
|
||||||
static consvar_t cons_backpic = {"con_backpic", "translucent", CV_SAVE, backpic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
static consvar_t cons_backpic = {"con_backpic", "translucent", CV_SAVE, backpic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Orange"},
|
static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Gray"}, {2, "Brown"},
|
||||||
{2, "Blue"}, {3, "Green"}, {4, "Gray"},
|
{3, "Red"}, {4, "Orange"}, {5, "Yellow"},
|
||||||
{5, "Red"}, {0, NULL}};
|
{6, "Green"}, {7, "Blue"}, {8, "Purple"},
|
||||||
consvar_t cons_backcolor = {"con_backcolor", "3", CV_SAVE, backcolor_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
{9, "Magenta"}, {10, "Aqua"},
|
||||||
|
{0, NULL}};
|
||||||
|
consvar_t cons_backcolor = {"con_backcolor", "Green", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
static void CON_Print(char *msg);
|
static void CON_Print(char *msg);
|
||||||
|
|
||||||
|
@ -219,8 +225,9 @@ static void CONS_Bind_f(void)
|
||||||
// CONSOLE SETUP
|
// CONSOLE SETUP
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
// Prepare a colormap for GREEN ONLY translucency over background
|
// Font colormap colors
|
||||||
//
|
// TODO: This could probably be improved somehow...
|
||||||
|
// These colormaps are 99% identical, with just a few changed bytes
|
||||||
UINT8 *yellowmap;
|
UINT8 *yellowmap;
|
||||||
UINT8 *purplemap;
|
UINT8 *purplemap;
|
||||||
UINT8 *lgreenmap;
|
UINT8 *lgreenmap;
|
||||||
|
@ -229,44 +236,52 @@ UINT8 *graymap;
|
||||||
UINT8 *redmap;
|
UINT8 *redmap;
|
||||||
UINT8 *orangemap;
|
UINT8 *orangemap;
|
||||||
|
|
||||||
// Console BG colors
|
// Console BG color
|
||||||
UINT8 *cwhitemap;
|
UINT8 *consolebgmap = NULL;
|
||||||
UINT8 *corangemap;
|
|
||||||
UINT8 *cbluemap;
|
|
||||||
UINT8 *cgreenmap;
|
|
||||||
UINT8 *cgraymap;
|
|
||||||
UINT8 *credmap;
|
|
||||||
|
|
||||||
void CON_ReSetupBackColormap(UINT16 num)
|
void CON_SetupBackColormap(void)
|
||||||
{
|
{
|
||||||
UINT16 i, j;
|
UINT16 i, palsum;
|
||||||
UINT8 k;
|
UINT8 j, palindex, shift;
|
||||||
UINT8 *pal = W_CacheLumpName(R_GetPalname(num), PU_CACHE);
|
UINT8 *pal = W_CacheLumpName(GetPalette(), PU_CACHE);
|
||||||
|
|
||||||
// setup the green translucent background colormaps
|
if (!consolebgmap)
|
||||||
for (i = 0, k = 0; i < 768; i += 3, k++)
|
consolebgmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||||
|
|
||||||
|
shift = 6; // 12 colors -- shift of 7 means 6 colors
|
||||||
|
switch (cons_backcolor.value)
|
||||||
{
|
{
|
||||||
j = pal[i] + pal[i+1] + pal[i+2];
|
case 0: palindex = 15; break; // White
|
||||||
cwhitemap[k] = (UINT8)(15 - (j>>6));
|
case 1: palindex = 31; break; // Gray
|
||||||
corangemap[k] = (UINT8)(63 - (j>>6));
|
case 2: palindex = 239; break; // Brown
|
||||||
cbluemap[k] = (UINT8)(159 - (j>>6));
|
case 3: palindex = 47; break; // Red
|
||||||
cgreenmap[k] = (UINT8)(111 - (j>>6));
|
case 4: palindex = 63; break; // Orange
|
||||||
cgraymap[k] = (UINT8)(31 - (j>>6));
|
case 5: palindex = 79; shift = 7; break; // Yellow
|
||||||
credmap[k] = (UINT8)(47 - (j>>6));
|
case 6: palindex = 111; break; // Green
|
||||||
|
case 7: palindex = 159; break; // Blue
|
||||||
|
case 8: palindex = 199; shift = 7; break; // Purple
|
||||||
|
case 9: palindex = 187; break; // Magenta
|
||||||
|
case 10: palindex = 139; break; // Aqua
|
||||||
|
// Default green
|
||||||
|
default: palindex = 175; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup background colormap
|
||||||
|
for (i = 0, j = 0; i < 768; i += 3, j++)
|
||||||
|
{
|
||||||
|
palsum = (pal[i] + pal[i+1] + pal[i+2]) >> shift;
|
||||||
|
consolebgmap[j] = (UINT8)(palindex - palsum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CON_SetupBackColormap(void)
|
static void CONS_backcolor_Change(void)
|
||||||
{
|
{
|
||||||
INT32 i, j, k;
|
CON_SetupBackColormap();
|
||||||
UINT8 *pal;
|
}
|
||||||
|
|
||||||
cwhitemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
static void CON_SetupColormaps(void)
|
||||||
corangemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
{
|
||||||
cbluemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
INT32 i;
|
||||||
cgreenmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
|
||||||
cgraymap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
|
||||||
credmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
|
||||||
|
|
||||||
yellowmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
yellowmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||||
graymap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
graymap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||||
|
@ -276,20 +291,6 @@ static void CON_SetupBackColormap(void)
|
||||||
redmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
redmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||||
orangemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
orangemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||||
|
|
||||||
pal = W_CacheLumpName("PLAYPAL", PU_CACHE);
|
|
||||||
|
|
||||||
// setup the green translucent background colormaps
|
|
||||||
for (i = 0, k = 0; i < 768; i += 3, k++)
|
|
||||||
{
|
|
||||||
j = pal[i] + pal[i+1] + pal[i+2];
|
|
||||||
cwhitemap[k] = (UINT8)(15 - (j>>6));
|
|
||||||
corangemap[k] = (UINT8)(63 - (j>>6));
|
|
||||||
cbluemap[k] = (UINT8)(159 - (j>>6));
|
|
||||||
cgreenmap[k] = (UINT8)(111 - (j>>6));
|
|
||||||
cgraymap[k] = (UINT8)(31 - (j>>6));
|
|
||||||
credmap[k] = (UINT8)(47 - (j>>6));
|
|
||||||
}
|
|
||||||
|
|
||||||
// setup the other colormaps, for console text
|
// setup the other colormaps, for console text
|
||||||
|
|
||||||
// these don't need to be aligned, unless you convert the
|
// these don't need to be aligned, unless you convert the
|
||||||
|
@ -320,6 +321,9 @@ static void CON_SetupBackColormap(void)
|
||||||
redmap[9] = (UINT8)32;
|
redmap[9] = (UINT8)32;
|
||||||
orangemap[3] = (UINT8)52;
|
orangemap[3] = (UINT8)52;
|
||||||
orangemap[9] = (UINT8)57;
|
orangemap[9] = (UINT8)57;
|
||||||
|
|
||||||
|
// Init back colormap
|
||||||
|
CON_SetupBackColormap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup the console text buffer
|
// Setup the console text buffer
|
||||||
|
@ -343,7 +347,7 @@ void CON_Init(void)
|
||||||
con_width = 0;
|
con_width = 0;
|
||||||
CON_RecalcSize();
|
CON_RecalcSize();
|
||||||
|
|
||||||
CON_SetupBackColormap();
|
CON_SetupColormaps();
|
||||||
|
|
||||||
//note: CON_Ticker should always execute at least once before D_Display()
|
//note: CON_Ticker should always execute at least once before D_Display()
|
||||||
con_clipviewtop = -1; // -1 does not clip
|
con_clipviewtop = -1; // -1 does not clip
|
||||||
|
@ -386,14 +390,10 @@ void CON_Init(void)
|
||||||
//
|
//
|
||||||
static void CON_InputInit(void)
|
static void CON_InputInit(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
// prepare the first prompt line
|
// prepare the first prompt line
|
||||||
memset(inputlines, 0, sizeof (inputlines));
|
memset(inputlines, 0, sizeof (inputlines));
|
||||||
for (i = 0; i < 32; i++)
|
|
||||||
inputlines[i][0] = CON_PROMPTCHAR;
|
|
||||||
inputline = 0;
|
inputline = 0;
|
||||||
input_cx = 1;
|
input_cur = input_sel = input_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
@ -618,13 +618,91 @@ void CON_Ticker(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// ----
|
||||||
|
//
|
||||||
|
// Shortcuts for adding and deleting characters, strings, and sections
|
||||||
|
// Necessary due to moving cursor
|
||||||
|
//
|
||||||
|
|
||||||
|
static void CON_InputClear(void)
|
||||||
|
{
|
||||||
|
memset(inputlines[inputline], 0, CON_MAXPROMPTCHARS);
|
||||||
|
input_cur = input_sel = input_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CON_InputSetString(const char *c)
|
||||||
|
{
|
||||||
|
memset(inputlines[inputline], 0, CON_MAXPROMPTCHARS);
|
||||||
|
strcpy(inputlines[inputline], c);
|
||||||
|
input_cur = input_sel = input_len = strlen(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CON_InputAddString(const char *c)
|
||||||
|
{
|
||||||
|
size_t csize = strlen(c);
|
||||||
|
if (input_len + csize > CON_MAXPROMPTCHARS-1)
|
||||||
|
return;
|
||||||
|
if (input_cur != input_len)
|
||||||
|
memmove(&inputlines[inputline][input_cur+csize], &inputlines[inputline][input_cur], input_len-input_cur);
|
||||||
|
memcpy(&inputlines[inputline][input_cur], c, csize);
|
||||||
|
input_len += csize;
|
||||||
|
input_sel = (input_cur += csize);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CON_InputDelSelection(void)
|
||||||
|
{
|
||||||
|
size_t start, end, len;
|
||||||
|
if (input_cur > input_sel)
|
||||||
|
{
|
||||||
|
start = input_sel;
|
||||||
|
end = input_cur;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
start = input_cur;
|
||||||
|
end = input_sel;
|
||||||
|
}
|
||||||
|
len = (end - start);
|
||||||
|
|
||||||
|
if (end != input_len)
|
||||||
|
memmove(&inputlines[inputline][start], &inputlines[inputline][end], input_len-end);
|
||||||
|
memset(&inputlines[inputline][input_len - len], 0, len);
|
||||||
|
|
||||||
|
input_len -= len;
|
||||||
|
input_sel = input_cur = start;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CON_InputAddChar(char c)
|
||||||
|
{
|
||||||
|
if (input_len >= CON_MAXPROMPTCHARS-1)
|
||||||
|
return;
|
||||||
|
if (input_cur != input_len)
|
||||||
|
memmove(&inputlines[inputline][input_cur+1], &inputlines[inputline][input_cur], input_len-input_cur);
|
||||||
|
inputlines[inputline][input_cur++] = c;
|
||||||
|
inputlines[inputline][++input_len] = 0;
|
||||||
|
input_sel = input_cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CON_InputDelChar(void)
|
||||||
|
{
|
||||||
|
if (!input_cur)
|
||||||
|
return;
|
||||||
|
if (input_cur != input_len)
|
||||||
|
memmove(&inputlines[inputline][input_cur-1], &inputlines[inputline][input_cur], input_len-input_cur);
|
||||||
|
inputlines[inputline][--input_len] = 0;
|
||||||
|
input_sel = --input_cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// ----
|
||||||
|
//
|
||||||
|
|
||||||
// Handles console key input
|
// Handles console key input
|
||||||
//
|
//
|
||||||
boolean CON_Responder(event_t *ev)
|
boolean CON_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
static boolean consdown;
|
static UINT8 consdown = false; // console is treated differently due to rare usage
|
||||||
static boolean shiftdown;
|
|
||||||
static boolean ctrldown;
|
|
||||||
|
|
||||||
// sequential completions a la 4dos
|
// sequential completions a la 4dos
|
||||||
static char completion[80];
|
static char completion[80];
|
||||||
|
@ -639,13 +717,8 @@ boolean CON_Responder(event_t *ev)
|
||||||
// let go keyup events, don't eat them
|
// let go keyup events, don't eat them
|
||||||
if (ev->type != ev_keydown && ev->type != ev_console)
|
if (ev->type != ev_keydown && ev->type != ev_console)
|
||||||
{
|
{
|
||||||
if (ev->data1 == KEY_LSHIFT || ev->data1 == KEY_RSHIFT)
|
if (ev->data1 == gamecontrol[gc_console][0] || ev->data1 == gamecontrol[gc_console][1])
|
||||||
shiftdown = false;
|
|
||||||
else if (ev->data1 == KEY_LCTRL || ev->data1 == KEY_RCTRL)
|
|
||||||
ctrldown = false;
|
|
||||||
else if (ev->data1 == gamecontrol[gc_console][0] || ev->data1 == gamecontrol[gc_console][1])
|
|
||||||
consdown = false;
|
consdown = false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,94 +757,110 @@ boolean CON_Responder(event_t *ev)
|
||||||
consoletoggle = true;
|
consoletoggle = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// eat shift only if console active
|
// Always eat ctrl/shift/alt if console open, so the menu doesn't get ideas
|
||||||
if (key == KEY_LSHIFT || key == KEY_RSHIFT)
|
if (key == KEY_LSHIFT || key == KEY_RSHIFT
|
||||||
|
|| key == KEY_LCTRL || key == KEY_RCTRL
|
||||||
|
|| key == KEY_LALT || key == KEY_RALT)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// ctrl modifier -- changes behavior, adds shortcuts
|
||||||
|
if (ctrldown)
|
||||||
{
|
{
|
||||||
shiftdown = true;
|
// show all cvars/commands that match what we have inputted
|
||||||
|
if (key == KEY_TAB)
|
||||||
|
{
|
||||||
|
size_t i, len;
|
||||||
|
|
||||||
|
if (!completion[0])
|
||||||
|
{
|
||||||
|
if (!input_len || input_len >= 40 || strchr(inputlines[inputline], ' '))
|
||||||
|
return true;
|
||||||
|
strcpy(completion, inputlines[inputline]);
|
||||||
|
comskips = varskips = 0;
|
||||||
|
}
|
||||||
|
len = strlen(completion);
|
||||||
|
|
||||||
|
//first check commands
|
||||||
|
CONS_Printf("\nCommands:\n");
|
||||||
|
for (i = 0, cmd = COM_CompleteCommand(completion, i); cmd; cmd = COM_CompleteCommand(completion, ++i))
|
||||||
|
CONS_Printf(" \x83" "%s" "\x80" "%s\n", completion, cmd+len);
|
||||||
|
if (i == 0) CONS_Printf(" (none)\n");
|
||||||
|
|
||||||
|
//now we move on to CVARs
|
||||||
|
CONS_Printf("Variables:\n");
|
||||||
|
for (i = 0, cmd = CV_CompleteVar(completion, i); cmd; cmd = CV_CompleteVar(completion, ++i))
|
||||||
|
CONS_Printf(" \x83" "%s" "\x80" "%s\n", completion, cmd+len);
|
||||||
|
if (i == 0) CONS_Printf(" (none)\n");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ---
|
||||||
|
|
||||||
|
if (key == KEY_HOME) // oldest text in buffer
|
||||||
|
{
|
||||||
|
con_scrollup = (con_totallines-((con_curlines-16)>>3));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (key == KEY_END) // most recent text in buffer
|
||||||
|
{
|
||||||
|
con_scrollup = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// same for ctrl
|
if (key == 'x' || key == 'X')
|
||||||
if (key == KEY_LCTRL || key == KEY_RCTRL)
|
|
||||||
{
|
{
|
||||||
ctrldown = true;
|
if (input_sel > input_cur)
|
||||||
|
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
|
||||||
|
else
|
||||||
|
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
|
||||||
|
CON_InputDelSelection();
|
||||||
|
completion[0] = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (key == 'c' || key == 'C')
|
||||||
|
{
|
||||||
|
if (input_sel > input_cur)
|
||||||
|
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
|
||||||
|
else
|
||||||
|
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (key == 'v' || key == 'V')
|
||||||
|
{
|
||||||
|
const char *paste = I_ClipboardPaste();
|
||||||
|
if (input_sel != input_cur)
|
||||||
|
CON_InputDelSelection();
|
||||||
|
if (paste != NULL)
|
||||||
|
CON_InputAddString(paste);
|
||||||
|
completion[0] = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Select all
|
||||||
|
if (key == 'a' || key == 'A')
|
||||||
|
{
|
||||||
|
input_sel = 0;
|
||||||
|
input_cur = input_len;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't eat the key
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// command completion forward (tab) and backward (shift-tab)
|
// command completion forward (tab) and backward (shift-tab)
|
||||||
if (key == KEY_TAB)
|
if (key == KEY_TAB)
|
||||||
{
|
{
|
||||||
// show all cvars/commands that match what we have inputted
|
|
||||||
if (ctrldown)
|
|
||||||
{
|
|
||||||
UINT32 i;
|
|
||||||
size_t stop = input_cx - 1;
|
|
||||||
char nameremainder[255];
|
|
||||||
|
|
||||||
if (input_cx < 2 || strlen(inputlines[inputline]+1) >= 80)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
strcpy(completion, inputlines[inputline]+1);
|
|
||||||
|
|
||||||
// trimming: stop at the first newline
|
|
||||||
for (i = 0; i < input_cx - 1; ++i)
|
|
||||||
{
|
|
||||||
if (completion[i] == ' ')
|
|
||||||
{
|
|
||||||
completion[i] = '\0';
|
|
||||||
stop = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
//first check commands
|
|
||||||
CONS_Printf("\nCommands:\n");
|
|
||||||
|
|
||||||
for (cmd = COM_CompleteCommand(completion, i); cmd; cmd = COM_CompleteCommand(completion, i))
|
|
||||||
{
|
|
||||||
strncpy(nameremainder, cmd+(stop), strlen(cmd)-(stop));
|
|
||||||
nameremainder[strlen(cmd)-(stop)] = '\0';
|
|
||||||
|
|
||||||
CONS_Printf(" \x83" "%s" "\x80" "%s\n", completion, nameremainder);
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
if (i == 0)
|
|
||||||
CONS_Printf(" (none)\n");
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
|
|
||||||
//now we move on to CVARs
|
|
||||||
CONS_Printf("Variables:\n");
|
|
||||||
|
|
||||||
for (cmd = CV_CompleteVar(completion, i); cmd; cmd = CV_CompleteVar(completion, i))
|
|
||||||
{
|
|
||||||
strncpy(nameremainder, cmd+(stop), strlen(cmd)-(stop));
|
|
||||||
nameremainder[strlen(cmd)-(stop)] = '\0';
|
|
||||||
|
|
||||||
CONS_Printf(" \x83" "%s" "\x80" "%s\n", completion, nameremainder);
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
if (i == 0)
|
|
||||||
CONS_Printf(" (none)\n");
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// sequential command completion forward and backward
|
// sequential command completion forward and backward
|
||||||
|
|
||||||
// remember typing for several completions (a-la-4dos)
|
// remember typing for several completions (a-la-4dos)
|
||||||
if (inputlines[inputline][input_cx-1] != ' ')
|
if (!completion[0])
|
||||||
{
|
{
|
||||||
if (strlen(inputlines[inputline]+1) < 80)
|
if (!input_len || input_len >= 40 || strchr(inputlines[inputline], ' '))
|
||||||
strcpy(completion, inputlines[inputline]+1);
|
return true;
|
||||||
else
|
strcpy(completion, inputlines[inputline]);
|
||||||
completion[0] = 0;
|
|
||||||
|
|
||||||
comskips = varskips = 0;
|
comskips = varskips = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -783,37 +872,26 @@ boolean CON_Responder(event_t *ev)
|
||||||
if (--varskips < 0)
|
if (--varskips < 0)
|
||||||
comskips = -comskips - 2;
|
comskips = -comskips - 2;
|
||||||
}
|
}
|
||||||
else if (comskips > 0)
|
else if (comskips > 0) comskips--;
|
||||||
comskips--;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (comskips < 0)
|
if (comskips < 0) varskips++;
|
||||||
varskips++;
|
else comskips++;
|
||||||
else
|
|
||||||
comskips++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comskips >= 0)
|
if (comskips >= 0)
|
||||||
{
|
{
|
||||||
cmd = COM_CompleteCommand(completion, comskips);
|
cmd = COM_CompleteCommand(completion, comskips);
|
||||||
if (!cmd)
|
if (!cmd) // dirty: make sure if comskips is zero, to have a neg value
|
||||||
// dirty: make sure if comskips is zero, to have a neg value
|
|
||||||
comskips = -comskips - 1;
|
comskips = -comskips - 1;
|
||||||
}
|
}
|
||||||
if (comskips < 0)
|
if (comskips < 0)
|
||||||
cmd = CV_CompleteVar(completion, varskips);
|
cmd = CV_CompleteVar(completion, varskips);
|
||||||
|
|
||||||
if (cmd)
|
if (cmd)
|
||||||
{
|
CON_InputSetString(va("%s ", cmd));
|
||||||
memset(inputlines[inputline]+1, 0, CON_MAXPROMPTCHARS-1);
|
|
||||||
strcpy(inputlines[inputline]+1, cmd);
|
|
||||||
input_cx = strlen(cmd) + 1;
|
|
||||||
inputlines[inputline][input_cx] = ' ';
|
|
||||||
input_cx++;
|
|
||||||
inputlines[inputline][input_cx] = 0;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (comskips > 0)
|
if (comskips > 0)
|
||||||
|
@ -839,47 +917,80 @@ boolean CON_Responder(event_t *ev)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == KEY_HOME) // oldest text in buffer
|
if (key == KEY_LEFTARROW)
|
||||||
{
|
{
|
||||||
con_scrollup = (con_totallines-((con_curlines-16)>>3));
|
if (input_cur != 0)
|
||||||
|
--input_cur;
|
||||||
|
if (!shiftdown)
|
||||||
|
input_sel = input_cur;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (key == KEY_END) // most recent text in buffer
|
else if (key == KEY_RIGHTARROW)
|
||||||
{
|
{
|
||||||
con_scrollup = 0;
|
if (input_cur < input_len)
|
||||||
|
++input_cur;
|
||||||
|
if (!shiftdown)
|
||||||
|
input_sel = input_cur;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (key == KEY_HOME)
|
||||||
|
{
|
||||||
|
input_cur = 0;
|
||||||
|
if (!shiftdown)
|
||||||
|
input_sel = input_cur;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (key == KEY_END)
|
||||||
|
{
|
||||||
|
input_cur = input_len;
|
||||||
|
if (!shiftdown)
|
||||||
|
input_sel = input_cur;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// At this point we're messing with input
|
||||||
|
// Clear completion
|
||||||
|
completion[0] = 0;
|
||||||
|
|
||||||
// command enter
|
// command enter
|
||||||
if (key == KEY_ENTER)
|
if (key == KEY_ENTER)
|
||||||
{
|
{
|
||||||
if (input_cx < 2)
|
if (!input_len)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// push the command
|
// push the command
|
||||||
COM_BufAddText(inputlines[inputline]+1);
|
COM_BufAddText(inputlines[inputline]);
|
||||||
COM_BufAddText("\n");
|
COM_BufAddText("\n");
|
||||||
|
|
||||||
CONS_Printf("%s\n", inputlines[inputline]);
|
CONS_Printf("\x86""%c""\x80""%s\n", CON_PROMPTCHAR, inputlines[inputline]);
|
||||||
|
|
||||||
inputline = (inputline+1) & 31;
|
inputline = (inputline+1) & 31;
|
||||||
inputhist = inputline;
|
inputhist = inputline;
|
||||||
|
CON_InputClear();
|
||||||
memset(inputlines[inputline], 0, CON_MAXPROMPTCHARS);
|
|
||||||
inputlines[inputline][0] = CON_PROMPTCHAR;
|
|
||||||
input_cx = 1;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// backspace command prompt
|
// backspace and delete command prompt
|
||||||
if (key == KEY_BACKSPACE)
|
if (input_sel != input_cur)
|
||||||
{
|
{
|
||||||
if (input_cx > 1)
|
if (key == KEY_BACKSPACE || key == KEY_DEL)
|
||||||
{
|
{
|
||||||
input_cx--;
|
CON_InputDelSelection();
|
||||||
inputlines[inputline][input_cx] = 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (key == KEY_BACKSPACE)
|
||||||
|
{
|
||||||
|
CON_InputDelChar();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (key == KEY_DEL)
|
||||||
|
{
|
||||||
|
if (input_cur == input_len)
|
||||||
|
return true;
|
||||||
|
++input_cur;
|
||||||
|
CON_InputDelChar();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -888,18 +999,15 @@ boolean CON_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
// copy one of the previous inputlines to the current
|
// copy one of the previous inputlines to the current
|
||||||
do
|
do
|
||||||
{
|
|
||||||
inputhist = (inputhist - 1) & 31; // cycle back
|
inputhist = (inputhist - 1) & 31; // cycle back
|
||||||
} while (inputhist != inputline && !inputlines[inputhist][1]);
|
while (inputhist != inputline && !inputlines[inputhist][0]);
|
||||||
|
|
||||||
// stop at the last history input line, which is the
|
// stop at the last history input line, which is the
|
||||||
// current line + 1 because we cycle through the 32 input lines
|
// current line + 1 because we cycle through the 32 input lines
|
||||||
if (inputhist == inputline)
|
if (inputhist == inputline)
|
||||||
inputhist = (inputline + 1) & 31;
|
inputhist = (inputline + 1) & 31;
|
||||||
|
|
||||||
M_Memcpy(inputlines[inputline], inputlines[inputhist], CON_MAXPROMPTCHARS);
|
CON_InputSetString(inputlines[inputhist]);
|
||||||
input_cx = strlen(inputlines[inputline]);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -909,23 +1017,14 @@ boolean CON_Responder(event_t *ev)
|
||||||
if (inputhist == inputline)
|
if (inputhist == inputline)
|
||||||
return true;
|
return true;
|
||||||
do
|
do
|
||||||
{
|
|
||||||
inputhist = (inputhist + 1) & 31;
|
inputhist = (inputhist + 1) & 31;
|
||||||
} while (inputhist != inputline && !inputlines[inputhist][1]);
|
while (inputhist != inputline && !inputlines[inputhist][0]);
|
||||||
|
|
||||||
memset(inputlines[inputline], 0, CON_MAXPROMPTCHARS);
|
|
||||||
|
|
||||||
// back to currentline
|
// back to currentline
|
||||||
if (inputhist == inputline)
|
if (inputhist == inputline)
|
||||||
{
|
CON_InputClear();
|
||||||
inputlines[inputline][0] = CON_PROMPTCHAR;
|
|
||||||
input_cx = 1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
CON_InputSetString(inputlines[inputhist]);
|
||||||
strcpy(inputlines[inputline], inputlines[inputhist]);
|
|
||||||
input_cx = strlen(inputlines[inputline]);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,15 +1049,12 @@ boolean CON_Responder(event_t *ev)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// add key to cmd line here
|
// add key to cmd line here
|
||||||
if (input_cx < CON_MAXPROMPTCHARS)
|
|
||||||
{
|
|
||||||
if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
|
if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
|
||||||
key = key + 'a' - 'A';
|
key = key + 'a' - 'A';
|
||||||
|
|
||||||
inputlines[inputline][input_cx] = (char)key;
|
if (input_sel != input_cur)
|
||||||
inputlines[inputline][input_cx + 1] = 0;
|
CON_InputDelSelection();
|
||||||
input_cx++;
|
CON_InputAddChar(key);
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1242,26 +1338,89 @@ void CONS_Error(const char *msg)
|
||||||
//
|
//
|
||||||
static void CON_DrawInput(void)
|
static void CON_DrawInput(void)
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
size_t c;
|
|
||||||
INT32 x, y;
|
|
||||||
INT32 charwidth = (INT32)con_scalefactor << 3;
|
INT32 charwidth = (INT32)con_scalefactor << 3;
|
||||||
|
const char *p = inputlines[inputline];
|
||||||
// input line scrolls left if it gets too long
|
size_t c, clen, cend;
|
||||||
p = inputlines[inputline];
|
UINT8 lellip = 0, rellip = 0;
|
||||||
if (input_cx >= con_width-11)
|
INT32 x, y, i;
|
||||||
p += input_cx - (con_width-11) + 1;
|
|
||||||
|
|
||||||
y = con_curlines - 12 * con_scalefactor;
|
y = con_curlines - 12 * con_scalefactor;
|
||||||
|
x = charwidth*2;
|
||||||
|
|
||||||
for (c = 0, x = charwidth; c < con_width-11; c++, x += charwidth)
|
clen = con_width-13;
|
||||||
|
|
||||||
|
if (input_len <= clen)
|
||||||
|
{
|
||||||
|
c = 0;
|
||||||
|
clen = input_len;
|
||||||
|
}
|
||||||
|
else // input line scrolls left if it gets too long
|
||||||
|
{
|
||||||
|
clen -= 2; // There will always be some extra truncation -- but where is what we'll find out
|
||||||
|
|
||||||
|
if (input_cur <= clen/2)
|
||||||
|
{
|
||||||
|
// Close enough to right edge to show all
|
||||||
|
c = 0;
|
||||||
|
// Always will truncate right side from this position, so always draw right ellipsis
|
||||||
|
rellip = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Cursor in the middle (or right side) of input
|
||||||
|
// Move over for the ellipsis
|
||||||
|
c = input_cur - (clen/2) + 2;
|
||||||
|
x += charwidth*2;
|
||||||
|
lellip = 1;
|
||||||
|
|
||||||
|
if (c + clen >= input_len)
|
||||||
|
{
|
||||||
|
// Cursor in the right side of input
|
||||||
|
// We were too far over, so move back
|
||||||
|
c = input_len - clen;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Cursor in the middle -- ellipses on both sides
|
||||||
|
clen -= 2;
|
||||||
|
rellip = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lellip)
|
||||||
|
{
|
||||||
|
x -= charwidth*3;
|
||||||
|
if (input_sel < c)
|
||||||
|
V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 77 | V_NOSCALESTART);
|
||||||
|
for (i = 0; i < 3; ++i, x += charwidth)
|
||||||
|
V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
V_DrawCharacter(x-charwidth, y, CON_PROMPTCHAR | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
|
|
||||||
|
for (cend = c + clen; c < cend; ++c, x += charwidth)
|
||||||
|
{
|
||||||
|
if ((input_sel > c && input_cur <= c) || (input_sel <= c && input_cur > c))
|
||||||
|
{
|
||||||
|
V_DrawFill(x, y, charwidth, (10 * con_scalefactor), 77 | V_NOSCALESTART);
|
||||||
|
V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_YELLOWMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
V_DrawCharacter(x, y, p[c] | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
|
|
||||||
// draw the blinking cursor
|
if (c == input_cur && con_tick >= 4)
|
||||||
//
|
V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
x = ((input_cx >= con_width-11) ? (INT32)(con_width-11) : (INT32)((input_cx + 1)) * charwidth);
|
}
|
||||||
if (con_tick < 4)
|
if (cend == input_cur && con_tick >= 4)
|
||||||
V_DrawCharacter(x, y, '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
V_DrawCharacter(x, y + (con_scalefactor*2), '_' | cv_constextsize.value | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
|
if (rellip)
|
||||||
|
{
|
||||||
|
if (input_sel > cend)
|
||||||
|
V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 77 | V_NOSCALESTART);
|
||||||
|
for (i = 0; i < 3; ++i, x += charwidth)
|
||||||
|
V_DrawCharacter(x, y, '.' | cv_constextsize.value | V_GRAYMAP | V_NOSCALESTART, !cv_allcaps.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the last lines of console text to the top of the screen
|
// draw the last lines of console text to the top of the screen
|
||||||
|
@ -1417,7 +1576,7 @@ static void CON_DrawConsole(void)
|
||||||
{
|
{
|
||||||
// inu: no more width (was always 0 and vid.width)
|
// inu: no more width (was always 0 and vid.width)
|
||||||
if (rendermode != render_none)
|
if (rendermode != render_none)
|
||||||
V_DrawFadeConsBack(con_curlines, cons_backcolor.value); // translucent background
|
V_DrawFadeConsBack(con_curlines); // translucent background
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw console text lines from top to bottom
|
// draw console text lines from top to bottom
|
||||||
|
|
|
@ -40,11 +40,10 @@ extern consvar_t cons_backcolor;
|
||||||
|
|
||||||
extern UINT8 *yellowmap, *purplemap, *lgreenmap, *bluemap, *graymap, *redmap, *orangemap;
|
extern UINT8 *yellowmap, *purplemap, *lgreenmap, *bluemap, *graymap, *redmap, *orangemap;
|
||||||
|
|
||||||
// Console bg colors:
|
// Console bg color (auto updated to match)
|
||||||
extern UINT8 *cwhitemap, *corangemap, *cbluemap, *cgreenmap, *cgraymap,
|
extern UINT8 *consolebgmap;
|
||||||
*credmap;
|
|
||||||
|
|
||||||
void CON_ReSetupBackColormap(UINT16 num);
|
void CON_SetupBackColormap(void);
|
||||||
void CON_ClearHUD(void); // clear heads up messages
|
void CON_ClearHUD(void); // clear heads up messages
|
||||||
|
|
||||||
void CON_Ticker(void);
|
void CON_Ticker(void);
|
||||||
|
|
|
@ -495,7 +495,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
|
||||||
rsp->powers[j] = (UINT16)SHORT(players[i].powers[j]);
|
rsp->powers[j] = (UINT16)SHORT(players[i].powers[j]);
|
||||||
|
|
||||||
// Score is resynched in the rspfirm resync packet
|
// Score is resynched in the rspfirm resync packet
|
||||||
rsp->health = 0; // resynched with mo health
|
rsp->rings = LONG(players[i].rings);
|
||||||
rsp->lives = players[i].lives;
|
rsp->lives = players[i].lives;
|
||||||
rsp->continues = players[i].continues;
|
rsp->continues = players[i].continues;
|
||||||
rsp->scoreadd = players[i].scoreadd;
|
rsp->scoreadd = players[i].scoreadd;
|
||||||
|
@ -582,7 +582,6 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
|
||||||
rsp->hasmo = true;
|
rsp->hasmo = true;
|
||||||
|
|
||||||
rsp->health = LONG(players[i].mo->health);
|
rsp->health = LONG(players[i].mo->health);
|
||||||
|
|
||||||
rsp->angle = (angle_t)LONG(players[i].mo->angle);
|
rsp->angle = (angle_t)LONG(players[i].mo->angle);
|
||||||
rsp->x = LONG(players[i].mo->x);
|
rsp->x = LONG(players[i].mo->x);
|
||||||
rsp->y = LONG(players[i].mo->y);
|
rsp->y = LONG(players[i].mo->y);
|
||||||
|
@ -625,7 +624,7 @@ static void resynch_read_player(resynch_pak *rsp)
|
||||||
players[i].powers[j] = (UINT16)SHORT(rsp->powers[j]);
|
players[i].powers[j] = (UINT16)SHORT(rsp->powers[j]);
|
||||||
|
|
||||||
// Score is resynched in the rspfirm resync packet
|
// Score is resynched in the rspfirm resync packet
|
||||||
players[i].health = rsp->health;
|
players[i].rings = LONG(rsp->rings);
|
||||||
players[i].lives = rsp->lives;
|
players[i].lives = rsp->lives;
|
||||||
players[i].continues = rsp->continues;
|
players[i].continues = rsp->continues;
|
||||||
players[i].scoreadd = rsp->scoreadd;
|
players[i].scoreadd = rsp->scoreadd;
|
||||||
|
@ -2254,7 +2253,7 @@ static void CL_RemovePlayer(INT32 playernum)
|
||||||
}
|
}
|
||||||
|
|
||||||
count--;
|
count--;
|
||||||
rings = players[playernum].health - 1;
|
rings = players[playernum].rings;
|
||||||
increment = rings/count;
|
increment = rings/count;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
|
|
@ -155,7 +155,7 @@ typedef struct
|
||||||
UINT16 powers[NUMPOWERS];
|
UINT16 powers[NUMPOWERS];
|
||||||
|
|
||||||
// Score is resynched in the confirm resync packet
|
// Score is resynched in the confirm resync packet
|
||||||
INT32 health;
|
INT32 rings;
|
||||||
SINT8 lives;
|
SINT8 lives;
|
||||||
SINT8 continues;
|
SINT8 continues;
|
||||||
UINT8 scoreadd;
|
UINT8 scoreadd;
|
||||||
|
@ -236,6 +236,7 @@ typedef struct
|
||||||
//player->mo stuff
|
//player->mo stuff
|
||||||
UINT8 hasmo; //boolean
|
UINT8 hasmo; //boolean
|
||||||
|
|
||||||
|
INT32 health;
|
||||||
angle_t angle;
|
angle_t angle;
|
||||||
fixed_t x;
|
fixed_t x;
|
||||||
fixed_t y;
|
fixed_t y;
|
||||||
|
|
36
src/d_main.c
36
src/d_main.c
|
@ -73,6 +73,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
||||||
#include "dehacked.h" // Dehacked list test
|
#include "dehacked.h" // Dehacked list test
|
||||||
#include "m_cond.h" // condition initialization
|
#include "m_cond.h" // condition initialization
|
||||||
#include "fastcmp.h"
|
#include "fastcmp.h"
|
||||||
|
#include "keys.h"
|
||||||
|
|
||||||
#ifdef CMAKECONFIG
|
#ifdef CMAKECONFIG
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -176,6 +177,38 @@ void D_PostEvent(const event_t *ev)
|
||||||
void D_PostEvent_end(void) {};
|
void D_PostEvent_end(void) {};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// modifier keys
|
||||||
|
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
|
||||||
|
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
|
||||||
|
UINT8 altdown = 0; // 0x1 left, 0x2 right
|
||||||
|
//
|
||||||
|
// D_ModifierKeyResponder
|
||||||
|
// Sets global shift/ctrl/alt variables, never actually eats events
|
||||||
|
//
|
||||||
|
static inline void D_ModifierKeyResponder(event_t *ev)
|
||||||
|
{
|
||||||
|
if (ev->type == ev_keydown) switch (ev->data1)
|
||||||
|
{
|
||||||
|
case KEY_LSHIFT: shiftdown |= 0x1; return;
|
||||||
|
case KEY_RSHIFT: shiftdown |= 0x2; return;
|
||||||
|
case KEY_LCTRL: ctrldown |= 0x1; return;
|
||||||
|
case KEY_RCTRL: ctrldown |= 0x2; return;
|
||||||
|
case KEY_LALT: altdown |= 0x1; return;
|
||||||
|
case KEY_RALT: altdown |= 0x2; return;
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
|
else if (ev->type == ev_keyup) switch (ev->data1)
|
||||||
|
{
|
||||||
|
case KEY_LSHIFT: shiftdown &= ~0x1; return;
|
||||||
|
case KEY_RSHIFT: shiftdown &= ~0x2; return;
|
||||||
|
case KEY_LCTRL: ctrldown &= ~0x1; return;
|
||||||
|
case KEY_RCTRL: ctrldown &= ~0x2; return;
|
||||||
|
case KEY_LALT: altdown &= ~0x1; return;
|
||||||
|
case KEY_RALT: altdown &= ~0x2; return;
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// D_ProcessEvents
|
// D_ProcessEvents
|
||||||
// Send all the events of the given timestamp down the responder chain
|
// Send all the events of the given timestamp down the responder chain
|
||||||
|
@ -188,6 +221,9 @@ void D_ProcessEvents(void)
|
||||||
{
|
{
|
||||||
ev = &events[eventtail];
|
ev = &events[eventtail];
|
||||||
|
|
||||||
|
// Set global shift/ctrl/alt down variables
|
||||||
|
D_ModifierKeyResponder(ev); // never eats events
|
||||||
|
|
||||||
// Screenshots over everything so that they can be taken anywhere.
|
// Screenshots over everything so that they can be taken anywhere.
|
||||||
if (M_ScreenshotResponder(ev))
|
if (M_ScreenshotResponder(ev))
|
||||||
continue; // ate the event
|
continue; // ate the event
|
||||||
|
|
|
@ -2574,7 +2574,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
if (players[playernum].spectator)
|
if (players[playernum].spectator)
|
||||||
{
|
{
|
||||||
players[playernum].score = 0;
|
players[playernum].score = 0;
|
||||||
players[playernum].health = 1;
|
players[playernum].rings = 0;
|
||||||
if (players[playernum].mo)
|
if (players[playernum].mo)
|
||||||
players[playernum].mo->health = 1;
|
players[playernum].mo->health = 1;
|
||||||
}
|
}
|
||||||
|
@ -4055,8 +4055,7 @@ static void Skin_OnChange(void)
|
||||||
if (!Playing())
|
if (!Playing())
|
||||||
return; // do whatever you want
|
return; // do whatever you want
|
||||||
|
|
||||||
if (!(cv_debug || devparm) && !(multiplayer || netgame) // In single player.
|
if (!(cv_debug || devparm) && !(multiplayer || netgame)) // In single player.
|
||||||
&& (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_CONTINUING))
|
|
||||||
{
|
{
|
||||||
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
|
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -44,6 +44,7 @@ typedef enum
|
||||||
SF_STOMPDAMAGE = 1<<9, // Always damage enemies, etc by landing on them, no matter your vunerability?
|
SF_STOMPDAMAGE = 1<<9, // Always damage enemies, etc by landing on them, no matter your vunerability?
|
||||||
SF_MARIODAMAGE = SF_NOJUMPDAMAGE|SF_STOMPDAMAGE, // The Mario method of being able to damage enemies, etc.
|
SF_MARIODAMAGE = SF_NOJUMPDAMAGE|SF_STOMPDAMAGE, // The Mario method of being able to damage enemies, etc.
|
||||||
SF_MACHINE = 1<<10, // Beep boop. Are you a robot?
|
SF_MACHINE = 1<<10, // Beep boop. Are you a robot?
|
||||||
|
SF_NOSPINDASHDUST = 1<<11, // Don't spawn dust particles when charging a spindash
|
||||||
// free up to and including 1<<31
|
// free up to and including 1<<31
|
||||||
} skinflags_t;
|
} skinflags_t;
|
||||||
|
|
||||||
|
@ -151,7 +152,13 @@ typedef enum
|
||||||
PF_ANALOGMODE = 1<<26, // Analog mode?
|
PF_ANALOGMODE = 1<<26, // Analog mode?
|
||||||
|
|
||||||
// Can carry another player?
|
// Can carry another player?
|
||||||
PF_CANCARRY = 1<<27
|
PF_CANCARRY = 1<<27,
|
||||||
|
|
||||||
|
// Used shield ability
|
||||||
|
PF_SHIELDABILITY = 1<<28,
|
||||||
|
|
||||||
|
// Force jump damage?
|
||||||
|
PF_FORCEJUMPDAMAGE = 1<<29
|
||||||
|
|
||||||
// free up to and including 1<<31
|
// free up to and including 1<<31
|
||||||
} pflags_t;
|
} pflags_t;
|
||||||
|
@ -178,23 +185,34 @@ typedef enum
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
SH_NONE = 0,
|
SH_NONE = 0,
|
||||||
// Standard shields
|
|
||||||
SH_JUMP,
|
|
||||||
SH_ATTRACT,
|
|
||||||
SH_ELEMENTAL,
|
|
||||||
SH_BOMB,
|
|
||||||
// Stupid useless unimplimented Sonic 3 shields
|
|
||||||
SH_BUBBLEWRAP,
|
|
||||||
SH_THUNDERCOIN,
|
|
||||||
SH_FLAMEAURA,
|
|
||||||
// Pity shield: the world's most basic shield ever, given to players who suck at Match
|
|
||||||
SH_PITY,
|
|
||||||
// The fireflower is special, it combines with other shields.
|
|
||||||
SH_FIREFLOWER = 0x100,
|
|
||||||
// The force shield uses the lower 8 bits to count how many hits are left.
|
|
||||||
SH_FORCE = 0x200,
|
|
||||||
|
|
||||||
SH_STACK = SH_FIREFLOWER,
|
// Shield flags
|
||||||
|
SH_PROTECTFIRE = 0x400,
|
||||||
|
SH_PROTECTWATER = 0x800,
|
||||||
|
SH_PROTECTELECTRIC = 0x1000,
|
||||||
|
|
||||||
|
// Indivisible shields
|
||||||
|
SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match
|
||||||
|
SH_WHIRLWIND,
|
||||||
|
SH_ARMAGEDDON,
|
||||||
|
|
||||||
|
// normal shields that use flags
|
||||||
|
SH_ATTRACT = SH_PROTECTELECTRIC,
|
||||||
|
SH_ELEMENTAL = SH_PROTECTFIRE|SH_PROTECTWATER,
|
||||||
|
|
||||||
|
// Sonic 3 shields
|
||||||
|
SH_FLAMEAURA = SH_PROTECTFIRE,
|
||||||
|
SH_BUBBLEWRAP = SH_PROTECTWATER,
|
||||||
|
SH_THUNDERCOIN = SH_WHIRLWIND|SH_PROTECTELECTRIC,
|
||||||
|
|
||||||
|
// The force shield uses the lower 8 bits to count how many extra hits are left.
|
||||||
|
SH_FORCE = 0x100,
|
||||||
|
SH_FORCEHP = 0xFF, // to be used as a bitmask only
|
||||||
|
|
||||||
|
// Mostly for use with Mario mode.
|
||||||
|
SH_FIREFLOWER = 0x200,
|
||||||
|
|
||||||
|
SH_STACK = SH_FIREFLOWER, // second-layer shields
|
||||||
SH_NOSTACK = ~SH_STACK
|
SH_NOSTACK = ~SH_STACK
|
||||||
} shieldtype_t; // pw_shield
|
} shieldtype_t; // pw_shield
|
||||||
|
|
||||||
|
@ -297,10 +315,8 @@ typedef struct player_s
|
||||||
// It is updated with cmd->aiming.
|
// It is updated with cmd->aiming.
|
||||||
angle_t aiming;
|
angle_t aiming;
|
||||||
|
|
||||||
// This is only used between levels,
|
// player's ring count
|
||||||
// mo->health is used during levels.
|
INT32 rings;
|
||||||
/// \todo Remove this. We don't need a second health definition for players.
|
|
||||||
INT32 health;
|
|
||||||
|
|
||||||
SINT8 pity; // i pity the fool.
|
SINT8 pity; // i pity the fool.
|
||||||
INT32 currentweapon; // current weapon selected.
|
INT32 currentweapon; // current weapon selected.
|
||||||
|
@ -361,8 +377,8 @@ typedef struct player_s
|
||||||
UINT8 gotcontinue; // Got continue from this stage?
|
UINT8 gotcontinue; // Got continue from this stage?
|
||||||
|
|
||||||
fixed_t speed; // Player's speed (distance formula of MOMX and MOMY values)
|
fixed_t speed; // Player's speed (distance formula of MOMX and MOMY values)
|
||||||
UINT8 jumping; // Jump counter
|
UINT8 jumping; // Holding down jump button
|
||||||
UINT8 secondjump;
|
UINT8 secondjump; // Jump counter
|
||||||
|
|
||||||
UINT8 fly1; // Tails flying
|
UINT8 fly1; // Tails flying
|
||||||
UINT8 scoreadd; // Used for multiple enemy attack bonus
|
UINT8 scoreadd; // Used for multiple enemy attack bonus
|
||||||
|
|
198
src/dehacked.c
198
src/dehacked.c
|
@ -1687,6 +1687,9 @@ static actionpointer_t actionpointers[] =
|
||||||
{{A_WaterShield}, "A_WATERSHIELD"},
|
{{A_WaterShield}, "A_WATERSHIELD"},
|
||||||
{{A_ForceShield}, "A_FORCESHIELD"},
|
{{A_ForceShield}, "A_FORCESHIELD"},
|
||||||
{{A_PityShield}, "A_PITYSHIELD"},
|
{{A_PityShield}, "A_PITYSHIELD"},
|
||||||
|
{{A_FlameShield}, "A_FLAMESHIELD"},
|
||||||
|
{{A_BubbleShield}, "A_BUBBLESHIELD"},
|
||||||
|
{{A_ThunderShield}, "A_THUNDERSHIELD"},
|
||||||
{{A_GravityBox}, "A_GRAVITYBOX"},
|
{{A_GravityBox}, "A_GRAVITYBOX"},
|
||||||
{{A_ScoreRise}, "A_SCORERISE"},
|
{{A_ScoreRise}, "A_SCORERISE"},
|
||||||
{{A_ParticleSpawn}, "A_PARTICLESPAWN"},
|
{{A_ParticleSpawn}, "A_PARTICLESPAWN"},
|
||||||
|
@ -2778,7 +2781,7 @@ static void readpatch(MYFILE *f, const char *name, UINT16 wad)
|
||||||
char *word2;
|
char *word2;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
INT32 i = 0, j = 0, value;
|
INT32 i = 0, j = 0, value;
|
||||||
texpatch_t patch = {0, 0, UINT16_MAX, UINT16_MAX};
|
texpatch_t patch = {0, 0, UINT16_MAX, UINT16_MAX, 0};
|
||||||
|
|
||||||
// Jump to the texture this patch belongs to, which,
|
// Jump to the texture this patch belongs to, which,
|
||||||
// coincidentally, is always the last one on the buffer cache.
|
// coincidentally, is always the last one on the buffer cache.
|
||||||
|
@ -4834,7 +4837,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_SPIKEBALL7",
|
"S_SPIKEBALL7",
|
||||||
"S_SPIKEBALL8",
|
"S_SPIKEBALL8",
|
||||||
|
|
||||||
// Fire Shield's Spawn
|
// Elemental Shield's Spawn
|
||||||
"S_SPINFIRE1",
|
"S_SPINFIRE1",
|
||||||
"S_SPINFIRE2",
|
"S_SPINFIRE2",
|
||||||
"S_SPINFIRE3",
|
"S_SPINFIRE3",
|
||||||
|
@ -4908,6 +4911,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_RECYCLER_BOX",
|
"S_RECYCLER_BOX",
|
||||||
"S_SCORE1K_BOX",
|
"S_SCORE1K_BOX",
|
||||||
"S_SCORE10K_BOX",
|
"S_SCORE10K_BOX",
|
||||||
|
"S_FLAMEAURA_BOX",
|
||||||
|
"S_BUBBLEWRAP_BOX",
|
||||||
|
"S_THUNDERCOIN_BOX",
|
||||||
|
|
||||||
// Gold Repeat Monitor States (one per box)
|
// Gold Repeat Monitor States (one per box)
|
||||||
"S_PITY_GOLDBOX",
|
"S_PITY_GOLDBOX",
|
||||||
|
@ -4920,6 +4926,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_INVULN_GOLDBOX",
|
"S_INVULN_GOLDBOX",
|
||||||
"S_EGGMAN_GOLDBOX",
|
"S_EGGMAN_GOLDBOX",
|
||||||
"S_GRAVITY_GOLDBOX",
|
"S_GRAVITY_GOLDBOX",
|
||||||
|
"S_FLAMEAURA_GOLDBOX",
|
||||||
|
"S_BUBBLEWRAP_GOLDBOX",
|
||||||
|
"S_THUNDERCOIN_GOLDBOX",
|
||||||
|
|
||||||
// Team Ring Boxes (these are special)
|
// Team Ring Boxes (these are special)
|
||||||
"S_RING_REDBOX1",
|
"S_RING_REDBOX1",
|
||||||
|
@ -4981,6 +4990,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_SCORE10K_ICON1",
|
"S_SCORE10K_ICON1",
|
||||||
"S_SCORE10K_ICON2",
|
"S_SCORE10K_ICON2",
|
||||||
|
|
||||||
|
"S_FLAMEAURA_ICON1",
|
||||||
|
"S_FLAMEAURA_ICON2",
|
||||||
|
|
||||||
|
"S_BUBBLEWRAP_ICON1",
|
||||||
|
"S_BUBBLEWRAP_ICON2",
|
||||||
|
|
||||||
|
"S_THUNDERCOIN_ICON1",
|
||||||
|
"S_THUNDERCOIN_ICON2",
|
||||||
|
|
||||||
"S_ROCKET",
|
"S_ROCKET",
|
||||||
|
|
||||||
"S_LASER",
|
"S_LASER",
|
||||||
|
@ -5350,6 +5368,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_MAGN10",
|
"S_MAGN10",
|
||||||
"S_MAGN11",
|
"S_MAGN11",
|
||||||
"S_MAGN12",
|
"S_MAGN12",
|
||||||
|
"S_MAGN13",
|
||||||
|
|
||||||
"S_FORC1",
|
"S_FORC1",
|
||||||
"S_FORC2",
|
"S_FORC2",
|
||||||
|
@ -5373,6 +5392,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_FORC19",
|
"S_FORC19",
|
||||||
"S_FORC20",
|
"S_FORC20",
|
||||||
|
|
||||||
|
"S_FORC21",
|
||||||
|
|
||||||
"S_ELEM1",
|
"S_ELEM1",
|
||||||
"S_ELEM2",
|
"S_ELEM2",
|
||||||
"S_ELEM3",
|
"S_ELEM3",
|
||||||
|
@ -5386,6 +5407,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_ELEM11",
|
"S_ELEM11",
|
||||||
"S_ELEM12",
|
"S_ELEM12",
|
||||||
|
|
||||||
|
"S_ELEM13",
|
||||||
|
"S_ELEM14",
|
||||||
|
|
||||||
"S_ELEMF1",
|
"S_ELEMF1",
|
||||||
"S_ELEMF2",
|
"S_ELEMF2",
|
||||||
"S_ELEMF3",
|
"S_ELEMF3",
|
||||||
|
@ -5394,6 +5418,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_ELEMF6",
|
"S_ELEMF6",
|
||||||
"S_ELEMF7",
|
"S_ELEMF7",
|
||||||
"S_ELEMF8",
|
"S_ELEMF8",
|
||||||
|
"S_ELEMF9",
|
||||||
|
"S_ELEMF10",
|
||||||
|
|
||||||
"S_PITY1",
|
"S_PITY1",
|
||||||
"S_PITY2",
|
"S_PITY2",
|
||||||
|
@ -5406,6 +5432,84 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
"S_PITY9",
|
"S_PITY9",
|
||||||
"S_PITY10",
|
"S_PITY10",
|
||||||
|
|
||||||
|
"S_FIRS1",
|
||||||
|
"S_FIRS2",
|
||||||
|
"S_FIRS3",
|
||||||
|
"S_FIRS4",
|
||||||
|
"S_FIRS5",
|
||||||
|
"S_FIRS6",
|
||||||
|
"S_FIRS7",
|
||||||
|
"S_FIRS8",
|
||||||
|
"S_FIRS9",
|
||||||
|
|
||||||
|
"S_FIRS10",
|
||||||
|
"S_FIRS11",
|
||||||
|
|
||||||
|
"S_FIRSB1",
|
||||||
|
"S_FIRSB2",
|
||||||
|
"S_FIRSB3",
|
||||||
|
"S_FIRSB4",
|
||||||
|
"S_FIRSB5",
|
||||||
|
"S_FIRSB6",
|
||||||
|
"S_FIRSB7",
|
||||||
|
"S_FIRSB8",
|
||||||
|
"S_FIRSB9",
|
||||||
|
|
||||||
|
"S_FIRSB10",
|
||||||
|
|
||||||
|
"S_BUBS1",
|
||||||
|
"S_BUBS2",
|
||||||
|
"S_BUBS3",
|
||||||
|
"S_BUBS4",
|
||||||
|
"S_BUBS5",
|
||||||
|
"S_BUBS6",
|
||||||
|
"S_BUBS7",
|
||||||
|
"S_BUBS8",
|
||||||
|
"S_BUBS9",
|
||||||
|
|
||||||
|
"S_BUBS10",
|
||||||
|
"S_BUBS11",
|
||||||
|
|
||||||
|
"S_BUBSB1",
|
||||||
|
"S_BUBSB2",
|
||||||
|
"S_BUBSB3",
|
||||||
|
"S_BUBSB4",
|
||||||
|
|
||||||
|
"S_BUBSB5",
|
||||||
|
"S_BUBSB6",
|
||||||
|
|
||||||
|
"S_ZAPS1",
|
||||||
|
"S_ZAPS2",
|
||||||
|
"S_ZAPS3",
|
||||||
|
"S_ZAPS4",
|
||||||
|
"S_ZAPS5",
|
||||||
|
"S_ZAPS6",
|
||||||
|
"S_ZAPS7",
|
||||||
|
"S_ZAPS8",
|
||||||
|
"S_ZAPS9",
|
||||||
|
"S_ZAPS10",
|
||||||
|
"S_ZAPS11",
|
||||||
|
"S_ZAPS12",
|
||||||
|
"S_ZAPS13", // blank frame
|
||||||
|
"S_ZAPS14",
|
||||||
|
"S_ZAPS15",
|
||||||
|
"S_ZAPS16",
|
||||||
|
|
||||||
|
"S_ZAPSB1", // blank frame
|
||||||
|
"S_ZAPSB2",
|
||||||
|
"S_ZAPSB3",
|
||||||
|
"S_ZAPSB4",
|
||||||
|
"S_ZAPSB5",
|
||||||
|
"S_ZAPSB6",
|
||||||
|
"S_ZAPSB7",
|
||||||
|
"S_ZAPSB8",
|
||||||
|
"S_ZAPSB9",
|
||||||
|
"S_ZAPSB10",
|
||||||
|
"S_ZAPSB11", // blank frame
|
||||||
|
|
||||||
|
// Thunder spark
|
||||||
|
"S_THUNDERCOIN_SPARK",
|
||||||
|
|
||||||
// Invincibility Sparkles
|
// Invincibility Sparkles
|
||||||
"S_IVSP",
|
"S_IVSP",
|
||||||
|
|
||||||
|
@ -5566,6 +5670,20 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
|
|
||||||
"S_WATERZAP",
|
"S_WATERZAP",
|
||||||
|
|
||||||
|
// Spindash dust
|
||||||
|
"S_SPINDUST1",
|
||||||
|
"S_SPINDUST2",
|
||||||
|
"S_SPINDUST3",
|
||||||
|
"S_SPINDUST4",
|
||||||
|
"S_SPINDUST_BUBBLE1",
|
||||||
|
"S_SPINDUST_BUBBLE2",
|
||||||
|
"S_SPINDUST_BUBBLE3",
|
||||||
|
"S_SPINDUST_BUBBLE4",
|
||||||
|
"S_SPINDUST_FIRE1",
|
||||||
|
"S_SPINDUST_FIRE2",
|
||||||
|
"S_SPINDUST_FIRE3",
|
||||||
|
"S_SPINDUST_FIRE4",
|
||||||
|
|
||||||
"S_FOG1",
|
"S_FOG1",
|
||||||
"S_FOG2",
|
"S_FOG2",
|
||||||
"S_FOG3",
|
"S_FOG3",
|
||||||
|
@ -6164,6 +6282,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_RECYCLER_BOX",
|
"MT_RECYCLER_BOX",
|
||||||
"MT_SCORE1K_BOX",
|
"MT_SCORE1K_BOX",
|
||||||
"MT_SCORE10K_BOX",
|
"MT_SCORE10K_BOX",
|
||||||
|
"MT_FLAMEAURA_BOX",
|
||||||
|
"MT_BUBBLEWRAP_BOX",
|
||||||
|
"MT_THUNDERCOIN_BOX",
|
||||||
|
|
||||||
// Monitor boxes -- repeating (big) boxes
|
// Monitor boxes -- repeating (big) boxes
|
||||||
"MT_PITY_GOLDBOX",
|
"MT_PITY_GOLDBOX",
|
||||||
|
@ -6176,6 +6297,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_INVULN_GOLDBOX",
|
"MT_INVULN_GOLDBOX",
|
||||||
"MT_EGGMAN_GOLDBOX",
|
"MT_EGGMAN_GOLDBOX",
|
||||||
"MT_GRAVITY_GOLDBOX",
|
"MT_GRAVITY_GOLDBOX",
|
||||||
|
"MT_FLAMEAURA_GOLDBOX",
|
||||||
|
"MT_BUBBLEWRAP_GOLDBOX",
|
||||||
|
"MT_THUNDERCOIN_GOLDBOX",
|
||||||
|
|
||||||
// Monitor boxes -- special
|
// Monitor boxes -- special
|
||||||
"MT_RING_REDBOX",
|
"MT_RING_REDBOX",
|
||||||
|
@ -6198,6 +6322,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_RECYCLER_ICON",
|
"MT_RECYCLER_ICON",
|
||||||
"MT_SCORE1K_ICON",
|
"MT_SCORE1K_ICON",
|
||||||
"MT_SCORE10K_ICON",
|
"MT_SCORE10K_ICON",
|
||||||
|
"MT_FLAMEAURA_ICON",
|
||||||
|
"MT_BUBBLEWRAP_ICON",
|
||||||
|
"MT_THUNDERCOIN_ICON",
|
||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
"MT_ROCKET",
|
"MT_ROCKET",
|
||||||
|
@ -6350,13 +6477,17 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_EGGSTATUE2",
|
"MT_EGGSTATUE2",
|
||||||
|
|
||||||
// Powerup Indicators
|
// Powerup Indicators
|
||||||
"MT_GREENORB", // Elemental shield mobj
|
"MT_ELEMENTAL_ORB", // Elemental shield mobj
|
||||||
"MT_YELLOWORB", // Attract shield mobj
|
"MT_ATTRACT_ORB", // Attract shield mobj
|
||||||
"MT_BLUEORB", // Force shield mobj
|
"MT_FORCE_ORB", // Force shield mobj
|
||||||
"MT_BLACKORB", // Armageddon shield mobj
|
"MT_ARMAGEDDON_ORB", // Armageddon shield mobj
|
||||||
"MT_WHITEORB", // Whirlwind shield mobj
|
"MT_WHIRLWIND_ORB", // Whirlwind shield mobj
|
||||||
"MT_PITYORB", // Pity shield mobj
|
"MT_PITY_ORB", // Pity shield mobj
|
||||||
"MT_IVSP", // invincibility sparkles
|
"MT_FLAMEAURA_ORB", // Flame shield mobj
|
||||||
|
"MT_BUBBLEWRAP_ORB", // Bubble shield mobj
|
||||||
|
"MT_THUNDERCOIN_ORB", // Thunder shield mobj
|
||||||
|
"MT_THUNDERCOIN_SPARK", // Thunder spark
|
||||||
|
"MT_IVSP", // Invincibility sparkles
|
||||||
"MT_SUPERSPARK", // Super Sonic Spark
|
"MT_SUPERSPARK", // Super Sonic Spark
|
||||||
|
|
||||||
// Freed Animals
|
// Freed Animals
|
||||||
|
@ -6376,6 +6507,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_MEDIUMBUBBLE", // medium bubble
|
"MT_MEDIUMBUBBLE", // medium bubble
|
||||||
"MT_EXTRALARGEBUBBLE", // extra large bubble
|
"MT_EXTRALARGEBUBBLE", // extra large bubble
|
||||||
"MT_WATERZAP",
|
"MT_WATERZAP",
|
||||||
|
"MT_SPINDUST", // Spindash dust
|
||||||
"MT_TFOG",
|
"MT_TFOG",
|
||||||
"MT_SEED",
|
"MT_SEED",
|
||||||
"MT_PARTICLE",
|
"MT_PARTICLE",
|
||||||
|
@ -6553,7 +6685,7 @@ static const char *const MOBJFLAG2_LIST[] = {
|
||||||
"BOUNCERING", // Thrown ring has bounce properties
|
"BOUNCERING", // Thrown ring has bounce properties
|
||||||
"EXPLOSION", // Thrown ring has explosive properties
|
"EXPLOSION", // Thrown ring has explosive properties
|
||||||
"SCATTER", // Thrown ring has scatter properties
|
"SCATTER", // Thrown ring has scatter properties
|
||||||
"BEYONDTHEGRAVE",// Source of this missile has died and has since respawned.
|
"BEYONDTHEGRAVE", // Source of this missile has died and has since respawned.
|
||||||
"SLIDEPUSH", // MF_PUSHABLE that pushes continuously.
|
"SLIDEPUSH", // MF_PUSHABLE that pushes continuously.
|
||||||
"CLASSICPUSH", // Drops straight down when object has negative Z.
|
"CLASSICPUSH", // Drops straight down when object has negative Z.
|
||||||
"STANDONME", // While not pushable, stand on me anyway.
|
"STANDONME", // While not pushable, stand on me anyway.
|
||||||
|
@ -6573,6 +6705,7 @@ static const char *const MOBJFLAG2_LIST[] = {
|
||||||
"BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
|
"BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
|
||||||
"AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH
|
"AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH
|
||||||
"LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position)
|
"LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position)
|
||||||
|
"SHIELD", // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use)
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6654,6 +6787,9 @@ static const char *const PLAYERFLAG_LIST[] = {
|
||||||
/*** misc ***/
|
/*** misc ***/
|
||||||
"FORCESTRAFE", // Translate turn inputs into strafe inputs
|
"FORCESTRAFE", // Translate turn inputs into strafe inputs
|
||||||
"ANALOGMODE", // Analog mode?
|
"ANALOGMODE", // Analog mode?
|
||||||
|
"CANCARRY", // Can carry?
|
||||||
|
"SHIELDABILITY", // Thokked with shield ability
|
||||||
|
"FORCEJUMPDAMAGE", // Force jump damage
|
||||||
|
|
||||||
NULL // stop loop here.
|
NULL // stop loop here.
|
||||||
};
|
};
|
||||||
|
@ -6998,20 +7134,27 @@ struct {
|
||||||
{"PRECIP_STORM_NOSTRIKES",PRECIP_STORM_NOSTRIKES},
|
{"PRECIP_STORM_NOSTRIKES",PRECIP_STORM_NOSTRIKES},
|
||||||
|
|
||||||
// Shields
|
// Shields
|
||||||
// These ones use the lower 8 bits
|
|
||||||
{"SH_NONE",SH_NONE},
|
{"SH_NONE",SH_NONE},
|
||||||
{"SH_JUMP",SH_JUMP},
|
// Shield flags
|
||||||
|
{"SH_PROTECTFIRE",SH_PROTECTFIRE},
|
||||||
|
{"SH_PROTECTWATER",SH_PROTECTWATER},
|
||||||
|
{"SH_PROTECTELECTRIC",SH_PROTECTELECTRIC},
|
||||||
|
// Indivisible shields
|
||||||
|
{"SH_PITY",SH_PITY},
|
||||||
|
{"SH_WHIRLWIND",SH_WHIRLWIND},
|
||||||
|
{"SH_ARMAGEDDON",SH_ARMAGEDDON},
|
||||||
|
// normal shields that use flags
|
||||||
{"SH_ATTRACT",SH_ATTRACT},
|
{"SH_ATTRACT",SH_ATTRACT},
|
||||||
{"SH_ELEMENTAL",SH_ELEMENTAL},
|
{"SH_ELEMENTAL",SH_ELEMENTAL},
|
||||||
{"SH_BOMB",SH_BOMB},
|
// Sonic 3 shields
|
||||||
|
{"SH_FLAMEAURA",SH_FLAMEAURA},
|
||||||
{"SH_BUBBLEWRAP",SH_BUBBLEWRAP},
|
{"SH_BUBBLEWRAP",SH_BUBBLEWRAP},
|
||||||
{"SH_THUNDERCOIN",SH_THUNDERCOIN},
|
{"SH_THUNDERCOIN",SH_THUNDERCOIN},
|
||||||
{"SH_FLAMEAURA",SH_FLAMEAURA},
|
// The force shield uses the lower 8 bits to count how many extra hits are left.
|
||||||
{"SH_PITY",SH_PITY},
|
{"SH_FORCE",SH_FORCE},
|
||||||
// These ones are special and use the upper bits
|
{"SH_FORCEHP",SH_FORCEHP}, // to be used as a bitmask only
|
||||||
{"SH_FIREFLOWER",SH_FIREFLOWER}, // Lower bits are a normal shield stacked on top of the fire flower
|
// Mostly for use with Mario mode.
|
||||||
{"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit
|
{"SH_FIREFLOWER", SH_FIREFLOWER},
|
||||||
// Stack masks
|
|
||||||
{"SH_STACK",SH_STACK},
|
{"SH_STACK",SH_STACK},
|
||||||
{"SH_NOSTACK",SH_NOSTACK},
|
{"SH_NOSTACK",SH_NOSTACK},
|
||||||
|
|
||||||
|
@ -7045,6 +7188,7 @@ struct {
|
||||||
{"SF_STOMPDAMAGE",SF_STOMPDAMAGE},
|
{"SF_STOMPDAMAGE",SF_STOMPDAMAGE},
|
||||||
{"SF_MARIODAMAGE",SF_MARIODAMAGE},
|
{"SF_MARIODAMAGE",SF_MARIODAMAGE},
|
||||||
{"SF_MACHINE",SF_MACHINE},
|
{"SF_MACHINE",SF_MACHINE},
|
||||||
|
{"SF_NOSPINDASHDUST",SF_NOSPINDASHDUST},
|
||||||
|
|
||||||
// Character abilities!
|
// Character abilities!
|
||||||
// Primary
|
// Primary
|
||||||
|
@ -7093,6 +7237,22 @@ struct {
|
||||||
{"PAL_MIXUP",PAL_MIXUP},
|
{"PAL_MIXUP",PAL_MIXUP},
|
||||||
{"PAL_RECYCLE",PAL_RECYCLE},
|
{"PAL_RECYCLE",PAL_RECYCLE},
|
||||||
{"PAL_NUKE",PAL_NUKE},
|
{"PAL_NUKE",PAL_NUKE},
|
||||||
|
// for P_DamageMobj
|
||||||
|
//// Damage types
|
||||||
|
{"DMG_WATER",DMG_WATER},
|
||||||
|
{"DMG_FIRE",DMG_FIRE},
|
||||||
|
{"DMG_ELECTRIC",DMG_ELECTRIC},
|
||||||
|
{"DMG_SPIKE",DMG_SPIKE},
|
||||||
|
{"DMG_NUKE",DMG_NUKE},
|
||||||
|
//// Death types
|
||||||
|
{"DMG_INSTAKILL",DMG_INSTAKILL},
|
||||||
|
{"DMG_DROWNED",DMG_DROWNED},
|
||||||
|
{"DMG_SPACEDROWN",DMG_SPACEDROWN},
|
||||||
|
{"DMG_DEATHPIT",DMG_DEATHPIT},
|
||||||
|
{"DMG_CRUSHED",DMG_CRUSHED},
|
||||||
|
{"DMG_SPECTATOR",DMG_SPECTATOR},
|
||||||
|
//// Masks
|
||||||
|
{"DMG_DEATHMASK",DMG_DEATHMASK},
|
||||||
|
|
||||||
// Gametypes, for use with global var "gametype"
|
// Gametypes, for use with global var "gametype"
|
||||||
{"GT_COOP",GT_COOP},
|
{"GT_COOP",GT_COOP},
|
||||||
|
|
|
@ -1721,6 +1721,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
return putenv(variable);
|
return putenv(variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
const CPUInfoFlags *I_CPUInfo(void)
|
const CPUInfoFlags *I_CPUInfo(void)
|
||||||
{
|
{
|
||||||
static CPUInfoFlags DOS_CPUInfo;
|
static CPUInfoFlags DOS_CPUInfo;
|
||||||
|
|
|
@ -407,6 +407,7 @@ void M_StartupLocale(void);
|
||||||
extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
|
extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
|
||||||
char *va(const char *format, ...) FUNCPRINTF;
|
char *va(const char *format, ...) FUNCPRINTF;
|
||||||
char *M_GetToken(const char *inputString);
|
char *M_GetToken(const char *inputString);
|
||||||
|
void M_UnGetToken(void);
|
||||||
char *sizeu1(size_t num);
|
char *sizeu1(size_t num);
|
||||||
char *sizeu2(size_t num);
|
char *sizeu2(size_t num);
|
||||||
char *sizeu3(size_t num);
|
char *sizeu3(size_t num);
|
||||||
|
@ -435,6 +436,9 @@ extern INT32 cv_debug;
|
||||||
// Misc stuff for later...
|
// Misc stuff for later...
|
||||||
// =======================
|
// =======================
|
||||||
|
|
||||||
|
// Modifier key variables, accessible anywhere
|
||||||
|
extern UINT8 shiftdown, ctrldown, altdown;
|
||||||
|
|
||||||
// if we ever make our alloc stuff...
|
// if we ever make our alloc stuff...
|
||||||
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)
|
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void I_RegisterSysCommands(void) {}
|
void I_RegisterSysCommands(void) {}
|
||||||
|
|
||||||
#include "../sdl/dosstr.c"
|
#include "../sdl/dosstr.c"
|
||||||
|
|
|
@ -88,6 +88,7 @@ UINT8 modeattacking = ATTACKING_NONE;
|
||||||
boolean disableSpeedAdjust = false;
|
boolean disableSpeedAdjust = false;
|
||||||
boolean imcontinuing = false;
|
boolean imcontinuing = false;
|
||||||
boolean runemeraldmanager = false;
|
boolean runemeraldmanager = false;
|
||||||
|
UINT16 emeraldspawndelay = 60*TICRATE;
|
||||||
|
|
||||||
// menu demo things
|
// menu demo things
|
||||||
UINT8 numDemos = 3;
|
UINT8 numDemos = 3;
|
||||||
|
@ -2193,7 +2194,7 @@ void G_PlayerReborn(INT32 player)
|
||||||
p->pflags |= PF_JUMPDOWN;
|
p->pflags |= PF_JUMPDOWN;
|
||||||
|
|
||||||
p->playerstate = PST_LIVE;
|
p->playerstate = PST_LIVE;
|
||||||
p->health = 1; // 0 rings
|
p->rings = 0; // 0 rings
|
||||||
p->panim = PA_IDLE; // standing animation
|
p->panim = PA_IDLE; // standing animation
|
||||||
|
|
||||||
if ((netgame || multiplayer) && !p->spectator)
|
if ((netgame || multiplayer) && !p->spectator)
|
||||||
|
|
|
@ -656,6 +656,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||||
{
|
{
|
||||||
FOutVector v[4];
|
FOutVector v[4];
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
|
float sdupx, sdupy;
|
||||||
|
|
||||||
if (w < 0 || h < 0)
|
if (w < 0 || h < 0)
|
||||||
return; // consistency w/ software
|
return; // consistency w/ software
|
||||||
|
@ -664,10 +665,16 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
||||||
// | /|
|
// | /|
|
||||||
// |/ |
|
// |/ |
|
||||||
// 0--1
|
// 0--1
|
||||||
v[0].x = v[3].x = (x - 160.0f)/160.0f;
|
sdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f;
|
||||||
v[2].x = v[1].x = ((x+w) - 160.0f)/160.0f;
|
sdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f;
|
||||||
v[0].y = v[1].y = -(y - 100.0f)/100.0f;
|
|
||||||
v[2].y = v[3].y = -((y+h) - 100.0f)/100.0f;
|
if (color & V_NOSCALESTART)
|
||||||
|
sdupx = sdupy = 2.0f;
|
||||||
|
|
||||||
|
v[0].x = v[3].x = (x*sdupx)/vid.width - 1;
|
||||||
|
v[2].x = v[1].x = (x*sdupx + w*sdupx)/vid.width - 1;
|
||||||
|
v[0].y = v[1].y = 1-(y*sdupy)/vid.height;
|
||||||
|
v[2].y = v[3].y = 1-(y*sdupy + h*sdupy)/vid.height;
|
||||||
|
|
||||||
//Hurdler: do we still use this argb color? if not, we should remove it
|
//Hurdler: do we still use this argb color? if not, we should remove it
|
||||||
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
|
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
|
||||||
|
|
|
@ -271,6 +271,9 @@ light_t *t_lspr[NUMSPRITES] =
|
||||||
&lspr[NOLIGHT], // SPR_TVRC
|
&lspr[NOLIGHT], // SPR_TVRC
|
||||||
&lspr[NOLIGHT], // SPR_TV1K
|
&lspr[NOLIGHT], // SPR_TV1K
|
||||||
&lspr[NOLIGHT], // SPR_TVTK
|
&lspr[NOLIGHT], // SPR_TVTK
|
||||||
|
&lspr[NOLIGHT], // SPR_TVFL
|
||||||
|
&lspr[NOLIGHT], // SPR_TVBB
|
||||||
|
&lspr[NOLIGHT], // SPR_TVZP
|
||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
&lspr[NOLIGHT], // SPR_MISL
|
&lspr[NOLIGHT], // SPR_MISL
|
||||||
|
@ -359,6 +362,9 @@ light_t *t_lspr[NUMSPRITES] =
|
||||||
&lspr[NOLIGHT], // SPR_ELEM
|
&lspr[NOLIGHT], // SPR_ELEM
|
||||||
&lspr[NOLIGHT], // SPR_FORC
|
&lspr[NOLIGHT], // SPR_FORC
|
||||||
&lspr[NOLIGHT], // SPR_PITY
|
&lspr[NOLIGHT], // SPR_PITY
|
||||||
|
&lspr[NOLIGHT], // SPR_FIRS
|
||||||
|
&lspr[NOLIGHT], // SPR_BUBS
|
||||||
|
&lspr[NOLIGHT], // SPR_ZAPS
|
||||||
&lspr[INVINCIBLE_L], // SPR_IVSP
|
&lspr[INVINCIBLE_L], // SPR_IVSP
|
||||||
&lspr[SUPERSPARK_L], // SPR_SSPK
|
&lspr[SUPERSPARK_L], // SPR_SSPK
|
||||||
|
|
||||||
|
|
|
@ -757,15 +757,8 @@ void HU_clearChatChars(void)
|
||||||
//
|
//
|
||||||
boolean HU_Responder(event_t *ev)
|
boolean HU_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
static boolean shiftdown = false;
|
|
||||||
UINT8 c;
|
UINT8 c;
|
||||||
|
|
||||||
if (ev->data1 == KEY_LSHIFT || ev->data1 == KEY_RSHIFT)
|
|
||||||
{
|
|
||||||
shiftdown = (ev->type == ev_keydown);
|
|
||||||
return chat_on;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ev->type != ev_keydown)
|
if (ev->type != ev_keydown)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1198,7 +1191,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
|
|
||||||
V_DrawString(x + 20, y,
|
V_DrawString(x + 20, y,
|
||||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||||
| ((players[tab[i].num].health > 0) ? 0 : V_60TRANS)
|
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS)
|
||||||
| V_ALLOWLOWERCASE, tab[i].name);
|
| V_ALLOWLOWERCASE, tab[i].name);
|
||||||
|
|
||||||
// Draw emeralds
|
// Draw emeralds
|
||||||
|
@ -1208,7 +1201,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
|
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, livesback);
|
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, livesback);
|
||||||
else
|
else
|
||||||
V_DrawSmallScaledPatch (x, y-4, 0, livesback);
|
V_DrawSmallScaledPatch (x, y-4, 0, livesback);
|
||||||
|
@ -1220,7 +1213,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
V_DrawSmallScaledPatch(x, y-4, 0, superprefix[players[tab[i].num].skin]);
|
V_DrawSmallScaledPatch(x, y-4, 0, superprefix[players[tab[i].num].skin]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentPatch(x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
|
V_DrawSmallTranslucentPatch(x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
|
||||||
else
|
else
|
||||||
V_DrawSmallScaledPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
V_DrawSmallScaledPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
||||||
|
@ -1236,7 +1229,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
|
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
|
||||||
else
|
else
|
||||||
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||||
|
@ -1244,10 +1237,10 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_GametypeUsesLives()) //show lives
|
if (G_GametypeUsesLives()) //show lives
|
||||||
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives));
|
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives));
|
||||||
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
|
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
|
||||||
{
|
{
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentPatch(x-32, y-4, V_60TRANS, tagico);
|
V_DrawSmallTranslucentPatch(x-32, y-4, V_60TRANS, tagico);
|
||||||
else
|
else
|
||||||
V_DrawSmallScaledPatch(x-32, y-4, 0, tagico);
|
V_DrawSmallScaledPatch(x-32, y-4, 0, tagico);
|
||||||
|
@ -1260,13 +1253,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
||||||
if (players[tab[i].num].exiting)
|
if (players[tab[i].num].exiting)
|
||||||
V_DrawRightAlignedString(x+240, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
V_DrawRightAlignedString(x+240, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
|
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
|
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
|
||||||
|
|
||||||
y += 16;
|
y += 16;
|
||||||
}
|
}
|
||||||
|
@ -1311,7 +1304,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
||||||
strlcpy(name, tab[i].name, 9);
|
strlcpy(name, tab[i].name, 9);
|
||||||
V_DrawString(x + 20, y,
|
V_DrawString(x + 20, y,
|
||||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||||
| ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT)
|
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT)
|
||||||
| V_ALLOWLOWERCASE, name);
|
| V_ALLOWLOWERCASE, name);
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametype == GT_CTF)
|
||||||
|
@ -1337,12 +1330,12 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||||
else
|
else
|
||||||
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||||
}
|
}
|
||||||
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1367,7 +1360,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
||||||
strlcpy(name, tab[i].name, 9);
|
strlcpy(name, tab[i].name, 9);
|
||||||
V_DrawString(x + 20, y,
|
V_DrawString(x + 20, y,
|
||||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||||
| ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT)
|
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT)
|
||||||
| V_ALLOWLOWERCASE, name);
|
| V_ALLOWLOWERCASE, name);
|
||||||
|
|
||||||
if (G_GametypeUsesLives()) //show lives
|
if (G_GametypeUsesLives()) //show lives
|
||||||
|
@ -1390,7 +1383,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
||||||
V_DrawSmallScaledPatch (x, y-4, 0, superprefix[players[tab[i].num].skin]);
|
V_DrawSmallScaledPatch (x, y-4, 0, superprefix[players[tab[i].num].skin]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
V_DrawSmallTranslucentPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
||||||
else
|
else
|
||||||
V_DrawSmallScaledPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
V_DrawSmallScaledPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
||||||
|
@ -1406,7 +1399,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||||
if (players[tab[i].num].health <= 0)
|
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||||
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||||
else
|
else
|
||||||
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||||
|
@ -1421,13 +1414,13 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
||||||
if (players[tab[i].num].exiting)
|
if (players[tab[i].num].exiting)
|
||||||
V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
||||||
|
|
||||||
y += 16;
|
y += 16;
|
||||||
if (y > 160)
|
if (y > 160)
|
||||||
|
|
|
@ -296,6 +296,14 @@ char *I_GetEnv(const char *name);
|
||||||
|
|
||||||
INT32 I_PutEnv(char *variable);
|
INT32 I_PutEnv(char *variable);
|
||||||
|
|
||||||
|
/** \brief Put data in system clipboard
|
||||||
|
*/
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size);
|
||||||
|
|
||||||
|
/** \brief Retrieve data from system clipboard
|
||||||
|
*/
|
||||||
|
const char *I_ClipboardPaste(void);
|
||||||
|
|
||||||
void I_RegisterSysCommands(void);
|
void I_RegisterSysCommands(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
606
src/info.c
606
src/info.c
|
@ -159,6 +159,9 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"TVRC", // ReCycler
|
"TVRC", // ReCycler
|
||||||
"TV1K", // 1,000 points (1 K)
|
"TV1K", // 1,000 points (1 K)
|
||||||
"TVTK", // 10,000 points (Ten K)
|
"TVTK", // 10,000 points (Ten K)
|
||||||
|
"TVFL", // FLame shield
|
||||||
|
"TVBB", // BuBble shield
|
||||||
|
"TVZP", // Thunder shield (ZaP)
|
||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
"MISL",
|
"MISL",
|
||||||
|
@ -243,6 +246,9 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"ELEM", // Elemental Shield Orb and Fire
|
"ELEM", // Elemental Shield Orb and Fire
|
||||||
"FORC", // Force Shield Orb
|
"FORC", // Force Shield Orb
|
||||||
"PITY", // Pity Shield Orb
|
"PITY", // Pity Shield Orb
|
||||||
|
"FIRS", // Flame Shield Orb
|
||||||
|
"BUBS", // Bubble Shield Orb
|
||||||
|
"ZAPS", // Thunder Shield Orb
|
||||||
"IVSP", // invincibility sparkles
|
"IVSP", // invincibility sparkles
|
||||||
"SSPK", // Super Sonic Spark
|
"SSPK", // Super Sonic Spark
|
||||||
|
|
||||||
|
@ -274,6 +280,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"SMOK",
|
"SMOK",
|
||||||
"BUBL", // Bubble
|
"BUBL", // Bubble
|
||||||
"WZAP",
|
"WZAP",
|
||||||
|
"DUST", // Spindash dust
|
||||||
|
"FPRT", // Spindash dust (flame)
|
||||||
"TFOG", // Teleport Fog
|
"TFOG", // Teleport Fog
|
||||||
"SEED", // Sonic CD flower seed
|
"SEED", // Sonic CD flower seed
|
||||||
"PRTL", // Particle (for fans, etc.)
|
"PRTL", // Particle (for fans, etc.)
|
||||||
|
@ -479,21 +487,21 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK
|
{SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
{SPR_PLAY, SPR2_STND, 105, {NULL}, 0, 0, S_PLAY_WAIT}, // S_PLAY_STND
|
{SPR_PLAY, SPR2_STND|FF_ANIMATE, 105, {NULL}, 0, 7, S_PLAY_WAIT}, // S_PLAY_STND
|
||||||
{SPR_PLAY, SPR2_WAIT, 16, {NULL}, 0, 0, S_PLAY_WAIT}, // S_PLAY_WAIT
|
{SPR_PLAY, SPR2_WAIT|FF_ANIMATE, -1, {NULL}, 0, 16, S_NULL}, // S_PLAY_WAIT
|
||||||
{SPR_PLAY, SPR2_WALK, 4, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_WALK
|
{SPR_PLAY, SPR2_WALK, 4, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_WALK
|
||||||
{SPR_PLAY, SPR2_RUN , 2, {NULL}, 0, 0, S_PLAY_RUN}, // S_PLAY_RUN
|
{SPR_PLAY, SPR2_RUN , 2, {NULL}, 0, 0, S_PLAY_RUN}, // S_PLAY_RUN
|
||||||
{SPR_PLAY, SPR2_PEEL, 2, {NULL}, 0, 0, S_PLAY_PEEL}, // S_PLAY_PEEL
|
{SPR_PLAY, SPR2_PEEL, 2, {NULL}, 0, 0, S_PLAY_PEEL}, // S_PLAY_PEEL
|
||||||
{SPR_PLAY, SPR2_PAIN, 350, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_PAIN
|
{SPR_PLAY, SPR2_PAIN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_FALL}, // S_PLAY_PAIN
|
||||||
{SPR_PLAY, SPR2_DEAD, 4, {NULL}, 0, 0, S_PLAY_DEAD}, // S_PLAY_DEAD
|
{SPR_PLAY, SPR2_DEAD|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_DEAD
|
||||||
{SPR_PLAY, SPR2_DRWN, 4, {NULL}, 0, 0, S_PLAY_DRWN}, // S_PLAY_DRWN
|
{SPR_PLAY, SPR2_DRWN|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_DRWN
|
||||||
{SPR_PLAY, SPR2_SPIN, 1, {NULL}, 0, 0, S_PLAY_SPIN}, // S_PLAY_SPIN
|
{SPR_PLAY, SPR2_SPIN, 1, {NULL}, 0, 0, S_PLAY_SPIN}, // S_PLAY_SPIN
|
||||||
{SPR_PLAY, SPR2_DASH, 2, {NULL}, 0, 0, S_PLAY_DASH}, // S_PLAY_DASH
|
{SPR_PLAY, SPR2_DASH, 2, {NULL}, 0, 0, S_PLAY_DASH}, // S_PLAY_DASH
|
||||||
{SPR_PLAY, SPR2_GASP, 14, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_GASP
|
{SPR_PLAY, SPR2_GASP|FF_ANIMATE, 14, {NULL}, 0, 4, S_PLAY_WALK}, // S_PLAY_GASP
|
||||||
{SPR_PLAY, SPR2_JUMP, 1, {NULL}, 0, 0, S_PLAY_JUMP}, // S_PLAY_JUMP
|
{SPR_PLAY, SPR2_JUMP, 1, {NULL}, 0, 0, S_PLAY_JUMP}, // S_PLAY_JUMP
|
||||||
{SPR_PLAY, SPR2_SPNG, 2, {NULL}, 0, 0, S_PLAY_SPRING}, // S_PLAY_SPRING
|
{SPR_PLAY, SPR2_SPNG, 2, {NULL}, 0, 0, S_PLAY_SPRING}, // S_PLAY_SPRING
|
||||||
{SPR_PLAY, SPR2_FALL, 2, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_FALL
|
{SPR_PLAY, SPR2_FALL, 2, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_FALL
|
||||||
{SPR_PLAY, SPR2_EDGE, 12, {NULL}, 0, 0, S_PLAY_EDGE}, // S_PLAY_EDGE
|
{SPR_PLAY, SPR2_EDGE|FF_ANIMATE, -1, {NULL}, 0, 12, S_NULL}, // S_PLAY_EDGE
|
||||||
{SPR_PLAY, SPR2_RIDE, 4, {NULL}, 0, 0, S_PLAY_RIDE}, // S_PLAY_RIDE
|
{SPR_PLAY, SPR2_RIDE, 4, {NULL}, 0, 0, S_PLAY_RIDE}, // S_PLAY_RIDE
|
||||||
|
|
||||||
// CA_FLY/CA_SWIM
|
// CA_FLY/CA_SWIM
|
||||||
|
@ -503,7 +511,7 @@ state_t states[NUMSTATES] =
|
||||||
|
|
||||||
// CA_GLIDEANDCLIMB
|
// CA_GLIDEANDCLIMB
|
||||||
{SPR_PLAY, SPR2_GLID, 2, {NULL}, 0, 0, S_PLAY_GLIDE}, // S_PLAY_GLIDE
|
{SPR_PLAY, SPR2_GLID, 2, {NULL}, 0, 0, S_PLAY_GLIDE}, // S_PLAY_GLIDE
|
||||||
{SPR_PLAY, SPR2_CLNG, 6, {NULL}, 0, 0, S_PLAY_CLING}, // S_PLAY_CLING
|
{SPR_PLAY, SPR2_CLNG|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_CLING
|
||||||
{SPR_PLAY, SPR2_CLMB, 5, {NULL}, 0, 0, S_PLAY_CLIMB}, // S_PLAY_CLIMB
|
{SPR_PLAY, SPR2_CLMB, 5, {NULL}, 0, 0, S_PLAY_CLIMB}, // S_PLAY_CLIMB
|
||||||
|
|
||||||
// CA_TWINSPIN
|
// CA_TWINSPIN
|
||||||
|
@ -514,20 +522,20 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_PLAY, SPR2_MLEE, 20, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_MELEE_FINISH
|
{SPR_PLAY, SPR2_MLEE, 20, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_MELEE_FINISH
|
||||||
|
|
||||||
// SF_SUPERANIMS
|
// SF_SUPERANIMS
|
||||||
{SPR_PLAY, SPR2_SSTD, 7, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_STND
|
{SPR_PLAY, SPR2_SSTD|FF_ANIMATE, -1, {NULL}, 0, 7, S_NULL}, // S_PLAY_SUPER_STND
|
||||||
{SPR_PLAY, SPR2_SWLK, 7, {NULL}, 0, 0, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_WALK
|
{SPR_PLAY, SPR2_SWLK, 7, {NULL}, 0, 0, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_WALK
|
||||||
{SPR_PLAY, SPR2_SRUN, 7, {NULL}, 0, 0, S_PLAY_SUPER_RUN}, // S_PLAY_SUPER_RUN
|
{SPR_PLAY, SPR2_SRUN, 7, {NULL}, 0, 0, S_PLAY_SUPER_RUN}, // S_PLAY_SUPER_RUN
|
||||||
{SPR_PLAY, SPR2_SPEE, 7, {NULL}, 0, 0, S_PLAY_SUPER_PEEL}, // S_PLAY_SUPER_PEEL
|
{SPR_PLAY, SPR2_SPEE, 7, {NULL}, 0, 0, S_PLAY_SUPER_PEEL}, // S_PLAY_SUPER_PEEL
|
||||||
{SPR_PLAY, SPR2_SPAN, -1, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_PAIN
|
{SPR_PLAY, SPR2_SPAN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_PAIN
|
||||||
{SPR_PLAY, SPR2_SSTN, -1, {NULL}, 0, 0, S_PLAY_SUPER_STND}, // S_PLAY_SUPER_STUN
|
{SPR_PLAY, SPR2_SSTN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_STUN
|
||||||
{SPR_PLAY, SPR2_SDTH, 4, {NULL}, 0, 0, S_PLAY_SUPER_DEAD}, // S_PLAY_SUPER_DEAD
|
{SPR_PLAY, SPR2_SDTH|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_SUPER_DEAD
|
||||||
{SPR_PLAY, SPR2_SDRN, 4, {NULL}, 0, 0, S_PLAY_SUPER_DRWN}, // S_PLAY_SUPER_DRWN
|
{SPR_PLAY, SPR2_SDRN|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_SUPER_DRWN
|
||||||
{SPR_PLAY, SPR2_SSPN, 1, {NULL}, 0, 0, S_PLAY_SUPER_SPIN}, // S_PLAY_SUPER_SPIN
|
{SPR_PLAY, SPR2_SSPN, 1, {NULL}, 0, 0, S_PLAY_SUPER_SPIN}, // S_PLAY_SUPER_SPIN
|
||||||
{SPR_PLAY, SPR2_SGSP, 14, {NULL}, 0, 0, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_GASP
|
{SPR_PLAY, SPR2_SGSP|FF_ANIMATE, 14, {NULL}, 0, 4, S_PLAY_SUPER_WALK}, // S_PLAY_SUPER_GASP
|
||||||
{SPR_PLAY, SPR2_SJMP, 1, {NULL}, 0, 0, S_PLAY_SUPER_JUMP}, // S_PLAY_SUPER_JUMP
|
{SPR_PLAY, SPR2_SJMP, 1, {NULL}, 0, 0, S_PLAY_SUPER_JUMP}, // S_PLAY_SUPER_JUMP
|
||||||
{SPR_PLAY, SPR2_SSPG, 2, {NULL}, 0, 0, S_PLAY_SUPER_SPRING}, // S_PLAY_SUPER_SPRING
|
{SPR_PLAY, SPR2_SSPG, 2, {NULL}, 0, 0, S_PLAY_SUPER_SPRING}, // S_PLAY_SUPER_SPRING
|
||||||
{SPR_PLAY, SPR2_SFAL, 2, {NULL}, 0, 0, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_FALL
|
{SPR_PLAY, SPR2_SFAL, 2, {NULL}, 0, 0, S_PLAY_SUPER_FALL}, // S_PLAY_SUPER_FALL
|
||||||
{SPR_PLAY, SPR2_SEDG, 12, {NULL}, 0, 0, S_PLAY_SUPER_EDGE}, // S_PLAY_SUPER_EDGE
|
{SPR_PLAY, SPR2_SEDG|FF_ANIMATE, -1, {NULL}, 0, 12, S_NULL}, // S_PLAY_SUPER_EDGE
|
||||||
{SPR_PLAY, SPR2_SRID, 4, {NULL}, 0, 0, S_PLAY_SUPER_RIDE}, // S_PLAY_SUPER_RIDE
|
{SPR_PLAY, SPR2_SRID, 4, {NULL}, 0, 0, S_PLAY_SUPER_RIDE}, // S_PLAY_SUPER_RIDE
|
||||||
{SPR_PLAY, SPR2_SFLT, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT}, // S_PLAY_SUPER_FLOAT
|
{SPR_PLAY, SPR2_SFLT, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT}, // S_PLAY_SUPER_FLOAT
|
||||||
|
|
||||||
|
@ -1532,7 +1540,7 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_SPIK, 6, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL8}, // S_SPIKEBALL7
|
{SPR_SPIK, 6, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL8}, // S_SPIKEBALL7
|
||||||
{SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8
|
{SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8
|
||||||
|
|
||||||
// Red Shield's Spawn
|
// Elemental Shield's Spawn
|
||||||
{SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1
|
{SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1
|
||||||
{SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2
|
{SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2
|
||||||
{SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3
|
{SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3
|
||||||
|
@ -1606,6 +1614,9 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_TVRC, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_RECYCLER_BOX
|
{SPR_TVRC, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_RECYCLER_BOX
|
||||||
{SPR_TV1K, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE1K_BOX
|
{SPR_TV1K, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE1K_BOX
|
||||||
{SPR_TVTK, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE10K_BOX
|
{SPR_TVTK, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE10K_BOX
|
||||||
|
{SPR_TVFL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_FLAMEAURA_BOX
|
||||||
|
{SPR_TVBB, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_BUBBLEWRAP_BOX
|
||||||
|
{SPR_TVZP, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_THUNDERCOIN_BOX
|
||||||
|
|
||||||
// Gold Repeat Monitor States (one per box)
|
// Gold Repeat Monitor States (one per box)
|
||||||
{SPR_TVPI, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_PITY_GOLDBOX
|
{SPR_TVPI, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_PITY_GOLDBOX
|
||||||
|
@ -1618,6 +1629,9 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_TVIV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_INVULN_GOLDBOX
|
{SPR_TVIV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_INVULN_GOLDBOX
|
||||||
{SPR_TVEG, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_EGGMAN_GOLDBOX
|
{SPR_TVEG, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_EGGMAN_GOLDBOX
|
||||||
{SPR_TVGV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_GRAVITY_GOLDBOX
|
{SPR_TVGV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_GRAVITY_GOLDBOX
|
||||||
|
{SPR_TVFL, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_FLAMEAURA_GOLDBOX
|
||||||
|
{SPR_TVBB, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_BUBBLEWRAP_GOLDBOX
|
||||||
|
{SPR_TVZP, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_THUNDERCOIN_GOLDBOX
|
||||||
|
|
||||||
// Team Ring Boxes (these are special)
|
// Team Ring Boxes (these are special)
|
||||||
{SPR_TRRI, 0, 2, {NULL}, 0, 0, S_RING_REDBOX2}, // S_RING_REDBOX1
|
{SPR_TRRI, 0, 2, {NULL}, 0, 0, S_RING_REDBOX2}, // S_RING_REDBOX1
|
||||||
|
@ -1641,7 +1655,7 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2
|
{SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2
|
||||||
|
|
||||||
{SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1
|
{SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1
|
||||||
{SPR_TVFO, 2, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON2
|
{SPR_TVFO, 2, 18, {A_ForceShield}, 1, 0, S_NULL}, // S_FORCE_ICON2
|
||||||
|
|
||||||
{SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1
|
{SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1
|
||||||
{SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2
|
{SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2
|
||||||
|
@ -1679,6 +1693,15 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_TVTK, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1
|
{SPR_TVTK, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1
|
||||||
{SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2
|
{SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2
|
||||||
|
|
||||||
|
{SPR_TVFL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FLAMEAURA_ICON2}, // S_FLAMEAURA_ICON1
|
||||||
|
{SPR_TVFL, 2, 18, {A_FlameShield}, 0, 0, S_NULL}, // S_FLAMEAURA_ICON2
|
||||||
|
|
||||||
|
{SPR_TVBB, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_BUBBLEWRAP_ICON2}, // S_BUBBLEWRAP_ICON1
|
||||||
|
{SPR_TVBB, 2, 18, {A_BubbleShield}, 0, 0, S_NULL}, // S_BUBBLERWAP_ICON2
|
||||||
|
|
||||||
|
{SPR_TVZP, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_THUNDERCOIN_ICON2}, // S_THUNDERCOIN_ICON1
|
||||||
|
{SPR_TVZP, 2, 18, {A_ThunderShield}, 0, 0, S_NULL}, // S_THUNDERCOIN_ICON2
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
{SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET
|
{SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET
|
||||||
|
@ -2059,6 +2082,8 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_MAGN12}, // S_MAGN11
|
{SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_MAGN12}, // S_MAGN11
|
||||||
{SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN12
|
{SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN12
|
||||||
|
|
||||||
|
{SPR_MAGN, FF_FULLBRIGHT|FF_TRANS10|12, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN13
|
||||||
|
|
||||||
{SPR_FORC, FF_TRANS50 , 3, {NULL}, 0, 0, S_FORC2 }, // S_FORC1
|
{SPR_FORC, FF_TRANS50 , 3, {NULL}, 0, 0, S_FORC2 }, // S_FORC1
|
||||||
{SPR_FORC, FF_TRANS50|1, 3, {NULL}, 0, 0, S_FORC3 }, // S_FORC2
|
{SPR_FORC, FF_TRANS50|1, 3, {NULL}, 0, 0, S_FORC3 }, // S_FORC2
|
||||||
{SPR_FORC, FF_TRANS50|2, 3, {NULL}, 0, 0, S_FORC4 }, // S_FORC3
|
{SPR_FORC, FF_TRANS50|2, 3, {NULL}, 0, 0, S_FORC4 }, // S_FORC3
|
||||||
|
@ -2081,6 +2106,8 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_FORC, FF_TRANS50|18, 3, {NULL}, 0, 0, S_FORC20}, // S_FORC19
|
{SPR_FORC, FF_TRANS50|18, 3, {NULL}, 0, 0, S_FORC20}, // S_FORC19
|
||||||
{SPR_FORC, FF_TRANS50|19, 3, {NULL}, 0, 0, S_FORC11}, // S_FORC20
|
{SPR_FORC, FF_TRANS50|19, 3, {NULL}, 0, 0, S_FORC11}, // S_FORC20
|
||||||
|
|
||||||
|
{SPR_FORC, FF_TRANS50|20, -1, {NULL}, 0, 0, S_NULL}, // S_FORC21
|
||||||
|
|
||||||
{SPR_ELEM, FF_TRANS50 , 4, {NULL}, 0, 0, S_ELEM2 }, // S_ELEM1
|
{SPR_ELEM, FF_TRANS50 , 4, {NULL}, 0, 0, S_ELEM2 }, // S_ELEM1
|
||||||
{SPR_ELEM, FF_TRANS50| 1, 4, {NULL}, 0, 0, S_ELEM3 }, // S_ELEM2
|
{SPR_ELEM, FF_TRANS50| 1, 4, {NULL}, 0, 0, S_ELEM3 }, // S_ELEM2
|
||||||
{SPR_ELEM, FF_TRANS50| 2, 4, {NULL}, 0, 0, S_ELEM4 }, // S_ELEM3
|
{SPR_ELEM, FF_TRANS50| 2, 4, {NULL}, 0, 0, S_ELEM4 }, // S_ELEM3
|
||||||
|
@ -2094,14 +2121,20 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_ELEM, FF_TRANS50|10, 4, {NULL}, 0, 0, S_ELEM12}, // S_ELEM11
|
{SPR_ELEM, FF_TRANS50|10, 4, {NULL}, 0, 0, S_ELEM12}, // S_ELEM11
|
||||||
{SPR_ELEM, FF_TRANS50|11, 4, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM12
|
{SPR_ELEM, FF_TRANS50|11, 4, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM12
|
||||||
|
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2}, // S_ELEMF1
|
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEM14}, // S_ELEM13
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3}, // S_ELEMF2
|
{SPR_ELEM, FF_TRANS50|11, 1, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM14
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4}, // S_ELEMF3
|
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|15, 3, {NULL}, 0, 0, S_ELEMF5}, // S_ELEMF4
|
{SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2 }, // S_ELEMF1
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|16, 3, {NULL}, 0, 0, S_ELEMF6}, // S_ELEMF5
|
{SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3 }, // S_ELEMF2
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7}, // S_ELEMF6
|
{SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4 }, // S_ELEMF3
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8}, // S_ELEMF7
|
{SPR_ELEM, FF_FULLBRIGHT|15, 3, {NULL}, 0, 0, S_ELEMF5 }, // S_ELEMF4
|
||||||
{SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1}, // S_ELEMF8
|
{SPR_ELEM, FF_FULLBRIGHT|16, 3, {NULL}, 0, 0, S_ELEMF6 }, // S_ELEMF5
|
||||||
|
{SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7 }, // S_ELEMF6
|
||||||
|
{SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8 }, // S_ELEMF7
|
||||||
|
{SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF8
|
||||||
|
|
||||||
|
{SPR_ELEM, FF_FULLBRIGHT|20, 1, {NULL}, 0, 0, S_ELEMF10}, // S_ELEMF9
|
||||||
|
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF10
|
||||||
|
|
||||||
{SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY2 }, // S_PITY1
|
{SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY2 }, // S_PITY1
|
||||||
{SPR_PITY, FF_TRANS20|1, 1, {NULL}, 0, 0, S_PITY3 }, // S_PITY2
|
{SPR_PITY, FF_TRANS20|1, 1, {NULL}, 0, 0, S_PITY3 }, // S_PITY2
|
||||||
|
@ -2114,6 +2147,84 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY10}, // S_PITY9
|
{SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY10}, // S_PITY9
|
||||||
{SPR_PITY, FF_TRANS20|5, 1, {NULL}, 0, 0, S_PITY1 }, // S_PITY10
|
{SPR_PITY, FF_TRANS20|5, 1, {NULL}, 0, 0, S_PITY1 }, // S_PITY10
|
||||||
|
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40 , 2, {NULL}, 0, 0, S_FIRS2}, // S_FIRS1
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|1, 2, {NULL}, 0, 0, S_FIRS3}, // S_FIRS2
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|2, 2, {NULL}, 0, 0, S_FIRS4}, // S_FIRS3
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|3, 2, {NULL}, 0, 0, S_FIRS5}, // S_FIRS4
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|4, 2, {NULL}, 0, 0, S_FIRS6}, // S_FIRS5
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|5, 2, {NULL}, 0, 0, S_FIRS7}, // S_FIRS6
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|6, 2, {NULL}, 0, 0, S_FIRS8}, // S_FIRS7
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|7, 2, {NULL}, 0, 0, S_FIRS9}, // S_FIRS8
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|8, 2, {NULL}, 0, 0, S_FIRS1}, // S_FIRS9
|
||||||
|
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|18, 1, {NULL}, 0, 0, S_FIRS11}, // S_FIRS10
|
||||||
|
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_FIRS1 }, // S_FIRS11
|
||||||
|
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_FIRSB2}, // S_FIRSB1
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_FIRSB3}, // S_FIRSB2
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_FIRSB4}, // S_FIRSB3
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|12, 2, {NULL}, 0, 0, S_FIRSB5}, // S_FIRSB4
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|13, 2, {NULL}, 0, 0, S_FIRSB6}, // S_FIRSB5
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|14, 2, {NULL}, 0, 0, S_FIRSB7}, // S_FIRSB6
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|15, 2, {NULL}, 0, 0, S_FIRSB8}, // S_FIRSB7
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8
|
||||||
|
{SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9
|
||||||
|
|
||||||
|
{SPR_NULL, 0, 2, {NULL}, 0, 0, S_FIRSB1 }, // S_FIRSB10
|
||||||
|
|
||||||
|
{SPR_BUBS, FF_TRANS30 , 3, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1
|
||||||
|
{SPR_BUBS, FF_TRANS30|1, 3, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2
|
||||||
|
{SPR_BUBS, FF_TRANS30|2, 3, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3
|
||||||
|
{SPR_BUBS, FF_TRANS30|3, 3, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4
|
||||||
|
{SPR_BUBS, FF_TRANS30|4, 3, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5
|
||||||
|
{SPR_BUBS, FF_TRANS30|5, 3, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6
|
||||||
|
{SPR_BUBS, FF_TRANS30|6, 3, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7
|
||||||
|
{SPR_BUBS, FF_TRANS30|7, 3, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8
|
||||||
|
{SPR_BUBS, FF_TRANS30|8, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9
|
||||||
|
|
||||||
|
{SPR_NULL, 0, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS10
|
||||||
|
{SPR_NULL, 0, 4*3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS11
|
||||||
|
|
||||||
|
{SPR_BUBS, FF_TRANS30| 9, 3, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1
|
||||||
|
{SPR_BUBS, FF_TRANS30|10, 3, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2
|
||||||
|
{SPR_BUBS, FF_TRANS30|11, 3, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3
|
||||||
|
{SPR_BUBS, FF_TRANS30|10, 3, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4
|
||||||
|
|
||||||
|
{SPR_BUBS, FF_TRANS30|12, 3, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB5
|
||||||
|
{SPR_BUBS, FF_TRANS30|13, 3, {NULL}, 0, 0, S_BUBSB5}, // S_BUBSB6
|
||||||
|
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 2, 2, {NULL}, 0, 0, S_ZAPS4 }, // S_ZAPS3
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 3, 2, {NULL}, 0, 0, S_ZAPS5 }, // S_ZAPS4
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 4, 2, {NULL}, 0, 0, S_ZAPS6 }, // S_ZAPS5
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 5, 2, {NULL}, 0, 0, S_ZAPS7 }, // S_ZAPS6
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 6, 2, {NULL}, 0, 0, S_ZAPS8 }, // S_ZAPS7
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 7, 2, {NULL}, 0, 0, S_ZAPS9 }, // S_ZAPS8
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 8, 2, {NULL}, 0, 0, S_ZAPS10}, // S_ZAPS9
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 9, 2, {NULL}, 0, 0, S_ZAPS11}, // S_ZAPS10
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|10, 2, {NULL}, 0, 0, S_ZAPS12}, // S_ZAPS11
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|11, 2, {NULL}, 0, 0, S_ZAPS13}, // S_ZAPS12
|
||||||
|
{SPR_NULL, 0, 9*2, {NULL}, 0, 0, S_ZAPS14}, // S_ZAPS13
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 9, 2, {NULL}, 0, 0, S_ZAPS15}, // S_ZAPS14
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|10, 2, {NULL}, 0, 0, S_ZAPS16}, // S_ZAPS15
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|11, 2, {NULL}, 0, 0, S_ZAPS1 }, // S_ZAPS16
|
||||||
|
|
||||||
|
{SPR_NULL, 0, 12*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB1
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 8, 2, {NULL}, 0, 0, S_ZAPSB3 }, // S_ZAPSB2
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 7, 2, {NULL}, 0, 0, S_ZAPSB4 }, // S_ZAPSB3
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 6, 2, {NULL}, 0, 0, S_ZAPSB5 }, // S_ZAPSB4
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 5, 2, {NULL}, 0, 0, S_ZAPSB6 }, // S_ZAPSB5
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 4, 2, {NULL}, 0, 0, S_ZAPSB7 }, // S_ZAPSB6
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 3, 2, {NULL}, 0, 0, S_ZAPSB8 }, // S_ZAPSB7
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 2, 2, {NULL}, 0, 0, S_ZAPSB9 }, // S_ZAPSB8
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPSB10}, // S_ZAPSB9
|
||||||
|
{SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPSB11}, // S_ZAPSB10
|
||||||
|
{SPR_NULL, 0, 15*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB11
|
||||||
|
|
||||||
|
// Thunder spark
|
||||||
|
{SPR_SSPK, FF_ANIMATE, 18, {NULL}, 1, 2, S_NULL}, // S_THUNDERCOIN_SPARK
|
||||||
|
|
||||||
// Invincibility Sparkles
|
// Invincibility Sparkles
|
||||||
{SPR_IVSP, FF_ANIMATE, 32, {NULL}, 31, 1, S_NULL}, // S_IVSP
|
{SPR_IVSP, FF_ANIMATE, 32, {NULL}, 31, 1, S_NULL}, // S_IVSP
|
||||||
|
|
||||||
|
@ -2279,6 +2390,21 @@ state_t states[NUMSTATES] =
|
||||||
|
|
||||||
{SPR_WZAP, FF_TRANS10|FF_ANIMATE|FF_RANDOMANIM, 4, {NULL}, 3, 2, S_NULL}, // S_WATERZAP
|
{SPR_WZAP, FF_TRANS10|FF_ANIMATE|FF_RANDOMANIM, 4, {NULL}, 3, 2, S_NULL}, // S_WATERZAP
|
||||||
|
|
||||||
|
// Spindash dust
|
||||||
|
{SPR_DUST, 0, 7, {NULL}, 0, 0, S_SPINDUST2}, // S_SPINDUST1
|
||||||
|
{SPR_DUST, 1, 6, {NULL}, 0, 0, S_SPINDUST3}, // S_SPINDUST2
|
||||||
|
{SPR_DUST, FF_TRANS30|2, 4, {NULL}, 0, 0, S_SPINDUST4}, // S_SPINDUST3
|
||||||
|
{SPR_DUST, FF_TRANS60|3, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST4
|
||||||
|
{SPR_BUBL, 0, 7, {NULL}, 0, 0, S_SPINDUST_BUBBLE2}, // S_SPINDUST_BUBBLE1
|
||||||
|
{SPR_BUBL, 0, 6, {NULL}, 0, 0, S_SPINDUST_BUBBLE3}, // S_SPINDUST_BUBBLE2
|
||||||
|
{SPR_BUBL, FF_TRANS30|0, 4, {NULL}, 0, 0, S_SPINDUST_BUBBLE4}, // S_SPINDUST_BUBBLE3
|
||||||
|
{SPR_BUBL, FF_TRANS60|0, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST_BUBBLE4
|
||||||
|
{SPR_FPRT, 0, 7, {NULL}, 0, 0, S_SPINDUST_FIRE2}, // S_SPINDUST_FIRE1
|
||||||
|
{SPR_FPRT, 0, 6, {NULL}, 0, 0, S_SPINDUST_FIRE3}, // S_SPINDUST_FIRE2
|
||||||
|
{SPR_FPRT, FF_TRANS30|0, 4, {NULL}, 0, 0, S_SPINDUST_FIRE4}, // S_SPINDUST_FIRE3
|
||||||
|
{SPR_FPRT, FF_TRANS60|0, 3, {NULL}, 0, 0, S_NULL}, // S_SPINDUST_FIRE4
|
||||||
|
|
||||||
|
|
||||||
{SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50, 2, {NULL}, 0, 0, S_FOG2}, // S_FOG1
|
{SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50, 2, {NULL}, 0, 0, S_FOG2}, // S_FOG1
|
||||||
{SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|1, 2, {NULL}, 0, 0, S_FOG3}, // S_FOG2
|
{SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|1, 2, {NULL}, 0, 0, S_FOG3}, // S_FOG2
|
||||||
{SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|2, 2, {NULL}, 0, 0, S_FOG4}, // S_FOG3
|
{SPR_TFOG, FF_FULLBRIGHT|FF_TRANS50|2, 2, {NULL}, 0, 0, S_FOG4}, // S_FOG3
|
||||||
|
@ -6346,6 +6472,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_FLAMEAURA_BOX
|
||||||
|
420, // doomednum
|
||||||
|
S_FLAMEAURA_BOX, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_FLAMEAURA_BOX, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_BOX_POP1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_pop, // deathsound
|
||||||
|
1, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
32*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
MT_FLAMEAURA_ICON, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_BUBBLEWRAP_BOX
|
||||||
|
421, // doomednum
|
||||||
|
S_BUBBLEWRAP_BOX, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_BUBBLEWRAP_BOX, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_BOX_POP1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_pop, // deathsound
|
||||||
|
1, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
32*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
MT_BUBBLEWRAP_ICON, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_THUNDERCOIN_BOX
|
||||||
|
422, // doomednum
|
||||||
|
S_THUNDERCOIN_BOX, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_THUNDERCOIN_BOX, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_BOX_POP1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_pop, // deathsound
|
||||||
|
1, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
32*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
MT_THUNDERCOIN_ICON, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_PITY_GOLDBOX
|
{ // MT_PITY_GOLDBOX
|
||||||
431, // doomednum
|
431, // doomednum
|
||||||
S_PITY_GOLDBOX, // spawnstate
|
S_PITY_GOLDBOX, // spawnstate
|
||||||
|
@ -6616,6 +6823,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_FLAMEAURA_GOLDBOX
|
||||||
|
450, // doomednum
|
||||||
|
S_FLAMEAURA_GOLDBOX, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_monton, // attacksound
|
||||||
|
S_FLAMEAURA_GOLDBOX, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_GOLDBOX_OFF1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_pop, // deathsound
|
||||||
|
0, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
36*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
MT_FLAMEAURA_ICON, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_BUBBLEWRAP_GOLDBOX
|
||||||
|
451, // doomednum
|
||||||
|
S_BUBBLEWRAP_GOLDBOX, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_monton, // attacksound
|
||||||
|
S_BUBBLEWRAP_GOLDBOX, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_GOLDBOX_OFF1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_pop, // deathsound
|
||||||
|
0, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
36*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
MT_BUBBLEWRAP_ICON, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_THUNDERCOIN_GOLDBOX
|
||||||
|
452, // doomednum
|
||||||
|
S_THUNDERCOIN_GOLDBOX, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_monton, // attacksound
|
||||||
|
S_THUNDERCOIN_GOLDBOX, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_GOLDBOX_OFF1, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_pop, // deathsound
|
||||||
|
0, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
36*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
MT_THUNDERCOIN_ICON, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_RING_REDBOX
|
{ // MT_RING_REDBOX
|
||||||
414, // doomednum
|
414, // doomednum
|
||||||
S_RING_REDBOX1, // spawnstate
|
S_RING_REDBOX1, // spawnstate
|
||||||
|
@ -6702,7 +6990,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_PITY_ICON1, // spawnstate
|
S_PITY_ICON1, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_shield, // seesound
|
sfx_s3k3a, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
|
@ -6729,7 +7017,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_ATTRACT_ICON1, // spawnstate
|
S_ATTRACT_ICON1, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_shield, // seesound
|
sfx_s3k41, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
|
@ -6756,7 +7044,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_FORCE_ICON1, // spawnstate
|
S_FORCE_ICON1, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_shield, // seesound
|
sfx_forcsg, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
|
@ -6783,7 +7071,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_ARMAGEDDON_ICON1, // spawnstate
|
S_ARMAGEDDON_ICON1, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_shield, // seesound
|
sfx_armasg, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
|
@ -6810,7 +7098,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_WHIRLWIND_ICON1, // spawnstate
|
S_WHIRLWIND_ICON1, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_shield, // seesound
|
sfx_wirlsg, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
|
@ -6837,7 +7125,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_ELEMENTAL_ICON1, // spawnstate
|
S_ELEMENTAL_ICON1, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_shield, // seesound
|
sfx_elemsg, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_NULL, // painstate
|
||||||
|
@ -7102,6 +7390,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_FLAMEAURA_ICON
|
||||||
|
-1, // doomednum
|
||||||
|
S_FLAMEAURA_ICON1, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_s3k3e, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
2*FRACUNIT, // speed
|
||||||
|
8*FRACUNIT, // radius
|
||||||
|
14*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
62*FRACUNIT, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_BUBBLEWRAP_ICON
|
||||||
|
-1, // doomednum
|
||||||
|
S_BUBBLEWRAP_ICON1, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_s3k3f, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
2*FRACUNIT, // speed
|
||||||
|
8*FRACUNIT, // radius
|
||||||
|
14*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
62*FRACUNIT, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_THUNDERCOIN_ICON
|
||||||
|
-1, // doomednum
|
||||||
|
S_THUNDERCOIN_ICON1, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_s3k41, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
2*FRACUNIT, // speed
|
||||||
|
8*FRACUNIT, // radius
|
||||||
|
14*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
62*FRACUNIT, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_ROCKET
|
{ // MT_ROCKET
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_ROCKET, // spawnstate
|
S_ROCKET, // spawnstate
|
||||||
|
@ -10345,7 +10714,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_GREENORB
|
{ // MT_ELEMENTAL_ORB
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_ELEM1, // spawnstate
|
S_ELEM1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
|
@ -10353,7 +10722,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
sfx_None, // seesound
|
sfx_None, // seesound
|
||||||
0, // reactiontime
|
0, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_ELEM13, // painstate
|
||||||
SKINCOLOR_NONE, // painchance
|
SKINCOLOR_NONE, // painchance
|
||||||
sfx_None, // painsound
|
sfx_None, // painsound
|
||||||
S_NULL, // meleestate
|
S_NULL, // meleestate
|
||||||
|
@ -10364,15 +10733,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
SH_ELEMENTAL, // speed
|
SH_ELEMENTAL, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
1, // display offset
|
2, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||||
S_NULL // raisestate
|
S_ELEMF9 // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_YELLOWORB
|
{ // MT_ATTRACT_ORB
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_MAGN1, // spawnstate
|
S_MAGN1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
|
@ -10380,7 +10749,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
sfx_None, // seesound
|
sfx_None, // seesound
|
||||||
8, // reactiontime
|
8, // reactiontime
|
||||||
sfx_None, // attacksound
|
sfx_None, // attacksound
|
||||||
S_NULL, // painstate
|
S_MAGN13, // painstate
|
||||||
SKINCOLOR_NONE, // painchance
|
SKINCOLOR_NONE, // painchance
|
||||||
sfx_None, // painsound
|
sfx_None, // painsound
|
||||||
S_NULL, // meleestate
|
S_NULL, // meleestate
|
||||||
|
@ -10391,7 +10760,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
SH_ATTRACT, // speed
|
SH_ATTRACT, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
1, // display offset
|
2, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
|
@ -10399,7 +10768,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_BLUEORB
|
{ // MT_FORCE_ORB
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_FORC1, // spawnstate
|
S_FORC1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
|
@ -10418,15 +10787,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
SH_FORCE, // speed
|
SH_FORCE, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
1, // display offset
|
2, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||||
S_NULL // raisestate
|
S_FORC21 // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_BLACKORB
|
{ // MT_ARMAGEDDON_ORB
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_ARMA1, // spawnstate
|
S_ARMA1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
|
@ -10442,10 +10811,10 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL, // deathstate
|
S_NULL, // deathstate
|
||||||
S_NULL, // xdeathstate
|
S_NULL, // xdeathstate
|
||||||
sfx_None, // deathsound
|
sfx_None, // deathsound
|
||||||
SH_BOMB, // speed
|
SH_ARMAGEDDON, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
1, // display offset
|
2, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
|
@ -10453,7 +10822,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_WHITEORB
|
{ // MT_WHIRLWIND_ORB
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_WIND1, // spawnstate
|
S_WIND1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
|
@ -10469,10 +10838,10 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL, // deathstate
|
S_NULL, // deathstate
|
||||||
S_NULL, // xdeathstate
|
S_NULL, // xdeathstate
|
||||||
sfx_None, // deathsound
|
sfx_None, // deathsound
|
||||||
SH_JUMP, // speed
|
SH_WHIRLWIND, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
1, // display offset
|
2, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
|
@ -10480,7 +10849,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_PITYORB
|
{ // MT_PITY_ORB
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_PITY1, // spawnstate
|
S_PITY1, // spawnstate
|
||||||
1000, // spawnhealth
|
1000, // spawnhealth
|
||||||
|
@ -10499,7 +10868,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
SH_PITY, // speed
|
SH_PITY, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
1, // display offset
|
2, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
|
@ -10507,6 +10876,114 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_FLAMEAURA_ORB
|
||||||
|
-1, // doomednum
|
||||||
|
S_FIRSB1, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_FIRS1, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_FIRSB10, // painstate
|
||||||
|
SKINCOLOR_NONE, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
SH_FLAMEAURA, // speed
|
||||||
|
64*FRACUNIT, // radius
|
||||||
|
64*FRACUNIT, // height
|
||||||
|
-2, // display offset
|
||||||
|
16, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||||
|
S_FIRS10 // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_BUBBLEWRAP_ORB
|
||||||
|
-1, // doomednum
|
||||||
|
S_BUBSB1, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_BUBS1, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_BUBSB5, // painstate
|
||||||
|
SKINCOLOR_NONE, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
SH_BUBBLEWRAP, // speed
|
||||||
|
64*FRACUNIT, // radius
|
||||||
|
64*FRACUNIT, // height
|
||||||
|
2, // display offset
|
||||||
|
16, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||||
|
S_BUBS10 // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_THUNDERCOIN_ORB
|
||||||
|
-1, // doomednum
|
||||||
|
S_ZAPSB1, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_ZAPS1, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_ZAPSB11, // painstate
|
||||||
|
SKINCOLOR_NONE, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
SH_THUNDERCOIN, // speed
|
||||||
|
64*FRACUNIT, // radius
|
||||||
|
64*FRACUNIT, // height
|
||||||
|
-2, // display offset
|
||||||
|
16, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||||
|
S_ZAPS14 // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_THUNDERCOIN_SPARK
|
||||||
|
-1, // doomednum
|
||||||
|
S_THUNDERCOIN_SPARK, // spawnstate
|
||||||
|
1, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
4*FRACUNIT, // radius
|
||||||
|
4*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_IVSP
|
{ // MT_IVSP
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_IVSP, // spawnstate
|
S_IVSP, // spawnstate
|
||||||
|
@ -10526,7 +11003,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
8, // speed
|
8, // speed
|
||||||
64*FRACUNIT, // radius
|
64*FRACUNIT, // radius
|
||||||
64*FRACUNIT, // height
|
64*FRACUNIT, // height
|
||||||
2, // display offset
|
3, // display offset
|
||||||
16, // mass
|
16, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
|
@ -10940,6 +11417,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_SPINDUST
|
||||||
|
-1, // doomednum
|
||||||
|
S_SPINDUST1, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
4*FRACUNIT, // speed
|
||||||
|
4*FRACUNIT, // radius
|
||||||
|
4*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
4, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIP, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_TFOG
|
{ // MT_TFOG
|
||||||
-1, // doomednum
|
-1, // doomednum
|
||||||
S_FOG1, // spawnstate
|
S_FOG1, // spawnstate
|
||||||
|
@ -12153,7 +12657,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL, // missilestate
|
S_NULL, // missilestate
|
||||||
S_NULL, // deathstate
|
S_NULL, // deathstate
|
||||||
S_NULL, // xdeathstate
|
S_NULL, // xdeathstate
|
||||||
sfx_mario3, // deathsound
|
sfx_None, // deathsound
|
||||||
0, // speed
|
0, // speed
|
||||||
16*FRACUNIT, // radius
|
16*FRACUNIT, // radius
|
||||||
32*FRACUNIT, // height
|
32*FRACUNIT, // height
|
||||||
|
|
156
src/info.h
156
src/info.h
|
@ -56,6 +56,9 @@ void A_BombShield(); // Obtained Bomb Shield
|
||||||
void A_WaterShield(); // Obtained Water Shield
|
void A_WaterShield(); // Obtained Water Shield
|
||||||
void A_ForceShield(); // Obtained Force Shield
|
void A_ForceShield(); // Obtained Force Shield
|
||||||
void A_PityShield(); // Obtained Pity Shield. We're... sorry.
|
void A_PityShield(); // Obtained Pity Shield. We're... sorry.
|
||||||
|
void A_FlameShield(); // Obtained Flame Shield
|
||||||
|
void A_BubbleShield(); // Obtained Bubble Shield
|
||||||
|
void A_ThunderShield(); // Obtained Thunder Shield
|
||||||
void A_GravityBox();
|
void A_GravityBox();
|
||||||
void A_ScoreRise(); // Rise the score logo
|
void A_ScoreRise(); // Rise the score logo
|
||||||
void A_ParticleSpawn();
|
void A_ParticleSpawn();
|
||||||
|
@ -351,6 +354,9 @@ typedef enum sprite
|
||||||
SPR_TVRC, // ReCycler
|
SPR_TVRC, // ReCycler
|
||||||
SPR_TV1K, // 1,000 points (1 K)
|
SPR_TV1K, // 1,000 points (1 K)
|
||||||
SPR_TVTK, // 10,000 points (Ten K)
|
SPR_TVTK, // 10,000 points (Ten K)
|
||||||
|
SPR_TVFL, // FLame shield
|
||||||
|
SPR_TVBB, // BuBble shield
|
||||||
|
SPR_TVZP, // Thunder shield (ZaP)
|
||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
SPR_MISL,
|
SPR_MISL,
|
||||||
|
@ -435,6 +441,9 @@ typedef enum sprite
|
||||||
SPR_ELEM, // Elemental Shield Orb and Fire
|
SPR_ELEM, // Elemental Shield Orb and Fire
|
||||||
SPR_FORC, // Force Shield Orb
|
SPR_FORC, // Force Shield Orb
|
||||||
SPR_PITY, // Pity Shield Orb
|
SPR_PITY, // Pity Shield Orb
|
||||||
|
SPR_FIRS, // Flame Shield Orb
|
||||||
|
SPR_BUBS, // Bubble Shield Orb
|
||||||
|
SPR_ZAPS, // Thunder Shield Orb
|
||||||
SPR_IVSP, // invincibility sparkles
|
SPR_IVSP, // invincibility sparkles
|
||||||
SPR_SSPK, // Super Sonic Spark
|
SPR_SSPK, // Super Sonic Spark
|
||||||
|
|
||||||
|
@ -466,6 +475,8 @@ typedef enum sprite
|
||||||
SPR_SMOK,
|
SPR_SMOK,
|
||||||
SPR_BUBL, // Bubble
|
SPR_BUBL, // Bubble
|
||||||
SPR_WZAP,
|
SPR_WZAP,
|
||||||
|
SPR_DUST, // Spindash dust
|
||||||
|
SPR_FPRT, // Spindash dust (flame)
|
||||||
SPR_TFOG, // Teleport Fog
|
SPR_TFOG, // Teleport Fog
|
||||||
SPR_SEED, // Sonic CD flower seed
|
SPR_SEED, // Sonic CD flower seed
|
||||||
SPR_PRTL, // Particle (for fans, etc.)
|
SPR_PRTL, // Particle (for fans, etc.)
|
||||||
|
@ -1723,7 +1734,7 @@ typedef enum state
|
||||||
S_SPIKEBALL7,
|
S_SPIKEBALL7,
|
||||||
S_SPIKEBALL8,
|
S_SPIKEBALL8,
|
||||||
|
|
||||||
// Fire Shield's Spawn
|
// Elemental Shield's Spawn
|
||||||
S_SPINFIRE1,
|
S_SPINFIRE1,
|
||||||
S_SPINFIRE2,
|
S_SPINFIRE2,
|
||||||
S_SPINFIRE3,
|
S_SPINFIRE3,
|
||||||
|
@ -1797,6 +1808,9 @@ typedef enum state
|
||||||
S_RECYCLER_BOX,
|
S_RECYCLER_BOX,
|
||||||
S_SCORE1K_BOX,
|
S_SCORE1K_BOX,
|
||||||
S_SCORE10K_BOX,
|
S_SCORE10K_BOX,
|
||||||
|
S_FLAMEAURA_BOX,
|
||||||
|
S_BUBBLEWRAP_BOX,
|
||||||
|
S_THUNDERCOIN_BOX,
|
||||||
|
|
||||||
// Gold Repeat Monitor States (one per box)
|
// Gold Repeat Monitor States (one per box)
|
||||||
S_PITY_GOLDBOX,
|
S_PITY_GOLDBOX,
|
||||||
|
@ -1809,6 +1823,9 @@ typedef enum state
|
||||||
S_INVULN_GOLDBOX,
|
S_INVULN_GOLDBOX,
|
||||||
S_EGGMAN_GOLDBOX,
|
S_EGGMAN_GOLDBOX,
|
||||||
S_GRAVITY_GOLDBOX,
|
S_GRAVITY_GOLDBOX,
|
||||||
|
S_FLAMEAURA_GOLDBOX,
|
||||||
|
S_BUBBLEWRAP_GOLDBOX,
|
||||||
|
S_THUNDERCOIN_GOLDBOX,
|
||||||
|
|
||||||
// Team Ring Boxes (these are special)
|
// Team Ring Boxes (these are special)
|
||||||
S_RING_REDBOX1,
|
S_RING_REDBOX1,
|
||||||
|
@ -1870,6 +1887,15 @@ typedef enum state
|
||||||
S_SCORE10K_ICON1,
|
S_SCORE10K_ICON1,
|
||||||
S_SCORE10K_ICON2,
|
S_SCORE10K_ICON2,
|
||||||
|
|
||||||
|
S_FLAMEAURA_ICON1,
|
||||||
|
S_FLAMEAURA_ICON2,
|
||||||
|
|
||||||
|
S_BUBBLEWRAP_ICON1,
|
||||||
|
S_BUBBLEWRAP_ICON2,
|
||||||
|
|
||||||
|
S_THUNDERCOIN_ICON1,
|
||||||
|
S_THUNDERCOIN_ICON2,
|
||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
S_ROCKET,
|
S_ROCKET,
|
||||||
|
@ -2241,6 +2267,7 @@ typedef enum state
|
||||||
S_MAGN10,
|
S_MAGN10,
|
||||||
S_MAGN11,
|
S_MAGN11,
|
||||||
S_MAGN12,
|
S_MAGN12,
|
||||||
|
S_MAGN13,
|
||||||
|
|
||||||
S_FORC1,
|
S_FORC1,
|
||||||
S_FORC2,
|
S_FORC2,
|
||||||
|
@ -2264,6 +2291,8 @@ typedef enum state
|
||||||
S_FORC19,
|
S_FORC19,
|
||||||
S_FORC20,
|
S_FORC20,
|
||||||
|
|
||||||
|
S_FORC21,
|
||||||
|
|
||||||
S_ELEM1,
|
S_ELEM1,
|
||||||
S_ELEM2,
|
S_ELEM2,
|
||||||
S_ELEM3,
|
S_ELEM3,
|
||||||
|
@ -2277,6 +2306,9 @@ typedef enum state
|
||||||
S_ELEM11,
|
S_ELEM11,
|
||||||
S_ELEM12,
|
S_ELEM12,
|
||||||
|
|
||||||
|
S_ELEM13,
|
||||||
|
S_ELEM14,
|
||||||
|
|
||||||
S_ELEMF1,
|
S_ELEMF1,
|
||||||
S_ELEMF2,
|
S_ELEMF2,
|
||||||
S_ELEMF3,
|
S_ELEMF3,
|
||||||
|
@ -2285,6 +2317,8 @@ typedef enum state
|
||||||
S_ELEMF6,
|
S_ELEMF6,
|
||||||
S_ELEMF7,
|
S_ELEMF7,
|
||||||
S_ELEMF8,
|
S_ELEMF8,
|
||||||
|
S_ELEMF9,
|
||||||
|
S_ELEMF10,
|
||||||
|
|
||||||
S_PITY1,
|
S_PITY1,
|
||||||
S_PITY2,
|
S_PITY2,
|
||||||
|
@ -2297,6 +2331,84 @@ typedef enum state
|
||||||
S_PITY9,
|
S_PITY9,
|
||||||
S_PITY10,
|
S_PITY10,
|
||||||
|
|
||||||
|
S_FIRS1,
|
||||||
|
S_FIRS2,
|
||||||
|
S_FIRS3,
|
||||||
|
S_FIRS4,
|
||||||
|
S_FIRS5,
|
||||||
|
S_FIRS6,
|
||||||
|
S_FIRS7,
|
||||||
|
S_FIRS8,
|
||||||
|
S_FIRS9,
|
||||||
|
|
||||||
|
S_FIRS10,
|
||||||
|
S_FIRS11,
|
||||||
|
|
||||||
|
S_FIRSB1,
|
||||||
|
S_FIRSB2,
|
||||||
|
S_FIRSB3,
|
||||||
|
S_FIRSB4,
|
||||||
|
S_FIRSB5,
|
||||||
|
S_FIRSB6,
|
||||||
|
S_FIRSB7,
|
||||||
|
S_FIRSB8,
|
||||||
|
S_FIRSB9,
|
||||||
|
|
||||||
|
S_FIRSB10,
|
||||||
|
|
||||||
|
S_BUBS1,
|
||||||
|
S_BUBS2,
|
||||||
|
S_BUBS3,
|
||||||
|
S_BUBS4,
|
||||||
|
S_BUBS5,
|
||||||
|
S_BUBS6,
|
||||||
|
S_BUBS7,
|
||||||
|
S_BUBS8,
|
||||||
|
S_BUBS9,
|
||||||
|
|
||||||
|
S_BUBS10,
|
||||||
|
S_BUBS11,
|
||||||
|
|
||||||
|
S_BUBSB1,
|
||||||
|
S_BUBSB2,
|
||||||
|
S_BUBSB3,
|
||||||
|
S_BUBSB4,
|
||||||
|
|
||||||
|
S_BUBSB5,
|
||||||
|
S_BUBSB6,
|
||||||
|
|
||||||
|
S_ZAPS1,
|
||||||
|
S_ZAPS2,
|
||||||
|
S_ZAPS3,
|
||||||
|
S_ZAPS4,
|
||||||
|
S_ZAPS5,
|
||||||
|
S_ZAPS6,
|
||||||
|
S_ZAPS7,
|
||||||
|
S_ZAPS8,
|
||||||
|
S_ZAPS9,
|
||||||
|
S_ZAPS10,
|
||||||
|
S_ZAPS11,
|
||||||
|
S_ZAPS12,
|
||||||
|
S_ZAPS13, // blank frame
|
||||||
|
S_ZAPS14,
|
||||||
|
S_ZAPS15,
|
||||||
|
S_ZAPS16,
|
||||||
|
|
||||||
|
S_ZAPSB1, // blank frame
|
||||||
|
S_ZAPSB2,
|
||||||
|
S_ZAPSB3,
|
||||||
|
S_ZAPSB4,
|
||||||
|
S_ZAPSB5,
|
||||||
|
S_ZAPSB6,
|
||||||
|
S_ZAPSB7,
|
||||||
|
S_ZAPSB8,
|
||||||
|
S_ZAPSB9,
|
||||||
|
S_ZAPSB10,
|
||||||
|
S_ZAPSB11, // blank frame
|
||||||
|
|
||||||
|
//Thunder spark
|
||||||
|
S_THUNDERCOIN_SPARK,
|
||||||
|
|
||||||
// Invincibility Sparkles
|
// Invincibility Sparkles
|
||||||
S_IVSP,
|
S_IVSP,
|
||||||
|
|
||||||
|
@ -2457,6 +2569,20 @@ typedef enum state
|
||||||
|
|
||||||
S_WATERZAP,
|
S_WATERZAP,
|
||||||
|
|
||||||
|
// Spindash dust
|
||||||
|
S_SPINDUST1,
|
||||||
|
S_SPINDUST2,
|
||||||
|
S_SPINDUST3,
|
||||||
|
S_SPINDUST4,
|
||||||
|
S_SPINDUST_BUBBLE1,
|
||||||
|
S_SPINDUST_BUBBLE2,
|
||||||
|
S_SPINDUST_BUBBLE3,
|
||||||
|
S_SPINDUST_BUBBLE4,
|
||||||
|
S_SPINDUST_FIRE1,
|
||||||
|
S_SPINDUST_FIRE2,
|
||||||
|
S_SPINDUST_FIRE3,
|
||||||
|
S_SPINDUST_FIRE4,
|
||||||
|
|
||||||
S_FOG1,
|
S_FOG1,
|
||||||
S_FOG2,
|
S_FOG2,
|
||||||
S_FOG3,
|
S_FOG3,
|
||||||
|
@ -3074,6 +3200,9 @@ typedef enum mobj_type
|
||||||
MT_RECYCLER_BOX,
|
MT_RECYCLER_BOX,
|
||||||
MT_SCORE1K_BOX,
|
MT_SCORE1K_BOX,
|
||||||
MT_SCORE10K_BOX,
|
MT_SCORE10K_BOX,
|
||||||
|
MT_FLAMEAURA_BOX,
|
||||||
|
MT_BUBBLEWRAP_BOX,
|
||||||
|
MT_THUNDERCOIN_BOX,
|
||||||
|
|
||||||
// Monitor boxes -- repeating (big) boxes
|
// Monitor boxes -- repeating (big) boxes
|
||||||
MT_PITY_GOLDBOX,
|
MT_PITY_GOLDBOX,
|
||||||
|
@ -3086,6 +3215,9 @@ typedef enum mobj_type
|
||||||
MT_INVULN_GOLDBOX,
|
MT_INVULN_GOLDBOX,
|
||||||
MT_EGGMAN_GOLDBOX,
|
MT_EGGMAN_GOLDBOX,
|
||||||
MT_GRAVITY_GOLDBOX,
|
MT_GRAVITY_GOLDBOX,
|
||||||
|
MT_FLAMEAURA_GOLDBOX,
|
||||||
|
MT_BUBBLEWRAP_GOLDBOX,
|
||||||
|
MT_THUNDERCOIN_GOLDBOX,
|
||||||
|
|
||||||
// Monitor boxes -- special
|
// Monitor boxes -- special
|
||||||
MT_RING_REDBOX,
|
MT_RING_REDBOX,
|
||||||
|
@ -3108,6 +3240,9 @@ typedef enum mobj_type
|
||||||
MT_RECYCLER_ICON,
|
MT_RECYCLER_ICON,
|
||||||
MT_SCORE1K_ICON,
|
MT_SCORE1K_ICON,
|
||||||
MT_SCORE10K_ICON,
|
MT_SCORE10K_ICON,
|
||||||
|
MT_FLAMEAURA_ICON,
|
||||||
|
MT_BUBBLEWRAP_ICON,
|
||||||
|
MT_THUNDERCOIN_ICON,
|
||||||
|
|
||||||
// Projectiles
|
// Projectiles
|
||||||
MT_ROCKET,
|
MT_ROCKET,
|
||||||
|
@ -3260,13 +3395,17 @@ typedef enum mobj_type
|
||||||
MT_EGGSTATUE2,
|
MT_EGGSTATUE2,
|
||||||
|
|
||||||
// Powerup Indicators
|
// Powerup Indicators
|
||||||
MT_GREENORB, // Elemental shield mobj
|
MT_ELEMENTAL_ORB, // Elemental shield mobj
|
||||||
MT_YELLOWORB, // Attract shield mobj
|
MT_ATTRACT_ORB, // Attract shield mobj
|
||||||
MT_BLUEORB, // Force shield mobj
|
MT_FORCE_ORB, // Force shield mobj
|
||||||
MT_BLACKORB, // Armageddon shield mobj
|
MT_ARMAGEDDON_ORB, // Armageddon shield mobj
|
||||||
MT_WHITEORB, // Whirlwind shield mobj
|
MT_WHIRLWIND_ORB, // Whirlwind shield mobj
|
||||||
MT_PITYORB, // Pity shield mobj
|
MT_PITY_ORB, // Pity shield mobj
|
||||||
MT_IVSP, // invincibility sparkles
|
MT_FLAMEAURA_ORB, // Flame shield mobj
|
||||||
|
MT_BUBBLEWRAP_ORB, // Bubble shield mobj
|
||||||
|
MT_THUNDERCOIN_ORB, // Thunder shield mobj
|
||||||
|
MT_THUNDERCOIN_SPARK, // Thunder spark
|
||||||
|
MT_IVSP, // Invincibility sparkles
|
||||||
MT_SUPERSPARK, // Super Sonic Spark
|
MT_SUPERSPARK, // Super Sonic Spark
|
||||||
|
|
||||||
// Freed Animals
|
// Freed Animals
|
||||||
|
@ -3286,6 +3425,7 @@ typedef enum mobj_type
|
||||||
MT_MEDIUMBUBBLE, // medium bubble
|
MT_MEDIUMBUBBLE, // medium bubble
|
||||||
MT_EXTRALARGEBUBBLE, // extra large bubble
|
MT_EXTRALARGEBUBBLE, // extra large bubble
|
||||||
MT_WATERZAP,
|
MT_WATERZAP,
|
||||||
|
MT_SPINDUST, // Spindash dust
|
||||||
MT_TFOG,
|
MT_TFOG,
|
||||||
MT_SEED,
|
MT_SEED,
|
||||||
MT_PARTICLE,
|
MT_PARTICLE,
|
||||||
|
|
|
@ -309,6 +309,19 @@ static int lib_pRemoveMobj(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// P_IsValidSprite2 technically doesn't exist, and probably never should... but too much would need to be exposed to allow this to be checked by other methods.
|
||||||
|
|
||||||
|
static int lib_pIsValidSprite2(lua_State *L)
|
||||||
|
{
|
||||||
|
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
UINT8 spr2 = (UINT8)luaL_checkinteger(L, 2);
|
||||||
|
//HUDSAFE
|
||||||
|
if (!mobj)
|
||||||
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
|
lua_pushboolean(L, (mobj->skin && (((skin_t *)mobj->skin)->sprites[spr2].numframes > 0)));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int lib_pSpawnMissile(lua_State *L)
|
static int lib_pSpawnMissile(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
@ -618,6 +631,17 @@ static int lib_pAddPlayerScore(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_pStealPlayerScore(lua_State *L)
|
||||||
|
{
|
||||||
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
UINT32 amount = (UINT32)luaL_checkinteger(L, 2);
|
||||||
|
NOHUD
|
||||||
|
if (!player)
|
||||||
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
|
P_StealPlayerScore(player, amount);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int lib_pPlayerInPain(lua_State *L)
|
static int lib_pPlayerInPain(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
@ -777,6 +801,16 @@ static int lib_pDoJumpShield(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_pDoBubbleBounce(lua_State *L)
|
||||||
|
{
|
||||||
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
NOHUD
|
||||||
|
if (!player)
|
||||||
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
|
P_DoBubbleBounce(player);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int lib_pBlackOw(lua_State *L)
|
static int lib_pBlackOw(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
@ -787,13 +821,14 @@ static int lib_pBlackOw(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_pElementalFireTrail(lua_State *L)
|
static int lib_pElementalFire(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
boolean cropcircle = lua_optboolean(L, 2);
|
||||||
NOHUD
|
NOHUD
|
||||||
if (!player)
|
if (!player)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
P_ElementalFireTrail(player);
|
P_ElementalFire(player, cropcircle);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,10 +883,11 @@ static int lib_pReturnThrustY(lua_State *L)
|
||||||
static int lib_pLookForEnemies(lua_State *L)
|
static int lib_pLookForEnemies(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
boolean nonenemies = lua_opttrueboolean(L, 2);
|
||||||
NOHUD
|
NOHUD
|
||||||
if (!player)
|
if (!player)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
lua_pushboolean(L, P_LookForEnemies(player));
|
lua_pushboolean(L, P_LookForEnemies(player, nonenemies));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1132,7 +1168,7 @@ static int lib_pPlayerRingBurst(lua_State *L)
|
||||||
if (!player)
|
if (!player)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
if (num_rings == -1)
|
if (num_rings == -1)
|
||||||
num_rings = player->health - 1;
|
num_rings = player->rings;
|
||||||
P_PlayerRingBurst(player, num_rings);
|
P_PlayerRingBurst(player, num_rings);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1157,6 +1193,16 @@ static int lib_pPlayerWeaponAmmoBurst(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_pPlayerWeaponPanelOrAmmoBurst(lua_State *L)
|
||||||
|
{
|
||||||
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
NOHUD
|
||||||
|
if (!player)
|
||||||
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
|
P_PlayerWeaponPanelOrAmmoBurst(player);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int lib_pPlayerEmeraldBurst(lua_State *L)
|
static int lib_pPlayerEmeraldBurst(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
@ -1264,6 +1310,16 @@ static int lib_pDoNightsScore(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_pDoMatchSuper(lua_State *L)
|
||||||
|
{
|
||||||
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
NOHUD
|
||||||
|
if (!player)
|
||||||
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
|
P_DoMatchSuper(player);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// P_SPEC
|
// P_SPEC
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
|
@ -2005,6 +2061,7 @@ static luaL_Reg lib[] = {
|
||||||
// don't add P_SetMobjState or P_SetPlayerMobjState, use "mobj.state = S_NEWSTATE" instead.
|
// don't add P_SetMobjState or P_SetPlayerMobjState, use "mobj.state = S_NEWSTATE" instead.
|
||||||
{"P_SpawnMobj",lib_pSpawnMobj},
|
{"P_SpawnMobj",lib_pSpawnMobj},
|
||||||
{"P_RemoveMobj",lib_pRemoveMobj},
|
{"P_RemoveMobj",lib_pRemoveMobj},
|
||||||
|
{"P_IsValidSprite2", lib_pIsValidSprite2},
|
||||||
{"P_SpawnMissile",lib_pSpawnMissile},
|
{"P_SpawnMissile",lib_pSpawnMissile},
|
||||||
{"P_SpawnXYZMissile",lib_pSpawnXYZMissile},
|
{"P_SpawnXYZMissile",lib_pSpawnXYZMissile},
|
||||||
{"P_SpawnPointMissile",lib_pSpawnPointMissile},
|
{"P_SpawnPointMissile",lib_pSpawnPointMissile},
|
||||||
|
@ -2031,6 +2088,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_GetPlayerSpinHeight",lib_pGetPlayerSpinHeight},
|
{"P_GetPlayerSpinHeight",lib_pGetPlayerSpinHeight},
|
||||||
{"P_GetPlayerControlDirection",lib_pGetPlayerControlDirection},
|
{"P_GetPlayerControlDirection",lib_pGetPlayerControlDirection},
|
||||||
{"P_AddPlayerScore",lib_pAddPlayerScore},
|
{"P_AddPlayerScore",lib_pAddPlayerScore},
|
||||||
|
{"P_StealPlayerScore",lib_pStealPlayerScore},
|
||||||
{"P_PlayerInPain",lib_pPlayerInPain},
|
{"P_PlayerInPain",lib_pPlayerInPain},
|
||||||
{"P_DoPlayerPain",lib_pDoPlayerPain},
|
{"P_DoPlayerPain",lib_pDoPlayerPain},
|
||||||
{"P_ResetPlayer",lib_pResetPlayer},
|
{"P_ResetPlayer",lib_pResetPlayer},
|
||||||
|
@ -2046,8 +2104,9 @@ static luaL_Reg lib[] = {
|
||||||
{"P_GivePlayerLives",lib_pGivePlayerLives},
|
{"P_GivePlayerLives",lib_pGivePlayerLives},
|
||||||
{"P_ResetScore",lib_pResetScore},
|
{"P_ResetScore",lib_pResetScore},
|
||||||
{"P_DoJumpShield",lib_pDoJumpShield},
|
{"P_DoJumpShield",lib_pDoJumpShield},
|
||||||
|
{"P_DoBubbleBounce",lib_pDoBubbleBounce},
|
||||||
{"P_BlackOw",lib_pBlackOw},
|
{"P_BlackOw",lib_pBlackOw},
|
||||||
{"P_ElementalFireTrail",lib_pElementalFireTrail},
|
{"P_ElementalFire",lib_pElementalFire},
|
||||||
{"P_DoPlayerExit",lib_pDoPlayerExit},
|
{"P_DoPlayerExit",lib_pDoPlayerExit},
|
||||||
{"P_InstaThrust",lib_pInstaThrust},
|
{"P_InstaThrust",lib_pInstaThrust},
|
||||||
{"P_ReturnThrustX",lib_pReturnThrustX},
|
{"P_ReturnThrustX",lib_pReturnThrustX},
|
||||||
|
@ -2081,6 +2140,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_PlayerRingBurst",lib_pPlayerRingBurst},
|
{"P_PlayerRingBurst",lib_pPlayerRingBurst},
|
||||||
{"P_PlayerWeaponPanelBurst",lib_pPlayerWeaponPanelBurst},
|
{"P_PlayerWeaponPanelBurst",lib_pPlayerWeaponPanelBurst},
|
||||||
{"P_PlayerWeaponAmmoBurst",lib_pPlayerWeaponAmmoBurst},
|
{"P_PlayerWeaponAmmoBurst",lib_pPlayerWeaponAmmoBurst},
|
||||||
|
{"P_PlayerWeaponPanelOrAmmoBurst", lib_pPlayerWeaponPanelOrAmmoBurst},
|
||||||
{"P_PlayerEmeraldBurst",lib_pPlayerEmeraldBurst},
|
{"P_PlayerEmeraldBurst",lib_pPlayerEmeraldBurst},
|
||||||
{"P_PlayerFlagBurst",lib_pPlayerFlagBurst},
|
{"P_PlayerFlagBurst",lib_pPlayerFlagBurst},
|
||||||
{"P_PlayRinglossSound",lib_pPlayRinglossSound},
|
{"P_PlayRinglossSound",lib_pPlayRinglossSound},
|
||||||
|
@ -2089,6 +2149,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_PlayLivesJingle",lib_pPlayLivesJingle},
|
{"P_PlayLivesJingle",lib_pPlayLivesJingle},
|
||||||
{"P_CanPickupItem",lib_pCanPickupItem},
|
{"P_CanPickupItem",lib_pCanPickupItem},
|
||||||
{"P_DoNightsScore",lib_pDoNightsScore},
|
{"P_DoNightsScore",lib_pDoNightsScore},
|
||||||
|
{"P_DoMatchSuper",lib_pDoMatchSuper},
|
||||||
|
|
||||||
// p_spec
|
// p_spec
|
||||||
{"P_Thrust",lib_pThrust},
|
{"P_Thrust",lib_pThrust},
|
||||||
|
|
|
@ -43,6 +43,8 @@ enum hook {
|
||||||
hook_PlayerMsg,
|
hook_PlayerMsg,
|
||||||
hook_HurtMsg,
|
hook_HurtMsg,
|
||||||
hook_PlayerSpawn,
|
hook_PlayerSpawn,
|
||||||
|
hook_ShieldSpawn,
|
||||||
|
hook_ShieldSpecial,
|
||||||
|
|
||||||
hook_MAX // last hook
|
hook_MAX // last hook
|
||||||
};
|
};
|
||||||
|
@ -62,9 +64,9 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher); // Hook for P_Touch
|
||||||
#define LUAh_MobjFuse(mo) LUAh_MobjHook(mo, hook_MobjFuse) // Hook for mobj->fuse == 0 by mobj type
|
#define LUAh_MobjFuse(mo) LUAh_MobjHook(mo, hook_MobjFuse) // Hook for mobj->fuse == 0 by mobj type
|
||||||
#define LUAh_MobjThinker(mo) LUAh_MobjHook(mo, hook_MobjThinker) // Hook for P_MobjThinker or P_SceneryThinker by mobj type
|
#define LUAh_MobjThinker(mo) LUAh_MobjHook(mo, hook_MobjThinker) // Hook for P_MobjThinker or P_SceneryThinker by mobj type
|
||||||
#define LUAh_BossThinker(mo) LUAh_MobjHook(mo, hook_BossThinker) // Hook for P_GenericBossThinker by mobj type
|
#define LUAh_BossThinker(mo) LUAh_MobjHook(mo, hook_BossThinker) // Hook for P_GenericBossThinker by mobj type
|
||||||
UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage); // Hook for P_DamageMobj by mobj type (Should mobj take damage?)
|
UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype); // Hook for P_DamageMobj by mobj type (Should mobj take damage?)
|
||||||
boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage); // Hook for P_DamageMobj by mobj type (Mobj actually takes damage!)
|
boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype); // Hook for P_DamageMobj by mobj type (Mobj actually takes damage!)
|
||||||
boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Hook for P_KillMobj by mobj type
|
boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); // Hook for P_KillMobj by mobj type
|
||||||
#define LUAh_BossDeath(mo) LUAh_MobjHook(mo, hook_BossDeath) // Hook for A_BossDeath by mobj type
|
#define LUAh_BossDeath(mo) LUAh_MobjHook(mo, hook_BossDeath) // Hook for A_BossDeath by mobj type
|
||||||
#define LUAh_MobjRemoved(mo) LUAh_MobjHook(mo, hook_MobjRemoved) // Hook for P_RemoveMobj by mobj type
|
#define LUAh_MobjRemoved(mo) LUAh_MobjHook(mo, hook_MobjRemoved) // Hook for P_RemoveMobj by mobj type
|
||||||
#define LUAh_JumpSpecial(player) LUAh_PlayerHook(player, hook_JumpSpecial) // Hook for P_DoJumpStuff (Any-jumping)
|
#define LUAh_JumpSpecial(player) LUAh_PlayerHook(player, hook_JumpSpecial) // Hook for P_DoJumpStuff (Any-jumping)
|
||||||
|
@ -75,7 +77,9 @@ boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd
|
||||||
boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name
|
boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name
|
||||||
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors
|
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors
|
||||||
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages
|
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages
|
||||||
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages
|
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); // Hook for hurt messages
|
||||||
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer
|
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer
|
||||||
|
#define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb
|
||||||
|
#define LUAh_ShieldSpecial(player) LUAh_PlayerHook(player, hook_ShieldSpecial) // Hook for shield abilities
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,6 +54,8 @@ const char *const hookNames[hook_MAX+1] = {
|
||||||
"PlayerMsg",
|
"PlayerMsg",
|
||||||
"HurtMsg",
|
"HurtMsg",
|
||||||
"PlayerSpawn",
|
"PlayerSpawn",
|
||||||
|
"ShieldSpawn",
|
||||||
|
"ShieldSpecial",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -412,7 +414,7 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook for P_DamageMobj by mobj type (Should mobj take damage?)
|
// Hook for P_DamageMobj by mobj type (Should mobj take damage?)
|
||||||
UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
UINT8 shouldDamage = 0; // 0 = default, 1 = force yes, 2 = force no.
|
UINT8 shouldDamage = 0; // 0 = default, 1 = force yes, 2 = force no.
|
||||||
|
@ -431,14 +433,16 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
|
||||||
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
||||||
LUA_PushUserdata(gL, source, META_MOBJ);
|
LUA_PushUserdata(gL, source, META_MOBJ);
|
||||||
lua_pushinteger(gL, damage);
|
lua_pushinteger(gL, damage);
|
||||||
|
lua_pushinteger(gL, damagetype);
|
||||||
}
|
}
|
||||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
if (lua_pcall(gL, 4, 1, 0)) {
|
lua_pushvalue(gL, -6);
|
||||||
|
if (lua_pcall(gL, 5, 1, 0)) {
|
||||||
if (!hookp->error || cv_debug & DBG_LUA)
|
if (!hookp->error || cv_debug & DBG_LUA)
|
||||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
|
@ -460,7 +464,7 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook for P_DamageMobj by mobj type (Mobj actually takes damage!)
|
// Hook for P_DamageMobj by mobj type (Mobj actually takes damage!)
|
||||||
boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
boolean hooked = false;
|
boolean hooked = false;
|
||||||
|
@ -479,14 +483,16 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
|
||||||
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
||||||
LUA_PushUserdata(gL, source, META_MOBJ);
|
LUA_PushUserdata(gL, source, META_MOBJ);
|
||||||
lua_pushinteger(gL, damage);
|
lua_pushinteger(gL, damage);
|
||||||
|
lua_pushinteger(gL, damagetype);
|
||||||
}
|
}
|
||||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
lua_pushvalue(gL, -5);
|
lua_pushvalue(gL, -6);
|
||||||
if (lua_pcall(gL, 4, 1, 0)) {
|
lua_pushvalue(gL, -6);
|
||||||
|
if (lua_pcall(gL, 5, 1, 0)) {
|
||||||
if (!hookp->error || cv_debug & DBG_LUA)
|
if (!hookp->error || cv_debug & DBG_LUA)
|
||||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
|
@ -503,7 +509,7 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook for P_KillMobj by mobj type
|
// Hook for P_KillMobj by mobj type
|
||||||
boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
boolean hooked = false;
|
boolean hooked = false;
|
||||||
|
@ -521,13 +527,15 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||||
LUA_PushUserdata(gL, target, META_MOBJ);
|
LUA_PushUserdata(gL, target, META_MOBJ);
|
||||||
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
||||||
LUA_PushUserdata(gL, source, META_MOBJ);
|
LUA_PushUserdata(gL, source, META_MOBJ);
|
||||||
|
lua_pushinteger(gL, damagetype);
|
||||||
}
|
}
|
||||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||||
lua_pushvalue(gL, -4);
|
lua_pushvalue(gL, -5);
|
||||||
lua_pushvalue(gL, -4);
|
lua_pushvalue(gL, -5);
|
||||||
lua_pushvalue(gL, -4);
|
lua_pushvalue(gL, -5);
|
||||||
if (lua_pcall(gL, 3, 1, 0)) {
|
lua_pushvalue(gL, -5);
|
||||||
|
if (lua_pcall(gL, 4, 1, 0)) {
|
||||||
if (!hookp->error || cv_debug & DBG_LUA)
|
if (!hookp->error || cv_debug & DBG_LUA)
|
||||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
|
@ -729,7 +737,7 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook for hurt messages
|
// Hook for hurt messages
|
||||||
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source)
|
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
boolean hooked = false;
|
boolean hooked = false;
|
||||||
|
@ -747,13 +755,15 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||||
LUA_PushUserdata(gL, player, META_PLAYER);
|
LUA_PushUserdata(gL, player, META_PLAYER);
|
||||||
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
LUA_PushUserdata(gL, inflictor, META_MOBJ);
|
||||||
LUA_PushUserdata(gL, source, META_MOBJ);
|
LUA_PushUserdata(gL, source, META_MOBJ);
|
||||||
|
lua_pushinteger(gL, damagetype);
|
||||||
}
|
}
|
||||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||||
lua_pushvalue(gL, -4);
|
lua_pushvalue(gL, -5);
|
||||||
lua_pushvalue(gL, -4);
|
lua_pushvalue(gL, -5);
|
||||||
lua_pushvalue(gL, -4);
|
lua_pushvalue(gL, -5);
|
||||||
if (lua_pcall(gL, 3, 1, 0)) {
|
lua_pushvalue(gL, -5);
|
||||||
|
if (lua_pcall(gL, 4, 1, 0)) {
|
||||||
if (!hookp->error || cv_debug & DBG_LUA)
|
if (!hookp->error || cv_debug & DBG_LUA)
|
||||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
|
|
|
@ -34,6 +34,7 @@ enum mobj_e {
|
||||||
mobj_angle,
|
mobj_angle,
|
||||||
mobj_sprite,
|
mobj_sprite,
|
||||||
mobj_frame,
|
mobj_frame,
|
||||||
|
mobj_sprite2,
|
||||||
mobj_anim_duration,
|
mobj_anim_duration,
|
||||||
mobj_touching_sectorlist,
|
mobj_touching_sectorlist,
|
||||||
mobj_subsector,
|
mobj_subsector,
|
||||||
|
@ -93,6 +94,7 @@ static const char *const mobj_opt[] = {
|
||||||
"angle",
|
"angle",
|
||||||
"sprite",
|
"sprite",
|
||||||
"frame",
|
"frame",
|
||||||
|
"sprite2",
|
||||||
"anim_duration",
|
"anim_duration",
|
||||||
"touching_sectorlist",
|
"touching_sectorlist",
|
||||||
"subsector",
|
"subsector",
|
||||||
|
@ -189,6 +191,9 @@ static int mobj_get(lua_State *L)
|
||||||
case mobj_frame:
|
case mobj_frame:
|
||||||
lua_pushinteger(L, mo->frame);
|
lua_pushinteger(L, mo->frame);
|
||||||
break;
|
break;
|
||||||
|
case mobj_sprite2:
|
||||||
|
lua_pushinteger(L, mo->sprite2);
|
||||||
|
break;
|
||||||
case mobj_anim_duration:
|
case mobj_anim_duration:
|
||||||
lua_pushinteger(L, mo->anim_duration);
|
lua_pushinteger(L, mo->anim_duration);
|
||||||
break;
|
break;
|
||||||
|
@ -411,6 +416,9 @@ static int mobj_set(lua_State *L)
|
||||||
case mobj_frame:
|
case mobj_frame:
|
||||||
mo->frame = (UINT32)luaL_checkinteger(L, 3);
|
mo->frame = (UINT32)luaL_checkinteger(L, 3);
|
||||||
break;
|
break;
|
||||||
|
case mobj_sprite2:
|
||||||
|
mo->sprite2 = P_GetMobjSprite2(mo, (UINT8)luaL_checkinteger(L, 3));
|
||||||
|
break;
|
||||||
case mobj_anim_duration:
|
case mobj_anim_duration:
|
||||||
mo->anim_duration = (UINT16)luaL_checkinteger(L, 3);
|
mo->anim_duration = (UINT16)luaL_checkinteger(L, 3);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -122,8 +122,8 @@ static int player_get(lua_State *L)
|
||||||
lua_pushfixed(L, plr->bob);
|
lua_pushfixed(L, plr->bob);
|
||||||
else if (fastcmp(field,"aiming"))
|
else if (fastcmp(field,"aiming"))
|
||||||
lua_pushangle(L, plr->aiming);
|
lua_pushangle(L, plr->aiming);
|
||||||
else if (fastcmp(field,"health"))
|
else if (fastcmp(field,"rings"))
|
||||||
lua_pushinteger(L, plr->health);
|
lua_pushinteger(L, plr->rings);
|
||||||
else if (fastcmp(field,"pity"))
|
else if (fastcmp(field,"pity"))
|
||||||
lua_pushinteger(L, plr->pity);
|
lua_pushinteger(L, plr->pity);
|
||||||
else if (fastcmp(field,"currentweapon"))
|
else if (fastcmp(field,"currentweapon"))
|
||||||
|
@ -382,8 +382,8 @@ static int player_set(lua_State *L)
|
||||||
else if (plr == &players[secondarydisplayplayer])
|
else if (plr == &players[secondarydisplayplayer])
|
||||||
localaiming2 = plr->aiming;
|
localaiming2 = plr->aiming;
|
||||||
}
|
}
|
||||||
else if (fastcmp(field,"health"))
|
else if (fastcmp(field,"rings"))
|
||||||
plr->health = (INT32)luaL_checkinteger(L, 3);
|
plr->rings = (INT32)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"pity"))
|
else if (fastcmp(field,"pity"))
|
||||||
plr->pity = (SINT8)luaL_checkinteger(L, 3);
|
plr->pity = (SINT8)luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"currentweapon"))
|
else if (fastcmp(field,"currentweapon"))
|
||||||
|
|
|
@ -606,7 +606,7 @@ void Command_CauseCfail_f(void)
|
||||||
players[consoleplayer].mo->y = 123311; //cfail cansuled kthxbye
|
players[consoleplayer].mo->y = 123311; //cfail cansuled kthxbye
|
||||||
players[consoleplayer].mo->z = 123311;
|
players[consoleplayer].mo->z = 123311;
|
||||||
players[consoleplayer].score = 1337;
|
players[consoleplayer].score = 1337;
|
||||||
players[consoleplayer].health = 1337;
|
players[consoleplayer].rings = 1337;
|
||||||
players[consoleplayer].mo->destscale = 25;
|
players[consoleplayer].mo->destscale = 25;
|
||||||
P_SetThingPosition(players[consoleplayer].mo);
|
P_SetThingPosition(players[consoleplayer].mo);
|
||||||
|
|
||||||
|
@ -720,7 +720,7 @@ void Command_Setrings_f(void)
|
||||||
if (COM_Argc() > 1)
|
if (COM_Argc() > 1)
|
||||||
{
|
{
|
||||||
// P_GivePlayerRings does value clamping
|
// P_GivePlayerRings does value clamping
|
||||||
players[consoleplayer].health = players[consoleplayer].mo->health = 1;
|
players[consoleplayer].rings = 0;
|
||||||
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||||
if (!G_IsSpecialStage(gamemap) || !useNightsSS)
|
if (!G_IsSpecialStage(gamemap) || !useNightsSS)
|
||||||
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
||||||
|
@ -1298,7 +1298,7 @@ void Command_ObjectPlace_f(void)
|
||||||
// Like the classics, recover from death by entering objectplace
|
// Like the classics, recover from death by entering objectplace
|
||||||
if (players[0].mo->health <= 0)
|
if (players[0].mo->health <= 0)
|
||||||
{
|
{
|
||||||
players[0].mo->health = players[0].health = 1;
|
players[0].mo->health = 1;
|
||||||
players[0].deadtimer = 0;
|
players[0].deadtimer = 0;
|
||||||
op_oldflags1 = mobjinfo[MT_PLAYER].flags;
|
op_oldflags1 = mobjinfo[MT_PLAYER].flags;
|
||||||
++players[0].lives;
|
++players[0].lives;
|
||||||
|
|
16
src/m_menu.c
16
src/m_menu.c
|
@ -183,9 +183,6 @@ static INT32 vidm_selected = 0;
|
||||||
static INT32 vidm_nummodes;
|
static INT32 vidm_nummodes;
|
||||||
static INT32 vidm_column_size;
|
static INT32 vidm_column_size;
|
||||||
|
|
||||||
// what a headache.
|
|
||||||
static boolean shiftdown = false;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// PROTOTYPES
|
// PROTOTYPES
|
||||||
//
|
//
|
||||||
|
@ -2083,11 +2080,6 @@ boolean M_Responder(event_t *ev)
|
||||||
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION)
|
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (ev->type == ev_keyup && (ev->data1 == KEY_LSHIFT || ev->data1 == KEY_RSHIFT))
|
|
||||||
{
|
|
||||||
shiftdown = false;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (noFurtherInput)
|
if (noFurtherInput)
|
||||||
{
|
{
|
||||||
// Ignore input after enter/escape/other buttons
|
// Ignore input after enter/escape/other buttons
|
||||||
|
@ -2101,10 +2093,6 @@ boolean M_Responder(event_t *ev)
|
||||||
// added 5-2-98 remap virtual keys (mouse & joystick buttons)
|
// added 5-2-98 remap virtual keys (mouse & joystick buttons)
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case KEY_LSHIFT:
|
|
||||||
case KEY_RSHIFT:
|
|
||||||
shiftdown = true;
|
|
||||||
break; //return false;
|
|
||||||
case KEY_MOUSE1:
|
case KEY_MOUSE1:
|
||||||
case KEY_JOY1:
|
case KEY_JOY1:
|
||||||
case KEY_JOY1 + 2:
|
case KEY_JOY1 + 2:
|
||||||
|
@ -3831,7 +3819,7 @@ static void M_HandleImageDef(INT32 choice)
|
||||||
static void M_PandorasBox(INT32 choice)
|
static void M_PandorasBox(INT32 choice)
|
||||||
{
|
{
|
||||||
(void)choice;
|
(void)choice;
|
||||||
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].health - 1, 0));
|
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0));
|
||||||
CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives);
|
CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives);
|
||||||
CV_StealthSetValue(&cv_dummycontinues, players[consoleplayer].continues);
|
CV_StealthSetValue(&cv_dummycontinues, players[consoleplayer].continues);
|
||||||
M_SetupNextMenu(&SR_PandoraDef);
|
M_SetupNextMenu(&SR_PandoraDef);
|
||||||
|
@ -3839,7 +3827,7 @@ static void M_PandorasBox(INT32 choice)
|
||||||
|
|
||||||
static boolean M_ExitPandorasBox(void)
|
static boolean M_ExitPandorasBox(void)
|
||||||
{
|
{
|
||||||
if (cv_dummyrings.value != max(players[consoleplayer].health - 1, 0))
|
if (cv_dummyrings.value != max(players[consoleplayer].rings, 0))
|
||||||
COM_ImmedExecute(va("setrings %d", cv_dummyrings.value));
|
COM_ImmedExecute(va("setrings %d", cv_dummyrings.value));
|
||||||
if (cv_dummylives.value != players[consoleplayer].lives)
|
if (cv_dummylives.value != players[consoleplayer].lives)
|
||||||
COM_ImmedExecute(va("setlives %d", cv_dummylives.value));
|
COM_ImmedExecute(va("setlives %d", cv_dummylives.value));
|
||||||
|
|
21
src/m_misc.c
21
src/m_misc.c
|
@ -1617,6 +1617,11 @@ INT32 axtoi(const char *hexStg)
|
||||||
return intValue;
|
return intValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Token parser variables
|
||||||
|
|
||||||
|
static UINT32 oldendPos = 0; // old value of endPos, used by M_UnGetToken
|
||||||
|
static UINT32 endPos = 0; // now external to M_GetToken, but still static
|
||||||
|
|
||||||
/** Token parser for TEXTURES, ANIMDEFS, and potentially other lumps later down the line.
|
/** Token parser for TEXTURES, ANIMDEFS, and potentially other lumps later down the line.
|
||||||
* Was originally R_GetTexturesToken when I was coding up the TEXTURES parser, until I realized I needed it for ANIMDEFS too.
|
* Was originally R_GetTexturesToken when I was coding up the TEXTURES parser, until I realized I needed it for ANIMDEFS too.
|
||||||
* Parses up to the next whitespace character or comma. When finding the start of the next token, whitespace is skipped.
|
* Parses up to the next whitespace character or comma. When finding the start of the next token, whitespace is skipped.
|
||||||
|
@ -1631,7 +1636,7 @@ char *M_GetToken(const char *inputString)
|
||||||
{
|
{
|
||||||
static const char *stringToUse = NULL; // Populated if inputString != NULL; used otherwise
|
static const char *stringToUse = NULL; // Populated if inputString != NULL; used otherwise
|
||||||
static UINT32 startPos = 0;
|
static UINT32 startPos = 0;
|
||||||
static UINT32 endPos = 0;
|
// static UINT32 endPos = 0;
|
||||||
static UINT32 stringLength = 0;
|
static UINT32 stringLength = 0;
|
||||||
static UINT8 inComment = 0; // 0 = not in comment, 1 = // Single-line, 2 = /* Multi-line */
|
static UINT8 inComment = 0; // 0 = not in comment, 1 = // Single-line, 2 = /* Multi-line */
|
||||||
char *texturesToken = NULL;
|
char *texturesToken = NULL;
|
||||||
|
@ -1641,12 +1646,12 @@ char *M_GetToken(const char *inputString)
|
||||||
{
|
{
|
||||||
stringToUse = inputString;
|
stringToUse = inputString;
|
||||||
startPos = 0;
|
startPos = 0;
|
||||||
endPos = 0;
|
oldendPos = endPos = 0;
|
||||||
stringLength = strlen(inputString);
|
stringLength = strlen(inputString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
startPos = endPos;
|
startPos = oldendPos = endPos;
|
||||||
}
|
}
|
||||||
if (stringToUse == NULL)
|
if (stringToUse == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1777,6 +1782,16 @@ char *M_GetToken(const char *inputString)
|
||||||
return texturesToken;
|
return texturesToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Undoes the last M_GetToken call
|
||||||
|
* The current position along the string being parsed is reset to the last saved position.
|
||||||
|
* This exists mostly because of R_ParseTexture/R_ParsePatch honestly, but could be useful elsewhere?
|
||||||
|
* -Monster Iestyn (22/10/16)
|
||||||
|
*/
|
||||||
|
void M_UnGetToken(void)
|
||||||
|
{
|
||||||
|
endPos = oldendPos;
|
||||||
|
}
|
||||||
|
|
||||||
/** Count bits in a number.
|
/** Count bits in a number.
|
||||||
*/
|
*/
|
||||||
UINT8 M_CountBits(UINT32 num, UINT8 size)
|
UINT8 M_CountBits(UINT32 num, UINT8 size)
|
||||||
|
|
|
@ -269,6 +269,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void I_RegisterSysCommands(void) {}
|
void I_RegisterSysCommands(void) {}
|
||||||
|
|
||||||
#include "../sdl/dosstr.c"
|
#include "../sdl/dosstr.c"
|
||||||
|
|
177
src/p_enemy.c
177
src/p_enemy.c
|
@ -104,6 +104,9 @@ void A_BombShield(mobj_t *actor);
|
||||||
void A_WaterShield(mobj_t *actor);
|
void A_WaterShield(mobj_t *actor);
|
||||||
void A_ForceShield(mobj_t *actor);
|
void A_ForceShield(mobj_t *actor);
|
||||||
void A_PityShield(mobj_t *actor);
|
void A_PityShield(mobj_t *actor);
|
||||||
|
void A_FlameShield(mobj_t *actor);
|
||||||
|
void A_BubbleShield(mobj_t *actor);
|
||||||
|
void A_ThunderShield(mobj_t *actor);
|
||||||
void A_GravityBox(mobj_t *actor);
|
void A_GravityBox(mobj_t *actor);
|
||||||
void A_ScoreRise(mobj_t *actor);
|
void A_ScoreRise(mobj_t *actor);
|
||||||
void A_ParticleSpawn(mobj_t *actor);
|
void A_ParticleSpawn(mobj_t *actor);
|
||||||
|
@ -658,15 +661,15 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
|
||||||
if ((netgame || multiplayer) && player->spectator)
|
if ((netgame || multiplayer) && player->spectator)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (player->health <= 0)
|
|
||||||
continue; // dead
|
|
||||||
|
|
||||||
if (player->pflags & PF_INVIS)
|
if (player->pflags & PF_INVIS)
|
||||||
continue; // ignore notarget
|
continue; // ignore notarget
|
||||||
|
|
||||||
if (!player->mo || P_MobjWasRemoved(player->mo))
|
if (!player->mo || P_MobjWasRemoved(player->mo))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (player->mo->health <= 0)
|
||||||
|
continue; // dead
|
||||||
|
|
||||||
if (dist > 0
|
if (dist > 0
|
||||||
&& P_AproxDistance(P_AproxDistance(player->mo->x - actor->x, player->mo->y - actor->y), player->mo->z - actor->z) > dist)
|
&& P_AproxDistance(P_AproxDistance(player->mo->x - actor->x, player->mo->y - actor->y), player->mo->z - actor->z) > dist)
|
||||||
continue; // Too far away
|
continue; // Too far away
|
||||||
|
@ -730,7 +733,7 @@ static boolean P_LookForShield(mobj_t *actor)
|
||||||
|
|
||||||
player = &players[actor->lastlook];
|
player = &players[actor->lastlook];
|
||||||
|
|
||||||
if (player->health <= 0 || !player->mo)
|
if (!player->mo || player->mo->health <= 0)
|
||||||
continue; // dead
|
continue; // dead
|
||||||
|
|
||||||
//When in CTF, don't pull rings that you cannot pick up.
|
//When in CTF, don't pull rings that you cannot pick up.
|
||||||
|
@ -738,7 +741,7 @@ static boolean P_LookForShield(mobj_t *actor)
|
||||||
(actor->type == MT_BLUETEAMRING && player->ctfteam != 2))
|
(actor->type == MT_BLUETEAMRING && player->ctfteam != 2))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT
|
if ((player->powers[pw_shield] & SH_PROTECTELECTRIC)
|
||||||
&& (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST, player->mo->scale)))
|
&& (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST, player->mo->scale)))
|
||||||
{
|
{
|
||||||
P_SetTarget(&actor->tracer, player->mo);
|
P_SetTarget(&actor->tracer, player->mo);
|
||||||
|
@ -2553,6 +2556,7 @@ void A_1upThinker(mobj_t *actor)
|
||||||
{
|
{
|
||||||
P_SetTarget(&actor->tracer, P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY));
|
P_SetTarget(&actor->tracer, P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY));
|
||||||
P_SetTarget(&actor->tracer->target, actor);
|
P_SetTarget(&actor->tracer->target, actor);
|
||||||
|
actor->tracer->skin = &skins[players[closestplayer].skin]; // required here to prevent spr2 default showing stand for a single frame
|
||||||
P_SetMobjState(actor->tracer, actor->info->seestate);
|
P_SetMobjState(actor->tracer, actor->info->seestate);
|
||||||
|
|
||||||
// The overlay is going to be one tic early turning off and on
|
// The overlay is going to be one tic early turning off and on
|
||||||
|
@ -2813,7 +2817,7 @@ void A_BossDeath(mobj_t *mo)
|
||||||
|
|
||||||
// make sure there is a player alive for victory
|
// make sure there is a player alive for victory
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i] && (players[i].health > 0
|
if (playeringame[i] && ((players[i].mo && players[i].mo->health > 0)
|
||||||
|| ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0))))
|
|| ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0))))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3058,11 +3062,7 @@ void A_JumpShield(mobj_t *actor)
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) != SH_JUMP)
|
P_SwitchShield(player, SH_WHIRLWIND);
|
||||||
{
|
|
||||||
player->powers[pw_shield] = SH_JUMP|(player->powers[pw_shield] & SH_STACK);
|
|
||||||
P_SpawnShieldOrb(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
}
|
}
|
||||||
|
@ -3090,11 +3090,7 @@ void A_RingShield(mobj_t *actor)
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT)
|
P_SwitchShield(player, SH_ATTRACT);
|
||||||
{
|
|
||||||
player->powers[pw_shield] = SH_ATTRACT|(player->powers[pw_shield] & SH_STACK);
|
|
||||||
P_SpawnShieldOrb(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
}
|
}
|
||||||
|
@ -3291,11 +3287,12 @@ void A_BombShield(mobj_t *actor)
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) != SH_BOMB)
|
// If you already have a bomb shield, use it!
|
||||||
{
|
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON)
|
||||||
player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK);
|
P_BlackOw(player);
|
||||||
P_SpawnShieldOrb(player);
|
|
||||||
}
|
// Now we know for certain that we don't have a bomb shield, so add one. :3
|
||||||
|
P_SwitchShield(player, SH_ARMAGEDDON);
|
||||||
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
}
|
}
|
||||||
|
@ -3323,22 +3320,8 @@ void A_WaterShield(mobj_t *actor)
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL)
|
P_SwitchShield(player, SH_ELEMENTAL);
|
||||||
{
|
|
||||||
player->powers[pw_shield] = SH_ELEMENTAL|(player->powers[pw_shield] & SH_STACK);
|
|
||||||
P_SpawnShieldOrb(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1)
|
|
||||||
P_RestoreMusic(player);
|
|
||||||
|
|
||||||
player->powers[pw_underwater] = 0;
|
|
||||||
|
|
||||||
if (player->powers[pw_spacetime] > 1)
|
|
||||||
{
|
|
||||||
player->powers[pw_spacetime] = 0;
|
|
||||||
P_RestoreMusic(player);
|
|
||||||
}
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3346,12 +3329,13 @@ void A_WaterShield(mobj_t *actor)
|
||||||
//
|
//
|
||||||
// Description: Awards the player a force shield.
|
// Description: Awards the player a force shield.
|
||||||
//
|
//
|
||||||
// var1 = unused
|
// var1 = Number of additional hitpoints to give
|
||||||
// var2 = unused
|
// var2 = unused
|
||||||
//
|
//
|
||||||
void A_ForceShield(mobj_t *actor)
|
void A_ForceShield(mobj_t *actor)
|
||||||
{
|
{
|
||||||
player_t *player;
|
player_t *player;
|
||||||
|
INT32 locvar1 = var1;
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_ForceShield", actor))
|
if (LUA_CallAction("A_ForceShield", actor))
|
||||||
|
@ -3363,15 +3347,15 @@ void A_ForceShield(mobj_t *actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (locvar1 & ~SH_FORCEHP)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Invalid number of additional hitpoints.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if (!(player->powers[pw_shield] & SH_FORCE))
|
P_SwitchShield(player, SH_FORCE|locvar1);
|
||||||
{
|
|
||||||
player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01;
|
|
||||||
P_SpawnShieldOrb(player);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01;
|
|
||||||
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
}
|
}
|
||||||
|
@ -3403,12 +3387,92 @@ void A_PityShield(mobj_t *actor)
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)
|
P_SwitchShield(player, SH_PITY);
|
||||||
|
|
||||||
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function: A_FlameShield
|
||||||
|
//
|
||||||
|
// Description: Awards the player a flame shield.
|
||||||
|
//
|
||||||
|
// var1 = unused
|
||||||
|
// var2 = unused
|
||||||
|
//
|
||||||
|
void A_FlameShield(mobj_t *actor)
|
||||||
|
{
|
||||||
|
player_t *player;
|
||||||
|
|
||||||
|
#ifdef HAVE_BLUA
|
||||||
|
if (LUA_CallAction("A_FlameShield", actor))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
if (!actor->target || !actor->target->player)
|
||||||
{
|
{
|
||||||
player->powers[pw_shield] = SH_PITY+(player->powers[pw_shield] & SH_STACK);
|
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
|
||||||
P_SpawnShieldOrb(player);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player = actor->target->player;
|
||||||
|
|
||||||
|
P_SwitchShield(player, SH_FLAMEAURA);
|
||||||
|
|
||||||
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function: A_BubbleShield
|
||||||
|
//
|
||||||
|
// Description: Awards the player a bubble shield.
|
||||||
|
//
|
||||||
|
// var1 = unused
|
||||||
|
// var2 = unused
|
||||||
|
//
|
||||||
|
void A_BubbleShield(mobj_t *actor)
|
||||||
|
{
|
||||||
|
player_t *player;
|
||||||
|
|
||||||
|
#ifdef HAVE_BLUA
|
||||||
|
if (LUA_CallAction("A_BubbleShield", actor))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
if (!actor->target || !actor->target->player)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
player = actor->target->player;
|
||||||
|
|
||||||
|
P_SwitchShield(player, SH_BUBBLEWRAP);
|
||||||
|
|
||||||
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function: A_ThunderShield
|
||||||
|
//
|
||||||
|
// Description: Awards the player a thunder shield.
|
||||||
|
//
|
||||||
|
// var1 = unused
|
||||||
|
// var2 = unused
|
||||||
|
//
|
||||||
|
void A_ThunderShield(mobj_t *actor)
|
||||||
|
{
|
||||||
|
player_t *player;
|
||||||
|
|
||||||
|
#ifdef HAVE_BLUA
|
||||||
|
if (LUA_CallAction("A_ThunderShield", actor))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
if (!actor->target || !actor->target->player)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
player = actor->target->player;
|
||||||
|
|
||||||
|
P_SwitchShield(player, SH_THUNDERCOIN);
|
||||||
|
|
||||||
S_StartSound(player->mo, actor->info->seesound);
|
S_StartSound(player->mo, actor->info->seesound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3435,9 +3499,10 @@ void A_GravityBox(mobj_t *actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1);
|
|
||||||
|
|
||||||
S_StartSound(player, actor->info->activesound);
|
S_StartSound(player, actor->info->activesound);
|
||||||
|
|
||||||
|
player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function: A_ScoreRise
|
// Function: A_ScoreRise
|
||||||
|
@ -3703,7 +3768,7 @@ void A_AttractChase(mobj_t *actor)
|
||||||
|
|
||||||
// Turn flingrings back into regular rings if attracted.
|
// Turn flingrings back into regular rings if attracted.
|
||||||
if (actor->tracer && actor->tracer->player
|
if (actor->tracer && actor->tracer->player
|
||||||
&& (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime)
|
&& !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime)
|
||||||
{
|
{
|
||||||
mobj_t *newring;
|
mobj_t *newring;
|
||||||
newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime);
|
newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime);
|
||||||
|
@ -3908,7 +3973,7 @@ void A_ThrownRing(mobj_t *actor)
|
||||||
// A non-homing ring getting attracted by a
|
// A non-homing ring getting attracted by a
|
||||||
// magnetic player. If he gets too far away, make
|
// magnetic player. If he gets too far away, make
|
||||||
// sure to stop the attraction!
|
// sure to stop the attraction!
|
||||||
if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT
|
if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC)
|
||||||
&& P_AproxDistance(P_AproxDistance(actor->tracer->x-actor->x,
|
&& P_AproxDistance(P_AproxDistance(actor->tracer->x-actor->x,
|
||||||
actor->tracer->y-actor->y), actor->tracer->z-actor->z) > FixedMul(RING_DIST/4, actor->tracer->scale)))
|
actor->tracer->y-actor->y), actor->tracer->z-actor->z) > FixedMul(RING_DIST/4, actor->tracer->scale)))
|
||||||
{
|
{
|
||||||
|
@ -3916,7 +3981,7 @@ void A_ThrownRing(mobj_t *actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actor->tracer && (actor->tracer->health)
|
if (actor->tracer && (actor->tracer->health)
|
||||||
&& (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)// Already found someone to follow.
|
&& (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC))// Already found someone to follow.
|
||||||
{
|
{
|
||||||
const INT32 temp = actor->threshold;
|
const INT32 temp = actor->threshold;
|
||||||
actor->threshold = 32000;
|
actor->threshold = 32000;
|
||||||
|
@ -3984,7 +4049,7 @@ void A_ThrownRing(mobj_t *actor)
|
||||||
if (!P_CheckSight(actor, player->mo))
|
if (!P_CheckSight(actor, player->mo))
|
||||||
continue; // out of sight
|
continue; // out of sight
|
||||||
|
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT
|
if ((player->powers[pw_shield] & SH_PROTECTELECTRIC)
|
||||||
&& dist < FixedMul(RING_DIST/4, player->mo->scale))
|
&& dist < FixedMul(RING_DIST/4, player->mo->scale))
|
||||||
P_SetTarget(&actor->tracer, player->mo);
|
P_SetTarget(&actor->tracer, player->mo);
|
||||||
return;
|
return;
|
||||||
|
@ -8379,7 +8444,7 @@ void A_RingDrain(mobj_t *actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
player = actor->target->player;
|
player = actor->target->player;
|
||||||
P_GivePlayerRings(player, -min(locvar1, player->mo->health-1));
|
P_GivePlayerRings(player, -min(locvar1, player->rings));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function: A_SplitShot
|
// Function: A_SplitShot
|
||||||
|
@ -8687,7 +8752,7 @@ void A_CheckTargetRings(mobj_t *actor)
|
||||||
if (!(actor->target) || !(actor->target->player))
|
if (!(actor->target) || !(actor->target->player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (actor->target->player->health >= locvar1)
|
if (actor->target->player->rings >= locvar1)
|
||||||
P_SetMobjState(actor, locvar2);
|
P_SetMobjState(actor, locvar2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8709,7 +8774,7 @@ void A_CheckRings(mobj_t *actor)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
cntr += players[i].health-1;
|
cntr += players[i].rings;
|
||||||
|
|
||||||
if (cntr >= locvar1)
|
if (cntr >= locvar1)
|
||||||
P_SetMobjState(actor, locvar2);
|
P_SetMobjState(actor, locvar2);
|
||||||
|
@ -9281,7 +9346,7 @@ void A_ForceWin(mobj_t *actor)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (playeringame[i] && (players[i].health > 0
|
if (playeringame[i] && ((players[i].mo && players[i].mo->health > 0)
|
||||||
|| ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0))))
|
|| ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0))))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1748,12 +1748,15 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
|
||||||
case MT_GHOST:
|
case MT_GHOST:
|
||||||
case MT_OVERLAY:
|
case MT_OVERLAY:
|
||||||
case MT_EMERALDSPAWN:
|
case MT_EMERALDSPAWN:
|
||||||
case MT_GREENORB:
|
case MT_ELEMENTAL_ORB:
|
||||||
case MT_YELLOWORB:
|
case MT_ATTRACT_ORB:
|
||||||
case MT_BLUEORB:
|
case MT_FORCE_ORB:
|
||||||
case MT_BLACKORB:
|
case MT_ARMAGEDDON_ORB:
|
||||||
case MT_WHITEORB:
|
case MT_WHIRLWIND_ORB:
|
||||||
case MT_PITYORB:
|
case MT_PITY_ORB:
|
||||||
|
case MT_FLAMEAURA_ORB:
|
||||||
|
case MT_BUBBLEWRAP_ORB:
|
||||||
|
case MT_THUNDERCOIN_ORB:
|
||||||
case MT_IVSP:
|
case MT_IVSP:
|
||||||
case MT_SUPERSPARK:
|
case MT_SUPERSPARK:
|
||||||
case MT_RAIN:
|
case MT_RAIN:
|
||||||
|
@ -1782,8 +1785,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Ignore popped monitors, too.
|
// Ignore popped monitors, too.
|
||||||
if (node->m_thing->flags & MF_MONITOR
|
if (node->m_thing->health == 0 // this only really applies for monitors
|
||||||
&& node->m_thing->threshold == 68)
|
|| (!(node->m_thing->flags & MF_MONITOR) && (mobjinfo[node->m_thing->type].flags & MF_MONITOR))) // gold monitor support
|
||||||
continue;
|
continue;
|
||||||
// Okay, we found something valid.
|
// Okay, we found something valid.
|
||||||
if (!thing // take either the first thing
|
if (!thing // take either the first thing
|
||||||
|
@ -3156,15 +3159,15 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob
|
||||||
S_StartSound(puncher, sfx_mario9); // Puncher is "close enough"
|
S_StartSound(puncher, sfx_mario9); // Puncher is "close enough"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itsamonitor)
|
if (itsamonitor && thing)
|
||||||
{
|
{
|
||||||
P_UnsetThingPosition(tmthing);
|
P_UnsetThingPosition(thing);
|
||||||
tmthing->x = oldx;
|
thing->x = oldx;
|
||||||
tmthing->y = oldy;
|
thing->y = oldy;
|
||||||
tmthing->z = oldz;
|
thing->z = oldz;
|
||||||
tmthing->momx = 1;
|
thing->momx = 1;
|
||||||
tmthing->momy = 1;
|
thing->momy = 1;
|
||||||
P_SetThingPosition(tmthing);
|
P_SetThingPosition(thing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
396
src/p_inter.c
396
src/p_inter.c
|
@ -142,7 +142,10 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
|
||||||
if (player->bot && weapon)
|
if (player->bot && weapon)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics)
|
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (player->mo && player->mo->health <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -221,6 +224,65 @@ void P_DoNightsScore(player_t *player)
|
||||||
dummymo->destscale = 2*FRACUNIT;
|
dummymo->destscale = 2*FRACUNIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// P_DoMatchSuper
|
||||||
|
//
|
||||||
|
// Checks if you have all 7 pw_emeralds, then turns you "super". =P
|
||||||
|
//
|
||||||
|
void P_DoMatchSuper(player_t *player)
|
||||||
|
{
|
||||||
|
UINT16 match_emeralds = player->powers[pw_emeralds];
|
||||||
|
boolean doteams = false;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// If this gametype has teams, check every player on your team for emeralds.
|
||||||
|
if (G_GametypeHasTeams())
|
||||||
|
{
|
||||||
|
doteams = true;
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
if (players[i].ctfteam == player->ctfteam)
|
||||||
|
match_emeralds |= players[i].powers[pw_emeralds];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ALL7EMERALDS(match_emeralds))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Got 'em all? Turn "super"!
|
||||||
|
emeraldspawndelay = invulntics + 1;
|
||||||
|
player->powers[pw_emeralds] = 0;
|
||||||
|
player->powers[pw_invulnerability] = emeraldspawndelay;
|
||||||
|
player->powers[pw_sneakers] = emeraldspawndelay;
|
||||||
|
if (P_IsLocalPlayer(player) && !player->powers[pw_super])
|
||||||
|
{
|
||||||
|
S_StopMusic();
|
||||||
|
if (mariomode)
|
||||||
|
G_GhostAddColor(GHC_INVINCIBLE);
|
||||||
|
S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also steal 50 points from every enemy, sealing your victory.
|
||||||
|
P_StealPlayerScore(player, 50);
|
||||||
|
|
||||||
|
// In a team game?
|
||||||
|
// Check everyone else on your team for emeralds, and turn those helpful assisting players invincible too.
|
||||||
|
if (doteams)
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
if (playeringame[i] && players[i].ctfteam == player->ctfteam
|
||||||
|
&& players[i].powers[pw_emeralds] != 0)
|
||||||
|
{
|
||||||
|
players[i].powers[pw_emeralds] = 0;
|
||||||
|
player->powers[pw_invulnerability] = invulntics + 1;
|
||||||
|
player->powers[pw_sneakers] = player->powers[pw_invulnerability];
|
||||||
|
if (P_IsLocalPlayer(player) && !player->powers[pw_super])
|
||||||
|
{
|
||||||
|
S_StopMusic();
|
||||||
|
if (mariomode)
|
||||||
|
G_GhostAddColor(GHC_INVINCIBLE);
|
||||||
|
S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Takes action based on a ::MF_SPECIAL thing touched by a player.
|
/** Takes action based on a ::MF_SPECIAL thing touched by a player.
|
||||||
* Actually, this just checks a few things (heights, toucher->player, no
|
* Actually, this just checks a few things (heights, toucher->player, no
|
||||||
* objectplace, no dead or disappearing things)
|
* objectplace, no dead or disappearing things)
|
||||||
|
@ -237,6 +299,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
{
|
{
|
||||||
player_t *player;
|
player_t *player;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
UINT8 elementalpierce;
|
||||||
|
|
||||||
if (objectplacing)
|
if (objectplacing)
|
||||||
return;
|
return;
|
||||||
|
@ -291,6 +354,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// 0 = none, 1 = elemental pierce, 2 = bubble bounce
|
||||||
|
elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY)
|
||||||
|
? (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) ? 1 : 2)
|
||||||
|
: 0);
|
||||||
|
|
||||||
if (special->flags & MF_BOSS)
|
if (special->flags & MF_BOSS)
|
||||||
{
|
{
|
||||||
if (special->type == MT_BLACKEGGMAN)
|
if (special->type == MT_BLACKEGGMAN)
|
||||||
|
@ -300,14 +368,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||||
|| ((player->pflags & PF_JUMPED) && !(player->charflags & SF_NOJUMPDAMAGE && !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||||
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
||||||
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
||||||
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
||||||
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
|| player->powers[pw_invulnerability] || player->powers[pw_super]
|
||||||
|
|| elementalpierce) // Do you possess the ability to subdue the object?
|
||||||
{
|
{
|
||||||
if (P_MobjFlip(toucher)*toucher->momz < 0)
|
if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1))
|
||||||
|
{
|
||||||
|
if (elementalpierce == 2)
|
||||||
|
P_DoBubbleBounce(player);
|
||||||
|
else
|
||||||
toucher->momz = -toucher->momz;
|
toucher->momz = -toucher->momz;
|
||||||
|
}
|
||||||
toucher->momx = -toucher->momx;
|
toucher->momx = -toucher->momx;
|
||||||
toucher->momy = -toucher->momy;
|
toucher->momy = -toucher->momy;
|
||||||
P_DamageMobj(special, toucher, toucher, 1, 0);
|
P_DamageMobj(special, toucher, toucher, 1, 0);
|
||||||
|
@ -333,7 +407,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
/////ENEMIES!!//////////////////////////////////////////
|
/////ENEMIES!!//////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||||
|| player->powers[pw_invulnerability] || player->powers[pw_super])
|
|| player->powers[pw_invulnerability] || player->powers[pw_super] || elementalpierce)
|
||||||
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z)
|
&& toucher->z < special->z + special->height && toucher->z + toucher->height > special->z)
|
||||||
{
|
{
|
||||||
// Can only hit snapper from above
|
// Can only hit snapper from above
|
||||||
|
@ -346,14 +420,19 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
P_DamageMobj(toucher, special, special, 1, 0);
|
P_DamageMobj(toucher, special, special, 1, 0);
|
||||||
}
|
}
|
||||||
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||||
|| ((player->pflags & PF_JUMPED) && !(player->charflags & SF_NOJUMPDAMAGE && !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||||
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
||||||
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
|| (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
|
||||||
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
||||||
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
||||||
{
|
{
|
||||||
if (P_MobjFlip(toucher)*toucher->momz < 0)
|
if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1))
|
||||||
|
{
|
||||||
|
if (elementalpierce == 2)
|
||||||
|
P_DoBubbleBounce(player);
|
||||||
|
else
|
||||||
toucher->momz = -toucher->momz;
|
toucher->momz = -toucher->momz;
|
||||||
|
}
|
||||||
|
|
||||||
P_DamageMobj(special, toucher, toucher, 1, 0);
|
P_DamageMobj(special, toucher, toucher, 1, 0);
|
||||||
}
|
}
|
||||||
|
@ -445,7 +524,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
{
|
{
|
||||||
INT32 pindex = special->info->mass - (INT32)pw_infinityring;
|
INT32 pindex = special->info->mass - (INT32)pw_infinityring;
|
||||||
|
|
||||||
player->powers[special->info->mass] += (UINT16)special->info->reactiontime;
|
player->powers[special->info->mass] += (UINT16)special->reactiontime;
|
||||||
player->ringweapons |= 1 << (pindex-1);
|
player->ringweapons |= 1 << (pindex-1);
|
||||||
|
|
||||||
if (player->powers[special->info->mass] > rw_maximums[pindex])
|
if (player->powers[special->info->mass] > rw_maximums[pindex])
|
||||||
|
@ -532,7 +611,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (special->threshold)
|
if (special->threshold)
|
||||||
|
{
|
||||||
player->powers[pw_emeralds] |= special->info->speed;
|
player->powers[pw_emeralds] |= special->info->speed;
|
||||||
|
P_DoMatchSuper(player);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
emeralds |= special->info->speed;
|
emeralds |= special->info->speed;
|
||||||
|
|
||||||
|
@ -553,6 +635,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
player->powers[pw_emeralds] |= special->threshold;
|
player->powers[pw_emeralds] |= special->threshold;
|
||||||
|
P_DoMatchSuper(player);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Secret emblem thingy
|
// Secret emblem thingy
|
||||||
|
@ -814,16 +897,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
if (G_IsSpecialStage(gamemap) && !player->exiting)
|
if (G_IsSpecialStage(gamemap) && !player->exiting)
|
||||||
{ // In special stages, share rings. Everyone gives up theirs to the player who touched the capsule
|
{ // In special stages, share rings. Everyone gives up theirs to the player who touched the capsule
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i] && (&players[i] != player) && players[i].mo->health > 1)
|
if (playeringame[i] && (&players[i] != player) && players[i].rings > 0)
|
||||||
{
|
{
|
||||||
toucher->health += players[i].mo->health-1;
|
player->rings += players[i].rings;
|
||||||
player->health = toucher->health;
|
players[i].rings = 0;
|
||||||
players[i].mo->health = 1;
|
|
||||||
players[i].health = players[i].mo->health;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(player->health > 1) || player->exiting)
|
if (player->rings <= 0 || player->exiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Mark the player as 'pull into the capsule'
|
// Mark the player as 'pull into the capsule'
|
||||||
|
@ -1134,9 +1215,17 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
case MT_FIREFLOWER:
|
case MT_FIREFLOWER:
|
||||||
if (player->bot)
|
if (player->bot)
|
||||||
return;
|
return;
|
||||||
player->powers[pw_shield] |= SH_FIREFLOWER;
|
|
||||||
toucher->color = SKINCOLOR_WHITE;
|
S_StartSound(toucher, sfx_mario3);
|
||||||
|
|
||||||
|
player->powers[pw_shield] = (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER;
|
||||||
|
|
||||||
|
if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability])))
|
||||||
|
{
|
||||||
|
player->mo->color = SKINCOLOR_WHITE;
|
||||||
G_GhostAddColor(GHC_FIREFLOWER);
|
G_GhostAddColor(GHC_FIREFLOWER);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// *************** //
|
// *************** //
|
||||||
|
@ -1305,7 +1394,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING))
|
||||||
|| ((player->pflags & PF_JUMPED) && !(player->charflags & SF_NOJUMPDAMAGE))
|
|| ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY)))
|
||||||
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
|| ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0))
|
||||||
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
|| (player->pflags & (PF_SPINNING|PF_GLIDING))
|
||||||
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
|
||||||
|
@ -1380,7 +1469,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->powers[pw_invulnerability] || player->powers[pw_flashing]
|
if (player->powers[pw_invulnerability] || player->powers[pw_flashing]
|
||||||
|| (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds]))))
|
|| player->powers[pw_super])
|
||||||
return;
|
return;
|
||||||
if (player->powers[pw_shield] || player->bot) //If One-Hit Shield
|
if (player->powers[pw_shield] || player->bot) //If One-Hit Shield
|
||||||
{
|
{
|
||||||
|
@ -1390,11 +1479,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
P_PlayRinglossSound(toucher);
|
P_PlayRinglossSound(toucher);
|
||||||
if (toucher->health > 10)
|
if (player->rings >= 10)
|
||||||
toucher->health -= 10;
|
player->rings -= 10;
|
||||||
else
|
else
|
||||||
toucher->health = 1;
|
player->rings = 0;
|
||||||
player->health = toucher->health;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
P_DoPlayerPain(player, special, NULL);
|
P_DoPlayerPain(player, special, NULL);
|
||||||
|
@ -1418,7 +1506,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MT_EXTRALARGEBUBBLE:
|
case MT_EXTRALARGEBUBBLE:
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
|
if (player->powers[pw_shield] & SH_PROTECTWATER)
|
||||||
return;
|
return;
|
||||||
if (maptol & TOL_NIGHTS)
|
if (maptol & TOL_NIGHTS)
|
||||||
return;
|
return;
|
||||||
|
@ -1496,6 +1584,9 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
|
||||||
if (!player)
|
if (!player)
|
||||||
return; // Impossible!
|
return; // Impossible!
|
||||||
|
|
||||||
|
if (!player->mo)
|
||||||
|
return; // Also impossible!
|
||||||
|
|
||||||
if (player->spectator)
|
if (player->spectator)
|
||||||
return; // No messages for dying (crushed) spectators.
|
return; // No messages for dying (crushed) spectators.
|
||||||
|
|
||||||
|
@ -1503,11 +1594,11 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
|
||||||
return; // Presumably it's obvious what's happening in splitscreen.
|
return; // Presumably it's obvious what's happening in splitscreen.
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUAh_HurtMsg(player, inflictor, source))
|
if (LUAh_HurtMsg(player, inflictor, source, damagetype))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
deadtarget = (player->health <= 0);
|
deadtarget = (player->mo->health <= 0);
|
||||||
|
|
||||||
// Target's name
|
// Target's name
|
||||||
snprintf(targetname, sizeof(targetname), "%s%s%s",
|
snprintf(targetname, sizeof(targetname), "%s%s%s",
|
||||||
|
@ -1541,8 +1632,10 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
|
||||||
else switch (inflictor->type)
|
else switch (inflictor->type)
|
||||||
{
|
{
|
||||||
case MT_PLAYER:
|
case MT_PLAYER:
|
||||||
if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB)
|
if (damagetype == DMG_NUKE) // SH_ARMAGEDDON, armageddon shield
|
||||||
str = M_GetText("%s%s's armageddon blast %s %s.\n");
|
str = M_GetText("%s%s's armageddon blast %s %s.\n");
|
||||||
|
else if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (inflictor->player->pflags & PF_SHIELDABILITY))
|
||||||
|
str = M_GetText("%s%s's flame stomp %s %s.\n");
|
||||||
else if (inflictor->player->powers[pw_invulnerability])
|
else if (inflictor->player->powers[pw_invulnerability])
|
||||||
str = M_GetText("%s%s's invincibility aura %s %s.\n");
|
str = M_GetText("%s%s's invincibility aura %s %s.\n");
|
||||||
else if (inflictor->player->powers[pw_super])
|
else if (inflictor->player->powers[pw_super])
|
||||||
|
@ -1974,7 +2067,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
target->health = 0; // This makes it easy to check if something's dead elsewhere.
|
target->health = 0; // This makes it easy to check if something's dead elsewhere.
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUAh_MobjDeath(target, inflictor, source) || P_MobjWasRemoved(target))
|
if (LUAh_MobjDeath(target, inflictor, source, damagetype) || P_MobjWasRemoved(target))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2258,8 +2351,10 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MT_PLAYER:
|
case MT_PLAYER:
|
||||||
|
{
|
||||||
target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player)
|
target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player)
|
||||||
target->momx = target->momy = target->momz = 0;
|
target->momx = target->momy = target->momz = 0;
|
||||||
|
|
||||||
if (damagetype == DMG_DROWNED) // drowned
|
if (damagetype == DMG_DROWNED) // drowned
|
||||||
{
|
{
|
||||||
target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack.
|
target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack.
|
||||||
|
@ -2277,6 +2372,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
else
|
else
|
||||||
P_PlayDeathSound(target);
|
P_PlayDeathSound(target);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -2442,8 +2538,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
|
||||||
player_t *player = target->player;
|
player_t *player = target->player;
|
||||||
tic_t oldnightstime = player->nightstime;
|
tic_t oldnightstime = player->nightstime;
|
||||||
|
|
||||||
if (!player->powers[pw_flashing]
|
if (!player->powers[pw_flashing])
|
||||||
&& !(player->pflags & PF_GODMODE))
|
|
||||||
{
|
{
|
||||||
angle_t fa;
|
angle_t fa;
|
||||||
|
|
||||||
|
@ -2558,27 +2653,18 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target->health <= 1) // Death
|
if (player->rings > 0) // Ring loss
|
||||||
|
{
|
||||||
|
P_PlayRinglossSound(target);
|
||||||
|
P_PlayerRingBurst(player, player->rings);
|
||||||
|
}
|
||||||
|
else // Death
|
||||||
{
|
{
|
||||||
P_PlayDeathSound(target);
|
P_PlayDeathSound(target);
|
||||||
P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!!
|
P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!!
|
||||||
}
|
}
|
||||||
else if (target->health > 1) // Ring loss
|
|
||||||
{
|
|
||||||
P_PlayRinglossSound(target);
|
|
||||||
P_PlayerRingBurst(player, player->mo->health - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
|
|
||||||
{
|
|
||||||
player->health -= 10;
|
|
||||||
if (player->health < 2)
|
|
||||||
player->health = 2;
|
|
||||||
target->health = player->health;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
player->health = target->health = 1;
|
|
||||||
|
|
||||||
|
player->rings = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2629,7 +2715,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
||||||
// Burst weapons and emeralds in Match/CTF only
|
// Burst weapons and emeralds in Match/CTF only
|
||||||
if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF))
|
if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF))
|
||||||
{
|
{
|
||||||
P_PlayerRingBurst(player, player->health - 1);
|
P_PlayerRingBurst(player, player->rings);
|
||||||
P_PlayerEmeraldBurst(player, false);
|
P_PlayerEmeraldBurst(player, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2733,22 +2819,21 @@ void P_RemoveShield(player_t *player)
|
||||||
{
|
{
|
||||||
if (player->powers[pw_shield] & SH_FORCE)
|
if (player->powers[pw_shield] & SH_FORCE)
|
||||||
{ // Multi-hit
|
{ // Multi-hit
|
||||||
if ((player->powers[pw_shield] & 0xFF) == 0)
|
if (player->powers[pw_shield] & SH_FORCEHP)
|
||||||
player->powers[pw_shield] &= ~SH_FORCE;
|
|
||||||
else
|
|
||||||
player->powers[pw_shield]--;
|
player->powers[pw_shield]--;
|
||||||
|
else
|
||||||
|
player->powers[pw_shield] &= SH_STACK;
|
||||||
}
|
}
|
||||||
else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE)
|
else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE)
|
||||||
{ // Second layer shields
|
{ // Second layer shields
|
||||||
player->powers[pw_shield] = SH_NONE;
|
if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability])))
|
||||||
// Reset fireflower
|
|
||||||
if (!player->powers[pw_super])
|
|
||||||
{
|
{
|
||||||
player->mo->color = player->skincolor;
|
player->mo->color = player->skincolor;
|
||||||
G_GhostAddColor(GHC_NORMAL);
|
G_GhostAddColor(GHC_NORMAL);
|
||||||
}
|
}
|
||||||
|
player->powers[pw_shield] = SH_NONE;
|
||||||
}
|
}
|
||||||
else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) // Give them what's coming to them!
|
else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them!
|
||||||
{
|
{
|
||||||
P_BlackOw(player); // BAM!
|
P_BlackOw(player); // BAM!
|
||||||
player->pflags |= PF_JUMPDOWN;
|
player->pflags |= PF_JUMPDOWN;
|
||||||
|
@ -2757,7 +2842,7 @@ void P_RemoveShield(player_t *player)
|
||||||
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
|
player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
// Must do pain first to set flashing -- P_RemoveShield can cause damage
|
// Must do pain first to set flashing -- P_RemoveShield can cause damage
|
||||||
P_DoPlayerPain(player, source, inflictor);
|
P_DoPlayerPain(player, source, inflictor);
|
||||||
|
@ -2766,7 +2851,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
|
|
||||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||||
|
|
||||||
if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes
|
if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes
|
||||||
S_StartSound(player->mo, sfx_spkdth);
|
S_StartSound(player->mo, sfx_spkdth);
|
||||||
else
|
else
|
||||||
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
||||||
|
@ -2791,15 +2876,12 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
|
|
||||||
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
|
||||||
{
|
{
|
||||||
if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
|
|
||||||
{
|
|
||||||
P_DoPlayerPain(player, source, inflictor);
|
P_DoPlayerPain(player, source, inflictor);
|
||||||
|
|
||||||
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
|
||||||
|
|
||||||
if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes
|
if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes
|
||||||
S_StartSound(player->mo, sfx_spkdth);
|
S_StartSound(player->mo, sfx_spkdth);
|
||||||
}
|
|
||||||
|
|
||||||
if (source && source->player && !player->powers[pw_super]) //don't score points against super players
|
if (source && source->player && !player->powers[pw_super]) //don't score points against super players
|
||||||
{
|
{
|
||||||
|
@ -2821,6 +2903,10 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
|
||||||
|
|
||||||
// Ring loss sound plays despite hitting spikes
|
// Ring loss sound plays despite hitting spikes
|
||||||
P_PlayRinglossSound(player->mo); // Ringledingle!
|
P_PlayRinglossSound(player->mo); // Ringledingle!
|
||||||
|
P_PlayerRingBurst(player, damage);
|
||||||
|
player->rings -= damage;
|
||||||
|
if (player->rings < 0)
|
||||||
|
player->rings = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Damages an object, which may or may not be a player.
|
/** Damages an object, which may or may not be a player.
|
||||||
|
@ -2869,7 +2955,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
// Everything above here can't be forced.
|
// Everything above here can't be forced.
|
||||||
if (!metalrecording)
|
if (!metalrecording)
|
||||||
{
|
{
|
||||||
UINT8 shouldForce = LUAh_ShouldDamage(target, inflictor, source, damage);
|
UINT8 shouldForce = LUAh_ShouldDamage(target, inflictor, source, damage, damagetype);
|
||||||
if (P_MobjWasRemoved(target))
|
if (P_MobjWasRemoved(target))
|
||||||
return (shouldForce == 1); // mobj was removed
|
return (shouldForce == 1); // mobj was removed
|
||||||
if (shouldForce == 1)
|
if (shouldForce == 1)
|
||||||
|
@ -2912,7 +2998,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target))
|
if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2940,7 +3026,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target))
|
if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2950,7 +3036,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
else if (target->flags & MF_ENEMY)
|
else if (target->flags & MF_ENEMY)
|
||||||
{
|
{
|
||||||
if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target))
|
if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2964,18 +3050,24 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
if (player->exiting)
|
if (player->exiting)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (player->pflags & PF_GODMODE)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS))
|
if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch (damagetype)
|
switch (damagetype)
|
||||||
{
|
{
|
||||||
case DMG_WATER:
|
case DMG_WATER:
|
||||||
|
if (player->powers[pw_shield] & SH_PROTECTWATER)
|
||||||
|
return false; // Invincible to water damage
|
||||||
|
break;
|
||||||
case DMG_FIRE:
|
case DMG_FIRE:
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
|
if (player->powers[pw_shield] & SH_PROTECTFIRE)
|
||||||
return false; // Invincible to water/fire damage
|
return false; // Invincible to fire damage
|
||||||
break;
|
break;
|
||||||
case DMG_ELECTRIC:
|
case DMG_ELECTRIC:
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)
|
if (player->powers[pw_shield] & SH_PROTECTELECTRIC)
|
||||||
return false; // Invincible to electric damage
|
return false; // Invincible to electric damage
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2991,11 +3083,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false; // Don't hit yourself with your own paraloop, baka
|
return false; // Don't hit yourself with your own paraloop, baka
|
||||||
if (source && source->player && !cv_friendlyfire.value
|
if (source && source->player && !cv_friendlyfire.value
|
||||||
&& (gametype == GT_COOP
|
&& (gametype == GT_COOP
|
||||||
|| (G_GametypeHasTeams() && target->player->ctfteam == source->player->ctfteam)))
|
|| (G_GametypeHasTeams() && player->ctfteam == source->player->ctfteam)))
|
||||||
return false; // Don't run eachother over in special stages and team games and such
|
return false; // Don't run eachother over in special stages and team games and such
|
||||||
}
|
}
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUAh_MobjDamage(target, inflictor, source, damage))
|
if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
P_NiGHTSDamage(target, source); // -5s :(
|
P_NiGHTSDamage(target, source); // -5s :(
|
||||||
|
@ -3004,7 +3096,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
|
|
||||||
if (!force && inflictor && inflictor->flags & MF_FIRE)
|
if (!force && inflictor && inflictor->flags & MF_FIRE)
|
||||||
{
|
{
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
|
if (player->powers[pw_shield] & SH_PROTECTFIRE)
|
||||||
return false; // Invincible to fire objects
|
return false; // Invincible to fire objects
|
||||||
|
|
||||||
if (G_PlatformGametype() && inflictor && source && source->player)
|
if (G_PlatformGametype() && inflictor && source && source->player)
|
||||||
|
@ -3026,12 +3118,12 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!force && player->pflags & PF_GODMODE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Instant-Death
|
// Instant-Death
|
||||||
if (damagetype & DMG_DEATHMASK)
|
if (damagetype & DMG_DEATHMASK)
|
||||||
|
{
|
||||||
P_KillPlayer(player, source, damage);
|
P_KillPlayer(player, source, damage);
|
||||||
|
player->rings = 0;
|
||||||
|
}
|
||||||
else if (metalrecording)
|
else if (metalrecording)
|
||||||
{
|
{
|
||||||
if (!inflictor)
|
if (!inflictor)
|
||||||
|
@ -3045,19 +3137,19 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false; // Metal Sonic walk through flame !!
|
return false; // Metal Sonic walk through flame !!
|
||||||
else
|
else
|
||||||
{ // Oh no! Metal Sonic is hit !!
|
{ // Oh no! Metal Sonic is hit !!
|
||||||
P_ShieldDamage(player, inflictor, source, damage);
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (player->powers[pw_invulnerability] || player->powers[pw_flashing] // ignore bouncing & such in invulnerability
|
else if (player->powers[pw_invulnerability] || player->powers[pw_flashing] // ignore bouncing & such in invulnerability
|
||||||
|| (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player))))
|
|| player->powers[pw_super])
|
||||||
{
|
{
|
||||||
if (force || (inflictor && (inflictor->flags & MF_MISSILE)
|
if (force || (inflictor && (inflictor->flags & MF_MISSILE)
|
||||||
&& (inflictor->flags2 & MF2_SUPERFIRE)
|
&& (inflictor->flags2 & MF2_SUPERFIRE)
|
||||||
&& player->powers[pw_super]))
|
&& player->powers[pw_super]))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (!LUAh_MobjDamage(target, inflictor, source, damage))
|
if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
|
||||||
#endif
|
#endif
|
||||||
P_SuperDamage(player, inflictor, source, damage);
|
P_SuperDamage(player, inflictor, source, damage);
|
||||||
return true;
|
return true;
|
||||||
|
@ -3066,66 +3158,34 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
else if (LUAh_MobjDamage(target, inflictor, source, damage))
|
else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield
|
else if (player->powers[pw_shield] || player->bot) //If One-Hit Shield
|
||||||
{
|
{
|
||||||
P_ShieldDamage(player, inflictor, source, damage);
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
damage = 0;
|
damage = 0;
|
||||||
}
|
}
|
||||||
else if (player->mo->health > 1) // No shield but have rings.
|
else if (player->rings > 0) // No shield but have rings.
|
||||||
{
|
{
|
||||||
damage = player->mo->health - 1;
|
damage = player->rings;
|
||||||
P_RingDamage(player, inflictor, source, damage, damagetype);
|
P_RingDamage(player, inflictor, source, damage, damagetype);
|
||||||
|
damage = 0;
|
||||||
}
|
}
|
||||||
else // No shield, no rings, no invincibility.
|
|
||||||
{
|
|
||||||
// To reduce griefing potential, don't allow players to be killed
|
// To reduce griefing potential, don't allow players to be killed
|
||||||
// by friendly fire. Spilling their rings and other items is enough.
|
// by friendly fire. Spilling their rings and other items is enough.
|
||||||
if (force || !(G_GametypeHasTeams()
|
else if (!force && G_GametypeHasTeams()
|
||||||
&& source && source->player && (source->player->ctfteam == player->ctfteam)
|
&& source && source->player && (source->player->ctfteam == player->ctfteam)
|
||||||
&& cv_friendlyfire.value))
|
&& cv_friendlyfire.value)
|
||||||
|
{
|
||||||
|
damage = 0;
|
||||||
|
P_ShieldDamage(player, inflictor, source, damage, damagetype);
|
||||||
|
}
|
||||||
|
else // No shield, no rings, no invincibility.
|
||||||
{
|
{
|
||||||
damage = 1;
|
damage = 1;
|
||||||
P_KillPlayer(player, source, damage);
|
P_KillPlayer(player, source, damage);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
damage = 0;
|
|
||||||
P_ShieldDamage(player, inflictor, source, damage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
|
|
||||||
{
|
|
||||||
if (player->powers[pw_shield])
|
|
||||||
{
|
|
||||||
P_RemoveShield(player);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player->health -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500)));
|
|
||||||
if (player->health < 2)
|
|
||||||
player->health = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
|
||||||
P_PlayerFlagBurst(player, false);
|
|
||||||
}
|
|
||||||
else if (damagetype & DMG_DEATHMASK)
|
|
||||||
player->health = 0;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player->health -= damage; // mirror mobj health here
|
|
||||||
target->player->powers[pw_flashing] = flashingtics;
|
|
||||||
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
|
|
||||||
P_PlayerRingBurst(player, damage);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player->health < 0)
|
|
||||||
player->health = 0;
|
|
||||||
|
|
||||||
P_HitDeathMessages(player, inflictor, source, damagetype);
|
P_HitDeathMessages(player, inflictor, source, damagetype);
|
||||||
|
|
||||||
|
@ -3138,13 +3198,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
P_DamageMobj(source, target, target, 1, 0);
|
P_DamageMobj(source, target, target, 1, 0);
|
||||||
|
|
||||||
// do the damage
|
// do the damage
|
||||||
if (player && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player))
|
if (damagetype & DMG_DEATHMASK)
|
||||||
{
|
|
||||||
target->health -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500)));
|
|
||||||
if (target->health < 2)
|
|
||||||
target->health = 2;
|
|
||||||
}
|
|
||||||
else if (damagetype & DMG_DEATHMASK)
|
|
||||||
target->health = 0;
|
target->health = 0;
|
||||||
else
|
else
|
||||||
target->health -= damage;
|
target->health -= damage;
|
||||||
|
@ -3159,10 +3213,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player)
|
if (player)
|
||||||
{
|
|
||||||
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
|
|
||||||
P_ResetPlayer(target->player);
|
P_ResetPlayer(target->player);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
switch (target->type)
|
switch (target->type)
|
||||||
{
|
{
|
||||||
|
@ -3185,16 +3236,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
// if not intent on another player,
|
// if not intent on another player,
|
||||||
// chase after this one
|
// chase after this one
|
||||||
P_SetTarget(&target->target, source);
|
P_SetTarget(&target->target, source);
|
||||||
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
|
|
||||||
{
|
|
||||||
if (player)
|
|
||||||
{
|
|
||||||
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
|
|
||||||
P_SetPlayerMobjState(target, target->info->seestate);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
P_SetMobjState(target, target->info->seestate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -3220,7 +3261,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If no health, don't spawn ring!
|
// If no health, don't spawn ring!
|
||||||
if (player->mo->health <= 1)
|
if (player->rings <= 0)
|
||||||
num_rings = 0;
|
num_rings = 0;
|
||||||
|
|
||||||
if (num_rings > 32 && !(player->pflags & PF_NIGHTSFALL))
|
if (num_rings > 32 && !(player->pflags & PF_NIGHTSFALL))
|
||||||
|
@ -3230,11 +3271,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
||||||
P_PlayerEmeraldBurst(player, false);
|
P_PlayerEmeraldBurst(player, false);
|
||||||
|
|
||||||
// Spill weapons first
|
// Spill weapons first
|
||||||
if (player->ringweapons)
|
P_PlayerWeaponPanelOrAmmoBurst(player);
|
||||||
P_PlayerWeaponPanelBurst(player);
|
|
||||||
|
|
||||||
// Spill the ammo
|
|
||||||
P_PlayerWeaponAmmoBurst(player);
|
|
||||||
|
|
||||||
for (i = 0; i < num_rings; i++)
|
for (i = 0; i < num_rings; i++)
|
||||||
{
|
{
|
||||||
|
@ -3491,6 +3528,75 @@ void P_PlayerWeaponAmmoBurst(player_t *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void P_PlayerWeaponPanelOrAmmoBurst(player_t *player)
|
||||||
|
{
|
||||||
|
mobj_t *mo;
|
||||||
|
angle_t fa;
|
||||||
|
fixed_t ns;
|
||||||
|
INT32 i = 0;
|
||||||
|
fixed_t z;
|
||||||
|
|
||||||
|
#define SETUP_DROP(thingtype) \
|
||||||
|
z = player->mo->z; \
|
||||||
|
if (player->mo->eflags & MFE_VERTICALFLIP) \
|
||||||
|
z += player->mo->height - mobjinfo[thingtype].height; \
|
||||||
|
fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT)) & FINEMASK; \
|
||||||
|
ns = FixedMul(3*FRACUNIT, player->mo->scale); \
|
||||||
|
|
||||||
|
#define DROP_WEAPON(rwflag, pickup, ammo, power) \
|
||||||
|
if (player->ringweapons & rwflag) \
|
||||||
|
{ \
|
||||||
|
player->ringweapons &= ~rwflag; \
|
||||||
|
SETUP_DROP(pickup) \
|
||||||
|
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, pickup); \
|
||||||
|
mo->reactiontime = 0; \
|
||||||
|
mo->flags2 |= MF2_DONTRESPAWN; \
|
||||||
|
mo->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT); \
|
||||||
|
P_SetTarget(&mo->target, player->mo); \
|
||||||
|
mo->fuse = 12*TICRATE; \
|
||||||
|
mo->destscale = player->mo->scale; \
|
||||||
|
P_SetScale(mo, player->mo->scale); \
|
||||||
|
mo->momx = FixedMul(FINECOSINE(fa),ns); \
|
||||||
|
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) \
|
||||||
|
mo->momy = FixedMul(FINESINE(fa),ns); \
|
||||||
|
P_SetObjectMomZ(mo, 4*FRACUNIT, false); \
|
||||||
|
if (i & 1) \
|
||||||
|
P_SetObjectMomZ(mo, 4*FRACUNIT, true); \
|
||||||
|
++i; \
|
||||||
|
} \
|
||||||
|
else if (player->powers[power] > 0) \
|
||||||
|
{ \
|
||||||
|
SETUP_DROP(ammo) \
|
||||||
|
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, ammo); \
|
||||||
|
mo->health = player->powers[power]; \
|
||||||
|
mo->flags2 |= MF2_DONTRESPAWN; \
|
||||||
|
mo->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT); \
|
||||||
|
P_SetTarget(&mo->target, player->mo); \
|
||||||
|
mo->fuse = 12*TICRATE; \
|
||||||
|
mo->destscale = player->mo->scale; \
|
||||||
|
P_SetScale(mo, player->mo->scale); \
|
||||||
|
mo->momx = FixedMul(FINECOSINE(fa),ns); \
|
||||||
|
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) \
|
||||||
|
mo->momy = FixedMul(FINESINE(fa),ns); \
|
||||||
|
P_SetObjectMomZ(mo, 3*FRACUNIT, false); \
|
||||||
|
if (i & 1) \
|
||||||
|
P_SetObjectMomZ(mo, 3*FRACUNIT, true); \
|
||||||
|
player->powers[power] = 0; \
|
||||||
|
++i; \
|
||||||
|
}
|
||||||
|
|
||||||
|
DROP_WEAPON(RW_BOUNCE, MT_BOUNCEPICKUP, MT_BOUNCERING, pw_bouncering);
|
||||||
|
DROP_WEAPON(RW_RAIL, MT_RAILPICKUP, MT_RAILRING, pw_railring);
|
||||||
|
DROP_WEAPON(RW_AUTO, MT_AUTOPICKUP, MT_AUTOMATICRING, pw_automaticring);
|
||||||
|
DROP_WEAPON(RW_EXPLODE, MT_EXPLODEPICKUP, MT_EXPLOSIONRING, pw_explosionring);
|
||||||
|
DROP_WEAPON(RW_SCATTER, MT_SCATTERPICKUP, MT_SCATTERRING, pw_scatterring);
|
||||||
|
DROP_WEAPON(RW_GRENADE, MT_GRENADEPICKUP, MT_GRENADERING, pw_grenadering);
|
||||||
|
DROP_WEAPON(0, 0, MT_INFINITYRING, pw_infinityring);
|
||||||
|
|
||||||
|
#undef DROP_WEAPON
|
||||||
|
#undef SETUP_DROP
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_PlayerEmeraldBurst
|
// P_PlayerEmeraldBurst
|
||||||
//
|
//
|
||||||
|
|
|
@ -59,9 +59,10 @@
|
||||||
|
|
||||||
#define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK)
|
#define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK)
|
||||||
|
|
||||||
#define mariomode (maptol & TOL_MARIO)
|
|
||||||
#define twodlevel (maptol & TOL_2D)
|
#define twodlevel (maptol & TOL_2D)
|
||||||
|
|
||||||
|
#define mariomode (maptol & TOL_MARIO)
|
||||||
|
|
||||||
#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale)
|
#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale)
|
||||||
#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale)
|
#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale)
|
||||||
|
|
||||||
|
@ -124,6 +125,7 @@ extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
||||||
|
|
||||||
INT32 P_GetPlayerControlDirection(player_t *player);
|
INT32 P_GetPlayerControlDirection(player_t *player);
|
||||||
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
||||||
|
void P_StealPlayerScore(player_t *player, UINT32 amount);
|
||||||
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
||||||
boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
|
boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
|
||||||
void P_SlideCameraMove(camera_t *thiscam);
|
void P_SlideCameraMove(camera_t *thiscam);
|
||||||
|
@ -142,6 +144,7 @@ boolean P_InQuicksand(mobj_t *mo);
|
||||||
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
|
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
|
||||||
void P_RestoreMusic(player_t *player);
|
void P_RestoreMusic(player_t *player);
|
||||||
void P_SpawnShieldOrb(player_t *player);
|
void P_SpawnShieldOrb(player_t *player);
|
||||||
|
void P_SwitchShield(player_t *player, UINT16 shieldtype);
|
||||||
mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
|
mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
|
||||||
void P_GivePlayerRings(player_t *player, INT32 num_rings);
|
void P_GivePlayerRings(player_t *player, INT32 num_rings);
|
||||||
void P_GivePlayerLives(player_t *player, INT32 numlives);
|
void P_GivePlayerLives(player_t *player, INT32 numlives);
|
||||||
|
@ -151,8 +154,9 @@ void P_ResetScore(player_t *player);
|
||||||
boolean P_AutoPause(void);
|
boolean P_AutoPause(void);
|
||||||
|
|
||||||
void P_DoJumpShield(player_t *player);
|
void P_DoJumpShield(player_t *player);
|
||||||
|
void P_DoBubbleBounce(player_t *player);
|
||||||
void P_BlackOw(player_t *player);
|
void P_BlackOw(player_t *player);
|
||||||
void P_ElementalFireTrail(player_t *player);
|
void P_ElementalFire(player_t *player, boolean cropcircle);
|
||||||
|
|
||||||
void P_DoPityCheck(player_t *player);
|
void P_DoPityCheck(player_t *player);
|
||||||
void P_PlayerThink(player_t *player);
|
void P_PlayerThink(player_t *player);
|
||||||
|
@ -165,7 +169,7 @@ fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
|
||||||
fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move);
|
fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move);
|
||||||
void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
|
void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
|
||||||
|
|
||||||
boolean P_LookForEnemies(player_t *player);
|
boolean P_LookForEnemies(player_t *player, boolean nonenemies);
|
||||||
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
||||||
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
||||||
boolean P_SuperReady(player_t *player);
|
boolean P_SuperReady(player_t *player);
|
||||||
|
@ -211,6 +215,7 @@ void P_PrecipitationEffects(void);
|
||||||
void P_RemoveMobj(mobj_t *th);
|
void P_RemoveMobj(mobj_t *th);
|
||||||
boolean P_MobjWasRemoved(mobj_t *th);
|
boolean P_MobjWasRemoved(mobj_t *th);
|
||||||
void P_RemoveSavegameMobj(mobj_t *th);
|
void P_RemoveSavegameMobj(mobj_t *th);
|
||||||
|
UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2);
|
||||||
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
|
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
|
||||||
boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
|
boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
|
||||||
void P_RunShields(void);
|
void P_RunShields(void);
|
||||||
|
@ -380,7 +385,8 @@ typedef struct BasicFF_s
|
||||||
#define DMG_FIRE 2
|
#define DMG_FIRE 2
|
||||||
#define DMG_ELECTRIC 3
|
#define DMG_ELECTRIC 3
|
||||||
#define DMG_SPIKE 4
|
#define DMG_SPIKE 4
|
||||||
//#define DMG_SPECIALSTAGE 5
|
#define DMG_NUKE 5 // bomb shield
|
||||||
|
//#define DMG_SPECIALSTAGE 6
|
||||||
//// Death types - cannot be combined with damage types
|
//// Death types - cannot be combined with damage types
|
||||||
#define DMG_INSTAKILL 0x80
|
#define DMG_INSTAKILL 0x80
|
||||||
#define DMG_DROWNED 0x80+1
|
#define DMG_DROWNED 0x80+1
|
||||||
|
@ -399,6 +405,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c
|
void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c
|
||||||
void P_PlayerWeaponPanelBurst(player_t *player);
|
void P_PlayerWeaponPanelBurst(player_t *player);
|
||||||
void P_PlayerWeaponAmmoBurst(player_t *player);
|
void P_PlayerWeaponAmmoBurst(player_t *player);
|
||||||
|
void P_PlayerWeaponPanelOrAmmoBurst(player_t *player);
|
||||||
void P_PlayerEmeraldBurst(player_t *player, boolean toss);
|
void P_PlayerEmeraldBurst(player_t *player, boolean toss);
|
||||||
|
|
||||||
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
|
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
|
||||||
|
@ -413,6 +420,7 @@ void P_ResetStarposts(void);
|
||||||
|
|
||||||
boolean P_CanPickupItem(player_t *player, boolean weapon);
|
boolean P_CanPickupItem(player_t *player, boolean weapon);
|
||||||
void P_DoNightsScore(player_t *player);
|
void P_DoNightsScore(player_t *player);
|
||||||
|
void P_DoMatchSuper(player_t *player);
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_SPEC
|
// P_SPEC
|
||||||
|
|
42
src/p_map.c
42
src/p_map.c
|
@ -203,7 +203,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these.
|
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these.
|
||||||
jumping = object->player->jumping;
|
jumping = object->player->jumping;
|
||||||
secondjump = object->player->secondjump;
|
secondjump = object->player->secondjump;
|
||||||
P_ResetPlayer(object->player);
|
P_ResetPlayer(object->player);
|
||||||
|
@ -969,10 +969,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
{
|
{
|
||||||
if (G_RingSlingerGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
|
if (G_RingSlingerGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
|
||||||
{
|
{
|
||||||
if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super])
|
if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super] || (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY)))
|
||||||
&& !thing->player->powers[pw_super])
|
&& !thing->player->powers[pw_super])
|
||||||
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
|
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
|
||||||
else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super])
|
else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super] || (((thing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (thing->player->pflags & PF_SHIELDABILITY)))
|
||||||
&& !tmthing->player->powers[pw_super])
|
&& !tmthing->player->powers[pw_super])
|
||||||
P_DamageMobj(tmthing, thing, thing, 1, 0);
|
P_DamageMobj(tmthing, thing, thing, 1, 0);
|
||||||
}
|
}
|
||||||
|
@ -1052,24 +1052,41 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height
|
else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height
|
||||||
&& thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z)
|
&& thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z)
|
||||||
{
|
{
|
||||||
|
// 0 = none, 1 = elemental pierce, 2 = bubble bounce
|
||||||
|
UINT8 elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (tmthing->player->pflags & PF_SHIELDABILITY)
|
||||||
|
? (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) ? 1 : 2)
|
||||||
|
: 0);
|
||||||
if (thing->flags & MF_MONITOR
|
if (thing->flags & MF_MONITOR
|
||||||
&& (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING)
|
&& (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING)
|
||||||
|| ((tmthing->player->pflags & PF_JUMPED)
|
|| ((tmthing->player->pflags & PF_JUMPED)
|
||||||
&& !(tmthing->player->charflags & SF_NOJUMPDAMAGE
|
&& (tmthing->player->pflags & PF_FORCEJUMPDAMAGE
|
||||||
&& !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
|| !(tmthing->player->charflags & SF_NOJUMPSPIN)
|
||||||
|
|| (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
||||||
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
||||||
|| ((tmthing->player->charflags & SF_STOMPDAMAGE)
|
|| ((tmthing->player->charflags & SF_STOMPDAMAGE)
|
||||||
&& (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0))))
|
&& (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0))
|
||||||
|
|| elementalpierce))
|
||||||
{
|
{
|
||||||
|
player_t *player = tmthing->player;
|
||||||
SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed.
|
SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed.
|
||||||
fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;;
|
fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;;
|
||||||
|
fixed_t *z = &tmthing->z; // aau.
|
||||||
P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor
|
P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor
|
||||||
// Going down? Then bounce back up.
|
// Going down? Then bounce back up.
|
||||||
if ((P_MobjWasRemoved(thing) // Monitor was removed
|
if ((P_MobjWasRemoved(thing) // Monitor was removed
|
||||||
|| !thing->health) // or otherwise popped
|
|| !thing->health) // or otherwise popped
|
||||||
&& (flipval*(*momz) < 0)) // monitor is on the floor and you're going down, or on the ceiling and you're going up
|
&& (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up
|
||||||
|
&& (elementalpierce != 1)) // you're not piercing through the monitor...
|
||||||
|
{
|
||||||
|
if (elementalpierce == 2)
|
||||||
|
P_DoBubbleBounce(player);
|
||||||
|
else
|
||||||
*momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
|
*momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
|
||||||
|
}
|
||||||
|
if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough.
|
||||||
return false;
|
return false;
|
||||||
|
else
|
||||||
|
*z -= *momz; // to ensure proper collision.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1084,8 +1101,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
else if (thing->flags & MF_MONITOR && tmthing->player
|
else if (thing->flags & MF_MONITOR && tmthing->player
|
||||||
&& (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING)
|
&& (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING)
|
||||||
|| ((tmthing->player->pflags & PF_JUMPED)
|
|| ((tmthing->player->pflags & PF_JUMPED)
|
||||||
&& !(tmthing->player->charflags & SF_NOJUMPDAMAGE
|
&& (tmthing->player->pflags & PF_FORCEJUMPDAMAGE
|
||||||
&& !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
|| !(tmthing->player->charflags & SF_NOJUMPSPIN)
|
||||||
|
|| (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
||||||
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
||||||
|| ((tmthing->player->charflags & SF_STOMPDAMAGE)
|
|| ((tmthing->player->charflags & SF_STOMPDAMAGE)
|
||||||
&& (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)))
|
&& (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)))
|
||||||
|
@ -1124,6 +1142,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (tmthing->player && tmthing->z + tmthing->height > topz
|
if (tmthing->player && tmthing->z + tmthing->height > topz
|
||||||
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
||||||
{
|
{
|
||||||
|
if (thing->flags & MF_GRENADEBOUNCE && (thing->flags & MF_MONITOR || thing->flags2 & MF2_STANDONME)) // Gold monitor hack...
|
||||||
|
return false;
|
||||||
|
|
||||||
tmfloorz = tmceilingz = INT32_MIN; // block while in air
|
tmfloorz = tmceilingz = INT32_MIN; // block while in air
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
tmceilingslope = NULL;
|
tmceilingslope = NULL;
|
||||||
|
@ -1167,6 +1188,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (tmthing->player && tmthing->z < topz
|
if (tmthing->player && tmthing->z < topz
|
||||||
&& tmthing->z > tmthing->floorz)
|
&& tmthing->z > tmthing->floorz)
|
||||||
{
|
{
|
||||||
|
if (thing->flags & MF_GRENADEBOUNCE && (thing->flags & MF_MONITOR || thing->flags2 & MF2_STANDONME)) // Gold monitor hack...
|
||||||
|
return false;
|
||||||
|
|
||||||
tmfloorz = tmceilingz = INT32_MAX; // block while in air
|
tmfloorz = tmceilingz = INT32_MAX; // block while in air
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
tmfloorslope = NULL;
|
tmfloorslope = NULL;
|
||||||
|
|
760
src/p_mobj.c
760
src/p_mobj.c
File diff suppressed because it is too large
Load diff
|
@ -193,6 +193,7 @@ typedef enum
|
||||||
MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
|
MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.)
|
||||||
MF2_AMBUSH = 1<<27, // Alternate behaviour typically set by MTF_AMBUSH
|
MF2_AMBUSH = 1<<27, // Alternate behaviour typically set by MTF_AMBUSH
|
||||||
MF2_LINKDRAW = 1<<28, // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position)
|
MF2_LINKDRAW = 1<<28, // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position)
|
||||||
|
MF2_SHIELD = 1<<29, // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use)
|
||||||
// free: to and including 1<<31
|
// free: to and including 1<<31
|
||||||
} mobjflag2_t;
|
} mobjflag2_t;
|
||||||
|
|
||||||
|
@ -453,5 +454,6 @@ void P_EmeraldManager(void);
|
||||||
extern mapthing_t *huntemeralds[MAXHUNTEMERALDS];
|
extern mapthing_t *huntemeralds[MAXHUNTEMERALDS];
|
||||||
extern INT32 numhuntemeralds;
|
extern INT32 numhuntemeralds;
|
||||||
extern boolean runemeraldmanager;
|
extern boolean runemeraldmanager;
|
||||||
|
extern UINT16 emeraldspawndelay;
|
||||||
extern INT32 numstarposts;
|
extern INT32 numstarposts;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -128,7 +128,7 @@ static void P_NetArchivePlayers(void)
|
||||||
WRITEANGLE(save_p, players[i].aiming);
|
WRITEANGLE(save_p, players[i].aiming);
|
||||||
WRITEANGLE(save_p, players[i].awayviewaiming);
|
WRITEANGLE(save_p, players[i].awayviewaiming);
|
||||||
WRITEINT32(save_p, players[i].awayviewtics);
|
WRITEINT32(save_p, players[i].awayviewtics);
|
||||||
WRITEINT32(save_p, players[i].health);
|
WRITEINT32(save_p, players[i].rings);
|
||||||
|
|
||||||
WRITESINT8(save_p, players[i].pity);
|
WRITESINT8(save_p, players[i].pity);
|
||||||
WRITEINT32(save_p, players[i].currentweapon);
|
WRITEINT32(save_p, players[i].currentweapon);
|
||||||
|
@ -308,7 +308,7 @@ static void P_NetUnArchivePlayers(void)
|
||||||
players[i].aiming = READANGLE(save_p);
|
players[i].aiming = READANGLE(save_p);
|
||||||
players[i].awayviewaiming = READANGLE(save_p);
|
players[i].awayviewaiming = READANGLE(save_p);
|
||||||
players[i].awayviewtics = READINT32(save_p);
|
players[i].awayviewtics = READINT32(save_p);
|
||||||
players[i].health = READINT32(save_p);
|
players[i].rings = READINT32(save_p);
|
||||||
|
|
||||||
players[i].pity = READSINT8(save_p);
|
players[i].pity = READSINT8(save_p);
|
||||||
players[i].currentweapon = READINT32(save_p);
|
players[i].currentweapon = READINT32(save_p);
|
||||||
|
|
|
@ -2087,6 +2087,7 @@ static void P_LevelInitStuff(void)
|
||||||
// special stage tokens, emeralds, and ring total
|
// special stage tokens, emeralds, and ring total
|
||||||
tokenbits = 0;
|
tokenbits = 0;
|
||||||
runemeraldmanager = false;
|
runemeraldmanager = false;
|
||||||
|
emeraldspawndelay = 60*TICRATE;
|
||||||
nummaprings = 0;
|
nummaprings = 0;
|
||||||
|
|
||||||
// emerald hunt
|
// emerald hunt
|
||||||
|
@ -2129,7 +2130,7 @@ static void P_LevelInitStuff(void)
|
||||||
players[i].gotcontinue = false;
|
players[i].gotcontinue = false;
|
||||||
|
|
||||||
players[i].xtralife = players[i].deadtimer = players[i].numboxes = players[i].totalring = players[i].laps = 0;
|
players[i].xtralife = players[i].deadtimer = players[i].numboxes = players[i].totalring = players[i].laps = 0;
|
||||||
players[i].health = 1;
|
players[i].rings = 0;
|
||||||
players[i].aiming = 0;
|
players[i].aiming = 0;
|
||||||
players[i].pflags &= ~PF_TIMEOVER;
|
players[i].pflags &= ~PF_TIMEOVER;
|
||||||
|
|
||||||
|
@ -2586,7 +2587,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
lastloadedmaplumpnum = W_GetNumForName(maplumpname = G_BuildMapName(gamemap));
|
lastloadedmaplumpnum = W_GetNumForName(maplumpname = G_BuildMapName(gamemap));
|
||||||
|
|
||||||
R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette);
|
R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette);
|
||||||
CON_ReSetupBackColormap(mapheaderinfo[gamemap-1]->palette);
|
CON_SetupBackColormap();
|
||||||
|
|
||||||
// SRB2 determines the sky texture to be used depending on the map header.
|
// SRB2 determines the sky texture to be used depending on the map header.
|
||||||
P_SetupLevelSky(mapheaderinfo[gamemap-1]->skynum, true);
|
P_SetupLevelSky(mapheaderinfo[gamemap-1]->skynum, true);
|
||||||
|
|
24
src/p_spec.c
24
src/p_spec.c
|
@ -1621,10 +1621,10 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
||||||
if (!playeringame[i] || players[i].spectator)
|
if (!playeringame[i] || players[i].spectator)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!players[i].mo || players[i].mo->health < 1)
|
if (!players[i].mo || players[i].rings <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rings += players[i].mo->health-1;
|
rings += players[i].rings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1632,7 +1632,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
||||||
if (!(actor && actor->player))
|
if (!(actor && actor->player))
|
||||||
return false; // no player to count rings from here, sorry
|
return false; // no player to count rings from here, sorry
|
||||||
|
|
||||||
rings = actor->health-1;
|
rings = actor->player->rings;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerline->flags & ML_NOCLIMB)
|
if (triggerline->flags & ML_NOCLIMB)
|
||||||
|
@ -3548,10 +3548,9 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||||
break;
|
break;
|
||||||
case 9: // Ring Drainer (Floor Touch)
|
case 9: // Ring Drainer (Floor Touch)
|
||||||
case 10: // Ring Drainer (No Floor Touch)
|
case 10: // Ring Drainer (No Floor Touch)
|
||||||
if (leveltime % (TICRATE/2) == 0 && player->mo->health > 1)
|
if (leveltime % (TICRATE/2) == 0 && player->rings > 0)
|
||||||
{
|
{
|
||||||
player->mo->health--;
|
player->rings--;
|
||||||
player->health--;
|
|
||||||
S_StartSound(player->mo, sfx_itemup);
|
S_StartSound(player->mo, sfx_itemup);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3559,7 +3558,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||||
if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super] || player->exiting || player->bot)
|
if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super] || player->exiting || player->bot)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(player->powers[pw_shield] || player->mo->health > 1)) // Don't do anything if no shield or rings anyway
|
if (!(player->powers[pw_shield] || player->rings > 0)) // Don't do anything if no shield or rings anyway
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (player->powers[pw_shield])
|
if (player->powers[pw_shield])
|
||||||
|
@ -3567,14 +3566,13 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||||
P_RemoveShield(player);
|
P_RemoveShield(player);
|
||||||
S_StartSound(player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
S_StartSound(player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
||||||
}
|
}
|
||||||
else if (player->mo->health > 1)
|
else if (player->rings > 0)
|
||||||
{
|
{
|
||||||
P_PlayRinglossSound(player->mo);
|
P_PlayRinglossSound(player->mo);
|
||||||
if (player->mo->health > 10)
|
if (player->rings >= 10)
|
||||||
player->mo->health -= 10;
|
player->rings -= 10;
|
||||||
else
|
else
|
||||||
player->mo->health = 1;
|
player->rings = 0;
|
||||||
player->health = player->mo->health;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
P_DoPlayerPain(player, NULL, NULL); // this does basically everything that was here before
|
P_DoPlayerPain(player, NULL, NULL); // this does basically everything that was here before
|
||||||
|
@ -3583,7 +3581,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||||
P_PlayerFlagBurst(player, false);
|
P_PlayerFlagBurst(player, false);
|
||||||
break;
|
break;
|
||||||
case 12: // Space Countdown
|
case 12: // Space Countdown
|
||||||
if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL && !player->powers[pw_spacetime])
|
if (!(player->powers[pw_shield] & SH_PROTECTWATER) && !player->powers[pw_spacetime])
|
||||||
player->powers[pw_spacetime] = spacetimetics + 1;
|
player->powers[pw_spacetime] = spacetimetics + 1;
|
||||||
break;
|
break;
|
||||||
case 13: // Ramp Sector (Increase step-up/down)
|
case 13: // Ramp Sector (Increase step-up/down)
|
||||||
|
|
|
@ -469,7 +469,7 @@ static inline void P_DoSpecialStageStuff(void)
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i])
|
if (playeringame[i])
|
||||||
{
|
{
|
||||||
ssrings += (players[i].mo->health-1);
|
ssrings += players[i].rings;
|
||||||
|
|
||||||
// If in water, deplete timer 6x as fast.
|
// If in water, deplete timer 6x as fast.
|
||||||
if ((players[i].mo->eflags & MFE_TOUCHWATER)
|
if ((players[i].mo->eflags & MFE_TOUCHWATER)
|
||||||
|
|
703
src/p_user.c
703
src/p_user.c
File diff suppressed because it is too large
Load diff
108
src/r_data.c
108
src/r_data.c
|
@ -160,6 +160,7 @@ static inline void R_DrawColumnInCache(column_t *patch, UINT8 *cache, INT32 orig
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
{
|
{
|
||||||
count += position;
|
count += position;
|
||||||
|
source -= position; // start further down the column
|
||||||
position = 0;
|
position = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +174,44 @@ static inline void R_DrawColumnInCache(column_t *patch, UINT8 *cache, INT32 orig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void R_DrawFlippedColumnInCache(column_t *patch, UINT8 *cache, INT32 originy, INT32 cacheheight, INT32 patchheight)
|
||||||
|
{
|
||||||
|
INT32 count, position;
|
||||||
|
UINT8 *source, *dest;
|
||||||
|
INT32 topdelta, prevdelta = -1;
|
||||||
|
|
||||||
|
while (patch->topdelta != 0xff)
|
||||||
|
{
|
||||||
|
topdelta = patch->topdelta;
|
||||||
|
if (topdelta <= prevdelta)
|
||||||
|
topdelta += prevdelta;
|
||||||
|
prevdelta = topdelta;
|
||||||
|
topdelta = patchheight-patch->length-topdelta;
|
||||||
|
source = (UINT8 *)patch + 2 + patch->length; // patch + 3 + (patch->length-1)
|
||||||
|
count = patch->length;
|
||||||
|
position = originy + topdelta;
|
||||||
|
|
||||||
|
if (position < 0)
|
||||||
|
{
|
||||||
|
count += position;
|
||||||
|
source += position; // start further UP the column
|
||||||
|
position = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position + count > cacheheight)
|
||||||
|
count = cacheheight - position;
|
||||||
|
|
||||||
|
dest = cache + position;
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
for (; dest < cache + position + count; --source)
|
||||||
|
*dest++ = *source;
|
||||||
|
}
|
||||||
|
|
||||||
|
patch = (column_t *)((UINT8 *)patch + patch->length + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_GenerateTexture
|
// R_GenerateTexture
|
||||||
//
|
//
|
||||||
|
@ -191,7 +230,7 @@ static UINT8 *R_GenerateTexture(size_t texnum)
|
||||||
texture_t *texture;
|
texture_t *texture;
|
||||||
texpatch_t *patch;
|
texpatch_t *patch;
|
||||||
patch_t *realpatch;
|
patch_t *realpatch;
|
||||||
int x, x1, x2, i;
|
int x, x1, x2, i, width, height;
|
||||||
size_t blocksize;
|
size_t blocksize;
|
||||||
column_t *patchcol;
|
column_t *patchcol;
|
||||||
UINT32 *colofs;
|
UINT32 *colofs;
|
||||||
|
@ -239,6 +278,7 @@ static UINT8 *R_GenerateTexture(size_t texnum)
|
||||||
if (holey)
|
if (holey)
|
||||||
{
|
{
|
||||||
texture->holes = true;
|
texture->holes = true;
|
||||||
|
texture->flip = patch->flip;
|
||||||
blocksize = W_LumpLengthPwad(patch->wad, patch->lump);
|
blocksize = W_LumpLengthPwad(patch->wad, patch->lump);
|
||||||
block = Z_Calloc(blocksize, PU_STATIC, // will change tag at end of this function
|
block = Z_Calloc(blocksize, PU_STATIC, // will change tag at end of this function
|
||||||
&texturecache[texnum]);
|
&texturecache[texnum]);
|
||||||
|
@ -249,6 +289,14 @@ static UINT8 *R_GenerateTexture(size_t texnum)
|
||||||
colofs = (UINT32 *)(void *)(block + 8);
|
colofs = (UINT32 *)(void *)(block + 8);
|
||||||
texturecolumnofs[texnum] = colofs;
|
texturecolumnofs[texnum] = colofs;
|
||||||
blocktex = block;
|
blocktex = block;
|
||||||
|
if (patch->flip & 1) // flip the patch horizontally
|
||||||
|
{
|
||||||
|
UINT32 *realcolofs = (UINT32 *)realpatch->columnofs;
|
||||||
|
for (x = 0; x < texture->width; x++)
|
||||||
|
colofs[x] = realcolofs[texture->width-1-x]; // swap with the offset of the other side of the texture
|
||||||
|
}
|
||||||
|
// we can't as easily flip the patch vertically sadly though,
|
||||||
|
// we have wait until the texture itself is drawn to do that
|
||||||
for (x = 0; x < texture->width; x++)
|
for (x = 0; x < texture->width; x++)
|
||||||
colofs[x] = LONG(LONG(colofs[x]) + 3);
|
colofs[x] = LONG(LONG(colofs[x]) + 3);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -259,11 +307,12 @@ static UINT8 *R_GenerateTexture(size_t texnum)
|
||||||
|
|
||||||
// multi-patch textures (or 'composite')
|
// multi-patch textures (or 'composite')
|
||||||
texture->holes = false;
|
texture->holes = false;
|
||||||
|
texture->flip = 0;
|
||||||
blocksize = (texture->width * 4) + (texture->width * texture->height);
|
blocksize = (texture->width * 4) + (texture->width * texture->height);
|
||||||
texturememory += blocksize;
|
texturememory += blocksize;
|
||||||
block = Z_Malloc(blocksize+1, PU_STATIC, &texturecache[texnum]);
|
block = Z_Malloc(blocksize+1, PU_STATIC, &texturecache[texnum]);
|
||||||
|
|
||||||
memset(block, 0xF7, blocksize+1); // Transparency hack
|
memset(block, 0xFF, blocksize+1); // Transparency hack
|
||||||
|
|
||||||
// columns lookup table
|
// columns lookup table
|
||||||
colofs = (UINT32 *)(void *)block;
|
colofs = (UINT32 *)(void *)block;
|
||||||
|
@ -277,7 +326,9 @@ static UINT8 *R_GenerateTexture(size_t texnum)
|
||||||
{
|
{
|
||||||
realpatch = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE);
|
realpatch = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE);
|
||||||
x1 = patch->originx;
|
x1 = patch->originx;
|
||||||
x2 = x1 + SHORT(realpatch->width);
|
width = SHORT(realpatch->width);
|
||||||
|
height = SHORT(realpatch->height);
|
||||||
|
x2 = x1 + width;
|
||||||
|
|
||||||
if (x1 < 0)
|
if (x1 < 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
|
@ -289,10 +340,16 @@ static UINT8 *R_GenerateTexture(size_t texnum)
|
||||||
|
|
||||||
for (; x < x2; x++)
|
for (; x < x2; x++)
|
||||||
{
|
{
|
||||||
|
if (patch->flip & 1)
|
||||||
|
patchcol = (column_t *)((UINT8 *)realpatch + LONG(realpatch->columnofs[(x1+width-1)-x]));
|
||||||
|
else
|
||||||
patchcol = (column_t *)((UINT8 *)realpatch + LONG(realpatch->columnofs[x-x1]));
|
patchcol = (column_t *)((UINT8 *)realpatch + LONG(realpatch->columnofs[x-x1]));
|
||||||
|
|
||||||
// generate column ofset lookup
|
// generate column ofset lookup
|
||||||
colofs[x] = LONG((x * texture->height) + (texture->width*4));
|
colofs[x] = LONG((x * texture->height) + (texture->width*4));
|
||||||
|
if (patch->flip & 2)
|
||||||
|
R_DrawFlippedColumnInCache(patchcol, block + LONG(colofs[x]), patch->originy, texture->height, height);
|
||||||
|
else
|
||||||
R_DrawColumnInCache(patchcol, block + LONG(colofs[x]), patch->originy, texture->height);
|
R_DrawColumnInCache(patchcol, block + LONG(colofs[x]), patch->originy, texture->height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -469,6 +526,7 @@ void R_LoadTextures(void)
|
||||||
texture->height = SHORT(patchlump->height)*patchcount;
|
texture->height = SHORT(patchlump->height)*patchcount;
|
||||||
texture->patchcount = patchcount;
|
texture->patchcount = patchcount;
|
||||||
texture->holes = false;
|
texture->holes = false;
|
||||||
|
texture->flip = 0;
|
||||||
|
|
||||||
// Allocate information for the texture's patches.
|
// Allocate information for the texture's patches.
|
||||||
for (k = 0; k < patchcount; k++)
|
for (k = 0; k < patchcount; k++)
|
||||||
|
@ -479,6 +537,7 @@ void R_LoadTextures(void)
|
||||||
patch->originy = (INT16)(k*patchlump->height);
|
patch->originy = (INT16)(k*patchlump->height);
|
||||||
patch->wad = (UINT16)w;
|
patch->wad = (UINT16)w;
|
||||||
patch->lump = texstart + j;
|
patch->lump = texstart + j;
|
||||||
|
patch->flip = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Unlock(patchlump);
|
Z_Unlock(patchlump);
|
||||||
|
@ -502,6 +561,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||||
char *patchName = NULL;
|
char *patchName = NULL;
|
||||||
INT16 patchXPos;
|
INT16 patchXPos;
|
||||||
INT16 patchYPos;
|
INT16 patchYPos;
|
||||||
|
UINT8 flip = 0;
|
||||||
texpatch_t *resultPatch = NULL;
|
texpatch_t *resultPatch = NULL;
|
||||||
lumpnum_t patchLumpNum;
|
lumpnum_t patchLumpNum;
|
||||||
|
|
||||||
|
@ -598,6 +658,47 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||||
}
|
}
|
||||||
Z_Free(texturesToken);
|
Z_Free(texturesToken);
|
||||||
|
|
||||||
|
// Patch parameters block (OPTIONAL)
|
||||||
|
// added by Monster Iestyn (22/10/16)
|
||||||
|
|
||||||
|
// Left Curly Brace
|
||||||
|
texturesToken = M_GetToken(NULL);
|
||||||
|
if (texturesToken == NULL)
|
||||||
|
; // move on and ignore, R_ParseTextures will deal with this
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (strcmp(texturesToken,"{")==0)
|
||||||
|
{
|
||||||
|
Z_Free(texturesToken);
|
||||||
|
texturesToken = M_GetToken(NULL);
|
||||||
|
if (texturesToken == NULL)
|
||||||
|
{
|
||||||
|
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s parameters should be",patchName);
|
||||||
|
}
|
||||||
|
while (strcmp(texturesToken,"}")!=0)
|
||||||
|
{
|
||||||
|
if (stricmp(texturesToken, "FLIPX")==0)
|
||||||
|
flip |= 1;
|
||||||
|
else if (stricmp(texturesToken, "FLIPY")==0)
|
||||||
|
flip |= 2;
|
||||||
|
Z_Free(texturesToken);
|
||||||
|
|
||||||
|
texturesToken = M_GetToken(NULL);
|
||||||
|
if (texturesToken == NULL)
|
||||||
|
{
|
||||||
|
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s parameters or right curly brace should be",patchName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// this is not what we wanted...
|
||||||
|
// undo last read so R_ParseTextures can re-get the token for its own purposes
|
||||||
|
M_UnGetToken();
|
||||||
|
}
|
||||||
|
Z_Free(texturesToken);
|
||||||
|
}
|
||||||
|
|
||||||
if (actuallyLoadPatch == true)
|
if (actuallyLoadPatch == true)
|
||||||
{
|
{
|
||||||
// Check lump exists
|
// Check lump exists
|
||||||
|
@ -608,6 +709,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||||
resultPatch->originy = patchYPos;
|
resultPatch->originy = patchYPos;
|
||||||
resultPatch->lump = patchLumpNum & 65535;
|
resultPatch->lump = patchLumpNum & 65535;
|
||||||
resultPatch->wad = patchLumpNum>>16;
|
resultPatch->wad = patchLumpNum>>16;
|
||||||
|
resultPatch->flip = flip;
|
||||||
// Clean up a little after ourselves
|
// Clean up a little after ourselves
|
||||||
Z_Free(patchName);
|
Z_Free(patchName);
|
||||||
// Then return it
|
// Then return it
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef struct
|
||||||
// Block origin (always UL), which has already accounted for the internal origin of the patch.
|
// Block origin (always UL), which has already accounted for the internal origin of the patch.
|
||||||
INT16 originx, originy;
|
INT16 originx, originy;
|
||||||
UINT16 wad, lump;
|
UINT16 wad, lump;
|
||||||
|
UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
|
||||||
} texpatch_t;
|
} texpatch_t;
|
||||||
|
|
||||||
// A maptexturedef_t describes a rectangular texture,
|
// A maptexturedef_t describes a rectangular texture,
|
||||||
|
@ -42,6 +43,7 @@ typedef struct
|
||||||
char name[8];
|
char name[8];
|
||||||
INT16 width, height;
|
INT16 width, height;
|
||||||
boolean holes;
|
boolean holes;
|
||||||
|
UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
|
||||||
|
|
||||||
// All the patches[patchcount] are drawn back to front into the cached texture.
|
// All the patches[patchcount] are drawn back to front into the cached texture.
|
||||||
INT16 patchcount;
|
INT16 patchcount;
|
||||||
|
|
|
@ -162,6 +162,7 @@ void R_DrawSplat_8(void);
|
||||||
void R_DrawTranslucentSplat_8(void);
|
void R_DrawTranslucentSplat_8(void);
|
||||||
void R_DrawTranslucentSpan_8(void);
|
void R_DrawTranslucentSpan_8(void);
|
||||||
void R_Draw2sMultiPatchColumn_8(void);
|
void R_Draw2sMultiPatchColumn_8(void);
|
||||||
|
void R_Draw2sMultiPatchTranslucentColumn_8(void);
|
||||||
void R_DrawFogSpan_8(void);
|
void R_DrawFogSpan_8(void);
|
||||||
void R_DrawFogColumn_8(void);
|
void R_DrawFogColumn_8(void);
|
||||||
void R_DrawColumnShadowed_8(void);
|
void R_DrawColumnShadowed_8(void);
|
||||||
|
|
|
@ -203,6 +203,103 @@ void R_Draw2sMultiPatchColumn_8(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void R_Draw2sMultiPatchTranslucentColumn_8(void)
|
||||||
|
{
|
||||||
|
INT32 count;
|
||||||
|
register UINT8 *dest;
|
||||||
|
register fixed_t frac;
|
||||||
|
fixed_t fracstep;
|
||||||
|
|
||||||
|
count = dc_yh - dc_yl;
|
||||||
|
|
||||||
|
if (count < 0) // Zero length, column does not exceed a pixel.
|
||||||
|
return;
|
||||||
|
|
||||||
|
#ifdef RANGECHECK
|
||||||
|
if ((unsigned)dc_x >= (unsigned)vid.width || dc_yl < 0 || dc_yh >= vid.height)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Framebuffer destination address.
|
||||||
|
// Use ylookup LUT to avoid multiply with ScreenWidth.
|
||||||
|
// Use columnofs LUT for subwindows?
|
||||||
|
|
||||||
|
//dest = ylookup[dc_yl] + columnofs[dc_x];
|
||||||
|
dest = &topleft[dc_yl*vid.width + dc_x];
|
||||||
|
|
||||||
|
count++;
|
||||||
|
|
||||||
|
// Determine scaling, which is the only mapping to be done.
|
||||||
|
fracstep = dc_iscale;
|
||||||
|
//frac = dc_texturemid + (dc_yl - centery)*fracstep;
|
||||||
|
frac = (dc_texturemid + FixedMul((dc_yl << FRACBITS) - centeryfrac, fracstep))*(!dc_hires);
|
||||||
|
|
||||||
|
// Inner loop that does the actual texture mapping, e.g. a DDA-like scaling.
|
||||||
|
// This is as fast as it gets.
|
||||||
|
{
|
||||||
|
register const UINT8 *source = dc_source;
|
||||||
|
register const UINT8 *transmap = dc_transmap;
|
||||||
|
register const lighttable_t *colormap = dc_colormap;
|
||||||
|
register INT32 heightmask = dc_texheight-1;
|
||||||
|
register UINT8 val;
|
||||||
|
if (dc_texheight & heightmask) // not a power of 2 -- killough
|
||||||
|
{
|
||||||
|
heightmask++;
|
||||||
|
heightmask <<= FRACBITS;
|
||||||
|
|
||||||
|
if (frac < 0)
|
||||||
|
while ((frac += heightmask) < 0);
|
||||||
|
else
|
||||||
|
while (frac >= heightmask)
|
||||||
|
frac -= heightmask;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// Re-map color indices from wall texture column
|
||||||
|
// using a lighting/special effects LUT.
|
||||||
|
// heightmask is the Tutti-Frutti fix
|
||||||
|
val = source[frac>>FRACBITS];
|
||||||
|
|
||||||
|
if (val != TRANSPARENTPIXEL)
|
||||||
|
*dest = colormap[*(transmap + (val<<8) + (*dest))];
|
||||||
|
|
||||||
|
dest += vid.width;
|
||||||
|
|
||||||
|
// Avoid overflow.
|
||||||
|
if (fracstep > 0x7FFFFFFF - frac)
|
||||||
|
frac += fracstep - heightmask;
|
||||||
|
else
|
||||||
|
frac += fracstep;
|
||||||
|
|
||||||
|
while (frac >= heightmask)
|
||||||
|
frac -= heightmask;
|
||||||
|
} while (--count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while ((count -= 2) >= 0) // texture height is a power of 2
|
||||||
|
{
|
||||||
|
val = source[(frac>>FRACBITS) & heightmask];
|
||||||
|
if (val != TRANSPARENTPIXEL)
|
||||||
|
*dest = colormap[*(transmap + (val<<8) + (*dest))];
|
||||||
|
dest += vid.width;
|
||||||
|
frac += fracstep;
|
||||||
|
val = source[(frac>>FRACBITS) & heightmask];
|
||||||
|
if (val != TRANSPARENTPIXEL)
|
||||||
|
*dest = colormap[*(transmap + (val<<8) + (*dest))];
|
||||||
|
dest += vid.width;
|
||||||
|
frac += fracstep;
|
||||||
|
}
|
||||||
|
if (count & 1)
|
||||||
|
{
|
||||||
|
val = source[(frac>>FRACBITS) & heightmask];
|
||||||
|
if (val != TRANSPARENTPIXEL)
|
||||||
|
*dest = colormap[*(transmap + (val<<8) + (*dest))];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief The R_DrawShadeColumn_8 function
|
/** \brief The R_DrawShadeColumn_8 function
|
||||||
Experiment to make software go faster. Taken from the Boom source
|
Experiment to make software go faster. Taken from the Boom source
|
||||||
*/
|
*/
|
||||||
|
|
35
src/r_segs.c
35
src/r_segs.c
|
@ -271,11 +271,20 @@ static void R_Render2sidedMultiPatchColumn(column_t *column)
|
||||||
|
|
||||||
if (colfunc == wallcolfunc)
|
if (colfunc == wallcolfunc)
|
||||||
twosmultipatchfunc();
|
twosmultipatchfunc();
|
||||||
|
else if (colfunc == fuzzcolfunc)
|
||||||
|
twosmultipatchtransfunc();
|
||||||
else
|
else
|
||||||
colfunc();
|
colfunc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// quick wrapper for R_DrawFlippedMaskedColumn so it can be set as a colfunc_2s value
|
||||||
|
// uses column2s_length for texture->height as above
|
||||||
|
static void R_DrawFlippedMaskedSegColumn(column_t *column)
|
||||||
|
{
|
||||||
|
R_DrawFlippedMaskedColumn(column, column2s_length);
|
||||||
|
}
|
||||||
|
|
||||||
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
{
|
{
|
||||||
size_t pindex;
|
size_t pindex;
|
||||||
|
@ -347,7 +356,15 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
||||||
// handle case where multipatch texture is drawn on a 2sided wall, multi-patch textures
|
// handle case where multipatch texture is drawn on a 2sided wall, multi-patch textures
|
||||||
// are not stored per-column with post info in SRB2
|
// are not stored per-column with post info in SRB2
|
||||||
if (textures[texnum]->holes)
|
if (textures[texnum]->holes)
|
||||||
|
{
|
||||||
|
if (textures[texnum]->flip & 2) // vertically flipped?
|
||||||
|
{
|
||||||
|
colfunc_2s = R_DrawFlippedMaskedSegColumn;
|
||||||
|
column2s_length = textures[texnum]->height;
|
||||||
|
}
|
||||||
|
else
|
||||||
colfunc_2s = R_DrawMaskedColumn; // render the usual 2sided single-patch packed texture
|
colfunc_2s = R_DrawMaskedColumn; // render the usual 2sided single-patch packed texture
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colfunc_2s = R_Render2sidedMultiPatchColumn; // render multipatch with no holes (no post_t info)
|
colfunc_2s = R_Render2sidedMultiPatchColumn; // render multipatch with no holes (no post_t info)
|
||||||
|
@ -700,6 +717,14 @@ static void R_DrawRepeatMaskedColumn(column_t *col)
|
||||||
} while (sprtopscreen < sprbotscreen);
|
} while (sprtopscreen < sprbotscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void R_DrawRepeatFlippedMaskedColumn(column_t *col)
|
||||||
|
{
|
||||||
|
do {
|
||||||
|
R_DrawFlippedMaskedColumn(col, column2s_length);
|
||||||
|
sprtopscreen += dc_texheight*spryscale;
|
||||||
|
} while (sprtopscreen < sprbotscreen);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_RenderThickSideRange
|
// R_RenderThickSideRange
|
||||||
// Renders all the thick sides in the given range.
|
// Renders all the thick sides in the given range.
|
||||||
|
@ -1027,7 +1052,15 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
||||||
//faB: handle case where multipatch texture is drawn on a 2sided wall, multi-patch textures
|
//faB: handle case where multipatch texture is drawn on a 2sided wall, multi-patch textures
|
||||||
// are not stored per-column with post info anymore in Doom Legacy
|
// are not stored per-column with post info anymore in Doom Legacy
|
||||||
if (textures[texnum]->holes)
|
if (textures[texnum]->holes)
|
||||||
colfunc_2s = R_DrawRepeatMaskedColumn; //render the usual 2sided single-patch packed texture
|
{
|
||||||
|
if (textures[texnum]->flip & 2) // vertically flipped?
|
||||||
|
{
|
||||||
|
colfunc_2s = R_DrawRepeatFlippedMaskedColumn;
|
||||||
|
column2s_length = textures[texnum]->height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
colfunc_2s = R_DrawRepeatMaskedColumn; // render the usual 2sided single-patch packed texture
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colfunc_2s = R_Render2sidedMultiPatchColumn; //render multipatch with no holes (no post_t info)
|
colfunc_2s = R_Render2sidedMultiPatchColumn; //render multipatch with no holes (no post_t info)
|
||||||
|
|
|
@ -712,7 +712,7 @@ void R_DrawMaskedColumn(column_t *column)
|
||||||
dc_texturemid = basetexturemid;
|
dc_texturemid = basetexturemid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void R_DrawFlippedMaskedColumn(column_t *column, INT32 texheight)
|
void R_DrawFlippedMaskedColumn(column_t *column, INT32 texheight)
|
||||||
{
|
{
|
||||||
INT32 topscreen;
|
INT32 topscreen;
|
||||||
INT32 bottomscreen;
|
INT32 bottomscreen;
|
||||||
|
@ -2880,6 +2880,7 @@ void R_AddSkins(UINT16 wadnum)
|
||||||
GETFLAG(STOMPDAMAGE)
|
GETFLAG(STOMPDAMAGE)
|
||||||
GETFLAG(MARIODAMAGE)
|
GETFLAG(MARIODAMAGE)
|
||||||
GETFLAG(MACHINE)
|
GETFLAG(MACHINE)
|
||||||
|
GETFLAG(NOSPINDASHDUST)
|
||||||
#undef GETFLAG
|
#undef GETFLAG
|
||||||
|
|
||||||
else // let's check if it's a sound, otherwise error out
|
else // let's check if it's a sound, otherwise error out
|
||||||
|
|
|
@ -46,6 +46,7 @@ extern fixed_t windowtop;
|
||||||
extern fixed_t windowbottom;
|
extern fixed_t windowbottom;
|
||||||
|
|
||||||
void R_DrawMaskedColumn(column_t *column);
|
void R_DrawMaskedColumn(column_t *column);
|
||||||
|
void R_DrawFlippedMaskedColumn(column_t *column, INT32 texheight);
|
||||||
void R_SortVisSprites(void);
|
void R_SortVisSprites(void);
|
||||||
|
|
||||||
//faB: find sprites in wadfile, replace existing, add new ones
|
//faB: find sprites in wadfile, replace existing, add new ones
|
||||||
|
|
|
@ -607,6 +607,13 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id)
|
||||||
sfx_id = sfx_mario6;
|
sfx_id = sfx_mario6;
|
||||||
break;
|
break;
|
||||||
case sfx_shield:
|
case sfx_shield:
|
||||||
|
case sfx_wirlsg:
|
||||||
|
case sfx_forcsg:
|
||||||
|
case sfx_elemsg:
|
||||||
|
case sfx_armasg:
|
||||||
|
case sfx_s3k3e:
|
||||||
|
case sfx_s3k3f:
|
||||||
|
case sfx_s3k41:
|
||||||
sfx_id = sfx_mario3;
|
sfx_id = sfx_mario3;
|
||||||
break;
|
break;
|
||||||
case sfx_itemup:
|
case sfx_itemup:
|
||||||
|
|
|
@ -49,6 +49,7 @@ void (*splatfunc)(void); // span drawer w/ transparency
|
||||||
void (*basespanfunc)(void); // default span func for color mode
|
void (*basespanfunc)(void); // default span func for color mode
|
||||||
void (*transtransfunc)(void); // translucent translated column drawer
|
void (*transtransfunc)(void); // translucent translated column drawer
|
||||||
void (*twosmultipatchfunc)(void); // for cols with transparent pixels
|
void (*twosmultipatchfunc)(void); // for cols with transparent pixels
|
||||||
|
void (*twosmultipatchtransfunc)(void); // for cols with transparent pixels AND translucency
|
||||||
|
|
||||||
// ------------------
|
// ------------------
|
||||||
// global video state
|
// global video state
|
||||||
|
@ -127,6 +128,7 @@ void SCR_SetMode(void)
|
||||||
fuzzcolfunc = R_DrawTranslucentColumn_8;
|
fuzzcolfunc = R_DrawTranslucentColumn_8;
|
||||||
walldrawerfunc = R_DrawWallColumn_8;
|
walldrawerfunc = R_DrawWallColumn_8;
|
||||||
twosmultipatchfunc = R_Draw2sMultiPatchColumn_8;
|
twosmultipatchfunc = R_Draw2sMultiPatchColumn_8;
|
||||||
|
twosmultipatchtransfunc = R_Draw2sMultiPatchTranslucentColumn_8;
|
||||||
#ifdef RUSEASM
|
#ifdef RUSEASM
|
||||||
if (R_ASM)
|
if (R_ASM)
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,6 +136,7 @@ extern void (*basespanfunc)(void);
|
||||||
extern void (*splatfunc)(void);
|
extern void (*splatfunc)(void);
|
||||||
extern void (*transtransfunc)(void);
|
extern void (*transtransfunc)(void);
|
||||||
extern void (*twosmultipatchfunc)(void);
|
extern void (*twosmultipatchfunc)(void);
|
||||||
|
extern void (*twosmultipatchtransfunc)(void);
|
||||||
|
|
||||||
// -----
|
// -----
|
||||||
// CPUID
|
// CPUID
|
||||||
|
|
|
@ -2647,6 +2647,47 @@ INT32 I_PutEnv(char *variable)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
char storage[256];
|
||||||
|
if (size > 255)
|
||||||
|
size = 255;
|
||||||
|
memcpy(storage, data, size);
|
||||||
|
storage[size] = 0;
|
||||||
|
|
||||||
|
if (SDL_SetClipboardText(storage))
|
||||||
|
return 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
static char clipboard_modified[256];
|
||||||
|
char *clipboard_contents, *i = clipboard_modified;
|
||||||
|
|
||||||
|
if (!SDL_HasClipboardText())
|
||||||
|
return NULL;
|
||||||
|
clipboard_contents = SDL_GetClipboardText();
|
||||||
|
memcpy(clipboard_modified, clipboard_contents, 255);
|
||||||
|
SDL_free(clipboard_contents);
|
||||||
|
clipboard_modified[255] = 0;
|
||||||
|
|
||||||
|
while (*i)
|
||||||
|
{
|
||||||
|
if (*i == '\n' || *i == '\r')
|
||||||
|
{ // End on newline
|
||||||
|
*i = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (*i == '\t')
|
||||||
|
*i = ' '; // Tabs become spaces
|
||||||
|
else if (*i < 32 || (unsigned)*i > 127)
|
||||||
|
*i = '?'; // Nonprintable chars become question marks
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
return (const char *)&clipboard_modified;
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief The isWadPathOk function
|
/** \brief The isWadPathOk function
|
||||||
|
|
||||||
\param path string path to check
|
\param path string path to check
|
||||||
|
|
|
@ -33,14 +33,6 @@
|
||||||
#pragma warning(default : 4214 4244)
|
#pragma warning(default : 4214 4244)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
|
||||||
#define SDLK_EQUALS SDLK_KP_EQUALSAS400
|
|
||||||
#define SDLK_LMETA SDLK_LGUI
|
|
||||||
#define SDLK_RMETA SDLK_RGUI
|
|
||||||
#else
|
|
||||||
#define HAVE_SDLMETAKEYS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_TTF
|
#ifdef HAVE_TTF
|
||||||
#include "i_ttf.h"
|
#include "i_ttf.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -189,14 +181,14 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
||||||
wasfullscreen = SDL_TRUE;
|
wasfullscreen = SDL_TRUE;
|
||||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||||
}
|
}
|
||||||
else if (!fullscreen && wasfullscreen)
|
else if (wasfullscreen)
|
||||||
{
|
{
|
||||||
wasfullscreen = SDL_FALSE;
|
wasfullscreen = SDL_FALSE;
|
||||||
SDL_SetWindowFullscreen(window, 0);
|
SDL_SetWindowFullscreen(window, 0);
|
||||||
SDL_SetWindowSize(window, width, height);
|
SDL_SetWindowSize(window, width, height);
|
||||||
SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1));
|
SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED_DISPLAY(1), SDL_WINDOWPOS_CENTERED_DISPLAY(1));
|
||||||
}
|
}
|
||||||
else if (!wasfullscreen)
|
else
|
||||||
{
|
{
|
||||||
// Reposition window only in windowed mode
|
// Reposition window only in windowed mode
|
||||||
SDL_SetWindowSize(window, width, height);
|
SDL_SetWindowSize(window, width, height);
|
||||||
|
@ -282,129 +274,70 @@ static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code)
|
||||||
}
|
}
|
||||||
switch (code)
|
switch (code)
|
||||||
{
|
{
|
||||||
case SDL_SCANCODE_F11: // F11 and F12 are
|
// F11 and F12 are separated from the rest of the function keys
|
||||||
return KEY_F11; // separated from the
|
case SDL_SCANCODE_F11: return KEY_F11;
|
||||||
case SDL_SCANCODE_F12: // rest of the function
|
case SDL_SCANCODE_F12: return KEY_F12;
|
||||||
return KEY_F12; // keys
|
|
||||||
|
|
||||||
case SDL_SCANCODE_KP_0:
|
case SDL_SCANCODE_KP_0: return KEY_KEYPAD0;
|
||||||
return KEY_KEYPAD0;
|
case SDL_SCANCODE_KP_1: return KEY_KEYPAD1;
|
||||||
case SDL_SCANCODE_KP_1:
|
case SDL_SCANCODE_KP_2: return KEY_KEYPAD2;
|
||||||
return KEY_KEYPAD1;
|
case SDL_SCANCODE_KP_3: return KEY_KEYPAD3;
|
||||||
case SDL_SCANCODE_KP_2:
|
case SDL_SCANCODE_KP_4: return KEY_KEYPAD4;
|
||||||
return KEY_KEYPAD2;
|
case SDL_SCANCODE_KP_5: return KEY_KEYPAD5;
|
||||||
case SDL_SCANCODE_KP_3:
|
case SDL_SCANCODE_KP_6: return KEY_KEYPAD6;
|
||||||
return KEY_KEYPAD3;
|
case SDL_SCANCODE_KP_7: return KEY_KEYPAD7;
|
||||||
case SDL_SCANCODE_KP_4:
|
case SDL_SCANCODE_KP_8: return KEY_KEYPAD8;
|
||||||
return KEY_KEYPAD4;
|
case SDL_SCANCODE_KP_9: return KEY_KEYPAD9;
|
||||||
case SDL_SCANCODE_KP_5:
|
|
||||||
return KEY_KEYPAD5;
|
|
||||||
case SDL_SCANCODE_KP_6:
|
|
||||||
return KEY_KEYPAD6;
|
|
||||||
case SDL_SCANCODE_KP_7:
|
|
||||||
return KEY_KEYPAD7;
|
|
||||||
case SDL_SCANCODE_KP_8:
|
|
||||||
return KEY_KEYPAD8;
|
|
||||||
case SDL_SCANCODE_KP_9:
|
|
||||||
return KEY_KEYPAD9;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_RETURN:
|
case SDL_SCANCODE_RETURN: return KEY_ENTER;
|
||||||
return KEY_ENTER;
|
case SDL_SCANCODE_ESCAPE: return KEY_ESCAPE;
|
||||||
case SDL_SCANCODE_ESCAPE:
|
case SDL_SCANCODE_BACKSPACE: return KEY_BACKSPACE;
|
||||||
return KEY_ESCAPE;
|
case SDL_SCANCODE_TAB: return KEY_TAB;
|
||||||
case SDL_SCANCODE_BACKSPACE:
|
case SDL_SCANCODE_SPACE: return KEY_SPACE;
|
||||||
return KEY_BACKSPACE;
|
case SDL_SCANCODE_MINUS: return KEY_MINUS;
|
||||||
case SDL_SCANCODE_TAB:
|
case SDL_SCANCODE_EQUALS: return KEY_EQUALS;
|
||||||
return KEY_TAB;
|
case SDL_SCANCODE_LEFTBRACKET: return '[';
|
||||||
case SDL_SCANCODE_SPACE:
|
case SDL_SCANCODE_RIGHTBRACKET: return ']';
|
||||||
return KEY_SPACE;
|
case SDL_SCANCODE_BACKSLASH: return '\\';
|
||||||
case SDL_SCANCODE_MINUS:
|
case SDL_SCANCODE_NONUSHASH: return '#';
|
||||||
return KEY_MINUS;
|
case SDL_SCANCODE_SEMICOLON: return ';';
|
||||||
case SDL_SCANCODE_EQUALS:
|
case SDL_SCANCODE_APOSTROPHE: return '\'';
|
||||||
return KEY_EQUALS;
|
case SDL_SCANCODE_GRAVE: return '`';
|
||||||
case SDL_SCANCODE_LEFTBRACKET:
|
case SDL_SCANCODE_COMMA: return ',';
|
||||||
return '[';
|
case SDL_SCANCODE_PERIOD: return '.';
|
||||||
case SDL_SCANCODE_RIGHTBRACKET:
|
case SDL_SCANCODE_SLASH: return '/';
|
||||||
return ']';
|
case SDL_SCANCODE_CAPSLOCK: return KEY_CAPSLOCK;
|
||||||
case SDL_SCANCODE_BACKSLASH:
|
case SDL_SCANCODE_PRINTSCREEN: return 0; // undefined?
|
||||||
return '\\';
|
case SDL_SCANCODE_SCROLLLOCK: return KEY_SCROLLLOCK;
|
||||||
case SDL_SCANCODE_NONUSHASH:
|
case SDL_SCANCODE_PAUSE: return KEY_PAUSE;
|
||||||
return '#';
|
case SDL_SCANCODE_INSERT: return KEY_INS;
|
||||||
case SDL_SCANCODE_SEMICOLON:
|
case SDL_SCANCODE_HOME: return KEY_HOME;
|
||||||
return ';';
|
case SDL_SCANCODE_PAGEUP: return KEY_PGUP;
|
||||||
case SDL_SCANCODE_APOSTROPHE:
|
case SDL_SCANCODE_DELETE: return KEY_DEL;
|
||||||
return '\'';
|
case SDL_SCANCODE_END: return KEY_END;
|
||||||
case SDL_SCANCODE_GRAVE:
|
case SDL_SCANCODE_PAGEDOWN: return KEY_PGDN;
|
||||||
return '`';
|
case SDL_SCANCODE_RIGHT: return KEY_RIGHTARROW;
|
||||||
case SDL_SCANCODE_COMMA:
|
case SDL_SCANCODE_LEFT: return KEY_LEFTARROW;
|
||||||
return ',';
|
case SDL_SCANCODE_DOWN: return KEY_DOWNARROW;
|
||||||
case SDL_SCANCODE_PERIOD:
|
case SDL_SCANCODE_UP: return KEY_UPARROW;
|
||||||
return '.';
|
case SDL_SCANCODE_NUMLOCKCLEAR: return KEY_NUMLOCK;
|
||||||
case SDL_SCANCODE_SLASH:
|
case SDL_SCANCODE_KP_DIVIDE: return KEY_KPADSLASH;
|
||||||
return '/';
|
case SDL_SCANCODE_KP_MULTIPLY: return '*'; // undefined?
|
||||||
case SDL_SCANCODE_CAPSLOCK:
|
case SDL_SCANCODE_KP_MINUS: return KEY_MINUSPAD;
|
||||||
return KEY_CAPSLOCK;
|
case SDL_SCANCODE_KP_PLUS: return KEY_PLUSPAD;
|
||||||
case SDL_SCANCODE_PRINTSCREEN:
|
case SDL_SCANCODE_KP_ENTER: return KEY_ENTER;
|
||||||
return 0; // undefined?
|
case SDL_SCANCODE_KP_PERIOD: return KEY_KPADDEL;
|
||||||
case SDL_SCANCODE_SCROLLLOCK:
|
case SDL_SCANCODE_NONUSBACKSLASH: return '\\';
|
||||||
return KEY_SCROLLLOCK;
|
|
||||||
case SDL_SCANCODE_PAUSE:
|
|
||||||
return KEY_PAUSE;
|
|
||||||
case SDL_SCANCODE_INSERT:
|
|
||||||
return KEY_INS;
|
|
||||||
case SDL_SCANCODE_HOME:
|
|
||||||
return KEY_HOME;
|
|
||||||
case SDL_SCANCODE_PAGEUP:
|
|
||||||
return KEY_PGUP;
|
|
||||||
case SDL_SCANCODE_DELETE:
|
|
||||||
return KEY_DEL;
|
|
||||||
case SDL_SCANCODE_END:
|
|
||||||
return KEY_END;
|
|
||||||
case SDL_SCANCODE_PAGEDOWN:
|
|
||||||
return KEY_PGDN;
|
|
||||||
case SDL_SCANCODE_RIGHT:
|
|
||||||
return KEY_RIGHTARROW;
|
|
||||||
case SDL_SCANCODE_LEFT:
|
|
||||||
return KEY_LEFTARROW;
|
|
||||||
case SDL_SCANCODE_DOWN:
|
|
||||||
return KEY_DOWNARROW;
|
|
||||||
case SDL_SCANCODE_UP:
|
|
||||||
return KEY_UPARROW;
|
|
||||||
case SDL_SCANCODE_NUMLOCKCLEAR:
|
|
||||||
return KEY_NUMLOCK;
|
|
||||||
case SDL_SCANCODE_KP_DIVIDE:
|
|
||||||
return KEY_KPADSLASH;
|
|
||||||
case SDL_SCANCODE_KP_MULTIPLY:
|
|
||||||
return '*'; // undefined?
|
|
||||||
case SDL_SCANCODE_KP_MINUS:
|
|
||||||
return KEY_MINUSPAD;
|
|
||||||
case SDL_SCANCODE_KP_PLUS:
|
|
||||||
return KEY_PLUSPAD;
|
|
||||||
case SDL_SCANCODE_KP_ENTER:
|
|
||||||
return KEY_ENTER;
|
|
||||||
case SDL_SCANCODE_KP_PERIOD:
|
|
||||||
return KEY_KPADDEL;
|
|
||||||
case SDL_SCANCODE_NONUSBACKSLASH:
|
|
||||||
return '\\';
|
|
||||||
|
|
||||||
case SDL_SCANCODE_LSHIFT:
|
case SDL_SCANCODE_LSHIFT: return KEY_LSHIFT;
|
||||||
return KEY_LSHIFT;
|
case SDL_SCANCODE_RSHIFT: return KEY_RSHIFT;
|
||||||
case SDL_SCANCODE_RSHIFT:
|
case SDL_SCANCODE_LCTRL: return KEY_LCTRL;
|
||||||
return KEY_RSHIFT;
|
case SDL_SCANCODE_RCTRL: return KEY_RCTRL;
|
||||||
case SDL_SCANCODE_LCTRL:
|
case SDL_SCANCODE_LALT: return KEY_LALT;
|
||||||
return KEY_LCTRL;
|
case SDL_SCANCODE_RALT: return KEY_RALT;
|
||||||
case SDL_SCANCODE_RCTRL:
|
case SDL_SCANCODE_LGUI: return KEY_LEFTWIN;
|
||||||
return KEY_RCTRL;
|
case SDL_SCANCODE_RGUI: return KEY_RIGHTWIN;
|
||||||
case SDL_SCANCODE_LALT:
|
default: break;
|
||||||
return KEY_LALT;
|
|
||||||
case SDL_SCANCODE_RALT:
|
|
||||||
return KEY_RALT;
|
|
||||||
case SDL_SCANCODE_LGUI:
|
|
||||||
return KEY_LEFTWIN;
|
|
||||||
case SDL_SCANCODE_RGUI:
|
|
||||||
return KEY_RIGHTWIN;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
DBG_Printf("Unknown incoming scancode: %d, represented %c\n",
|
DBG_Printf("Unknown incoming scancode: %d, represented %c\n",
|
||||||
|
@ -432,15 +365,10 @@ static void VID_Command_NumModes_f (void)
|
||||||
CONS_Printf(M_GetText("%d video mode(s) available(s)\n"), VID_NumModes());
|
CONS_Printf(M_GetText("%d video mode(s) available(s)\n"), VID_NumModes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SDL2 doesn't have SDL_GetVideoSurface or a lot of the SDL_Surface flags that SDL 1.2 had
|
||||||
static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText)
|
static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
(void)infoSurface;
|
|
||||||
(void)SurfaceText;
|
|
||||||
SDL2STUB();
|
|
||||||
#else
|
|
||||||
INT32 vfBPP;
|
INT32 vfBPP;
|
||||||
const SDL_Surface *VidSur = SDL_GetVideoSurface();
|
|
||||||
|
|
||||||
if (!infoSurface)
|
if (!infoSurface)
|
||||||
return;
|
return;
|
||||||
|
@ -453,49 +381,12 @@ static void SurfaceInfo(const SDL_Surface *infoSurface, const char *SurfaceText)
|
||||||
CONS_Printf("\x82" "%s\n", SurfaceText);
|
CONS_Printf("\x82" "%s\n", SurfaceText);
|
||||||
CONS_Printf(M_GetText(" %ix%i at %i bit color\n"), infoSurface->w, infoSurface->h, vfBPP);
|
CONS_Printf(M_GetText(" %ix%i at %i bit color\n"), infoSurface->w, infoSurface->h, vfBPP);
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_HWSURFACE)
|
if (infoSurface->flags&SDL_PREALLOC)
|
||||||
CONS_Printf("%s", M_GetText(" Stored in video memory\n"));
|
|
||||||
else if (infoSurface->flags&SDL_OPENGL)
|
|
||||||
CONS_Printf("%s", M_GetText(" Stored in an OpenGL context\n"));
|
|
||||||
else if (infoSurface->flags&SDL_PREALLOC)
|
|
||||||
CONS_Printf("%s", M_GetText(" Uses preallocated memory\n"));
|
CONS_Printf("%s", M_GetText(" Uses preallocated memory\n"));
|
||||||
else
|
else
|
||||||
CONS_Printf("%s", M_GetText(" Stored in system memory\n"));
|
CONS_Printf("%s", M_GetText(" Stored in system memory\n"));
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_ASYNCBLIT)
|
|
||||||
CONS_Printf("%s", M_GetText(" Uses asynchronous blits if possible\n"));
|
|
||||||
else
|
|
||||||
CONS_Printf("%s", M_GetText(" Uses synchronous blits if possible\n"));
|
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_ANYFORMAT)
|
|
||||||
CONS_Printf("%s", M_GetText(" Allows any pixel-format\n"));
|
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_HWPALETTE)
|
|
||||||
CONS_Printf("%s", M_GetText(" Has exclusive palette access\n"));
|
|
||||||
else if (VidSur == infoSurface)
|
|
||||||
CONS_Printf("%s", M_GetText(" Has nonexclusive palette access\n"));
|
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_DOUBLEBUF)
|
|
||||||
CONS_Printf("%s", M_GetText(" Double buffered\n"));
|
|
||||||
else if (VidSur == infoSurface)
|
|
||||||
CONS_Printf("%s", M_GetText(" No hardware flipping\n"));
|
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_FULLSCREEN)
|
|
||||||
CONS_Printf("%s", M_GetText(" Full screen\n"));
|
|
||||||
else if (infoSurface->flags&SDL_RESIZABLE)
|
|
||||||
CONS_Printf("%s", M_GetText(" Resizable window\n"));
|
|
||||||
else if (VidSur == infoSurface)
|
|
||||||
CONS_Printf("%s", M_GetText(" Nonresizable window\n"));
|
|
||||||
|
|
||||||
if (infoSurface->flags&SDL_HWACCEL)
|
|
||||||
CONS_Printf("%s", M_GetText(" Uses hardware acceleration blit\n"));
|
|
||||||
if (infoSurface->flags&SDL_SRCCOLORKEY)
|
|
||||||
CONS_Printf("%s", M_GetText(" Use colorkey blitting\n"));
|
|
||||||
if (infoSurface->flags&SDL_RLEACCEL)
|
if (infoSurface->flags&SDL_RLEACCEL)
|
||||||
CONS_Printf("%s", M_GetText(" Colorkey RLE acceleration blit\n"));
|
CONS_Printf("%s", M_GetText(" Colorkey RLE acceleration blit\n"));
|
||||||
if (infoSurface->flags&SDL_SRCALPHA)
|
|
||||||
CONS_Printf("%s", M_GetText(" Use alpha blending acceleration blit\n"));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void VID_Command_Info_f (void)
|
static void VID_Command_Info_f (void)
|
||||||
|
@ -579,23 +470,6 @@ static void VID_Command_Mode_f (void)
|
||||||
setmodeneeded = modenum+1; // request vid mode change
|
setmodeneeded = modenum+1; // request vid mode change
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
#if defined(RPC_NO_WINDOWS_H)
|
|
||||||
static VOID MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
UNREFERENCED_PARAMETER(hWnd);
|
|
||||||
UNREFERENCED_PARAMETER(message);
|
|
||||||
UNREFERENCED_PARAMETER(wParam);
|
|
||||||
switch (message)
|
|
||||||
{
|
|
||||||
case WM_SETTEXT:
|
|
||||||
COM_BufAddText((LPCSTR)lParam);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline void SDLJoyRemap(event_t *event)
|
static inline void SDLJoyRemap(event_t *event)
|
||||||
{
|
{
|
||||||
(void)event;
|
(void)event;
|
||||||
|
@ -954,218 +828,6 @@ void I_GetEvent(void)
|
||||||
// In order to make wheels act like buttons, we have to set their state to Up.
|
// In order to make wheels act like buttons, we have to set their state to Up.
|
||||||
// This is because wheel messages don't have an up/down state.
|
// This is because wheel messages don't have an up/down state.
|
||||||
gamekeydown[KEY_MOUSEWHEELDOWN] = gamekeydown[KEY_MOUSEWHEELUP] = 0;
|
gamekeydown[KEY_MOUSEWHEELDOWN] = gamekeydown[KEY_MOUSEWHEELUP] = 0;
|
||||||
|
|
||||||
#if 0
|
|
||||||
SDL_Event inputEvent;
|
|
||||||
static SDL_bool sdlquit = SDL_FALSE; //Alam: once, just once
|
|
||||||
event_t event;
|
|
||||||
|
|
||||||
if (!graphics_started)
|
|
||||||
return;
|
|
||||||
|
|
||||||
memset(&inputEvent, 0x00, sizeof(inputEvent));
|
|
||||||
while (SDL_PollEvent(&inputEvent))
|
|
||||||
{
|
|
||||||
memset(&event,0x00,sizeof (event_t));
|
|
||||||
switch (inputEvent.type)
|
|
||||||
{
|
|
||||||
case SDL_ACTIVEEVENT:
|
|
||||||
if (inputEvent.active.state & (SDL_APPACTIVE|SDL_APPINPUTFOCUS))
|
|
||||||
{
|
|
||||||
// pause music when alt-tab
|
|
||||||
if (inputEvent.active.gain /*&& !paused */)
|
|
||||||
{
|
|
||||||
static SDL_bool firsttimeonmouse = SDL_TRUE;
|
|
||||||
if (!firsttimeonmouse)
|
|
||||||
{
|
|
||||||
if (cv_usemouse.value) I_StartupMouse();
|
|
||||||
}
|
|
||||||
else firsttimeonmouse = SDL_FALSE;
|
|
||||||
//if (!netgame && !con_destlines) paused = false;
|
|
||||||
if (gamestate == GS_LEVEL)
|
|
||||||
if (!paused) I_ResumeSong(0); //resume it
|
|
||||||
}
|
|
||||||
else /*if (!paused)*/
|
|
||||||
{
|
|
||||||
if (!disable_mouse)
|
|
||||||
SDLforceUngrabMouse();
|
|
||||||
if (!netgame && gamestate == GS_LEVEL) paused = true;
|
|
||||||
memset(gamekeydown, 0, NUMKEYS);
|
|
||||||
//S_PauseSound();
|
|
||||||
if (gamestate == GS_LEVEL)
|
|
||||||
I_PauseSong(0); //pause it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (MOUSE_MENU)
|
|
||||||
{
|
|
||||||
SDLdoUngrabMouse();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if ((SDL_APPMOUSEFOCUS&inputEvent.active.state) && USE_MOUSEINPUT && inputEvent.active.gain)
|
|
||||||
HalfWarpMouse(realwidth, realheight);
|
|
||||||
break;
|
|
||||||
case SDL_KEYDOWN:
|
|
||||||
case SDL_KEYUP:
|
|
||||||
/// \todo inputEvent.key.which?
|
|
||||||
if (inputEvent.type == SDL_KEYUP)
|
|
||||||
event.type = ev_keyup;
|
|
||||||
else if (inputEvent.type == SDL_KEYDOWN)
|
|
||||||
event.type = ev_keydown;
|
|
||||||
else break;
|
|
||||||
event.data1 = SDLatekey(inputEvent.key.keysym.sym);
|
|
||||||
if (event.data1) D_PostEvent(&event);
|
|
||||||
break;
|
|
||||||
case SDL_MOUSEMOTION:
|
|
||||||
/// \todo inputEvent.motion.which
|
|
||||||
if (MOUSE_MENU)
|
|
||||||
{
|
|
||||||
SDLdoUngrabMouse();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//if (USE_MOUSEINPUT) TODO SDL2 stub
|
|
||||||
{
|
|
||||||
// If the event is from warping the pointer back to middle
|
|
||||||
// of the screen then ignore it.
|
|
||||||
if ((inputEvent.motion.x == realwidth/2) &&
|
|
||||||
(inputEvent.motion.y == realheight/2))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
event.data2 = +inputEvent.motion.xrel;
|
|
||||||
event.data3 = -inputEvent.motion.yrel;
|
|
||||||
}
|
|
||||||
event.type = ev_mouse;
|
|
||||||
D_PostEvent(&event);
|
|
||||||
// Warp the pointer back to the middle of the window
|
|
||||||
// or we cannot move any further if it's at a border.
|
|
||||||
if ((inputEvent.motion.x < (realwidth/2 )-(realwidth/4 )) ||
|
|
||||||
(inputEvent.motion.y < (realheight/2)-(realheight/4)) ||
|
|
||||||
(inputEvent.motion.x > (realwidth/2 )+(realwidth/4 )) ||
|
|
||||||
(inputEvent.motion.y > (realheight/2)+(realheight/4) ) )
|
|
||||||
{
|
|
||||||
//if (SDL_GRAB_ON == SDL_WM_GrabInput(SDL_GRAB_QUERY) || !mousegrabok)
|
|
||||||
HalfWarpMouse(realwidth, realheight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
|
||||||
case SDL_MOUSEBUTTONUP:
|
|
||||||
/// \todo inputEvent.button.which
|
|
||||||
if (USE_MOUSEINPUT)
|
|
||||||
{
|
|
||||||
if (inputEvent.type == SDL_MOUSEBUTTONUP)
|
|
||||||
event.type = ev_keyup;
|
|
||||||
else if (inputEvent.type == SDL_MOUSEBUTTONDOWN)
|
|
||||||
event.type = ev_keydown;
|
|
||||||
else break;
|
|
||||||
if (inputEvent.button.button==SDL_BUTTON_WHEELUP || inputEvent.button.button==SDL_BUTTON_WHEELDOWN)
|
|
||||||
{
|
|
||||||
if (inputEvent.type == SDL_MOUSEBUTTONUP)
|
|
||||||
event.data1 = 0; //Alam: dumb! this could be a real button with some mice
|
|
||||||
else
|
|
||||||
event.data1 = KEY_MOUSEWHEELUP + inputEvent.button.button - SDL_BUTTON_WHEELUP;
|
|
||||||
}
|
|
||||||
else if (inputEvent.button.button == SDL_BUTTON_MIDDLE)
|
|
||||||
event.data1 = KEY_MOUSE1+2;
|
|
||||||
else if (inputEvent.button.button == SDL_BUTTON_RIGHT)
|
|
||||||
event.data1 = KEY_MOUSE1+1;
|
|
||||||
else if (inputEvent.button.button <= MOUSEBUTTONS)
|
|
||||||
event.data1 = KEY_MOUSE1 + inputEvent.button.button - SDL_BUTTON_LEFT;
|
|
||||||
if (event.data1) D_PostEvent(&event);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SDL_JOYAXISMOTION:
|
|
||||||
inputEvent.jaxis.which++;
|
|
||||||
inputEvent.jaxis.axis++;
|
|
||||||
event.data1 = event.data2 = event.data3 = INT32_MAX;
|
|
||||||
if (cv_usejoystick.value == inputEvent.jaxis.which)
|
|
||||||
{
|
|
||||||
event.type = ev_joystick;
|
|
||||||
}
|
|
||||||
else if (cv_usejoystick.value == inputEvent.jaxis.which)
|
|
||||||
{
|
|
||||||
event.type = ev_joystick2;
|
|
||||||
}
|
|
||||||
else break;
|
|
||||||
//axis
|
|
||||||
if (inputEvent.jaxis.axis > JOYAXISSET*2)
|
|
||||||
break;
|
|
||||||
//vaule
|
|
||||||
if (inputEvent.jaxis.axis%2)
|
|
||||||
{
|
|
||||||
event.data1 = inputEvent.jaxis.axis / 2;
|
|
||||||
event.data2 = SDLJoyAxis(inputEvent.jaxis.value, event.type);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
inputEvent.jaxis.axis--;
|
|
||||||
event.data1 = inputEvent.jaxis.axis / 2;
|
|
||||||
event.data3 = SDLJoyAxis(inputEvent.jaxis.value, event.type);
|
|
||||||
}
|
|
||||||
D_PostEvent(&event);
|
|
||||||
break;
|
|
||||||
case SDL_JOYBALLMOTION:
|
|
||||||
case SDL_JOYHATMOTION:
|
|
||||||
break; //NONE
|
|
||||||
case SDL_JOYBUTTONDOWN:
|
|
||||||
case SDL_JOYBUTTONUP:
|
|
||||||
inputEvent.jbutton.which++;
|
|
||||||
if (cv_usejoystick.value == inputEvent.jbutton.which)
|
|
||||||
event.data1 = KEY_JOY1;
|
|
||||||
else if (cv_usejoystick.value == inputEvent.jbutton.which)
|
|
||||||
event.data1 = KEY_2JOY1;
|
|
||||||
else break;
|
|
||||||
if (inputEvent.type == SDL_JOYBUTTONUP)
|
|
||||||
event.type = ev_keyup;
|
|
||||||
else if (inputEvent.type == SDL_JOYBUTTONDOWN)
|
|
||||||
event.type = ev_keydown;
|
|
||||||
else break;
|
|
||||||
if (inputEvent.jbutton.button < JOYBUTTONS)
|
|
||||||
event.data1 += inputEvent.jbutton.button;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
SDLJoyRemap(&event);
|
|
||||||
if (event.type != ev_console) D_PostEvent(&event);
|
|
||||||
break;
|
|
||||||
case SDL_QUIT:
|
|
||||||
if (!sdlquit)
|
|
||||||
{
|
|
||||||
sdlquit = SDL_TRUE;
|
|
||||||
M_QuitResponse('y');
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#if defined(RPC_NO_WINDOWS_H)
|
|
||||||
case SDL_SYSWMEVENT:
|
|
||||||
MainWndproc(inputEvent.syswm.msg->hwnd,
|
|
||||||
inputEvent.syswm.msg->msg,
|
|
||||||
inputEvent.syswm.msg->wParam,
|
|
||||||
inputEvent.syswm.msg->lParam);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case SDL_VIDEORESIZE:
|
|
||||||
if (gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN || gamestate == GS_EVALUATION)
|
|
||||||
setmodeneeded = VID_GetModeForSize(inputEvent.resize.w,inputEvent.resize.h)+1;
|
|
||||||
if (render_soft == rendermode)
|
|
||||||
{
|
|
||||||
SDLSetMode(realwidth, realheight, vid.bpp*8, surfaceFlagsW);
|
|
||||||
if (vidSurface) SDL_SetColors(vidSurface, localPalette, 0, 256);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SDLSetMode(realwidth, realheight, vid.bpp*8, surfaceFlagsW);
|
|
||||||
if (!vidSurface)
|
|
||||||
I_Error("Could not reset vidmode: %s\n",SDL_GetError());
|
|
||||||
break;
|
|
||||||
case SDL_VIDEOEXPOSE:
|
|
||||||
exposevideo = SDL_TRUE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//reset wheel like in win32, I don't understand it but works
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_StartupMouse(void)
|
void I_StartupMouse(void)
|
||||||
|
@ -1494,11 +1156,6 @@ void VID_PrepareModeList(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void SDLESSet(void)
|
|
||||||
{
|
|
||||||
SDL2STUB();
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 VID_SetMode(INT32 modeNum)
|
INT32 VID_SetMode(INT32 modeNum)
|
||||||
{
|
{
|
||||||
SDLdoUngrabMouse();
|
SDLdoUngrabMouse();
|
||||||
|
@ -1550,6 +1207,12 @@ INT32 VID_SetMode(INT32 modeNum)
|
||||||
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||||
{
|
{
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
|
if (rendermode == render_none) // dedicated
|
||||||
|
{
|
||||||
|
return SDL_TRUE; // Monster Iestyn -- not sure if it really matters what we return here tbh
|
||||||
|
}
|
||||||
|
|
||||||
if (window != NULL)
|
if (window != NULL)
|
||||||
{
|
{
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
|
@ -1568,9 +1231,23 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
|
flags |= SDL_WINDOW_OPENGL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Create a window
|
||||||
window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||||
realwidth, realheight, flags | SDL_WINDOW_OPENGL);
|
realwidth, realheight, flags);
|
||||||
if (window != NULL)
|
|
||||||
|
if (window == NULL)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("Couldn't create window: %s\n"), SDL_GetError());
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Renderer-specific stuff
|
||||||
|
#ifdef HWRENDER
|
||||||
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
sdlglcontext = SDL_GL_CreateContext(window);
|
sdlglcontext = SDL_GL_CreateContext(window);
|
||||||
if (sdlglcontext == NULL)
|
if (sdlglcontext == NULL)
|
||||||
|
@ -1578,29 +1255,20 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
I_Error("Failed to create a GL context: %s\n", SDL_GetError());
|
I_Error("Failed to create a GL context: %s\n", SDL_GetError());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
SDL_GL_MakeCurrent(window, sdlglcontext);
|
SDL_GL_MakeCurrent(window, sdlglcontext);
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else return SDL_FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (rendermode == render_soft)
|
if (rendermode == render_soft)
|
||||||
{
|
|
||||||
window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
|
||||||
realwidth, realheight, flags);
|
|
||||||
if (window != NULL)
|
|
||||||
{
|
{
|
||||||
renderer = SDL_CreateRenderer(window, -1, (usesdl2soft ? SDL_RENDERER_SOFTWARE : 0) | (cv_vidwait.value && !usesdl2soft ? SDL_RENDERER_PRESENTVSYNC : 0));
|
renderer = SDL_CreateRenderer(window, -1, (usesdl2soft ? SDL_RENDERER_SOFTWARE : 0) | (cv_vidwait.value && !usesdl2soft ? SDL_RENDERER_PRESENTVSYNC : 0));
|
||||||
if (renderer != NULL)
|
if (renderer == NULL)
|
||||||
{
|
{
|
||||||
|
CONS_Printf(M_GetText("Couldn't create rendering context: %s\n"), SDL_GetError());
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
||||||
}
|
}
|
||||||
else return SDL_FALSE;
|
|
||||||
}
|
|
||||||
else return SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1620,7 +1288,7 @@ static void Impl_SetWindowIcon(void)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SDL2STUB();
|
//SDL2STUB(); // Monster Iestyn: why is this stubbed?
|
||||||
SDL_SetWindowIcon(window, icoSurface);
|
SDL_SetWindowIcon(window, icoSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1718,7 +1386,6 @@ void I_StartupGraphics(void)
|
||||||
borderlesswindow = M_CheckParm("-borderless");
|
borderlesswindow = M_CheckParm("-borderless");
|
||||||
|
|
||||||
//SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2);
|
//SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2);
|
||||||
SDLESSet();
|
|
||||||
VID_Command_ModeList_f();
|
VID_Command_ModeList_f();
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (M_CheckParm("-opengl") || rendermode == render_opengl)
|
if (M_CheckParm("-opengl") || rendermode == render_opengl)
|
||||||
|
|
|
@ -24,7 +24,6 @@ boolean OglSdlSurface(INT32 w, INT32 h);
|
||||||
|
|
||||||
void OglSdlFinishUpdate(boolean vidwait);
|
void OglSdlFinishUpdate(boolean vidwait);
|
||||||
|
|
||||||
extern SDL_Window *window;
|
|
||||||
extern SDL_Renderer *renderer;
|
extern SDL_Renderer *renderer;
|
||||||
extern SDL_GLContext sdlglcontext;
|
extern SDL_GLContext sdlglcontext;
|
||||||
extern Uint16 realwidth;
|
extern Uint16 realwidth;
|
||||||
|
|
|
@ -71,4 +71,7 @@ void I_GetConsoleEvents(void);
|
||||||
|
|
||||||
void SDLforceUngrabMouse(void);
|
void SDLforceUngrabMouse(void);
|
||||||
|
|
||||||
|
// Needed for some WIN32 functions
|
||||||
|
extern SDL_Window *window;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2666,6 +2666,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief The isWadPathOk function
|
/** \brief The isWadPathOk function
|
||||||
|
|
||||||
\param path string path to check
|
\param path string path to check
|
||||||
|
|
|
@ -165,8 +165,12 @@ sfxinfo_t S_sfx[NUMSFX] =
|
||||||
{"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // generic GET!
|
||||||
{"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Whirlwind GET!
|
||||||
|
{"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Force GET!
|
||||||
|
{"elemsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Elemental GET!
|
||||||
|
{"armasg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Armaggeddon GET!
|
||||||
|
{"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // You LOSE!
|
||||||
{"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
|
@ -183,6 +187,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
||||||
{"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
{"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
|
{"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
|
|
||||||
// Menu, interface
|
// Menu, interface
|
||||||
{"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
{"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR},
|
||||||
|
|
|
@ -229,6 +229,10 @@ typedef enum
|
||||||
sfx_rail2,
|
sfx_rail2,
|
||||||
sfx_rlaunc,
|
sfx_rlaunc,
|
||||||
sfx_shield,
|
sfx_shield,
|
||||||
|
sfx_wirlsg,
|
||||||
|
sfx_forcsg,
|
||||||
|
sfx_elemsg,
|
||||||
|
sfx_armasg,
|
||||||
sfx_shldls,
|
sfx_shldls,
|
||||||
sfx_spdpad,
|
sfx_spdpad,
|
||||||
sfx_spkdth,
|
sfx_spkdth,
|
||||||
|
@ -246,6 +250,7 @@ typedef enum
|
||||||
sfx_wdjump,
|
sfx_wdjump,
|
||||||
sfx_mswarp,
|
sfx_mswarp,
|
||||||
sfx_mspogo,
|
sfx_mspogo,
|
||||||
|
sfx_boingf,
|
||||||
|
|
||||||
// Menu, interface
|
// Menu, interface
|
||||||
sfx_chchng,
|
sfx_chchng,
|
||||||
|
|
|
@ -99,6 +99,9 @@ static patch_t *ringshield;
|
||||||
static patch_t *watershield;
|
static patch_t *watershield;
|
||||||
static patch_t *bombshield;
|
static patch_t *bombshield;
|
||||||
static patch_t *pityshield;
|
static patch_t *pityshield;
|
||||||
|
static patch_t *flameshield;
|
||||||
|
static patch_t *bubbleshield;
|
||||||
|
static patch_t *thundershield;
|
||||||
static patch_t *invincibility;
|
static patch_t *invincibility;
|
||||||
static patch_t *sneakers;
|
static patch_t *sneakers;
|
||||||
static patch_t *gravboots;
|
static patch_t *gravboots;
|
||||||
|
@ -288,15 +291,18 @@ void ST_LoadGraphics(void)
|
||||||
scatterring = W_CachePatchName("SCATIND", PU_HUDGFX);
|
scatterring = W_CachePatchName("SCATIND", PU_HUDGFX);
|
||||||
grenadering = W_CachePatchName("GRENIND", PU_HUDGFX);
|
grenadering = W_CachePatchName("GRENIND", PU_HUDGFX);
|
||||||
railring = W_CachePatchName("RAILIND", PU_HUDGFX);
|
railring = W_CachePatchName("RAILIND", PU_HUDGFX);
|
||||||
jumpshield = W_CachePatchName("WHTVB0", PU_HUDGFX);
|
jumpshield = W_CachePatchName("TVWWC0", PU_HUDGFX);
|
||||||
forceshield = W_CachePatchName("BLTVB0", PU_HUDGFX);
|
forceshield = W_CachePatchName("TVFOC0", PU_HUDGFX);
|
||||||
ringshield = W_CachePatchName("YLTVB0", PU_HUDGFX);
|
ringshield = W_CachePatchName("TVATC0", PU_HUDGFX);
|
||||||
watershield = W_CachePatchName("ELTVB0", PU_HUDGFX);
|
watershield = W_CachePatchName("TVELC0", PU_HUDGFX);
|
||||||
bombshield = W_CachePatchName("BKTVB0", PU_HUDGFX);
|
bombshield = W_CachePatchName("TVARC0", PU_HUDGFX);
|
||||||
pityshield = W_CachePatchName("GRTVB0", PU_HUDGFX);
|
pityshield = W_CachePatchName("TVPIC0", PU_HUDGFX);
|
||||||
invincibility = W_CachePatchName("PINVB0", PU_HUDGFX);
|
flameshield = W_CachePatchName("TVFLC0", PU_HUDGFX);
|
||||||
sneakers = W_CachePatchName("SHTVB0", PU_HUDGFX);
|
bubbleshield = W_CachePatchName("TVBBC0", PU_HUDGFX);
|
||||||
gravboots = W_CachePatchName("GBTVB0", PU_HUDGFX);
|
thundershield = W_CachePatchName("TVZPC0", PU_HUDGFX);
|
||||||
|
invincibility = W_CachePatchName("TVIVC0", PU_HUDGFX);
|
||||||
|
sneakers = W_CachePatchName("TVSSC0", PU_HUDGFX);
|
||||||
|
gravboots = W_CachePatchName("TVGVC0", PU_HUDGFX);
|
||||||
|
|
||||||
tagico = W_CachePatchName("TAGICO", PU_HUDGFX);
|
tagico = W_CachePatchName("TAGICO", PU_HUDGFX);
|
||||||
rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX);
|
rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX);
|
||||||
|
@ -576,12 +582,13 @@ static void ST_drawDebugInfo(void)
|
||||||
V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime]));
|
V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime]));
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
V_DrawRightAlignedString(304-74, height - 72, V_MONOSPACE, "PF:");
|
V_DrawRightAlignedString(304-92, height - 72, V_MONOSPACE, "PF:");
|
||||||
V_DrawString(304-72, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM");
|
V_DrawString(304-90, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM");
|
||||||
V_DrawString(304-54, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD");
|
V_DrawString(304-72, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD");
|
||||||
V_DrawString(304-36, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP");
|
V_DrawString(304-54, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP");
|
||||||
V_DrawString(304-18, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST");
|
V_DrawString(304-36, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST");
|
||||||
V_DrawString(304, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH");
|
V_DrawString(304-18, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH");
|
||||||
|
V_DrawString(304, height - 72, (stplyr->pflags & PF_SHIELDABILITY) ? V_GREENMAP : V_REDMAP, "SH");
|
||||||
|
|
||||||
V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS));
|
V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS));
|
||||||
V_DrawRightAlignedString(320, height - 56, V_MONOSPACE, va("FLOORZ: %6d", stplyr->mo->floorz>>FRACBITS));
|
V_DrawRightAlignedString(320, height - 56, V_MONOSPACE, va("FLOORZ: %6d", stplyr->mo->floorz>>FRACBITS));
|
||||||
|
@ -672,9 +679,9 @@ static void ST_drawTime(void)
|
||||||
|
|
||||||
static inline void ST_drawRings(void)
|
static inline void ST_drawRings(void)
|
||||||
{
|
{
|
||||||
INT32 ringnum = max(stplyr->health-1, 0);
|
INT32 ringnum = max(stplyr->rings, 0);
|
||||||
|
|
||||||
ST_DrawPatchFromHudWS(HUD_RINGS, ((stplyr->health <= 1 && leveltime/5 & 1) ? rrings : sborings));
|
ST_DrawPatchFromHudWS(HUD_RINGS, ((stplyr->rings <= 0 && leveltime/5 & 1) ? rrings : sborings));
|
||||||
|
|
||||||
if (objectplacing)
|
if (objectplacing)
|
||||||
ringnum = op_currentdoomednum;
|
ringnum = op_currentdoomednum;
|
||||||
|
@ -683,8 +690,8 @@ static inline void ST_drawRings(void)
|
||||||
INT32 i;
|
INT32 i;
|
||||||
ringnum = 0;
|
ringnum = 0;
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i] && players[i].mo && players[i].mo->health > 1)
|
if (playeringame[i] && players[i].mo && players[i].rings > 0)
|
||||||
ringnum += players[i].mo->health - 1;
|
ringnum += players[i].rings;
|
||||||
}
|
}
|
||||||
|
|
||||||
ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum);
|
ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum);
|
||||||
|
@ -806,18 +813,21 @@ static void ST_drawFirstPersonHUD(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right
|
// Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right
|
||||||
if (player->powers[pw_shield] & SH_FORCE)
|
if ((player->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE)
|
||||||
{
|
{
|
||||||
if ((player->powers[pw_shield] & 0xFF) > 0 || leveltime & 1)
|
if ((player->powers[pw_shield] & SH_FORCEHP) > 0 || leveltime & 1)
|
||||||
p = forceshield;
|
p = forceshield;
|
||||||
}
|
}
|
||||||
else switch (player->powers[pw_shield] & SH_NOSTACK)
|
else switch (player->powers[pw_shield] & SH_NOSTACK)
|
||||||
{
|
{
|
||||||
case SH_JUMP: p = jumpshield; break;
|
case SH_WHIRLWIND: p = jumpshield; break;
|
||||||
case SH_ELEMENTAL: p = watershield; break;
|
case SH_ELEMENTAL: p = watershield; break;
|
||||||
case SH_BOMB: p = bombshield; break;
|
case SH_ARMAGEDDON: p = bombshield; break;
|
||||||
case SH_ATTRACT: p = ringshield; break;
|
case SH_ATTRACT: p = ringshield; break;
|
||||||
case SH_PITY: p = pityshield; break;
|
case SH_PITY: p = pityshield; break;
|
||||||
|
case SH_FLAMEAURA: p = flameshield; break;
|
||||||
|
case SH_BUBBLEWRAP: p = bubbleshield; break;
|
||||||
|
case SH_THUNDERCOIN: p = thundershield; break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1153,11 +1163,11 @@ static void ST_drawNiGHTSHUD(void)
|
||||||
INT32 i;
|
INT32 i;
|
||||||
total_ringcount = 0;
|
total_ringcount = 0;
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ && players[i].health)
|
if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ && players[i].rings)
|
||||||
total_ringcount += players[i].health - 1;
|
total_ringcount += players[i].rings;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
total_ringcount = stplyr->health-1;
|
total_ringcount = stplyr->rings;
|
||||||
|
|
||||||
if (stplyr->capsule)
|
if (stplyr->capsule)
|
||||||
{
|
{
|
||||||
|
@ -1369,7 +1379,7 @@ static void ST_drawWeaponRing(powertype_t weapon, INT32 rwflag, INT32 wepflag, I
|
||||||
txtflags |= V_YELLOWMAP;
|
txtflags |= V_YELLOWMAP;
|
||||||
|
|
||||||
if (weapon == pw_infinityring
|
if (weapon == pw_infinityring
|
||||||
|| (stplyr->ringweapons & rwflag && stplyr->health > 1))
|
|| (stplyr->ringweapons & rwflag))
|
||||||
txtflags |= V_20TRANS;
|
txtflags |= V_20TRANS;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1407,7 +1417,7 @@ static void ST_drawMatchHUD(void)
|
||||||
|
|
||||||
if (stplyr->powers[pw_infinityring])
|
if (stplyr->powers[pw_infinityring])
|
||||||
ST_drawWeaponRing(pw_infinityring, 0, 0, offset, infinityring);
|
ST_drawWeaponRing(pw_infinityring, 0, 0, offset, infinityring);
|
||||||
else if (stplyr->health > 1)
|
else if (stplyr->rings > 0)
|
||||||
V_DrawScaledPatch(8 + offset, STRINGY(162), V_SNAPTOLEFT, normring);
|
V_DrawScaledPatch(8 + offset, STRINGY(162), V_SNAPTOLEFT, normring);
|
||||||
else
|
else
|
||||||
V_DrawTranslucentPatch(8 + offset, STRINGY(162), V_SNAPTOLEFT|V_80TRANS, normring);
|
V_DrawTranslucentPatch(8 + offset, STRINGY(162), V_SNAPTOLEFT|V_80TRANS, normring);
|
||||||
|
|
|
@ -770,6 +770,13 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
||||||
if (!screens[0])
|
if (!screens[0])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (c & V_NOSCALESTART)
|
||||||
|
{
|
||||||
|
dest = screens[0] + y*vid.width + x;
|
||||||
|
deststop = screens[0] + vid.rowbytes * vid.height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||||
{ // Clear the entire screen, from dest to deststop. Yes, this really works.
|
{ // Clear the entire screen, from dest to deststop. Yes, this really works.
|
||||||
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
|
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
|
||||||
|
@ -809,6 +816,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
||||||
dest += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width / 2;
|
dest += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
c &= 255;
|
c &= 255;
|
||||||
|
|
||||||
|
@ -964,45 +972,38 @@ void V_DrawFadeScreen(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simple translucency with one color, over a set number of lines starting from the top.
|
// Simple translucency with one color, over a set number of lines starting from the top.
|
||||||
void V_DrawFadeConsBack(INT32 plines, INT32 pcolor)
|
void V_DrawFadeConsBack(INT32 plines)
|
||||||
{
|
{
|
||||||
UINT8 *deststop, *colormap, *buf;
|
UINT8 *deststop, *buf;
|
||||||
|
|
||||||
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
||||||
if (rendermode != render_soft && rendermode != render_none)
|
if (rendermode != render_soft && rendermode != render_none)
|
||||||
{
|
{
|
||||||
UINT32 hwcolor;
|
UINT32 hwcolor;
|
||||||
switch (pcolor)
|
switch (cons_backcolor.value)
|
||||||
{
|
{
|
||||||
case 0: hwcolor = 0xffffff00; break; //white
|
case 0: hwcolor = 0xffffff00; break; // White
|
||||||
case 1: hwcolor = 0xff800000; break; //orange
|
case 1: hwcolor = 0x80808000; break; // Gray
|
||||||
case 2: hwcolor = 0x0000ff00; break; //blue
|
case 2: hwcolor = 0x40201000; break; // Brown
|
||||||
case 3: hwcolor = 0x00800000; break; //green
|
case 3: hwcolor = 0xff000000; break; // Red
|
||||||
case 4: hwcolor = 0x80808000; break; //gray
|
case 4: hwcolor = 0xff800000; break; // Orange
|
||||||
case 5: hwcolor = 0xff000000; break; //red
|
case 5: hwcolor = 0x80800000; break; // Yellow
|
||||||
default: hwcolor = 0x00800000; break; //green
|
case 6: hwcolor = 0x00800000; break; // Green
|
||||||
|
case 7: hwcolor = 0x0000ff00; break; // Blue
|
||||||
|
case 8: hwcolor = 0x4080ff00; break; // Cyan
|
||||||
|
// Default green
|
||||||
|
default: hwcolor = 0x00800000; break;
|
||||||
}
|
}
|
||||||
HWR_DrawConsoleBack(hwcolor, plines);
|
HWR_DrawConsoleBack(hwcolor, plines);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (pcolor)
|
|
||||||
{
|
|
||||||
case 0: colormap = cwhitemap; break;
|
|
||||||
case 1: colormap = corangemap; break;
|
|
||||||
case 2: colormap = cbluemap; break;
|
|
||||||
case 3: colormap = cgreenmap; break;
|
|
||||||
case 4: colormap = cgraymap; break;
|
|
||||||
case 5: colormap = credmap; break;
|
|
||||||
default: colormap = cgreenmap; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// heavily simplified -- we don't need to know x or y position,
|
// heavily simplified -- we don't need to know x or y position,
|
||||||
// just the stop position
|
// just the stop position
|
||||||
deststop = screens[0] + vid.rowbytes * min(plines, vid.height);
|
deststop = screens[0] + vid.rowbytes * min(plines, vid.height);
|
||||||
for (buf = screens[0]; buf < deststop; ++buf)
|
for (buf = screens[0]; buf < deststop; ++buf)
|
||||||
*buf = colormap[*buf];
|
*buf = consolebgmap[*buf];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets string colormap, used for 0x80 color codes
|
// Gets string colormap, used for 0x80 color codes
|
||||||
|
|
|
@ -145,7 +145,7 @@ void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum);
|
||||||
// fade down the screen buffer before drawing the menu over
|
// fade down the screen buffer before drawing the menu over
|
||||||
void V_DrawFadeScreen(void);
|
void V_DrawFadeScreen(void);
|
||||||
|
|
||||||
void V_DrawFadeConsBack(INT32 plines, INT32 pcolor);
|
void V_DrawFadeConsBack(INT32 plines);
|
||||||
|
|
||||||
// draw a single character
|
// draw a single character
|
||||||
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
|
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
|
||||||
|
|
|
@ -3598,6 +3598,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
return putenv(variable);
|
return putenv(variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
typedef BOOL (WINAPI *p_IsProcessorFeaturePresent) (DWORD);
|
typedef BOOL (WINAPI *p_IsProcessorFeaturePresent) (DWORD);
|
||||||
|
|
||||||
const CPUInfoFlags *I_CPUInfo(void)
|
const CPUInfoFlags *I_CPUInfo(void)
|
||||||
|
|
|
@ -3470,6 +3470,18 @@ INT32 I_PutEnv(char *variable)
|
||||||
return putenv(variable);
|
return putenv(variable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 I_ClipboardCopy(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
(void)size;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *I_ClipboardPaste(void)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
typedef BOOL (WINAPI *MyFunc3) (DWORD);
|
typedef BOOL (WINAPI *MyFunc3) (DWORD);
|
||||||
|
|
||||||
const CPUInfoFlags *I_CPUInfo(void)
|
const CPUInfoFlags *I_CPUInfo(void)
|
||||||
|
|
|
@ -839,13 +839,13 @@ static void Y_UpdateRecordReplays(void)
|
||||||
if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time))
|
if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time))
|
||||||
mainrecords[gamemap-1]->time = players[consoleplayer].realtime;
|
mainrecords[gamemap-1]->time = players[consoleplayer].realtime;
|
||||||
|
|
||||||
if ((UINT16)(players[consoleplayer].health - 1) > mainrecords[gamemap-1]->rings)
|
if ((UINT16)(players[consoleplayer].rings) > mainrecords[gamemap-1]->rings)
|
||||||
mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].health - 1);
|
mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].rings);
|
||||||
|
|
||||||
// Save demo!
|
// Save demo!
|
||||||
bestdemo[255] = '\0';
|
bestdemo[255] = '\0';
|
||||||
lastdemo[255] = '\0';
|
lastdemo[255] = '\0';
|
||||||
G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].health-1));
|
G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].rings));
|
||||||
G_CheckDemoStatus();
|
G_CheckDemoStatus();
|
||||||
|
|
||||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||||
|
@ -1435,7 +1435,7 @@ static void Y_CalculateCompetitionWinners(void)
|
||||||
bestat[j] = true;
|
bestat[j] = true;
|
||||||
|
|
||||||
times[i] = players[i].realtime;
|
times[i] = players[i].realtime;
|
||||||
rings[i] = (UINT32)max(players[i].health-1, 0);
|
rings[i] = (UINT32)max(players[i].rings, 0);
|
||||||
maxrings[i] = (UINT32)players[i].totalring;
|
maxrings[i] = (UINT32)players[i].totalring;
|
||||||
monitors[i] = (UINT32)players[i].numboxes;
|
monitors[i] = (UINT32)players[i].numboxes;
|
||||||
scores[i] = (UINT32)min(players[i].score, 99999990);
|
scores[i] = (UINT32)min(players[i].score, 99999990);
|
||||||
|
@ -1450,7 +1450,7 @@ static void Y_CalculateCompetitionWinners(void)
|
||||||
else
|
else
|
||||||
bestat[0] = false;
|
bestat[0] = false;
|
||||||
|
|
||||||
if (max(players[i].health-1, 0) >= max(players[j].health-1, 0))
|
if (max(players[i].rings, 0) >= max(players[j].rings, 0))
|
||||||
points[i]++;
|
points[i]++;
|
||||||
else
|
else
|
||||||
bestat[1] = false;
|
bestat[1] = false;
|
||||||
|
@ -1573,7 +1573,7 @@ static void Y_SetRingBonus(player_t *player, y_bonus_t *bstruct)
|
||||||
{
|
{
|
||||||
strncpy(bstruct->patch, "YB_RING", sizeof(bstruct->patch));
|
strncpy(bstruct->patch, "YB_RING", sizeof(bstruct->patch));
|
||||||
bstruct->display = true;
|
bstruct->display = true;
|
||||||
bstruct->points = max(0, (player->health-1) * 100);
|
bstruct->points = max(0, (player->rings) * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1621,7 +1621,7 @@ static void Y_SetPerfectBonus(player_t *player, y_bonus_t *bstruct)
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i]) continue;
|
if (!playeringame[i]) continue;
|
||||||
sharedringtotal += players[i].health - 1;
|
sharedringtotal += players[i].rings;
|
||||||
}
|
}
|
||||||
if (!sharedringtotal || sharedringtotal < nummaprings)
|
if (!sharedringtotal || sharedringtotal < nummaprings)
|
||||||
data.coop.gotperfbonus = 0;
|
data.coop.gotperfbonus = 0;
|
||||||
|
|
Loading…
Reference in a new issue