mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 10:31:42 +00:00
Merge branch 'master' into gametype-strings
This commit is contained in:
commit
025891d2aa
19 changed files with 827 additions and 507 deletions
|
@ -2521,12 +2521,18 @@ static void Command_Nodes(void)
|
|||
|
||||
static void Command_Ban(void)
|
||||
{
|
||||
if (COM_Argc() == 1)
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("Ban <playername/playernum> <reason>: ban and kick a player\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!netgame) // Don't kick Tails in splitscreen!
|
||||
{
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
|
@ -2536,8 +2542,9 @@ static void Command_Ban(void)
|
|||
|
||||
if (pn == -1 || pn == 0)
|
||||
return;
|
||||
else
|
||||
WRITEUINT8(p, pn);
|
||||
|
||||
WRITEUINT8(p, pn);
|
||||
|
||||
if (server && I_Ban && !I_Ban(node)) // only the server is allowed to do this right now
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
|
||||
|
@ -2580,21 +2587,27 @@ static void Command_Ban(void)
|
|||
|
||||
static void Command_Kick(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
|
||||
if (COM_Argc() == 1)
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("kick <playername/playernum> <reason>: kick a player\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!netgame) // Don't kick Tails in splitscreen!
|
||||
{
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
const SINT8 pn = nametonum(COM_Argv(1));
|
||||
WRITESINT8(p, pn);
|
||||
|
||||
if (pn == -1 || pn == 0)
|
||||
return;
|
||||
|
||||
// Special case if we are trying to kick a player who is downloading the game state:
|
||||
// trigger a timeout instead of kicking them, because a kick would only
|
||||
// take effect after they have finished downloading
|
||||
|
@ -2603,6 +2616,9 @@ static void Command_Kick(void)
|
|||
Net_ConnectionTimeout(playernode[pn]);
|
||||
return;
|
||||
}
|
||||
|
||||
WRITESINT8(p, pn);
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
{
|
||||
WRITEUINT8(p, KICK_MSG_GO_AWAY);
|
||||
|
|
68
src/d_main.c
68
src/d_main.c
|
@ -107,8 +107,6 @@ UINT8 window_notinfocus = false;
|
|||
//
|
||||
// DEMO LOOP
|
||||
//
|
||||
//static INT32 demosequence;
|
||||
static const char *pagename = "MAP1PIC";
|
||||
static char *startupwadfiles[MAX_WADFILES];
|
||||
|
||||
boolean devparm = false; // started game with -devparm
|
||||
|
@ -721,7 +719,6 @@ void D_StartTitle(void)
|
|||
|
||||
gameaction = ga_nothing;
|
||||
displayplayer = consoleplayer = 0;
|
||||
//demosequence = -1;
|
||||
gametype = GT_COOP;
|
||||
paused = false;
|
||||
advancedemo = false;
|
||||
|
@ -886,27 +883,10 @@ static void IdentifyVersion(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
/* ======================================================================== */
|
||||
// Just print the nice red titlebar like the original SRB2 for DOS.
|
||||
/* ======================================================================== */
|
||||
#ifdef PC_DOS
|
||||
static inline void D_Titlebar(char *title1, char *title2)
|
||||
{
|
||||
// SRB2 banner
|
||||
clrscr();
|
||||
textattr((BLUE<<4)+WHITE);
|
||||
clreol();
|
||||
cputs(title1);
|
||||
|
||||
// standard srb2 banner
|
||||
textattr((RED<<4)+WHITE);
|
||||
clreol();
|
||||
gotoxy((80-strlen(title2))/2, 2);
|
||||
cputs(title2);
|
||||
normvideo();
|
||||
gotoxy(1,3);
|
||||
}
|
||||
#endif
|
||||
/* ======================================================================== */
|
||||
// Code for printing SRB2's title bar in DOS
|
||||
/* ======================================================================== */
|
||||
|
||||
//
|
||||
// Center the title string, then add the date and time of compilation.
|
||||
|
@ -935,6 +915,31 @@ static inline void D_MakeTitleString(char *s)
|
|||
strcpy(s, temp);
|
||||
}
|
||||
|
||||
static inline void D_Titlebar(void)
|
||||
{
|
||||
char title1[82]; // srb2 title banner
|
||||
char title2[82];
|
||||
|
||||
strcpy(title1, "Sonic Robo Blast 2");
|
||||
strcpy(title2, "Sonic Robo Blast 2");
|
||||
|
||||
D_MakeTitleString(title1);
|
||||
|
||||
// SRB2 banner
|
||||
clrscr();
|
||||
textattr((BLUE<<4)+WHITE);
|
||||
clreol();
|
||||
cputs(title1);
|
||||
|
||||
// standard srb2 banner
|
||||
textattr((RED<<4)+WHITE);
|
||||
clreol();
|
||||
gotoxy((80-strlen(title2))/2, 2);
|
||||
cputs(title2);
|
||||
normvideo();
|
||||
gotoxy(1,3);
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// D_SRB2Main
|
||||
|
@ -942,8 +947,6 @@ static inline void D_MakeTitleString(char *s)
|
|||
void D_SRB2Main(void)
|
||||
{
|
||||
INT32 p;
|
||||
char srb2[82]; // srb2 title banner
|
||||
char title[82];
|
||||
|
||||
INT32 pstartmap = 1;
|
||||
boolean autostart = false;
|
||||
|
@ -986,20 +989,8 @@ void D_SRB2Main(void)
|
|||
dedicated = M_CheckParm("-dedicated") != 0;
|
||||
#endif
|
||||
|
||||
strcpy(title, "Sonic Robo Blast 2");
|
||||
strcpy(srb2, "Sonic Robo Blast 2");
|
||||
D_MakeTitleString(srb2);
|
||||
|
||||
#ifdef PC_DOS
|
||||
D_Titlebar(srb2, title);
|
||||
#endif
|
||||
|
||||
#if defined (__OS2__) && !defined (HAVE_SDL)
|
||||
// set PM window title
|
||||
snprintf(pmData->title, sizeof (pmData->title),
|
||||
"Sonic Robo Blast 2" VERSIONSTRING ": %s",
|
||||
title);
|
||||
pmData->title[sizeof (pmData->title) - 1] = '\0';
|
||||
D_Titlebar();
|
||||
#endif
|
||||
|
||||
if (devparm)
|
||||
|
@ -1395,7 +1386,6 @@ void D_SRB2Main(void)
|
|||
|
||||
if (dedicated && server)
|
||||
{
|
||||
pagename = "TITLESKY";
|
||||
levelstarttic = gametic;
|
||||
G_SetGamestate(GS_LEVEL);
|
||||
if (!P_SetupLevel(false))
|
||||
|
|
381
src/dehacked.c
381
src/dehacked.c
|
@ -382,56 +382,6 @@ static void clear_levels(void)
|
|||
P_AllocMapHeader(gamemap-1);
|
||||
}
|
||||
|
||||
/*
|
||||
// Edits an animated texture slot on the array
|
||||
// Tails 12-27-2003
|
||||
static void readAnimTex(MYFILE *f, INT32 num)
|
||||
{
|
||||
char s[MAXLINELEN];
|
||||
char *word;
|
||||
char *word2;
|
||||
INT32 i;
|
||||
|
||||
do {
|
||||
if (myfgets(s, sizeof s, f) != NULL)
|
||||
{
|
||||
if (s[0] == '\n') break;
|
||||
|
||||
tmp = strchr(s, '#');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
// set the value in the appropriate field
|
||||
|
||||
word = strtok(s, " ");
|
||||
if (word)
|
||||
strupr(word);
|
||||
else
|
||||
break;
|
||||
|
||||
word2 = strtok(NULL, " = ");
|
||||
if (word2)
|
||||
strupr(word2);
|
||||
else
|
||||
break;
|
||||
|
||||
if (word2[strlen(word2)-1] == '\n')
|
||||
word2[strlen(word2)-1] = '\0';
|
||||
|
||||
i = atoi(word2);
|
||||
|
||||
if (fastcmp(word, "START"))
|
||||
strncpy(harddefs[num].startname, word2, 8);
|
||||
if (fastcmp(word, "END"))
|
||||
strncpy(harddefs[num].endname, word2, 8);
|
||||
else if (fastcmp(word, "SPEED")) harddefs[num].speed = i;
|
||||
else if (fastcmp(word, "ISTEXTURE")) harddefs[num].istexture = i;
|
||||
|
||||
else deh_warning("readAnimTex %d: unknown word '%s'", num, word);
|
||||
}
|
||||
} while (s[0] != '\n' && !myfeof(f)); //finish when the line is empty
|
||||
}
|
||||
*/
|
||||
|
||||
static boolean findFreeSlot(INT32 *num)
|
||||
{
|
||||
// Send the character select entry to a free slot.
|
||||
|
@ -2106,7 +2056,7 @@ static void readframe(MYFILE *f, INT32 num)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[])
|
||||
static void readsound(MYFILE *f, INT32 num)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word;
|
||||
|
@ -2142,21 +2092,7 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[])
|
|||
continue;
|
||||
}
|
||||
|
||||
/* if (fastcmp(word, "OFFSET"))
|
||||
{
|
||||
value -= 150360;
|
||||
if (value <= 64)
|
||||
value /= 8;
|
||||
else if (value <= 260)
|
||||
value = (value+4)/8;
|
||||
else
|
||||
value = (value+8)/8;
|
||||
if (value >= -1 && value < sfx_freeslot0 - 1)
|
||||
S_sfx[num].name = savesfxnames[value+1];
|
||||
else
|
||||
deh_warning("Sound %d: offset out of bounds", num);
|
||||
}
|
||||
else */if (fastcmp(word, "SINGULAR"))
|
||||
if (fastcmp(word, "SINGULAR"))
|
||||
{
|
||||
DEH_WriteUndoline(word, va("%d", S_sfx[num].singularity), UNDO_NONE);
|
||||
S_sfx[num].singularity = value;
|
||||
|
@ -2182,8 +2118,6 @@ static void readsound(MYFILE *f, INT32 num, const char *savesfxnames[])
|
|||
} while (!myfeof(f));
|
||||
|
||||
Z_Free(s);
|
||||
|
||||
(void)savesfxnames;
|
||||
}
|
||||
|
||||
/** Checks if a game data file name for a mod is good.
|
||||
|
@ -2811,190 +2745,6 @@ static void readconditionset(MYFILE *f, UINT8 setnum)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
static void readtexture(MYFILE *f, const char *name)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word;
|
||||
char *word2;
|
||||
char *tmp;
|
||||
INT32 i, j, value;
|
||||
UINT16 width = 0, height = 0;
|
||||
INT16 patchcount = 0;
|
||||
texture_t *texture;
|
||||
|
||||
do
|
||||
{
|
||||
if (myfgets(s, MAXLINELEN, f))
|
||||
{
|
||||
if (s[0] == '\n')
|
||||
break;
|
||||
|
||||
tmp = strchr(s, '#');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
|
||||
value = searchvalue(s);
|
||||
word = strtok(s, " ");
|
||||
if (word)
|
||||
strupr(word);
|
||||
else
|
||||
break;
|
||||
|
||||
word2 = strtok(NULL, " ");
|
||||
if (word2)
|
||||
strupr(word2);
|
||||
else
|
||||
break;
|
||||
|
||||
// Width of the texture.
|
||||
if (fastcmp(word, "WIDTH"))
|
||||
{
|
||||
DEH_WriteUndoline(word, va("%d", width), UNDO_NONE);
|
||||
width = SHORT((UINT16)value);
|
||||
}
|
||||
// Height of the texture.
|
||||
else if (fastcmp(word, "HEIGHT"))
|
||||
{
|
||||
DEH_WriteUndoline(word, va("%d", height), UNDO_NONE);
|
||||
height = SHORT((UINT16)value);
|
||||
}
|
||||
// Number of patches the texture has.
|
||||
else if (fastcmp(word, "NUMPATCHES"))
|
||||
{
|
||||
DEH_WriteUndoline(word, va("%d", patchcount), UNDO_NONE);
|
||||
patchcount = SHORT((UINT16)value);
|
||||
}
|
||||
else
|
||||
deh_warning("readtexture: unknown word '%s'", word);
|
||||
}
|
||||
} while (!myfeof(f));
|
||||
|
||||
// Error checking.
|
||||
if (!width)
|
||||
I_Error("Texture %s has no width!\n", name);
|
||||
|
||||
if (!height)
|
||||
I_Error("Texture %s has no height!\n", name);
|
||||
|
||||
if (!patchcount)
|
||||
I_Error("Texture %s has no patches!\n", name);
|
||||
|
||||
// Allocate memory for the texture, and fill in information.
|
||||
texture = Z_Calloc(sizeof(texture_t) + (sizeof(texpatch_t) * SHORT(patchcount)), PU_STATIC, NULL);
|
||||
M_Memcpy(texture->name, name, sizeof(texture->name));
|
||||
texture->width = width;
|
||||
texture->height = height;
|
||||
texture->patchcount = patchcount;
|
||||
texture->holes = false;
|
||||
// Fill out the texture patches, to allow them to be detected
|
||||
// accurately by readpatch.
|
||||
for (i = 0; i < patchcount; i++)
|
||||
{
|
||||
texture->patches[i].originx = 0;
|
||||
texture->patches[i].originy = 0;
|
||||
texture->patches[i].wad = UINT16_MAX;
|
||||
texture->patches[i].lump = UINT16_MAX;
|
||||
}
|
||||
|
||||
// Jump to the next empty texture entry.
|
||||
i = 0;
|
||||
while (textures[i])
|
||||
i++;
|
||||
|
||||
// Fill the global texture buffer entries.
|
||||
j = 1;
|
||||
while (j << 1 <= texture->width)
|
||||
j <<= 1;
|
||||
|
||||
textures[i] = texture;
|
||||
texturewidthmask[i] = j - 1;
|
||||
textureheight[i] = texture->height << FRACBITS;
|
||||
|
||||
// Clean up.
|
||||
Z_Free(s);
|
||||
}
|
||||
|
||||
static void readpatch(MYFILE *f, const char *name, UINT16 wad)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word;
|
||||
char *word2;
|
||||
char *tmp;
|
||||
INT32 i = 0, j = 0, value;
|
||||
texpatch_t patch = {0, 0, UINT16_MAX, UINT16_MAX, 0, 255, AST_COPY};
|
||||
|
||||
// Jump to the texture this patch belongs to, which,
|
||||
// coincidentally, is always the last one on the buffer cache.
|
||||
while (textures[i+1])
|
||||
i++;
|
||||
|
||||
// Jump to the next empty patch entry.
|
||||
while (memcmp(&(textures[i]->patches[j]), &patch, sizeof(patch)))
|
||||
j++;
|
||||
|
||||
patch.wad = wad;
|
||||
// Set the texture number, but only if the lump exists.
|
||||
if ((patch.lump = W_CheckNumForNamePwad(name, wad, 0)) == INT16_MAX)
|
||||
I_Error("readpatch: Missing patch in texture %s", textures[i]->name);
|
||||
|
||||
// note: undoing this patch will be done by other means
|
||||
do
|
||||
{
|
||||
if (myfgets(s, MAXLINELEN, f))
|
||||
{
|
||||
if (s[0] == '\n')
|
||||
break;
|
||||
|
||||
tmp = strchr(s, '#');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
|
||||
value = searchvalue(s);
|
||||
word = strtok(s, " ");
|
||||
if (word)
|
||||
strupr(word);
|
||||
else
|
||||
break;
|
||||
|
||||
word2 = strtok(NULL, " ");
|
||||
if (word2)
|
||||
strupr(word2);
|
||||
else
|
||||
break;
|
||||
|
||||
// X position of the patch in the texture.
|
||||
if (fastcmp(word, "X"))
|
||||
{
|
||||
//DEH_WriteUndoline(word, va("%d", patch->originx), UNDO_NONE);
|
||||
patch.originx = (INT16)value;
|
||||
}
|
||||
// Y position of the patch in the texture.
|
||||
else if (fastcmp(word, "Y"))
|
||||
{
|
||||
//DEH_WriteUndoline(word, va("%d", patch->originy), UNDO_NONE);
|
||||
patch.originy = (INT16)value;
|
||||
}
|
||||
else
|
||||
deh_warning("readpatch: unknown word '%s'", word);
|
||||
}
|
||||
} while (!myfeof(f));
|
||||
|
||||
// Error checking.
|
||||
/* // Irrelevant. Origins cannot be unsigned.
|
||||
if (patch.originx == UINT16_MAX)
|
||||
I_Error("Patch %s on texture %s has no X position!\n", name, textures[i]->name);
|
||||
|
||||
if (patch.originy == UINT16_MAX)
|
||||
I_Error("Patch %s on texture %s has no Y position!\n", name, textures[i]->name);
|
||||
*/
|
||||
|
||||
// Set the patch as that patch number.
|
||||
textures[i]->patches[j] = patch;
|
||||
|
||||
// Clean up.
|
||||
Z_Free(s);
|
||||
}
|
||||
|
||||
static void readmaincfg(MYFILE *f)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
|
@ -3405,30 +3155,17 @@ static void ignorelines(MYFILE *f)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
||||
static void DEH_LoadDehackedFile(MYFILE *f)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word;
|
||||
char *word2;
|
||||
INT32 i;
|
||||
// do a copy of this for cross references probleme
|
||||
//XBOXSTATIC actionf_t saveactions[NUMSTATES];
|
||||
//XBOXSTATIC const char *savesprnames[NUMSPRITES];
|
||||
XBOXSTATIC const char *savesfxnames[NUMSFX];
|
||||
|
||||
if (!deh_loaded)
|
||||
initfreeslots();
|
||||
|
||||
deh_num_warning = 0;
|
||||
// save values for cross reference
|
||||
/*
|
||||
for (i = 0; i < NUMSTATES; i++)
|
||||
saveactions[i] = states[i].action;
|
||||
for (i = 0; i < NUMSPRITES; i++)
|
||||
savesprnames[i] = sprnames[i];
|
||||
*/
|
||||
for (i = 0; i < NUMSFX; i++)
|
||||
savesfxnames[i] = S_sfx[i].name;
|
||||
|
||||
gamedataadded = false;
|
||||
|
||||
|
@ -3505,19 +3242,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
if (word2[strlen(word2)-1] == '\n')
|
||||
word2[strlen(word2)-1] = '\0';
|
||||
i = atoi(word2);
|
||||
if (fastcmp(word, "TEXTURE"))
|
||||
{
|
||||
// Read texture from spec file.
|
||||
readtexture(f, word2);
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
}
|
||||
else if (fastcmp(word, "PATCH"))
|
||||
{
|
||||
// Read patch from spec file.
|
||||
readpatch(f, word2, wad);
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
}
|
||||
else if (fastcmp(word, "THING") || fastcmp(word, "MOBJ") || fastcmp(word, "OBJECT"))
|
||||
if (fastcmp(word, "THING") || fastcmp(word, "MOBJ") || fastcmp(word, "OBJECT"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
i = get_mobjtype(word2); // find a thing by name
|
||||
|
@ -3530,10 +3255,6 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
}
|
||||
/* else if (fastcmp(word, "ANIMTEX"))
|
||||
{
|
||||
readAnimTex(f, i);
|
||||
}*/
|
||||
else if (fastcmp(word, "LIGHT"))
|
||||
{
|
||||
#ifdef HWRENDER
|
||||
|
@ -3605,34 +3326,12 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
}
|
||||
// <Callum> Added translations to this just in case its re-enabled
|
||||
/* else if (fastcmp(word, "POINTER"))
|
||||
{
|
||||
word = strtok(NULL, " "); // get frame
|
||||
word = strtok(NULL, ")");
|
||||
if (word)
|
||||
{
|
||||
i = atoi(word);
|
||||
if (i < NUMSTATES && i >= 0)
|
||||
{
|
||||
if (myfgets(s, MAXLINELEN, f))
|
||||
states[i].action = saveactions[searchvalue(s)];
|
||||
}
|
||||
else
|
||||
{
|
||||
deh_warning("Pointer: Frame %d doesn't exist", i);
|
||||
ignorelines(f);
|
||||
}
|
||||
}
|
||||
else
|
||||
deh_warning("pointer (Frame %d) : missing ')'", i);
|
||||
}*/
|
||||
else if (fastcmp(word, "SOUND"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
i = get_sfx(word2); // find a sound by name
|
||||
if (i < NUMSFX && i > 0)
|
||||
readsound(f, i, savesfxnames);
|
||||
readsound(f, i);
|
||||
else
|
||||
{
|
||||
deh_warning("Sound %d out of range (1 - %d)", i, NUMSFX-1);
|
||||
|
@ -3640,26 +3339,6 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
}
|
||||
/* else if (fastcmp(word, "SPRITE"))
|
||||
{
|
||||
if (i < NUMSPRITES && i >= 0)
|
||||
{
|
||||
if (myfgets(s, MAXLINELEN, f))
|
||||
{
|
||||
INT32 k;
|
||||
k = (searchvalue(s) - 151328)/8;
|
||||
if (k >= 0 && k < NUMSPRITES)
|
||||
sprnames[i] = savesprnames[k];
|
||||
else
|
||||
{
|
||||
deh_warning("Sprite %d: offset out of bounds", i);
|
||||
ignorelines(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
deh_warning("Sprite %d doesn't exist",i);
|
||||
}*/
|
||||
else if (fastcmp(word, "HUDITEM"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
|
@ -3746,7 +3425,10 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
// no undo support for this insanity yet
|
||||
//DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
}
|
||||
else if (fastcmp(word, "SRB2"))
|
||||
// Last I heard this crashes the game if you try to use it
|
||||
// so this is disabled for now
|
||||
// -- Monster Iestyn
|
||||
/* else if (fastcmp(word, "SRB2"))
|
||||
{
|
||||
INT32 ver = searchvalue(strtok(NULL, "\n"));
|
||||
if (ver != PATCHVERSION)
|
||||
|
@ -3757,6 +3439,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
// Unless you REALLY want to piss people off,
|
||||
// define a custom gamedata /before/ doing this!!
|
||||
// (then again, modifiedgame will prevent game data saving anyway)
|
||||
*/
|
||||
else if (fastcmp(word, "CLEAR"))
|
||||
{
|
||||
boolean clearall = (fastcmp(word2, "ALL"));
|
||||
|
@ -3830,7 +3513,7 @@ void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump)
|
|||
W_ReadLumpPwad(wad, lump, f.data);
|
||||
f.curpos = f.data;
|
||||
f.data[f.size] = 0;
|
||||
DEH_LoadDehackedFile(&f, wad);
|
||||
DEH_LoadDehackedFile(&f);
|
||||
DEH_WriteUndoline(va("# uload for wad: %u, lump: %u", wad, lump), NULL, UNDO_DONE);
|
||||
Z_Free(f.data);
|
||||
}
|
||||
|
@ -4838,12 +4521,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
// Individual Team Rings
|
||||
"S_TEAMRING",
|
||||
|
||||
// Special Stage Token
|
||||
"S_EMMY",
|
||||
|
||||
// Special Stage Token
|
||||
"S_TOKEN",
|
||||
"S_MOVINGTOKEN",
|
||||
|
||||
// CTF Flags
|
||||
"S_REDFLAG",
|
||||
|
@ -4994,6 +4673,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_SPIKED1",
|
||||
"S_SPIKED2",
|
||||
|
||||
// Wall spikes
|
||||
"S_WALLSPIKE1",
|
||||
"S_WALLSPIKE2",
|
||||
"S_WALLSPIKE3",
|
||||
"S_WALLSPIKE4",
|
||||
"S_WALLSPIKE5",
|
||||
"S_WALLSPIKE6",
|
||||
"S_WALLSPIKEBASE",
|
||||
|
||||
// Starpost
|
||||
"S_STARPOST_IDLE",
|
||||
"S_STARPOST_FLASH",
|
||||
|
@ -5180,6 +4868,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_DEMONFIRE5",
|
||||
"S_DEMONFIRE6",
|
||||
|
||||
// GFZ flowers
|
||||
"S_GFZFLOWERA",
|
||||
"S_GFZFLOWERB",
|
||||
"S_GFZFLOWERC",
|
||||
|
@ -5187,6 +4876,18 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_BERRYBUSH",
|
||||
"S_BUSH",
|
||||
|
||||
// Trees (both GFZ and misc)
|
||||
"S_GFZTREE",
|
||||
"S_GFZBERRYTREE",
|
||||
"S_GFZCHERRYTREE",
|
||||
"S_CHECKERTREE",
|
||||
"S_CHECKERSUNSETTREE",
|
||||
"S_FHZTREE", // Frozen Hillside
|
||||
"S_FHZPINKTREE",
|
||||
"S_POLYGONTREE",
|
||||
"S_BUSHTREE",
|
||||
"S_BUSHREDTREE",
|
||||
|
||||
// THZ Plant
|
||||
"S_THZFLOWERA",
|
||||
"S_THZFLOWERB",
|
||||
|
@ -6439,8 +6140,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_BLUEBALL", // Blue sphere replacement for special stages
|
||||
"MT_REDTEAMRING", //Rings collectable by red team.
|
||||
"MT_BLUETEAMRING", //Rings collectable by blue team.
|
||||
"MT_EMMY", // emerald token for special stage
|
||||
"MT_TOKEN", // Special Stage Token (uncollectible part)
|
||||
"MT_TOKEN", // Special Stage Token
|
||||
"MT_REDFLAG", // Red CTF Flag
|
||||
"MT_BLUEFLAG", // Blue CTF Flag
|
||||
"MT_EMBLEM",
|
||||
|
@ -6474,6 +6174,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_SPECIALSPIKEBALL",
|
||||
"MT_SPINFIRE",
|
||||
"MT_SPIKE",
|
||||
"MT_WALLSPIKE",
|
||||
"MT_WALLSPIKEBASE",
|
||||
"MT_STARPOST",
|
||||
"MT_BIGMINE",
|
||||
"MT_BIGAIRMINE",
|
||||
|
@ -6564,6 +6266,17 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
"MT_GFZFLOWER3",
|
||||
"MT_BERRYBUSH",
|
||||
"MT_BUSH",
|
||||
// Trees (both GFZ and misc)
|
||||
"MT_GFZTREE",
|
||||
"MT_GFZBERRYTREE",
|
||||
"MT_GFZCHERRYTREE",
|
||||
"MT_CHECKERTREE",
|
||||
"MT_CHECKERSUNSETTREE",
|
||||
"MT_FHZTREE", // Frozen Hillside
|
||||
"MT_FHZPINKTREE",
|
||||
"MT_POLYGONTREE",
|
||||
"MT_BUSHTREE",
|
||||
"MT_BUSHREDTREE",
|
||||
|
||||
// Techno Hill Scenery
|
||||
"MT_THZFLOWER1",
|
||||
|
|
|
@ -78,6 +78,7 @@ typedef struct gr_vissprite_s
|
|||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
UINT8 *colormap;
|
||||
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
|
||||
float z1, z2;
|
||||
} gr_vissprite_t;
|
||||
|
||||
// --------
|
||||
|
|
|
@ -226,8 +226,7 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
// Collectible Items
|
||||
&lspr[NOLIGHT], // SPR_RING
|
||||
&lspr[NOLIGHT], // SPR_TRNG
|
||||
&lspr[NOLIGHT], // SPR_EMMY
|
||||
&lspr[BLUEBALL_L], // SPR_TOKE
|
||||
&lspr[NOLIGHT], // SPR_TOKE
|
||||
&lspr[REDBALL_L], // SPR_RFLG
|
||||
&lspr[BLUEBALL_L], // SPR_BFLG
|
||||
&lspr[NOLIGHT], // SPR_NWNG
|
||||
|
@ -243,6 +242,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_SPIK
|
||||
&lspr[NOLIGHT], // SPR_SFLM
|
||||
&lspr[NOLIGHT], // SPR_USPK
|
||||
&lspr[NOLIGHT], // SPR_WSPK
|
||||
&lspr[NOLIGHT], // SPR_WSPB
|
||||
&lspr[NOLIGHT], // SPR_STPT
|
||||
&lspr[NOLIGHT], // SPR_BMNE
|
||||
|
||||
|
@ -293,6 +294,12 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_FWR4
|
||||
&lspr[NOLIGHT], // SPR_BUS1
|
||||
&lspr[NOLIGHT], // SPR_BUS2
|
||||
// Trees (both GFZ and misc)
|
||||
&lspr[NOLIGHT], // SPR_TRE1
|
||||
&lspr[NOLIGHT], // SPR_TRE2
|
||||
&lspr[NOLIGHT], // SPR_TRE3
|
||||
&lspr[NOLIGHT], // SPR_TRE4
|
||||
&lspr[NOLIGHT], // SPR_TRE5
|
||||
|
||||
// Techno Hill Scenery
|
||||
&lspr[NOLIGHT], // SPR_THZP
|
||||
|
@ -334,6 +341,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_XMS1
|
||||
&lspr[NOLIGHT], // SPR_XMS2
|
||||
&lspr[NOLIGHT], // SPR_XMS3
|
||||
&lspr[NOLIGHT], // SPR_XMS4
|
||||
&lspr[NOLIGHT], // SPR_XMS5
|
||||
|
||||
// Botanic Serenity Scenery
|
||||
&lspr[NOLIGHT], // SPR_BSZ1
|
||||
|
@ -345,13 +354,9 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_BSZ7
|
||||
&lspr[NOLIGHT], // SPR_BSZ8
|
||||
|
||||
// Stalagmites
|
||||
// Misc Scenery
|
||||
&lspr[NOLIGHT], // SPR_STLG
|
||||
|
||||
// Disco Ball
|
||||
&lspr[NOLIGHT], // SPR_DBAL
|
||||
|
||||
// ATZ Red Crystal
|
||||
&lspr[NOLIGHT], // SPR_RCRY
|
||||
|
||||
// Powerup Indicators
|
||||
|
@ -396,8 +401,11 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_SPRB Graue
|
||||
&lspr[NOLIGHT], // SPR_YSPR
|
||||
&lspr[NOLIGHT], // SPR_RSPR
|
||||
&lspr[NOLIGHT], // SPR_SSWY
|
||||
&lspr[NOLIGHT], // SPR_SSWR
|
||||
&lspr[NOLIGHT], // SPR_SSWB
|
||||
|
||||
// Environmentals Effects
|
||||
// Environmental Effects
|
||||
&lspr[NOLIGHT], // SPR_RAIN
|
||||
&lspr[NOLIGHT], // SPR_SNO1
|
||||
&lspr[NOLIGHT], // SPR_SPLH
|
||||
|
@ -405,6 +413,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_SMOK
|
||||
&lspr[NOLIGHT], // SPR_BUBL
|
||||
&lspr[RINGLIGHT_L], // SPR_WZAP
|
||||
&lspr[NOLIGHT], // SPR_DUST
|
||||
&lspr[NOLIGHT], // SPR_FPRT
|
||||
&lspr[SUPERSPARK_L], // SPR_TFOG
|
||||
&lspr[NIGHTSLIGHT_L], // SPR_SEED // Sonic CD flower seed
|
||||
&lspr[NOLIGHT], // SPR_PRTL
|
||||
|
|
|
@ -4229,6 +4229,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||
GLPatch_t *gpatch; // sprite patch converted to hardware
|
||||
FSurfaceInfo Surf;
|
||||
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)spr->mobj->skin)->flags & SF_HIRES);
|
||||
//const boolean papersprite = (spr->mobj && (spr->mobj->frame & FF_PAPERSPRITE));
|
||||
if (spr->mobj)
|
||||
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
||||
if (hires)
|
||||
|
@ -4272,7 +4273,8 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||
|
||||
// make a wall polygon (with 2 triangles), using the floor/ceiling heights,
|
||||
// and the 2d map coords of start/end vertices
|
||||
wallVerts[0].z = wallVerts[1].z = wallVerts[2].z = wallVerts[3].z = spr->tz;
|
||||
wallVerts[0].z = wallVerts[3].z = spr->z1;
|
||||
wallVerts[2].z = wallVerts[1].z = spr->z2;
|
||||
|
||||
// transform
|
||||
wv = wallVerts;
|
||||
|
@ -5068,6 +5070,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
angle_t ang;
|
||||
INT32 heightsec, phs;
|
||||
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
|
||||
float offset;
|
||||
float ang_scale = 1.0f, ang_scalez = 0.0f;
|
||||
float z1, z2;
|
||||
|
||||
if (!thing)
|
||||
return;
|
||||
|
@ -5082,7 +5088,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
tz = (tr_x * gr_viewcos) + (tr_y * gr_viewsin);
|
||||
|
||||
// thing is behind view plane?
|
||||
if (tz < ZCLIP_PLANE && (!cv_grmd2.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||
if (tz < ZCLIP_PLANE && !papersprite && (!cv_grmd2.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||
return;
|
||||
|
||||
tx = (tr_x * gr_viewsin) - (tr_y * gr_viewcos);
|
||||
|
@ -5120,6 +5126,27 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
|
||||
#endif
|
||||
|
||||
if (papersprite)
|
||||
{
|
||||
// Use the actual view angle, rather than the angle formed
|
||||
// between the view point and the thing
|
||||
// this makes sure paper sprites always appear at the right angle!
|
||||
// Note: DO NOT do this in software mode version, it actually
|
||||
// makes papersprites look WORSE there (I know, I've tried)
|
||||
// Monster Iestyn - 13/05/17
|
||||
ang = dup_viewangle - thing->angle;
|
||||
ang_scale = FIXED_TO_FLOAT(FINESINE(ang>>ANGLETOFINESHIFT));
|
||||
ang_scalez = FIXED_TO_FLOAT(FINECOSINE(ang>>ANGLETOFINESHIFT));
|
||||
|
||||
if (ang_scale < 0)
|
||||
{
|
||||
ang_scale = -ang_scale;
|
||||
ang_scalez = -ang_scalez;
|
||||
}
|
||||
}
|
||||
else if (sprframe->rotate != SRF_SINGLE)
|
||||
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
||||
|
||||
if (sprframe->rotate == SRF_SINGLE)
|
||||
{
|
||||
// use single rotation for all views
|
||||
|
@ -5130,8 +5157,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
else
|
||||
{
|
||||
// choose a different rotation based on player view
|
||||
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
||||
|
||||
if ((sprframe->rotate & SRF_RIGHT) && (ang < ANGLE_180)) // See from right
|
||||
rot = 6; // F7 slot
|
||||
else if ((sprframe->rotate & SRF_LEFT) && (ang >= ANGLE_180)) // See from left
|
||||
|
@ -5149,9 +5174,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
// calculate edges of the shape
|
||||
if (flip)
|
||||
tx -= FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width - spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width - spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
else
|
||||
tx -= FIXED_TO_FLOAT(spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].offset) * this_scale;
|
||||
|
||||
z1 = tz - (offset * ang_scalez);
|
||||
tx -= offset * ang_scale;
|
||||
|
||||
// project x
|
||||
x1 = gr_windowcenterx + (tx * gr_centerx / tz);
|
||||
|
@ -5162,7 +5190,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
x1 = tx;
|
||||
|
||||
tx += FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale;
|
||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale;
|
||||
|
||||
z2 = z1 + (offset * ang_scalez);
|
||||
tx += offset * ang_scale;
|
||||
|
||||
if (papersprite && max(z1, z2) < ZCLIP_PLANE)
|
||||
return;
|
||||
|
||||
x2 = gr_windowcenterx + (tx * gr_centerx / tz);
|
||||
|
||||
if (vflip)
|
||||
|
@ -5211,6 +5246,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
vis->patchlumpnum = sprframe->lumppat[rot];
|
||||
vis->flip = flip;
|
||||
vis->mobj = thing;
|
||||
vis->z1 = z1;
|
||||
vis->z2 = z2;
|
||||
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
|
||||
|
|
393
src/info.c
393
src/info.c
|
@ -114,7 +114,6 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
// Collectible Items
|
||||
"RING",
|
||||
"TRNG", // Team Rings
|
||||
"EMMY", // emerald test
|
||||
"TOKE", // Special Stage Token
|
||||
"RFLG", // Red CTF Flag
|
||||
"BFLG", // Blue CTF Flag
|
||||
|
@ -131,6 +130,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"SPIK", // Spike Ball
|
||||
"SFLM", // Spin fire
|
||||
"USPK", // Floor spike
|
||||
"WSPK", // Wall spike
|
||||
"WSPB", // Wall spike base
|
||||
"STPT", // Starpost
|
||||
"BMNE", // Big floating mine
|
||||
|
||||
|
@ -181,6 +182,12 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"FWR4",
|
||||
"BUS1", // GFZ Bush w/ berries
|
||||
"BUS2", // GFZ Bush w/o berries
|
||||
// Trees (both GFZ and misc)
|
||||
"TRE1", // GFZ
|
||||
"TRE2", // Checker
|
||||
"TRE3", // Frozen Hillside
|
||||
"TRE4", // Polygon
|
||||
"TRE5", // Bush tree
|
||||
|
||||
// Techno Hill Scenery
|
||||
"THZP", // Techno Hill Zone Plant
|
||||
|
@ -1409,14 +1416,10 @@ state_t states[NUMSTATES] =
|
|||
{SPR_GWLR, 2, 1, {NULL}, 0, 0, S_GRAVWELLRED}, // S_GRAVWELLRED3
|
||||
|
||||
// Individual Team Rings (now with shield attracting action! =P)
|
||||
{SPR_TRNG, FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 23, 1, S_TEAMRING}, // S_TEAMRING1
|
||||
{SPR_TRNG, FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 23, 1, S_TEAMRING}, // S_TEAMRING
|
||||
|
||||
// Special Stage Token
|
||||
{SPR_EMMY, FF_ANIMATE|FF_FULLBRIGHT, -1, {NULL}, 6, 2, S_EMMY}, // S_EMMY
|
||||
|
||||
// Special Stage Token
|
||||
{SPR_TOKE, FF_TRANS50|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_TOKEN
|
||||
{SPR_TOKE, FF_TRANS50|FF_FULLBRIGHT, 1, {A_CapeChase}, 0, 0, S_MOVINGTOKEN}, // S_MOVINGTOKEN
|
||||
{SPR_TOKE, FF_ANIMATE|FF_FULLBRIGHT, -1, {NULL}, 19, 1, S_TOKEN}, // S_TOKEN
|
||||
|
||||
// CTF Flags
|
||||
{SPR_RFLG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDFLAG
|
||||
|
@ -1568,6 +1571,15 @@ state_t states[NUMSTATES] =
|
|||
{SPR_USPK, 1,-1, {NULL}, 0, 0, S_NULL}, // S_SPIKED1 -- Busted spike particles
|
||||
{SPR_USPK, 2,-1, {NULL}, 0, 0, S_NULL}, // S_SPIKED2
|
||||
|
||||
// Wall Spike
|
||||
{SPR_WSPK, 0|FF_PAPERSPRITE,-1, {A_SpikeRetract}, 1, 0, S_WALLSPIKE2}, // S_WALLSPIKE1 -- Fully extended
|
||||
{SPR_WSPK, 1|FF_PAPERSPRITE, 2, {A_Pain}, 0, 0, S_WALLSPIKE3}, // S_WALLSPIKE2
|
||||
{SPR_WSPK, 2|FF_PAPERSPRITE, 2, {NULL}, 0, 0, S_WALLSPIKE4}, // S_WALLSPIKE3
|
||||
{SPR_WSPK, 3|FF_PAPERSPRITE,-1, {A_SpikeRetract}, 0, 0, S_WALLSPIKE5}, // S_WALLSPIKE4 -- Fully retracted
|
||||
{SPR_WSPK, 2|FF_PAPERSPRITE, 2, {A_Pain}, 0, 0, S_WALLSPIKE6}, // S_WALLSPIKE5
|
||||
{SPR_WSPK, 1|FF_PAPERSPRITE, 2, {NULL}, 0, 0, S_WALLSPIKE1}, // S_WALLSPIKE6
|
||||
{SPR_WSPB, 0|FF_PAPERSPRITE,-1, {NULL}, 0, 0, S_NULL}, // S_WALLSPIKEBASE -- Base
|
||||
|
||||
// Starpost
|
||||
{SPR_STPT, 0 , -1, {NULL}, 0, 0, S_NULL}, // S_STARPOST_IDLE
|
||||
{SPR_STPT, FF_ANIMATE|17, -1, {NULL}, 5, 1, S_NULL}, // S_STARPOST_FLASH
|
||||
|
@ -1761,6 +1773,18 @@ state_t states[NUMSTATES] =
|
|||
{SPR_BUS1, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BERRYBUSH
|
||||
{SPR_BUS2, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BUSH
|
||||
|
||||
// Trees
|
||||
{SPR_TRE1, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GFZTREE
|
||||
{SPR_TRE1, 1, -1, {NULL}, 0, 0, S_NULL}, // S_GFZBERRYTREE
|
||||
{SPR_TRE1, 2, -1, {NULL}, 0, 0, S_NULL}, // S_GFZCHERRYTREE
|
||||
{SPR_TRE2, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CHECKERTREE
|
||||
{SPR_TRE2, 1, -1, {NULL}, 0, 0, S_NULL}, // S_CHECKERSUNSETTREE
|
||||
{SPR_TRE3, 0, -1, {NULL}, 0, 0, S_NULL}, // S_FHZTREE
|
||||
{SPR_TRE3, 1, -1, {NULL}, 0, 0, S_NULL}, // S_FHZPINKTREE
|
||||
{SPR_TRE4, 0, -1, {NULL}, 0, 0, S_NULL}, // S_POLYGONTREE
|
||||
{SPR_TRE5, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BUSHTREE
|
||||
{SPR_TRE5, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BUSHREDTREE
|
||||
|
||||
{SPR_THZP, FF_ANIMATE, -1, {NULL}, 7, 4, S_NULL}, // S_THZFLOWERA
|
||||
{SPR_FWR5, FF_ANIMATE, -1, {NULL}, 19, 2, S_NULL}, // S_THZFLOWERB
|
||||
|
||||
|
@ -5162,9 +5186,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_EMMY
|
||||
{ // MT_TOKEN
|
||||
312, // doomednum
|
||||
S_EMMY, // spawnstate
|
||||
S_TOKEN, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
|
@ -5189,33 +5213,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_TOKEN
|
||||
-1, // doomednum
|
||||
S_TOKEN, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_MOVINGTOKEN, // 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
|
||||
8, // speed
|
||||
8*FRACUNIT, // radius
|
||||
16*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOBLOCKMAP|MF_NOCLIP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_REDFLAG
|
||||
310, // doomednum
|
||||
S_REDFLAG, // spawnstate
|
||||
|
@ -5993,6 +5990,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_WALLSPIKE
|
||||
522, // doomednum
|
||||
S_WALLSPIKE1, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_s3k64, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
2*TICRATE, // speed
|
||||
32*FRACUNIT, // radius
|
||||
14*FRACUNIT, // height
|
||||
0, // display offset
|
||||
4, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT|MF_PAPERCOLLISION, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_WALLSPIKEBASE
|
||||
-1, // doomednum
|
||||
S_WALLSPIKEBASE, // 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
|
||||
0, // speed
|
||||
7*FRACUNIT, // radius
|
||||
14*FRACUNIT, // height
|
||||
0, // display offset
|
||||
4, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPTHING, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_STARPOST
|
||||
502, // doomednum
|
||||
S_STARPOST_IDLE, // spawnstate
|
||||
|
@ -8045,6 +8096,276 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_GFZTREE
|
||||
806, // doomednum
|
||||
S_GFZTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
128*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_GFZBERRYTREE
|
||||
807, // doomednum
|
||||
S_GFZBERRYTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
128*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_GFZCHERRYTREE
|
||||
808, // doomednum
|
||||
S_GFZCHERRYTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
128*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_CHECKERTREE
|
||||
810, // doomednum
|
||||
S_CHECKERTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_CHECKERSUNSETTREE
|
||||
811, // doomednum
|
||||
S_CHECKERSUNSETTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_FHZTREE
|
||||
812, // doomednum
|
||||
S_FHZTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_FHZPINKTREE
|
||||
813, // doomednum
|
||||
S_FHZPINKTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_POLYGONTREE
|
||||
814, // doomednum
|
||||
S_POLYGONTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_BUSHTREE
|
||||
815, // doomednum
|
||||
S_BUSHTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_BUSHREDTREE
|
||||
816, // doomednum
|
||||
S_BUSHREDTREE, // 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
|
||||
0, // speed
|
||||
20*FRACUNIT, // radius
|
||||
200*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_THZFLOWER1
|
||||
900, // doomednum
|
||||
S_THZFLOWERA, // spawnstate
|
||||
|
|
51
src/info.h
51
src/info.h
|
@ -320,7 +320,6 @@ typedef enum sprite
|
|||
// Collectible Items
|
||||
SPR_RING,
|
||||
SPR_TRNG, // Team Rings
|
||||
SPR_EMMY, // emerald test
|
||||
SPR_TOKE, // Special Stage Token
|
||||
SPR_RFLG, // Red CTF Flag
|
||||
SPR_BFLG, // Blue CTF Flag
|
||||
|
@ -337,6 +336,8 @@ typedef enum sprite
|
|||
SPR_SPIK, // Spike Ball
|
||||
SPR_SFLM, // Spin fire
|
||||
SPR_USPK, // Floor spike
|
||||
SPR_WSPK, // Wall spike
|
||||
SPR_WSPB, // Wall spike base
|
||||
SPR_STPT, // Starpost
|
||||
SPR_BMNE, // Big floating mine
|
||||
|
||||
|
@ -387,6 +388,12 @@ typedef enum sprite
|
|||
SPR_FWR4,
|
||||
SPR_BUS1, // GFZ Bush w/ berries
|
||||
SPR_BUS2, // GFZ Bush w/o berries
|
||||
// Trees (both GFZ and misc)
|
||||
SPR_TRE1, // GFZ
|
||||
SPR_TRE2, // Checker
|
||||
SPR_TRE3, // Frozen Hillside
|
||||
SPR_TRE4, // Polygon
|
||||
SPR_TRE5, // Bush tree
|
||||
|
||||
// Techno Hill Scenery
|
||||
SPR_THZP, // THZ1 Flower
|
||||
|
@ -1617,12 +1624,8 @@ typedef enum state
|
|||
// Individual Team Rings
|
||||
S_TEAMRING,
|
||||
|
||||
// Special Stage Token
|
||||
S_EMMY,
|
||||
|
||||
// Special Stage Token
|
||||
S_TOKEN,
|
||||
S_MOVINGTOKEN,
|
||||
|
||||
// CTF Flags
|
||||
S_REDFLAG,
|
||||
|
@ -1773,6 +1776,15 @@ typedef enum state
|
|||
S_SPIKED1,
|
||||
S_SPIKED2,
|
||||
|
||||
// Wall spikes
|
||||
S_WALLSPIKE1,
|
||||
S_WALLSPIKE2,
|
||||
S_WALLSPIKE3,
|
||||
S_WALLSPIKE4,
|
||||
S_WALLSPIKE5,
|
||||
S_WALLSPIKE6,
|
||||
S_WALLSPIKEBASE,
|
||||
|
||||
// Starpost
|
||||
S_STARPOST_IDLE,
|
||||
S_STARPOST_FLASH,
|
||||
|
@ -1961,6 +1973,7 @@ typedef enum state
|
|||
S_DEMONFIRE5,
|
||||
S_DEMONFIRE6,
|
||||
|
||||
// GFZ flowers
|
||||
S_GFZFLOWERA,
|
||||
S_GFZFLOWERB,
|
||||
S_GFZFLOWERC,
|
||||
|
@ -1968,6 +1981,18 @@ typedef enum state
|
|||
S_BERRYBUSH,
|
||||
S_BUSH,
|
||||
|
||||
// Trees (both GFZ and misc)
|
||||
S_GFZTREE,
|
||||
S_GFZBERRYTREE,
|
||||
S_GFZCHERRYTREE,
|
||||
S_CHECKERTREE,
|
||||
S_CHECKERSUNSETTREE,
|
||||
S_FHZTREE, // Frozen Hillside
|
||||
S_FHZPINKTREE,
|
||||
S_POLYGONTREE,
|
||||
S_BUSHTREE,
|
||||
S_BUSHREDTREE,
|
||||
|
||||
// THZ Plant
|
||||
S_THZFLOWERA,
|
||||
S_THZFLOWERB,
|
||||
|
@ -3239,8 +3264,7 @@ typedef enum mobj_type
|
|||
MT_BLUEBALL, // Blue sphere replacement for special stages
|
||||
MT_REDTEAMRING, //Rings collectable by red team.
|
||||
MT_BLUETEAMRING, //Rings collectable by blue team.
|
||||
MT_EMMY, // emerald token for special stage
|
||||
MT_TOKEN, // Special Stage Token (uncollectible part)
|
||||
MT_TOKEN, // Special Stage token for special stage
|
||||
MT_REDFLAG, // Red CTF Flag
|
||||
MT_BLUEFLAG, // Blue CTF Flag
|
||||
MT_EMBLEM,
|
||||
|
@ -3274,6 +3298,8 @@ typedef enum mobj_type
|
|||
MT_SPECIALSPIKEBALL,
|
||||
MT_SPINFIRE,
|
||||
MT_SPIKE,
|
||||
MT_WALLSPIKE,
|
||||
MT_WALLSPIKEBASE,
|
||||
MT_STARPOST,
|
||||
MT_BIGMINE,
|
||||
MT_BIGAIRMINE,
|
||||
|
@ -3364,6 +3390,17 @@ typedef enum mobj_type
|
|||
MT_GFZFLOWER3,
|
||||
MT_BERRYBUSH,
|
||||
MT_BUSH,
|
||||
// Trees (both GFZ and misc)
|
||||
MT_GFZTREE,
|
||||
MT_GFZBERRYTREE,
|
||||
MT_GFZCHERRYTREE,
|
||||
MT_CHECKERTREE,
|
||||
MT_CHECKERSUNSETTREE,
|
||||
MT_FHZTREE, // Frozen Hillside
|
||||
MT_FHZPINKTREE,
|
||||
MT_POLYGONTREE,
|
||||
MT_BUSHTREE,
|
||||
MT_BUSHREDTREE,
|
||||
|
||||
// Techno Hill Scenery
|
||||
MT_THZFLOWER1,
|
||||
|
|
|
@ -46,6 +46,7 @@ enum hook {
|
|||
hook_ShieldSpawn,
|
||||
hook_ShieldSpecial,
|
||||
hook_MobjMoveBlocked,
|
||||
hook_MapThingSpawn,
|
||||
|
||||
hook_MAX // last hook
|
||||
};
|
||||
|
@ -83,5 +84,6 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8
|
|||
#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
|
||||
#define LUAh_MobjMoveBlocked(mo) LUAh_MobjHook(mo, hook_MobjMoveBlocked) // Hook for P_XYMovement (when movement is blocked)
|
||||
boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing); // Hook for P_SpawnMapThing by mobj type
|
||||
|
||||
#endif
|
||||
|
|
|
@ -57,6 +57,7 @@ const char *const hookNames[hook_MAX+1] = {
|
|||
"ShieldSpawn",
|
||||
"ShieldSpecial",
|
||||
"MobjMoveBlocked",
|
||||
"MapThingSpawn",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -128,6 +129,7 @@ static int lib_addHook(lua_State *L)
|
|||
case hook_MobjRemoved:
|
||||
case hook_HurtMsg:
|
||||
case hook_MobjMoveBlocked:
|
||||
case hook_MapThingSpawn:
|
||||
hook.s.mt = MT_NULL;
|
||||
if (lua_isnumber(L, 2))
|
||||
hook.s.mt = lua_tonumber(L, 2);
|
||||
|
@ -187,6 +189,7 @@ static int lib_addHook(lua_State *L)
|
|||
case hook_BossDeath:
|
||||
case hook_MobjRemoved:
|
||||
case hook_MobjMoveBlocked:
|
||||
case hook_MapThingSpawn:
|
||||
lastp = &mobjhooks[hook.s.mt];
|
||||
break;
|
||||
case hook_JumpSpecial:
|
||||
|
@ -1073,4 +1076,66 @@ void LUAh_NetArchiveHook(lua_CFunction archFunc)
|
|||
// stack: tables
|
||||
}
|
||||
|
||||
boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
|
||||
{
|
||||
hook_p hookp;
|
||||
boolean hooked = false;
|
||||
if (!gL || !(hooksAvailable[hook_MapThingSpawn/8] & (1<<(hook_MapThingSpawn%8))))
|
||||
return false;
|
||||
|
||||
lua_settop(gL, 0);
|
||||
|
||||
// Look for all generic mobj map thing spawn hooks
|
||||
for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next)
|
||||
if (hookp->type == hook_MapThingSpawn)
|
||||
{
|
||||
if (lua_gettop(gL) == 0)
|
||||
{
|
||||
LUA_PushUserdata(gL, mo, META_MOBJ);
|
||||
LUA_PushUserdata(gL, mthing, META_MAPTHING);
|
||||
}
|
||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||
lua_pushvalue(gL, -3);
|
||||
lua_pushvalue(gL, -3);
|
||||
if (lua_pcall(gL, 2, 1, 0)) {
|
||||
if (!hookp->error || cv_debug & DBG_LUA)
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||
lua_pop(gL, 1);
|
||||
hookp->error = true;
|
||||
continue;
|
||||
}
|
||||
if (lua_toboolean(gL, -1))
|
||||
hooked = true;
|
||||
lua_pop(gL, 1);
|
||||
}
|
||||
|
||||
for (hookp = mobjhooks[mo->type]; hookp; hookp = hookp->next)
|
||||
if (hookp->type == hook_MapThingSpawn)
|
||||
{
|
||||
if (lua_gettop(gL) == 0)
|
||||
{
|
||||
LUA_PushUserdata(gL, mo, META_MOBJ);
|
||||
LUA_PushUserdata(gL, mthing, META_MAPTHING);
|
||||
}
|
||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||
lua_pushvalue(gL, -3);
|
||||
lua_pushvalue(gL, -3);
|
||||
if (lua_pcall(gL, 2, 1, 0)) {
|
||||
if (!hookp->error || cv_debug & DBG_LUA)
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||
lua_pop(gL, 1);
|
||||
hookp->error = true;
|
||||
continue;
|
||||
}
|
||||
if (lua_toboolean(gL, -1))
|
||||
hooked = true;
|
||||
lua_pop(gL, 1);
|
||||
}
|
||||
|
||||
lua_settop(gL, 0);
|
||||
return hooked;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -596,14 +596,14 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
{
|
||||
mobjinfo_t *info = *((mobjinfo_t **)lua_touserdata(gL, myindex));
|
||||
WRITEUINT8(save_p, ARCH_MOBJINFO);
|
||||
WRITEUINT8(save_p, info - mobjinfo);
|
||||
WRITEUINT16(save_p, info - mobjinfo);
|
||||
break;
|
||||
}
|
||||
case ARCH_STATE:
|
||||
{
|
||||
state_t *state = *((state_t **)lua_touserdata(gL, myindex));
|
||||
WRITEUINT8(save_p, ARCH_STATE);
|
||||
WRITEUINT8(save_p, state - states);
|
||||
WRITEUINT16(save_p, state - states);
|
||||
break;
|
||||
}
|
||||
case ARCH_MOBJ:
|
||||
|
|
|
@ -2061,6 +2061,33 @@ void T_NoEnemiesSector(levelspecthink_t *nobaddies)
|
|||
P_RemoveThinker(&nobaddies->thinker);
|
||||
}
|
||||
|
||||
//
|
||||
// P_IsObjectOnRealGround
|
||||
//
|
||||
// Helper function for T_EachTimeThinker
|
||||
// Like P_IsObjectOnGroundIn, except ONLY THE REAL GROUND IS CONSIDERED, NOT FOFS
|
||||
// I'll consider whether to make this a more globally accessible function or whatever in future
|
||||
// -- Monster Iestyn
|
||||
//
|
||||
static boolean P_IsObjectOnRealGround(mobj_t *mo, sector_t *sec)
|
||||
{
|
||||
// Is the object in reverse gravity?
|
||||
if (mo->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
// Detect if the player is on the ceiling.
|
||||
if (mo->z+mo->height >= P_GetSpecialTopZ(mo, sec, sec))
|
||||
return true;
|
||||
}
|
||||
// Nope!
|
||||
else
|
||||
{
|
||||
// Detect if the player is on the floor.
|
||||
if (mo->z <= P_GetSpecialBottomZ(mo, sec, sec))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// P_HavePlayersEnteredArea
|
||||
//
|
||||
|
@ -2264,7 +2291,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
|||
|| P_PlayerTouchingSectorSpecial(&players[i], 2, (GETSECSPECIAL(sec->special, 2))) == sec))
|
||||
continue;
|
||||
|
||||
if (floortouch == true && P_IsObjectOnGroundIn(players[i].mo, sec))
|
||||
if (floortouch == true && P_IsObjectOnRealGround(players[i].mo, sec))
|
||||
{
|
||||
if (i & 1)
|
||||
eachtime->var2s[i/2] |= 1;
|
||||
|
@ -3283,14 +3310,6 @@ INT32 EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (thing->type == MT_EMMY && thing->spawnpoint && (thing->spawnpoint->options & MTF_OBJECTSPECIAL))
|
||||
{
|
||||
mobj_t *tokenobj = P_SpawnMobj(sector->soundorg.x, sector->soundorg.y, topheight, MT_TOKEN);
|
||||
P_SetTarget(&thing->tracer, tokenobj);
|
||||
P_SetTarget(&tokenobj->target, thing);
|
||||
P_SetMobjState(tokenobj, mobjinfo[MT_TOKEN].seestate);
|
||||
}
|
||||
|
||||
// "Powerup rise" sound
|
||||
S_StartSound(puncher, sfx_mario9); // Puncher is "close enough"
|
||||
}
|
||||
|
|
|
@ -570,7 +570,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
// Gameplay related collectibles //
|
||||
// ***************************** //
|
||||
// Special Stage Token
|
||||
case MT_EMMY:
|
||||
case MT_TOKEN:
|
||||
if (player->bot)
|
||||
return;
|
||||
tokenlist += special->health;
|
||||
|
@ -589,9 +589,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
}
|
||||
else
|
||||
token++;
|
||||
|
||||
if (special->tracer) // token BG
|
||||
P_RemoveMobj(special->tracer);
|
||||
break;
|
||||
|
||||
// Emerald Hunt
|
||||
|
|
53
src/p_map.c
53
src/p_map.c
|
@ -959,6 +959,45 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
P_DamageMobj(tmthing, thing, thing, 1, 0);
|
||||
}
|
||||
|
||||
if (tmthing->type == MT_WALLSPIKE && tmthing->flags & MF_SOLID && thing->player) // wall spike impales player
|
||||
{
|
||||
fixed_t bottomz, topz;
|
||||
bottomz = tmthing->z;
|
||||
topz = tmthing->z + tmthing->height;
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
bottomz -= FixedMul(FRACUNIT, tmthing->scale);
|
||||
else
|
||||
topz += FixedMul(FRACUNIT, tmthing->scale);
|
||||
|
||||
if (thing->z + thing->height > bottomz // above bottom
|
||||
&& thing->z < topz) // below top
|
||||
{ // don't check angle, the player was clearly in the way in this case
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
}
|
||||
}
|
||||
else if (thing->type == MT_WALLSPIKE && thing->flags & MF_SOLID && tmthing->player)
|
||||
{
|
||||
fixed_t bottomz, topz;
|
||||
bottomz = thing->z;
|
||||
topz = thing->z + thing->height;
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
bottomz -= FixedMul(FRACUNIT, thing->scale);
|
||||
else
|
||||
topz += FixedMul(FRACUNIT, thing->scale);
|
||||
|
||||
if (tmthing->z + tmthing->height > bottomz // above bottom
|
||||
&& tmthing->z < topz // below top
|
||||
&& !P_MobjWasRemoved(thing->tracer)) // this probably wouldn't work if we didn't have a tracer
|
||||
{ // use base as a reference point to determine what angle you touched the spike at
|
||||
angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
|
||||
angle_t diffangle = thing->angle - touchangle;
|
||||
if (diffangle > ANGLE_180)
|
||||
diffangle = InvAngle(diffangle);
|
||||
if (diffangle <= ANGLE_22h) // if you touched it at this close an angle, you get poked!
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
}
|
||||
|
||||
if (thing->flags & MF_PUSHABLE)
|
||||
{
|
||||
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
|
||||
|
@ -1117,6 +1156,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (iwassprung) // this spring caused you to gain MFE_SPRUNG just now...
|
||||
return false; // "cancel" P_TryMove via blocking so you keep your current position
|
||||
}
|
||||
else if (tmthing->flags & MF_SPRING && (thing->player || thing->flags & MF_PUSHABLE))
|
||||
; // Fix a few nasty spring-jumping bugs that happen sometimes.
|
||||
// Monitors are not treated as solid to players who are jumping, spinning or gliding,
|
||||
// unless it's a CTF team monitor and you're on the wrong team
|
||||
else if (thing->flags & MF_MONITOR && tmthing->player
|
||||
|
@ -1155,11 +1196,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
topz = thing->z - thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways
|
||||
|
||||
if (thing->flags & MF_SPRING)
|
||||
;
|
||||
// block only when jumping not high enough,
|
||||
// (dont climb max. 24units while already in air)
|
||||
// since return false doesn't handle momentum properly,
|
||||
// we lie to P_TryMove() so it's always too high
|
||||
if (tmthing->player && tmthing->z + tmthing->height > topz
|
||||
else if (tmthing->player && tmthing->z + tmthing->height > topz
|
||||
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
||||
{
|
||||
if (thing->flags & MF_GRENADEBOUNCE && (thing->flags & MF_MONITOR || thing->flags2 & MF2_STANDONME)) // Gold monitor hack...
|
||||
|
@ -1171,8 +1214,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
#endif
|
||||
tmfloorthing = thing; // needed for side collision
|
||||
}
|
||||
else if (thing->flags & MF_SPRING)
|
||||
;
|
||||
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
||||
{
|
||||
tmceilingz = topz;
|
||||
|
@ -1201,11 +1242,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
topz = thing->z + thing->height + thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways
|
||||
|
||||
if (thing->flags & MF_SPRING)
|
||||
;
|
||||
// block only when jumping not high enough,
|
||||
// (dont climb max. 24units while already in air)
|
||||
// since return false doesn't handle momentum properly,
|
||||
// we lie to P_TryMove() so it's always too high
|
||||
if (tmthing->player && tmthing->z < topz
|
||||
else if (tmthing->player && tmthing->z < topz
|
||||
&& tmthing->z > tmthing->floorz)
|
||||
{
|
||||
if (thing->flags & MF_GRENADEBOUNCE && (thing->flags & MF_MONITOR || thing->flags2 & MF2_STANDONME)) // Gold monitor hack...
|
||||
|
@ -1217,8 +1260,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
#endif
|
||||
tmfloorthing = thing; // needed for side collision
|
||||
}
|
||||
else if (thing->flags & MF_SPRING)
|
||||
;
|
||||
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
||||
{
|
||||
tmfloorz = topz;
|
||||
|
|
95
src/p_mobj.c
95
src/p_mobj.c
|
@ -7373,6 +7373,23 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
}
|
||||
else switch (mobj->type)
|
||||
{
|
||||
case MT_WALLSPIKEBASE:
|
||||
if (!mobj->target) {
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|(mobj->target->frame & FF_FRAMEMASK);
|
||||
if (mobj->angle != mobj->target->angle + ANGLE_90) // reposition if not the correct angle
|
||||
{
|
||||
mobj_t *target = mobj->target; // shortcut
|
||||
const fixed_t baseradius = target->radius/2 - FixedMul(FRACUNIT, target->scale);
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->x = target->x - P_ReturnThrustX(target, target->angle, baseradius);
|
||||
mobj->y = target->y - P_ReturnThrustY(target, target->angle, baseradius);
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->angle = target->angle + ANGLE_90;
|
||||
}
|
||||
break;
|
||||
case MT_FALLINGROCK:
|
||||
// Despawn rocks here in case zmovement code can't do so (blame slopes)
|
||||
if (!mobj->momx && !mobj->momy && !mobj->momz
|
||||
|
@ -8066,6 +8083,10 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
|||
if (mobj->spawnpoint)
|
||||
mobj->fuse += mobj->spawnpoint->angle;
|
||||
break;
|
||||
case MT_WALLSPIKE:
|
||||
P_SetMobjState(mobj, mobj->state->nextstate);
|
||||
mobj->fuse = mobj->info->speed;
|
||||
break;
|
||||
case MT_NIGHTSCORE:
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
|
@ -8457,9 +8478,13 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
// Collision helper can be stood on but not pushed
|
||||
mobj->flags2 |= MF2_STANDONME;
|
||||
break;
|
||||
case MT_WALLSPIKE:
|
||||
case MT_SPIKE:
|
||||
mobj->flags2 |= MF2_STANDONME;
|
||||
break;
|
||||
case MT_GFZTREE:
|
||||
case MT_GFZBERRYTREE:
|
||||
case MT_GFZCHERRYTREE:
|
||||
case MT_LAMPPOST1:
|
||||
case MT_LAMPPOST2:
|
||||
mobj->flags2 |= MF2_STANDONME;
|
||||
|
@ -9478,7 +9503,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
}
|
||||
|
||||
if (metalrecording) // Metal Sonic can't use these things.
|
||||
if (mobjinfo[i].flags & (MF_ENEMY|MF_BOSS) || i == MT_EMMY || i == MT_STARPOST)
|
||||
if (mobjinfo[i].flags & (MF_ENEMY|MF_BOSS) || i == MT_TOKEN || i == MT_STARPOST)
|
||||
return;
|
||||
|
||||
if (i >= MT_EMERALD1 && i <= MT_EMERALD7) // Pickupable Emeralds
|
||||
|
@ -9592,7 +9617,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
return;
|
||||
|
||||
// Emerald Tokens -->> Score Tokens
|
||||
else if (i == MT_EMMY)
|
||||
else if (i == MT_TOKEN)
|
||||
return; /// \todo
|
||||
|
||||
// 1UPs -->> Score TVs
|
||||
|
@ -9620,7 +9645,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
// They're likely facets of the level's design and therefore required to progress.
|
||||
}
|
||||
|
||||
if (i == MT_EMMY && (gametype != GT_COOP || ultimatemode || tokenbits == 30 || tokenlist & (1 << tokenbits++)))
|
||||
if (i == MT_TOKEN && (gametype != GT_COOP || ultimatemode || tokenbits == 30 || tokenlist & (1 << tokenbits++)))
|
||||
return; // you already got this token, or there are too many, or the gametype's not right
|
||||
|
||||
// Objectplace landing point
|
||||
|
@ -9639,7 +9664,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
ss->sector->floorheight) + ((mthing->options >> ZSHIFT) << FRACBITS);
|
||||
else if (i == MT_AXIS || i == MT_AXISTRANSFER || i == MT_AXISTRANSFERLINE)
|
||||
z = ONFLOORZ;
|
||||
else if (i == MT_SPECIALSPIKEBALL || P_WeaponOrPanel(i) || i == MT_EMERALDSPAWN || i == MT_EMMY)
|
||||
else if (i == MT_SPECIALSPIKEBALL || P_WeaponOrPanel(i) || i == MT_EMERALDSPAWN || i == MT_TOKEN)
|
||||
{
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
|
@ -9729,6 +9754,16 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
mobj = P_SpawnMobj(x, y, z, i);
|
||||
mobj->spawnpoint = mthing;
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUAh_MapThingSpawn(mobj, mthing))
|
||||
{
|
||||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
}
|
||||
else if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
else
|
||||
#endif
|
||||
switch(mobj->type)
|
||||
{
|
||||
case MT_SKYBOX:
|
||||
|
@ -10028,28 +10063,10 @@ ML_NOCLIMB : Direction not controllable
|
|||
mobj->radius = (mthing->angle & 16383)*FRACUNIT;
|
||||
}
|
||||
}
|
||||
else if (i == MT_EMMY)
|
||||
else if (i == MT_TOKEN)
|
||||
{
|
||||
if (mthing->options & MTF_OBJECTSPECIAL) // Mario Block version
|
||||
mobj->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT);
|
||||
else
|
||||
{
|
||||
fixed_t zheight = mobj->z;
|
||||
mobj_t *tokenobj;
|
||||
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
zheight += mobj->height-FixedMul(mobjinfo[MT_TOKEN].height, mobj->scale); // align with emmy properly!
|
||||
|
||||
tokenobj = P_SpawnMobj(x, y, zheight, MT_TOKEN);
|
||||
P_SetTarget(&mobj->tracer, tokenobj);
|
||||
tokenobj->destscale = mobj->scale;
|
||||
P_SetScale(tokenobj, mobj->scale);
|
||||
if (mthing->options & MTF_OBJECTFLIP) // flip token to match emmy
|
||||
{
|
||||
tokenobj->eflags |= MFE_VERTICALFLIP;
|
||||
tokenobj->flags2 |= MF2_OBJECTFLIP;
|
||||
}
|
||||
}
|
||||
|
||||
// We advanced tokenbits earlier due to the return check.
|
||||
// Subtract 1 here for the correct value.
|
||||
|
@ -10109,6 +10126,38 @@ ML_NOCLIMB : Direction not controllable
|
|||
P_SetThingPosition(mobj);
|
||||
}
|
||||
}
|
||||
else if (i == MT_WALLSPIKE)
|
||||
{
|
||||
// Pop up spikes!
|
||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
||||
{
|
||||
mobj->flags &= ~MF_SCENERY;
|
||||
mobj->fuse = mobj->info->speed;
|
||||
}
|
||||
// Use per-thing collision for spikes if the deaf flag is checked.
|
||||
if (mthing->options & MTF_AMBUSH && !metalrecording)
|
||||
{
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOCLIPHEIGHT);
|
||||
mobj->flags |= MF_SOLID;
|
||||
P_SetThingPosition(mobj);
|
||||
}
|
||||
|
||||
// spawn base
|
||||
{
|
||||
const angle_t mobjangle = FixedAngle(mthing->angle*FRACUNIT); // the mobj's own angle hasn't been set quite yet so...
|
||||
const fixed_t baseradius = mobj->radius/2 - FixedMul(FRACUNIT, mobj->scale);
|
||||
mobj_t *base = P_SpawnMobj(
|
||||
mobj->x - P_ReturnThrustX(mobj, mobjangle, baseradius),
|
||||
mobj->y - P_ReturnThrustY(mobj, mobjangle, baseradius),
|
||||
mobj->z, MT_WALLSPIKEBASE);
|
||||
base->angle = mobjangle + ANGLE_90;
|
||||
base->destscale = mobj->destscale;
|
||||
P_SetScale(base, mobj->scale);
|
||||
P_SetTarget(&base->target, mobj);
|
||||
P_SetTarget(&mobj->tracer, base);
|
||||
}
|
||||
}
|
||||
|
||||
//count 10 ring boxes into the number of rings equation too.
|
||||
if (i == MT_RING_BOX)
|
||||
|
|
|
@ -456,7 +456,8 @@ void P_ParseAnimationDefintion(SINT8 istexture)
|
|||
|
||||
// Search for existing animdef
|
||||
for (i = 0; i < maxanims; i++)
|
||||
if (stricmp(animdefsToken, animdefs[i].startname) == 0)
|
||||
if (animdefs[i].istexture == istexture // Check if it's the same type!
|
||||
&& stricmp(animdefsToken, animdefs[i].startname) == 0)
|
||||
{
|
||||
//CONS_Alert(CONS_NOTICE, "Duplicate animation: %s\n", animdefsToken);
|
||||
|
||||
|
@ -1748,7 +1749,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
|||
case 305: // continuous
|
||||
case 306: // each time
|
||||
case 307: // once
|
||||
if (!(actor && actor->player && actor->player->charability != dist/10))
|
||||
if (!(actor && actor->player && actor->player->charability == dist/10))
|
||||
return false;
|
||||
break;
|
||||
case 309: // continuous
|
||||
|
|
14
src/p_user.c
14
src/p_user.c
|
@ -1267,11 +1267,12 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
// If the FOF is configured to let players through, continue.
|
||||
if (!(rover->flags & FF_BLOCKPLAYER) && (rover->flags & FF_BLOCKOTHERS))
|
||||
// If the FOF is configured to let the object through, continue.
|
||||
if (!((rover->flags & FF_BLOCKPLAYER && mo->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mo->player)))
|
||||
continue;
|
||||
|
||||
// If the the platform is intangile from below, continue.
|
||||
// If the the platform is intangible from below, continue.
|
||||
if (rover->flags & FF_PLATFORM)
|
||||
continue;
|
||||
|
||||
|
@ -1300,11 +1301,12 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec)
|
|||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
// If the FOF is configured to let players through, continue.
|
||||
if (!(rover->flags & FF_BLOCKPLAYER) && (rover->flags & FF_BLOCKOTHERS))
|
||||
// If the FOF is configured to let the object through, continue.
|
||||
if (!((rover->flags & FF_BLOCKPLAYER && mo->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mo->player)))
|
||||
continue;
|
||||
|
||||
// If the the platform is intangile from above, continue.
|
||||
// If the the platform is intangible from above, continue.
|
||||
if (rover->flags & FF_REVERSEPLATFORM)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ static INT32 windowedModes[MAXWINMODES][2] =
|
|||
static void Impl_VideoSetupSDLBuffer(void);
|
||||
static void Impl_VideoSetupBuffer(void);
|
||||
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen);
|
||||
static void Impl_SetWindowName(const char *title);
|
||||
//static void Impl_SetWindowName(const char *title);
|
||||
static void Impl_SetWindowIcon(void);
|
||||
|
||||
static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
||||
|
@ -1188,7 +1188,7 @@ INT32 VID_SetMode(INT32 modeNum)
|
|||
}
|
||||
vid.modenum = -1;
|
||||
}
|
||||
Impl_SetWindowName("SRB2 "VERSIONSTRING);
|
||||
//Impl_SetWindowName("SRB2 "VERSIONSTRING);
|
||||
|
||||
SDLSetMode(vid.width, vid.height, USE_FULLSCREEN);
|
||||
|
||||
|
@ -1271,14 +1271,16 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
static void Impl_SetWindowName(const char *title)
|
||||
{
|
||||
if (window != NULL)
|
||||
if (window == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
SDL_SetWindowTitle(window, title);
|
||||
}
|
||||
*/
|
||||
|
||||
static void Impl_SetWindowIcon(void)
|
||||
{
|
||||
|
|
|
@ -160,6 +160,20 @@ static void Y_CalculateMatchWinners(void);
|
|||
static void Y_FollowIntermission(void);
|
||||
static void Y_UnloadData(void);
|
||||
|
||||
// Stuff copy+pasted from st_stuff.c
|
||||
static INT32 SCX(INT32 x)
|
||||
{
|
||||
return FixedInt(FixedMul(x<<FRACBITS, vid.fdupx));
|
||||
}
|
||||
static INT32 SCY(INT32 z)
|
||||
{
|
||||
return FixedInt(FixedMul(z<<FRACBITS, vid.fdupy));
|
||||
}
|
||||
|
||||
#define ST_DrawNumFromHud(h,n) V_DrawTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, n)
|
||||
#define ST_DrawPadNumFromHud(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, n, q)
|
||||
#define ST_DrawPatchFromHud(h,p) V_DrawScaledPatch(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, p)
|
||||
|
||||
static void Y_IntermissionTokenDrawer(void)
|
||||
{
|
||||
INT32 y;
|
||||
|
@ -242,28 +256,31 @@ void Y_IntermissionDrawer(void)
|
|||
Y_IntermissionTokenDrawer();
|
||||
|
||||
// draw score
|
||||
V_DrawScaledPatch(hudinfo[HUD_SCORE].x, hudinfo[HUD_SCORE].y, V_SNAPTOLEFT, sboscore);
|
||||
V_DrawTallNum(hudinfo[HUD_SCORENUM].x, hudinfo[HUD_SCORENUM].y, V_SNAPTOLEFT, data.coop.score);
|
||||
ST_DrawPatchFromHud(HUD_SCORE, sboscore);
|
||||
ST_DrawNumFromHud(HUD_SCORENUM, data.coop.score);
|
||||
|
||||
// draw time
|
||||
V_DrawScaledPatch(hudinfo[HUD_TIME].x, hudinfo[HUD_TIME].y, V_SNAPTOLEFT, sbotime);
|
||||
ST_DrawPatchFromHud(HUD_TIME, sbotime);
|
||||
if (cv_timetic.value == 1)
|
||||
V_DrawTallNum(hudinfo[HUD_SECONDS].x, hudinfo[HUD_SECONDS].y, V_SNAPTOLEFT, data.coop.tics);
|
||||
ST_DrawNumFromHud(HUD_SECONDS, data.coop.tics);
|
||||
else
|
||||
{
|
||||
INT32 seconds, minutes, tictrn;
|
||||
|
||||
seconds = G_TicsToSeconds(data.coop.tics);
|
||||
minutes = G_TicsToMinutes(data.coop.tics, true);
|
||||
tictrn = G_TicsToCentiseconds(data.coop.tics);
|
||||
|
||||
ST_DrawNumFromHud(HUD_MINUTES, minutes); // Minutes
|
||||
ST_DrawPatchFromHud(HUD_TIMECOLON, sbocolon); // Colon
|
||||
ST_DrawPadNumFromHud(HUD_SECONDS, seconds, 2); // Seconds
|
||||
|
||||
// we should show centiseconds on the intermission screen too, if the conditions are right.
|
||||
if (modeattacking || cv_timetic.value == 2)
|
||||
{
|
||||
V_DrawPaddedTallNum(hudinfo[HUD_TICS].x, hudinfo[HUD_TICS].y, V_SNAPTOLEFT,
|
||||
G_TicsToCentiseconds(data.coop.tics), 2);
|
||||
V_DrawScaledPatch(hudinfo[HUD_TIMETICCOLON].x, hudinfo[HUD_TIMETICCOLON].y, V_SNAPTOLEFT, sboperiod);
|
||||
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod); // Period
|
||||
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2); // Tics
|
||||
}
|
||||
|
||||
V_DrawPaddedTallNum(hudinfo[HUD_SECONDS].x, hudinfo[HUD_SECONDS].y, V_SNAPTOLEFT,
|
||||
G_TicsToSeconds(data.coop.tics), 2);
|
||||
V_DrawScaledPatch(hudinfo[HUD_TIMECOLON].x, hudinfo[HUD_TIMECOLON].y, V_SNAPTOLEFT, sbocolon);
|
||||
V_DrawTallNum(hudinfo[HUD_MINUTES].x, hudinfo[HUD_MINUTES].y, V_SNAPTOLEFT,
|
||||
G_TicsToMinutes(data.coop.tics, false));
|
||||
}
|
||||
|
||||
// draw the "got through act" lines and act number
|
||||
|
|
Loading…
Reference in a new issue