mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
This commit is contained in:
commit
0f715454fa
24 changed files with 258 additions and 51 deletions
|
|
@ -923,8 +923,10 @@ boolean CON_Responder(event_t *ev)
|
||||||
// check for console toggle key
|
// check for console toggle key
|
||||||
if (ev->type != ev_console)
|
if (ev->type != ev_console)
|
||||||
{
|
{
|
||||||
|
#ifndef DEVELOP // I have driven this course 45 times and I just want to give myself rocketsneakers
|
||||||
if (modeattacking || metalrecording || marathonmode)
|
if (modeattacking || metalrecording || marathonmode)
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ev->data1 >= NUMKEYS) // See also: HUD_Responder
|
if (ev->data1 >= NUMKEYS) // See also: HUD_Responder
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -671,6 +671,8 @@ struct player_t
|
||||||
|
|
||||||
UINT8 eggmanTransferDelay;
|
UINT8 eggmanTransferDelay;
|
||||||
|
|
||||||
|
fixed_t SPBdistance;
|
||||||
|
|
||||||
UINT8 tripwireReboundDelay; // When failing Tripwire, brieftly lock out speed-based tripwire pass (anti-cheese)
|
UINT8 tripwireReboundDelay; // When failing Tripwire, brieftly lock out speed-based tripwire pass (anti-cheese)
|
||||||
|
|
||||||
mobj_t *stumbleIndicator;
|
mobj_t *stumbleIndicator;
|
||||||
|
|
|
||||||
|
|
@ -6402,6 +6402,7 @@ struct int_const_s const INT_CONST[] = {
|
||||||
|
|
||||||
// Map emblem var flags
|
// Map emblem var flags
|
||||||
{"ME_ENCORE",ME_ENCORE},
|
{"ME_ENCORE",ME_ENCORE},
|
||||||
|
{"ME_SPBATTACK",ME_SPBATTACK},
|
||||||
|
|
||||||
// p_local.h constants
|
// p_local.h constants
|
||||||
{"FLOATSPEED",FLOATSPEED},
|
{"FLOATSPEED",FLOATSPEED},
|
||||||
|
|
|
||||||
|
|
@ -121,11 +121,12 @@ struct recorddata_t
|
||||||
};
|
};
|
||||||
|
|
||||||
// mapvisited is now a set of flags that says what we've done in the map.
|
// mapvisited is now a set of flags that says what we've done in the map.
|
||||||
#define MV_VISITED (1)
|
#define MV_VISITED (1)
|
||||||
#define MV_BEATEN (1<<1)
|
#define MV_BEATEN (1<<1)
|
||||||
#define MV_ENCORE (1<<2)
|
#define MV_ENCORE (1<<2)
|
||||||
#define MV_MAX (MV_VISITED|MV_BEATEN|MV_ENCORE)
|
#define MV_SPBATTACK (1<<3)
|
||||||
#define MV_MP ((MV_MAX+1)<<1)
|
#define MV_MAX (MV_VISITED|MV_BEATEN|MV_ENCORE|MV_SPBATTACK)
|
||||||
|
#define MV_MP ((MV_MAX+1)<<1)
|
||||||
|
|
||||||
// Set if homebrew PWAD stuff has been added.
|
// Set if homebrew PWAD stuff has been added.
|
||||||
extern boolean modifiedgame;
|
extern boolean modifiedgame;
|
||||||
|
|
@ -139,6 +140,7 @@ extern boolean metalrecording;
|
||||||
#define ATTACKING_NONE 0
|
#define ATTACKING_NONE 0
|
||||||
#define ATTACKING_TIME 1
|
#define ATTACKING_TIME 1
|
||||||
#define ATTACKING_LAP (1<<1)
|
#define ATTACKING_LAP (1<<1)
|
||||||
|
#define ATTACKING_SPB (1<<2)
|
||||||
extern UINT8 modeattacking;
|
extern UINT8 modeattacking;
|
||||||
|
|
||||||
// menu demo things
|
// menu demo things
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ demoghost *ghosts = NULL;
|
||||||
#define DEMOVERSION 0x0007
|
#define DEMOVERSION 0x0007
|
||||||
#define DEMOHEADER "\xF0" "KartReplay" "\x0F"
|
#define DEMOHEADER "\xF0" "KartReplay" "\x0F"
|
||||||
|
|
||||||
#define DF_ATTACKMASK (ATTACKING_TIME|ATTACKING_LAP) // This demo contains time/lap data
|
#define DF_ATTACKMASK (ATTACKING_TIME|ATTACKING_LAP|ATTACKING_SPB) // This demo contains time/lap data
|
||||||
|
|
||||||
#define DF_GHOST 0x08 // This demo contains ghost data too!
|
#define DF_GHOST 0x08 // This demo contains ghost data too!
|
||||||
|
|
||||||
|
|
|
||||||
27
src/g_game.c
27
src/g_game.c
|
|
@ -512,10 +512,19 @@ void G_UpdateTimeStickerMedals(UINT16 map, boolean showownrecord)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ET_MAP:
|
||||||
|
{
|
||||||
|
if (emblem->flags & ME_SPBATTACK && cv_dummyspbattack.value)
|
||||||
|
break;
|
||||||
|
goto bademblem;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
goto bademblem;
|
goto bademblem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cv_dummyspbattack.value && !(emblem->flags & ME_SPBATTACK))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!gamedata->collected[(emblem-emblemlocations)] && gonnadrawtime)
|
if (!gamedata->collected[(emblem-emblemlocations)] && gonnadrawtime)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -2429,7 +2438,18 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
itemamount = 0;
|
itemamount = 0;
|
||||||
growshrinktimer = 0;
|
growshrinktimer = 0;
|
||||||
bumper = ((gametyperules & GTR_BUMPERS) ? K_StartingBumperCount() : 0);
|
bumper = ((gametyperules & GTR_BUMPERS) ? K_StartingBumperCount() : 0);
|
||||||
rings = ((gametyperules & GTR_SPHERES) ? 0 : 5);
|
if (gametyperules & GTR_SPHERES)
|
||||||
|
{
|
||||||
|
rings = 0;
|
||||||
|
}
|
||||||
|
else if (modeattacking & ATTACKING_SPB)
|
||||||
|
{
|
||||||
|
rings = 20;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rings = 5;
|
||||||
|
}
|
||||||
spheres = 0;
|
spheres = 0;
|
||||||
kickstartaccel = 0;
|
kickstartaccel = 0;
|
||||||
khudfault = 0;
|
khudfault = 0;
|
||||||
|
|
@ -3684,6 +3704,11 @@ static void G_UpdateVisited(void)
|
||||||
mapheaderinfo[prevmap]->mapvisited |= MV_ENCORE;
|
mapheaderinfo[prevmap]->mapvisited |= MV_ENCORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modeattacking & ATTACKING_SPB)
|
||||||
|
{
|
||||||
|
mapheaderinfo[prevmap]->mapvisited |= MV_SPBATTACK;
|
||||||
|
}
|
||||||
|
|
||||||
if (modeattacking)
|
if (modeattacking)
|
||||||
G_UpdateRecordReplays();
|
G_UpdateRecordReplays();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -193,14 +193,16 @@ static InternalPassData build_pass_manager()
|
||||||
);
|
);
|
||||||
basic_rendering->insert("pp_final_simple_blit", pp_simple_blit_pass);
|
basic_rendering->insert("pp_final_simple_blit", pp_simple_blit_pass);
|
||||||
|
|
||||||
basic_rendering->insert(
|
auto screenshot_rendering = std::make_shared<PassManager>();
|
||||||
|
|
||||||
|
screenshot_rendering->insert(
|
||||||
"screenshot_prepare",
|
"screenshot_prepare",
|
||||||
[screenshot_pass, framebuffer_manager](PassManager&, Rhi&)
|
[screenshot_pass, framebuffer_manager](PassManager&, Rhi&)
|
||||||
{
|
{
|
||||||
screenshot_pass->set_source(framebuffer_manager->current_post_color(), vid.width, vid.height);
|
screenshot_pass->set_source(framebuffer_manager->current_post_color(), vid.width, vid.height);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
basic_rendering->insert("screenshot", screenshot_pass);
|
screenshot_rendering->insert("screenshot", screenshot_pass);
|
||||||
|
|
||||||
// Composite-present takes the current postprocess result and outputs it to the default framebuffer.
|
// Composite-present takes the current postprocess result and outputs it to the default framebuffer.
|
||||||
// It also renders imgui and presents the screen.
|
// It also renders imgui and presents the screen.
|
||||||
|
|
@ -233,6 +235,7 @@ static InternalPassData build_pass_manager()
|
||||||
|
|
||||||
normal_rendering->insert("resource_manager", resource_manager);
|
normal_rendering->insert("resource_manager", resource_manager);
|
||||||
normal_rendering->insert("basic_rendering", basic_rendering);
|
normal_rendering->insert("basic_rendering", basic_rendering);
|
||||||
|
normal_rendering->insert("screenshot_rendering", screenshot_rendering);
|
||||||
normal_rendering->insert("composite_present_rendering", composite_present_rendering);
|
normal_rendering->insert("composite_present_rendering", composite_present_rendering);
|
||||||
|
|
||||||
// Wipe Start Screen Capture rendering
|
// Wipe Start Screen Capture rendering
|
||||||
|
|
@ -305,14 +308,7 @@ static InternalPassData build_pass_manager()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
wipe_rendering->insert("pp_final_wipe", pp_wipe_pass);
|
wipe_rendering->insert("pp_final_wipe", pp_wipe_pass);
|
||||||
wipe_rendering->insert(
|
wipe_rendering->insert("screenshot_rendering", screenshot_rendering);
|
||||||
"screenshot_prepare",
|
|
||||||
[screenshot_pass, framebuffer_manager](PassManager&, Rhi&)
|
|
||||||
{
|
|
||||||
screenshot_pass->set_source(framebuffer_manager->current_post_color(), vid.width, vid.height);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
wipe_rendering->insert("screenshot", screenshot_pass);
|
|
||||||
wipe_rendering->insert("composite_present_rendering", composite_present_rendering);
|
wipe_rendering->insert("composite_present_rendering", composite_present_rendering);
|
||||||
|
|
||||||
InternalPassData ret;
|
InternalPassData ret;
|
||||||
|
|
|
||||||
55
src/k_hud.c
55
src/k_hud.c
|
|
@ -180,19 +180,19 @@ patch_t *kp_capsuletarget_far[2];
|
||||||
patch_t *kp_capsuletarget_far_text[2];
|
patch_t *kp_capsuletarget_far_text[2];
|
||||||
patch_t *kp_capsuletarget_near[8];
|
patch_t *kp_capsuletarget_near[8];
|
||||||
|
|
||||||
static patch_t *kp_button_a[2][2];
|
patch_t *kp_button_a[2][2];
|
||||||
static patch_t *kp_button_b[2][2];
|
patch_t *kp_button_b[2][2];
|
||||||
static patch_t *kp_button_c[2][2];
|
patch_t *kp_button_c[2][2];
|
||||||
static patch_t *kp_button_x[2][2];
|
patch_t *kp_button_x[2][2];
|
||||||
static patch_t *kp_button_y[2][2];
|
patch_t *kp_button_y[2][2];
|
||||||
static patch_t *kp_button_z[2][2];
|
patch_t *kp_button_z[2][2];
|
||||||
static patch_t *kp_button_start[2];
|
patch_t *kp_button_start[2];
|
||||||
static patch_t *kp_button_l[2];
|
patch_t *kp_button_l[2];
|
||||||
static patch_t *kp_button_r[2];
|
patch_t *kp_button_r[2];
|
||||||
static patch_t *kp_button_up[2];
|
patch_t *kp_button_up[2];
|
||||||
static patch_t *kp_button_down[2];
|
patch_t *kp_button_down[2];
|
||||||
static patch_t *kp_button_right[2];
|
patch_t *kp_button_right[2];
|
||||||
static patch_t *kp_button_left[2];
|
patch_t *kp_button_left[2];
|
||||||
|
|
||||||
static void K_LoadButtonGraphics(patch_t *kp[2], int letter)
|
static void K_LoadButtonGraphics(patch_t *kp[2], int letter)
|
||||||
{
|
{
|
||||||
|
|
@ -1654,6 +1654,22 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT32 splitflags, U
|
||||||
workx += 6;
|
workx += 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modeattacking & ATTACKING_SPB && stplyr->SPBdistance > 0)
|
||||||
|
{
|
||||||
|
UINT8 *colormap = R_GetTranslationColormap(stplyr->skin, stplyr->skincolor, GTC_CACHE);
|
||||||
|
int ybar = 180;
|
||||||
|
int widthbar = 120;
|
||||||
|
|
||||||
|
V_DrawFill(160 - widthbar / 2, ybar, widthbar, 1, 6);
|
||||||
|
V_DrawMappedPatch(160 + widthbar/2 - 7, ybar - 7, FRACUNIT, faceprefix[stplyr->skin][FACE_MINIMAP], colormap);
|
||||||
|
|
||||||
|
// vibes-based math
|
||||||
|
int bombxoff = (stplyr->SPBdistance/mapobjectscale - mobjinfo[MT_SPB].radius/FRACUNIT - mobjinfo[MT_PLAYER].radius/FRACUNIT) * 8;
|
||||||
|
bombxoff = sqrt(bombxoff) - 5;
|
||||||
|
bombxoff = max(0, min(bombxoff, widthbar));
|
||||||
|
V_DrawScaledPatch(160 + widthbar/2 - bombxoff, ybar - 7, FRACUNIT, W_CachePatchName("SPBMMAP", PU_CACHE));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static fixed_t K_DrawKartPositionNumPatch(UINT8 num, UINT8 *color, fixed_t x, fixed_t y, fixed_t scale, INT32 flags)
|
static fixed_t K_DrawKartPositionNumPatch(UINT8 num, UINT8 *color, fixed_t x, fixed_t y, fixed_t scale, INT32 flags)
|
||||||
|
|
@ -4639,13 +4655,16 @@ K_drawMiniPing (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void K_drawButtonAnim(INT32 x, INT32 y, INT32 flags, patch_t *button[2], tic_t animtic)
|
||||||
|
{
|
||||||
|
const UINT8 anim_duration = 16;
|
||||||
|
const UINT8 anim = (animtic % (anim_duration * 2)) < anim_duration;
|
||||||
|
V_DrawScaledPatch(x, y, flags, button[anim]);
|
||||||
|
}
|
||||||
|
|
||||||
static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2], INT32 textflags)
|
static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2], INT32 textflags)
|
||||||
{
|
{
|
||||||
INT32 flags = V_SNAPTORIGHT | V_SLIDEIN | V_SPLITSCREEN;
|
INT32 flags = V_SNAPTORIGHT | V_SLIDEIN | V_SPLITSCREEN;
|
||||||
|
|
||||||
const UINT8 anim_duration = 16;
|
|
||||||
const UINT8 anim = (leveltime % (anim_duration * 2)) < anim_duration;
|
|
||||||
|
|
||||||
INT32 x = (BASEVIDWIDTH/2) - 10;
|
INT32 x = (BASEVIDWIDTH/2) - 10;
|
||||||
INT32 y = (idx * 16);
|
INT32 y = (idx * 16);
|
||||||
|
|
||||||
|
|
@ -4660,7 +4679,7 @@ static void K_DrawDirectorButton(INT32 idx, const char *label, patch_t *kp[2], I
|
||||||
|
|
||||||
textflags |= (flags | V_6WIDTHSPACE | V_ALLOWLOWERCASE);
|
textflags |= (flags | V_6WIDTHSPACE | V_ALLOWLOWERCASE);
|
||||||
|
|
||||||
V_DrawScaledPatch(x, y - 4, flags, kp[anim]);
|
K_drawButtonAnim(x, y - 4, flags, kp, leveltime);
|
||||||
V_DrawRightAlignedThinString(x - 2, y, textflags, label);
|
V_DrawRightAlignedThinString(x - 2, y, textflags, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
15
src/k_hud.h
15
src/k_hud.h
|
|
@ -45,6 +45,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
|
||||||
void K_DrawMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, UINT16 map, UINT8 *colormap);
|
void K_DrawMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, UINT16 map, UINT8 *colormap);
|
||||||
void K_DrawLikeMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, patch_t *patch, UINT8 *colormap);
|
void K_DrawLikeMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, patch_t *patch, UINT8 *colormap);
|
||||||
void K_drawTargetHUD(const vector3_t *origin, player_t *player);
|
void K_drawTargetHUD(const vector3_t *origin, player_t *player);
|
||||||
|
void K_drawButtonAnim(INT32 x, INT32 y, INT32 flags, patch_t *button[2], tic_t animtic);
|
||||||
|
|
||||||
extern patch_t *kp_capsuletarget_arrow[2][2];
|
extern patch_t *kp_capsuletarget_arrow[2][2];
|
||||||
extern patch_t *kp_capsuletarget_icon[2];
|
extern patch_t *kp_capsuletarget_icon[2];
|
||||||
|
|
@ -52,6 +53,20 @@ extern patch_t *kp_capsuletarget_far[2];
|
||||||
extern patch_t *kp_capsuletarget_far_text[2];
|
extern patch_t *kp_capsuletarget_far_text[2];
|
||||||
extern patch_t *kp_capsuletarget_near[8];
|
extern patch_t *kp_capsuletarget_near[8];
|
||||||
|
|
||||||
|
extern patch_t *kp_button_a[2][2];
|
||||||
|
extern patch_t *kp_button_b[2][2];
|
||||||
|
extern patch_t *kp_button_c[2][2];
|
||||||
|
extern patch_t *kp_button_x[2][2];
|
||||||
|
extern patch_t *kp_button_y[2][2];
|
||||||
|
extern patch_t *kp_button_z[2][2];
|
||||||
|
extern patch_t *kp_button_start[2];
|
||||||
|
extern patch_t *kp_button_l[2];
|
||||||
|
extern patch_t *kp_button_r[2];
|
||||||
|
extern patch_t *kp_button_up[2];
|
||||||
|
extern patch_t *kp_button_down[2];
|
||||||
|
extern patch_t *kp_button_right[2];
|
||||||
|
extern patch_t *kp_button_left[2];
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -4095,6 +4095,13 @@ INT32 K_ExplodePlayer(player_t *player, mobj_t *inflictor, mobj_t *source) // A
|
||||||
{
|
{
|
||||||
if (inflictor->type == MT_SPBEXPLOSION && inflictor->movefactor)
|
if (inflictor->type == MT_SPBEXPLOSION && inflictor->movefactor)
|
||||||
{
|
{
|
||||||
|
if (modeattacking & ATTACKING_SPB)
|
||||||
|
{
|
||||||
|
P_DamageMobj(player->mo, inflictor, source, 1, DMG_INSTAKILL);
|
||||||
|
player->SPBdistance = 0;
|
||||||
|
S_StopMusic();
|
||||||
|
}
|
||||||
|
|
||||||
spbMultiplier = inflictor->movefactor;
|
spbMultiplier = inflictor->movefactor;
|
||||||
|
|
||||||
if (spbMultiplier <= 0)
|
if (spbMultiplier <= 0)
|
||||||
|
|
|
||||||
13
src/k_menu.h
13
src/k_menu.h
|
|
@ -232,6 +232,7 @@ typedef enum
|
||||||
ta_replay = 0,
|
ta_replay = 0,
|
||||||
ta_guest,
|
ta_guest,
|
||||||
ta_ghosts,
|
ta_ghosts,
|
||||||
|
ta_spb,
|
||||||
ta_spacer,
|
ta_spacer,
|
||||||
ta_start,
|
ta_start,
|
||||||
} ta_e;
|
} ta_e;
|
||||||
|
|
@ -762,6 +763,8 @@ extern consvar_t cv_dummykartspeed;
|
||||||
extern consvar_t cv_dummygpencore;
|
extern consvar_t cv_dummygpencore;
|
||||||
extern consvar_t cv_dummymatchbots;
|
extern consvar_t cv_dummymatchbots;
|
||||||
|
|
||||||
|
extern consvar_t cv_dummyspbattack;
|
||||||
|
|
||||||
void M_SetupDifficultyOptions(INT32 choice);
|
void M_SetupDifficultyOptions(INT32 choice);
|
||||||
void M_SetupDifficultySelect(INT32 choice);
|
void M_SetupDifficultySelect(INT32 choice);
|
||||||
void M_DifficultySelectInputs(INT32 choice);
|
void M_DifficultySelectInputs(INT32 choice);
|
||||||
|
|
@ -798,6 +801,8 @@ void M_StartTimeAttack(INT32 choice);
|
||||||
void M_ReplayTimeAttack(INT32 choice);
|
void M_ReplayTimeAttack(INT32 choice);
|
||||||
void M_HandleStaffReplay(INT32 choice);
|
void M_HandleStaffReplay(INT32 choice);
|
||||||
void M_SetGuestReplay(INT32 choice);
|
void M_SetGuestReplay(INT32 choice);
|
||||||
|
void M_TimeAttackTick(void);
|
||||||
|
boolean M_TimeAttackInputs (INT32 choice);
|
||||||
|
|
||||||
// MP selection
|
// MP selection
|
||||||
void M_MPOptSelect(INT32 choice);
|
void M_MPOptSelect(INT32 choice);
|
||||||
|
|
@ -1142,6 +1147,14 @@ void M_DrawAddons(void);
|
||||||
|
|
||||||
#define TILEFLIP_MAX 16
|
#define TILEFLIP_MAX 16
|
||||||
|
|
||||||
|
extern struct timeattackmenu_s {
|
||||||
|
|
||||||
|
tic_t ticker; // How long the menu's been open for
|
||||||
|
tic_t spbflicker; // used for SPB flicker-in
|
||||||
|
|
||||||
|
} timeattackmenu;
|
||||||
|
|
||||||
|
|
||||||
// Keep track of some pause menu data for visual goodness.
|
// Keep track of some pause menu data for visual goodness.
|
||||||
extern struct challengesmenu_s {
|
extern struct challengesmenu_s {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2382,6 +2382,28 @@ void M_DrawTimeAttack(void)
|
||||||
|
|
||||||
V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST TIME:");
|
V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST TIME:");
|
||||||
K_drawKartTimestamp(timerec, 162+t, timeheight+6, 0, 1);
|
K_drawKartTimestamp(timerec, 162+t, timeheight+6, 0, 1);
|
||||||
|
|
||||||
|
// SPB Attack control hint + menu overlay
|
||||||
|
if (levellist.newgametype == GT_RACE && levellist.levelsearch.timeattack == true)
|
||||||
|
{
|
||||||
|
const UINT8 anim_duration = 16;
|
||||||
|
const UINT8 anim = (timeattackmenu.ticker % (anim_duration * 2)) < anim_duration;
|
||||||
|
|
||||||
|
INT32 buttonx = 162 + t;
|
||||||
|
INT32 buttony = timeheight;
|
||||||
|
|
||||||
|
if (anim)
|
||||||
|
V_DrawScaledPatch(buttonx + 35, buttony - 3, V_SNAPTOLEFT, W_CachePatchName("TLB_I", PU_CACHE));
|
||||||
|
else
|
||||||
|
V_DrawScaledPatch(buttonx + 35, buttony - 3, V_SNAPTOLEFT, W_CachePatchName("TLB_IB", PU_CACHE));
|
||||||
|
|
||||||
|
if (timeattackmenu.ticker > (timeattackmenu.spbflicker + TICRATE/6) || timeattackmenu.ticker % 2)
|
||||||
|
{
|
||||||
|
if (cv_dummyspbattack.value)
|
||||||
|
V_DrawMappedPatch(buttonx + 7, buttony - 1, 0, W_CachePatchName("K_SPBATK", PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_RED, GTC_MENUCACHE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
opty = 80;
|
opty = 80;
|
||||||
|
|
|
||||||
|
|
@ -1160,6 +1160,8 @@ void M_Init(void)
|
||||||
CV_RegisterVar(&cv_dummygpencore);
|
CV_RegisterVar(&cv_dummygpencore);
|
||||||
CV_RegisterVar(&cv_dummymatchbots);
|
CV_RegisterVar(&cv_dummymatchbots);
|
||||||
|
|
||||||
|
CV_RegisterVar(&cv_dummyspbattack);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_dummyaddonsearch);
|
CV_RegisterVar(&cv_dummyaddonsearch);
|
||||||
|
|
||||||
M_UpdateMenuBGImage(true);
|
M_UpdateMenuBGImage(true);
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,13 @@ static kartitems_t K_KartItemReelTimeAttack[] =
|
||||||
KITEM_NONE
|
KITEM_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static kartitems_t K_KartItemReelSPBAttack[] =
|
||||||
|
{
|
||||||
|
KITEM_GACHABOM,
|
||||||
|
KITEM_SUPERRING,
|
||||||
|
KITEM_NONE
|
||||||
|
};
|
||||||
|
|
||||||
static kartitems_t K_KartItemReelBreakTheCapsules[] =
|
static kartitems_t K_KartItemReelBreakTheCapsules[] =
|
||||||
{
|
{
|
||||||
KITEM_GACHABOM,
|
KITEM_GACHABOM,
|
||||||
|
|
@ -1237,6 +1244,10 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet
|
||||||
{
|
{
|
||||||
presetlist = K_KartItemReelBreakTheCapsules;
|
presetlist = K_KartItemReelBreakTheCapsules;
|
||||||
}
|
}
|
||||||
|
else if (modeattacking & ATTACKING_SPB)
|
||||||
|
{
|
||||||
|
presetlist = K_KartItemReelSPBAttack;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; presetlist[i] != KITEM_NONE; i++)
|
for (i = 0; presetlist[i] != KITEM_NONE; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1420,6 +1420,9 @@ UINT8 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separa
|
||||||
if (embtype & ME_ENCORE)
|
if (embtype & ME_ENCORE)
|
||||||
flags |= MV_ENCORE;
|
flags |= MV_ENCORE;
|
||||||
|
|
||||||
|
if (embtype & ME_SPBATTACK)
|
||||||
|
flags |= MV_SPBATTACK;
|
||||||
|
|
||||||
res = ((mapheaderinfo[levelnum]->mapvisited & flags) == flags);
|
res = ((mapheaderinfo[levelnum]->mapvisited & flags) == flags);
|
||||||
|
|
||||||
gamedata->collected[i] = res;
|
gamedata->collected[i] = res;
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ struct conditionset_t
|
||||||
|
|
||||||
// Map emblem flags
|
// Map emblem flags
|
||||||
#define ME_ENCORE 1 // Achieve in Encore
|
#define ME_ENCORE 1 // Achieve in Encore
|
||||||
|
#define ME_SPBATTACK 2 // Achieve in SPB Attack
|
||||||
|
|
||||||
struct emblem_t
|
struct emblem_t
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,47 @@
|
||||||
#include "../m_misc.h" // M_MkdirEach
|
#include "../m_misc.h" // M_MkdirEach
|
||||||
#include "../z_zone.h" // Z_StrDup/Z_Free
|
#include "../z_zone.h" // Z_StrDup/Z_Free
|
||||||
|
|
||||||
|
static void CV_SPBAttackChanged(void)
|
||||||
|
{
|
||||||
|
G_UpdateTimeStickerMedals(levellist.choosemap, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
consvar_t cv_dummyspbattack = CVAR_INIT ("dummyspbattack", "Off", CV_HIDDEN|CV_CALL, CV_OnOff, CV_SPBAttackChanged);
|
||||||
|
|
||||||
|
struct timeattackmenu_s timeattackmenu;
|
||||||
|
|
||||||
|
void M_TimeAttackTick(void)
|
||||||
|
{
|
||||||
|
timeattackmenu.ticker++;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean M_TimeAttackInputs(INT32 ch)
|
||||||
|
{
|
||||||
|
const UINT8 pid = 0;
|
||||||
|
const boolean buttonR = M_MenuButtonPressed(pid, MBT_R);
|
||||||
|
(void) ch;
|
||||||
|
|
||||||
|
if (buttonR && levellist.newgametype == GT_RACE)
|
||||||
|
{
|
||||||
|
CV_AddValue(&cv_dummyspbattack, 1);
|
||||||
|
timeattackmenu.spbflicker = timeattackmenu.ticker;
|
||||||
|
if (cv_dummyspbattack.value)
|
||||||
|
{
|
||||||
|
S_StartSound(NULL, sfx_s3k9f);
|
||||||
|
S_StopSoundByID(NULL, sfx_s3k92);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
S_StartSound(NULL, sfx_s3k92);
|
||||||
|
S_StopSoundByID(NULL, sfx_s3k9f);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// see ta_e
|
// see ta_e
|
||||||
menuitem_t PLAY_TimeAttack[] =
|
menuitem_t PLAY_TimeAttack[] =
|
||||||
{
|
{
|
||||||
|
|
@ -30,10 +71,10 @@ menu_t PLAY_TimeAttackDef = {
|
||||||
NULL,
|
NULL,
|
||||||
2, 5,
|
2, 5,
|
||||||
M_DrawTimeAttack,
|
M_DrawTimeAttack,
|
||||||
|
M_TimeAttackTick,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
M_TimeAttackInputs
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -426,6 +467,11 @@ void M_StartTimeAttack(INT32 choice)
|
||||||
modeattacking |= ATTACKING_LAP;
|
modeattacking |= ATTACKING_LAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cv_dummyspbattack.value)
|
||||||
|
{
|
||||||
|
modeattacking |= ATTACKING_SPB;
|
||||||
|
}
|
||||||
|
|
||||||
// Still need to reset devmode
|
// Still need to reset devmode
|
||||||
cht_debug = 0;
|
cht_debug = 0;
|
||||||
emeralds = 0;
|
emeralds = 0;
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,9 @@ boolean M_LevelListFromGametype(INT16 gt)
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (levellist.levelsearch.timeattack == false || levellist.newgametype != GT_RACE)
|
||||||
|
CV_SetValue(&cv_dummyspbattack, 0);
|
||||||
|
|
||||||
// Obviously go to Cup Select in gametypes that have cups.
|
// Obviously go to Cup Select in gametypes that have cups.
|
||||||
// Use a really long level select in gametypes that don't use cups.
|
// Use a really long level select in gametypes that don't use cups.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,9 @@ static void SPBMantaRings(mobj_t *spb)
|
||||||
const fixed_t floatHeight = 24 * spb->scale;
|
const fixed_t floatHeight = 24 * spb->scale;
|
||||||
fixed_t floorDist = INT32_MAX;
|
fixed_t floorDist = INT32_MAX;
|
||||||
|
|
||||||
|
if (modeattacking & ATTACKING_SPB)
|
||||||
|
return; // no one else to use 'em
|
||||||
|
|
||||||
if (leveltime % SPB_MANTA_VRATE == 0)
|
if (leveltime % SPB_MANTA_VRATE == 0)
|
||||||
{
|
{
|
||||||
spb_manta_vscale(spb) = max(spb_manta_vscale(spb) - 1, SPB_MANTA_VMAX);
|
spb_manta_vscale(spb) = max(spb_manta_vscale(spb) - 1, SPB_MANTA_VMAX);
|
||||||
|
|
@ -730,6 +733,8 @@ static void SPBChase(mobj_t *spb, mobj_t *bestMobj)
|
||||||
|
|
||||||
dist = P_AproxDistance(P_AproxDistance(spb->x - chase->x, spb->y - chase->y), spb->z - chase->z);
|
dist = P_AproxDistance(P_AproxDistance(spb->x - chase->x, spb->y - chase->y), spb->z - chase->z);
|
||||||
|
|
||||||
|
chasePlayer->SPBdistance = dist;
|
||||||
|
|
||||||
desiredSpeed = FixedMul(baseSpeed, FRACUNIT + FixedDiv(dist - range, range));
|
desiredSpeed = FixedMul(baseSpeed, FRACUNIT + FixedDiv(dist - range, range));
|
||||||
|
|
||||||
if (desiredSpeed < baseSpeed)
|
if (desiredSpeed < baseSpeed)
|
||||||
|
|
|
||||||
|
|
@ -1921,7 +1921,7 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player->exiting && specialstageinfo.valid == true)
|
if (!player->exiting && (specialstageinfo.valid == true || modeattacking & ATTACKING_SPB))
|
||||||
{
|
{
|
||||||
player->pflags |= PF_NOCONTEST;
|
player->pflags |= PF_NOCONTEST;
|
||||||
P_DoPlayerExit(player);
|
P_DoPlayerExit(player);
|
||||||
|
|
|
||||||
|
|
@ -12175,7 +12175,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
|
||||||
boolean isRingCapsule = (mthing->args[0] < 1 || mthing->args[0] == KITEM_SUPERRING || mthing->args[0] >= NUMKARTITEMS);
|
boolean isRingCapsule = (mthing->args[0] < 1 || mthing->args[0] == KITEM_SUPERRING || mthing->args[0] >= NUMKARTITEMS);
|
||||||
|
|
||||||
// don't spawn ring capsules in GTR_SPHERES gametypes
|
// don't spawn ring capsules in GTR_SPHERES gametypes
|
||||||
if (isRingCapsule && (gametyperules & GTR_SPHERES))
|
if (isRingCapsule && ((gametyperules & GTR_SPHERES) || (modeattacking & ATTACKING_SPB)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// in record attack, only spawn ring capsules
|
// in record attack, only spawn ring capsules
|
||||||
|
|
@ -12185,6 +12185,10 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MT_RING:
|
||||||
|
if (modeattacking & ATTACKING_SPB)
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -12224,7 +12228,7 @@ static mobjtype_t P_GetMobjtypeSubstitute(mapthing_t *mthing, mobjtype_t i)
|
||||||
|
|
||||||
if ((i == MT_RANDOMITEM) && (gametyperules & (GTR_PAPERITEMS|GTR_CIRCUIT)) == (GTR_PAPERITEMS|GTR_CIRCUIT))
|
if ((i == MT_RANDOMITEM) && (gametyperules & (GTR_PAPERITEMS|GTR_CIRCUIT)) == (GTR_PAPERITEMS|GTR_CIRCUIT))
|
||||||
return MT_PAPERITEMSPOT;
|
return MT_PAPERITEMSPOT;
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1973,6 +1973,13 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
rainbowstartavailable = false;
|
rainbowstartavailable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->laps == 1 && modeattacking & ATTACKING_SPB)
|
||||||
|
{
|
||||||
|
P_SpawnMobj(player->mo->x - FixedMul(1000*mapobjectscale, FINECOSINE(player->mo->angle >> ANGLETOFINESHIFT)),
|
||||||
|
player->mo->y - FixedMul(1000*mapobjectscale, FINESINE(player->mo->angle >> ANGLETOFINESHIFT)),
|
||||||
|
player->mo->z, MT_SPB);
|
||||||
|
}
|
||||||
|
|
||||||
if (netgame && player->laps > numlaps)
|
if (netgame && player->laps > numlaps)
|
||||||
CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players]));
|
CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players]));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1324,15 +1324,25 @@ void ST_Drawer(void)
|
||||||
switch (demo.savemode)
|
switch (demo.savemode)
|
||||||
{
|
{
|
||||||
case DSM_NOTSAVING:
|
case DSM_NOTSAVING:
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_YELLOWMAP, "(B) or (X): Save replay");
|
{
|
||||||
break;
|
INT32 buttonx = BASEVIDWIDTH;
|
||||||
|
INT32 buttony = 2;
|
||||||
|
|
||||||
|
K_drawButtonAnim(buttonx - 76, buttony, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT, kp_button_b[1], leveltime);
|
||||||
|
V_DrawRightAlignedThinString(buttonx - 55, buttony, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_YELLOWMAP, "or");
|
||||||
|
K_drawButtonAnim(buttonx - 55, buttony, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT, kp_button_x[1], leveltime);
|
||||||
|
V_DrawRightAlignedThinString(buttonx - 2, buttony, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_YELLOWMAP, "Save replay");
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DSM_WILLAUTOSAVE:
|
case DSM_WILLAUTOSAVE:
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_YELLOWMAP, "Replay will be saved. (Look Backward: Change title)");
|
{
|
||||||
|
V_DrawRightAlignedThinString(BASEVIDWIDTH - 55, 2, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_YELLOWMAP, "Replay will be saved.");
|
||||||
|
K_drawButtonAnim(BASEVIDWIDTH - 56, 0, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT, kp_button_b[1], leveltime);
|
||||||
|
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_YELLOWMAP, "Change title");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case DSM_WILLSAVE:
|
case DSM_WILLSAVE:
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_YELLOWMAP, "Replay will be saved.");
|
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_YELLOWMAP, "Replay will be saved.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSM_TITLEENTRY:
|
case DSM_TITLEENTRY:
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ static INT32 powertype = PWRLV_DISABLED;
|
||||||
static INT32 intertic;
|
static INT32 intertic;
|
||||||
static INT32 endtic = -1;
|
static INT32 endtic = -1;
|
||||||
static INT32 sorttic = -1;
|
static INT32 sorttic = -1;
|
||||||
|
static INT32 replayprompttic;
|
||||||
|
|
||||||
intertype_t intertype = int_none;
|
intertype_t intertype = int_none;
|
||||||
|
|
||||||
|
|
@ -599,12 +600,19 @@ skiptallydrawer:
|
||||||
{
|
{
|
||||||
switch (demo.savemode)
|
switch (demo.savemode)
|
||||||
{
|
{
|
||||||
case DSM_NOTSAVING:
|
case DSM_NOTSAVING:
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|hilicol, "(B) or (X): Save replay");
|
{
|
||||||
break;
|
INT32 buttonx = BASEVIDWIDTH;
|
||||||
|
INT32 buttony = 2;
|
||||||
|
|
||||||
|
K_drawButtonAnim(buttonx - 76, buttony, V_SNAPTOTOP|V_SNAPTORIGHT, kp_button_b[1], replayprompttic);
|
||||||
|
V_DrawRightAlignedThinString(buttonx - 55, buttony, V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|hilicol, "or");
|
||||||
|
K_drawButtonAnim(buttonx - 55, buttony, V_SNAPTOTOP|V_SNAPTORIGHT, kp_button_x[1], replayprompttic);
|
||||||
|
V_DrawRightAlignedThinString(buttonx - 2, buttony, V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|hilicol, "Save replay");
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DSM_SAVED:
|
case DSM_SAVED:
|
||||||
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|hilicol, "Replay saved!");
|
V_DrawRightAlignedThinString(BASEVIDWIDTH - 2, 2, V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|hilicol, "Replay saved!");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DSM_TITLEENTRY:
|
case DSM_TITLEENTRY:
|
||||||
|
|
@ -633,8 +641,11 @@ void Y_Ticker(void)
|
||||||
if (demo.recording)
|
if (demo.recording)
|
||||||
{
|
{
|
||||||
if (demo.savemode == DSM_NOTSAVING)
|
if (demo.savemode == DSM_NOTSAVING)
|
||||||
|
{
|
||||||
|
replayprompttic++;
|
||||||
G_CheckDemoTitleEntry();
|
G_CheckDemoTitleEntry();
|
||||||
|
}
|
||||||
|
|
||||||
if (demo.savemode == DSM_WILLSAVE || demo.savemode == DSM_WILLAUTOSAVE)
|
if (demo.savemode == DSM_WILLSAVE || demo.savemode == DSM_WILLAUTOSAVE)
|
||||||
G_SaveDemo();
|
G_SaveDemo();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue