Merge branch 'blankart-dev' into AirDrop

This commit is contained in:
NepDisk 2025-09-22 15:35:20 -04:00
commit 9df538fe32
18 changed files with 115 additions and 39 deletions

View file

@ -163,6 +163,7 @@ static void KartDrafting_OnChange(void);
static void KartAirDrop_OnChange(void);
static void KartItemBreaker_OnChange(void);
static void KartInvinType_OnChange(void);
static void KartBumpSpark_OnChange(void);
static void Schedule_OnChange(void);
@ -535,7 +536,7 @@ consvar_t cv_kartusepwrlv = CVAR_INIT ("kartusepwrlv", "Yes", CV_NETVAR, CV_YesN
consvar_t cv_kartpurpledrift = CVAR_INIT ("kartpurpledrift", "No", CV_NETVAR, CV_YesNo, KartPurpleDrift_OnChange);
static CV_PossibleValue_t bumpspark_cons_t[] = {{0, "Off"}, {1, "Remove Charge Only"}, {2, "On"}, {0, NULL}};
consvar_t cv_kartbumpspark = CVAR_INIT ("kartbumpspark", "Remove Charge Only", CV_NETVAR, bumpspark_cons_t, NULL);
consvar_t cv_kartbumpspark = CVAR_INIT ("kartbumpspark", "Remove Charge Only", CV_NETVAR|CV_CALL, bumpspark_cons_t, KartBumpSpark_OnChange);
consvar_t cv_kartbumpspring = CVAR_INIT ("kartbumpspring", "Yes", CV_NETVAR, CV_YesNo, NULL);
@ -7671,6 +7672,24 @@ static void KartInvinType_OnChange(void)
}
}
static void KartBumpSpark_OnChange(void)
{
if (K_CanChangeRules() == false)
{
return;
}
if (leveltime < starttime)
{
CONS_Printf(M_GetText("Bump spark type has been changed to \"%s\".\n"), cv_kartbumpspark.string);
bumpsparkactive = (UINT8)cv_kartbumpspark.value;
}
else
{
CONS_Printf(M_GetText("Bump spark type will be changed to \"%s\" next round.\n"), cv_kartbumpspark.string);
}
}
static void Schedule_OnChange(void)
{
size_t i;

View file

@ -1860,6 +1860,7 @@ static struct { const char *name; consvar_t *var; } HIDDENVARS[] = {
{ "DUMMYATTACKINGPURPLEDRIFT", &cv_dummyattackingpurpledrift },
{ "DUMMYATTACKINGSLOPEBOOST", &cv_dummyattackingslopeboost },
{ "DUMMYATTACKINGAIRDROP", &cv_dummyattackingairdrop },
{ "DUMMYATTACKINGBUMPSPARK", &cv_dummyattackingbumpspark },
{ "DUMMYSTAFF", &cv_dummystaff },
{ "DUMMYMULTIPLAYER", &cv_dummymultiplayer },
{ "DUMMYIP", &cv_dummyip },

View file

@ -2742,6 +2742,10 @@ void G_BeginRecording(void)
raflags |= RAF_SLOPEBOOST;
if (cv_dummyattackingairdrop.value)
raflags |= RAF_AIRDROP;
if (cv_dummyattackingbumpspark.value == BUMPSPARK_ALL)
raflags |= RAF_BUMPSPARK;
if (cv_dummyattackingbumpspark.value == BUMPSPARK_NOCHARGE)
raflags |= RAF_BUMPDRIFT;
}
else
{
@ -3936,6 +3940,8 @@ void G_AddGhost(char *defdemoname)
if (demoversion <= 0x000B)
{
ourraflags &= ~RAF_AIRDROP;
ourraflags &= ~RAF_BUMPDRIFT;
ourraflags &= ~RAF_BUMPSPARK;
}
if (ourraflags != raflags)

View file

@ -42,6 +42,8 @@ typedef enum
RAF_PURPLEDRIFT = 1<<4,
RAF_SLOPEBOOST = 1<<5,
RAF_AIRDROP = 1<<6,
RAF_BUMPDRIFT = 1<<7,
RAF_BUMPSPARK = 1<<8,
// up to 1<<31 is free
} raflags_t;

View file

@ -484,14 +484,15 @@ SINT8 G_RecordPresetIndex(void)
boolean purpledrift = cv_dummyattackingpurpledrift.value;
boolean slopeboost = cv_dummyattackingslopeboost.value;
boolean airdrop = cv_dummyattackingairdrop.value;
UINT8 bumpspark = cv_dummyattackingbumpspark.value;
if (!rings && !stacking && !chaining && !slipdash && !purpledrift && !slopeboost && !airdrop)
return RP_KART;
if (stacking && chaining && slopeboost && airdrop && !rings && !slipdash && !purpledrift)
if (stacking && chaining && slopeboost && airdrop && !rings && !slipdash && !purpledrift && (bumpspark == BUMPSPARK_ALL))
return RP_TECH;
if (rings && stacking && chaining && slipdash && purpledrift && slopeboost && airdrop)
if (rings && stacking && chaining && slipdash && purpledrift && slopeboost && (bumpspark == BUMPSPARK_NOCHARGE))
return RP_BLAN;
return RP_CUST;

View file

@ -2363,7 +2363,7 @@ void K_SetScoreboardModStatus(const char *name, SINT8 active)
CONS_Alert(CONS_WARNING, "Server mod '%s' does not exist so status cannot be changed.\n", name);
}
#define BASEMODS 12
#define BASEMODS 14
static void K_DrawServerMods(INT32 x, INT32 y)
{
UINT8 i, j;
@ -2382,6 +2382,8 @@ static void K_DrawServerMods(INT32 x, INT32 y)
{"Drafting", 0, NULL, K_DraftingActive() > 0, true},
{"Air Drop", 0, NULL, K_AirDropActive() > 0, true},
{"Bump Spark", 0, &cv_kartbumpspark, -1, true},
{"Bump Drift", 0, NULL, K_GetBumpSpark() > 0, true},
{"Bump Spark", 0, NULL, K_GetBumpSpark() == BUMPSPARK_ALL, true},
{"Bump Spring", 0, &cv_kartbumpspring, -1, true},
{"Alt. Invin.", 0, NULL, K_GetKartInvinType() == KARTINVIN_ALTERN, true}
};

View file

@ -6741,7 +6741,7 @@ void K_AirDrop(player_t *player, ticcmd_t *cmd)
// Returns the bumpspark value as an enum.
INT32 K_GetBumpSpark(void)
{
return max(BUMPSPARK_NONE, min(BUMPSPARK_ALL, (bumpsparktype_t)cv_kartbumpspark.value));
return max(BUMPSPARK_NONE, min(BUMPSPARK_ALL, (bumpsparktype_t)bumpsparkactive));
}
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c

View file

@ -324,6 +324,7 @@ boolean K_SlopeBoostActive(void);
boolean K_DraftingActive(void);
boolean K_AirDropActive(void);
boolean K_GetKartInvinType(void);
INT32 K_GetBumpSpark(void);
boolean K_BoostChain(player_t *player, INT32 timer, boolean chainsound);
INT32 K_ChainOrDeincrementTime(player_t *player, INT32 timer, INT32 deincrement, boolean chainsound);
boolean K_UsingLegacyCheckpoints(void);
@ -354,8 +355,6 @@ typedef enum
BUMPSPARK_ALL
} bumpsparktype_t;
INT32 K_GetBumpSpark(void);
#ifdef __cplusplus
} // extern "C"
#endif

View file

@ -4184,6 +4184,13 @@ static int lib_kGetKartInvinType(lua_State *L)
return 1;
}
// Gets the currently active bumpspark type.
static int lib_kGetBumpSpark(lua_State *L)
{
lua_pushinteger(L, K_GetBumpSpark());
return 1;
}
// Checks if current map is using legacy boss3 bassed checkpoints. Useful for map compat.
static int lib_kUsingLegacyCheckpoints(lua_State *L)
{
@ -5274,6 +5281,7 @@ static luaL_Reg lib[] = {
{"K_SlopeBoostActive",lib_kSlopeBoostActive},
{"K_DraftingActive",lib_kDraftingActive},
{"K_AirDropActive",lib_kAirDropActive},
{"K_GetBumpSpark",lib_kGetBumpSpark},
{"K_GetKartInvinType",lib_kGetKartInvinType},
{"K_UsingLegacyCheckpoints",lib_kUsingLegacyCheckpoints},
{"K_DoBoost",lib_kDoBoost},

View file

@ -399,6 +399,8 @@ int LUA_PushGlobals(lua_State *L, const char *word)
return 1;
} else if (fastcmp(word,"airdropactive")) {
lua_pushinteger(L, airdropactive);
} else if (fastcmp(word,"bumpsparkactive")) {
lua_pushinteger(L, bumpsparkactive);
return 1;
} else if (fastcmp(word,"purpledriftactive")) {
lua_pushinteger(L, purpledriftactive);

View file

@ -458,6 +458,9 @@ consvar_t cv_dummyattackingslopeboost = CVAR_INIT ("dummyattackingslopeboost", "
consvar_t cv_dummyattackingairdrop = CVAR_INIT ("dummyattackingairdrop", "Off", CV_HIDEN|CV_CALL|CV_NOINIT, CV_OnOff, Nextmap_OnChange);
static CV_PossibleValue_t dummybumpspark_cons_t[] = {{BUMPSPARK_NONE, "Off"}, {BUMPSPARK_NOCHARGE, "NoCharge"}, {BUMPSPARK_ALL, "On"}};
consvar_t cv_dummyattackingbumpspark = CVAR_INIT ("dummyattackingbumpspark", "Off", CV_HIDEN|CV_CALL|CV_NOINIT, dummybumpspark_cons_t, Nextmap_OnChange);
static CV_PossibleValue_t dummygpdifficulty_cons_t[] = {{KARTSPEED_EASY, "Easy"}, {KARTSPEED_NORMAL, "Normal"}, {KARTSPEED_HARD, "Hard"}, {KARTSPEED_EXPERT, "Expert"}, {KARTGP_MASTER, "Master"}, {KARTGP_NIGHTMARE, "Nightmare"}, {0, NULL}};
static CV_PossibleValue_t dummygpcup_cons_t[50] = {{1, "TEMP"}}; // A REALLY BIG NUMBER, SINCE THIS IS TEMP UNTIL NEW MENUS
@ -629,6 +632,14 @@ if (cv.value) \
strcat(new_str, str); \
}
#define ADDEQUALS(cv, str, num) \
if (cv.value == num) \
{ \
len += 3; \
new_str = Z_Realloc(new_str, len, PU_STATIC, NULL); \
strcat(new_str, str); \
}
char *M_AppendGametypeAndModName(void)
{
UINT8 len = 4;
@ -652,6 +663,8 @@ char *M_AppendGametypeAndModName(void)
ADD(cv_dummyattackingpurpledrift, "PD-")
ADD(cv_dummyattackingslopeboost, "SB-")
ADD(cv_dummyattackingairdrop, "AD-")
ADDEQUALS(cv_dummyattackingbumpspark, "BD-", BUMPSPARK_NOCHARGE)
ADDEQUALS(cv_dummyattackingbumpspark, "BS-", BUMPSPARK_ALL)
new_str[len-1] = '\0';
@ -2165,6 +2178,7 @@ void M_Init(void)
CV_RegisterVar(&cv_dummyattackingpurpledrift);
CV_RegisterVar(&cv_dummyattackingslopeboost);
CV_RegisterVar(&cv_dummyattackingairdrop);
CV_RegisterVar(&cv_dummyattackingbumpspark);
CV_RegisterVar(&cv_dummygpdifficulty);
CV_RegisterVar(&cv_dummygpencore);
@ -5857,11 +5871,11 @@ INT32 MR_ReplayStaff(INT32 choice)
}
#define NUMPRESETS 3
static boolean presets[NUMPRESETS][7] = {
//rings stacking chaining slipdash purpledrift slopeboost airdrop
{ false, false, false, false, false, false, false }, // SRB2Kart
{ false, true, true, false, false, true, true }, // Tech
{ true, true, true, true, true, true, true }, // BlanKart
static INT32 presets[NUMPRESETS][8] = {
//rings stacking chaining slipdash purpledrift slopeboost airdrop bumpspark
{ 0, 0, 0, 0, 0, 0, 0, BUMPSPARK_NONE }, // SRB2Kart
{ 0, 1, 1, 0, 0, 1, 1, BUMPSPARK_ALL }, // Tech
{ 1, 1, 1, 1, 1, 1, 1, BUMPSPARK_NOCHARGE }, // BlanKart
};
INT32 MR_TimeAttackPreset(INT32 arg)
@ -5870,13 +5884,28 @@ INT32 MR_TimeAttackPreset(INT32 arg)
return false;
boolean *preset = presets[arg];
CV_Set(&cv_dummyattackingrings, preset[0] ? "On" : "Off");
CV_Set(&cv_dummyattackingstacking, preset[1] ? "On" : "Off");
CV_Set(&cv_dummyattackingchaining, preset[2] ? "On" : "Off");
CV_Set(&cv_dummyattackingslipdash, preset[3] ? "On" : "Off");
CV_Set(&cv_dummyattackingpurpledrift, preset[4] ? "On" : "Off");
CV_Set(&cv_dummyattackingslopeboost, preset[5] ? "On" : "Off");
CV_Set(&cv_dummyattackingrings, (boolean)preset[0] ? "On" : "Off");
CV_Set(&cv_dummyattackingstacking, (boolean)preset[1] ? "On" : "Off");
CV_Set(&cv_dummyattackingchaining, (boolean)preset[2] ? "On" : "Off");
CV_Set(&cv_dummyattackingslipdash, (boolean)preset[3] ? "On" : "Off");
CV_Set(&cv_dummyattackingpurpledrift, (boolean)preset[4] ? "On" : "Off");
CV_Set(&cv_dummyattackingslopeboost, (boolean)preset[5] ? "On" : "Off");
CV_Set(&cv_dummyattackingairdrop, preset[6] ? "On" : "Off");
switch(preset[7])
{
case BUMPSPARK_ALL:
CV_Set(&cv_dummyattackingbumpspark, "On");
break;
case BUMPSPARK_NOCHARGE:
CV_Set(&cv_dummyattackingbumpspark, "NoCharge");
break;
case BUMPSPARK_NONE:
/* FALLTHRU */
default:
CV_Set(&cv_dummyattackingbumpspark, "Off");
}
return true;
}
#undef NUMPRESETS

View file

@ -422,7 +422,7 @@ extern consvar_t cv_dummygpdifficulty, cv_dummygpencore, cv_dummygpcup;
extern consvar_t cv_dummymenuplayer, cv_dummyteam, cv_dummyspectate, cv_dummyscramble;
extern consvar_t cv_dummyattackingrings, cv_dummyattackingstacking, cv_dummyattackingchaining;
extern consvar_t cv_dummyattackingslipdash, cv_dummyattackingpurpledrift, cv_dummyattackingslopeboost;
extern consvar_t cv_dummyattackingairdrop;
extern consvar_t cv_dummyattackingairdrop, cv_dummyattackingbumpspark;
extern consvar_t cv_dummystaff;
extern consvar_t cv_dummymultiplayer, cv_dummyip, cv_dummyname, cv_dummyfollower, cv_dummycolor;
extern consvar_t cv_dummyserverpage;

View file

@ -1,7 +1,7 @@
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2023 by James R.
// Copyright (C) 2023 by Kart Krew
// Copyright (C) 2025 by James Robert Roman
// Copyright (C) 2025 by Kart Krew
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -180,10 +180,8 @@ Obj_InitLoopEndpoint
void
Obj_InitLoopCenter (mobj_t *center)
{
const mapthing_t *mt = center->spawnpoint;
center_max_revolution(center) = mt->args[1] * FRACUNIT / 360;
center_set_flip(center, mt->args[0]);
center_max_revolution(center) = center->args[1] * FRACUNIT / 360;
center_set_flip(center, center->args[0]);
}
void
@ -260,7 +258,7 @@ Obj_LoopEndpointCollide
const fixed_t magnitude = R_PointToDist2(0, 0, px, py);
const fixed_t newX = FixedDiv(px, magnitude);
const fixed_t newY = FixedDiv(py, magnitude);
s->origin_shift = {FixedMul(newX, FCOS(anchor->angle)),
FixedMul(newY, FSIN(anchor->angle))};
}
@ -285,15 +283,15 @@ Obj_LoopEndpointCollide
cam->enter_tic = leveltime;
cam->exit_tic = INFTICS;
if (center->spawnpoint->args[4]) // is camera distance set?
if (center->args[4]) // is camera distance set?
{
cam->zoom_out_speed = center->spawnpoint->args[2];
cam->zoom_in_speed = center->spawnpoint->args[3];
cam->dist = center->spawnpoint->args[4] * FRACUNIT;
cam->pan = FixedAngle(center->spawnpoint->args[5] * FRACUNIT);
cam->pan_speed = center->spawnpoint->args[6] * FRACUNIT;
cam->pan_accel = center->spawnpoint->args[7];
cam->pan_back = center->spawnpoint->args[8];
cam->zoom_out_speed = center->args[2];
cam->zoom_in_speed = center->args[3];
cam->dist = center->args[4] * FRACUNIT;
cam->pan = FixedAngle(center->args[5] * FRACUNIT);
cam->pan_speed = center->args[6] * FRACUNIT;
cam->pan_accel = center->args[7];
cam->pan_back = center->args[8];
}
else
{

View file

@ -1,6 +1,7 @@
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2023 by Kart Krew
// Copyright (C) 2025 by James Robert Roman.
// Copyright (C) 2025 by Kart Krew.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -11,7 +12,6 @@
#include "doomdef.h"
#include "d_player.h"
#include "doomstat.h"
#include "k_kart.h"
#include "p_local.h"
#include "p_setup.h"

View file

@ -3479,9 +3479,7 @@ static void P_BouncePlayerMove(mobj_t *mo, TryMoveResult_t *result)
mmomx = mo->player->rmomx;
mmomy = mo->player->rmomy;
UINT32 bumpspark =
max((modeattacking != ATTACKING_NONE) ? BUMPSPARK_NOCHARGE : BUMPSPARK_NONE,
K_GetBumpSpark());
UINT32 bumpspark = K_GetBumpSpark();
if ((bumpspark < BUMPSPARK_ALL) ||
(modeattacking != ATTACKING_NONE && G_CompatLevel(0x0009)))

View file

@ -608,6 +608,7 @@ extern boolean purpledriftactive;
extern boolean slopeboostactive;
extern boolean draftingactive;
extern boolean airdropactive;
extern UINT8 bumpsparkactive;
extern UINT16 bossdisabled;
extern boolean stoppedclock;

View file

@ -5318,6 +5318,7 @@ static void P_NetArchiveMisc(savebuffer_t *save, boolean resending)
WRITEUINT8(save->p, slopeboostactive);
WRITEUINT8(save->p, draftingactive);
WRITEUINT8(save->p, airdropactive);
WRITEUINT8(save->p, bumpsparkactive);
for (i = 0; i < 12; i++)
{
@ -5706,6 +5707,7 @@ FUNCINLINE static ATTRINLINE boolean P_NetUnArchiveMisc(savebuffer_t *save, bool
slopeboostactive = READUINT8(save->p);
draftingactive = READUINT8(save->p);
airdropactive = READUINT8(save->p);
bumpsparkactive = READUINT8(save->p);
for (i = 0; i < 12; i++)
{

View file

@ -155,6 +155,7 @@ boolean purpledriftactive;
boolean slopeboostactive;
boolean draftingactive;
boolean airdropactive;
UINT8 bumpsparkactive;
UINT16 bossdisabled;
boolean stoppedclock;
boolean levelloading;
@ -8036,6 +8037,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
slopeboostactive = false;
draftingactive = false;
airdropactive = false;
bumpsparkactive = 0;
if (cv_kartrings.value)
ringsactive = true;
@ -8061,6 +8063,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
if (cv_kartairdrop.value)
airdropactive = true;
bumpsparkactive = (UINT8)cv_kartbumpspark.value;
invintype = (UINT8)cv_kartinvintype.value;
// emerald hunt
@ -8153,6 +8156,10 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
slopeboostactive = true;
if (raflags & RAF_AIRDROP)
airdropactive = true;
if (raflags & RAF_BUMPSPARK)
bumpsparkactive = BUMPSPARK_ALL;
if (raflags & RAF_BUMPDRIFT)
bumpsparkactive = BUMPSPARK_NOCHARGE;
}
else
{
@ -8163,6 +8170,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
slipdashactive = cv_dummyattackingslipdash.value;
slopeboostactive = cv_dummyattackingslopeboost.value;
airdropactive = cv_dummyattackingairdrop.value;
bumpsparkactive = (UINT8)(cv_dummyattackingbumpspark.value);
}
}
else