Merge branch 'master' of git@git.magicalgirl.moe:KartKrew/Kart.git into rings_slopechange

# Conflicts:
#	src/k_kart.c
This commit is contained in:
Sryder 2019-05-31 22:29:32 +01:00
commit 96f92f8183
18 changed files with 276 additions and 81 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

@ -222,6 +222,7 @@ endif
ifdef GCC71
WFLAGS+=-Wno-error=implicit-fallthrough
WFLAGS+=-Wno-implicit-fallthrough
WFLAGS+=-Wno-error=format-truncation
endif
ifdef GCC80
WFLAGS+=-Wno-error=format-overflow

View file

@ -33,12 +33,12 @@
*/
#define ASSET_HASH_MAIN_KART "00000000000000000000000000000000"
#define ASSET_HASH_GFX_PK3 "99c39f223d84ebc78e67ab68f3bead95"
#define ASSET_HASH_TEXTURES_PK3 "ec8e9b7535cf585afe72ef277b08f490"
#define ASSET_HASH_CHARS_PK3 "e2c428347dde52858a3dacd29fc5b964"
#define ASSET_HASH_MAPS_WAD "1335cd064656aedca359cfbb5233ac4a"
#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 "6461b30bb20754a16a1b582120f55842"
#define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000"
#endif
#endif

View file

@ -266,6 +266,7 @@ typedef enum
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
@ -279,6 +280,7 @@ typedef enum
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_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

View file

