Merge branch 'blankart-dev' into socmenus
This commit is contained in:
commit
fedf429c9b
39 changed files with 711 additions and 545 deletions
|
|
@ -71,6 +71,7 @@ cmake_dependent_option(
|
|||
OFF "NOT SRB2_CONFIG_SYSTEM_LIBRARIES"
|
||||
OFF
|
||||
)
|
||||
option(SRB2_CONFIG_ENABLE_DISCORDRPC "Enable Discord RPC features" ON)
|
||||
option(SRB2_CONFIG_HWRENDER "Enable hardware render (OpenGL) support" ON)
|
||||
option(SRB2_CONFIG_STATIC_OPENGL "Enable static linking GL (do not do this)" OFF)
|
||||
option(SRB2_CONFIG_ERRORMODE "Compile C code with warnings treated as errors." OFF)
|
||||
|
|
|
|||
|
|
@ -649,6 +649,7 @@ enum
|
|||
MF2_LINKDRAW = 1<<28,
|
||||
MF2_SHIELD = 1<<29,
|
||||
MF2_SPLAT = 1<<30,
|
||||
MF2_WATERRUN = 1<<31,
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
|||
|
|
@ -99,6 +99,13 @@ target_link_libraries(SRB2SDL2 PRIVATE tcbrindle::span)
|
|||
target_link_libraries(SRB2SDL2 PRIVATE fmt::fmt-header-only)
|
||||
target_link_libraries(SRB2SDL2 PRIVATE Tracy::TracyClient)
|
||||
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DUSE_STUN)
|
||||
if(SRB2_CONFIG_ENABLE_DISCORDRPC)
|
||||
target_link_libraries(SRB2SDL2 PRIVATE DiscordRPC::DiscordRPC)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_DISCORDRPC)
|
||||
target_sources(SRB2SDL2 PRIVATE discord.c)
|
||||
endif()
|
||||
|
||||
set(SRB2_HAVE_THREADS ON)
|
||||
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS)
|
||||
|
||||
|
|
|
|||
|
|
@ -130,3 +130,4 @@ k_director.c
|
|||
k_follower.c
|
||||
k_mapuser.c
|
||||
k_stats.c
|
||||
stun.c
|
||||
|
|
|
|||
|
|
@ -255,8 +255,6 @@ static CV_PossibleValue_t sleeping_cons_t[] = {{0, "MIN"}, {1000/TICRATE, "MAX"}
|
|||
|
||||
static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", 0, CV_OnOff, NULL);
|
||||
|
||||
static consvar_t cv_dummyconsvar = CVAR_INIT ("dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, DummyConsvar_OnChange);
|
||||
|
||||
consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "No", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL);
|
||||
|
|
@ -998,7 +996,6 @@ void D_RegisterClientCommands(void)
|
|||
|
||||
// HUD
|
||||
CV_RegisterVar(&cv_itemfinder);
|
||||
CV_RegisterVar(&cv_showinputjoy);
|
||||
|
||||
// time attack ghost options are also saved to config
|
||||
CV_RegisterVar(&cv_ghost_besttime);
|
||||
|
|
|
|||
|
|
@ -623,7 +623,6 @@ struct player_t
|
|||
|
||||
UINT16 sneakertimer; // Duration of a Sneaker Boost (from Sneakers or level boosters)
|
||||
UINT8 floorboost; // (0 to 3) - Prevents Sneaker sounds for a brief duration when triggered by a floor panel
|
||||
boolean waterrun; // Tracks condition of water run
|
||||
|
||||
UINT8 boostcharge; // Charge during race start
|
||||
|
||||
|
|
|
|||
|
|
@ -377,37 +377,12 @@ static int ScanConstants(lua_State *L, boolean mathlib, const char *word)
|
|||
}
|
||||
else if (fastncmp("ML_", word, 3)) {
|
||||
p = word+3;
|
||||
for (i = 0; i < 20; i++)
|
||||
if (ML_LIST[i] && fastcmp(p, ML_LIST[i])) {
|
||||
const char *const *list = lua_compatmode ? ML_LIST_KART : ML_LIST;
|
||||
for (i = 0; list[i]; i++)
|
||||
if (fastcmp(p, list[i])) {
|
||||
CacheAndPushConstant(L, word, ((lua_Integer)1<<i));
|
||||
return 1;
|
||||
}
|
||||
// Aliases
|
||||
if (fastcmp(p, "EFFECT1"))
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)ML_SKEWTD);
|
||||
return 1;
|
||||
}
|
||||
if (fastcmp(p, "EFFECT2"))
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)ML_NOSKEW);
|
||||
return 1;
|
||||
}
|
||||
if (fastcmp(p, "EFFECT3"))
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)ML_MIDPEG);
|
||||
return 1;
|
||||
}
|
||||
if (fastcmp(p, "EFFECT4"))
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)ML_MIDSOLID);
|
||||
return 1;
|
||||
}
|
||||
if (fastcmp(p, "EFFECT5"))
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)ML_WRAPMIDTEX);
|
||||
return 1;
|
||||
}
|
||||
if (mathlib) return luaL_error(L, "linedef flag '%s' could not be found.\n", word);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ const char *const MOBJFLAG2_LIST[] = {
|
|||
"AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH
|
||||
"LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position)
|
||||
"SHIELD", // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use)
|
||||
"WATERRUN", // Mobj is able to run on Water!
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -337,14 +338,31 @@ const char *const ML_LIST[] = {
|
|||
"MIDPEG",
|
||||
"MIDSOLID",
|
||||
"WRAPMIDTEX",
|
||||
"NETONLY",
|
||||
"NONET",
|
||||
"EFFECT6",
|
||||
"NOTBOUNCY",
|
||||
"TFERLINE",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Linedef flags for Kart
|
||||
const char *const ML_LIST_KART[] = {
|
||||
"IMPASSIBLE",
|
||||
"BLOCKMONSTERS",
|
||||
"TWOSIDED",
|
||||
"DONTPEGTOP",
|
||||
"DONTPEGBOTTOM",
|
||||
"EFFECT1",
|
||||
"NOCLIMB",
|
||||
"EFFECT2",
|
||||
"EFFECT3",
|
||||
"EFFECT4",
|
||||
"EFFECT5",
|
||||
"NOSONIC",
|
||||
"NOTAILS",
|
||||
"NOKNUX",
|
||||
"NETONLY",
|
||||
"NETONLY_OLD",
|
||||
"NONET",
|
||||
"BLOCKMONSTERS",
|
||||
"NOTBOUNCY",
|
||||
"BOUNCY",
|
||||
"TFERLINE",
|
||||
NULL
|
||||
};
|
||||
|
|
@ -1074,9 +1092,10 @@ struct int_const_s const INT_CONST[] = {
|
|||
// for P_DamageMobj
|
||||
//// Damage types
|
||||
{"DMG_NORMAL",DMG_NORMAL},
|
||||
{"DMG_SQUISH",DMG_SQUISH},
|
||||
{"DMG_WIPEOUT",DMG_WIPEOUT},
|
||||
{"DMG_EXPLODE",DMG_EXPLODE},
|
||||
{"DMG_SQUISH",DMG_SQUISH},
|
||||
{"DMG_VOLTAGE",DMG_VOLTAGE},
|
||||
{"DMG_KARMA",DMG_KARMA},
|
||||
//// Death types
|
||||
{"DMG_INSTAKILL",DMG_INSTAKILL},
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ extern const char *const PLAYERFLAG_LIST[];
|
|||
extern const char *const ITEMFLAG_LIST[];
|
||||
extern const char *const GAMETYPERULE_LIST[];
|
||||
extern const char *const ML_LIST[]; // Linedef flags
|
||||
extern const char *const ML_LIST_KART[]; // Linedef flags for Kart
|
||||
extern const char *const MSF_LIST[]; // Sector flags
|
||||
extern const char *const SSF_LIST[]; // Sector special flags
|
||||
extern const char *const SD_LIST[]; // Sector damagetype
|
||||
|
|
|
|||
|
|
@ -144,11 +144,6 @@ enum
|
|||
ML_MIDSOLID = 0x00000200,
|
||||
ML_WRAPMIDTEX = 0x00000400,
|
||||
|
||||
// Compat for old lua scripts.
|
||||
ML_NOSONIC = 0x00000800,
|
||||
ML_NOTAILS = 0x00001000,
|
||||
ML_NOKNUX = 0x00002000,
|
||||
|
||||
// Apply effect only in netgames
|
||||
ML_NETONLY = 0x00000800,
|
||||
ML_NETONLY_OLD = 0x00003800, // Combination of old ML_NOSONIC, ML_NOTAILS and ML_NOKNUX
|
||||
|
|
|
|||
|
|
@ -759,7 +759,6 @@ extern boolean singletics;
|
|||
|
||||
#include "d_clisrv.h"
|
||||
|
||||
extern consvar_t cv_showinputjoy; // display joystick in time attack
|
||||
extern consvar_t cv_forceskin; // force clients to use the server's skin
|
||||
extern consvar_t cv_downloading; // allow clients to downloading WADs.
|
||||
extern consvar_t cv_nettimeout; // SRB2Kart: Advanced server options menu
|
||||
|
|
|
|||
|
|
@ -1817,7 +1817,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
|
||||
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
|
||||
continue;
|
||||
if ((udmf && !(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) || (!udmf && rover->fofflags & FOF_INVERTSIDES))
|
||||
if (rover->fofflags & FOF_INVERTSIDES && (mapnamespace == MNS_SRB2KART || !(rover->fofflags & FOF_ALLSIDES)))
|
||||
continue;
|
||||
|
||||
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
|
||||
|
|
@ -1977,7 +1977,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
|
||||
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
|
||||
continue;
|
||||
if ((udmf && !(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) || (!udmf && rover->fofflags & FOF_INVERTSIDES))
|
||||
if (!(rover->fofflags & FOF_ALLSIDES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTSIDES)))
|
||||
continue;
|
||||
|
||||
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
|
||||
|
|
@ -2902,7 +2902,7 @@ static void HWR_Subsector(size_t num)
|
|||
|
||||
if (centerHeight <= locCeilingHeight &&
|
||||
centerHeight >= locFloorHeight &&
|
||||
((dup_viewz < cullHeight && ((udmf && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
((dup_viewz < cullHeight && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
|
||||
{
|
||||
if (rover->fofflags & FOF_FOG)
|
||||
|
|
@ -2950,7 +2950,7 @@ static void HWR_Subsector(size_t num)
|
|||
|
||||
if (centerHeight >= locFloorHeight &&
|
||||
centerHeight <= locCeilingHeight &&
|
||||
((dup_viewz > cullHeight && ((udmf && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
((dup_viewz > cullHeight && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
|
||||
{
|
||||
if (rover->fofflags & FOF_FOG)
|
||||
|
|
|
|||
|
|
@ -2310,12 +2310,31 @@ Ping_gfx_color (int lag)
|
|||
return SKINCOLOR_MAGENTA;
|
||||
}
|
||||
|
||||
static const UINT8 *
|
||||
Ping_gfx_colormap (UINT32 lag, boolean gentleman)
|
||||
{
|
||||
const UINT8 *colormap = NULL;
|
||||
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, Ping_gfx_color(lag), GTC_CACHE);
|
||||
|
||||
if (servermaxping && lag > servermaxping && hu_tick < 4)
|
||||
{
|
||||
// flash ping red if too high
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
|
||||
}
|
||||
else if (gentleman)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PASTEL, GTC_CACHE);
|
||||
}
|
||||
|
||||
return colormap;
|
||||
}
|
||||
|
||||
//
|
||||
// HU_drawPing
|
||||
//
|
||||
void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags, boolean offline)
|
||||
{
|
||||
UINT8 *colormap = NULL;
|
||||
INT32 measureid = cv_pingmeasurement.value ? 1 : 0;
|
||||
INT32 gfxnum; // gfx to draw
|
||||
boolean drawlocal = (offline && cv_mindelay.value && lag <= (tic_t)cv_mindelay.value);
|
||||
|
|
@ -2331,25 +2350,14 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags, boolean offline)
|
|||
if (measureid == 1)
|
||||
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
|
||||
|
||||
if (drawlocal)
|
||||
V_DrawScaledPatch(x+2, y, flags, pinglocal[0]);
|
||||
else
|
||||
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
|
||||
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, Ping_gfx_color(lag), GTC_CACHE);
|
||||
|
||||
if (servermaxping && lag > servermaxping && hu_tick < 4)
|
||||
{
|
||||
// flash ping red if too high
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_WHITE, GTC_CACHE);
|
||||
}
|
||||
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
|
||||
|
||||
if (cv_pingmeasurement.value)
|
||||
{
|
||||
lag = (INT32)(lag * (1000.00f / TICRATE));
|
||||
}
|
||||
|
||||
x = V_DrawPingNum(x + (measureid == 1 ? 11 - pingmeasure[measureid]->width : 10), y+9, flags, lag, colormap);
|
||||
x = V_DrawPingNum(x + (measureid == 1 ? 11 - pingmeasure[measureid]->width : 10), y+9, flags, lag, Ping_gfx_colormap(lag,drawlocal));
|
||||
|
||||
if (measureid == 0)
|
||||
V_DrawScaledPatch(x+1 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
|
||||
|
|
@ -2361,6 +2369,9 @@ HU_drawMiniPing (INT32 x, INT32 y, UINT32 lag, INT32 flags)
|
|||
patch_t *patch;
|
||||
INT32 w = BASEVIDWIDTH;
|
||||
|
||||
// draw new graphics later.
|
||||
return;
|
||||
|
||||
if (r_splitscreen > 1)
|
||||
{
|
||||
w /= 2;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ enum
|
|||
X (TALLNUM),
|
||||
X (NIGHTSNUM),
|
||||
X (PINGNUM),
|
||||
X (OPPRNK),
|
||||
};
|
||||
#undef X
|
||||
|
||||
|
|
|
|||
|
|
@ -3517,12 +3517,6 @@ _(BUBBLESHIELDTRAP5)
|
|||
_(BUBBLESHIELDTRAP6)
|
||||
_(BUBBLESHIELDTRAP7)
|
||||
_(BUBBLESHIELDTRAP8)
|
||||
_(BUBBLESHIELDWAVE1)
|
||||
_(BUBBLESHIELDWAVE2)
|
||||
_(BUBBLESHIELDWAVE3)
|
||||
_(BUBBLESHIELDWAVE4)
|
||||
_(BUBBLESHIELDWAVE5)
|
||||
_(BUBBLESHIELDWAVE6)
|
||||
|
||||
// Flame Shield
|
||||
_(FLAMESHIELD1)
|
||||
|
|
|
|||
154
src/k_collide.c
154
src/k_collide.c
|
|
@ -665,10 +665,13 @@ static inline BlockItReturn_t PIT_ThunderShieldAttack(mobj_t *thing)
|
|||
return BMIT_CONTINUE;
|
||||
}
|
||||
|
||||
if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY))
|
||||
if (thing->type != MT_SPB)
|
||||
{
|
||||
// Not shootable
|
||||
return BMIT_CONTINUE;
|
||||
if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY))
|
||||
{
|
||||
// Not shootable
|
||||
return BMIT_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (thing->player && thing->player->spectator)
|
||||
|
|
@ -691,7 +694,7 @@ static inline BlockItReturn_t PIT_ThunderShieldAttack(mobj_t *thing)
|
|||
}
|
||||
#endif
|
||||
|
||||
P_DamageMobj(thing, lightningSource, lightningSource, 1, DMG_NORMAL|DMG_CANTHURTSELF);
|
||||
P_DamageMobj(thing, lightningSource, lightningSource, 1, DMG_VOLTAGE|DMG_CANTHURTSELF);
|
||||
return BMIT_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
@ -715,82 +718,103 @@ void K_ThunderShieldAttack(mobj_t *actor, fixed_t size)
|
|||
P_BlockThingsIterator(bx, by, PIT_ThunderShieldAttack);
|
||||
}
|
||||
|
||||
boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
|
||||
static void K_BubbleShieldCollideDrain(player_t *player, mobj_t *bubble)
|
||||
{
|
||||
if (t2->type == MT_PLAYER)
|
||||
if (!player)
|
||||
{
|
||||
// Counter desyncs
|
||||
/*mobj_t *oldthing = thing;
|
||||
mobj_t *oldg_tm.thing = g_tm.thing;
|
||||
// Bad reference passed.
|
||||
return;
|
||||
}
|
||||
|
||||
P_Thrust(g_tm.thing, R_PointToAngle2(thing->x, thing->y, g_tm.thing->x, g_tm.thing->y), 4*thing->scale);
|
||||
if (!bubble || P_MobjWasRemoved(bubble) )
|
||||
{
|
||||
// Bad/Stale reference passed.
|
||||
return;
|
||||
}
|
||||
|
||||
thing = oldthing;
|
||||
P_SetTarget(&g_tm.thing, oldg_tm.thing);*/
|
||||
player->bubblepop++;
|
||||
player->bubblecool = 15*4;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
bubble->extravalue1 = 4;
|
||||
bubble->cvmem = 1;
|
||||
|
||||
if (P_PlayerInPain(t2->player)
|
||||
|| t2->player->flashing || t2->player->hyudorotimer
|
||||
|| t2->player->justbumped || t2->scale > t1->scale + (mapobjectscale/8))
|
||||
return true;
|
||||
if (player->bubblepop > 1)
|
||||
{
|
||||
K_DropHnextList(player, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Player Damage
|
||||
P_DamageMobj(t2, ((t1->type == MT_BUBBLESHIELD) ? t1->target : t1), t1, 1, DMG_NORMAL);
|
||||
boolean K_BubbleShieldReflect(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
mobj_t *owner = t1->player ? t1 : t1->target;
|
||||
|
||||
if (t1->target->player)
|
||||
if (t2->target != owner || !t2->threshold || t2->type == MT_DROPTARGET)
|
||||
{
|
||||
if (!t2->momx && !t2->momy)
|
||||
{
|
||||
player_t *player = t1->target->player;
|
||||
|
||||
player->bubblepop++;
|
||||
player->bubblecool = 15*4;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
t1->extravalue1 = 4;
|
||||
t1->cvmem = 1;
|
||||
|
||||
if (player->bubblepop > 1)
|
||||
{
|
||||
K_DropHnextList(player, false);
|
||||
}
|
||||
t2->momz += (24*t2->scale) * P_MobjFlip(t2);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
t2->momx = -6*t2->momx;
|
||||
t2->momy = -6*t2->momy;
|
||||
t2->momz = -6*t2->momz;
|
||||
t2->angle += ANGLE_180;
|
||||
}
|
||||
if (t2->type == MT_JAWZ)
|
||||
P_SetTarget(&t2->tracer, t2->target); // Back to the source!
|
||||
P_SetTarget(&t2->target, owner); // Let the source reflect it back again!
|
||||
t2->threshold = 10;
|
||||
S_StartSound(t1, sfx_s3k44);
|
||||
}
|
||||
else
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean K_BubbleShieldCanReflect(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
return (t2->type == MT_ORBINAUT || t2->type == MT_JAWZ
|
||||
|| t2->type == MT_BANANA || t2->type == MT_EGGMANITEM || t2->type == MT_BALLHOG
|
||||
|| t2->type == MT_SSMINE || t2->type == MT_LANDMINE || t2->type == MT_SINK
|
||||
|| t2->type == MT_DROPTARGET
|
||||
|| t2->type == MT_KART_LEFTOVER
|
||||
|| (t2->type == MT_PLAYER && t1->target != t2));
|
||||
}
|
||||
|
||||
boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
if (t1->type == MT_PLAYER)
|
||||
return true;
|
||||
|
||||
if (t1->target == t2)
|
||||
return true;
|
||||
|
||||
if (t2->type == MT_PLAYER)
|
||||
{
|
||||
// Player Damage
|
||||
if (K_KartBouncing(t2, t1->target, false, true))
|
||||
{
|
||||
P_DamageMobj(t2, t1->target, t1, 1, DMG_NORMAL);
|
||||
K_BubbleShieldCollideDrain(t1->target->player, t1);
|
||||
S_StartSound(t2, sfx_s3k44);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (K_BubbleShieldCanReflect(t1, t2))
|
||||
{
|
||||
if (!t2->threshold)
|
||||
{
|
||||
if (!t2->momx && !t2->momy)
|
||||
{
|
||||
t2->momz += (24*t2->scale) * P_MobjFlip(t2);
|
||||
}
|
||||
else
|
||||
{
|
||||
t2->momx = -4*t2->momx;
|
||||
t2->momy = -4*t2->momy;
|
||||
t2->momz = -4*t2->momz;
|
||||
t2->angle += ANGLE_180;
|
||||
}
|
||||
if (t2->type == MT_JAWZ)
|
||||
P_SetTarget(&t2->tracer, t2->target); // Back to the source!
|
||||
|
||||
if (t1->target->player)
|
||||
{
|
||||
player_t *player = t1->target->player;
|
||||
|
||||
player->bubblepop++;
|
||||
player->bubblecool = 15*4;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
t1->extravalue1 = 4;
|
||||
t1->cvmem = 1;
|
||||
|
||||
if (player->bubblepop > 1)
|
||||
{
|
||||
K_DropHnextList(player, false);
|
||||
}
|
||||
}
|
||||
|
||||
t2->threshold = 20;
|
||||
S_StartSound(t1, sfx_s3k44);
|
||||
// Drain my stuff please.
|
||||
K_BubbleShieldCollideDrain(t1->target->player, t1);
|
||||
}
|
||||
return K_BubbleShieldReflect(t1, t2);
|
||||
}
|
||||
|
||||
if (t2->flags & MF_SHOOTABLE)
|
||||
{
|
||||
P_DamageMobj(t2, t1, t1->target, 1, DMG_NORMAL);
|
||||
}
|
||||
|
||||
// no interaction
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ boolean K_LandMineCollide(mobj_t *t1, mobj_t *t2);
|
|||
boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2);
|
||||
|
||||
void K_ThunderShieldAttack(mobj_t *actor, fixed_t size);
|
||||
|
||||
boolean K_BubbleShieldReflect(mobj_t *t1, mobj_t *t2);
|
||||
boolean K_BubbleShieldCanReflect(mobj_t *t1, mobj_t *t2);
|
||||
boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2);
|
||||
|
||||
boolean K_KitchenSinkCollide(mobj_t *t1, mobj_t *t2);
|
||||
|
|
|
|||
402
src/k_hud.c
402
src/k_hud.c
|
|
@ -47,10 +47,13 @@
|
|||
static CV_PossibleValue_t speedo_cons_t[]= {
|
||||
{0, "Default"},
|
||||
{1, "Small"},
|
||||
//{2, "P-Meter"}, Readded later need to draw smaller sprites.
|
||||
{0, NULL}};
|
||||
consvar_t cv_newspeedometer = CVAR_INIT ("newspeedometer", "Default", CV_SAVE, speedo_cons_t, NULL);
|
||||
|
||||
consvar_t cv_showinput = CVAR_INIT ("showinput", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||
static CV_PossibleValue_t inputdisplay_cons_t[] = {{0, "Off"}, {1, "Wheel"}, {2, "Stick"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_showinput = CVAR_INIT ("showinput", "Off", CV_SAVE, inputdisplay_cons_t, NULL);
|
||||
|
||||
//{ Patch Definitions
|
||||
static patch_t *kp_nodraw;
|
||||
|
|
@ -87,6 +90,7 @@ static patch_t *kp_ringdebtminussmall;
|
|||
|
||||
static patch_t *kp_speedometersticker;
|
||||
static patch_t *kp_speedometerlabel[4];
|
||||
static patch_t *kp_kartzspeedo[25];
|
||||
|
||||
static patch_t *kp_rankbumper;
|
||||
static patch_t *kp_tinybumper[2];
|
||||
|
|
@ -133,17 +137,8 @@ static patch_t *kp_sadface[2];
|
|||
|
||||
static patch_t *kp_check[6];
|
||||
|
||||
static patch_t *kp_rival[2];
|
||||
static patch_t *kp_localtag[4][2];
|
||||
|
||||
static patch_t *kp_talk;
|
||||
static patch_t *kp_typdot;
|
||||
|
||||
static patch_t *kp_eggnum[4];
|
||||
|
||||
static patch_t *kp_flameshieldmeter[104][2];
|
||||
static patch_t *kp_flameshieldmeter_bg[16][2];
|
||||
|
||||
static patch_t *kp_fpview[3];
|
||||
static patch_t *kp_inputwheel[5];
|
||||
|
||||
|
|
@ -157,13 +152,6 @@ static patch_t *kp_lapanim_hand[3];
|
|||
|
||||
static patch_t *kp_yougotem;
|
||||
|
||||
static patch_t *kp_alagles[10];
|
||||
static patch_t *kp_blagles[6];
|
||||
|
||||
static patch_t *kp_cpu;
|
||||
|
||||
static patch_t *kp_nametagstem;
|
||||
|
||||
static patch_t *kp_bossbar[8];
|
||||
static patch_t *kp_bossret[4];
|
||||
|
||||
|
|
@ -269,15 +257,29 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_ringdebtminussmall, "K_RNGSM");
|
||||
|
||||
// Speedometer
|
||||
HU_UpdatePatch(&kp_speedometersticker, "K_SPDMBG");
|
||||
HU_UpdatePatch(&kp_speedometersticker, "SP_SMSTC");
|
||||
|
||||
HU_UpdatePatch(&kp_speedometerlabel[0], "SP_MKMH");
|
||||
HU_UpdatePatch(&kp_speedometerlabel[1], "SP_MMPH");
|
||||
HU_UpdatePatch(&kp_speedometerlabel[2], "SP_MFRAC");
|
||||
HU_UpdatePatch(&kp_speedometerlabel[3], "SP_MPERC");
|
||||
|
||||
sprintf(buffer, "K_SPDMLx");
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
buffer[7] = '0'+(i+1);
|
||||
HU_UpdatePatch(&kp_speedometerlabel[i], "%s", buffer);
|
||||
const char* patchNames[] = {
|
||||
"K_KZSP1", "K_KZSP2", "K_KZSP3", "K_KZSP4", "K_KZSP5",
|
||||
"K_KZSP6", "K_KZSP7", "K_KZSP8", "K_KZSP9", "K_KZSP10",
|
||||
"K_KZSP11", "K_KZSP12", "K_KZSP13", "K_KZSP14", "K_KZSP15",
|
||||
"K_KZSP16", "K_KZSP17", "K_KZSP18", "K_KZSP19", "K_KZSP20",
|
||||
"K_KZSP21", "K_KZSP22", "K_KZSP23", "K_KZSP24", "K_KZSP25"
|
||||
};
|
||||
|
||||
for (size_t m = 0; m < sizeof(patchNames) / sizeof(patchNames[0]); ++m)
|
||||
{
|
||||
kp_kartzspeedo[m] = W_CachePatchName(patchNames[m], PU_HUDGFX);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Extra ranking icons
|
||||
HU_UpdatePatch(&kp_rankbumper, "K_BLNICO");
|
||||
HU_UpdatePatch(&kp_tinybumper[0], "K_BLNA");
|
||||
|
|
@ -342,23 +344,6 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_kitchensink[0], "K_ITSINK");
|
||||
HU_UpdatePatch(&kp_sadface[0], "K_ITSAD");
|
||||
|
||||
sprintf(buffer, "FSMFGxxx");
|
||||
for (i = 0; i < 104; i++)
|
||||
{
|
||||
buffer[5] = '0'+((i+1)/100);
|
||||
buffer[6] = '0'+(((i+1)/10)%10);
|
||||
buffer[7] = '0'+((i+1)%10);
|
||||
HU_UpdatePatch(&kp_flameshieldmeter[i][0], "%s", buffer);
|
||||
}
|
||||
|
||||
sprintf(buffer, "FSMBG0xx");
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
buffer[6] = '0'+((i+1)/10);
|
||||
buffer[7] = '0'+((i+1)%10);
|
||||
HU_UpdatePatch(&kp_flameshieldmeter_bg[i][0], "%s", buffer);
|
||||
}
|
||||
|
||||
// Splitscreen
|
||||
HU_UpdatePatch(&kp_itembg[2], "K_ISBG");
|
||||
HU_UpdatePatch(&kp_itembg[3], "K_ISBGD");
|
||||
|
|
@ -393,23 +378,6 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_kitchensink[1], "K_ISSINK");
|
||||
HU_UpdatePatch(&kp_sadface[1], "K_ISSAD");
|
||||
|
||||
sprintf(buffer, "FSMFSxxx");
|
||||
for (i = 0; i < 104; i++)
|
||||
{
|
||||
buffer[5] = '0'+((i+1)/100);
|
||||
buffer[6] = '0'+(((i+1)/10)%10);
|
||||
buffer[7] = '0'+((i+1)%10);
|
||||
HU_UpdatePatch(&kp_flameshieldmeter[i][1], "%s", buffer);
|
||||
}
|
||||
|
||||
sprintf(buffer, "FSMBS0xx");
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
buffer[6] = '0'+((i+1)/10);
|
||||
buffer[7] = '0'+((i+1)%10);
|
||||
HU_UpdatePatch(&kp_flameshieldmeter_bg[i][1], "%s", buffer);
|
||||
}
|
||||
|
||||
// CHECK indicators
|
||||
sprintf(buffer, "K_CHECKx");
|
||||
for (i = 0; i < 6; i++)
|
||||
|
|
@ -418,30 +386,6 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_check[i], "%s", buffer);
|
||||
}
|
||||
|
||||
// Rival indicators
|
||||
sprintf(buffer, "K_RIVALx");
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
buffer[7] = '1'+i;
|
||||
HU_UpdatePatch(&kp_rival[i], "%s", buffer);
|
||||
}
|
||||
|
||||
// Rival indicators
|
||||
sprintf(buffer, "K_SSPLxx");
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
buffer[6] = 'A'+i;
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
buffer[7] = '1'+j;
|
||||
HU_UpdatePatch(&kp_localtag[i][j], "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
// Typing indicator
|
||||
HU_UpdatePatch(&kp_talk, "K_TALK");
|
||||
HU_UpdatePatch(&kp_typdot, "K_TYPDOT");
|
||||
|
||||
// Eggman warning numbers
|
||||
sprintf(buffer, "K_EGGNx");
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
@ -515,24 +459,6 @@ void K_LoadKartHUDGraphics(void)
|
|||
|
||||
HU_UpdatePatch(&kp_yougotem, "YOUGOTEM");
|
||||
|
||||
sprintf(buffer, "ALAGLESx");
|
||||
for (i = 0; i < 10; ++i)
|
||||
{
|
||||
buffer[7] = '0'+i;
|
||||
HU_UpdatePatch(&kp_alagles[i], "%s", buffer);
|
||||
}
|
||||
|
||||
sprintf(buffer, "BLAGLESx");
|
||||
for (i = 0; i < 6; ++i)
|
||||
{
|
||||
buffer[7] = '0'+i;
|
||||
HU_UpdatePatch(&kp_blagles[i], "%s", buffer);
|
||||
}
|
||||
|
||||
HU_UpdatePatch(&kp_cpu, "K_CPU");
|
||||
|
||||
HU_UpdatePatch(&kp_nametagstem, "K_NAMEST");
|
||||
|
||||
sprintf(buffer, "K_BOSB0x");
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
|
|
@ -921,6 +847,8 @@ static void K_drawKartItem(void)
|
|||
INT32 numberdisplaymin = 2;
|
||||
INT32 itembar = 0;
|
||||
INT32 maxl = 0; // itembar's normal highest value
|
||||
INT32 flamebar = 0;
|
||||
INT32 flamemaxl = 0; // flamebar's normal highest value
|
||||
const INT32 barlength = (r_splitscreen > 1 ? 12 : 26);
|
||||
UINT16 localcolor = SKINCOLOR_NONE;
|
||||
SINT8 colormode = TC_RAINBOW;
|
||||
|
|
@ -993,8 +921,16 @@ static void K_drawKartItem(void)
|
|||
{
|
||||
itembar = stplyr->flametimer;
|
||||
maxl = (itemtime*3) - barlength;
|
||||
flamebar = stplyr->flamestore;
|
||||
flamemaxl = FLAMESTOREMAX;
|
||||
localbg = kp_itembg[offset+1];
|
||||
|
||||
if ((stplyr->flamestore >= FLAMESTOREMAX-1) && (leveltime & 1))
|
||||
{
|
||||
colormode = TC_BLINK;
|
||||
localcolor = SKINCOLOR_WHITE;
|
||||
}
|
||||
|
||||
if (leveltime & 1)
|
||||
localpatch = kp_flameshield[offset];
|
||||
else
|
||||
|
|
@ -1173,6 +1109,26 @@ static void K_drawKartItem(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (flamebar)
|
||||
{
|
||||
const INT32 fill = ((flamebar*barlength)/flamemaxl);
|
||||
const INT32 length = min(barlength, fill);
|
||||
const INT32 height = (offset ? 1 : 2);
|
||||
const INT32 x = (offset ? 17 : 11), y = (offset ? 27 : 35);
|
||||
|
||||
V_DrawScaledPatch(fx+x, fy+y-8, V_HUDTRANS|fflags, kp_itemtimer[offset]);
|
||||
// The left dark "AA" edge
|
||||
V_DrawFill(fx+x+1, fy+y+1-8, (length == 2 ? 2 : 1), height, 55|fflags);
|
||||
// The bar itself
|
||||
if (length > 2)
|
||||
{
|
||||
V_DrawFill(fx+x+length, fy+y+1-8, 1, height, 55|fflags); // the right one
|
||||
if (height == 2)
|
||||
V_DrawFill(fx+x+2, fy+y+2-8, length-2, 1, 36|fflags); // the dulled underside
|
||||
V_DrawFill(fx+x+2, fy+y+1-8, length-2, 1, 51|fflags); // the shine
|
||||
}
|
||||
}
|
||||
|
||||
// Quick Eggman numbers
|
||||
if (stplyr->eggmanexplode > 1)
|
||||
V_DrawScaledPatch(fx+17, fy+13-offset, V_HUDTRANS|fflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->eggmanexplode))]);
|
||||
|
|
@ -1359,7 +1315,7 @@ static void K_DrawKartPositionNum(INT32 num)
|
|||
fixed_t scale = FRACUNIT;
|
||||
patch_t *localpatch = kp_positionnum[0][0];
|
||||
INT32 fx = 0, fy = 0, fflags = 0;
|
||||
INT32 xoffs = (cv_showinput.value) ? -48 : 0;
|
||||
INT32 xoffs = (cv_showinput.value > 0) ? -48 : 0;
|
||||
INT32 addOrSub = V_ADD;
|
||||
boolean flipdraw = false; // flip the order we draw it in for MORE splitscreen bs. fun.
|
||||
boolean flipvdraw = false; // used only for 2p splitscreen so overtaking doesn't make 1P's position fly off the screen.
|
||||
|
|
@ -1376,7 +1332,7 @@ static void K_DrawKartPositionNum(INT32 num)
|
|||
overtake = true; // this is used for splitscreen stuff in conjunction with flipdraw.
|
||||
}
|
||||
|
||||
if (r_splitscreen || (cv_showinput.value && !r_splitscreen))
|
||||
if (r_splitscreen || ((cv_showinput.value > 0) && !r_splitscreen))
|
||||
scale /= 2;
|
||||
|
||||
W = FixedMul(W<<FRACBITS, scale)>>FRACBITS;
|
||||
|
|
@ -1758,7 +1714,6 @@ static void K_drawBossHealthBar(void)
|
|||
//
|
||||
void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol)
|
||||
{
|
||||
static tic_t alagles_timer = 9;
|
||||
INT32 i, rightoffset = 240;
|
||||
const UINT8 *colormap;
|
||||
INT32 dupadjust = (vid.width/vid.dupx), duptweak = (dupadjust - BASEVIDWIDTH)/2;
|
||||
|
|
@ -1794,7 +1749,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
|
|||
{
|
||||
if (players[tab[i].num].bot)
|
||||
{
|
||||
V_DrawScaledPatch(x + ((i < 8) ? -25 : rightoffset + 3), y-2, 0, kp_cpu);
|
||||
V_DrawString(x + ((i < 8) ? -25 : rightoffset + 3), y-2, V_SNAPTOLEFT, "CPU");
|
||||
}
|
||||
else if (tab[i].num != serverplayer || !server_lagless)
|
||||
{
|
||||
|
|
@ -1806,28 +1761,6 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
|
|||
|
||||
y2 = y;
|
||||
|
||||
if (netgame && playerconsole[tab[i].num] == 0 && server_lagless && !players[tab[i].num].bot)
|
||||
{
|
||||
y2 = ( y - 4 );
|
||||
|
||||
V_DrawScaledPatch(x + 20, y2, 0, kp_blagles[(leveltime / 3) % 6]);
|
||||
// every 70 tics
|
||||
if (( leveltime % 70 ) == 0)
|
||||
{
|
||||
alagles_timer = 9;
|
||||
}
|
||||
if (alagles_timer > 0)
|
||||
{
|
||||
V_DrawScaledPatch(x + 20, y2, 0, kp_alagles[alagles_timer]);
|
||||
if (( leveltime % 2 ) == 0)
|
||||
alagles_timer--;
|
||||
}
|
||||
else
|
||||
V_DrawScaledPatch(x + 20, y2, 0, kp_alagles[0]);
|
||||
|
||||
y2 += SHORT (kp_alagles[0]->height) + 1;
|
||||
}
|
||||
|
||||
if (scorelines >= 8)
|
||||
V_DrawThinString(x + 20, y2, ((tab[i].num == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime);
|
||||
else
|
||||
|
|
@ -1962,7 +1895,7 @@ static void K_drawKartLaps(void)
|
|||
}
|
||||
|
||||
// Lives
|
||||
if (uselives)
|
||||
if (LUA_HudEnabled(hud_lives) && uselives)
|
||||
{
|
||||
UINT8 *colormap = R_GetTranslationColormap(stplyr->skin, stplyr->skincolor, GTC_CACHE);
|
||||
V_DrawMappedPatch(fr+21, fy-13, V_HUDTRANS|splitflags, faceprefix[stplyr->skin][FACE_MINIMAP], colormap);
|
||||
|
|
@ -2063,20 +1996,20 @@ static void K_drawKartSpeedometer(void)
|
|||
{
|
||||
case 1: // Kilometers
|
||||
convSpeed = FixedDiv(FixedMul(stplyr->speed, 142371), mapobjectscale) / FRACUNIT; // 2.172409058
|
||||
labeln = 1;
|
||||
labeln = 0;
|
||||
break;
|
||||
case 2: // Miles
|
||||
convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapobjectscale) / FRACUNIT; // 1.349868774
|
||||
labeln = 2;
|
||||
labeln = 1;
|
||||
break;
|
||||
case 3: // Fracunits
|
||||
convSpeed = FixedDiv(stplyr->speed, mapobjectscale) / FRACUNIT; // 1.0. duh.
|
||||
labeln = 3;
|
||||
labeln = 2;
|
||||
break;
|
||||
case 4: // Sonic Drift 2 style percentage
|
||||
if (stplyr->mo)
|
||||
convSpeed = (FixedDiv(stplyr->speed, FixedMul(K_GetKartSpeed(stplyr, false, false), ORIG_FRICTION))*100)>>FRACBITS;
|
||||
labeln = 0;
|
||||
labeln = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -2106,13 +2039,13 @@ static void K_drawKartSpeedometer(void)
|
|||
V_DrawKartString(LAPS_X, LAPS_Y-18 + battleoffset + ringoffset, V_HUDTRANS|splitflags, va("%3d fu/t", convSpeed));
|
||||
break;
|
||||
case 4:
|
||||
V_DrawKartString(LAPS_X, LAPS_Y-18 + battleoffset + ringoffset, V_HUDTRANS|splitflags, va("%4d P", convSpeed));
|
||||
V_DrawKartString(LAPS_X, LAPS_Y-18 + battleoffset + ringoffset, V_HUDTRANS|splitflags, va("%4d %%", convSpeed));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (cv_newspeedometer.value == 1)
|
||||
{
|
||||
numbers[0] = ((convSpeed / 100) % 10);
|
||||
numbers[1] = ((convSpeed / 10) % 10);
|
||||
|
|
@ -2124,6 +2057,32 @@ static void K_drawKartSpeedometer(void)
|
|||
V_DrawScaledPatch(LAPS_X+19, LAPS_Y-9 + battleoffset + ringoffset, V_HUDTRANS|splitflags, kp_facenum[numbers[2]]);
|
||||
V_DrawScaledPatch(LAPS_X+29, LAPS_Y-9 + battleoffset + ringoffset, V_HUDTRANS|splitflags, kp_speedometerlabel[labeln]);
|
||||
}
|
||||
// Readded later need to draw smaller graphics.
|
||||
/*else if (cv_newspeedometer.value == 2)
|
||||
{
|
||||
fixed_t fuspeed = FixedDiv(stplyr->speed, mapobjectscale)/FRACUNIT;
|
||||
INT32 spdpatch = 0;
|
||||
|
||||
#define NUM_INTERVALS 22
|
||||
const int speedIntervals[NUM_INTERVALS] = {2, 5, 7, 10, 12, 15, 17, 20, 22, 25, 27, 30, 32, 35, 37, 40, 42, 45, 47, 50, 52, 55};
|
||||
|
||||
for (int i = 0; i < NUM_INTERVALS; ++i)
|
||||
{
|
||||
if (fuspeed < speedIntervals[i])
|
||||
{
|
||||
spdpatch = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#undef NUM_INTERVALS
|
||||
|
||||
if (((fuspeed < 57 && fuspeed > 54) || (fuspeed < 60 && fuspeed > 56) || (fuspeed > 59)) && (leveltime & 4))
|
||||
spdpatch = 24;
|
||||
else if (((fuspeed < 57 && fuspeed > 54) || (fuspeed < 60 && fuspeed > 56) || (fuspeed > 59)) && !(leveltime & 4))
|
||||
spdpatch = 23;
|
||||
|
||||
V_DrawScaledPatch(LAPS_X, LAPS_Y-18 + battleoffset + ringoffset, V_HUDTRANS|splitflags, kp_kartzspeedo[spdpatch]);
|
||||
}*/
|
||||
|
||||
K_drawKartAccessibilityIcons(56);
|
||||
}
|
||||
|
|
@ -2131,7 +2090,6 @@ static void K_drawKartSpeedometer(void)
|
|||
static void K_drawRingMeter(void)
|
||||
{
|
||||
UINT8 rn[2];
|
||||
INT32 ringflip = 0;
|
||||
UINT8 *ringmap = NULL;
|
||||
boolean colorring = false;
|
||||
INT32 splitflags = V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_HUDTRANS|V_SPLITSCREEN;
|
||||
|
|
@ -2176,7 +2134,7 @@ static void K_drawRingMeter(void)
|
|||
|
||||
fr = fx;
|
||||
|
||||
V_DrawMappedPatch(fr, fy-10, V_HUDTRANS|splitflags|ringflip, kp_ringsplitscreen, (colorring ? ringmap : NULL));
|
||||
V_DrawMappedPatch(fr, fy-10, V_HUDTRANS|splitflags, kp_ringsplitscreen, (colorring ? ringmap : NULL));
|
||||
|
||||
if (stplyr->rings < 0) // Draw the minus for ring debt
|
||||
V_DrawMappedPatch(fr+7, fy-8, V_HUDTRANS|splitflags, kp_ringdebtminussmall, ringmap);
|
||||
|
|
@ -2552,35 +2510,42 @@ static boolean K_ShowPlayerNametag(player_t *p)
|
|||
|
||||
static void K_DrawLocalTagForPlayer(fixed_t x, fixed_t y, player_t *p, UINT8 id)
|
||||
{
|
||||
UINT8 blink = ((leveltime / 7) & 1);
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE);
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, V_HUDTRANS|V_SPLITSCREEN, kp_localtag[id][blink], colormap);
|
||||
UINT16 chatcolor = skincolors[p->skincolor].chatcolor;
|
||||
char letters[4] = {'A', 'B', 'C', 'D'};
|
||||
|
||||
V_DrawCenteredSmallStringAtFixed(x, y, V_HUDTRANS|V_ALLOWLOWERCASE|V_SPLITSCREEN|chatcolor, va("%c\nv", letters[id]));
|
||||
}
|
||||
|
||||
static void K_DrawRivalTagForPlayer(fixed_t x, fixed_t y)
|
||||
{
|
||||
UINT8 blink = ((leveltime / 7) & 1);
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, V_HUDTRANS|V_SPLITSCREEN, kp_rival[blink], NULL);
|
||||
UINT16 chatcolor = skincolors[SKINCOLOR_ORANGE].chatcolor;
|
||||
|
||||
V_DrawCenteredSmallStringAtFixed(x, y, V_HUDTRANS|V_ALLOWLOWERCASE|V_SPLITSCREEN|chatcolor, "Rival\nv");
|
||||
}
|
||||
|
||||
static void K_DrawTypingDot(fixed_t x, fixed_t y, UINT8 duration, player_t *p)
|
||||
static const char *K_StringTypingDot(player_t *p)
|
||||
{
|
||||
if (p->typing_duration > duration)
|
||||
if (p->typing_duration > 47)
|
||||
{
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, V_HUDTRANS|V_SPLITSCREEN, kp_typdot, NULL);
|
||||
return "...";
|
||||
}
|
||||
else if (p->typing_duration > 31)
|
||||
{
|
||||
return "..";
|
||||
}
|
||||
else if (p->typing_duration > 15)
|
||||
{
|
||||
return ".";
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static void K_DrawTypingNotifier(fixed_t x, fixed_t y, player_t *p)
|
||||
{
|
||||
if (p->cmd.flags & TICCMD_TYPING)
|
||||
{
|
||||
V_DrawFixedPatch(x, y, FRACUNIT,V_SPLITSCREEN, kp_talk, NULL);
|
||||
|
||||
/* spacing closer with the last two looks a better most of the time */
|
||||
K_DrawTypingDot(x + 3*FRACUNIT, y, 15, p);
|
||||
K_DrawTypingDot(x + 6*FRACUNIT - FRACUNIT/3, y, 31, p);
|
||||
K_DrawTypingDot(x + 9*FRACUNIT - FRACUNIT/3, y, 47, p);
|
||||
V_DrawCenteredSmallStringAtFixed(x, y, V_SPLITSCREEN, va("Typing%s",K_StringTypingDot(p)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2634,13 +2599,13 @@ static void K_DrawNameTagForPlayer(fixed_t x, fixed_t y, player_t *p)
|
|||
fixed_t stemx;
|
||||
fixed_t stemy;
|
||||
int j;
|
||||
boolean flipcam = (p->pflags & PF_FLIPCAM) && (p->mo->eflags & MFE_VERTICALFLIP);
|
||||
/*boolean flipcam = (p->pflags & PF_FLIPCAM) && (p->mo->eflags & MFE_VERTICALFLIP);
|
||||
boolean flipped;
|
||||
|
||||
if (flipcam)
|
||||
flipped = (p->mo->eflags & MFE_VERTICALFLIP) != (stplyr->mo->eflags & MFE_VERTICALFLIP);
|
||||
else
|
||||
flipped = p->mo->eflags & MFE_VERTICALFLIP;
|
||||
flipped = p->mo->eflags & MFE_VERTICALFLIP;*/
|
||||
stemx = (x * vid.dupx) / FRACUNIT;
|
||||
stemy = (y * vid.dupy) / FRACUNIT;
|
||||
|
||||
|
|
@ -2667,7 +2632,6 @@ static void K_DrawNameTagForPlayer(fixed_t x, fixed_t y, player_t *p)
|
|||
V_DrawFill(barx, bary + vid.dupy, barw, vid.dupy, (colormap ? colormap[0] : 0)|V_NOSCALESTART);
|
||||
V_DrawFill(stemx+vid.dupx, stemy+vid.dupy, barw - vid.dupx*3, vid.dupy, (colormap ? colormap[0] : 0)|V_NOSCALESTART);
|
||||
}
|
||||
//V_DrawFixedPatch(x, y, FRACUNIT, 0, kp_nametagstem, colormap);
|
||||
// END DRAWFILL DUMBNESS
|
||||
|
||||
|
||||
|
|
@ -3027,8 +2991,8 @@ static void K_drawKartMinimapNametag(fixed_t objx, fixed_t objy, INT32 hudx, INT
|
|||
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
char color_prefix[2];
|
||||
UINT8 skin = 0;
|
||||
UINT16 chatcolor = skincolors[player->mo->color].chatcolor;
|
||||
|
||||
amnumxpos = (FixedMul(objx, minimapinfo.zoom) - minimapinfo.offs_x);
|
||||
amnumypos = -(FixedMul(objy, minimapinfo.zoom) - minimapinfo.offs_y);
|
||||
|
|
@ -3041,21 +3005,8 @@ static void K_drawKartMinimapNametag(fixed_t objx, fixed_t objy, INT32 hudx, INT
|
|||
amxpos = amnumxpos + ((hudx + (SHORT(minimapinfo.minimap_pic->width)-SHORT(faceprefix[skin][FACE_MINIMAP]->width))/2)<<FRACBITS);
|
||||
amypos = amnumypos + ((hudy + (SHORT(minimapinfo.minimap_pic->height)-SHORT(faceprefix[skin][FACE_MINIMAP]->height))/2)<<FRACBITS);
|
||||
|
||||
{
|
||||
UINT16 chatcolor = skincolors[player->mo->color].chatcolor;
|
||||
if (chatcolor > V_TANMAP)
|
||||
{
|
||||
sprintf(color_prefix, "%c", '\x80');
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(color_prefix, "%c", '\x80' + (chatcolor >> V_CHARCOLORSHIFT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const char *player_name = va("%s%s", color_prefix, player_names[player - players]);
|
||||
V_DrawCenteredSmallStringAtFixed(amxpos + (4*FRACUNIT), amypos - (3*FRACUNIT), V_ALLOWLOWERCASE|flags, player_name);
|
||||
const char *player_name = va("%s",player_names[player - players]);
|
||||
V_DrawCenteredSmallStringAtFixed(amxpos + (4*FRACUNIT), amypos - (3*FRACUNIT), V_ALLOWLOWERCASE|flags|chatcolor, player_name);
|
||||
}
|
||||
|
||||
static void K_drawKartMinimapDot(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, UINT8 color, UINT8 size)
|
||||
|
|
@ -3285,6 +3236,12 @@ static void K_drawKartMinimap(void)
|
|||
|
||||
K_drawKartMinimapIcon(interpx, interpy, x, y, splitflags, workingPic, colormap);
|
||||
|
||||
if (mobj->player)
|
||||
{
|
||||
// Draw the Nametag
|
||||
K_drawKartMinimapNametag(interpx, interpy, x, y, splitflags, &players[i]);
|
||||
}
|
||||
|
||||
// Target reticule
|
||||
if ((gametype == GT_RACE && players[i].position == spbplace)
|
||||
|| (gametype == GT_BATTLE && K_IsPlayerWanted(&players[i])))
|
||||
|
|
@ -3511,10 +3468,11 @@ static void K_drawKartStartCountdown(void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (numplayers == 2)
|
||||
// Re-enable when graphics are drawn up for this.
|
||||
/*if (numplayers == 2)
|
||||
{
|
||||
pnum++; // DUEL
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if ((leveltime % (2*5)) / 5) // blink
|
||||
|
|
@ -3841,7 +3799,7 @@ static void K_drawInput(void)
|
|||
#define BUTTH 11
|
||||
|
||||
#define drawbutt(xoffs, butt, symb)\
|
||||
if (!stplyr->exiting && (K_GetKartButtons(stplyr) & butt))\
|
||||
if ((K_GetKartButtons(stplyr) & butt))\
|
||||
{\
|
||||
offs = 2*FRACUNIT;\
|
||||
col = accent1;\
|
||||
|
|
@ -3867,44 +3825,78 @@ static void K_drawInput(void)
|
|||
|
||||
y -= FRACUNIT;
|
||||
|
||||
if (stplyr->exiting || !stplyr->cmd.turning) // no turn
|
||||
target = 0;
|
||||
else // turning of multiple strengths!
|
||||
if (cv_showinput.value == 2)
|
||||
{
|
||||
target = ((abs(stplyr->cmd.turning) - 1)/125)+1;
|
||||
if (target > 4)
|
||||
target = 4;
|
||||
if (stplyr->cmd.turning < 0)
|
||||
target = -target;
|
||||
INT32 joyx, joyxoffs, joyy, joyyoffs;
|
||||
joyxoffs = -8, joyyoffs = -24;
|
||||
joyx = x>>FRACBITS, joyy = y>>FRACBITS;
|
||||
|
||||
// O backing
|
||||
V_DrawFill(joyx+joyxoffs, joyy+joyyoffs-1, 16, 16, splitflags|accent2);
|
||||
V_DrawFill(joyx+joyxoffs, joyy+joyyoffs+15, 16, 1, splitflags|splitflags|31);
|
||||
|
||||
if (stplyr->cmd.turning || stplyr->cmd.throwdir)
|
||||
{
|
||||
INT16 turning = encoremode ? -stplyr->cmd.turning : stplyr->cmd.turning;
|
||||
// joystick hole
|
||||
V_DrawFill(joyx+joyxoffs+5, joyy+joyyoffs+4, 6, 6, splitflags|accent1);
|
||||
// joystick top and back
|
||||
V_DrawFill(joyx+joyxoffs+3-turning/80,
|
||||
joyy+joyyoffs+2-stplyr->cmd.throwdir/80,
|
||||
10, 10, splitflags|31);
|
||||
V_DrawFill(joyx+joyxoffs+3-turning/64,
|
||||
joyy+joyyoffs+1-stplyr->cmd.throwdir/64,
|
||||
10, 10, splitflags|accent1);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawFill(joyx+joyxoffs+3, joyy+joyyoffs+11, 10, 1, splitflags|accent2);
|
||||
V_DrawFill(joyx+joyxoffs+3,
|
||||
joyy+joyyoffs+1,
|
||||
10, 10,splitflags|accent1);
|
||||
}
|
||||
}
|
||||
|
||||
if (pn != target)
|
||||
{
|
||||
if (abs(pn - target) == 1)
|
||||
pn = target;
|
||||
else if (pn < target)
|
||||
pn += 2;
|
||||
else //if (pn > target)
|
||||
pn -= 2;
|
||||
}
|
||||
|
||||
if (pn < 0)
|
||||
{
|
||||
splitflags |= V_FLIP; // right turn
|
||||
x -= FRACUNIT;
|
||||
}
|
||||
|
||||
target = abs(pn);
|
||||
if (target > 4)
|
||||
target = 4;
|
||||
|
||||
if (!stplyr->skincolor)
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], NULL);
|
||||
else
|
||||
{
|
||||
UINT8 *colormap;
|
||||
colormap = R_GetTranslationColormap(0, stplyr->skincolor, GTC_CACHE);
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], colormap);
|
||||
if (!stplyr->cmd.turning) // no turn
|
||||
target = 0;
|
||||
else // turning of multiple strengths!
|
||||
{
|
||||
target = ((abs(stplyr->cmd.turning) - 1)/125)+1;
|
||||
if (target > 4)
|
||||
target = 4;
|
||||
if (stplyr->cmd.turning < 0)
|
||||
target = -target;
|
||||
}
|
||||
|
||||
if (pn != target)
|
||||
{
|
||||
if (abs(pn - target) == 1)
|
||||
pn = target;
|
||||
else if (pn < target)
|
||||
pn += 2;
|
||||
else //if (pn > target)
|
||||
pn -= 2;
|
||||
}
|
||||
|
||||
if (pn < 0)
|
||||
{
|
||||
splitflags |= V_FLIP; // right turn
|
||||
x -= FRACUNIT;
|
||||
}
|
||||
|
||||
target = abs(pn);
|
||||
if (target > 4)
|
||||
target = 4;
|
||||
|
||||
if (!stplyr->skincolor)
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], NULL);
|
||||
else
|
||||
{
|
||||
UINT8 *colormap;
|
||||
colormap = R_GetTranslationColormap(0, stplyr->skincolor, GTC_CACHE);
|
||||
V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4445,12 +4437,12 @@ void K_drawKartHUD(void)
|
|||
K_drawKartAccessibilityIcons(0);
|
||||
}
|
||||
|
||||
if (K_RingsActive() == true)
|
||||
if (LUA_HudEnabled(hud_rings) && K_RingsActive() == true)
|
||||
{
|
||||
K_drawRingMeter();
|
||||
}
|
||||
|
||||
if (cv_showinput.value || (modeattacking && !bossinfo.boss))
|
||||
if ((cv_showinput.value > 0) || (modeattacking && !bossinfo.boss))
|
||||
{
|
||||
// Draw the input UI
|
||||
if (LUA_HudEnabled(hud_position))
|
||||
|
|
|
|||
211
src/k_kart.c
211
src/k_kart.c
|
|
@ -1759,25 +1759,6 @@ fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against)
|
|||
return weight;
|
||||
}
|
||||
|
||||
static boolean K_JustBumpedException(mobj_t *mobj)
|
||||
{
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_WALLSPIKE:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mobj->flags & MF_PUSHABLE)
|
||||
return true;
|
||||
|
||||
if (!mobj->player && mobj->flags & MF_SOLID)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||
{
|
||||
mobj_t *fx;
|
||||
|
|
@ -1825,13 +1806,13 @@ boolean K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean sol
|
|||
|
||||
|
||||
// Don't bump if you've recently bumped
|
||||
if (mobj1->player && mobj1->player->justbumped && !K_JustBumpedException(mobj2))
|
||||
if (mobj1->player && mobj1->player->justbumped)
|
||||
{
|
||||
mobj1->player->justbumped = bumptime;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mobj2->player && mobj2->player->justbumped && !K_JustBumpedException(mobj1))
|
||||
if (mobj2->player && mobj2->player->justbumped)
|
||||
{
|
||||
mobj2->player->justbumped = bumptime;
|
||||
return false;
|
||||
|
|
@ -3137,13 +3118,147 @@ boolean K_TripwirePass(player_t *player)
|
|||
return (player->tripwirePass != TRIPWIRE_NONE);
|
||||
}
|
||||
|
||||
boolean K_WaterRun(player_t *player)
|
||||
boolean K_ItemMobjAllowedtoWaterRun(mobj_t *item)
|
||||
{
|
||||
if (player->waterrun)
|
||||
return true;
|
||||
switch (item->type)
|
||||
{
|
||||
case MT_ORBINAUT:
|
||||
case MT_JAWZ:
|
||||
case MT_JAWZ_DUD:
|
||||
case MT_DROPTARGET:
|
||||
case MT_BANANA_SHIELD:
|
||||
case MT_DROPTARGET_SHIELD:
|
||||
case MT_SSMINE_SHIELD:
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean K_WaterRun(mobj_t *mobj)
|
||||
{
|
||||
// Let dragged items waterrun with the player for free.
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_BANANA_SHIELD:
|
||||
case MT_DROPTARGET_SHIELD:
|
||||
case MT_SSMINE_SHIELD:
|
||||
if (mobj->target && (mobj->target->flags2 & MF2_WATERRUN))
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mobj->flags2 & MF2_WATERRUN)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void K_SpawnWaterTrail(mobj_t *mobj)
|
||||
{
|
||||
fixed_t topspeed = mobj->player ? K_GetKartSpeed(mobj->player, false, false) : K_GetKartSpeedFromStat(5);
|
||||
fixed_t runspd = 14*mobj->scale; //srb2kart
|
||||
runspd = FixedMul(runspd, mobj->movefactor);
|
||||
fixed_t trailScale;
|
||||
|
||||
if (topspeed > runspd)
|
||||
{
|
||||
if (mobj->player)
|
||||
{
|
||||
trailScale = FixedMul(FixedDiv(mobj->player->speed - runspd, topspeed - runspd), mapobjectscale);
|
||||
}
|
||||
else
|
||||
{
|
||||
trailScale = FixedMul(FixedDiv(R_PointToDist2(0, 0, mobj->momx, mobj->momy) - runspd, topspeed - runspd), mapobjectscale);
|
||||
}
|
||||
}
|
||||
else
|
||||
trailScale = mapobjectscale; // Scaling is based off difference between runspeed and top speed
|
||||
|
||||
if (trailScale > 0)
|
||||
{
|
||||
const angle_t forwardangle = K_MomentumAngle(mobj);
|
||||
const fixed_t visualradius = mobj->radius + (8 * mobj->scale);
|
||||
const SINT8 numFrames = 5;
|
||||
const INT32 curFrame = (leveltime % numFrames)|FF_PAPERSPRITE;
|
||||
fixed_t x1, x2, y1, y2;
|
||||
mobj_t *water;
|
||||
|
||||
x1 = mobj->x + mobj->momx + P_ReturnThrustX(mobj, forwardangle + ANGLE_90, visualradius);
|
||||
y1 = mobj->y + mobj->momy + P_ReturnThrustY(mobj, forwardangle + ANGLE_90, visualradius);
|
||||
x1 = x1 + P_ReturnThrustX(mobj, forwardangle, visualradius);
|
||||
y1 = y1 + P_ReturnThrustY(mobj, forwardangle, visualradius);
|
||||
|
||||
x2 = mobj->x + mobj->momx + P_ReturnThrustX(mobj, forwardangle - ANGLE_90, visualradius);
|
||||
y2 = mobj->y + mobj->momy + P_ReturnThrustY(mobj, forwardangle - ANGLE_90, visualradius);
|
||||
x2 = x2 + P_ReturnThrustX(mobj, forwardangle, visualradius);
|
||||
y2 = y2 + P_ReturnThrustY(mobj, forwardangle, visualradius);
|
||||
|
||||
// Left
|
||||
// underlay
|
||||
water = P_SpawnMobj(x1, y1,
|
||||
((mobj->eflags & MFE_VERTICALFLIP) ? mobj->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, mobj->scale) : mobj->watertop), MT_WATERTRAILUNDERLAY);
|
||||
water->angle = forwardangle - ANGLE_180 - ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = mobj->momx;
|
||||
water->momy = mobj->momy;
|
||||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILSUNDERLAY);
|
||||
water->frame = curFrame|FF_ADD|FF_TRANS40;
|
||||
|
||||
// overlay
|
||||
water = P_SpawnMobj(x1, y1,
|
||||
((mobj->eflags & MFE_VERTICALFLIP) ? mobj->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, mobj->scale) : mobj->watertop), MT_WATERTRAIL);
|
||||
water->angle = forwardangle - ANGLE_180 - ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = mobj->momx;
|
||||
water->momy = mobj->momy;
|
||||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILS);
|
||||
water->frame = curFrame;
|
||||
|
||||
// Right
|
||||
// Underlay
|
||||
water = P_SpawnMobj(x2, y2,
|
||||
((mobj->eflags & MFE_VERTICALFLIP) ? mobj->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, mobj->scale) : mobj->watertop), MT_WATERTRAILUNDERLAY);
|
||||
water->angle = forwardangle - ANGLE_180 + ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = mobj->momx;
|
||||
water->momy = mobj->momy;
|
||||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILSUNDERLAY);
|
||||
water->frame = curFrame|FF_ADD|FF_TRANS40;
|
||||
|
||||
// Overlay
|
||||
water = P_SpawnMobj(x2, y2,
|
||||
((mobj->eflags & MFE_VERTICALFLIP) ? mobj->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, mobj->scale) : mobj->watertop), MT_WATERTRAIL);
|
||||
water->angle = forwardangle - ANGLE_180 + ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = mobj->momx;
|
||||
water->momy = mobj->momy;
|
||||
water->momz = mobj->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILS);
|
||||
water->frame = curFrame;
|
||||
|
||||
if (!S_SoundPlaying(mobj, sfx_s3kdbs))
|
||||
{
|
||||
const INT32 volume = (min(trailScale, FRACUNIT) * 255) / FRACUNIT;
|
||||
S_StartSoundAtVolume(mobj, sfx_s3kdbs, volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static fixed_t K_FlameShieldDashVar(INT32 val)
|
||||
{
|
||||
// 1 second = 15% + ????% top speed
|
||||
|
|
@ -4034,6 +4149,15 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
|
|||
|
||||
th->flags2 |= flags2;
|
||||
|
||||
if (source->flags2 & MF2_WATERRUN)
|
||||
{
|
||||
// Allow certain items to run on water as well!
|
||||
if (K_ItemMobjAllowedtoWaterRun(th))
|
||||
{
|
||||
th->flags2 |= MF2_WATERRUN;
|
||||
}
|
||||
}
|
||||
|
||||
th->threshold = 10;
|
||||
|
||||
if (th->info->seesound)
|
||||
|
|
@ -5083,7 +5207,7 @@ void K_DoWaterRunPanel(player_t *player)
|
|||
}
|
||||
|
||||
player->sneakertimer = TICRATE*2;
|
||||
player->waterrun = true;
|
||||
player->mo->flags2 |= MF2_WATERRUN;
|
||||
|
||||
// set angle for spun out players:
|
||||
player->boostangle = player->mo->angle;
|
||||
|
|
@ -7012,7 +7136,10 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->floorboost--;
|
||||
|
||||
if (player->sneakertimer == 0)
|
||||
player->waterrun = false;
|
||||
{
|
||||
// No more waterrunning for you pal!
|
||||
player->mo->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
|
||||
if (player->driftboost)
|
||||
player->driftboost--;
|
||||
|
|
@ -8863,25 +8990,29 @@ void K_KartLegacyUpdatePosition(player_t *player)
|
|||
void K_UpdateAllPlayerPositions(void)
|
||||
{
|
||||
INT32 i;
|
||||
// First loop: Ensure all players' distance to the finish line are all accurate
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
||||
if (!K_UsingLegacyCheckpoints())
|
||||
{
|
||||
player_t *player = &players[i];
|
||||
if (!playeringame[i] || player->spectator || !player->mo || P_MobjWasRemoved(player->mo))
|
||||
// First loop: Ensure all players' distance to the finish line are all accurate
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player->respawn > 0 && player->lastsafelap != player->laps)
|
||||
{
|
||||
if (!K_UsingLegacyCheckpoints())
|
||||
player_t *player = &players[i];
|
||||
if (!playeringame[i] || player->spectator || !player->mo || P_MobjWasRemoved(player->mo))
|
||||
{
|
||||
player->laps = player->lastsafelap;
|
||||
player->starpostnum = player->lastsafestarpost;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
K_UpdatePlayerWaypoints(player);
|
||||
if (player->respawn > 0 && player->lastsafelap != player->laps)
|
||||
{
|
||||
if (!K_UsingLegacyCheckpoints())
|
||||
{
|
||||
player->laps = player->lastsafelap;
|
||||
player->starpostnum = player->lastsafestarpost;
|
||||
}
|
||||
}
|
||||
|
||||
K_UpdatePlayerWaypoints(player);
|
||||
}
|
||||
}
|
||||
|
||||
// Second loop: Ensure all player positions reflect everyone's distances
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ Make sure this matches the actual number of states
|
|||
#define AUTORESPAWN_TIME (10 * TICRATE)
|
||||
#define AUTORESPAWN_THRESHOLD (7 * TICRATE)
|
||||
|
||||
#define FLAMESTOREMAX TICRATE*2
|
||||
|
||||
// Used for respawning checks.
|
||||
|
||||
typedef struct respawnresult_s
|
||||
|
|
@ -150,7 +152,9 @@ boolean K_SlopeResistance(player_t *player);
|
|||
fixed_t K_PlayerTripwireSpeedThreshold(player_t *player);
|
||||
tripwirepass_t K_TripwirePassConditions(player_t *player);
|
||||
boolean K_TripwirePass(player_t *player);
|
||||
boolean K_WaterRun(player_t *player);
|
||||
boolean K_WaterRun(mobj_t *mobj);
|
||||
void K_SpawnWaterTrail(mobj_t *mobj);
|
||||
boolean K_ItemMobjAllowedtoWaterRun(mobj_t *item);
|
||||
void K_SetTireGrease(player_t *player, tic_t tics);
|
||||
void K_SquishPlayer(player_t *player, mobj_t *inflictor, mobj_t *source);
|
||||
void K_ApplyTripWire(player_t *player, tripwirestate_t state);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ enum hud {
|
|||
hud_battlecomebacktimer, // comeback timer in battlefullscreen. separated for ease of use.
|
||||
hud_wanted,
|
||||
hud_speedometer,
|
||||
hud_rings,
|
||||
hud_lives,
|
||||
hud_freeplay,
|
||||
hud_rankings, // Tab rankings
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ static const char *const hud_disable_options[] = {
|
|||
"battlecomebacktimer", // come back timer in battlefullscreen
|
||||
"wanted",
|
||||
"speedometer",
|
||||
"rings",
|
||||
"lives",
|
||||
"freeplay",
|
||||
"rankings",
|
||||
|
||||
|
|
|
|||
|
|
@ -360,8 +360,6 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->sneakertimer);
|
||||
else if (fastcmp(field,"floorboost"))
|
||||
lua_pushinteger(L, plr->floorboost);
|
||||
else if (fastcmp(field,"waterrun"))
|
||||
lua_pushinteger(L, plr->waterrun);
|
||||
else if (fastcmp(field,"growshrinktimer"))
|
||||
lua_pushinteger(L, plr->growshrinktimer);
|
||||
else if (fastcmp(field,"growcancel"))
|
||||
|
|
@ -777,8 +775,6 @@ static int player_set(lua_State *L)
|
|||
plr->sneakertimer = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"floorboost"))
|
||||
plr->floorboost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"waterrun"))
|
||||
plr->waterrun = luaL_checkboolean(L, 3);
|
||||
else if (fastcmp(field,"growshrinktimer"))
|
||||
plr->growshrinktimer = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"growcancel"))
|
||||
|
|
|
|||
25
src/m_menu.c
25
src/m_menu.c
|
|
@ -5076,12 +5076,12 @@ void M_DrawMusicTest(void)
|
|||
V_DrawString(x, 10, 0, "NOW PLAYING:");
|
||||
if (curplaying)
|
||||
{
|
||||
if (curplaying->title && curplaying->title[0])
|
||||
if (curplaying->source && curplaying->source[0] && curplaying->title && curplaying->title[0])
|
||||
titl = va("%s - %s - ", curplaying->title, curplaying->source);
|
||||
else if (curplaying->title && curplaying->title[0])
|
||||
titl = va("%s - ", curplaying->title);
|
||||
else if (curplaying->title && curplaying->source[0])
|
||||
titl = va("%s - ", curplaying->source);
|
||||
else
|
||||
titl = va("%s - ", "What did you do.......");
|
||||
titl = va("%s - ", "No Title - ");
|
||||
}
|
||||
else
|
||||
titl = "NONE - ";
|
||||
|
|
@ -5175,9 +5175,9 @@ void M_DrawMusicTest(void)
|
|||
const size_t MAXLENGTH = 34;
|
||||
const tic_t SCROLLSPEED = TICRATE/5; // Number of tics for name being scrolled by 1 letter
|
||||
size_t nameoffset = 0;
|
||||
size_t namelength = soundtestdefs[t]->source ? strlen(soundtestdefs[t]->source) : 0;
|
||||
if (soundtestdefs[t]->title && (soundtestdefs[t]->title[0]))
|
||||
namelength = strlen(soundtestdefs[t]->title);
|
||||
size_t namelength = soundtestdefs[t]->title ? strlen(soundtestdefs[t]->title) : 8; // "No Title"
|
||||
if (soundtestdefs[t]->source && (soundtestdefs[t]->source[0]))
|
||||
namelength = strlen(va("%s - %s ", soundtestdefs[t]->title, soundtestdefs[t]->source));
|
||||
|
||||
char buf[MAXLENGTH+1];
|
||||
|
||||
|
|
@ -5239,12 +5239,13 @@ void M_DrawMusicTest(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (soundtestdefs[t]->title && soundtestdefs[t]->title[0])
|
||||
if (soundtestdefs[t]->title && soundtestdefs[t]->title[0]
|
||||
&& soundtestdefs[t]->source && soundtestdefs[t]->source[0])
|
||||
strncpy(buf, va("%s - %s",soundtestdefs[t]->title, soundtestdefs[t]->source) + nameoffset, MAXLENGTH);
|
||||
else if (soundtestdefs[t]->title && soundtestdefs[t]->title[0])
|
||||
strncpy(buf, soundtestdefs[t]->title + nameoffset, MAXLENGTH);
|
||||
else if (soundtestdefs[t]->source && soundtestdefs[t]->source[0])
|
||||
strncpy(buf, soundtestdefs[t]->source + nameoffset, MAXLENGTH);
|
||||
else
|
||||
strncpy(buf, "How tf did you get here?", MAXLENGTH);
|
||||
strncpy(buf, "No Title or Source", MAXLENGTH);
|
||||
buf[MAXLENGTH] = 0;
|
||||
|
||||
V_DrawString(x, y, (t == st_sel ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE|V_MONOSPACE, buf);
|
||||
|
|
@ -8813,7 +8814,7 @@ void M_DrawHUDOptions(void)
|
|||
const char *str1 = " Warning highlight";
|
||||
const char *str2 = ",";
|
||||
const char *str3 = "Good highlight";
|
||||
INT32 x = BASEVIDWIDTH - currentMenu->x + 2, y = currentMenu->y + 115;
|
||||
INT32 x = BASEVIDWIDTH - currentMenu->x + 2, y = currentMenu->y + 90;
|
||||
INT32 w0 = V_StringWidth(str0, 0), w1 = V_StringWidth(str1, 0), w2 = V_StringWidth(str2, 0), w3 = V_StringWidth(str3, 0);
|
||||
|
||||
M_DrawGenericMenu();
|
||||
|
|
|
|||
|
|
@ -13450,8 +13450,13 @@ void A_SSMineExplode(mobj_t *actor)
|
|||
if (actor->flags2 & MF2_DEBRIS)
|
||||
return;
|
||||
|
||||
K_SpawnMineExplosion(actor, (actor->target && actor->target->player) ? actor->target->player->skincolor : SKINCOLOR_KETCHUP);
|
||||
K_MineExplodeAttack(actor, (3*actor->info->painchance)>>1, (boolean)locvar1);
|
||||
|
||||
skincolornum_t color = SKINCOLOR_KETCHUP;
|
||||
if (!P_MobjWasRemoved(actor->target) && actor->target->player)
|
||||
color = actor->target->player->skincolor;
|
||||
|
||||
K_SpawnMineExplosion(actor, color);
|
||||
}
|
||||
|
||||
void A_LandMineExplode(mobj_t *actor)
|
||||
|
|
|
|||
|
|
@ -1093,7 +1093,7 @@ void T_ThwompSector(thwomp_t *thwomp)
|
|||
INT32 secnum;
|
||||
fixed_t speed;
|
||||
|
||||
if (thwompsactive == false)
|
||||
if (mapnamespace == MNS_RINGRACERS && thwompsactive == false)
|
||||
{
|
||||
// Ring Racers: Rest until Lap 2
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -2083,6 +2083,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
{
|
||||
player_t *player;
|
||||
boolean force = false;
|
||||
boolean spbpop = false;
|
||||
|
||||
if (objectplacing)
|
||||
return false;
|
||||
|
|
@ -2097,6 +2098,16 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
if (source && source->player && source->player->spectator)
|
||||
return false;
|
||||
|
||||
switch (target->type)
|
||||
{
|
||||
case MT_SPB:
|
||||
spbpop = (damagetype & DMG_TYPEMASK) == DMG_VOLTAGE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Everything above here can't be forced.
|
||||
if (!metalrecording)
|
||||
{
|
||||
|
|
@ -2111,8 +2122,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
|
||||
if (!force)
|
||||
{
|
||||
if (!(target->flags & MF_SHOOTABLE))
|
||||
return false; // shouldn't happen...
|
||||
if (!spbpop)
|
||||
{
|
||||
if (!(target->flags & MF_SHOOTABLE))
|
||||
return false; // shouldn't happen...
|
||||
}
|
||||
}
|
||||
|
||||
if (target->flags2 & MF2_SKULLFLY)
|
||||
|
|
@ -2317,6 +2331,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
LUA_HookPlayerSpin(target, inflictor, source, damage, damagetype);
|
||||
K_KartPainEnergyFling(player);
|
||||
break;
|
||||
case DMG_VOLTAGE:
|
||||
case DMG_NORMAL:
|
||||
default:
|
||||
K_SpinPlayer(player, inflictor, source, KSPIN_SPINOUT);
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
|||
void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab);
|
||||
mobj_t *P_GetClosestAxis(mobj_t *source);
|
||||
|
||||
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover);
|
||||
boolean P_CanRunOnWater(mobj_t *mobj, ffloor_t *rover);
|
||||
boolean P_CheckSolidFFloorSurface(mobj_t *mobj, ffloor_t *rover);
|
||||
|
||||
void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot);
|
||||
|
|
@ -559,7 +559,7 @@ struct BasicFF_t
|
|||
#define DMG_WIPEOUT 0x01 // Normal, but with extra flashy effects
|
||||
#define DMG_EXPLODE 0x02
|
||||
#define DMG_SQUISH 0x03
|
||||
//#define free 0x04
|
||||
#define DMG_VOLTAGE 0x04 // Normal but for killing the spb
|
||||
#define DMG_KARMA 0x05 // Karma Bomb explosion -- works like DMG_EXPLODE, but steals half of their bumpers & deletes the rest
|
||||
//// Death types - cannot be combined with damage types
|
||||
#define DMG_INSTAKILL 0x80
|
||||
|
|
|
|||
20
src/p_map.c
20
src/p_map.c
|
|
@ -687,12 +687,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
|||
return BMIT_CONTINUE;
|
||||
|
||||
// Bubble Shield reflect
|
||||
if (((thing->type == MT_BUBBLESHIELD && !P_MobjWasRemoved(thing->target) && thing->target->player && thing->target->player->bubbleblowup)
|
||||
|| (thing->player && thing->player->bubbleblowup))
|
||||
&& (g_tm.thing->type == MT_ORBINAUT || g_tm.thing->type == MT_JAWZ || g_tm.thing->type == MT_JAWZ_DUD
|
||||
|| g_tm.thing->type == MT_BANANA || g_tm.thing->type == MT_EGGMANITEM || g_tm.thing->type == MT_BALLHOG
|
||||
|| g_tm.thing->type == MT_SSMINE || g_tm.thing->type == MT_LANDMINE || g_tm.thing->type == MT_SINK
|
||||
|| (g_tm.thing->type == MT_PLAYER && thing->target != g_tm.thing)))
|
||||
if (thing->type == MT_BUBBLESHIELD && !P_MobjWasRemoved(thing->target) && thing->target->player && thing->target->player->bubbleblowup)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (g_tm.thing->z > thing->z + thing->height)
|
||||
|
|
@ -702,12 +697,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
return K_BubbleShieldCollide(thing, g_tm.thing) ? BMIT_CONTINUE : BMIT_ABORT;
|
||||
}
|
||||
else if (((g_tm.thing->type == MT_BUBBLESHIELD && !P_MobjWasRemoved(g_tm.thing->target) && g_tm.thing->target->player && g_tm.thing->target->player->bubbleblowup)
|
||||
|| (g_tm.thing->player && g_tm.thing->player->bubbleblowup))
|
||||
&& (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD
|
||||
|| thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG
|
||||
|| thing->type == MT_SSMINE || thing->type == MT_LANDMINE || thing->type == MT_SINK
|
||||
|| (thing->type == MT_PLAYER && g_tm.thing->target != thing)))
|
||||
else if (g_tm.thing->type == MT_BUBBLESHIELD && !P_MobjWasRemoved(g_tm.thing->target) && g_tm.thing->target->player && g_tm.thing->target->player->bubbleblowup)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (g_tm.thing->z > thing->z + thing->height)
|
||||
|
|
@ -2478,14 +2468,12 @@ static boolean P_WaterRunning(mobj_t *thing)
|
|||
{
|
||||
ffloor_t *rover = thing->floorrover;
|
||||
return rover && (rover->fofflags & FOF_SWIMMABLE) &&
|
||||
P_IsObjectOnGround(thing);
|
||||
P_IsObjectOnGround(thing) && (thing->flags2 & MF2_WATERRUN);
|
||||
}
|
||||
|
||||
static boolean P_WaterStepUp(mobj_t *thing)
|
||||
{
|
||||
player_t *player = thing->player;
|
||||
return (player && player->waterskip) ||
|
||||
P_WaterRunning(thing);
|
||||
return P_WaterRunning(thing);
|
||||
}
|
||||
|
||||
fixed_t P_BaseStepUp(void)
|
||||
|
|
|
|||
88
src/p_mobj.c
88
src/p_mobj.c
|
|
@ -2997,11 +2997,11 @@ boolean P_SceneryZMovement(mobj_t *mo)
|
|||
//
|
||||
// P_CanRunOnWater
|
||||
//
|
||||
// Returns true if player can water run on a 3D floor
|
||||
// Returns true if mobj can water run on a 3D floor
|
||||
//
|
||||
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
||||
boolean P_CanRunOnWater(mobj_t *mobj, ffloor_t *rover)
|
||||
{
|
||||
const boolean flip = (player->mo->eflags & MFE_VERTICALFLIP);
|
||||
const boolean flip = (mobj->eflags & MFE_VERTICALFLIP);
|
||||
fixed_t surfaceheight = INT32_MAX;
|
||||
fixed_t playerbottom = INT32_MAX;
|
||||
fixed_t surfDiff = INT32_MAX;
|
||||
|
|
@ -3024,28 +3024,29 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (player->carry != CR_NONE) // Special carry state.
|
||||
if (mobj->player && mobj->player->carry != CR_NONE) // Special carry state.
|
||||
{
|
||||
// No good player state.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (P_IsObjectOnGround(player->mo) == false)
|
||||
if (P_IsObjectOnGround(mobj) == false && !K_ItemMobjAllowedtoWaterRun(mobj))
|
||||
{
|
||||
// Don't allow jumping onto water to start a water run.
|
||||
// (Unless you are some specfic item mobjs!)
|
||||
// (Already water running still counts as being on the ground.)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (K_WaterRun(player) == false)
|
||||
if (K_WaterRun(mobj) == false)
|
||||
{
|
||||
// Basic conditions for enabling water run.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player->mo->standingslope != NULL)
|
||||
if (mobj->standingslope != NULL)
|
||||
{
|
||||
ourZAng = player->mo->standingslope->zangle;
|
||||
ourZAng = mobj->standingslope->zangle;
|
||||
}
|
||||
|
||||
waterSlope = (flip ? *rover->b_slope : *rover->t_slope);
|
||||
|
|
@ -3060,10 +3061,10 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
|||
return false;
|
||||
}
|
||||
|
||||
surfaceheight = flip ? P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y) : P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y);
|
||||
playerbottom = flip ? (player->mo->z + player->mo->height) : player->mo->z;
|
||||
surfaceheight = flip ? P_GetFFloorBottomZAt(rover, mobj->x, mobj->y) : P_GetFFloorTopZAt(rover, mobj->x, mobj->y);
|
||||
playerbottom = flip ? (mobj->z + mobj->height) : mobj->z;
|
||||
|
||||
doifit = flip ? (surfaceheight - player->mo->floorz >= player->mo->height) : (player->mo->ceilingz - surfaceheight >= player->mo->height);
|
||||
doifit = flip ? (surfaceheight - mobj->floorz >= mobj->height) : (mobj->ceilingz - surfaceheight >= mobj->height);
|
||||
|
||||
if (!doifit)
|
||||
{
|
||||
|
|
@ -3071,7 +3072,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
|||
return false;
|
||||
}
|
||||
|
||||
maxStep = P_GetThingStepUp(player->mo, player->mo->x, player->mo->y);
|
||||
maxStep = P_GetThingStepUp(mobj, mobj->x, mobj->y);
|
||||
|
||||
surfDiff = flip ? (surfaceheight - playerbottom) : (playerbottom - surfaceheight);
|
||||
if (surfDiff <= maxStep && surfDiff >= 0)
|
||||
|
|
@ -3087,13 +3088,12 @@ boolean P_CheckSolidFFloorSurface(mobj_t *mobj, ffloor_t *rover)
|
|||
{
|
||||
if (!mobj->player)
|
||||
{
|
||||
// future proff if we ever decide to allow mobjs
|
||||
// to interact with P_CheckSolidFFloorSurface
|
||||
return false;
|
||||
// They can run on water now!
|
||||
return P_CanRunOnWater(mobj, rover);
|
||||
}
|
||||
|
||||
return P_CheckSolidLava(rover) ||
|
||||
P_CanRunOnWater(mobj->player, rover);
|
||||
P_CanRunOnWater(mobj, rover);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -6730,6 +6730,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
mobj->movecount = 2;
|
||||
mobj->frame++;
|
||||
}
|
||||
mobj->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -6768,6 +6769,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
P_Thrust(mobj, mobj->angle, thrustamount);
|
||||
|
||||
if (R_PointToDist2(0, 0, mobj->momx, mobj->momy) < 8*FRACUNIT)
|
||||
{
|
||||
// Not moving fast enough to water run.
|
||||
mobj->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
|
||||
sec2 = P_ThingOnSpecial3DFloor(mobj);
|
||||
if ((mobj->terrain && mobj->terrain->pogoSpring > 0) || (sec2 && (sec2->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING)))
|
||||
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
|
||||
|
|
@ -6834,6 +6841,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
K_DriftDustHandling(mobj);
|
||||
|
||||
if (R_PointToDist2(0, 0, mobj->momx, mobj->momy) < 8*FRACUNIT)
|
||||
{
|
||||
// Not moving fast enough to water run.
|
||||
mobj->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
|
||||
sec2 = P_ThingOnSpecial3DFloor(mobj);
|
||||
if ((mobj->terrain && mobj->terrain->pogoSpring > 0) || (sec2 && (sec2->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING)))
|
||||
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
|
||||
|
|
@ -6854,6 +6867,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
S_StartSound(mobj, mobj->info->deathsound);
|
||||
mobj->flags &= ~MF_NOCLIPTHING;
|
||||
}
|
||||
mobj->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -6870,6 +6884,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
K_DoPogoSpring(mobj, 0, 1);
|
||||
}
|
||||
|
||||
if (R_PointToDist2(0, 0, mobj->momx, mobj->momy) < 8*FRACUNIT)
|
||||
{
|
||||
// Not moving fast enough to water run.
|
||||
mobj->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
|
||||
if (mobj->threshold > 0)
|
||||
mobj->threshold--;
|
||||
|
||||
|
|
@ -7031,6 +7051,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
mobj->renderflags = (mobj->renderflags|RF_FULLBRIGHT) ^ RF_FULLDARK; // the difference between semi and fullbright
|
||||
|
||||
if (R_PointToDist2(0, 0, mobj->momx, mobj->momy) < 8*FRACUNIT)
|
||||
{
|
||||
// Not moving fast enough to water run.
|
||||
mobj->flags2 &= ~MF2_WATERRUN;
|
||||
}
|
||||
|
||||
if (mobj->threshold > 0)
|
||||
mobj->threshold--;
|
||||
break;
|
||||
|
|
@ -7291,6 +7317,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
}
|
||||
P_SetScale(mobj, (mobj->destscale = (5*mobj->target->scale)>>2));
|
||||
|
||||
mobj->pitch = mobj->target->pitch;
|
||||
mobj->roll = mobj->target->roll;
|
||||
|
||||
mobj->slopepitch = mobj->target->slopepitch;
|
||||
mobj->sloperoll = mobj->target->sloperoll;
|
||||
|
||||
P_MoveOrigin(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
|
||||
break;
|
||||
}
|
||||
|
|
@ -7361,10 +7393,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
(mobj->target->y - mobj->target->momy) + P_ReturnThrustY(NULL, a, mobj->radius - (21*ws)),
|
||||
(mobj->target->z - mobj->target->momz), MT_THOK);
|
||||
|
||||
wave->colorized = true;
|
||||
wave->color = SKINCOLOR_BLUE;
|
||||
wave->flags &= ~(MF_NOCLIPHEIGHT|MF_NOGRAVITY);
|
||||
P_SetScale(wave, (wave->destscale = ws));
|
||||
|
||||
P_SetMobjState(wave, S_BUBBLESHIELDWAVE1);
|
||||
P_SetMobjState(wave, S_SPLISH1);
|
||||
|
||||
wave->momx = mobj->target->momx;
|
||||
wave->momy = mobj->target->momy;
|
||||
|
|
@ -7406,6 +7440,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
mobj->extravalue2 = mobj->target->player->bubbleblowup;
|
||||
P_SetScale(mobj, (mobj->destscale = scale));
|
||||
|
||||
mobj->pitch = mobj->target->pitch;
|
||||
mobj->roll = mobj->target->roll;
|
||||
|
||||
mobj->slopepitch = mobj->target->slopepitch;
|
||||
mobj->sloperoll = mobj->target->sloperoll;
|
||||
|
||||
P_MoveOrigin(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
|
||||
break;
|
||||
}
|
||||
|
|
@ -7432,6 +7472,13 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
P_SetMobjState(mobj, S_FLAMESHIELD1);
|
||||
mobj->renderflags &= ~RF_DONTDRAW;
|
||||
}
|
||||
|
||||
mobj->pitch = mobj->target->pitch;
|
||||
mobj->roll = mobj->target->roll;
|
||||
|
||||
mobj->slopepitch = mobj->target->slopepitch;
|
||||
mobj->sloperoll = mobj->target->sloperoll;
|
||||
|
||||
P_MoveOrigin(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
|
||||
mobj->angle = mobj->target->angle;
|
||||
break;
|
||||
|
|
@ -8224,10 +8271,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
mobj->y + FixedMul(mobj->radius, FINESINE(aoff>>ANGLETOFINESHIFT)),
|
||||
mobj->z, MT_THOK);
|
||||
|
||||
wave->colorized = true;
|
||||
wave->color = SKINCOLOR_PERIWINKLE;
|
||||
wave->flags &= ~(MF_NOCLIPHEIGHT|MF_NOGRAVITY);
|
||||
P_SetScale(wave, (wave->destscale = mobj->scale/2));
|
||||
|
||||
P_SetMobjState(wave, S_BUBBLESHIELDWAVE1);
|
||||
P_SetMobjState(wave, S_SPLISH1);
|
||||
if (leveltime & 1)
|
||||
wave->tics++;
|
||||
|
||||
|
|
@ -8542,9 +8591,6 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
P_CheckMobjTrigger(mobj, false);
|
||||
}
|
||||
|
||||
// Sector flag MSF_TRIGGERLINE_MOBJ allows ANY mobj to trigger a linedef exec
|
||||
P_CheckMobjTrigger(mobj, false);
|
||||
|
||||
if (mobj->scale != mobj->destscale)
|
||||
P_MobjScaleThink(mobj); // Slowly scale up/down to reach your destscale.
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ typedef enum
|
|||
MF2_LINKDRAW = 1<<28, // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position)
|
||||
MF2_SHIELD = 1<<29, // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use)
|
||||
MF2_SPLAT = 1<<30, // Renders as a splat
|
||||
// free: to and including 1<<31
|
||||
MF2_WATERRUN = 1<<31, // Mobj is able to run on Water!
|
||||
} mobjflag2_t;
|
||||
|
||||
typedef enum
|
||||
|
|
|
|||
|
|
@ -315,7 +315,6 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
|
||||
WRITEUINT16(save->p, players[i].sneakertimer);
|
||||
WRITEUINT8(save->p, players[i].floorboost);
|
||||
WRITEUINT8(save->p, players[i].waterrun);
|
||||
|
||||
WRITEUINT8(save->p, players[i].boostcharge);
|
||||
|
||||
|
|
@ -625,7 +624,6 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
|
||||
players[i].sneakertimer = READUINT16(save->p);
|
||||
players[i].floorboost = READUINT8(save->p);
|
||||
players[i].waterrun = READUINT8(save->p);
|
||||
|
||||
players[i].boostcharge = READUINT8(save->p);
|
||||
|
||||
|
|
|
|||
|
|
@ -4813,7 +4813,17 @@ static line_t *P_FindPointPushLine(taglist_t *list)
|
|||
|
||||
static void P_SetBinaryFOFAlpha(line_t *line)
|
||||
{
|
||||
if (sides[line->sidenum[0]].toptexture > 0)
|
||||
// fun fact: in Kart, transparent FOFs with a missing top texture have their toptexture set to 1,
|
||||
// because that's the ID of REDWALL. this makes the FOF invisible.
|
||||
// in BlanKart, toptexture is set to 7478, which is a nonsensical alpha value that makes the FOF opaque.
|
||||
// so now we have to check for MISSTEX and set alpha to 1 in that case!
|
||||
// have fun with the time bomb in R_TextureNumForName :^)
|
||||
if (mapnamespace == MNS_SRB2KART && sides[line->sidenum[0]].toptexture == R_TextureNumForName(MISSING_TEXTURE))
|
||||
{
|
||||
line->args[1] = 1;
|
||||
line->args[2] = TMB_TRANSLUCENT;
|
||||
}
|
||||
else if (sides[line->sidenum[0]].toptexture > 0)
|
||||
{
|
||||
line->args[1] = sides[line->sidenum[0]].toptexture;
|
||||
|
||||
|
|
|
|||
84
src/p_user.c
84
src/p_user.c
|
|
@ -2238,89 +2238,7 @@ void P_MovePlayer(player_t *player)
|
|||
&& (player->speed > runspd)
|
||||
&& player->mo->momz == 0 && player->carry != CR_SLIDING && !player->spectator)
|
||||
{
|
||||
fixed_t playerTopSpeed = K_GetKartSpeed(player, false, false);
|
||||
fixed_t trailScale = FixedMul(FixedDiv(player->speed - runspd, playerTopSpeed - runspd), mapobjectscale);
|
||||
|
||||
if (playerTopSpeed > runspd)
|
||||
trailScale = FixedMul(FixedDiv(player->speed - runspd, playerTopSpeed - runspd), mapobjectscale);
|
||||
else
|
||||
trailScale = mapobjectscale; // Scaling is based off difference between runspeed and top speed
|
||||
|
||||
if (trailScale > 0)
|
||||
{
|
||||
const angle_t forwardangle = K_MomentumAngle(player->mo);
|
||||
const fixed_t playerVisualRadius = player->mo->radius + (8 * player->mo->scale);
|
||||
const SINT8 numFrames = 5;
|
||||
const INT32 curFrame = (leveltime % numFrames)|FF_PAPERSPRITE;
|
||||
fixed_t x1, x2, y1, y2;
|
||||
mobj_t *water;
|
||||
|
||||
x1 = player->mo->x + player->mo->momx + P_ReturnThrustX(player->mo, forwardangle + ANGLE_90, playerVisualRadius);
|
||||
y1 = player->mo->y + player->mo->momy + P_ReturnThrustY(player->mo, forwardangle + ANGLE_90, playerVisualRadius);
|
||||
x1 = x1 + P_ReturnThrustX(player->mo, forwardangle, playerVisualRadius);
|
||||
y1 = y1 + P_ReturnThrustY(player->mo, forwardangle, playerVisualRadius);
|
||||
|
||||
x2 = player->mo->x + player->mo->momx + P_ReturnThrustX(player->mo, forwardangle - ANGLE_90, playerVisualRadius);
|
||||
y2 = player->mo->y + player->mo->momy + P_ReturnThrustY(player->mo, forwardangle - ANGLE_90, playerVisualRadius);
|
||||
x2 = x2 + P_ReturnThrustX(player->mo, forwardangle, playerVisualRadius);
|
||||
y2 = y2 + P_ReturnThrustY(player->mo, forwardangle, playerVisualRadius);
|
||||
|
||||
// Left
|
||||
// underlay
|
||||
water = P_SpawnMobj(x1, y1,
|
||||
((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAILUNDERLAY);
|
||||
water->angle = forwardangle - ANGLE_180 - ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = player->mo->momx;
|
||||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILSUNDERLAY);
|
||||
water->frame = curFrame|FF_ADD|FF_TRANS40;
|
||||
|
||||
// overlay
|
||||
water = P_SpawnMobj(x1, y1,
|
||||
((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAIL);
|
||||
water->angle = forwardangle - ANGLE_180 - ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = player->mo->momx;
|
||||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILS);
|
||||
water->frame = curFrame;
|
||||
|
||||
// Right
|
||||
// Underlay
|
||||
water = P_SpawnMobj(x2, y2,
|
||||
((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAILUNDERLAY);
|
||||
water->angle = forwardangle - ANGLE_180 + ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = player->mo->momx;
|
||||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILSUNDERLAY);
|
||||
water->frame = curFrame|FF_ADD|FF_TRANS40;
|
||||
|
||||
// Overlay
|
||||
water = P_SpawnMobj(x2, y2,
|
||||
((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAIL);
|
||||
water->angle = forwardangle - ANGLE_180 + ANGLE_22h;
|
||||
water->destscale = trailScale;
|
||||
water->momx = player->mo->momx;
|
||||
water->momy = player->mo->momy;
|
||||
water->momz = player->mo->momz;
|
||||
P_SetScale(water, trailScale);
|
||||
P_SetMobjState(water, S_WATERTRAILS);
|
||||
water->frame = curFrame;
|
||||
|
||||
if (!S_SoundPlaying(player->mo, sfx_s3kdbs))
|
||||
{
|
||||
const INT32 volume = (min(trailScale, FRACUNIT) * 255) / FRACUNIT;
|
||||
S_StartSoundAtVolume(player->mo, sfx_s3kdbs, volume);
|
||||
}
|
||||
}
|
||||
K_SpawnWaterTrail(player->mo);
|
||||
}
|
||||
|
||||
// Little water sound while touching water - just a nicety.
|
||||
|
|
|
|||
|
|
@ -2400,7 +2400,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
{
|
||||
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
|
||||
continue;
|
||||
if ((udmf && !(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) || (!udmf && rover->fofflags & FOF_INVERTSIDES))
|
||||
if (rover->fofflags & FOF_INVERTSIDES && (mapnamespace == MNS_SRB2KART || !(rover->fofflags & FOF_ALLSIDES)))
|
||||
continue;
|
||||
|
||||
if (rover->norender == leveltime)
|
||||
|
|
@ -2458,7 +2458,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
{
|
||||
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
|
||||
continue;
|
||||
if ((udmf && !(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) || (!udmf && rover->fofflags & FOF_INVERTSIDES))
|
||||
if (!(rover->fofflags & FOF_ALLSIDES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTSIDES)))
|
||||
continue;
|
||||
|
||||
if (rover->norender == leveltime)
|
||||
|
|
@ -2518,7 +2518,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
{
|
||||
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
|
||||
continue;
|
||||
if ((udmf && !(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) || (!udmf && rover->fofflags & FOF_INVERTSIDES))
|
||||
if (rover->fofflags & FOF_INVERTSIDES && (mapnamespace == MNS_SRB2KART || !(rover->fofflags & FOF_ALLSIDES)))
|
||||
continue;
|
||||
if (rover->norender == leveltime)
|
||||
continue;
|
||||
|
|
@ -2540,7 +2540,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
{
|
||||
if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS))
|
||||
continue;
|
||||
if ((udmf && !(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) || (!udmf && rover->fofflags & FOF_INVERTSIDES))
|
||||
if (!(rover->fofflags & FOF_ALLSIDES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTSIDES)))
|
||||
continue;
|
||||
if (rover->norender == leveltime)
|
||||
continue;
|
||||
|
|
@ -2878,8 +2878,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
|
||||
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
|
||||
((viewz < planevistest && ((udmf && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
|
||||
((viewz < planevistest && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTPLANES)))))
|
||||
{
|
||||
//ffloor[i].slope = *rover->b_slope;
|
||||
ffloor[i].b_pos = roverleft;
|
||||
|
|
@ -2901,8 +2901,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
|
||||
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
|
||||
((viewz > planevistest && ((udmf && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
|
||||
((viewz > planevistest && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTPLANES)))))
|
||||
{
|
||||
//ffloor[i].slope = *rover->t_slope;
|
||||
ffloor[i].b_pos = roverleft;
|
||||
|
|
@ -2935,8 +2935,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
|
||||
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
|
||||
((viewz < planevistest && ((udmf && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
|
||||
((viewz < planevistest && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTPLANES)))))
|
||||
{
|
||||
//ffloor[i].slope = *rover->b_slope;
|
||||
ffloor[i].b_pos = roverleft;
|
||||
|
|
@ -2958,8 +2958,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) &&
|
||||
(roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) &&
|
||||
((viewz > planevistest && ((udmf && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
|
||||
((viewz > planevistest && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
|
||||
(viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTPLANES)))))
|
||||
{
|
||||
//ffloor[i].slope = *rover->t_slope;
|
||||
ffloor[i].b_pos = roverleft;
|
||||
|
|
|
|||
|
|
@ -2158,7 +2158,12 @@ INT32 R_TextureNumForName(const char *name)
|
|||
static INT32 redwall = -2;
|
||||
CONS_Debug(DBG_SETUP, "WARNING: R_TextureNumForName: %.8s not found\n", name);
|
||||
if (redwall == -2)
|
||||
{
|
||||
redwall = R_CheckTextureNumForName(MISSING_TEXTURE);
|
||||
if (redwall <= 256)
|
||||
// see P_SetBinaryFOFAlpha
|
||||
I_Error(MISSING_TEXTURE " resolved to ID <= 256. Shit's fucked man");
|
||||
}
|
||||
if (redwall != -1)
|
||||
return redwall;
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -2569,6 +2569,28 @@ INT32 V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *color
|
|||
return x;
|
||||
}
|
||||
|
||||
// Jaden: Draw a number using the position numbers.
|
||||
//
|
||||
void V_DrawRankNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits, const UINT8 *colormap)
|
||||
{
|
||||
INT32 w = SHORT(fontv[PINGNUM_FONT].font[0]->width) - 1;
|
||||
|
||||
if (flags & V_NOSCALESTART)
|
||||
w *= vid.dupx;
|
||||
|
||||
if (num < 0)
|
||||
num = -num;
|
||||
|
||||
// draw the number
|
||||
do
|
||||
{
|
||||
x -= (w - 1);
|
||||
|
||||
V_DrawFixedPatch(x << FRACBITS, y << FRACBITS, FRACUNIT, flags, fontv[PINGNUM_FONT].font[num % 10], colormap);
|
||||
num /= 10;
|
||||
} while (--digits);
|
||||
}
|
||||
|
||||
// Find string width from cred_font chars
|
||||
//
|
||||
INT32 V_CreditStringWidth(const char *string)
|
||||
|
|
|
|||
|
|
@ -316,6 +316,9 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits)
|
|||
// This is a separate function because IMO lua should have access to it as well.
|
||||
INT32 V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap);
|
||||
|
||||
// Rank numbers.
|
||||
void V_DrawRankNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits, const UINT8 *colormap);
|
||||
|
||||
// Find string width from lt_font chars
|
||||
INT32 V_LevelNameWidth(const char *string);
|
||||
INT32 V_LevelNameHeight(const char *string);
|
||||
|
|
|
|||
2
thirdparty/CMakeLists.txt
vendored
2
thirdparty/CMakeLists.txt
vendored
|
|
@ -45,7 +45,7 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
|
|||
"SDL2MIXER_MP3 ON"
|
||||
"SDL2MIXER_MP3_DRMP3 ON"
|
||||
"SDL2MIXER_MIDI ON"
|
||||
"SDL2MIXER_OPUS OFF"
|
||||
"SDL2MIXER_OPUS ON"
|
||||
"SDL2MIXER_VORBIS STB"
|
||||
"SDL2MIXER_WAVE ON"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue