Merge branch 'master' of git.magicalgirl.moe:KartKrew/Kart into v2-master

This commit is contained in:
Latapostrophe 2019-06-23 14:40:24 +02:00
commit dce64f33e1
50 changed files with 3173 additions and 2790 deletions

View file

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
# Version change is fine.
project(SRB2
VERSION 1.1.0
VERSION 2.0.0
LANGUAGES C)
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})

View file

@ -1,4 +1,4 @@
version: 1.1.0.{branch}-{build}
version: 2.0.0.{branch}-{build}
os: MinGW
environment:
@ -29,7 +29,7 @@ environment:
##############################
DPL_ENABLED: 0
DPL_TAG_ENABLED: 0
DPL_INSTALLER_NAME: srb2kart-v110
DPL_INSTALLER_NAME: srb2kart-v200
# Asset handling is barebones vs. Travis Deployer. We operate on 7z only.
# Include the README files and the OpenGL batch in the main and patch archives.
# The x86/x64 archives contain the DLL binaries.

View file

@ -13,12 +13,12 @@ set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer"
CACHE STRING "Path to directory that contains all asset files for the installer.")
set(SRB2_ASSET_HASHED
"srb2.srb;\
patch.kart;\
gfx.kart;\
textures.kart;\
chars.kart;\
maps.kart"
"main.kart;\
gfx.pk3;\
textures.pk3;\
chars.pk3;\
maps.wad;\
patch.pk3"
CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!"
)

View file

@ -83,16 +83,14 @@
# SRB2 data files
D_DIR?=../bin/Resources
D_FILES=$(D_DIR)/srb2.srb \
$(D_DIR)/patch.dta \
#$(D_DIR)/music.dta \
$(D_DIR)/gfx.kart \
$(D_DIR)/textures.kart \
$(D_DIR)/chars.kart \
$(D_DIR)/maps.kart \
$(D_DIR)/sounds.kart \
$(D_DIR)/patch.kart \
$(D_DIR)/music.kart \
D_FILES=$(D_DIR)/main.kart \
$(D_DIR)/gfx.pk3 \
$(D_DIR)/textures.pk3 \
$(D_DIR)/chars.pk3 \
$(D_DIR)/maps.wad \
$(D_DIR)/patch.pk3 \
$(D_DIR)/sounds.wad \
$(D_DIR)/music.wad \
PKG_CONFIG?=pkg-config

View file

@ -11,19 +11,13 @@
#ifdef CMAKECONFIG
// Base SRB2 hashes
#define ASSET_HASH_SRB2_SRB "${SRB2_ASSET_srb2.srb_HASH}"
#ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}"
#endif
// SRB2Kart-specific hashes
#define ASSET_HASH_GFX_KART "${SRB2_ASSET_gfx.kart_HASH}"
#define ASSET_HASH_TEXTURES_KART "${SRB2_ASSET_textures.kart_HASH}"
#define ASSET_HASH_CHARS_KART "${SRB2_ASSET_chars.kart_HASH}"
#define ASSET_HASH_MAPS_KART "${SRB2_ASSET_maps.kart_HASH}"
#ifdef USE_PATCH_KART
#define ASSET_HASH_PATCH_KART "${SRB2_ASSET_patch.kart_HASH}"
#define ASSET_HASH_MAIN_KART "${SRB2_ASSET_main.kart_HASH}"
#define ASSET_HASH_GFX_PK3 "${SRB2_ASSET_gfx.pk3_HASH}"
#define ASSET_HASH_TEXTURES_PK3 "${SRB2_ASSET_textures.pk3_HASH}"
#define ASSET_HASH_CHARS_PK3 "${SRB2_ASSET_chars.pk3_HASH}"
#define ASSET_HASH_MAPS_WAD "${SRB2_ASSET_maps.wad_HASH}"
#ifdef USE_PATCH_FILE
#define ASSET_HASH_PATCH_PK3 "${SRB2_ASSET_patch.pk3_HASH}"
#endif
#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
@ -34,25 +28,17 @@
#else
/* Manually defined asset hashes for non-CMake builds
* Last updated 2015 / 05 / 03 - SRB2 v2.1.15 - srb2.srb
* Last updated 2018 / 12 / 23 - SRB2 v2.1.22 - patch.dta
* Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets
* Last updated 2019 / 05 / 06 - Kart v1.1.0 - patch.kart
*/
// Base SRB2 hashes
#define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7"
#ifdef USE_PATCH_DTA
#define ASSET_HASH_PATCH_DTA "b04fd9624bfd94dc96dcf4f400f7deb4"
#endif
// SRB2Kart-specific hashes
#define ASSET_HASH_GFX_KART "99c39f223d84ebc78e67ab68f3bead95"
#define ASSET_HASH_TEXTURES_KART "ec8e9b7535cf585afe72ef277b08f490"
#define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964"
#define ASSET_HASH_MAPS_KART "1335cd064656aedca359cfbb5233ac4a"
#ifdef USE_PATCH_KART
#define ASSET_HASH_PATCH_KART "7093231f2c3c1cca1a909a708be85d9a"
#define ASSET_HASH_MAIN_KART "00000000000000000000000000000000"
#define ASSET_HASH_GFX_PK3 "00000000000000000000000000000000"
#define ASSET_HASH_TEXTURES_PK3 "00000000000000000000000000000000"
#define ASSET_HASH_CHARS_PK3 "00000000000000000000000000000000"
#define ASSET_HASH_MAPS_WAD "00000000000000000000000000000000"
#ifdef USE_PATCH_FILE
#define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000"
#endif
#endif

View file

@ -131,12 +131,12 @@ static CV_PossibleValue_t backpic_cons_t[] = {{0, "translucent"}, {1, "picture"}
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, "Black"}, {2, "Sepia"},
{3, "Brown"}, {4, "Pink"}, {5, "Raspberry"},
{6, "Red"}, {7, "Creamsicle"}, {8, "Orange"},
{9, "Gold"}, {10,"Yellow"}, {11,"Emerald"},
{12,"Green"}, {13,"Cyan"}, {14,"Steel"},
{15,"Periwinkle"}, {16,"Blue"}, {17,"Purple"},
{18,"Lavender"},
{3, "Brown"}, {4, "Pink"}, {5, "Red"},
{6, "Orange"}, {7, "Gold"}, {8, "Yellow"},
{9, "Peridot"}, {10,"Green"}, {11,"Aquamarine"},
{12,"Cyan"}, {13,"Steel"}, {14,"Blue"},
{15,"Purple"}, {16,"Magenta"}, {17,"Lavender"},
{18,"Rose"},
{0, NULL}};
consvar_t cons_backcolor = {"con_backcolor", "Black", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change, 0, NULL, NULL, 0, 0, NULL};
@ -153,11 +153,11 @@ static CV_PossibleValue_t menuhighlight_cons_t[] =
{V_SKYMAP, "Always sky-blue"},
{V_GOLDMAP, "Always gold"},
{V_LAVENDERMAP, "Always lavender"},
{V_TEAMAP, "Always tea-green"},
{V_STEELMAP, "Always steel-blue"},
{V_AQUAMAP, "Always aqua-green"},
{V_MAGENTAMAP, "Always magenta"},
{V_PINKMAP, "Always pink"},
{V_BROWNMAP, "Always brown"},
{V_PEACHMAP, "Always peach"},
{V_TANMAP, "Always tan"},
{0, NULL}
};
consvar_t cons_menuhighlight = {"menuhighlight", "Game type", CV_SAVE, menuhighlight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -262,27 +262,27 @@ void CON_SetupBackColormap(void)
switch (cons_backcolor.value)
{
case 0: palindex = 15; break; // White
case 1: palindex = 31; break; // Gray
case 2: palindex = 47; break; // Sepia
case 3: palindex = 63; break; // Brown
case 4: palindex = 150; shift = 7; break; // Pink
case 5: palindex = 127; shift = 7; break; // Raspberry
case 6: palindex = 143; break; // Red
case 7: palindex = 86; shift = 7; break; // Creamsicle
case 8: palindex = 95; break; // Orange
case 9: palindex = 119; shift = 7; break; // Gold
case 10: palindex = 111; break; // Yellow
case 11: palindex = 191; shift = 7; break; // Emerald
case 12: palindex = 175; break; // Green
case 13: palindex = 219; break; // Cyan
case 14: palindex = 207; shift = 7; break; // Steel
case 15: palindex = 230; shift = 7; break; // Periwinkle
case 16: palindex = 239; break; // Blue
case 17: palindex = 199; shift = 7; break; // Purple
case 18: palindex = 255; shift = 7; break; // Lavender
// Default green
default: palindex = 175; break;
case 0: palindex = 15; break; // White
case 1: palindex = 31; break; // Black
case 2: palindex = 251; break; // Sepia
case 3: palindex = 239; break; // Brown
case 4: palindex = 214; shift = 7; break; // Pink
case 5: palindex = 47; break; // Red
case 6: palindex = 63; break; // Orange
case 7: palindex = 71; shift = 7; break; // Gold
case 8: palindex = 79; shift = 7; break; // Yellow
case 9: palindex = 191; shift = 8; break; // Peridot
case 10: palindex = 111; break; // Green
case 11: palindex = 127; shift = 7; break; // Aquamarine
case 12: palindex = 139; break; // Cyan
case 13: palindex = 175; shift = 7; break; // Steel
case 14: palindex = 159; break; // Blue
case 15: palindex = 169; break; // Purple
case 16: palindex = 187; break; // Magenta
case 17: palindex = 199; shift = 7; break; // Lavender
case 18: palindex = 207; shift = 7; break; // Rose
// Default black
default: palindex = 31; break;
}
@ -303,7 +303,7 @@ static void CONS_backcolor_Change(void)
// TODO: This could probably be improved somehow...
// These colormaps are 99% identical, with just a few changed bytes
UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\
*skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap;
*skymap, *goldmap, *lavendermap, *aquamap, *magentamap, *pinkmap, *brownmap, *tanmap;
static void CON_SetupColormaps(void)
{
@ -320,11 +320,11 @@ static void CON_SetupColormaps(void)
skymap = (orangemap+256);
lavendermap = (skymap+256);
goldmap = (lavendermap+256);
teamap = (goldmap+256);
steelmap = (teamap+256);
pinkmap = (steelmap+256);
aquamap = (goldmap+256);
magentamap = (aquamap+256);
pinkmap = (magentamap+256);
brownmap = (pinkmap+256);
peachmap = (brownmap+256);
tanmap = (brownmap+256);
// setup the other colormaps, for console text
@ -335,21 +335,21 @@ static void CON_SetupColormaps(void)
*memorysrc = (UINT8)(i & 0xFF); // remap each color to itself...
// SRB2Kart: Different console font, new colors
purplemap[120] = (UINT8)194;
yellowmap[120] = (UINT8)103;
greenmap[120] = (UINT8)162;
bluemap[120] = (UINT8)228;
redmap[120] = (UINT8)126; // battle
graymap[120] = (UINT8)10;
orangemap[120] = (UINT8)85; // record attack
skymap[120] = (UINT8)214; // race
lavendermap[120] = (UINT8)248;
goldmap[120] = (UINT8)114;
teamap[120] = (UINT8)177;
steelmap[120] = (UINT8)201;
pinkmap[120] = (UINT8)145;
brownmap[120] = (UINT8)48;
peachmap[120] = (UINT8)69; // nice
purplemap[0] = (UINT8)163;
yellowmap[0] = (UINT8)73;
greenmap[0] = (UINT8)98;
bluemap[0] = (UINT8)148;
redmap[0] = (UINT8)34; // battle
graymap[0] = (UINT8)10;
orangemap[0] = (UINT8)52; // record attack
skymap[0] = (UINT8)132; // race
lavendermap[0] = (UINT8)192;
goldmap[0] = (UINT8)65;
aquamap[0] = (UINT8)121;
magentamap[0] = (UINT8)182;
pinkmap[0] = (UINT8)210;
brownmap[0] = (UINT8)224;
tanmap[0] = (UINT8)217; // no longer nice :(
// Init back colormap
CON_SetupBackColormap();
@ -1472,7 +1472,7 @@ static void CON_DrawInput(void)
{
x -= charwidth*3;
if (input_sel < c)
V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 107 | V_NOSCALESTART);
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);
}
@ -1483,7 +1483,7 @@ static void CON_DrawInput(void)
{
if ((input_sel > c && input_cur <= c) || (input_sel <= c && input_cur > c))
{
V_DrawFill(x, y, charwidth, (10 * con_scalefactor), 107 | V_NOSCALESTART);
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
@ -1497,7 +1497,7 @@ static void CON_DrawInput(void)
if (rellip)
{
if (input_sel > cend)
V_DrawFill(x, y, charwidth*3, (10 * con_scalefactor), 107 | V_NOSCALESTART);
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);
}

View file

@ -39,7 +39,7 @@ extern UINT32 con_scalefactor; // console text scale factor
extern consvar_t cons_backcolor, cons_menuhighlight;
extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\
*skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap;
*skymap, *goldmap, *lavendermap, *aquamap, *magentamap, *pinkmap, *brownmap, *tanmap;
// Console bg color (auto updated to match)
extern UINT8 *consolebgmap;

View file

@ -1175,7 +1175,7 @@ static inline void CL_DrawConnectionStatus(void)
if (cl_mode != CL_DOWNLOADFILES)
{
INT32 i, animtime = ((ccstime / 4) & 15) + 16;
UINT8 palstart = (cl_mode == CL_SEARCHING) ? 128 : 160;
UINT8 palstart = (cl_mode == CL_SEARCHING) ? 32 : 96;
// 15 pal entries total.
const char *cltext;
@ -1259,8 +1259,8 @@ static inline void CL_DrawConnectionStatus(void)
dldlength = (INT32)((file->currentsize/(double)file->totalsize) * 256);
if (dldlength > 256)
dldlength = 256;
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175);
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, dldlength, 8, 160);
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 111);
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, dldlength, 8, 96);
memset(tempname, 0, sizeof(tempname));
// offset filename to just the name only part

View file

@ -836,11 +836,11 @@ static inline void D_CleanFile(char **filearray)
static void IdentifyVersion(void)
{
char *srb2wad1, *srb2wad2;
char *mainresource;
const char *srb2waddir = NULL;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
// change to the directory where 'srb2.srb' is found
// change to the directory where 'main.kart' is found
srb2waddir = I_LocateWad();
#endif
@ -871,46 +871,34 @@ static void IdentifyVersion(void)
srb2waddir = I_GetWadDir();
#endif
// Commercial.
srb2wad1 = malloc(strlen(srb2waddir)+1+8+1);
srb2wad2 = malloc(strlen(srb2waddir)+1+8+1);
if (srb2wad1 == NULL && srb2wad2 == NULL)
mainresource = malloc(strlen(srb2waddir)+1+9+1);
if (mainresource == NULL)
I_Error("No more free memory to look in %s", srb2waddir);
if (srb2wad1 != NULL)
sprintf(srb2wad1, pandf, srb2waddir, "srb2.srb");
if (srb2wad2 != NULL)
sprintf(srb2wad2, pandf, srb2waddir, "srb2.wad");
if (mainresource != NULL)
sprintf(mainresource, pandf, srb2waddir, "main.kart");
// will be overwritten in case of -cdrom or unix/win home
snprintf(configfile, sizeof configfile, "%s" PATHSEP CONFIGFILENAME, srb2waddir);
configfile[sizeof configfile - 1] = '\0';
// Load the IWAD
if (srb2wad2 != NULL && FIL_ReadFileOK(srb2wad2))
D_AddFile(srb2wad2, startupwadfiles);
else if (srb2wad1 != NULL && FIL_ReadFileOK(srb2wad1))
D_AddFile(srb2wad1, startupwadfiles);
if (mainresource != NULL && FIL_ReadFileOK(mainresource))
D_AddFile(mainresource, startupwadfiles);
else
I_Error("SRB2.SRB/SRB2.WAD not found! Expected in %s, ss files: %s or %s\n", srb2waddir, srb2wad1, srb2wad2);
I_Error("MAIN.KART not found! Expected in %s, ss file: %s \n", srb2waddir, mainresource);
if (srb2wad1)
free(srb2wad1);
if (srb2wad2)
free(srb2wad2);
if (mainresource)
free(mainresource);
// if you change the ordering of this or add/remove a file, be sure to update the md5
// checking in D_SRB2Main
#ifdef USE_PATCH_DTA
// Add our crappy patches to fix our bugs
D_AddFile(va(pandf,srb2waddir,"patch.dta"));
#endif
D_AddFile(va(pandf,srb2waddir,"gfx.kart"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"textures.kart"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"chars.kart"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"maps.kart"), startupwadfiles);
#ifdef USE_PATCH_KART
D_AddFile(va(pandf,srb2waddir,"patch.kart"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"gfx.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"textures.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"chars.pk3"), startupwadfiles);
D_AddFile(va(pandf,srb2waddir,"maps.wad"), startupwadfiles); // TODO: make this a pk3 too!
#ifdef USE_PATCH_FILE
D_AddFile(va(pandf,srb2waddir,"patch.pk3"), startupwadfiles);
#endif
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
@ -923,8 +911,8 @@ static void IdentifyVersion(void)
else if (ms == 0) \
I_Error("File "str" has been modified with non-music/sound lumps"); \
}
MUSICTEST("sounds.kart")
MUSICTEST("music.kart")
MUSICTEST("sounds.wad")
MUSICTEST("music.wad")
#undef MUSICTEST
#endif
}
@ -1208,27 +1196,21 @@ void D_SRB2Main(void)
#ifndef DEVELOP
// Check MD5s of autoloaded files
// Note: Do not add any files that ignore MD5!
W_VerifyFileMD5(mainwads, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad
#ifdef USE_PATCH_DTA
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_DTA); // patch.dta
#endif
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_KART); // gfx.kart
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_KART); // textures.kart
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_KART); // chars.kart
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_KART); // maps.kart -- 4 - If you touch this, make sure to touch up the majormods stuff below.
#ifdef USE_PATCH_KART
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_KART); // patch.kart
W_VerifyFileMD5(mainwads, ASSET_HASH_MAIN_KART); // main.kart
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_PK3); // gfx.pk3
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_PK3); // textures.pk3
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_PK3); // chars.pk3
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_WAD); // maps.wad -- 4 - If you touch this, make sure to touch up the majormods stuff below.
#ifdef USE_PATCH_FILE
mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_PK3); // patch.pk3
#endif
#else
#ifdef USE_PATCH_DTA
mainwads++; // patch.dta
#endif
mainwads++; // gfx.kart
mainwads++; // textures.kart
mainwads++; // chars.kart
mainwads++; // maps.kart
#ifdef USE_PATCH_KART
mainwads++; // patch.kart
mainwads++; // gfx.pk3
mainwads++; // textures.pk3
mainwads++; // chars.pk3
mainwads++; // maps.wad
#ifdef USE_PATCH_FILE
mainwads++; // patch.pk3
#endif
#endif //ifndef DEVELOP

View file