@ -8418,6 +8418,7 @@ static const char *const KARTSTUFF_LIST[] = {
"RINGDELAY",
"RINGBOOST",
"RINGLOCK",
"SPARKLEANIM",
"JMP",
"OFFROAD",
"POGOSPRING",
@ -8431,6 +8432,7 @@ static const char *const KARTSTUFF_LIST[] = {
"DRAFTPOWER",
"DRAFTLEEWAY",
"LASTDRAFT",
"BOOSTANGLE",
"AIZDRIFTSTRAT",
"BRAKEDRIFT",

View file

@ -149,21 +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_FILE
#define USE_PATCH_FILE
// Use .kart extension addons
#define USE_KART
@ -222,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.

View file

@ -438,6 +438,7 @@ static const char *credits[] = {
"",
"\1Support Programming",
"Colette \"fickleheart\" Bordelon",
"James R.",
"\"Lat\'\"",
"\"Monster Iestyn\"",
"\"Shuffle\"",
@ -501,13 +502,18 @@ static const char *credits[] = {
"\"DrTapeworm\"",
"Paul \"Boinciel\" Clempson",
"Sherman \"CoatRack\" DesJardins",
"Colette \"fickleheart\" Bordelon",
"Vivian \"toaster\" Grannell",
"James \"SeventhSentinel\" Hall",
"\"Lat\'\"",
"\"MK\"",
"\"Ninferno\"",
"Sean \"Sryder\" Ryder",
"\"Ryuspark\"",
"\"Simsmagic\"",
"\"SP47\"",
"\"TG\"",
"\"Victor Rush Turbo\"",
"\"ZarroTsu\"",
"",
"\1Testing",
@ -560,7 +566,7 @@ static struct {
// This Tyler52 gag is troublesome
// Alignment should be ((spaces+1 * 100) + (headers+1 * 38) + (lines * 15))
// Current max image spacing: (200*17)
{112, (15*100)+(17*38)+(72*15), "TYLER52", SKINCOLOR_NONE},
{112, (15*100)+(17*38)+(86*15), "TYLER52", SKINCOLOR_NONE},
{0, 0, NULL, SKINCOLOR_NONE}
};

View file

@ -1555,11 +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->kartstuff[k_spinouttimer] && EITHERSNEAKER(player))) // Spinning and boosting cancels out turning
lang += (cmd->angleturn<<16);
cmd->angleturn = (INT16)(lang >> 16);

View file

@ -300,7 +300,7 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = {
{ 0, 80, 81, 88, 88, 188, 189, 76, 76, 77, 78, 79, 236, 237, 238, 239}, // SKINCOLOR_CROCODILE
{ 0, 80, 81, 88, 188, 189, 190, 191, 94, 94, 95, 95, 109, 110, 111, 31}, // SKINCOLOR_PERIDOT
{ 0, 208, 216, 209, 218, 51, 65, 76, 191, 191, 126, 143, 138, 175, 169, 254}, // SKINCOLOR_VOMIT
{ 81, 82, 83, 73, 64, 65, 66, 92, 92, 93, 93, 94, 95, 173, 174, 175}, // SKINCOLOR_GARDEN
{ 81, 82, 83, 73, 64, 65, 66, 92, 92, 93, 93, 94, 95, 109, 110, 111}, // SKINCOLOR_GARDEN
{ 0, 80, 81, 82, 83, 88, 89, 99, 100, 102, 104, 126, 143, 138, 139, 31}, // SKINCOLOR_LIME
{ 83, 72, 73, 74, 75, 76, 102, 104, 105, 106, 107, 108, 109, 110, 111, 31}, // SKINCOLOR_HANDHELD
{ 0, 80, 80, 81, 88, 89, 90, 91, 92, 93, 94, 95, 109, 110, 111, 31}, // SKINCOLOR_TEA
@ -2240,9 +2240,9 @@ static void K_GetKartBoostPower(player_t *player)
if (player->kartstuff[k_draftpower] > 0) // Drafting
{
speedboost += (player->kartstuff[k_draftpower]) / 3; // + 0 to 33.3% top speed
//accelboost += (FRACUNIT / 3); // + 33.3% acceleration
numboosts++; // (Drafting suffers no boost stack penalty!)
fixed_t draftspeed = ((3*FRACUNIT)/10) + ((player->kartspeed-1) * (FRACUNIT/50)); // min is 30%, max is 46%
speedboost += FixedMul(draftspeed, player->kartstuff[k_draftpower]); // (Drafting suffers no boost stack penalty.)
numboosts++;
}
player->kartstuff[k_boostpower] = boostpower;
@ -3980,6 +3980,9 @@ void K_DoSneaker(player_t *player, INT32 type)
}
else
player->kartstuff[k_levelbooster] = sneakertime;
// set angle for spun out players:
player->kartstuff[k_boostangle] = (INT32)player->mo->angle;
}
static void K_DoShrink(player_t *user)
@ -4968,6 +4971,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
K_UpdateOffroad(player);
K_UpdateDraft(player);
K_UpdateEngineSounds(player, cmd); // Thanks, VAda!
// update boost angle if not spun out
if (!player->kartstuff[k_spinouttimer] && !player->kartstuff[k_wipeoutslow])
player->kartstuff[k_boostangle] = (INT32)player->mo->angle;
K_GetKartBoostPower(player);
// Special effect objects!
@ -5138,7 +5146,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
{
player->powers[pw_flashing] = K_GetKartFlashing(player);
}
else if (player->powers[pw_flashing] == K_GetKartFlashing(player))
else if (player->powers[pw_flashing] >= K_GetKartFlashing(player))
{
player->powers[pw_flashing]--;
}
@ -6490,10 +6498,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392)
player->mo->friction += 4608;
if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392)
player->mo->friction += 1608;
}
if (player->speed > 0 && cmd->forwardmove < 0) // change friction while braking no matter what, otherwise it's not any more effective than just letting go off accel
player->mo->friction -= 2048;
// Karma ice physics
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{
@ -9108,6 +9117,11 @@ static void K_drawBattleFullscreen(void)
INT32 y = -64+(stplyr->karthud[khud_cardanimation]); // card animation goes from 0 to 164, 164 is the middle of the screen
INT32 splitflags = V_SNAPTOTOP; // I don't feel like properly supporting non-green resolutions, so you can have a misuse of SNAPTO instead
fixed_t scale = FRACUNIT;
boolean drawcomebacktimer = true; // lazy hack because it's cleaner in the long run.
#ifdef HAVE_BLUA
if (!LUA_HudEnabled(hud_battlecomebacktimer))
drawcomebacktimer = false;
#endif
if (splitscreen)
{
@ -9159,7 +9173,7 @@ static void K_drawBattleFullscreen(void)
else
K_drawKartFinish();
}
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback && !stplyr->spectator)
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback && !stplyr->spectator && drawcomebacktimer)
{
UINT16 t = stplyr->kartstuff[k_comebacktimer]/(10*TICRATE);
INT32 txoff, adjust = (splitscreen > 1) ? 4 : 6; // normal string is 8, kart string is 12, half of that for ease
@ -9737,6 +9751,9 @@ void K_drawKartHUD(void)
if (battlefullscreen)
{
#ifdef HAVE_BLUA
if (LUA_HudEnabled(hud_battlefullscreen))
#endif
K_drawBattleFullscreen();
return;
}

View file

@ -21,6 +21,8 @@ enum hud {
hud_position,
hud_minirankings, // Rankings to the left
hud_battlebumpers, // mini rankings battle bumpers.
hud_battlefullscreen, // battle huge text (WAIT, WIN, LOSE ...) + karma comeback time
hud_battlecomebacktimer, // comeback timer in battlefullscreen. separated for ease of use.
hud_wanted,
hud_speedometer,
hud_freeplay,

View file

@ -48,6 +48,8 @@ static const char *const hud_disable_options[] = {
"position",
"minirankings", // Gametype rankings to the left
"battlerankingsbumpers", // bumper drawer for battle. Useful if you want to make a custom battle gamemode without bumpers being involved.
"battlefullscreen", // battlefullscreen func (WAIT, ATTACK OR PROTECT ...)
"battlecomebacktimer", // come back timer in battlefullscreen
"wanted",
"speedometer",
"freeplay",
@ -381,6 +383,179 @@ static int libd_drawScaled(lua_State *L)
return 0;
}
// KART: draw patch on minimap from x, y coordinates on the map
static int libd_drawOnMinimap(lua_State *L)
{
fixed_t x, y, scale; // coordinates of the object
patch_t *patch; // patch we want to draw
const UINT8 *colormap = NULL; // do we want to colormap this patch?
boolean centered; // the patch is centered and doesn't need readjusting on x/y coordinates.
// variables used to replicate k_kart's mmap drawer:
INT32 lumpnum;
patch_t *AutomapPic;
INT32 mx, my;
INT32 splitflags, minimaptrans;
// base position of the minimap which also takes splits into account:
INT32 MM_X, MM_Y;
// variables used for actually drawing the icon:
fixed_t amnumxpos, amnumypos;
INT32 amxpos, amypos;
node_t *bsp = &nodes[numnodes-1];
fixed_t maxx, minx, maxy, miny;
fixed_t mapwidth, mapheight;
fixed_t xoffset, yoffset;
fixed_t xscale, yscale, zoom;
fixed_t patchw, patchh;
HUDONLY // only run this function in hud hooks
x = luaL_checkinteger(L, 1);
y = luaL_checkinteger(L, 2);
scale = luaL_checkinteger(L, 3);
patch = *((patch_t **)luaL_checkudata(L, 4, META_PATCH));
if (!lua_isnoneornil(L, 5))
colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP));
centered = lua_optboolean(L, 6);
// replicate exactly what source does for its minimap drawer; AKA hardcoded garbo.
// first, check what position the mmap is supposed to be in (pasted from k_kart.c):
MM_X = BASEVIDWIDTH - 50; // 270
MM_Y = (BASEVIDHEIGHT/2)-16; // 84
if (splitscreen)
{
MM_Y = (BASEVIDHEIGHT/2);
if (splitscreen > 1) // 3P : bottom right
{
MM_X = (3*BASEVIDWIDTH/4);
MM_Y = (3*BASEVIDHEIGHT/4);
if (splitscreen > 2) // 4P: centered
{
MM_X = (BASEVIDWIDTH/2);
MM_Y = (BASEVIDHEIGHT/2);
}
}
}
// splitscreen flags
splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split)
// translucency:
if (timeinmap > 105)
{
minimaptrans = cv_kartminimap.value;
if (timeinmap <= 113)
minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105);
if (!minimaptrans)
return 0;
}
else
return 0;
minimaptrans = ((10-minimaptrans)<<FF_TRANSSHIFT);
splitflags |= minimaptrans;
if (!(splitscreen == 2))
{
splitflags &= ~minimaptrans;
splitflags |= V_HUDTRANSHALF;
}
splitflags &= ~V_HUDTRANSHALF;
splitflags |= V_HUDTRANS;
// Draw the HUD only when playing in a level.
// hu_stuff needs this, unlike st_stuff.
if (gamestate != GS_LEVEL)
return 0;
if (stplyr != &players[displayplayers[0]])
return 0;
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(gamemap)));
if (lumpnum != -1)
AutomapPic = W_CachePatchName(va("%sR", G_BuildMapName(gamemap)), PU_HUDGFX);
else
return 0; // no pic, just get outta here
mx = MM_X - (AutomapPic->width/2);
my = MM_Y - (AutomapPic->height/2);
// let offsets transfer to the heads, too!
if (encoremode)
mx += SHORT(AutomapPic->leftoffset);
else
mx -= SHORT(AutomapPic->leftoffset);
my -= SHORT(AutomapPic->topoffset);
// now that we have replicated this behavior, we can draw an icon from our supplied x, y coordinates by replicating k_kart.c's totally understandable uncommented code!!!
// get map boundaries using nodes
maxx = maxy = INT32_MAX;
minx = miny = INT32_MIN;
minx = bsp->bbox[0][BOXLEFT];
maxx = bsp->bbox[0][BOXRIGHT];
miny = bsp->bbox[0][BOXBOTTOM];
maxy = bsp->bbox[0][BOXTOP];
if (bsp->bbox[1][BOXLEFT] < minx)
minx = bsp->bbox[1][BOXLEFT];
if (bsp->bbox[1][BOXRIGHT] > maxx)
maxx = bsp->bbox[1][BOXRIGHT];
if (bsp->bbox[1][BOXBOTTOM] < miny)
miny = bsp->bbox[1][BOXBOTTOM];
if (bsp->bbox[1][BOXTOP] > maxy)
maxy = bsp->bbox[1][BOXTOP];
// You might be wondering why these are being bitshift here
// it's because mapwidth and height would otherwise overflow for maps larger than half the size possible...
// map boundaries and sizes will ALWAYS be whole numbers thankfully
// later calculations take into consideration that these are actually not in terms of FRACUNIT though
minx >>= FRACBITS;
maxx >>= FRACBITS;
miny >>= FRACBITS;
maxy >>= FRACBITS;
// these are our final map boundaries:
mapwidth = maxx - minx;
mapheight = maxy - miny;
// These should always be small enough to be bitshift back right now
xoffset = (minx + mapwidth/2)<<FRACBITS;
yoffset = (miny + mapheight/2)<<FRACBITS;
xscale = FixedDiv(AutomapPic->width, mapwidth);
yscale = FixedDiv(AutomapPic->height, mapheight);
zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20);
amnumxpos = (FixedMul(x, zoom) - FixedMul(xoffset, zoom));
amnumypos = -(FixedMul(y, zoom) - FixedMul(yoffset, zoom));
if (encoremode)
amnumxpos = -amnumxpos;
// scale patch coords
patchw = patch->width*scale /2;
patchh = patch->height*scale /2;
if (centered)
patchw = patchh = 0; // patch is supposedly already centered, don't butt in.
amxpos = amnumxpos + ((mx + AutomapPic->width/2)<<FRACBITS) - patchw;
amypos = amnumypos + ((my + AutomapPic->height/2)<<FRACBITS) - patchh;
// and NOW we can FINALLY DRAW OUR GOD DAMN PATCH :V
V_DrawFixedPatch(amxpos, amypos, scale, splitflags, patch, colormap);
return 0;
}
static int libd_drawNum(lua_State *L)
{
INT32 x, y, flags, num;
@ -644,6 +819,7 @@ static luaL_Reg lib_draw[] = {
{"dupy", libd_dupy},
{"renderer", libd_renderer},
{"localTransFlag", libd_getlocaltransflag},
{"drawOnMinimap", libd_drawOnMinimap},
{NULL, NULL}
};

View file

@ -1244,14 +1244,15 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 55},
//{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65},
{IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 65},
{IT_STRING | IT_CVAR, NULL, "Field of View", &cv_fov, 75},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 80},
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 90},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90},
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100},
#ifdef HWRENDER
{IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmdls, 105},
{IT_STRING | IT_CVAR, NULL, "Fallback Player 3D Model", &cv_grfallbackplayermodel, 115},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 125},
{IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmdls, 115},
{IT_STRING | IT_CVAR, NULL, "Fallback Player 3D Model", &cv_grfallbackplayermodel, 125},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 135},
#endif
};
@ -1266,10 +1267,12 @@ enum
op_video_wdd,
//op_video_wd,
op_video_skybox,
op_video_fov,
op_video_fps,
op_video_vsync,
#ifdef HWRENDER
op_video_md2,
op_video_kartman,
op_video_ogl,
#endif
};
@ -1285,10 +1288,9 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
{IT_SUBMENU|IT_STRING, NULL, "Fog...", &OP_OpenGLFogDef, 10},
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 20},
{IT_STRING|IT_CVAR, NULL, "Field of View", &cv_fov, 35},
{IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 45},
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 55},
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 65},
{IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 35},
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 45},
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 55},
/*#ifdef _WINDOWS
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 50},
#endif
@ -3335,7 +3337,9 @@ void M_Init(void)
#ifdef HWRENDER
// Permanently hide some options based on render mode
if (rendermode == render_soft)
OP_VideoOptionsMenu[op_video_ogl].status = OP_VideoOptionsMenu[op_video_md2].status = IT_DISABLED;
OP_VideoOptionsMenu[op_video_ogl].status =
OP_VideoOptionsMenu[op_video_kartman].status =
OP_VideoOptionsMenu[op_video_md2] .status = IT_DISABLED;
#endif
#ifndef NONET

View file

@ -3582,22 +3582,17 @@ void A_AttractChase(mobj_t *actor)
if (actor->extravalue1 >= 21)
{
#if 0
UINT8 i;
#endif
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);
#if 0
// ring sparkle effect
for (i = 0; i < 4; i++)
{
mobj_t *sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS);
sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS);
P_SetTarget(&sparkle->target, actor->target);
sparkle->extravalue1 = i;
}
#endif
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;
@ -8413,6 +8408,7 @@ void A_SPBChase(mobj_t *actor)
actor->lastlook = -1;
spbplace = -1;
P_InstaThrust(actor, actor->angle, wspeed);
actor->flags &= ~MF_NOCLIPTHING; // just in case.
return;
}
@ -8442,10 +8438,14 @@ void A_SPBChase(mobj_t *actor)
{
if (actor->tracer && actor->tracer->health)
{
fixed_t defspeed = wspeed;
fixed_t range = (160*actor->tracer->scale);
fixed_t cx = 0, cy =0;
// we're tailing a player, now's a good time to regain our damage properties
actor->flags &= ~MF_NOCLIPTHING;
// Play the intimidating gurgle
if (!S_SoundPlaying(actor, actor->info->activesound))
S_StartSound(actor, actor->info->activesound);
@ -8583,6 +8583,9 @@ void A_SPBChase(mobj_t *actor)
{
actor->momx = actor->momy = actor->momz = 0; // Stoooop
// don't hurt players that have nothing to do with this:
actor->flags |= MF_NOCLIPTHING;
if (actor->lastlook != -1
&& playeringame[actor->lastlook]
&& !players[actor->lastlook].spectator
@ -8619,6 +8622,10 @@ void A_SPBChase(mobj_t *actor)
}
// Found someone, now get close enough to initiate the slaughter...
// don't hurt players that have nothing to do with this:
actor->flags |= MF_NOCLIPTHING;
P_SetTarget(&actor->tracer, player->mo);
spbplace = bestrank;

View file

@ -1076,7 +1076,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
S_StartSound(tmthing, sfx_bsnipe);
// Player Damage
K_SpinPlayer(tmthing->player, thing->target, 0, tmthing, (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD));
K_SpinPlayer(tmthing->player, thing->target, 0, thing, (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD));
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)
@ -1111,7 +1111,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->state == &states[S_MINEEXPLOSION1])
K_ExplodePlayer(tmthing->player, thing->target, thing);
else
K_SpinPlayer(tmthing->player, thing->target, 0, tmthing, false);
K_SpinPlayer(tmthing->player, thing->target, 0, thing, false);
return true;
}

View file

@ -8347,25 +8347,6 @@ void P_MobjThinker(mobj_t *mobj)
}
K_MatchGenericExtraFlags(mobj, mobj->target);
mobj->angle = mobj->target->angle;
switch (mobj->extravalue1)
{
case 0:
default:
mobj->angle += ANGLE_90;
break;
case 1:
mobj->angle -= ANGLE_90;
break;
case 2:
mobj->angle += ANGLE_45;
break;
case 3:
mobj->angle -= ANGLE_45;
break;
}
P_TeleportMove(mobj, mobj->target->x + FINECOSINE(mobj->angle >> ANGLETOFINESHIFT),
mobj->target->y + FINESINE(mobj->angle >> ANGLETOFINESHIFT),
mobj->target->z + mobj->target->height);

View file

@ -4024,6 +4024,8 @@ static void P_3dMovement(player_t *player)
{
if (player->kartstuff[k_drift] != 0)
movepushangle = player->mo->angle-(ANGLE_45/5)*player->kartstuff[k_drift];
else if (player->kartstuff[k_spinouttimer] || player->kartstuff[k_wipeoutslow]) // if spun out, use the boost angle
movepushangle = (angle_t)player->kartstuff[k_boostangle];
else
movepushangle = player->mo->angle;
}
@ -5757,11 +5759,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
&& !(player->kartstuff[k_spinouttimer] && EITHERSNEAKER(player))) // Spinning and boosting cancels out turning
{
player->lturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, KART_FULLTURN)+1;
player->rturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, -KART_FULLTURN)-1;
@ -8475,8 +8476,8 @@ void P_PlayerThink(player_t *player)
if (player->powers[pw_invulnerability] && player->powers[pw_invulnerability] < UINT16_MAX)
player->powers[pw_invulnerability]--;
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX && ((player->pflags & PF_NIGHTSMODE)
|| (player->spectator || player->powers[pw_flashing] < K_GetKartFlashing(player))))
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX &&
(player->spectator || player->powers[pw_flashing] < K_GetKartFlashing(player)))
player->powers[pw_flashing]--;
if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX /*&& player->charability != CA_SWIM*/ && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter

View file

@ -292,7 +292,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3
#ifdef HAVE_VIDCOPY
VID_BlitLinearScreen_ASM(srcptr,destptr,width,height,srcrowbytes,destrowbytes);
#else
if (srcrowbytes == destrowbytes)
if ((srcrowbytes == destrowbytes) && (srcrowbytes == (size_t)width))
M_Memcpy(destptr, srcptr, srcrowbytes * height);
else
{
@ -2404,7 +2404,7 @@ INT32 V_ThinStringWidth(const char *string, INT32 option)
boolean *heatshifter = NULL;
INT32 lastheight = 0;
INT32 heatindex[2] = { 0, 0 };
INT32 heatindex[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
//
// V_DoPostProcessor
@ -2537,9 +2537,6 @@ Unoptimized version
UINT8 *srcscr = screens[0];
INT32 y;
if (splitscreen > 1) // 3P/4P has trouble supporting this, anyone want to fix it? :p
return;
// Make sure table is built
if (heatshifter == NULL || lastheight != viewheight)
{
@ -2554,7 +2551,7 @@ Unoptimized version
heatshifter[y] = true;
}
heatindex[0] = heatindex[1] = 0;
heatindex[0] = heatindex[1] = heatindex[2] = heatindex[3] = 0;
lastheight = viewheight;
}