@ -328,6 +328,7 @@ consvar_t cv_1up = {"tv_1up", "5", CV_NETVAR|CV_CHEAT, chanc
consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/
// SRB2kart
consvar_t cv_superring = {"superring", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_sneaker = {"sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_rocketsneaker = {"rocketsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_invincibility = {"invincibility", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -365,7 +366,7 @@ consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV
consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartvoterulechanges_cons_t[] = {{0, "Never"}, {1, "Sometimes"}, {2, "Frequent"}, {3, "Always"}, {0, NULL}};
consvar_t cv_kartvoterulechanges = {"kartvoterulechanges", "Frequent", CV_NETVAR, kartvoterulechanges_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}};
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Percentage"}, {2, "Kilometers"}, {3, "Miles"}, {4, "Fracunits"}, {0, NULL}};
consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -101,7 +101,7 @@ extern consvar_t cv_1up, cv_eggmanbox;
extern consvar_t cv_recycler;*/
// SRB2kart items
extern consvar_t cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana;
extern consvar_t cv_superring, cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana;
extern consvar_t cv_eggmanmonitor, cv_orbinaut, cv_jawz, cv_mine;
extern consvar_t cv_ballhog, cv_selfpropelledbomb, cv_grow, cv_shrink;
extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring, cv_kitchensink;

View file

@ -358,7 +358,6 @@ INT32 CL_CheckFiles(void)
// return 1;
// the first is the iwad (the main wad file)
// we don't care if it's called srb2.srb or srb2.wad.
// Never download the IWAD, just assume it's there and identical
// ...No! Why were we sending the base wads to begin with??
//fileneeded[0].status = FS_OPEN;
@ -774,17 +773,14 @@ void Got_Filetxpak(void)
char *filename = file->filename;
static INT32 filetime = 0;
if (!(strcmp(filename, "srb2.srb")
&& strcmp(filename, "srb2.wad")
&& strcmp(filename, "patch.dta")
//&& strcmp(filename, "music.dta")
&& strcmp(filename, "gfx.kart")
&& strcmp(filename, "textures.kart")
&& strcmp(filename, "chars.kart")
&& strcmp(filename, "maps.kart")
&& strcmp(filename, "sounds.kart")
&& strcmp(filename, "music.kart")
&& strcmp(filename, "patch.kart")
if (!(strcmp(filename, "main.kart")
&& strcmp(filename, "gfx.pk3")
&& strcmp(filename, "textures.pk3")
&& strcmp(filename, "chars.pk3")
&& strcmp(filename, "maps.wad")
&& strcmp(filename, "patch.pk3")
&& strcmp(filename, "sounds.wad")
&& strcmp(filename, "music.wad")
))
I_Error("Tried to download \"%s\"", filename);

View file

@ -216,6 +216,7 @@ typedef enum
KITEM_THUNDERSHIELD,
KITEM_HYUDORO,
KITEM_POGOSPRING,
KITEM_SUPERRING,
KITEM_KITCHENSINK,
NUMKARTITEMS,
@ -234,6 +235,7 @@ typedef enum
//{ SRB2kart - kartstuff
typedef enum
{
// TODO: Kill this giant array. Add them as actual player_t variables, or condense related timers into their own, smaller arrays.
// Basic gameplay things
k_position, // Used for Kart positions, mostly for deterministic stuff
k_oldposition, // Used for taunting when you pass someone
@ -247,16 +249,10 @@ typedef enum
k_dropdash, // Charge up for respawn Drop Dash
k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
k_lapanimation, // Used to show the lap start wing logo animation
k_laphand, // Lap hand gfx to use; 0 = none, 1 = :ok_hand:, 2 = :thumbs_up:, 3 = :thumps_down:
k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics
k_voices, // Used to stop the player saying more voices than it should
k_tauntvoices, // Used to specifically stop taunt voice spam
k_instashield, // Instashield no-damage animation timer
k_enginesnd, // Engine sound number you're on.
k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel
k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still
k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still, 2 = stay still & no flashing tics
k_drift, // Drifting Left or Right, plus a bigger counter = sharper turn
k_driftend, // Drift has ended, used to adjust character angle after drift
@ -264,19 +260,27 @@ typedef enum
k_driftboost, // Boost you get from drifting
k_boostcharge, // Charge-up for boosting at the start of the race
k_startboost, // Boost you get from start of race or respawn drop dash
k_rings, // Number of held rings
k_pickuprings, // Number of rings being picked up before added to the counter (prevents rings from being deleted forever over 20)
k_userings, // Have to be not holding the item button to change from using rings to using items (or vice versa), to prevent some weirdness with the button
k_ringdelay, // 3 tic delay between every ring usage
k_ringboost, // Ring boost timer
k_ringlock, // Prevent picking up rings while SPB is locked on
k_sparkleanim, // Angle offset for ring sparkle animation
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
k_pogospring, // Pogo spring bounce effect
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
k_waterskip, // Water skipping counter
k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing
k_numboosts, // Count of how many boosts are being stacked, for after image spawning
k_boostpower, // Base boost value, for offroad
k_speedboost, // Boost value smoothing for max speed
k_accelboost, // Boost value smoothing for acceleration
k_draftpower, // Drafting power (from 0 to FRACUNIT), doubles your top speed & acceleration at max
k_draftleeway, // Leniency timer before removing draft power
k_lastdraft, // Last player being drafted
k_boostangle, // angle set when not spun out OR boosted to determine what direction you should keep going at if you're spun out and boosted.
k_boostcam, // Camera push forward on boost
k_destboostcam, // Ditto
k_timeovercam, // Camera timer for leaving behind or not
k_aizdriftstrat, // Let go of your drift while boosting? Helper for the SICK STRATZ you have just unlocked
k_brakedrift, // Helper for brake-drift spark spawning
@ -294,7 +298,9 @@ typedef enum
k_hyudorotimer, // Duration of the Hyudoro offroad effect itself
k_stealingtimer, // You are stealing an item, this is your timer
k_stolentimer, // You are being stolen from, this is your timer
k_superring, // Spawn rings on top of you every tic!
k_sneakertimer, // Duration of the Sneaker Boost itself
k_levelbooster, // Duration of a level booster's boost (same as sneaker, but separated for )
k_growshrinktimer, // > 0 = Big, < 0 = small
k_squishedtimer, // Squished frame timer
k_rocketsneakertimer, // Rocket Sneaker duration timer
@ -315,11 +321,8 @@ typedef enum
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a bumper
k_comebackmode, // 0 = bomb, 1 = item
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
k_yougotem, // "You Got Em" gfx when hitting someone as a karma player via a method that gets you back in the game instantly
// v1.0.2+ vars
k_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
k_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
k_getsparks, // Disable drift sparks at low speed, JUST enough to give acceleration the actual headstart above speed
k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy
k_spectatewait, // How long have you been waiting as a spectator
@ -327,6 +330,44 @@ typedef enum
NUMKARTSTUFF
} kartstufftype_t;
typedef enum
{
// Unsynced, HUD or clientsided effects
// Item box
khud_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
khud_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
// Rings
khud_ringframe, // Ring spin frame
khud_ringtics, // Tics left until next ring frame
khud_ringdelay, // Next frame's tics
khud_ringspblock, // Which frame of the SPB ring lock animation to use
// Lap finish
khud_lapanimation, // Used to show the lap start wing logo animation
khud_laphand, // Lap hand gfx to use; 0 = none, 1 = :ok_hand:, 2 = :thumbs_up:, 3 = :thumps_down:
// Camera
khud_boostcam, // Camera push forward on boost
khud_destboostcam, // Ditto
khud_timeovercam, // Camera timer for leaving behind or not
// Sounds
khud_enginesnd, // Engine sound offset this player is using.
khud_voices, // Used to stop the player saying more voices than it should
khud_tauntvoices, // Used to specifically stop taunt voice spam
// Battle
khud_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics
khud_yougotem, // "You Got Em" gfx when hitting someone as a karma player via a method that gets you back in the game instantly
NUMKARTHUD
} karthudtype_t;
// QUICKLY GET EITHER SNEAKER OR LEVEL BOOSTER SINCE THEY ARE FUNCTIONALLY IDENTICAL
#define EITHERSNEAKER(p) (p->kartstuff[k_sneakertimer] || p->kartstuff[k_levelbooster])
//}
#define WEP_AUTO 1
@ -387,6 +428,7 @@ typedef struct player_s
// SRB2kart stuff
INT32 kartstuff[NUMKARTSTUFF];
INT32 karthud[NUMKARTHUD];
angle_t frameangle; // for the player add the ability to have the sprite only face other angles
INT16 lturn_max[MAXPREDICTTICS]; // What's the expected turn value for full-left for a number of frames back (to account for netgame latency)?
INT16 rturn_max[MAXPREDICTTICS]; // Ditto but for full-right

View file

@ -3749,8 +3749,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
}
else if (fastcmp(word, "SRB2"))
{
if (mainwads) // srb2.srb triggers this warning otherwise
deh_warning("Patch is only compatible with base SRB2.");
deh_warning("Patch is only compatible with base SRB2.");
}
// Clear all data in certain locations (mostly for unlocks)
// Unless you REALLY want to piss people off,
@ -4797,6 +4796,18 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// Ring
"S_RING",
"S_FASTRING1",
"S_FASTRING2",
"S_FASTRING3",
"S_FASTRING4",
"S_FASTRING5",
"S_FASTRING6",
"S_FASTRING7",
"S_FASTRING8",
"S_FASTRING9",
"S_FASTRING10",
"S_FASTRING11",
"S_FASTRING12",
// Blue Sphere for special stages
"S_BLUEBALL",
@ -7165,6 +7176,29 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_OPAQUESMOKE4",
"S_OPAQUESMOKE5",
"S_RINGDEBT",
"S_RINGSPARKS1",
"S_RINGSPARKS2",
"S_RINGSPARKS3",
"S_RINGSPARKS4",
"S_RINGSPARKS5",
"S_RINGSPARKS6",
"S_RINGSPARKS7",
"S_RINGSPARKS8",
"S_RINGSPARKS9",
"S_RINGSPARKS10",
"S_RINGSPARKS11",
"S_RINGSPARKS12",
"S_RINGSPARKS13",
"S_RINGSPARKS14",
"S_RINGSPARKS15",
"S_DRAFTDUST1",
"S_DRAFTDUST2",
"S_DRAFTDUST3",
"S_DRAFTDUST4",
"S_DRAFTDUST5",
#ifdef SEENAMES
"S_NAMECHECK",
#endif
@ -7951,6 +7985,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_LIONMAN",
"MT_KARMAFIREWORK",
"MT_RINGSPARKS",
"MT_DRAFTDUST",
#ifdef SEENAMES
"MT_NAMECHECK",
@ -8155,51 +8191,46 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"GREY", // SKINCOLOR_GREY
"NICKEL", // SKINCOLOR_NICKEL
"BLACK", // SKINCOLOR_BLACK
"SKUNK", // SKINCOLOR_SKUNK
"FAIRY", // SKINCOLOR_FAIRY
"POPCORN", // SKINCOLOR_POPCORN
"ARTICHOKE", // SKINCOLOR_ARTICHOKE
"PIGEON", // SKINCOLOR_PIGEON
"SEPIA", // SKINCOLOR_SEPIA
"BEIGE", // SKINCOLOR_BEIGE
"WALNUT", // SKINCOLOR_WALNUT
"CARAMEL", // SKINCOLOR_CARAMEL
"PEACH", // SKINCOLOR_PEACH
"BROWN", // SKINCOLOR_BROWN
"LEATHER", // SKINCOLOR_LEATHER
"SALMON", // SKINCOLOR_SALMON
"PINK", // SKINCOLOR_PINK
"ROSE", // SKINCOLOR_ROSE
"BRICK", // SKINCOLOR_BRICK
"CINNAMON", // SKINCOLOR_CINNAMON
"RUBY", // SKINCOLOR_RUBY
"RASPBERRY", // SKINCOLOR_RASPBERRY
"CHERRY", // SKINCOLOR_CHERRY
"RED", // SKINCOLOR_RED
"CRIMSON", // SKINCOLOR_CRIMSON
"MAROON", // SKINCOLOR_MAROON
"LEMONADE", // SKINCOLOR_LEMONADE
"FLAME", // SKINCOLOR_FLAME
"SCARLET", // SKINCOLOR_SCARLET
"KETCHUP", // SKINCOLOR_KETCHUP
"DAWN", // SKINCOLOR_DAWN
"SUNSET", // SKINCOLOR_SUNSET
"CREAMSICLE", // SKINCOLOR_CREAMSICLE
"ORANGE", // SKINCOLOR_ORANGE
"PUMPKIN", // SKINCOLOR_PUMPKIN
"ROSEWOOD", // SKINCOLOR_ROSEWOOD
"BURGUNDY", // SKINCOLOR_BURGUNDY
"TANGERINE", // SKINCOLOR_TANGERINE
"PEACH", // SKINCOLOR_PEACH
"CARAMEL", // SKINCOLOR_CARAMEL
"TAN", // SKINCOLOR_TAN
"CREAM", // SKINCOLOR_CREAM
"GOLD", // SKINCOLOR_GOLD
"ROYAL", // SKINCOLOR_ROYAL
"BRONZE", // SKINCOLOR_BRONZE
"COPPER", // SKINCOLOR_COPPER
"QUARRY", // SKINCOLOR_QUARRY
"YELLOW", // SKINCOLOR_YELLOW
"MUSTARD", // SKINCOLOR_MUSTARD
"CROCODILE", // SKINCOLOR_CROCODILE
"BANANA", // SKINCOLOR_BANANA
"OLIVE", // SKINCOLOR_OLIVE
"CROCODILE", // SKINCOLOR_CROCODILE
"PERIDOT", // SKINCOLOR_PERIDOT
"VOMIT", // SKINCOLOR_VOMIT
"GARDEN", // SKINCOLOR_GARDEN
"LIME", // SKINCOLOR_LIME
@ -8212,14 +8243,16 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"MINT", // SKINCOLOR_MINT
"GREEN", // SKINCOLOR_GREEN
"PINETREE", // SKINCOLOR_PINETREE
"EMERALD", // SKINCOLOR_EMERALD
"TURTLE", // SKINCOLOR_TURTLE
"SWAMP", // SKINCOLOR_SWAMP
"DREAM", // SKINCOLOR_DREAM
"PLAGUE", // SKINCOLOR_PLAGUE
"EMERALD", // SKINCOLOR_EMERALD
"ALGAE", // SKINCOLOR_ALGAE
"CARIBBEAN", // SKINCOLOR_CARIBBEAN
"AZURE", // SKINCOLOR_AZURE
"AQUA", // SKINCOLOR_AQUA
"AQUAMARINE", // SKINCOLOR_AQUAMARINE
"TURQUOISE", // SKINCOLOR_TURQUOISE
"TEAL", // SKINCOLOR_TEAL
"CYAN", // SKINCOLOR_CYAN
"JAWZ", // SKINCOLOR_JAWZ
@ -8229,20 +8262,22 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"SLATE", // SKINCOLOR_SLATE
"STEEL", // SKINCOLOR_STEEL
"THUNDER", // SKINCOLOR_THUNDER
"NOVA", // SKINCOLOR_NOVA
"RUST", // SKINCOLOR_RUST
"WRISTWATCH", // SKINCOLOR_WRISTWATCH
"JET", // SKINCOLOR_JET
"SAPPHIRE", // SKINCOLOR_SAPPHIRE
"ULTRAMARINE", // SKINCOLOR_ULTRAMARINE
"PERIWINKLE", // SKINCOLOR_PERIWINKLE
"BLUE", // SKINCOLOR_BLUE
"BLUEBERRY", // SKINCOLOR_BLUEBERRY
"NOVA", // SKINCOLOR_NOVA
"THISTLE", // SKINCOLOR_THISTLE
"PURPLE", // SKINCOLOR_PURPLE
"PASTEL", // SKINCOLOR_PASTEL
"MOONSLAM", // SKINCOLOR_MOONSLAM
"ULTRAVIOLET", // SKINCOLOR_ULTRAVIOLET
"DUSK", // SKINCOLOR_DUSK
"BUBBLEGUM", // SKINCOLOR_BUBBLEGUM
"PURPLE", // SKINCOLOR_PURPLE
"MAGENTA", // SKINCOLOR_MAGENTA
"FUCHSIA", // SKINCOLOR_FUCHSIA
"TOXIC", // SKINCOLOR_TOXIC
"MAUVE", // SKINCOLOR_MAUVE
@ -8250,6 +8285,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"BYZANTIUM", // SKINCOLOR_BYZANTIUM
"POMEGRANATE", // SKINCOLOR_POMEGRANATE
"LILAC", // SKINCOLOR_LILAC
"TAFFY", // SKINCOLOR_TAFFY
// Special super colors
// Super Sonic Yellow
@ -8365,13 +8401,7 @@ static const char *const KARTSTUFF_LIST[] = {
"DROPDASH",
"THROWDIR",
"LAPANIMATION",
"LAPHAND",
"CARDANIMATION",
"VOICES",
"TAUNTVOICES",
"INSTASHIELD",
"ENGINESND",
"FLOORBOOST",
"SPINOUTTYPE",
@ -8382,19 +8412,27 @@ static const char *const KARTSTUFF_LIST[] = {
"DRIFTBOOST",
"BOOSTCHARGE",
"STARTBOOST",
"RINGS",
"PICKUPRINGS",
"USERINGS",
"RINGDELAY",
"RINGBOOST",
"RINGLOCK",
"SPARKLEANIM",
"JMP",
"OFFROAD",
"POGOSPRING",
"BRAKESTOP",
"WATERSKIP",
"DASHPADCOOLDOWN",
"NUMBOOSTS",
"BOOSTPOWER",
"SPEEDBOOST",
"ACCELBOOST",
"DRAFTPOWER",
"DRAFTLEEWAY",
"LASTDRAFT",
"BOOSTANGLE",
"BOOSTCAM",
"DESTBOOSTCAM",
"TIMEOVERCAM",
"AIZDRIFTSTRAT",
"BRAKEDRIFT",
@ -8409,7 +8447,9 @@ static const char *const KARTSTUFF_LIST[] = {
"HYUDOROTIMER",
"STEALINGTIMER",
"STOLENTIMER",
"SUPERRING",
"SNEAKERTIMER",
"LEVELBOOSTER",
"GROWSHRINKTIMER",
"SQUISHEDTIMER",
"ROCKETSNEAKERTIMER",
@ -8429,10 +8469,7 @@ static const char *const KARTSTUFF_LIST[] = {
"COMEBACKPOINTS",
"COMEBACKMODE",
"WANTED",
"YOUGOTEM",
"ITEMBLINK",
"ITEMBLINKMODE",
"GETSPARKS",
"JAWZTARGETDELAY",
"SPECTATEWAIT",
@ -8530,9 +8567,13 @@ struct {
// Frame settings
{"FF_FRAMEMASK",FF_FRAMEMASK},
{"FF_PAPERSPRITE",FF_PAPERSPRITE},
{"FF_ANIMATE",FF_ANIMATE},
{"FF_RANDOMANIM",FF_RANDOMANIM},
{"FF_GLOBALANIM",FF_GLOBALANIM},
{"FF_FULLBRIGHT",FF_FULLBRIGHT},
{"FF_SEMIBRIGHT",FF_SEMIBRIGHT},
{"FF_PAPERSPRITE",FF_PAPERSPRITE},
{"FF_VERTICALFLIP",FF_VERTICALFLIP},
{"FF_TRANSMASK",FF_TRANSMASK},
{"FF_TRANSSHIFT",FF_TRANSSHIFT},
// new preshifted translucency (used in source)
@ -8889,11 +8930,11 @@ struct {
{"V_SKYMAP",V_SKYMAP},
{"V_LAVENDERMAP",V_LAVENDERMAP},
{"V_GOLDMAP",V_GOLDMAP},
{"V_TEAMAP",V_TEAMAP},
{"V_STEELMAP",V_STEELMAP},
{"V_AQUAMAP",V_AQUAMAP},
{"V_MAGENTAMAP",V_MAGENTAMAP},
{"V_PINKMAP",V_PINKMAP},
{"V_BROWNMAP",V_BROWNMAP},
{"V_PEACHMAP",V_PEACHMAP},
{"V_TANMAP",V_TANMAP},
{"V_TRANSLUCENT",V_TRANSLUCENT},
{"V_10TRANS",V_10TRANS},
{"V_20TRANS",V_20TRANS},
@ -8957,6 +8998,7 @@ struct {
{"KITEM_THUNDERSHIELD",KITEM_THUNDERSHIELD},
{"KITEM_HYUDORO",KITEM_HYUDORO},
{"KITEM_POGOSPRING",KITEM_POGOSPRING},
{"KITEM_SUPERRING",KITEM_SUPERRING},
{"KITEM_KITCHENSINK",KITEM_KITCHENSINK},
{"NUMKARTITEMS",NUMKARTITEMS},
{"KRITEM_TRIPLESNEAKER",KRITEM_TRIPLESNEAKER}, // Additional roulette IDs (not usable for much in Lua besides K_GetItemPatch)
@ -9350,7 +9392,7 @@ fixed_t get_number(const char *word)
void DEH_Check(void)
{
#if defined(_DEBUG) || defined(PARANOIA)
//#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);
const size_t dehmobjs = sizeof(MOBJTYPE_LIST)/sizeof(const char*);
const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*);
@ -9371,7 +9413,7 @@ void DEH_Check(void)
if (dehcolors != MAXTRANSLATIONS)
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", MAXTRANSLATIONS, sizeu1(dehcolors));
#endif
//#endif
}
#ifdef HAVE_BLUA

View file

@ -149,24 +149,21 @@ extern FILE *logstream;
// most interface strings are ignored in development mode.
// we use comprevision and compbranch instead.
#else
#define VERSION 110 // Game version
#define VERSION 200 // Game version
#define SUBVERSION 0 // more precise version number
#define VERSIONSTRING "v1.1"
#define VERSIONSTRINGW L"v1.1"
#define VERSIONSTRING "v2.0"
#define VERSIONSTRINGW L"v2.0"
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
// And change CMakeLists.txt, for CMake users!
// AND appveyor.yml, for the build bots!
#endif
// Maintain compatibility with 1.0.x record attack replays?
#define DEMO_COMPAT_100
//#define DEMO_COMPAT_100
// Does this version require an added patch file?
// Comment or uncomment this as necessary.
//#define USE_PATCH_DTA
// Kart has it's own, as well.
#define USE_PATCH_KART
#define USE_PATCH_FILE
// Use .kart extension addons
#define USE_KART
@ -225,7 +222,7 @@ extern FILE *logstream;
// it's only for detection of the version the player is using so the MS can alert them of an update.
// Only set it higher, not lower, obviously.
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
#define MODVERSION 5
#define MODVERSION 6
// Filter consvars by version
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
@ -260,51 +257,46 @@ typedef enum
SKINCOLOR_GREY,
SKINCOLOR_NICKEL,
SKINCOLOR_BLACK,
SKINCOLOR_SKUNK,
SKINCOLOR_FAIRY,
SKINCOLOR_POPCORN,
SKINCOLOR_ARTICHOKE,
SKINCOLOR_PIGEON,
SKINCOLOR_SEPIA,
SKINCOLOR_BEIGE,
SKINCOLOR_WALNUT,
SKINCOLOR_CARAMEL,
SKINCOLOR_PEACH,
SKINCOLOR_BROWN,
SKINCOLOR_LEATHER,
SKINCOLOR_SALMON,
SKINCOLOR_PINK,
SKINCOLOR_ROSE,
SKINCOLOR_BRICK,
SKINCOLOR_CINNAMON,
SKINCOLOR_RUBY,
SKINCOLOR_RASPBERRY,
SKINCOLOR_CHERRY,
SKINCOLOR_RED,
SKINCOLOR_CRIMSON,
SKINCOLOR_MAROON,
SKINCOLOR_LEMONADE,
SKINCOLOR_FLAME,
SKINCOLOR_SCARLET,
SKINCOLOR_KETCHUP,
SKINCOLOR_DAWN,
SKINCOLOR_SUNSET,
SKINCOLOR_CREAMSICLE,
SKINCOLOR_ORANGE,
SKINCOLOR_PUMPKIN,
SKINCOLOR_ROSEWOOD,
SKINCOLOR_BURGUNDY,
SKINCOLOR_TANGERINE,
SKINCOLOR_PEACH,
SKINCOLOR_CARAMEL,
SKINCOLOR_TAN,
SKINCOLOR_CREAM,
SKINCOLOR_GOLD,
SKINCOLOR_ROYAL,
SKINCOLOR_BRONZE,
SKINCOLOR_COPPER,
SKINCOLOR_QUARRY,
SKINCOLOR_YELLOW,
SKINCOLOR_MUSTARD,
SKINCOLOR_CROCODILE,
SKINCOLOR_BANANA,
SKINCOLOR_OLIVE,
SKINCOLOR_CROCODILE,
SKINCOLOR_PERIDOT,
SKINCOLOR_VOMIT,
SKINCOLOR_GARDEN,
SKINCOLOR_LIME,
@ -317,14 +309,16 @@ typedef enum
SKINCOLOR_MINT,
SKINCOLOR_GREEN,
SKINCOLOR_PINETREE,
SKINCOLOR_EMERALD,
SKINCOLOR_TURTLE,
SKINCOLOR_SWAMP,
SKINCOLOR_DREAM,
SKINCOLOR_PLAGUE,
SKINCOLOR_EMERALD,
SKINCOLOR_ALGAE,
SKINCOLOR_CARIBBEAN,
SKINCOLOR_AZURE,
SKINCOLOR_AQUA,
SKINCOLOR_AQUAMARINE,
SKINCOLOR_TURQUOISE,
SKINCOLOR_TEAL,
SKINCOLOR_CYAN,
SKINCOLOR_JAWZ, // Oni's torment
@ -334,20 +328,22 @@ typedef enum
SKINCOLOR_SLATE,
SKINCOLOR_STEEL,
SKINCOLOR_THUNDER,
SKINCOLOR_NOVA,
SKINCOLOR_RUST,
SKINCOLOR_WRISTWATCH,
SKINCOLOR_JET,
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave - slender aphrodite has overcome me with longing for a girl
SKINCOLOR_ULTRAMARINE,
SKINCOLOR_PERIWINKLE,
SKINCOLOR_BLUE,
SKINCOLOR_BLUEBERRY,
SKINCOLOR_NOVA,
SKINCOLOR_THISTLE,
SKINCOLOR_PURPLE,
SKINCOLOR_PASTEL,
SKINCOLOR_MOONSLAM,
SKINCOLOR_ULTRAVIOLET,
SKINCOLOR_DUSK,
SKINCOLOR_BUBBLEGUM,
SKINCOLOR_PURPLE,
SKINCOLOR_MAGENTA,
SKINCOLOR_FUCHSIA,
SKINCOLOR_TOXIC,
SKINCOLOR_MAUVE,
@ -355,6 +351,7 @@ typedef enum
SKINCOLOR_BYZANTIUM,
SKINCOLOR_POMEGRANATE,
SKINCOLOR_LILAC,
SKINCOLOR_TAFFY,
// "Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now."
// (This comment is a dirty liar! This is only limited by the integer type, so 255 for UINT8.)

View file

@ -173,7 +173,7 @@ static void F_SkyScroll(INT32 scrollspeed)
// SRB2Kart: F_DrawPatchCol is over-engineered; recoded to be less shitty and error-prone
if (rendermode != render_none)
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
x = -((INT32)animtimer);
y = 0;
@ -274,7 +274,7 @@ static void F_IntroDrawScene(void)
highres = true;
}
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
if (background)
{
@ -976,7 +976,7 @@ void F_TitleScreenDrawer(void)
}
else if (finalecount < 52)
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
V_DrawSmallScaledPatch(84, 36, 0, ttkflash);
}
else
@ -992,7 +992,7 @@ void F_TitleScreenDrawer(void)
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
if (transval)
V_DrawFadeScreen(120, 10 - transval);
V_DrawFadeScreen(0, 10 - transval);
V_DrawSmallScaledPatch(84, 36, 0, ttbanner);

View file

@ -1406,7 +1406,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
{
// forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward.
axis = JoyAxis(AXISMOVE, ssplayer);
if (InputDown(gc_accelerate, ssplayer) || (gamepadjoystickmove && axis > 0) || player->kartstuff[k_sneakertimer])
if (InputDown(gc_accelerate, ssplayer) || (gamepadjoystickmove && axis > 0) || EITHERSNEAKER(player))
{
cmd->buttons |= BT_ACCELERATE;
forward = forwardmove[1]; // 50
@ -1555,10 +1555,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
cmd->angleturn *= realtics;
// SRB2kart - no additional angle if not moving
if (((player->mo && player->speed > 0) // Moving
if ((player->mo && player->speed > 0) // Moving
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|| (player->kartstuff[k_respawn]) // Respawning
|| (player->spectator || objectplacing))) // Not a physical player
|| (player->spectator || objectplacing)) // Not a physical player
lang += (cmd->angleturn<<16);
cmd->angleturn = (INT16)(lang >> 16);
@ -2580,6 +2580,7 @@ void G_PlayerReborn(INT32 player)
INT32 bumper;
INT32 comebackpoints;
INT32 wanted;
INT32 rings;
INT32 respawnflip;
boolean songcredit = false;
@ -2631,6 +2632,7 @@ void G_PlayerReborn(INT32 player)
itemamount = 0;
growshrinktimer = 0;
bumper = (G_BattleGametype() ? cv_kartbumpers.value : 0);
rings = (G_BattleGametype() ? 0 : 5);
comebackpoints = 0;
wanted = 0;
starpostwp = 0;
@ -2660,6 +2662,7 @@ void G_PlayerReborn(INT32 player)
growshrinktimer = 0;
bumper = players[player].kartstuff[k_bumper];
rings = players[player].kartstuff[k_rings];
comebackpoints = players[player].kartstuff[k_comebackpoints];
wanted = players[player].kartstuff[k_wanted];
}
@ -2704,17 +2707,19 @@ void G_PlayerReborn(INT32 player)
p->pity = pity;
// SRB2kart
p->kartstuff[k_starpostwp] = starpostwp; // TODO: get these out of kartstuff, it causes desync
p->kartstuff[k_starpostwp] = starpostwp; // TODO: get these out of kartstuff, it causes desync (Does it...?)
p->kartstuff[k_itemroulette] = itemroulette;
p->kartstuff[k_roulettetype] = roulettetype;
p->kartstuff[k_itemtype] = itemtype;
p->kartstuff[k_itemamount] = itemamount;
p->kartstuff[k_growshrinktimer] = growshrinktimer;
p->kartstuff[k_bumper] = bumper;
p->kartstuff[k_rings] = rings;
p->kartstuff[k_comebackpoints] = comebackpoints;
p->kartstuff[k_comebacktimer] = comebacktime;
p->kartstuff[k_wanted] = wanted;
p->kartstuff[k_eggmanblame] = -1;
p->kartstuff[k_lastdraft] = -1;
p->kartstuff[k_starpostflip] = respawnflip;
// Don't do anything immediately
@ -3439,12 +3444,12 @@ UINT8 G_GetGametypeColor(INT16 gt)
{
if (modeattacking // == ATTACKING_RECORD
|| gamestate == GS_TIMEATTACK)
return orangemap[120];
return orangemap[0];
if (gt == GT_MATCH)
return redmap[120];
return redmap[0];
if (gt == GT_RACE)
return skymap[120];
return 247; // FALLBACK
return skymap[0];
return 255; // FALLBACK
}
//
@ -5103,7 +5108,8 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|| (players[displayplayers[0]].kartstuff[k_respawn]) // Respawning
|| (players[displayplayers[0]].spectator || objectplacing)) // Not a physical player
&& !(players[displayplayers[0]].kartstuff[k_spinouttimer] && players[displayplayers[0]].kartstuff[k_sneakertimer])) // Spinning and boosting cancels out spinout
&& !(players[displayplayers[0]].kartstuff[k_spinouttimer]
&& (players[displayplayers[0]].kartstuff[k_sneakertimer] || players[displayplayers[0]].kartstuff[k_levelbooster]))) // Spinning and boosting cancels out spinout
localangle[0] += (cmd->angleturn<<16);
if (!(demoflags & DF_GHOST) && *demo_p == DEMOMARKER)
@ -5351,7 +5357,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
}
// Store the sprite frame.
frame = ghost->frame & 0xFF;
frame = ghost->frame & FF_FRAMEMASK;
if (frame != oldghost[playernum].frame)
{
oldghost[playernum].frame = frame;

View file

@ -46,8 +46,8 @@ typedef unsigned char FBOOLEAN;
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 0
#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 1
#else
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 247
#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 220
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 255
#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 130
#endif
// the chroma key color shows on border sprites, set it to black

View file

@ -4220,7 +4220,11 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
INT32 light = R_GetPlaneLight(sector, spr->mobj->floorz, false);
if (!(spr->mobj->frame & FF_FULLBRIGHT))
{
lightlevel = *sector->lightlist[light].lightlevel;
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
}
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@ -4441,16 +4445,20 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
alpha = Surf.FlatColor.s.alpha;
// Start with the lightlevel and colormap from the top of the sprite
lightlevel = *list[sector->numlights - 1].lightlevel;
colormap = list[sector->numlights - 1].extra_colormap;
i = 0;
temp = FLOAT_TO_FIXED(realtop);
if (spr->mobj->frame & FF_FULLBRIGHT)
lightlevel = 255;
#ifdef ESLOPE
// Start with the lightlevel and colormap from the top of the sprite
lightlevel = 255;
colormap = list[sector->numlights - 1].extra_colormap;
if (!(spr->mobj->frame & FF_FULLBRIGHT))
{
lightlevel = *list[sector->numlights - 1].lightlevel;
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
}
for (i = 1; i < sector->numlights; i++)
{
fixed_t h = sector->lightlist[i].slope ? P_GetZAt(sector->lightlist[i].slope, spr->mobj->x, spr->mobj->y)
@ -4458,7 +4466,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
if (h <= temp)
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
{
lightlevel = *list[i-1].lightlevel;
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
}
colormap = list[i-1].extra_colormap;
break;
}
@ -4466,7 +4478,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
#else
i = R_GetPlaneLight(sector, temp, false);
if (!(spr->mobj->frame & FF_FULLBRIGHT))
{
lightlevel = *list[i].lightlevel;
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
}
colormap = list[i].extra_colormap;
#endif
@ -4482,7 +4498,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
if (!(list[i].flags & FF_NOSHADE) && (list[i].flags & FF_CUTSPRITES))
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
{
lightlevel = *list[i].lightlevel;
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
}
colormap = list[i].extra_colormap;
}
@ -4775,7 +4795,11 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
extracolormap_t *colormap = sector->extra_colormap;
if (!(spr->mobj->frame & FF_FULLBRIGHT))
{
lightlevel = sector->lightlevel;
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
}
if (colormap)
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
@ -4886,6 +4910,9 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
colormap = sector->extra_colormap;
}
if (spr->mobj->frame & FF_SEMIBRIGHT)
lightlevel = 128 + (lightlevel>>1);
if (colormap)
Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
else
@ -5515,6 +5542,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
size_t lumpoff;
unsigned rot;
UINT8 flip;
boolean vflip = (!(thing->eflags & MFE_VERTICALFLIP) != !(thing->frame & FF_VERTICALFLIP));
angle_t ang;
INT32 heightsec, phs;
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
@ -5646,7 +5674,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
x1 = tr_x + x1 * rightcos;
x2 = tr_x - x2 * rightcos;
if (thing->eflags & MFE_VERTICALFLIP)
if (vflip)
{
gz = FIXED_TO_FLOAT(thing->z+thing->height) - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale;
gzt = gz + FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height) * this_scale;
@ -5733,10 +5761,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
//CONS_Debug(DBG_RENDER, "------------------\nH: sprite : %d\nH: frame : %x\nH: type : %d\nH: sname : %s\n\n",
// thing->sprite, thing->frame, thing->type, sprnames[thing->sprite]);
if (thing->eflags & MFE_VERTICALFLIP)
vis->vflip = true;
else
vis->vflip = false;
vis->vflip = vflip;
vis->precip = false;
}

View file

@ -793,13 +793,14 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_GREY:
case SKINCOLOR_NICKEL:
case SKINCOLOR_BLACK:
case SKINCOLOR_SKUNK:
case SKINCOLOR_PLATINUM:
case SKINCOLOR_JET:
cstart = "\x86"; // V_GRAYMAP
break;
case SKINCOLOR_SEPIA:
case SKINCOLOR_BEIGE:
case SKINCOLOR_WALNUT:
case SKINCOLOR_CARAMEL:
case SKINCOLOR_PEACH:
case SKINCOLOR_BROWN:
case SKINCOLOR_LEATHER:
case SKINCOLOR_RUST:
@ -810,20 +811,18 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_SALMON:
case SKINCOLOR_PINK:
case SKINCOLOR_ROSE:
case SKINCOLOR_BRICK:
case SKINCOLOR_LEMONADE:
case SKINCOLOR_BUBBLEGUM:
case SKINCOLOR_LILAC:
case SKINCOLOR_TAFFY:
cstart = "\x8d"; // V_PINKMAP
break;
case SKINCOLOR_CINNAMON:
case SKINCOLOR_RUBY:
case SKINCOLOR_RASPBERRY:
case SKINCOLOR_CHERRY:
case SKINCOLOR_RED:
case SKINCOLOR_CRIMSON:
case SKINCOLOR_MAROON:
case SKINCOLOR_FLAME:
case SKINCOLOR_SCARLET:
case SKINCOLOR_KETCHUP:
cstart = "\x85"; // V_REDMAP
@ -832,16 +831,13 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_SUNSET:
case SKINCOLOR_CREAMSICLE:
case SKINCOLOR_ORANGE:
case SKINCOLOR_PUMPKIN:
case SKINCOLOR_ROSEWOOD:
case SKINCOLOR_BURGUNDY:
case SKINCOLOR_TANGERINE:
cstart = "\x87"; // V_ORANGEMAP
break;
case SKINCOLOR_PEACH:
case SKINCOLOR_CARAMEL:
case SKINCOLOR_TAN:
case SKINCOLOR_CREAM:
cstart = "\x8f"; // V_PEACHMAP
cstart = "\x8f"; // V_TANMAP
break;
case SKINCOLOR_GOLD:
case SKINCOLOR_ROYAL:
@ -851,39 +847,43 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
cstart = "\x8A"; // V_GOLDMAP
break;
case SKINCOLOR_POPCORN:
case SKINCOLOR_QUARRY:
case SKINCOLOR_YELLOW:
case SKINCOLOR_MUSTARD:
case SKINCOLOR_CROCODILE:
case SKINCOLOR_BANANA:
case SKINCOLOR_OLIVE:
case SKINCOLOR_CROCODILE:
cstart = "\x82"; // V_YELLOWMAP
break;
case SKINCOLOR_ARTICHOKE:
case SKINCOLOR_PERIDOT:
case SKINCOLOR_VOMIT:
case SKINCOLOR_GARDEN:
case SKINCOLOR_TEA:
case SKINCOLOR_PISTACHIO:
cstart = "\x8b"; // V_TEAMAP
break;
case SKINCOLOR_LIME:
case SKINCOLOR_HANDHELD:
case SKINCOLOR_TEA:
case SKINCOLOR_PISTACHIO:
case SKINCOLOR_MOSS:
case SKINCOLOR_CAMOUFLAGE:
case SKINCOLOR_ROBOHOOD:
case SKINCOLOR_MINT:
case SKINCOLOR_GREEN:
case SKINCOLOR_PINETREE:
case SKINCOLOR_EMERALD:
case SKINCOLOR_TURTLE:
case SKINCOLOR_SWAMP:
case SKINCOLOR_DREAM:
case SKINCOLOR_PLAGUE:
case SKINCOLOR_EMERALD:
case SKINCOLOR_ALGAE:
cstart = "\x83"; // V_GREENMAP
break;
case SKINCOLOR_CARIBBEAN:
case SKINCOLOR_AZURE:
case SKINCOLOR_AQUA:
case SKINCOLOR_AQUAMARINE:
case SKINCOLOR_TURQUOISE:
case SKINCOLOR_TEAL:
cstart = "\x8b"; // V_AQUAMAP
break;
case SKINCOLOR_PIGEON:
case SKINCOLOR_CYAN:
case SKINCOLOR_JAWZ:
case SKINCOLOR_CERULEAN:
@ -891,24 +891,24 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_SAPPHIRE:
cstart = "\x88"; // V_SKYMAP
break;
case SKINCOLOR_PIGEON:
case SKINCOLOR_PLATINUM:
case SKINCOLOR_STEEL:
cstart = "\x8c"; // V_STEELMAP
break;
case SKINCOLOR_ULTRAMARINE:
case SKINCOLOR_PERIWINKLE:
case SKINCOLOR_BLUE:
case SKINCOLOR_BLUEBERRY:
case SKINCOLOR_NOVA:
cstart = "\x84"; // V_BLUEMAP
break;
case SKINCOLOR_ULTRAVIOLET:
case SKINCOLOR_THISTLE:
case SKINCOLOR_PURPLE:
case SKINCOLOR_FUCHSIA:
case SKINCOLOR_PASTEL:
cstart = "\x81"; // V_PURPLEMAP
break;
case SKINCOLOR_PASTEL:
case SKINCOLOR_MAGENTA:
case SKINCOLOR_FUCHSIA:
case SKINCOLOR_MOONSLAM:
cstart = "\x8c"; // V_MAGENTAMAP
break;
case SKINCOLOR_DUSK:
case SKINCOLOR_TOXIC:
case SKINCOLOR_MAUVE:
@ -1581,7 +1581,7 @@ static void HU_drawMiniChat(void)
else
{
if (cv_chatbacktint.value) // on request of wolfy
V_DrawFillConsoleMap(x + dx + 2, y+dy, charwidth, charheight, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT);
V_DrawFillConsoleMap(x + dx + 2, y+dy, charwidth, charheight, 159|V_SNAPTOBOTTOM|V_SNAPTOLEFT);
V_DrawChatCharacter(x + dx + 2, y+dy, msg[j++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|transflag, !cv_allcaps.value, colormap);
}
@ -1645,7 +1645,7 @@ static void HU_drawChatLog(INT32 offset)
chat_topy = y + chat_scroll*charheight;
chat_bottomy = chat_topy + boxh*charheight;
V_DrawFillConsoleMap(chatx, chat_topy, boxw, boxh*charheight +2, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT); // log box
V_DrawFillConsoleMap(chatx, chat_topy, boxw, boxh*charheight +2, 159|V_SNAPTOBOTTOM|V_SNAPTOLEFT); // log box
for (i=0; i<chat_nummsg_log; i++) // iterate through our chatlog
{
@ -1770,7 +1770,7 @@ static void HU_DrawChat(void)
cflag = V_GRAYMAP; // set text in gray if chat is muted.
}
V_DrawFillConsoleMap(chatx, y-1, boxw, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
V_DrawFillConsoleMap(chatx, y-1, boxw, (typelines*charheight), 159 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
while (talk[i])
{
@ -1897,14 +1897,14 @@ static void HU_DrawChat(void)
{
char name[MAXPLAYERNAME+1];
strlcpy(name, player_names[i], 7); // shorten name to 7 characters.
V_DrawFillConsoleMap(chatx+ boxw + 2, p_dispy- (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
V_DrawFillConsoleMap(chatx+ boxw + 2, p_dispy- (6*count), 48, 6, 159 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
V_DrawSmallString(chatx+ boxw + 4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, name));
count++;
}
}
if (count == 0) // no results.
{
V_DrawFillConsoleMap(chatx+boxw+2, p_dispy- (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
V_DrawFillConsoleMap(chatx+boxw+2, p_dispy- (6*count), 48, 6, 159 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
V_DrawSmallString(chatx+boxw+4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT.");
}
}

View file

@ -69,7 +69,7 @@ char sprnames[NUMSPRITES + 1][5] =
"CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH",
"MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT",
"OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK",
"XMS4","XMS5","VIEW"
"MXCL","RGSP","DRAF","XMS4","XMS5","VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -969,7 +969,19 @@ state_t states[NUMSTATES] =
{SPR_MSCF, FF_FULLBRIGHT|FF_TRANS30|11, 1, {NULL}, 0, 0, S_MSSHIELD_F1}, // S_MSSHIELD_F12
// Ring
{SPR_RING, FF_ANIMATE, -1, {NULL}, 23, 1, S_RING}, // S_RING
{SPR_RING, FF_SEMIBRIGHT|FF_ANIMATE|FF_GLOBALANIM, -1, {NULL}, 23, 1, S_RING}, // S_RING
{SPR_RING, 0, 1, {NULL}, 0, 0, S_FASTRING2}, // S_FASTRING1
{SPR_RING, 2, 1, {NULL}, 0, 0, S_FASTRING3}, // S_FASTRING2
{SPR_RING, 4, 1, {NULL}, 0, 0, S_FASTRING4}, // S_FASTRING3
{SPR_RING, 6, 1, {NULL}, 0, 0, S_FASTRING5}, // S_FASTRING4
{SPR_RING, 8, 1, {NULL}, 0, 0, S_FASTRING6}, // S_FASTRING5
{SPR_RING, 10, 1, {NULL}, 0, 0, S_FASTRING7}, // S_FASTRING6
{SPR_RING, 12, 1, {NULL}, 0, 0, S_FASTRING8}, // S_FASTRING7
{SPR_RING, 14, 1, {NULL}, 0, 0, S_FASTRING9}, // S_FASTRING8
{SPR_RING, 16, 1, {NULL}, 0, 0, S_FASTRING10}, // S_FASTRING9
{SPR_RING, 18, 1, {NULL}, 0, 0, S_FASTRING11}, // S_FASTRING10
{SPR_RING, 20, 1, {NULL}, 0, 0, S_FASTRING12}, // S_FASTRING11
{SPR_RING, 22, 1, {NULL}, 0, 0, S_FASTRING1}, // S_FASTRING12
// Blue Sphere Replacement for special stages
{SPR_BBAL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUEBALL
@ -3401,6 +3413,30 @@ state_t states[NUMSTATES] =
{SPR_SMOK, 3, 7, {NULL}, 0, 0, S_OPAQUESMOKE5}, // S_OPAQUESMOKE4
{SPR_SMOK, 4, 8, {NULL}, 0, 0, S_NULL}, // S_OPAQUESMOKE5
{SPR_MXCL, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_RINGDEBT
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_RINGSPARKS2}, // S_RINGSPARKS1
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_RINGSPARKS3}, // S_RINGSPARKS2
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_RINGSPARKS4}, // S_RINGSPARKS3
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|3, 1, {NULL}, 0, 0, S_RINGSPARKS5}, // S_RINGSPARKS4
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_RINGSPARKS6}, // S_RINGSPARKS5
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|5, 1, {NULL}, 0, 0, S_RINGSPARKS7}, // S_RINGSPARKS6
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|6, 1, {NULL}, 0, 0, S_RINGSPARKS8}, // S_RINGSPARKS7
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|7, 1, {NULL}, 0, 0, S_RINGSPARKS9}, // S_RINGSPARKS8
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|8, 1, {NULL}, 0, 0, S_RINGSPARKS10}, // S_RINGSPARKS9
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|9, 1, {NULL}, 0, 0, S_RINGSPARKS11}, // S_RINGSPARKS10
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|10, 1, {NULL}, 0, 0, S_RINGSPARKS12}, // S_RINGSPARKS11
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|11, 1, {NULL}, 0, 0, S_RINGSPARKS13}, // S_RINGSPARKS12
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|12, 1, {NULL}, 0, 0, S_RINGSPARKS14}, // S_RINGSPARKS13
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|13, 1, {NULL}, 0, 0, S_RINGSPARKS15}, // S_RINGSPARKS14
{SPR_RGSP, FF_PAPERSPRITE|FF_FULLBRIGHT|14, 1, {NULL}, 0, 0, S_NULL}, // S_RINGSPARKS15
{SPR_DRAF, 0, 2, {NULL}, 0, 0, S_DRAFTDUST2}, // S_DRAFTDUST1
{SPR_DRAF, 1, 1, {NULL}, 0, 0, S_DRAFTDUST3}, // S_DRAFTDUST2
{SPR_DRAF, 2, 1, {NULL}, 0, 0, S_DRAFTDUST4}, // S_DRAFTDUST3
{SPR_DRAF, 3, 1, {NULL}, 0, 0, S_DRAFTDUST5}, // S_DRAFTDUST4
{SPR_DRAF, 4, 1, {NULL}, 0, 0, S_NULL}, // S_DRAFTDUST5
#ifdef SEENAMES
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
#endif
@ -5447,12 +5483,12 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_SPRK1, // deathstate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_itemup, // deathsound
38*FRACUNIT, // speed
16*FRACUNIT, // radius
24*FRACUNIT, // height
48*FRACUNIT, // radius
48*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
@ -5478,13 +5514,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_itemup, // deathsound
38*FRACUNIT, // speed
15*FRACUNIT, // radius
24*FRACUNIT, // height
24*FRACUNIT, // radius
48*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL, // flags
MF_SLIDEME|MF_BOUNCE|MF_SPECIAL|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
@ -20059,6 +20095,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_RINGSPARKS
-1, // doomednum
S_RINGSPARKS1, // 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
8<<FRACBITS, // radius
16<<FRACBITS, // height
1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_DRAFTDUST
-1, // doomednum
S_DRAFTDUST1, // 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
8<<FRACBITS, // radius
16<<FRACBITS, // height
1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
// ============================================================================================================================//
#ifdef SEENAMES

View file

@ -775,6 +775,9 @@ typedef enum sprite
SPR_WBLN,
SPR_FWRK,
SPR_MXCL,
SPR_RGSP,
SPR_DRAF,
// Xmas-specific sprites that don't fit aboxe
SPR_XMS4,
@ -1675,6 +1678,18 @@ typedef enum state
// Ring
S_RING,
S_FASTRING1,
S_FASTRING2,
S_FASTRING3,
S_FASTRING4,
S_FASTRING5,
S_FASTRING6,
S_FASTRING7,
S_FASTRING8,
S_FASTRING9,
S_FASTRING10,
S_FASTRING11,
S_FASTRING12,
// Blue Sphere for special stages
S_BLUEBALL,
@ -4058,6 +4073,29 @@ typedef enum state
S_OPAQUESMOKE4,
S_OPAQUESMOKE5,
S_RINGDEBT,
S_RINGSPARKS1,
S_RINGSPARKS2,
S_RINGSPARKS3,
S_RINGSPARKS4,
S_RINGSPARKS5,
S_RINGSPARKS6,
S_RINGSPARKS7,
S_RINGSPARKS8,
S_RINGSPARKS9,
S_RINGSPARKS10,
S_RINGSPARKS11,
S_RINGSPARKS12,
S_RINGSPARKS13,
S_RINGSPARKS14,
S_RINGSPARKS15,
S_DRAFTDUST1,
S_DRAFTDUST2,
S_DRAFTDUST3,
S_DRAFTDUST4,
S_DRAFTDUST5,
#ifdef SEENAMES
S_NAMECHECK,
#endif
@ -4861,6 +4899,8 @@ typedef enum mobj_type
MT_LIONMAN,
MT_KARMAFIREWORK,
MT_RINGSPARKS,
MT_DRAFTDUST,
#ifdef SEENAMES
MT_NAMECHECK,

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,9 @@ void K_RegisterKartStuff(void);
boolean K_IsPlayerLosing(player_t *player);
boolean K_IsPlayerWanted(player_t *player);
fixed_t K_GetKartGameSpeedScalar(SINT8 value);
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
void K_KartPainEnergyFling(player_t *player);
void K_FlipFromObject(mobj_t *mo, mobj_t *master);
void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master);
void K_RespawnChecker(player_t *player);
@ -41,6 +43,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
void K_SpawnBoostTrail(player_t *player);
void K_SpawnSparkleTrail(mobj_t *mo);
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
void K_SpawnDraftDust(mobj_t *mo);
void K_DriftDustHandling(mobj_t *spawner);
void K_PuntMine(mobj_t *mine, mobj_t *punter);
void K_DoSneaker(player_t *player, INT32 type);
@ -71,6 +74,7 @@ void K_CheckSpectateStatus(void);
void K_PlayAttackTaunt(mobj_t *source);
void K_PlayBoostTaunt(mobj_t *source);
void K_PlayOvertakeSound(mobj_t *source);
void K_PlayPainSound(mobj_t *source);
void K_PlayHitEmSound(mobj_t *source);
void K_PlayPowerGloatSound(mobj_t *source);

View file

@ -1166,37 +1166,6 @@ static int lib_pPlayerRingBurst(lua_State *L)
return 0;
}
static int lib_pPlayerWeaponPanelBurst(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_PlayerWeaponPanelBurst(player);
return 0;
}
static int lib_pPlayerWeaponAmmoBurst(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_PlayerWeaponAmmoBurst(player);
return 0;
}
static int lib_pPlayerEmeraldBurst(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean toss = lua_optboolean(L, 2);
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_PlayerEmeraldBurst(player, toss);
return 0;
}
static int lib_pPlayerFlagBurst(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2229,6 +2198,16 @@ static int lib_kOvertakeSound(lua_State *L)
return 0;
}
static int lib_kPainSound(lua_State *L)
{
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
if (!mobj->player)
return luaL_error(L, "K_PlayPainSound: mobj_t isn't a player object."); //Nothing bad would happen if we let it run the func, but telling why it ain't doing anything is helpful.
K_PlayPainSound(mobj);
return 0;
}
static int lib_kHitEmSound(lua_State *L)
{
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -2744,9 +2723,6 @@ static luaL_Reg lib[] = {
{"P_DamageMobj",lib_pDamageMobj},
{"P_KillMobj",lib_pKillMobj},
{"P_PlayerRingBurst",lib_pPlayerRingBurst},
{"P_PlayerWeaponPanelBurst",lib_pPlayerWeaponPanelBurst},
{"P_PlayerWeaponAmmoBurst",lib_pPlayerWeaponAmmoBurst},
{"P_PlayerEmeraldBurst",lib_pPlayerEmeraldBurst},
{"P_PlayerFlagBurst",lib_pPlayerFlagBurst},
{"P_PlayRinglossSound",lib_pPlayRinglossSound},
{"P_PlayDeathSound",lib_pPlayDeathSound},
@ -2835,6 +2811,7 @@ static luaL_Reg lib[] = {
{"K_PlayPowerGloatSound", lib_kGloatSound},
{"K_PlayOvertakeSound", lib_kOvertakeSound},
{"K_PlayLossSound", lib_kLossSound},
{"K_PlayPainSound", lib_kPainSound},
{"K_PlayHitEmSound", lib_kHitEmSound},
{"K_GetKartColorByName",lib_kGetKartColorByName},
{"K_IsPlayerLosing",lib_kIsPlayerLosing},

View file

@ -618,26 +618,26 @@ static int libd_drawFill(lua_State *L)
static int libd_fadeScreen(lua_State *L)
{
UINT16 color = luaL_checkinteger(L, 1);
UINT8 strength = luaL_checkinteger(L, 2);
const UINT8 maxstrength = ((color & 0xFF00) ? 32 : 10);
UINT16 color = luaL_checkinteger(L, 1);
UINT8 strength = luaL_checkinteger(L, 2);
const UINT8 maxstrength = ((color & 0xFF00) ? 32 : 10);
HUDONLY
HUDONLY
if (!strength)
return 0;
if (!strength)
return 0;
if (strength > maxstrength)
return luaL_error(L, "%s fade strength %d out of range (0 - %d)", ((color & 0xFF00) ? "COLORMAP" : "TRANSMAP"), strength, maxstrength);
if (strength > maxstrength)
return luaL_error(L, "%s fade strength %d out of range (0 - %d)", ((color & 0xFF00) ? "COLORMAP" : "TRANSMAP"), strength, maxstrength);
if (strength == maxstrength) // Allow as a shortcut for drawfill...
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, ((color & 0xFF00) ? 31 : color));
return 0;
}
if (strength == maxstrength) // Allow as a shortcut for drawfill...
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, ((color & 0xFF00) ? 31 : color));
return 0;
}
V_DrawFadeScreen(color, strength);
return 0;
V_DrawFadeScreen(color, strength);
return 0;
}
static int libd_drawString(lua_State *L)

View file

@ -1562,7 +1562,7 @@ static menuitem_t OP_AdvServerOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 66},
};*/
#define ITEMTOGGLEBOTTOMRIGHT
//#define ITEMTOGGLEBOTTOMRIGHT
static menuitem_t OP_MonitorToggleMenu[] =
{
@ -1590,6 +1590,7 @@ static menuitem_t OP_MonitorToggleMenu[] =
{IT_KEYHANDLER | IT_NOTHING, NULL, "Thunder Shields", M_HandleMonitorToggles, KITEM_THUNDERSHIELD},
{IT_KEYHANDLER | IT_NOTHING, NULL, "Hyudoros", M_HandleMonitorToggles, KITEM_HYUDORO},
{IT_KEYHANDLER | IT_NOTHING, NULL, "Pogo Springs", M_HandleMonitorToggles, KITEM_POGOSPRING},
{IT_KEYHANDLER | IT_NOTHING, NULL, "Super Rings", M_HandleMonitorToggles, KITEM_SUPERRING},
{IT_KEYHANDLER | IT_NOTHING, NULL, "Kitchen Sinks", M_HandleMonitorToggles, KITEM_KITCHENSINK},
#ifdef ITEMTOGGLEBOTTOMRIGHT
{IT_KEYHANDLER | IT_NOTHING, NULL, "---", M_HandleMonitorToggles, 255},
@ -3516,7 +3517,7 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop)
void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines)
{
// Solid color textbox.
V_DrawFill(x+5, y+5, width*8+6, boxlines*8+6, 239);
V_DrawFill(x+5, y+5, width*8+6, boxlines*8+6, 159);
//V_DrawFill(x+8, y+8, width*8, boxlines*8, 31);
/*
patch_t *p;
@ -4675,10 +4676,10 @@ static void M_DrawTemperature(INT32 x, fixed_t t)
t = (FixedMul(h<<FRACBITS, t)>>FRACBITS);
// border
V_DrawFill(x - 1, vpadding, 1, h, 120);
V_DrawFill(x + width, vpadding, 1, h, 120);
V_DrawFill(x - 1, vpadding-1, width+2, 1, 120);
V_DrawFill(x - 1, vpadding+h, width+2, 1, 120);
V_DrawFill(x - 1, vpadding, 1, h, 0);
V_DrawFill(x + width, vpadding, 1, h, 0);
V_DrawFill(x - 1, vpadding-1, width+2, 1, 0);
V_DrawFill(x - 1, vpadding+h, width+2, 1, 0);
// bar itself
y = h;
@ -4829,14 +4830,14 @@ static void M_DrawAddons(void)
x = currentMenu->x;
y = currentMenu->y + 1;
hilicol = V_GetStringColormap(highlightflags)[120];
hilicol = V_GetStringColormap(highlightflags)[0];
V_DrawString(x-21, (y - 16) + (lsheadingheight - 12), highlightflags|V_ALLOWLOWERCASE, M_AddonsHeaderPath());
V_DrawFill(x-21, (y - 16) + (lsheadingheight - 3), MAXSTRINGLENGTH*8+6, 1, hilicol);
V_DrawFill(x-21, (y - 16) + (lsheadingheight - 2), MAXSTRINGLENGTH*8+6, 1, 30);
m = (BASEVIDHEIGHT - currentMenu->y + 2) - (y - 1);
V_DrawFill(x - 21, y - 1, MAXSTRINGLENGTH*8+6, m, 239);
V_DrawFill(x - 21, y - 1, MAXSTRINGLENGTH*8+6, m, 159);
// scrollbar!
if (sizedirmenu <= (2*numaddonsshown + 1))
@ -5562,8 +5563,8 @@ static void M_DrawReplayHut(void)
y = sizedirmenu*10 + currentMenu->menuitems[replaylistitem].alphaKey + 30;
if (y > SCALEDVIEWHEIGHT-80)
{
V_DrawFill(BASEVIDWIDTH-4, 75, 4, SCALEDVIEWHEIGHT-80, V_SNAPTOTOP|V_SNAPTORIGHT|239);
V_DrawFill(BASEVIDWIDTH-3, 76 + (SCALEDVIEWHEIGHT-80) * replayhutmenuy / y, 2, (((SCALEDVIEWHEIGHT-80) * (SCALEDVIEWHEIGHT-80))-1) / y - 1, V_SNAPTOTOP|V_SNAPTORIGHT|229);
V_DrawFill(BASEVIDWIDTH-4, 75, 4, SCALEDVIEWHEIGHT-80, V_SNAPTOTOP|V_SNAPTORIGHT|159);
V_DrawFill(BASEVIDWIDTH-3, 76 + (SCALEDVIEWHEIGHT-80) * replayhutmenuy / y, 2, (((SCALEDVIEWHEIGHT-80) * (SCALEDVIEWHEIGHT-80))-1) / y - 1, V_SNAPTOTOP|V_SNAPTORIGHT|149);
}
// Draw the cursor
@ -5572,7 +5573,7 @@ static void M_DrawReplayHut(void)
V_DrawString(currentMenu->x, cursory, V_SNAPTOTOP|V_SNAPTOLEFT|highlightflags, currentMenu->menuitems[itemOn].text);
// Now draw some replay info!
V_DrawFill(10, 10, 300, 60, V_SNAPTOTOP|239);
V_DrawFill(10, 10, 300, 60, V_SNAPTOTOP|159);
if (itemOn == replaylistitem)
{
@ -5654,7 +5655,7 @@ static void M_DrawReplayStartMenu(void)
}
}
V_DrawFill(10, 10, 300, 60, V_SNAPTOTOP|239);
V_DrawFill(10, 10, 300, 60, V_SNAPTOTOP|159);
DrawReplayHutReplayInfo();
V_DrawString(10, 72, V_SNAPTOTOP|highlightflags|V_ALLOWLOWERCASE, demolist[dir_on[menudepthleft]].title);
@ -7583,7 +7584,7 @@ void M_DrawTimeAttackMenu(void)
time = mainrecords[cv_nextmap.value-1]->time;
}
V_DrawFill((BASEVIDWIDTH - dupadjust)>>1, 78, dupadjust, 36, 239);
V_DrawFill((BASEVIDWIDTH - dupadjust)>>1, 78, dupadjust, 36, 159);
V_DrawRightAlignedString(149, 80, highlightflags, "BEST LAP:");
K_drawKartTimestamp(lap, 19, 86, 0, 2);
@ -8630,7 +8631,7 @@ static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade)
y = currentMenu->y + 130 + 8 - i;
if (currentMenu->menuitems[itemOn].itemaction == &cv_nextmap && skullAnimCounter < 4)
trans = 120;
trans = 0;
else
trans = G_GetGametypeColor(cv_newgametype.value);
@ -8822,7 +8823,7 @@ Update the maxplayers label...
#ifndef NONET
y += MP_MainMenu[8].alphaKey;
V_DrawFill(x+5, y+4+5, /*16*8 + 6,*/ BASEVIDWIDTH - 2*(x+5), 8+6, 239);
V_DrawFill(x+5, y+4+5, /*16*8 + 6,*/ BASEVIDWIDTH - 2*(x+5), 8+6, 159);
// draw name string
V_DrawString(x+8,y+12, V_ALLOWLOWERCASE, setupm_ip);
@ -9296,7 +9297,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
flags |= V_FLIP; // This sprite is left/right flipped!
// draw box around guy
V_DrawFill(mx + 43 - (charw/2), my+65, charw, 84, 239);
V_DrawFill(mx + 43 - (charw/2), my+65, charw, 84, 159);
// draw player sprite
if (setupm_fakecolor) // inverse should never happen
@ -10627,6 +10628,7 @@ static consvar_t *kartitemcvs[NUMKARTRESULTS-1] = {
&cv_thundershield,
&cv_hyudoro,
&cv_pogospring,
&cv_superring,
&cv_kitchensink,
&cv_triplesneaker,
&cv_triplebanana,

View file

@ -710,59 +710,6 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
//return false;
}
/** Looks for a player with a ring shield.
* Used by rings.
*
* \param actor Ring looking for a shield to be attracted to.
* \return True if a player with ring shield is found, otherwise false.
* \sa A_AttractChase
*/
static boolean P_LookForShield(mobj_t *actor)
{
INT32 c = 0, stop;
player_t *player;
// BP: first time init, this allow minimum lastlook changes
if (actor->lastlook < 0)
actor->lastlook = P_RandomByte();
actor->lastlook %= MAXPLAYERS;
stop = (actor->lastlook - 1) & PLAYERSMASK;
for (; ; actor->lastlook = ((actor->lastlook + 1) & PLAYERSMASK))
{
// done looking
if (actor->lastlook == stop)
return false;
if (!playeringame[actor->lastlook])
continue;
if (c++ == 2)
return false;
player = &players[actor->lastlook];
if (player->health <= 0 || !player->mo)
continue; // dead
//When in CTF, don't pull rings that you cannot pick up.
if ((actor->type == MT_REDTEAMRING && player->ctfteam != 1) ||
(actor->type == MT_BLUETEAMRING && player->ctfteam != 2))
continue;
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT
&& (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST/4, player->mo->scale)))
{
P_SetTarget(&actor->tracer, player->mo);
return true;
}
}
//return false;
}
#ifdef WEIGHTEDRECYCLER
// Compares players to see who currently has the "best" items, etc.
static int P_RecycleCompare(const void *p1, const void *p2)
@ -3615,57 +3562,163 @@ void A_AttractChase(mobj_t *actor)
if (LUA_CallAction("A_AttractChase", actor))
return;
#endif
if (actor->flags2 & MF2_NIGHTSPULL || !actor->health)
return;
// spilled rings flicker before disappearing
if (leveltime & 1 && actor->type == (mobjtype_t)actor->info->reactiontime && actor->fuse && actor->fuse < 2*TICRATE)
actor->flags2 |= MF2_DONTDRAW;
if (actor->extravalue1) // SRB2Kart
{
#define RINGBOOSTPWR (((9 - actor->target->player->kartspeed) + (9 - actor->target->player->kartweight)) / 2)
if (!actor->target || P_MobjWasRemoved(actor->target) || !actor->target->player)
{
P_RemoveMobj(actor);
return;
}
if (actor->extravalue2) // Using for ring boost
{
// Always fullbright
actor->frame |= FF_FULLBRIGHT;
if (actor->extravalue1 >= 21)
{
mobj_t *sparkle;
angle_t offset = FixedAngle(18<<FRACBITS);
// Base add is 3 tics for 9,9, adds 1 tic for each point closer to the 1,1 end
actor->target->player->kartstuff[k_ringboost] += RINGBOOSTPWR+3;
S_StartSound(actor->target, sfx_s1b5);
sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS);
P_SetTarget(&sparkle->target, actor->target);
sparkle->angle = (actor->target->angle + (offset>>1)) + (offset * actor->target->player->kartstuff[k_sparkleanim]);
actor->target->player->kartstuff[k_sparkleanim] = (actor->target->player->kartstuff[k_sparkleanim]+1) % 20;
P_KillMobj(actor, actor->target, actor->target);
return;
}
else
{
fixed_t offz = FixedMul(80*actor->target->scale, FINESINE(FixedAngle((90 - (9 * abs(10 - actor->extravalue1))) << FRACBITS) >> ANGLETOFINESHIFT));
//P_SetScale(actor, (actor->destscale = actor->target->scale));
P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z + actor->target->height + offz);
actor->extravalue1++;
}
}
else // Collecting
{
if (actor->extravalue1 >= 16)
{
if (actor->target->player->kartstuff[k_rings] >= 20)
actor->target->player->kartstuff[k_ringboost] += RINGBOOSTPWR+3;
else
P_GivePlayerRings(actor->target->player, 1);
if (actor->cvmem) // caching
S_StartSound(actor->target, sfx_s1c5);
else
S_StartSound(actor->target, sfx_s227);
actor->target->player->kartstuff[k_pickuprings]--;
P_RemoveMobj(actor);
return;
}
else
{
fixed_t dist = (actor->target->radius/4) * (16 - actor->extravalue1);
P_SetScale(actor, (actor->destscale = actor->target->scale - ((actor->target->scale/14) * actor->extravalue1)));
P_TeleportMove(actor,
actor->target->x + FixedMul(dist, FINECOSINE(actor->angle >> ANGLETOFINESHIFT)),
actor->target->y + FixedMul(dist, FINESINE(actor->angle >> ANGLETOFINESHIFT)),
actor->target->z + (24 * actor->target->scale));
actor->angle += ANG30;
actor->extravalue1++;
}
}
#undef RINGBOOSTPWR
}
else
actor->flags2 &= ~MF2_DONTDRAW;
// Turn flingrings back into regular rings if attracted.
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)
{
mobj_t *newring;
newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime);
newring->momx = actor->momx;
newring->momy = actor->momy;
newring->momz = actor->momz;
P_RemoveMobj(actor);
return;
// Don't immediately pick up spilled rings
if (actor->threshold > 0)
actor->threshold--;
// Rings flicker before disappearing
if (actor->fuse && actor->fuse < 5*TICRATE && (leveltime & 1))
actor->flags2 |= MF2_DONTDRAW;
else
actor->flags2 &= ~MF2_DONTDRAW;
// spilled rings have ghost trails and get capped to a certain speed
if (actor->type == (mobjtype_t)actor->info->reactiontime)
{
const fixed_t maxspeed = 4<<FRACBITS;
fixed_t oldspeed = R_PointToDist2(0, 0, actor->momx, actor->momy);
if (oldspeed > maxspeed)
{
fixed_t newspeed = max(maxspeed, oldspeed-FRACUNIT);
actor->momx = FixedMul(FixedDiv(actor->momx, oldspeed), newspeed);
actor->momy = FixedMul(FixedDiv(actor->momy, oldspeed), newspeed);
}
if (!P_IsObjectOnGround(actor))
P_SpawnGhostMobj(actor)->tics = 3;
}
if (actor->tracer && actor->tracer->player && actor->tracer->health
//&& P_CheckSight(actor, actor->tracer)
&& actor->tracer->player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD
&& (actor->tracer->player->kartstuff[k_rings]+actor->tracer->player->kartstuff[k_pickuprings]) < 20
&& !actor->tracer->player->kartstuff[k_ringlock])
{
fixed_t dist;
angle_t hang, vang;
// If a flung ring gets attracted by a shield, change it into a normal ring.
if (actor->type == (mobjtype_t)actor->info->reactiontime)
{
P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->painchance);
P_RemoveMobj(actor);
return;
}
// Keep stuff from going down inside floors and junk
actor->flags &= ~MF_NOCLIPHEIGHT;
// Let attracted rings move through walls and such.
actor->flags |= MF_NOCLIP;
// P_Attract is too "smart" for Kart; keep it simple, stupid!
dist = P_AproxDistance(P_AproxDistance(actor->x - actor->tracer->x, actor->y - actor->tracer->y), actor->z - actor->tracer->z);
hang = R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y);
vang = R_PointToAngle2(actor->z , 0, actor->tracer->z, dist);
actor->momx -= actor->momx>>4, actor->momy -= actor->momy>>4, actor->momz -= actor->momz>>4;
actor->momx += FixedMul(FINESINE(vang>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(hang>>ANGLETOFINESHIFT), 4*actor->scale));
actor->momy += FixedMul(FINESINE(vang>>ANGLETOFINESHIFT), FixedMul(FINESINE(hang>>ANGLETOFINESHIFT), 4*actor->scale));
actor->momz += FixedMul(FINECOSINE(vang>>ANGLETOFINESHIFT), 4*actor->scale);
}
else
{
// Turn rings back into flung rings if lost
if (actor->cusval && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime)
{
mobj_t *newring;
newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime);
P_InstaThrust(newring, P_RandomRange(0,7) * ANGLE_45, 2<<FRACBITS);
newring->momz = 8<<FRACBITS;
newring->fuse = 120*TICRATE;
P_RemoveMobj(actor);
return;
}
/*else
P_LookForShield(actor);*/
// SRB2Kart: now it's the PLAYER'S job to use the blockmap to find rings, not the ring's.
}
}
P_LookForShield(actor); // Go find 'em, boy!
if (!actor->tracer
|| !actor->tracer->player
|| !actor->tracer->health
|| !P_CheckSight(actor, actor->tracer)) // You have to be able to SEE it...sorta
{
// Lost attracted rings don't through walls anymore.
actor->flags &= ~MF_NOCLIP;
P_SetTarget(&actor->tracer, NULL);
return;
}
// If a FlingRing gets attracted by a shield, change it into a normal ring.
if (actor->type == (mobjtype_t)actor->info->reactiontime)
{
P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->painchance);
P_RemoveMobj(actor);
return;
}
// Keep stuff from going down inside floors and junk
actor->flags &= ~MF_NOCLIPHEIGHT;
// Let attracted rings move through walls and such.
actor->flags |= MF_NOCLIP;
P_Attract(actor, actor->tracer, false);
}
// Function: A_DropMine
@ -8405,6 +8458,7 @@ void A_SPBChase(mobj_t *actor)
fixed_t easiness = ((actor->tracer->player->kartspeed + (10-spark)) << FRACBITS) / 2;
actor->lastlook = actor->tracer->player-players; // Save the player num for death scumming...
actor->tracer->player->kartstuff[k_ringlock] = 1; // set ring lock
if (!P_IsObjectOnGround(actor->tracer) /*&& !actor->tracer->player->kartstuff[k_pogospring]*/)
{
@ -8488,6 +8542,15 @@ void A_SPBChase(mobj_t *actor)
actor->momy = cy + FixedMul(FixedMul(xyspeed, FINESINE(actor->angle>>ANGLETOFINESHIFT)), FINECOSINE(actor->movedir>>ANGLETOFINESHIFT));
actor->momz = FixedMul(zspeed, FINESINE(actor->movedir>>ANGLETOFINESHIFT));
// Spawn a trail of rings behind the SPB!
if (leveltime % 6 == 0)
{
mobj_t *ring = P_SpawnMobj(actor->x - actor->momx, actor->y - actor->momx,
actor->z - actor->momz + (24*mapobjectscale), MT_RING);
ring->threshold = 10;
ring->fuse = 120*TICRATE;
}
// Red speed lines for when it's gaining on its target. A tell for when you're starting to lose too much speed!
if (R_PointToDist2(0, 0, actor->momx, actor->momy) > (actor->tracer->player ? (16*actor->tracer->player->speed)/15
: (16*R_PointToDist2(0, 0, actor->tracer->momx, actor->tracer->momy))/15) // Going faster than the target
@ -8529,6 +8592,7 @@ void A_SPBChase(mobj_t *actor)
&& !players[actor->lastlook].exiting)
{
spbplace = players[actor->lastlook].kartstuff[k_position];
players[actor->lastlook].kartstuff[k_ringlock] = 1;
if (actor->extravalue2-- <= 0 && players[actor->lastlook].mo)
{
P_SetTarget(&actor->tracer, players[actor->lastlook].mo);

View file

@ -116,7 +116,7 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
{
// Invulnerable
if (player->powers[pw_flashing] > 0
|| player->kartstuff[k_spinouttimer] > 0
|| (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinouttype] != 2)
|| player->kartstuff[k_squishedtimer] > 0
|| player->kartstuff[k_invincibilitytimer] > 0
|| player->kartstuff[k_growshrinktimer] > 0
@ -494,7 +494,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->kartstuff[k_yougotem] = 2*TICRATE;
special->target->player->karthud[khud_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true);
@ -557,7 +557,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->kartstuff[k_yougotem] = 2*TICRATE;
special->target->player->karthud[khud_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, true);
@ -687,15 +687,34 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
/* FALLTHRU */
case MT_RING:
case MT_FLINGRING:
if (special->extravalue1)
return;
// No picking up rings while SPB is targetting you
if (player->kartstuff[k_ringlock])
return;
// Don't immediately pick up spilled rings
if (special->threshold > 0
|| player->kartstuff[k_squishedtimer]
|| player->kartstuff[k_spinouttimer])
return;
if (!(P_CanPickupItem(player, 0)))
return;
special->momx = special->momy = special->momz = 0;
P_GivePlayerRings(player, 1);
// Reached the cap, don't waste 'em!
if ((player->kartstuff[k_rings] + player->kartstuff[k_pickuprings]) >= 20)
return;
if ((maptol & TOL_NIGHTS) && special->type != MT_FLINGRING)
P_DoNightsScore(player);
break;
special->momx = special->momy = special->momz = 0;
special->extravalue1 = 1; // Ring collect animation timer
special->angle = R_PointToAngle2(toucher->x, toucher->y, special->x, special->y); // animation angle
P_SetTarget(&special->target, toucher); // toucher for thinker
player->kartstuff[k_pickuprings]++;
return;
case MT_COIN:
case MT_FLINGCOIN:
@ -2819,16 +2838,8 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou
return true;
}
if (target->health <= 1) // Death
{
P_PlayDeathSound(target);
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);
}
P_PlayRinglossSound(target);
P_PlayerRingBurst(player, 5);
if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
{
@ -2884,14 +2895,9 @@ static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj
static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
{
player->pflags &= ~(PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_ROPEHANG|PF_NIGHTSMODE);
(void)source;
// Burst weapons and emeralds in Match/CTF only
if (source && (G_BattleGametype()))
{
P_PlayerRingBurst(player, player->health - 1);
P_PlayerEmeraldBurst(player, false);
}
player->pflags &= ~(PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_ROPEHANG|PF_NIGHTSMODE);
// Get rid of shield
player->powers[pw_shield] = SH_NONE;
@ -2907,32 +2913,6 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
/*if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{
P_PlayerFlagBurst(player, false);
if (source && source->player)
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 1);
}
}
if (source && source->player && !player->powers[pw_super]) //don't score points against super players
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 1);
}
// If the player was super, tell them he/she ain't so super nomore.
if (gametype != GT_COOP && player->powers[pw_super])
{
S_StartSound(NULL, sfx_s3k66); //let all players hear it.
HU_SetCEchoFlags(0);
HU_SetCEchoDuration(5);
HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players]));
}*/
if (player->pflags & PF_TIMEOVER)
{
mobj_t *boom;
@ -2993,75 +2973,6 @@ void P_RemoveShield(player_t *player)
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) // SRB2kart - unused.
{
// Must do pain first to set flashing -- P_RemoveShield can cause damage
P_DoPlayerPain(player, source, inflictor);
P_RemoveShield(player);
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
S_StartSound(player->mo, sfx_spkdth);
else
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{
P_PlayerFlagBurst(player, false);
if (source && source->player)
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, 25);
}
}
if (source && source->player && !player->powers[pw_super]) //don't score points against super players
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, cv_match_scoring.value == 1 ? 25 : 50);
}
}
*/
static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage)
{
//const UINT8 scoremultiply = ((K_IsWantedPlayer(player) && !trapitem) : 2 ? 1);
if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
{
P_DoPlayerPain(player, source, inflictor);
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
S_StartSound(player->mo, sfx_spkdth);
}
/*if (source && source->player && !player->powers[pw_super]) //don't score points against super players
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, scoremultiply);
}
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{
P_PlayerFlagBurst(player, false);
if (source && source->player)
{
// Award no points when players shoot each other when cv_friendlyfire is on.
if (!G_GametypeHasTeams() || !(source->player->ctfteam == player->ctfteam && source != player->mo))
P_AddPlayerScore(source->player, scoremultiply);
}
}*/
// Ring loss sound plays despite hitting spikes
P_PlayRinglossSound(player->mo); // Ringledingle!
}
/** Damages an object, which may or may not be a player.
* For melee attacks, source and inflictor are the same.
@ -3279,121 +3190,21 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|| inflictor->type == MT_SMK_THWOMP || inflictor->player))
{
player->kartstuff[k_sneakertimer] = 0;
K_SpinPlayer(player, source, 1, inflictor, false);
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
P_PlayerRingBurst(player, 5);
if (P_IsLocalPlayer(player))
K_KartPainEnergyFling(player);
if (P_IsDisplayPlayer(player))
{
quake.intensity = 32*FRACUNIT;
quake.time = 5;
}
}
else
{
K_SpinPlayer(player, source, 0, inflictor, false);
}
return true;
}
/* // SRB2kart - don't need these
else if (metalrecording)
{
if (!inflictor)
inflictor = source;
if (inflictor && inflictor->flags & MF_ENEMY)
{ // Metal Sonic destroy enemy !!
P_KillMobj(inflictor, NULL, target);
return false;
}
else if (inflictor && inflictor->flags & MF_MISSILE)
return false; // Metal Sonic walk through flame !!
else
{ // Oh no! Metal Sonic is hit !!
P_ShieldDamage(player, inflictor, source, damage);
return true;
}
}
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))))
{
if (force || (inflictor && (inflictor->flags & MF_MISSILE)
&& (inflictor->flags2 & MF2_SUPERFIRE)
&& player->powers[pw_super]))
{
#ifdef HAVE_BLUA
if (!LUAh_MobjDamage(target, inflictor, source, damage))
#endif
P_SuperDamage(player, inflictor, source, damage);
return true;
}
else
return false;
}
#ifdef HAVE_BLUA
else if (LUAh_MobjDamage(target, inflictor, source, damage))
return true;
#endif
else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield
{
P_ShieldDamage(player, inflictor, source, damage);
damage = 0;
}
else if (player->mo->health > 1) // No shield but have rings.
{
damage = player->mo->health - 1;
P_RingDamage(player, inflictor, source, damage);
}
else // No shield, no rings, no invincibility.
{
// To reduce griefing potential, don't allow players to be killed
// by friendly fire. Spilling their rings and other items is enough.
if (force || !(G_GametypeHasTeams()
&& source && source->player && (source->player->ctfteam == player->ctfteam)
&& cv_friendlyfire.value))
{
damage = 1;
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
{
player->health -= damage; // mirror mobj health here
if (damage < 10000)
{
target->player->powers[pw_flashing] = K_GetKartFlashing(target->player);
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
P_PlayerRingBurst(player, damage);
}
}
if (player->health < 0)
player->health = 0;
P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2);
}
// Killing dead. Just for kicks.
@ -3468,7 +3279,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
/** Spills an injured player's rings.
*
* \param player The player who is losing rings.
* \param num_rings Number of rings lost. A maximum of 32 rings will be
* \param num_rings Number of rings lost. A maximum of 20 rings will be
* spawned.
* \sa P_PlayerFlagBurst
*/
@ -3479,32 +3290,38 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
angle_t fa;
fixed_t ns;
fixed_t z;
fixed_t momxy = 5<<FRACBITS, momz = 12<<FRACBITS; // base horizonal/vertical thrusts
// Rings shouldn't be in Battle!
if (G_BattleGametype())
return;
// Better safe than sorry.
if (!player)
return;
// Never have health in kart I think
if (player->mo->health <= 1)
num_rings = 5;
// Has a shield? Don't lose your rings!
if (player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD)
return;
if (num_rings > 32 && !(player->pflags & PF_NIGHTSFALL))
num_rings = 32;
// 20 is the ring cap in kart
if (num_rings > 20)
num_rings = 20;
else if (num_rings <= 0)
return;
if (player->powers[pw_emeralds])
P_PlayerEmeraldBurst(player, false);
// Cap the maximum loss automatically to 2 in ring debt
if (player->kartstuff[k_rings] <= 0 && num_rings > 2)
num_rings = 2;
// Spill weapons first
if (player->ringweapons)
P_PlayerWeaponPanelBurst(player);
P_GivePlayerRings(player, -num_rings);
// Spill the ammo
P_PlayerWeaponAmmoBurst(player);
// determine first angle
fa = player->mo->angle + ((P_RandomByte() & 1) ? -ANGLE_90 : ANGLE_90);
// There's no ring spilling in kart, so I'm hijacking this for the same thing as TD
for (i = 0; i < num_rings; i++)
{
INT32 objType = mobjinfo[MT_FLINGENERGY].reactiontime;
INT32 objType = mobjinfo[MT_RING].reactiontime;
z = player->mo->z;
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -3512,379 +3329,34 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, objType);
mo->fuse = 8*TICRATE;
mo->threshold = 10;
mo->fuse = 120*TICRATE;
P_SetTarget(&mo->target, player->mo);
mo->destscale = player->mo->scale;
P_SetScale(mo, player->mo->scale);
// Angle offset by player angle, then slightly offset by amount of rings
fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT) - ((num_rings-1)*FINEANGLES/32)) & FINEMASK;
// Make rings spill out around the player in 16 directions like SA, but spill like Sonic 2.
// Technically a non-SA way of spilling rings. They just so happen to be a little similar.
if (player->pflags & PF_NIGHTSFALL)
// Angle / height offset changes every other ring
if (i != 0)
{
ns = FixedMul(((i*FRACUNIT)/16)+2*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
mo->fuse = 20*TICRATE; // Adjust fuse for NiGHTS
}
else
{
fixed_t momxy, momz; // base horizonal/vertical thrusts
if (i > 15)
{
momxy = 3*FRACUNIT;
momz = 4*FRACUNIT;
}
else
{
momxy = 28*FRACUNIT;
momz = 3*FRACUNIT;
}
ns = FixedMul(momxy, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
mo->momy = FixedMul(FINESINE(fa),ns);
ns = momz;
P_SetObjectMomZ(mo, ns, false);
if (i & 1)
P_SetObjectMomZ(mo, ns, true);
{
momxy -= FRACUNIT;
momz += 2<<FRACBITS;
}
fa += ANGLE_180;
}
ns = FixedMul(momxy, mo->scale);
mo->momx = (mo->target->momx/2) + FixedMul(FINECOSINE(fa>>ANGLETOFINESHIFT), ns);
mo->momy = (mo->target->momy/2) + FixedMul(FINESINE(fa>>ANGLETOFINESHIFT), ns);
ns = FixedMul(momz, mo->scale);
P_SetObjectMomZ(mo, (mo->target->momz/2) + ns, false);
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->momz *= -1;
}
player->losstime += 10*TICRATE;
if (P_IsObjectOnGround(player->mo))
player->pflags &= ~PF_NIGHTSFALL;
return;
}
void P_PlayerWeaponPanelBurst(player_t *player)
{
mobj_t *mo;
angle_t fa;
fixed_t ns;
INT32 i;
fixed_t z;
INT32 num_weapons = M_CountBits((UINT32)player->ringweapons, NUM_WEAPONS-1);
UINT16 ammoamt = 0;
for (i = 0; i < num_weapons; i++)
{
mobjtype_t weptype = 0;
powertype_t power = 0;
if (player->ringweapons & RW_BOUNCE) // Bounce
{
weptype = MT_BOUNCEPICKUP;
player->ringweapons &= ~RW_BOUNCE;
power = pw_bouncering;
}
else if (player->ringweapons & RW_RAIL) // Rail
{
weptype = MT_RAILPICKUP;
player->ringweapons &= ~RW_RAIL;
power = pw_railring;
}
else if (player->ringweapons & RW_AUTO) // Auto
{
weptype = MT_AUTOPICKUP;
player->ringweapons &= ~RW_AUTO;
power = pw_automaticring;
}
else if (player->ringweapons & RW_EXPLODE) // Explode
{
weptype = MT_EXPLODEPICKUP;
player->ringweapons &= ~RW_EXPLODE;
power = pw_explosionring;
}
else if (player->ringweapons & RW_SCATTER) // Scatter
{
weptype = MT_SCATTERPICKUP;
player->ringweapons &= ~RW_SCATTER;
power = pw_scatterring;
}
else if (player->ringweapons & RW_GRENADE) // Grenade
{
weptype = MT_GRENADEPICKUP;
player->ringweapons &= ~RW_GRENADE;
power = pw_grenadering;
}
if (!weptype) // ???
continue;
if (player->powers[power] >= mobjinfo[weptype].reactiontime)
ammoamt = (UINT16)mobjinfo[weptype].reactiontime;
else
ammoamt = player->powers[power];
player->powers[power] -= ammoamt;
z = player->mo->z;
if (player->mo->eflags & MFE_VERTICALFLIP)
z += player->mo->height - mobjinfo[weptype].height;
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, weptype);
mo->reactiontime = ammoamt;
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);
// Angle offset by player angle
fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT)) & FINEMASK;
// Make rings spill out around the player in 16 directions like SA, but spill like Sonic 2.
// Technically a non-SA way of spilling rings. They just so happen to be a little similar.
// >16 ring type spillout
ns = FixedMul(3*FRACUNIT, 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);
}
}
void P_PlayerWeaponAmmoBurst(player_t *player)
{
mobj_t *mo;
angle_t fa;
fixed_t ns;
INT32 i = 0;
fixed_t z;
mobjtype_t weptype = 0;
powertype_t power = 0;
while (true)
{
if (player->powers[pw_bouncering])
{
weptype = MT_BOUNCERING;
power = pw_bouncering;
}
else if (player->powers[pw_railring])
{
weptype = MT_RAILRING;
power = pw_railring;
}
else if (player->powers[pw_infinityring])
{
weptype = MT_INFINITYRING;
power = pw_infinityring;
}
else if (player->powers[pw_automaticring])
{
weptype = MT_AUTOMATICRING;
power = pw_automaticring;
}
else if (player->powers[pw_explosionring])
{
weptype = MT_EXPLOSIONRING;
power = pw_explosionring;
}
else if (player->powers[pw_scatterring])
{
weptype = MT_SCATTERRING;
power = pw_scatterring;
}
else if (player->powers[pw_grenadering])
{
weptype = MT_GRENADERING;
power = pw_grenadering;
}
else
break; // All done!
z = player->mo->z;
if (player->mo->eflags & MFE_VERTICALFLIP)
z += player->mo->height - mobjinfo[weptype].height;
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, weptype);
mo->health = player->powers[power];
mo->flags2 |= MF2_DONTRESPAWN;
mo->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT);
P_SetTarget(&mo->target, player->mo);
player->powers[power] = 0;
mo->fuse = 12*TICRATE;
mo->destscale = player->mo->scale;
P_SetScale(mo, player->mo->scale);
// Angle offset by player angle
fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT)) & FINEMASK;
// Spill them!
ns = FixedMul(2*FRACUNIT, 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);
i++;
}
}
//
// P_PlayerEmeraldBurst
//
// Spills ONLY emeralds.
//
void P_PlayerEmeraldBurst(player_t *player, boolean toss)
{
INT32 i;
angle_t fa;
fixed_t ns;
fixed_t z = 0, momx = 0, momy = 0;
// Better safe than sorry.
if (!player)
return;
// Spill power stones
if (player->powers[pw_emeralds])
{
INT32 num_stones = 0;
if (player->powers[pw_emeralds] & EMERALD1)
num_stones++;
if (player->powers[pw_emeralds] & EMERALD2)
num_stones++;
if (player->powers[pw_emeralds] & EMERALD3)
num_stones++;
if (player->powers[pw_emeralds] & EMERALD4)
num_stones++;
if (player->powers[pw_emeralds] & EMERALD5)
num_stones++;
if (player->powers[pw_emeralds] & EMERALD6)
num_stones++;
if (player->powers[pw_emeralds] & EMERALD7)
num_stones++;
for (i = 0; i < num_stones; i++)
{
INT32 stoneflag = 0;
statenum_t statenum = S_CEMG1;
mobj_t *mo;
if (player->powers[pw_emeralds] & EMERALD1)
{
stoneflag = EMERALD1;
statenum = S_CEMG1;
}
else if (player->powers[pw_emeralds] & EMERALD2)
{
stoneflag = EMERALD2;
statenum = S_CEMG2;
}
else if (player->powers[pw_emeralds] & EMERALD3)
{
stoneflag = EMERALD3;
statenum = S_CEMG3;
}
else if (player->powers[pw_emeralds] & EMERALD4)
{
stoneflag = EMERALD4;
statenum = S_CEMG4;
}
else if (player->powers[pw_emeralds] & EMERALD5)
{
stoneflag = EMERALD5;
statenum = S_CEMG5;
}
else if (player->powers[pw_emeralds] & EMERALD6)
{
stoneflag = EMERALD6;
statenum = S_CEMG6;
}
else if (player->powers[pw_emeralds] & EMERALD7)
{
stoneflag = EMERALD7;
statenum = S_CEMG7;
}
if (!stoneflag) // ???
continue;
player->powers[pw_emeralds] &= ~stoneflag;
if (toss)
{
fa = player->mo->angle>>ANGLETOFINESHIFT;
z = player->mo->z + player->mo->height;
if (player->mo->eflags & MFE_VERTICALFLIP)
z -= mobjinfo[MT_FLINGEMERALD].height + player->mo->height;
ns = FixedMul(8*FRACUNIT, player->mo->scale);
}
else
{
fa = ((255 / num_stones) * i) * FINEANGLES/256;
z = player->mo->z + (player->mo->height / 2);
if (player->mo->eflags & MFE_VERTICALFLIP)
z -= mobjinfo[MT_FLINGEMERALD].height;
ns = FixedMul(4*FRACUNIT, player->mo->scale);
}
momx = FixedMul(FINECOSINE(fa), ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
momy = FixedMul(FINESINE(fa),ns);
else
momy = 0;
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, MT_FLINGEMERALD);
mo->health = 1;
mo->threshold = stoneflag;
mo->flags2 |= (MF2_DONTRESPAWN|MF2_SLIDEPUSH);
mo->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT);
P_SetTarget(&mo->target, player->mo);
mo->fuse = 12*TICRATE;
P_SetMobjState(mo, statenum);
mo->momx = momx;
mo->momy = momy;
P_SetObjectMomZ(mo, 3*FRACUNIT, false);
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->momz = -mo->momz;
if (toss)
player->tossdelay = 2*TICRATE;
}
}
}
/** Makes an injured or dead player lose possession of the flag.

View file

@ -390,9 +390,6 @@ void P_RemoveShield(player_t *player);
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage);
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source);
void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c
void P_PlayerWeaponPanelBurst(player_t *player);
void P_PlayerWeaponAmmoBurst(player_t *player);
void P_PlayerEmeraldBurst(player_t *player, boolean toss);
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
void P_PlayerFlagBurst(player_t *player, boolean toss);

View file

@ -1557,39 +1557,50 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
}
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_KartBouncing(tmthing, thing, true, false);
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, tmthing, false);
}
}
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_KartBouncing(thing, tmthing, true, false);
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, thing, false);
}
}
else
K_KartBouncing(tmthing, thing, false, false);
// The bump has to happen last
mobj_t *mo1 = tmthing;
mobj_t *mo2 = thing;
boolean zbounce = false;
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]) && !(thing->player->powers[pw_flashing])) // Don't steal bumpers while intangible
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, tmthing, false);
zbounce = true;
mo1 = thing;
mo2 = tmthing;
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, tmthing, false);
}
}
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]) && !(tmthing->player->powers[pw_flashing]))
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, thing, false);
zbounce = true;
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, thing, false);
}
}
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]) && !(thing->player->powers[pw_flashing])) // Don't steal bumpers while intangible
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, tmthing, false);
}
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]) && !(tmthing->player->powers[pw_flashing]))
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, thing, false);
}
}
K_KartBouncing(mo1, mo2, zbounce, false);
}
return true;

View file

@ -85,6 +85,37 @@ void P_AddCachedAction(mobj_t *mobj, INT32 statenum)
actioncachehead.prev = newaction;
}
//
// P_SetupStateAnimation
//
FUNCINLINE static ATTRINLINE void P_SetupStateAnimation(mobj_t *mobj, state_t *st)
{
if (!(st->frame & FF_ANIMATE))
return;
if (st->var1 <= 0 || st->var2 == 0)
{
mobj->frame &= ~FF_ANIMATE;
return; // Crash/stupidity prevention
}
mobj->anim_duration = (UINT16)st->var2;
if (st->frame & FF_GLOBALANIM)
{
// Attempt to account for the pre-ticker for objects spawned on load
if (!leveltime) return;
mobj->anim_duration -= (leveltime + 2) % st->var2; // Duration synced to timer
mobj->frame += ((leveltime + 2) / st->var2) % (st->var1 + 1); // Frame synced to timer (duration taken into account)
}
else if (st->frame & FF_RANDOMANIM)
{
mobj->frame += P_RandomKey(st->var1 + 1); // Random starting frame
mobj->anim_duration -= P_RandomKey(st->var2); // Random duration for first frame
}
}
//
// P_CycleStateAnimation
//
@ -93,6 +124,7 @@ FUNCINLINE static ATTRINLINE void P_CycleStateAnimation(mobj_t *mobj)
// var2 determines delay between animation frames
if (!(mobj->frame & FF_ANIMATE) || --mobj->anim_duration != 0)
return;
mobj->anim_duration = (UINT16)mobj->state->var2;
// compare the current sprite frame to the one we started from
@ -212,7 +244,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame;
mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set
P_SetupStateAnimation(mobj, st);
// Modified handling.
// Call action functions when the state is set
@ -280,7 +312,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame;
mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set
P_SetupStateAnimation(mobj, st);
// Modified handling.
// Call action functions when the state is set
@ -334,7 +366,7 @@ boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state)
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame;
mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set
P_SetupStateAnimation(mobj, st);
return true;
}
@ -353,7 +385,7 @@ static boolean P_SetPrecipMobjState(precipmobj_t *mobj, statenum_t state)
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame;
mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set
P_SetupStateAnimation((mobj_t*)mobj, st);
return true;
}
@ -1905,7 +1937,7 @@ void P_XYMovement(mobj_t *mo)
#endif
//{ SRB2kart stuff
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer))
return;
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2)
@ -2456,11 +2488,11 @@ static boolean P_ZMovement(mobj_t *mo)
mom.z = -mom.z;
else
// Flingrings bounce
if (mo->type == MT_FLINGRING
if (/*mo->type == MT_FLINGRING
|| mo->type == MT_FLINGCOIN
|| P_WeaponOrPanel(mo->type)
|| mo->type == MT_FLINGEMERALD
|| mo->type == MT_BIGTUMBLEWEED
||*/ mo->type == MT_BIGTUMBLEWEED
|| mo->type == MT_LITTLETUMBLEWEED
|| mo->type == MT_CANNONBALLDECOR
|| mo->type == MT_FALLINGROCK)
@ -3592,7 +3624,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
dummy.z = thiscam->z;
dummy.height = thiscam->height;
if (player->pflags & PF_TIMEOVER)
player->kartstuff[k_timeovercam] = (2*TICRATE)+1;
player->karthud[khud_timeovercam] = (2*TICRATE)+1;
if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
P_ResetCamera(player, thiscam);
else
@ -6670,7 +6702,7 @@ void P_MobjThinker(mobj_t *mobj)
if ((G_RaceGametype() || mobj->target->player->kartstuff[k_bumper] <= 0)
#if 1 // Set to 0 to test without needing to host
|| ((mobj->target->player == &players[displayplayers[0]]) || P_IsLocalPlayer(mobj->target->player))
|| (P_IsDisplayPlayer(mobj->target->player))
#endif
)
mobj->flags2 |= MF2_DONTDRAW;
@ -7903,8 +7935,8 @@ void P_MobjThinker(mobj_t *mobj)
else
{
fixed_t finalspeed = mobj->movefactor;
P_SpawnGhostMobj(mobj);
mobj_t *ghost = P_SpawnGhostMobj(mobj);
ghost->colorized = true; // already has color!
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy);
if (mobj->health <= 5)
@ -7939,18 +7971,20 @@ void P_MobjThinker(mobj_t *mobj)
fixed_t topspeed = mobj->movefactor;
fixed_t distbarrier = 512*mapobjectscale;
fixed_t distaway;
mobj_t *ghost = P_SpawnGhostMobj(mobj);
P_SpawnGhostMobj(mobj);
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
ghost->color = mobj->target->player->skincolor;
ghost->colorized = true;
}
if (mobj->threshold > 0)
mobj->threshold--;
if (leveltime % TICRATE == 0)
S_StartSound(mobj, mobj->info->activesound);
if (gamespeed == 0)
distbarrier = FixedMul(distbarrier, FRACUNIT-FRACUNIT/4);
else if (gamespeed == 2)
distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4);
distbarrier = FixedMul(distbarrier, FRACUNIT + ((gamespeed-1) * (FRACUNIT/4)));
if (G_RaceGametype() && mobj->tracer)
{
@ -8007,7 +8041,14 @@ void P_MobjThinker(mobj_t *mobj)
}
else
{
P_SpawnGhostMobj(mobj);
mobj_t *ghost = P_SpawnGhostMobj(mobj);
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
ghost->color = mobj->target->player->skincolor;
ghost->colorized = true;
}
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy);
P_InstaThrust(mobj, mobj->angle, mobj->movefactor);
@ -8032,14 +8073,25 @@ void P_MobjThinker(mobj_t *mobj)
case MT_BANANA:
case MT_EGGMANITEM:
mobj->friction = ORIG_FRICTION/4;
if (mobj->momx || mobj->momy)
P_SpawnGhostMobj(mobj);
{
mobj_t *ghost = P_SpawnGhostMobj(mobj);
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
ghost->color = mobj->target->player->skincolor;
ghost->colorized = true;
}
}
if (P_IsObjectOnGround(mobj) && mobj->health > 1)
{
S_StartSound(mobj, mobj->info->activesound);
mobj->momx = mobj->momy = 0;
mobj->health = 1;
}
if (mobj->threshold > 0)
mobj->threshold--;
break;
@ -8047,18 +8099,38 @@ void P_MobjThinker(mobj_t *mobj)
indirectitemcooldown = 20*TICRATE;
/* FALLTHRU */
case MT_BALLHOG:
P_SpawnGhostMobj(mobj)->fuse = 3;
if (mobj->threshold > 0)
mobj->threshold--;
{
mobj_t *ghost = P_SpawnGhostMobj(mobj);
ghost->fuse = 3;
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
ghost->color = mobj->target->player->skincolor;
ghost->colorized = true;
}
if (mobj->threshold > 0)
mobj->threshold--;
}
break;
case MT_SINK:
if (mobj->momx || mobj->momy)
P_SpawnGhostMobj(mobj);
{
mobj_t *ghost = P_SpawnGhostMobj(mobj);
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
{
ghost->color = mobj->target->player->skincolor;
ghost->colorized = true;
}
}
if (P_IsObjectOnGround(mobj))
{
S_StartSound(mobj, mobj->info->deathsound);
P_SetMobjState(mobj, S_NULL);
}
if (mobj->threshold > 0)
mobj->threshold--;
break;
@ -8069,7 +8141,10 @@ void P_MobjThinker(mobj_t *mobj)
mobj->color = SKINCOLOR_KETCHUP;
if (mobj->momx || mobj->momy)
P_SpawnGhostMobj(mobj);
{
mobj_t *ghost = P_SpawnGhostMobj(mobj);
ghost->colorized = true; // already has color!
}
if (P_IsObjectOnGround(mobj) && (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2]))
{
@ -8142,9 +8217,10 @@ void P_MobjThinker(mobj_t *mobj)
if (p)
{
if (p->kartstuff[k_sneakertimer] > mobj->movecount)
if (p->kartstuff[k_sneakertimer] > mobj->movecount
|| p->kartstuff[k_levelbooster] > mobj->movecount)
P_SetMobjState(mobj, S_BOOSTFLAME);
mobj->movecount = p->kartstuff[k_sneakertimer];
mobj->movecount = max(p->kartstuff[k_sneakertimer], p->kartstuff[k_levelbooster]);
}
}
@ -8263,6 +8339,18 @@ void P_MobjThinker(mobj_t *mobj)
K_MatchGenericExtraFlags(mobj, mobj->target);
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z + (mobj->target->height/2) + mobj->movefactor);
break;
case MT_RINGSPARKS:
if (!mobj->target || P_MobjWasRemoved(mobj->target))
{
P_RemoveMobj(mobj);
return;
}
K_MatchGenericExtraFlags(mobj, mobj->target);
P_TeleportMove(mobj, mobj->target->x + FINECOSINE(mobj->angle >> ANGLETOFINESHIFT),
mobj->target->y + FINESINE(mobj->angle >> ANGLETOFINESHIFT),
mobj->target->z + mobj->target->height);
break;
case MT_THUNDERSHIELD:
{
fixed_t destx, desty;
@ -9528,6 +9616,21 @@ void P_SceneryThinker(mobj_t *mobj)
}
}
// Sonic Advance 2 flashing afterimages
if (mobj->type == MT_GHOST && mobj->fuse > 0
&& mobj->extravalue1 > 0 && mobj->extravalue2 >= 2)
{
if (mobj->extravalue2 == 2) // I don't know why the normal logic doesn't work for this.
mobj->flags2 ^= MF2_DONTDRAW;
else
{
if (mobj->fuse == mobj->extravalue2)
mobj->flags2 &= ~MF2_DONTDRAW;
else
mobj->flags2 |= MF2_DONTDRAW;
}
}
// momentum movement
if (mobj->momx || mobj->momy)
{
@ -9635,7 +9738,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits..
mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set
P_SetupStateAnimation(mobj, st);
mobj->friction = ORIG_FRICTION;
@ -9879,7 +9982,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
break;
}
mobj->color = SKINCOLOR_AQUA;
mobj->color = SKINCOLOR_CYAN;
break;
}
case MT_MARBLETORCH:
@ -10086,6 +10189,7 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster)
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits..
P_SetupStateAnimation(mobj, st);
mobj->friction = ORIG_FRICTION;
@ -10178,7 +10282,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
mobj->tics = st->tics;
mobj->sprite = st->sprite;
mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits..
mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set
P_SetupStateAnimation((mobj_t*)mobj, st);
// set subsector and/or block links
P_SetPrecipitationThingPosition(mobj);
@ -10608,6 +10712,8 @@ void P_PrecipitationEffects(void)
//
void P_RespawnSpecials(void)
{
UINT8 p, pcount = 0;
tic_t time = 30*TICRATE; // Respawn things in empty dedicated servers
fixed_t x, y, z;
subsector_t *ss;
mobj_t *mo = NULL;
@ -10654,21 +10760,28 @@ void P_RespawnSpecials(void)
numgotboxes = 0;
}
// only respawn items when cv_itemrespawn is on
if (!cv_itemrespawn.value)
return;
// wait time depends on player count
for (p = 0; p < MAXPLAYERS; p++)
{
if (playeringame[p] && !players[p].spectator)
pcount++;
}
// Don't respawn in special stages!
if (G_IsSpecialStage(gamemap))
if (pcount == 1) // No respawn when alone
return;
else if (pcount > 1)
time = (180 - (pcount * 10))*TICRATE;
// only respawn items when cv_itemrespawn is on
//if (!cv_itemrespawn.value) // TODO: remove this cvar
//return;
// nothing left to respawn?
if (iquehead == iquetail)
return;
// the first item in the queue is the first to respawn
// wait at least 30 seconds
if (leveltime - itemrespawntime[iquetail] < (tic_t)cv_itemrespawntime.value*TICRATE)
if (leveltime - itemrespawntime[iquetail] < time)
return;
mthing = itemrespawnque[iquetail];
@ -11508,20 +11621,16 @@ void P_SpawnMapThing(mapthing_t *mthing)
mobjtype_t macetype = MT_SMALLMACE;
boolean firsttime;
mobj_t *spawnee;
size_t line;
INT32 line;
const size_t mthingi = (size_t)(mthing - mapthings);
// Why does P_FindSpecialLineFromTag not work here?!?
// Monster Iestyn: tag lists haven't been initialised yet for the map, that's why
for (line = 0; line < numlines; line++)
{
if (lines[line].special == 9 && lines[line].tag == mthing->angle)
break;
}
// Find the corresponding linedef special, using angle as tag
// P_FindSpecialLineFromTag works here now =D
line = P_FindSpecialLineFromTag(9, mthing->angle, -1);
if (line == numlines)
if (line == -1)
{
CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle);
CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs to be tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle);
return;
}
/*
@ -11957,7 +12066,7 @@ ML_NOCLIMB : Direction not controllable
void P_SpawnHoopsAndRings(mapthing_t *mthing)
{
mobj_t *mobj = NULL;
INT32 /*r,*/ i;
INT32 r, i;
fixed_t x, y, z, finalx, finaly, finalz;
sector_t *sec;
TVector v, *res;
@ -12244,8 +12353,6 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
return;
}
else return; // srb2kart - no rings or ring-like objects in R1
/*
// Wing logo item.
else if (mthing->type == mobjinfo[MT_NIGHTSWING].doomednum)
{
@ -12539,7 +12646,8 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
}
}
return;
}*/
}
else return;
}
//

View file

@ -35,14 +35,9 @@
#pragma interface
#endif
/// \brief Frame flags: only the frame number
#define FF_FRAMEMASK 0x1ff
/// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION)
#define FF_PAPERSPRITE 0x800
/// \brief Frame flags: Simple stateless animation
#define FF_ANIMATE 0x4000
/// \brief Frame flags: frame always appears full bright
#define FF_FULLBRIGHT 0x8000
/// \brief Frame flags: only the frame number (frames from 0 to 63, but a bit of headroom for 2.2 compat)
#define FF_FRAMEMASK 0xff
/// \brief Frame flags: 0 = no trans(opaque), 1-15 = transl. table
#define FF_TRANSMASK 0xf0000
/// \brief shift for FF_TRANSMASK
@ -58,6 +53,23 @@
#define FF_TRANS80 (tr_trans80<<FF_TRANSSHIFT)
#define FF_TRANS90 (tr_trans90<<FF_TRANSSHIFT)
/// \brief Frame flags: frame always appears full bright (mutually exclusive with below, currently takes priority)
#define FF_FULLBRIGHT 0x00100000
/// \brief Frame flags: frame appears with moderate brightness (mutually exclusive with above)
#define FF_SEMIBRIGHT 0x00200000
/// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION)
#define FF_PAPERSPRITE 0x00400000
/// \brief Frame flags: Flip sprite vertically (relative to what it should be for its gravity)
#define FF_VERTICALFLIP 0x00800000
/// \brief Frame flags - Animate: Simple stateless animation
#define FF_ANIMATE 0x01000000
/// \brief Frame flags - Animate: Sync animation to global timer (mutually exclusive with below, currently takes priority)
#define FF_GLOBALANIM 0x02000000
/// \brief Frame flags - Animate: Start at a random place in the animation (mutually exclusive with above)
#define FF_RANDOMANIM 0x04000000
/** \brief translucency tables
\todo add another asm routine which use the fg and bg indexes in the

View file

@ -2816,8 +2816,7 @@ boolean P_SetupLevel(boolean skipprecip)
for (i = 0; i <= splitscreen; i++)
postimgtype[i] = postimg_none;
if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0'
&& atoi(mapheaderinfo[gamemap-1]->forcecharacter) != 255)
if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0')
P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter);
// chasecam on in chaos, race, coop
@ -2859,13 +2858,13 @@ boolean P_SetupLevel(boolean skipprecip)
S_StartSound(NULL, sfx_ruby1);
F_WipeStartScreen();
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 122);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 209);
F_WipeEndScreen();
F_RunWipe(wipedefs[wipe_speclevel_towhite], false);
F_WipeStartScreen();
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
F_WipeEndScreen();
F_RunWipe(wipedefs[wipe_level_final], false);
@ -2898,7 +2897,7 @@ boolean P_SetupLevel(boolean skipprecip)
// We should be fine starting it here.
S_Start();
levelfadecol = (encoremode && !ranspecialwipe ? 122 : 120);
levelfadecol = (encoremode && !ranspecialwipe ? 209 : 0);
// Let's fade to white here
// But only if we didn't do the encore startup wipe
@ -3066,6 +3065,10 @@ boolean P_SetupLevel(boolean skipprecip)
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
}
// init gravity, tag lists,
// anything that P_ResetDynamicSlopes/P_LoadThings needs to know
P_InitSpecials();
#ifdef ESLOPE
P_ResetDynamicSlopes();
#endif
@ -3084,8 +3087,6 @@ boolean P_SetupLevel(boolean skipprecip)
if (loadprecip) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame)
P_SpawnPrecipitation();
globalweather = mapheaderinfo[gamemap-1]->weather;
#ifdef HWRENDER // not win32 only 19990829 by Kin
if (rendermode != render_soft && rendermode != render_none)
{

View file

@ -4247,19 +4247,19 @@ DoneSection2:
if (nump > 1)
{
if (K_IsPlayerLosing(player))
player->kartstuff[k_laphand] = 3;
player->karthud[khud_laphand] = 3;
else
{
if (nump > 2 && player->kartstuff[k_position] == 1) // 1st place in 1v1 uses thumbs up
player->kartstuff[k_laphand] = 1;
player->karthud[khud_laphand] = 1;
else
player->kartstuff[k_laphand] = 2;
player->karthud[khud_laphand] = 2;
}
}
else
player->kartstuff[k_laphand] = 0; // No hands in FREE PLAY
player->karthud[khud_laphand] = 0; // No hands in FREE PLAY
player->kartstuff[k_lapanimation] = 80;
player->karthud[khud_lapanimation] = 80;
if (player->pflags & PF_NIGHTSMODE)
player->drillmeter += 48*20;
@ -4295,7 +4295,7 @@ DoneSection2:
player->starpostangle = player->starpostx = player->starposty = player->starpostz = player->kartstuff[k_starpostflip] = 0;
}
if (P_IsLocalPlayer(player))
if (P_IsDisplayPlayer(player))
{
if (player->laps == (UINT8)(cv_numlaps.value - 1))
S_StartSound(NULL, sfx_s3k68);
@ -4325,7 +4325,7 @@ DoneSection2:
if (player->laps >= (unsigned)cv_numlaps.value)
{
if (P_IsLocalPlayer(player))
if (P_IsDisplayPlayer(player))
S_StartSound(NULL, sfx_s3k6a);
else if (player->kartstuff[k_position] == 1)
S_StartSound(NULL, sfx_s253);
@ -5659,6 +5659,45 @@ static void P_RunLevelLoadExecutors(void)
}
}
/** Before things are loaded, initialises certain stuff in case they're needed
* by P_ResetDynamicSlopes or P_LoadThings. This was split off from
* P_SpawnSpecials, in case you couldn't tell.
*
* \sa P_SpawnSpecials, P_InitTagLists
* \author Monster Iestyn
*/
void P_InitSpecials(void)
{
// Set the default gravity. Custom gravity overrides this setting.
gravity = (FRACUNIT*8)/10;
// Defaults in case levels don't have them set.
sstimer = 90*TICRATE + 6;
totalrings = 1;
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
// Set curWeather
switch (mapheaderinfo[gamemap-1]->weather)
{
case PRECIP_SNOW: // snow
case PRECIP_RAIN: // rain
case PRECIP_STORM: // storm
case PRECIP_STORM_NORAIN: // storm w/o rain
case PRECIP_STORM_NOSTRIKES: // storm w/o lightning
curWeather = mapheaderinfo[gamemap-1]->weather;
break;
default: // blank/none
curWeather = PRECIP_NONE;
break;
}
// Set globalweather
globalweather = mapheaderinfo[gamemap-1]->weather;
P_InitTagLists(); // Create xref tables for tags
}
/** After the map has loaded, scans for specials that spawn 3Dfloors and
* thinkers.
*
@ -5680,15 +5719,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
// but currently isn't.
(void)fromnetsave;
// Set the default gravity. Custom gravity overrides this setting.
gravity = (FRACUNIT*8)/10;
// Defaults in case levels don't have them set.
sstimer = 90*TICRATE + 6;
totalrings = 1;
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
// Init special SECTORs.
sector = sectors;
for (i = 0; i < numsectors; i++, sector++)
@ -5737,20 +5767,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
}
}
if (mapheaderinfo[gamemap-1]->weather == 2) // snow
curWeather = PRECIP_SNOW;
else if (mapheaderinfo[gamemap-1]->weather == 3) // rain
curWeather = PRECIP_RAIN;
else if (mapheaderinfo[gamemap-1]->weather == 1) // storm
curWeather = PRECIP_STORM;
else if (mapheaderinfo[gamemap-1]->weather == 5) // storm w/o rain
curWeather = PRECIP_STORM_NORAIN;
else if (mapheaderinfo[gamemap-1]->weather == 6) // storm w/o lightning
curWeather = PRECIP_STORM_NOSTRIKES;
else
curWeather = PRECIP_NONE;
P_InitTagLists(); // Create xref tables for tags
P_SearchForDisableLinedefs(); // Disable linedefs are now allowed to disable *any* line
P_SpawnScrollers(); // Add generalized scrollers
@ -7340,9 +7356,7 @@ void T_Friction(friction_t *f)
// apparently, all I had to do was comment out part of the next line and
// friction works for all mobj's
// (or at least MF_PUSHABLEs, which is all I care about anyway)
if ((!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) && thing->z == thing->floorz) && (thing->player
&& (thing->player->kartstuff[k_invincibilitytimer] == 0 && thing->player->kartstuff[k_hyudorotimer] == 0
&& thing->player->kartstuff[k_sneakertimer] == 0 && thing->player->kartstuff[k_growshrinktimer] <= 0)))
if (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) && thing->z == thing->floorz)
{
if (f->roverfriction)
{

View file

@ -32,6 +32,7 @@ void P_InitPicAnims(void);
void P_SetupLevelFlatAnims(void);
// at map load
void P_InitSpecials(void);
void P_SpawnSpecials(INT32 fromnetsave);
// every tic

View file

@ -946,50 +946,19 @@ void P_ResetPlayer(player_t *player)
//
void P_GivePlayerRings(player_t *player, INT32 num_rings)
{
if (player->bot)
player = &players[consoleplayer];
if (!player->mo)
return;
player->mo->health += num_rings;
player->health += num_rings;
if (G_BattleGametype()) // No rings in Battle Mode
return;
if (!G_IsSpecialStage(gamemap) || !useNightsSS)
player->totalring += num_rings;
player->kartstuff[k_rings] += num_rings;
//player->totalring += num_rings; // Used for GP lives later
//{ SRB2kart - rings don't really do anything, but we don't want the player spilling them later.
/*
// Can only get up to 9999 rings, sorry!
if (player->mo->health > 10000)
{
player->mo->health = 10000;
player->health = 10000;
}
else if (player->mo->health < 1)*/
{
player->mo->health = 1;
player->health = 1;
}
//}
// Now extra life bonuses are handled here instead of in P_MovePlayer, since why not?
if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives())
{
INT32 gainlives = 0;
while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1))
{
++gainlives;
++player->xtralife;
}
if (gainlives)
{
P_GivePlayerLives(player, gainlives);
P_PlayLivesJingle(player);
}
}
if (player->kartstuff[k_rings] > 20)
player->kartstuff[k_rings] = 20; // Caps at 20 rings, sorry!
else if (player->kartstuff[k_rings] < -20)
player->kartstuff[k_rings] = -20; // Chaotix ring debt!
}
//
@ -1114,11 +1083,12 @@ void P_PlayLivesJingle(player_t *player)
void P_PlayRinglossSound(mobj_t *source)
{
sfxenum_t key = P_RandomKey(2);
if (cv_kartvoices.value)
S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_khurt1 + key);
if (source->player && source->player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD)
S_StartSound(source, sfx_s1a3); // Shield hit (no ring loss)
else if (source->player && source->player->kartstuff[k_rings] <= 0)
S_StartSound(source, sfx_s1a6); // Ring debt (lessened ring loss)
else
S_StartSound(source, sfx_slip);
S_StartSound(source, sfx_s1c6); // Normal ring loss sound
}
void P_PlayDeathSound(mobj_t *source)
@ -1704,7 +1674,7 @@ void P_DoPlayerExit(player_t *player)
if (cv_kartvoices.value)
{
if (P_IsLocalPlayer(player))
if (P_IsDisplayPlayer(player))
{
sfxenum_t sfx_id;
if (K_IsPlayerLosing(player))
@ -1751,7 +1721,7 @@ void P_DoPlayerExit(player_t *player)
*/
player->powers[pw_underwater] = 0;
player->powers[pw_spacetime] = 0;
player->kartstuff[k_cardanimation] = 0; // srb2kart: reset battle animation
player->karthud[khud_cardanimation] = 0; // srb2kart: reset battle animation
if (player == &players[consoleplayer])
demo.savebutton = leveltime;
@ -4039,7 +4009,7 @@ static void P_3dMovement(player_t *player)
if ((player->exiting || mapreset) || player->pflags & PF_STASIS || player->kartstuff[k_spinouttimer]) // pw_introcam?
{
cmd->forwardmove = cmd->sidemove = 0;
if (player->kartstuff[k_sneakertimer])
if (EITHERSNEAKER(player))
cmd->forwardmove = 50;
}
@ -4129,13 +4099,6 @@ static void P_3dMovement(player_t *player)
//movepushforward = cmd->forwardmove * (thrustfactor * acceleration);
movepushforward = K_3dKartMovement(player, onground, cmd->forwardmove);
// allow very small movement while in air for gameplay
if (!onground)
movepushforward >>= 2; // proper air movement
// don't need to account for scale here with kart accel code
//movepushforward = FixedMul(movepushforward, player->mo->scale);
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
@ -4199,6 +4162,18 @@ static void P_3dMovement(player_t *player)
player->mo->momx += totalthrust.x;
player->mo->momy += totalthrust.y;
if (!onground)
{
fixed_t airspeedcap = (50*mapobjectscale);
fixed_t speed = R_PointToDist2(0, 0, player->mo->momx, player->mo->momy);
if (speed > airspeedcap)
{
fixed_t newspeed = speed - ((speed - airspeedcap) / 32);
player->mo->momx = FixedMul(FixedDiv(player->mo->momx, speed), newspeed);
player->mo->momy = FixedMul(FixedDiv(player->mo->momy, speed), newspeed);
}
}
#endif
// Time to ask three questions:
@ -4215,7 +4190,7 @@ static void P_3dMovement(player_t *player)
if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed)
{
fixed_t tempmomx, tempmomy;
if (oldMagnitude > K_GetKartSpeed(player, true) && onground) // SRB2Kart: onground check for air speed cap
if (oldMagnitude > K_GetKartSpeed(player, true))
{
if (newMagnitude > oldMagnitude)
{
@ -5778,11 +5753,10 @@ static void P_MovePlayer(player_t *player)
boolean add_delta = true;
// Kart: store the current turn range for later use
if (((player->mo && player->speed > 0) // Moving
if ((player->mo && player->speed > 0) // Moving
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|| (player->kartstuff[k_respawn]) // Respawning
|| (player->spectator || objectplacing)) // Not a physical player
) // ~~Spinning and boosting cancels out turning~~ Not anymore given spinout is more slippery and more prone to get you killed because of boosters.
{
player->lturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, KART_FULLTURN)+1;
player->rturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, -KART_FULLTURN)-1;
@ -6172,7 +6146,7 @@ static void P_MovePlayer(player_t *player)
////////////////////////////
// SRB2kart - Drifting smoke and fire
if (player->kartstuff[k_sneakertimer] > 0 && onground && (leveltime & 1))
if (EITHERSNEAKER(player) && onground && (leveltime & 1))
K_SpawnBoostTrail(player);
if (player->kartstuff[k_invincibilitytimer] > 0)
@ -7064,7 +7038,7 @@ static void P_DeathThink(player_t *player)
if (player->pflags & PF_TIMEOVER)
{
player->kartstuff[k_timeovercam]++;
player->karthud[khud_timeovercam]++;
if (player->mo)
{
player->mo->flags |= (MF_NOGRAVITY|MF_NOCLIP);
@ -7072,7 +7046,7 @@ static void P_DeathThink(player_t *player)
}
}
else
player->kartstuff[k_timeovercam] = 0;
player->karthud[khud_timeovercam] = 0;
K_KartPlayerHUDUpdate(player);
@ -7280,7 +7254,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
#endif
if (player->pflags & PF_TIMEOVER) // 1 for momentum keep, 2 for turnaround
timeover = (player->kartstuff[k_timeovercam] > 2*TICRATE ? 2 : 1);
timeover = (player->karthud[khud_timeovercam] > 2*TICRATE ? 2 : 1);
else
timeover = 0;
@ -7423,7 +7397,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (timeover)
{
const INT32 timeovercam = max(0, min(180, (player->kartstuff[k_timeovercam] - 2*TICRATE)*15));
const INT32 timeovercam = max(0, min(180, (player->karthud[khud_timeovercam] - 2*TICRATE)*15));
camrotate += timeovercam;
}
else if (leveltime < introtime) // Whoooshy camera!
@ -7497,10 +7471,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
dist += 4*(player->speed - K_GetKartSpeed(player, false));
dist += abs(thiscam->momz)/4;
if (player->kartstuff[k_boostcam])
if (player->karthud[khud_boostcam])
{
dist -= FixedMul(11*dist/16, player->kartstuff[k_boostcam]);
height -= FixedMul(height, player->kartstuff[k_boostcam]);
dist -= FixedMul(11*dist/16, player->karthud[khud_boostcam]);
height -= FixedMul(height, player->karthud[khud_boostcam]);
}
x = mo->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
@ -8437,8 +8411,7 @@ void P_PlayerThink(player_t *player)
#if 1
// "Blur" a bit when you have speed shoes and are going fast enough
if ((player->powers[pw_super] || player->powers[pw_sneakers]
|| player->kartstuff[k_driftboost] || player->kartstuff[k_sneakertimer] || player->kartstuff[k_startboost]) && !player->kartstuff[k_invincibilitytimer] // SRB2kart
if ((player->powers[pw_super] || player->powers[pw_sneakers])
&& (player->speed + abs(player->mo->momz)) > FixedMul(20*FRACUNIT,player->mo->scale))
{
UINT8 i;

View file

@ -139,75 +139,12 @@ UINT32 nflatxshift, nflatyshift, nflatshiftup, nflatmask;
#define BLINK_TT_CACHE_INDEX (MAXSKINS + 5)
#define TT_CACHE_SIZE (MAXSKINS + 6)
#define SKIN_RAMP_LENGTH 16
#define DEFAULT_STARTTRANSCOLOR 160
#define DEFAULT_STARTTRANSCOLOR 96
#define NUM_PALETTE_ENTRIES 256
static UINT8** translationtablecache[TT_CACHE_SIZE] = {NULL};
// See also the enum skincolors_t
// TODO Callum: Can this be translated?
/*
const char *Color_Names[MAXSKINCOLORS] =
{
"None", // SKINCOLOR_NONE
"White", // SKINCOLOR_WHITE
"Silver", // SKINCOLOR_SILVER
"Grey", // SKINCOLOR_GREY
"Black", // SKINCOLOR_BLACK
"Cyan", // SKINCOLOR_CYAN
"Teal", // SKINCOLOR_TEAL
"Steel_Blue",// SKINCOLOR_STEEL
"Blue", // SKINCOLOR_BLUE
"Peach", // SKINCOLOR_PEACH
"Tan", // SKINCOLOR_TAN
"Pink", // SKINCOLOR_PINK
"Lavender", // SKINCOLOR_LAVENDER
"Purple", // SKINCOLOR_PURPLE
"Orange", // SKINCOLOR_ORANGE
"Rosewood", // SKINCOLOR_ROSEWOOD
"Beige", // SKINCOLOR_BEIGE
"Brown", // SKINCOLOR_BROWN
"Red", // SKINCOLOR_RED
"Dark_Red", // SKINCOLOR_DARKRED
"Neon_Green",// SKINCOLOR_NEONGREEN
"Green", // SKINCOLOR_GREEN
"Zim", // SKINCOLOR_ZIM
"Olive", // SKINCOLOR_OLIVE
"Yellow", // SKINCOLOR_YELLOW
"Gold" // SKINCOLOR_GOLD
};
const UINT8 Color_Opposite[MAXSKINCOLORS*2] =
{
SKINCOLOR_NONE,8, // SKINCOLOR_NONE
SKINCOLOR_BLACK,10, // SKINCOLOR_WHITE
SKINCOLOR_GREY,4, // SKINCOLOR_SILVER
SKINCOLOR_SILVER,12,// SKINCOLOR_GREY
SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK
SKINCOLOR_NONE,8, // SKINCOLOR_CYAN
SKINCOLOR_NONE,8, // SKINCOLOR_TEAL
SKINCOLOR_NONE,8, // SKINCOLOR_STEEL
SKINCOLOR_ORANGE,9, // SKINCOLOR_BLUE
SKINCOLOR_NONE,8, // SKINCOLOR_PEACH
SKINCOLOR_NONE,8, // SKINCOLOR_TAN
SKINCOLOR_NONE,8, // SKINCOLOR_PINK
SKINCOLOR_NONE,8, // SKINCOLOR_LAVENDER
SKINCOLOR_NONE,8, // SKINCOLOR_PURPLE
SKINCOLOR_BLUE,12, // SKINCOLOR_ORANGE
SKINCOLOR_NONE,8, // SKINCOLOR_ROSEWOOD
SKINCOLOR_NONE,8, // SKINCOLOR_BEIGE
SKINCOLOR_NONE,8, // SKINCOLOR_BROWN
SKINCOLOR_GREEN,5, // SKINCOLOR_RED
SKINCOLOR_NONE,8, // SKINCOLOR_DARKRED
SKINCOLOR_NONE,8, // SKINCOLOR_NEONGREEN
SKINCOLOR_RED,11, // SKINCOLOR_GREEN
SKINCOLOR_PURPLE,3, // SKINCOLOR_ZIM
SKINCOLOR_NONE,8, // SKINCOLOR_OLIVE
SKINCOLOR_NONE,8, // SKINCOLOR_YELLOW
SKINCOLOR_NONE,8 // SKINCOLOR_GOLD
};
*/
// SKINCOLOR DEFINITIONS HAVE BEEN MOVED TO K_KART.C
CV_PossibleValue_t Color_cons_t[MAXSKINCOLORS+1];
@ -239,280 +176,6 @@ void R_InitTranslationTables(void)
#endif
}
/** \brief Generates a translation colormap.
\param dest_colormap colormap to populate
\param skinnum number of skin, TC_DEFAULT or TC_BOSS
\param color translation color
\return void
*/
/*
static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
{
// Table of indices into the palette of the first entries of each translated ramp
const UINT8 skinbasecolors[] = {
0x00, // SKINCOLOR_WHITE
0x03, // SKINCOLOR_SILVER
0x08, // SKINCOLOR_GREY
0x18, // SKINCOLOR_BLACK
0xd0, // SKINCOLOR_CYAN
0xdc, // SKINCOLOR_TEAL
0xc8, // SKINCOLOR_STEEL
0xe2, // SKINCOLOR_BLUE
0x40, // SKINCOLOR_PEACH
0x48, // SKINCOLOR_TAN
0x90, // SKINCOLOR_PINK
0xf8, // SKINCOLOR_LAVENDER
0xc0, // SKINCOLOR_PURPLE
0x52, // SKINCOLOR_ORANGE
0x5c, // SKINCOLOR_ROSEWOOD
0x20, // SKINCOLOR_BEIGE
0x30, // SKINCOLOR_BROWN
0x7d, // SKINCOLOR_RED
0x85, // SKINCOLOR_DARKRED
0xb8, // SKINCOLOR_NEONGREEN
0xa0, // SKINCOLOR_GREEN
0xb0, // SKINCOLOR_ZIM
0x69, // SKINCOLOR_OLIVE
0x67, // SKINCOLOR_YELLOW
0x70, // SKINCOLOR_GOLD
};
INT32 i;
INT32 starttranscolor;
// Handle a couple of simple special cases
if (skinnum == TC_BOSS || skinnum == TC_ALLWHITE || skinnum == TC_METALSONIC || color == SKINCOLOR_NONE)
{
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
{
if (skinnum == TC_ALLWHITE) dest_colormap[i] = 0;
else dest_colormap[i] = (UINT8)i;
}
// White!
if (skinnum == TC_BOSS)
dest_colormap[31] = 0;
else if (skinnum == TC_METALSONIC)
dest_colormap[239] = 0;
return;
}
starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
// Fill in the entries of the palette that are fixed
for (i = 0; i < starttranscolor; i++)
dest_colormap[i] = (UINT8)i;
for (i = (UINT8)(starttranscolor + 16); i < NUM_PALETTE_ENTRIES; i++)
dest_colormap[i] = (UINT8)i;
// Build the translated ramp
switch (color)
{
case SKINCOLOR_SILVER:
case SKINCOLOR_GREY:
case SKINCOLOR_PEACH:
case SKINCOLOR_BEIGE:
case SKINCOLOR_BROWN:
case SKINCOLOR_RED:
case SKINCOLOR_GREEN:
case SKINCOLOR_BLUE:
// 16 color ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i);
break;
case SKINCOLOR_ORANGE:
// 14 colors of orange + brown
for (i = 0; i < SKIN_RAMP_LENGTH-2; i++)
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i);
for (i = 0; i < 2; i++)
dest_colormap[starttranscolor + (i+SKIN_RAMP_LENGTH-2)] = (UINT8)(152 + i);
break;
case SKINCOLOR_CYAN:
// 12 color ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (12*i/SKIN_RAMP_LENGTH));
break;
case SKINCOLOR_WHITE:
case SKINCOLOR_BLACK:
case SKINCOLOR_STEEL:
case SKINCOLOR_PINK:
case SKINCOLOR_LAVENDER:
case SKINCOLOR_PURPLE:
case SKINCOLOR_DARKRED:
case SKINCOLOR_ZIM:
case SKINCOLOR_YELLOW:
case SKINCOLOR_GOLD:
// 8 color ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (i >> 1));
break;
case SKINCOLOR_TEAL:
// 5 color ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
{
if (5*i/16 == 0)
dest_colormap[starttranscolor + i] = 0xf7;
else
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (5*i/SKIN_RAMP_LENGTH) - 1);
}
break;
case SKINCOLOR_OLIVE:
// 7 color ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (7*i/SKIN_RAMP_LENGTH));
break;
case SKINCOLOR_TAN:
// 16 color ramp, from two color ranges
for (i = 0; i < SKIN_RAMP_LENGTH/2; i++) // Peach half
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + i);
for (i = 0; i < SKIN_RAMP_LENGTH/2; i++) // Brown half
dest_colormap[starttranscolor + (i+8)] = (UINT8)(48 + i);
break;
case SKINCOLOR_ROSEWOOD:
// 12 color ramp, from two color ranges!
for (i = 0; i < 6; i++) // Orange ...third?
dest_colormap[starttranscolor + i] = (UINT8)(skinbasecolors[color - 1] + (12*i/SKIN_RAMP_LENGTH));
for (i = 0; i < 10; i++) // Rosewood two-thirds-ish
dest_colormap[starttranscolor + (i+6)] = (UINT8)(152 + (12*i/SKIN_RAMP_LENGTH));
break;
case SKINCOLOR_NEONGREEN:
// Multi-color ramp
dest_colormap[starttranscolor] = 0xA0; // Brighter green
for (i = 0; i < SKIN_RAMP_LENGTH-1; i++) // Neon Green
dest_colormap[starttranscolor + (i+1)] = (UINT8)(skinbasecolors[color - 1] + (6*i/(SKIN_RAMP_LENGTH-1)));
break;
// Super colors, from lightest to darkest!
case SKINCOLOR_SUPER1:
// Super White
for (i = 0; i < 10; i++)
dest_colormap[starttranscolor + i] = 120; // True white
for (; i < SKIN_RAMP_LENGTH; i++) // White-yellow fade
dest_colormap[starttranscolor + i] = (UINT8)(96 + (i-10));
break;
case SKINCOLOR_SUPER2:
// Super Bright
for (i = 0; i < 5; i++) // White-yellow fade
dest_colormap[starttranscolor + i] = (UINT8)(96 + i);
dest_colormap[starttranscolor + 5] = 112; // Golden shine
for (i = 0; i < 8; i++) // Yellow
dest_colormap[starttranscolor + (i+6)] = (UINT8)(101 + (i>>1));
for (i = 0; i < 2; i++) // With a fine golden finish! :3
dest_colormap[starttranscolor + (i+14)] = (UINT8)(113 + i);
break;
case SKINCOLOR_SUPER3:
// Super Yellow
for (i = 0; i < 3; i++) // White-yellow fade
dest_colormap[starttranscolor + i] = (UINT8)(98 + i);
dest_colormap[starttranscolor + 3] = 112; // Golden shine
for (i = 0; i < 8; i++) // Yellow
dest_colormap[starttranscolor + (i+4)] = (UINT8)(101 + (i>>1));
for (i = 0; i < 4; i++) // With a fine golden finish! :3
dest_colormap[starttranscolor + (i+12)] = (UINT8)(113 + i);
break;
case SKINCOLOR_SUPER4:
// "The SSNTails"
dest_colormap[starttranscolor] = 112; // Golden shine
for (i = 0; i < 8; i++) // Yellow
dest_colormap[starttranscolor + (i+1)] = (UINT8)(101 + (i>>1));
for (i = 0; i < 7; i++) // With a fine golden finish! :3
dest_colormap[starttranscolor + (i+9)] = (UINT8)(113 + i);
break;
case SKINCOLOR_SUPER5:
// Golden Delicious
for (i = 0; i < 8; i++) // Yellow
dest_colormap[starttranscolor + i] = (UINT8)(101 + (i>>1));
for (i = 0; i < 7; i++) // With a fine golden finish! :3
dest_colormap[starttranscolor + (i+8)] = (UINT8)(113 + i);
dest_colormap[starttranscolor + 15] = 155;
break;
// Super Tails
case SKINCOLOR_TSUPER1:
for (i = 0; i < 10; i++) // white
dest_colormap[starttranscolor + i] = 120;
for (; i < SKIN_RAMP_LENGTH; i++) // orange
dest_colormap[starttranscolor + i] = (UINT8)(80 + (i-10));
break;
case SKINCOLOR_TSUPER2:
for (i = 0; i < 4; i++) // white
dest_colormap[starttranscolor + i] = 120;
for (; i < SKIN_RAMP_LENGTH; i++) // orange
dest_colormap[starttranscolor + i] = (UINT8)(80 + ((i-4)>>1));
break;
case SKINCOLOR_TSUPER3:
dest_colormap[starttranscolor] = 120; // pure white
dest_colormap[starttranscolor+1] = 120;
for (i = 2; i < SKIN_RAMP_LENGTH; i++) // orange
dest_colormap[starttranscolor + i] = (UINT8)(80 + ((i-2)>>1));
break;
case SKINCOLOR_TSUPER4:
dest_colormap[starttranscolor] = 120; // pure white
for (i = 1; i < 9; i++) // orange
dest_colormap[starttranscolor + i] = (UINT8)(80 + (i-1));
for (; i < SKIN_RAMP_LENGTH; i++) // gold
dest_colormap[starttranscolor + i] = (UINT8)(115 + (5*(i-9)/7));
break;
case SKINCOLOR_TSUPER5:
for (i = 0; i < 8; i++) // orange
dest_colormap[starttranscolor + i] = (UINT8)(80 + i);
for (; i < SKIN_RAMP_LENGTH; i++) // gold
dest_colormap[starttranscolor + i] = (UINT8)(115 + (5*(i-8)/8));
break;
// Super Knuckles
case SKINCOLOR_KSUPER1:
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(120 + (i >> 2));
break;
case SKINCOLOR_KSUPER2:
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(120 + (6*i/SKIN_RAMP_LENGTH));
break;
case SKINCOLOR_KSUPER3:
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(120 + (i >> 1));
break;
case SKINCOLOR_KSUPER4:
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(121 + (i >> 1));
break;
case SKINCOLOR_KSUPER5:
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
dest_colormap[starttranscolor + i] = (UINT8)(122 + (i >> 1));
break;
default:
I_Error("Invalid skin color #%hu.", (UINT16)color);
break;
}
}
*/
/** \brief Retrieves a translation colormap from the cache.
\param skinnum number of skin, TC_DEFAULT or TC_BOSS

View file

@ -105,7 +105,7 @@ void R_DrawColumn_8(void)
}
}
#define TRANSPARENTPIXEL 247
#define TRANSPARENTPIXEL 255
void R_Draw2sMultiPatchColumn_8(void)
{

View file

@ -1331,7 +1331,7 @@ void R_RenderPlayerView(player_t *player)
if (cv_homremoval.value == 1)
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // No HOM effect!
else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted.
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 128+(timeinmap&15));
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 32+(timeinmap&15));
}
// Draw over the fourth screen so you don't have to stare at a HOM :V
else if (splitscreen == 2 && player == &players[displayplayers[2]])

View file

@ -42,8 +42,6 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
CV_PossibleValue_t Forceskin_cons_t[MAXSKINS+2];
static void R_InitSkins(void);
#define MINZ (FRACUNIT*4)
#define BASEYCENTER (BASEVIDHEIGHT/2)
@ -585,7 +583,17 @@ void R_InitSprites(void)
//
// it can be is do before loading config for skin cvar possible value
R_InitSkins();
// (... what the fuck did you just say to me? "it can be is do"?)
#ifdef SKINVALUES
for (i = 0; i <= MAXSKINS; i++)
{
skin_cons_t[i].value = 0;
skin_cons_t[i].strvalue = NULL;
}
#endif
numskins = 0;
for (i = 0; i < numwadfiles; i++)
R_AddSkins((UINT16)i);
@ -820,7 +828,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
colfunc = basecolfunc; // hack: this isn't resetting properly somewhere.
dc_colormap = vis->colormap;
if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
if (!(vis->cut & SC_PRECIP) && (vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
{
// translate certain pixels to white
colfunc = transcolfunc;
@ -891,18 +899,18 @@ static void R_DrawVisSprite(vissprite_t *vis)
frac = vis->startfrac;
windowtop = windowbottom = sprbotscreen = INT32_MAX;
if (vis->mobj->skin && ((skin_t *)vis->mobj->skin)->flags & SF_HIRES)
if (!(vis->cut & SC_PRECIP) && vis->mobj->skin && ((skin_t *)vis->mobj->skin)->flags & SF_HIRES)
this_scale = FixedMul(this_scale, ((skin_t *)vis->mobj->skin)->highresscale);
if (this_scale <= 0)
this_scale = 1;
if (this_scale != FRACUNIT)
{
if (!vis->isScaled)
if (!(vis->cut & SC_ISSCALED))
{
vis->scale = FixedMul(vis->scale, this_scale);
vis->scalestep = FixedMul(vis->scalestep, this_scale);
vis->xiscale = FixedDiv(vis->xiscale,this_scale);
vis->isScaled = true;
vis->cut |= SC_ISSCALED;
}
dc_texturemid = FixedDiv(dc_texturemid,this_scale);
}
@ -955,7 +963,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
#else
column = (column_t *)((UINT8 *)patch + LONG(patch->columnofs[frac>>FRACBITS]));
#endif
if (vis->vflip)
if (vis->cut & SC_VFLIP)
R_DrawFlippedMaskedColumn(column, patch->height);
else
R_DrawMaskedColumn(column);
@ -1035,7 +1043,7 @@ static void R_DrawPrecipitationVisSprite(vissprite_t *vis)
//
// R_SplitSprite
// runs through a sector's lightlist and
static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing)
static void R_SplitSprite(vissprite_t *sprite)
{
INT32 i, lightnum, lindex;
INT16 cutfrac;
@ -1071,6 +1079,8 @@ static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing)
// adjust the heights.
newsprite = M_Memcpy(R_NewVisSprite(), sprite, sizeof (vissprite_t));
newsprite->cut |= (sprite->cut & SC_FLAGMASK);
sprite->cut |= SC_BOTTOM;
sprite->gz = testheight;
@ -1110,13 +1120,17 @@ static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing)
;
else
*/
if (!((thing->frame & (FF_FULLBRIGHT|FF_TRANSMASK) || thing->flags2 & MF2_SHADOW)
if (!((newsprite->cut & SC_FULLBRIGHT)
&& (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1))))
{
lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT);
if (lindex >= MAXLIGHTSCALE)
lindex = MAXLIGHTSCALE-1;
if (newsprite->cut & SC_SEMIBRIGHT)
lindex = (MAXLIGHTSCALE/2) + (lindex >> 1);
newsprite->colormap = spritelights[lindex];
}
}
@ -1144,6 +1158,7 @@ static void R_ProjectSprite(mobj_t *thing)
size_t rot;
UINT8 flip;
boolean vflip = (!(thing->eflags & MFE_VERTICALFLIP) != !(thing->frame & FF_VERTICALFLIP));
INT32 lindex;
@ -1349,7 +1364,7 @@ static void R_ProjectSprite(mobj_t *thing)
}
//SoM: 3/17/2000: Disregard sprites that are out of view..
if (thing->eflags & MFE_VERTICALFLIP)
if (vflip)
{
// When vertical flipped, draw sprites from the top down, at least as far as offsets are concerned.
// sprite height - sprite topoffset is the proper inverse of the vertical offset, of course.
@ -1491,7 +1506,12 @@ static void R_ProjectSprite(mobj_t *thing)
else if (thing->frame & FF_TRANSMASK)
vis->transmap = transtables + (thing->frame & FF_TRANSMASK) - 0x10000;
if (((thing->frame & FF_FULLBRIGHT) || (thing->flags2 & MF2_SHADOW))
if (thing->frame & FF_FULLBRIGHT || thing->flags2 & MF2_SHADOW)
vis->cut |= SC_FULLBRIGHT;
else if (thing->frame & FF_SEMIBRIGHT)
vis->cut |= SC_SEMIBRIGHT;
if (vis->cut & SC_FULLBRIGHT
&& (!vis->extra_colormap || !(vis->extra_colormap->fog & 1)))
{
// full bright: goggles
@ -1505,20 +1525,17 @@ static void R_ProjectSprite(mobj_t *thing)
if (lindex >= MAXLIGHTSCALE)
lindex = MAXLIGHTSCALE-1;
if (vis->cut & SC_SEMIBRIGHT)
lindex = (MAXLIGHTSCALE/2) + (lindex >> 1);
vis->colormap = spritelights[lindex];
}
vis->precip = false;
if (thing->eflags & MFE_VERTICALFLIP)
vis->vflip = true;
else
vis->vflip = false;
vis->isScaled = false;
if (vflip)
vis->cut |= SC_VFLIP;
if (thing->subsector->sector->numlights)
R_SplitSprite(vis, thing);
R_SplitSprite(vis);
// Debug
++objectsdrawn;
@ -1690,15 +1707,12 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing)
vis->transmap = NULL;
vis->mobjflags = 0;
vis->cut = SC_NONE;
vis->cut = SC_PRECIP;
vis->extra_colormap = thing->subsector->sector->extra_colormap;
vis->heightsec = thing->subsector->sector->heightsec;
// Fullbright
vis->colormap = colormaps;
vis->precip = true;
vis->vflip = false;
vis->isScaled = false;
}
// R_AddSprites
@ -2484,7 +2498,7 @@ void R_DrawMasked(void)
next = r2->prev;
// Tails 08-18-2002
if (r2->sprite->precip == true)
if (r2->sprite->cut & SC_PRECIP)
R_DrawPrecipitationSprite(r2->sprite);
else
R_DrawSprite(r2->sprite);
@ -2531,7 +2545,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
strncpy(skin->facewant, "PLAYWANT", 9);
strncpy(skin->facemmap, "PLAYMMAP", 9);
skin->starttranscolor = 160;
skin->starttranscolor = 96;
skin->prefcolor = SKINCOLOR_GREEN;
// SRB2kart
@ -2546,61 +2560,6 @@ static void Sk_SetDefaultValue(skin_t *skin)
skin->soundsid[S_sfx[i].skinsound] = i;
}
//
// Initialize the basic skins
//
void R_InitSkins(void)
{
skin_t *skin;
#ifdef SKINVALUES
INT32 i;
for (i = 0; i <= MAXSKINS; i++)
{
skin_cons_t[i].value = 0;
skin_cons_t[i].strvalue = NULL;
}
#endif
// skin[0] = Sonic skin
skin = &skins[0];
numskins = 1;
Sk_SetDefaultValue(skin);
// Hardcoded S_SKIN customizations for Sonic.
strcpy(skin->name, DEFAULTSKIN);
#ifdef SKINVALUES
skin_cons_t[0].strvalue = skins[0].name;
#endif
skin->flags = 0;
strcpy(skin->realname, "Sonic");
strcpy(skin->hudname, "SONIC");
strncpy(skin->facerank, "PLAYRANK", 9);
strncpy(skin->facewant, "PLAYWANT", 9);
strncpy(skin->facemmap, "PLAYMMAP", 9);
skin->prefcolor = SKINCOLOR_BLUE;
// SRB2kart
skin->kartspeed = 8;
skin->kartweight = 2;
//
skin->spritedef.numframes = sprites[SPR_PLAY].numframes;
skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes;
ST_LoadFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, 0);
// Set values for Sonic skin
Forceskin_cons_t[1].value = 0;
Forceskin_cons_t[1].strvalue = skin->name;
//MD2 for sonic doesn't want to load in Linux.
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_AddPlayerMD2(0);
#endif
}
// returns true if the skin name is found (loaded from pwad)
// warning return -1 if not found
INT32 R_SkinAvailable(const char *name)

View file

@ -104,9 +104,20 @@ extern CV_PossibleValue_t Forceskin_cons_t[];
// -----------
typedef enum
{
// actual cuts
SC_NONE = 0,
SC_TOP = 1,
SC_BOTTOM = 2
SC_BOTTOM = 1<<1,
// other flags
SC_PRECIP = 1<<2,
//SC_LINKDRAW = 1<<3, -- 2.2 compat
SC_FULLBRIGHT = 1<<4,
SC_SEMIBRIGHT = 1<<5,
SC_VFLIP = 1<<6,
SC_ISSCALED = 1>>7,
// masks
SC_CUTMASK = SC_TOP|SC_BOTTOM,
SC_FLAGMASK = ~SC_CUTMASK
} spritecut_e;
// A vissprite_t is a thing that will be drawn during a refresh,
@ -155,9 +166,6 @@ typedef struct vissprite_s
INT16 clipbot[MAXVIDWIDTH], cliptop[MAXVIDWIDTH];
boolean precip;
boolean vflip; // Flip vertically
boolean isScaled;
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
} vissprite_t;

View file

@ -131,7 +131,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <errno.h>
#endif
// Locations for searching the srb2.srb
// Locations for searching for main.kart
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2Kart"
#define DEFAULTWADLOCATION2 "/usr/local/games/SRB2Kart"
@ -149,8 +149,7 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
/** \brief WAD file to look for
*/
#define WADKEYWORD1 "srb2.srb"
#define WADKEYWORD2 "srb2.wad"
#define WADKEYWORD "main.kart"
/** \brief holds wad path
*/
static char returnWadPath[256];
@ -3454,15 +3453,7 @@ static boolean isWadPathOk(const char *path)
if (!wad3path)
return false;
sprintf(wad3path, pandf, path, WADKEYWORD1);
if (FIL_ReadFileOK(wad3path))
{
free(wad3path);
return true;
}
sprintf(wad3path, pandf, path, WADKEYWORD2);
sprintf(wad3path, pandf, path, WADKEYWORD);
if (FIL_ReadFileOK(wad3path))
{
@ -3487,7 +3478,7 @@ static void pathonly(char *s)
}
}
/** \brief search for srb2.srb in the given path
/** \brief search for main.kart in the given path
\param searchDir starting path
@ -3500,7 +3491,7 @@ static const char *searchWad(const char *searchDir)
static char tempsw[256] = "";
filestatus_t fstemp;
strcpy(tempsw, WADKEYWORD1);
strcpy(tempsw, WADKEYWORD);
fstemp = filesearch(tempsw,searchDir,NULL,true,20);
if (fstemp == FS_FOUND)
{
@ -3508,19 +3499,12 @@ static const char *searchWad(const char *searchDir)
return tempsw;
}
strcpy(tempsw, WADKEYWORD2);
fstemp = filesearch(tempsw, searchDir, NULL, true, 20);
if (fstemp == FS_FOUND)
{
pathonly(tempsw);
return tempsw;
}
return NULL;
}
/** \brief go through all possible paths and look for srb2.srb
/** \brief go through all possible paths and look for main.kart
\return path to srb2.srb if any
\return path to main.kart if any
*/
static const char *locateWad(void)
{
@ -3649,7 +3633,7 @@ const char *I_LocateWad(void)
if (waddir)
{
// change to the directory where we found srb2.srb
// change to the directory where we found main.kart
#if defined (_WIN32)
SetCurrentDirectoryA(waddir);
#else

View file

@ -145,7 +145,7 @@ void __set_fpscr(long); // in libgcc / kernel's startup.s?
#define O_BINARY 0
#endif
// Locations for searching the srb2.srb
// Locations for searching the main.kart
#ifdef _arch_dreamcast
#define DEFAULTWADLOCATION1 "/cd"
#define DEFAULTWADLOCATION2 "/pc"
@ -217,8 +217,7 @@ void __set_fpscr(long); // in libgcc / kernel's startup.s?
/** \brief WAD file to look for
*/
#define WADKEYWORD1 "srb2.srb"
#define WADKEYWORD2 "srb2.wad"
#define WADKEYWORD "main.kart"
/** \brief holds wad path
*/
static char returnWadPath[256];
@ -3398,15 +3397,7 @@ static boolean isWadPathOk(const char *path)
if (!wad3path)
return false;
sprintf(wad3path, pandf, path, WADKEYWORD1);
if (FIL_ReadFileOK(wad3path))
{
free(wad3path);
return true;
}
sprintf(wad3path, pandf, path, WADKEYWORD2);
sprintf(wad3path, pandf, path, WADKEYWORD);
if (FIL_ReadFileOK(wad3path))
{
@ -3431,7 +3422,7 @@ static void pathonly(char *s)
}
}
/** \brief search for srb2.srb in the given path
/** \brief search for main.kart in the given path
\param searchDir starting path
@ -3444,7 +3435,7 @@ static const char *searchWad(const char *searchDir)
static char tempsw[256] = "";
filestatus_t fstemp;
strcpy(tempsw, WADKEYWORD1);
strcpy(tempsw, WADKEYWORD);
fstemp = filesearch(tempsw,searchDir,NULL,true,20);
if (fstemp == FS_FOUND)
{
@ -3452,19 +3443,12 @@ static const char *searchWad(const char *searchDir)
return tempsw;
}
strcpy(tempsw, WADKEYWORD2);
fstemp = filesearch(tempsw, searchDir, NULL, true, 20);
if (fstemp == FS_FOUND)
{
pathonly(tempsw);
return tempsw;
}
return NULL;
}
/** \brief go through all possible paths and look for srb2.srb
/** \brief go through all possible paths and look for main.kart
\return path to srb2.srb if any
\return path to main.kart if any
*/
static const char *locateWad(void)
{
@ -3581,7 +3565,7 @@ const char *I_LocateWad(void)
if (waddir)
{
// change to the directory where we found srb2.srb
// change to the directory where we found main.kart
#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX)
SetCurrentDirectoryA(waddir);
#elif !defined (_WIN32_WCE) && !defined (_PS3)

View file

@ -2138,8 +2138,8 @@ void ST_Drawer(void)
if (timeinmap < 15)
{
if (timeinmap <= 5)
V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,120); // Pure white on first few frames, to hide SRB2's awful level load artifacts
V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,0); // Pure white on first few frames, to hide SRB2's awful level load artifacts
else
V_DrawFadeScreen(120, 15-timeinmap); // Then gradually fade out from there
V_DrawFadeScreen(0, 15-timeinmap); // Then gradually fade out from there
}
}

View file

@ -17,7 +17,7 @@
[BITS 32]
%define FRACBITS 16
%define TRANSPARENTPIXEL 247
%define TRANSPARENTPIXEL 255
%ifdef LINUX
%macro cextern 1

View file

@ -18,7 +18,7 @@
[BITS 32]
%define FRACBITS 16
%define TRANSPARENTPIXEL 247
%define TRANSPARENTPIXEL 255
%ifdef LINUX
%macro cextern 1

View file

@ -1359,16 +1359,16 @@ UINT8 *V_GetStringColormap(INT32 colorflags)
return lavendermap;
case 10: // 0x8A, gold
return goldmap;
case 11: // 0x8B, tea-green
return teamap;
case 12: // 0x8C, steel
return steelmap;
case 11: // 0x8B, aqua-green
return aquamap;
case 12: // 0x8C, magenta
return magentamap;
case 13: // 0x8D, pink
return pinkmap;
case 14: // 0x8E, brown
return brownmap;
case 15: // 0x8F, peach
return peachmap;
case 15: // 0x8F, tan
return tanmap;
default: // reset
return NULL;
}

View file

@ -79,11 +79,11 @@ extern UINT8 hudtrans;
#define V_SKYMAP 0x00008000
#define V_LAVENDERMAP 0x00009000
#define V_GOLDMAP 0x0000A000
#define V_TEAMAP 0x0000B000
#define V_STEELMAP 0x0000C000
#define V_AQUAMAP 0x0000B000
#define V_MAGENTAMAP 0x0000C000
#define V_PINKMAP 0x0000D000
#define V_BROWNMAP 0x0000E000
#define V_PEACHMAP 0x0000F000
#define V_TANMAP 0x0000F000
// use bits 17-20 for alpha transparency
#define V_ALPHASHIFT 16

View file

@ -1083,7 +1083,7 @@ void Y_VoteDrawer(void)
V_DrawMappedPatch(BASEVIDWIDTH-124, handy, V_SNAPTORIGHT, thiscurs, colormap);
if (votetic % 10 < 4)
V_DrawFill(BASEVIDWIDTH-100-sizeadd, y-sizeadd, 80+(sizeadd*2), 50+(sizeadd*2), 120|V_SNAPTORIGHT);
V_DrawFill(BASEVIDWIDTH-100-sizeadd, y-sizeadd, 80+(sizeadd*2), 50+(sizeadd*2), 0|V_SNAPTORIGHT);
else
V_DrawFill(BASEVIDWIDTH-100-sizeadd, y-sizeadd, 80+(sizeadd*2), 50+(sizeadd*2), color|V_SNAPTORIGHT);
@ -1154,7 +1154,7 @@ void Y_VoteDrawer(void)
{
V_DrawScaledPatch(x-18, y+9, V_SNAPTOLEFT, cursor);
if (voteendtic != -1 && !(votetic % 4))
V_DrawFill(x-1, y-1, 42, 27, 120|V_SNAPTOLEFT);
V_DrawFill(x-1, y-1, 42, 27, 0|V_SNAPTOLEFT);
else
V_DrawFill(x-1, y-1, 42, 27, levelinfo[votes[i]].gtc|V_SNAPTOLEFT);
}