Add a 5-second delay before the kill-field kicks in

Until it's ready, the orbs are transparent and the minimap icon blinks. Also, tons more sounds. ALSO, Super Overtime mode.
This commit is contained in:
TehRealSalt 2018-12-06 18:13:40 -05:00
parent 19ca7bf134
commit 43af067415
8 changed files with 44 additions and 18 deletions

View file

@ -398,7 +398,8 @@ consvar_t cv_itemfinder = {"itemfinder", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff,
// Scoring type options
consvar_t cv_match_scoring = {"matchscoring", "Normal", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, match_scoring_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_overtime = {"overtime", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t overtime_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Super"}, {0, NULL}};
consvar_t cv_overtime = {"overtime", "Yes", CV_NETVAR|CV_CHEAT, overtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_rollingdemos = {"rollingdemos", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};

View file

@ -475,8 +475,8 @@ extern SINT8 pickedvote;
*/
typedef struct
{
boolean enabled; ///< Has this been initalized yet?
UINT16 radius; ///< Radius of kill field
UINT8 enabled; ///< Has this been initalized yet?
UINT16 radius, minradius; ///< Radius of kill field
fixed_t x, y, z; ///< Position to center on (z is only used for visuals)
} battleovertime_t;

View file

@ -4394,7 +4394,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
&& !player->kartstuff[k_respawn] && !player->powers[pw_flashing])
{
player->kartstuff[k_wanted]++;
if (battleovertime->enabled)
if (battleovertime->enabled >= 5*TICRATE)
{
if (P_AproxDistance(player->mo->x - battleovertime->x, player->mo->y - battleovertime->y) > (battleovertime->radius<<FRACBITS))
{
@ -7434,6 +7434,8 @@ static void K_drawKartMinimap(void)
// Draw the super item in Battle
if (G_BattleGametype() && battleovertime->enabled)
{
if (battleovertime->enabled >= 5*TICRATE || (battleovertime->enabled & 1))
{
const INT32 prevsplitflags = splitflags;
splitflags &= ~V_HUDTRANSHALF;
@ -7442,6 +7444,7 @@ static void K_drawKartMinimap(void)
K_drawKartMinimapHead(battleovertime->x, battleovertime->y, x, y, splitflags, kp_itemminimap, colormap, AutomapPic);
splitflags = prevsplitflags;
}
}
// Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen)
if (ghosts)

View file

@ -1838,7 +1838,9 @@ void P_CheckTimeLimit(void)
battleovertime->y = item->y;
battleovertime->z = item->z;
battleovertime->radius = 4096;
battleovertime->enabled = true;
battleovertime->minradius = (cv_overtime.value == 2 ? 40 : 512);
battleovertime->enabled++;
S_StartSound(NULL, sfx_kc47);
}
return;
#ifndef TESTOVERTIMEINFREEPLAY

View file

@ -6499,6 +6499,8 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool
mo->destscale = mo->scale/4;
if ((leveltime/2) & 1)
mo->frame++;
if (battleovertime->enabled < 5*TICRATE)
mo->frame |= FF_TRANS50;
/*if (i == 0 && !((leveltime/2) % 3 == 0))
S_StartSoundAtVolume(mo, sfx_s1b1, 64);*/
break;
@ -6513,13 +6515,21 @@ void P_RunBattleOvertime(void)
{
UINT8 i, j;
/*if (!S_IdPlaying(sfx_s3kd4l)) // global ambience
S_StartSound(NULL, sfx_s3kd4l);*/
if (battleovertime->radius > 512)
if (battleovertime->enabled < 5*TICRATE)
{
battleovertime->enabled++;
if (battleovertime->enabled == TICRATE)
S_StartSound(NULL, sfx_bhurry);
if (battleovertime->enabled == 5*TICRATE)
S_StartSound(NULL, sfx_kc40);
}
else
{
if (battleovertime->radius > battleovertime->minradius)
battleovertime->radius--;
else
battleovertime->radius = 512;
battleovertime->radius = battleovertime->minradius;
}
if (leveltime & 1)
{
@ -6533,6 +6543,12 @@ void P_RunBattleOvertime(void)
}
}
if (battleovertime->enabled < 5*TICRATE)
return;
if (!S_IdPlaying(sfx_s3kd4s)) // global ambience
S_StartSoundAtVolume(NULL, sfx_s3kd4s, min(255, (4096-battleovertime->radius)/2));
for (i = 0; i < 16; i++)
{
j = 0;

View file

@ -3301,6 +3301,7 @@ static void P_NetArchiveMisc(void)
// battleovertime_t
WRITEUINT8(save_p, battleovertime->enabled);
WRITEUINT16(save_p, battleovertime->radius);
WRITEUINT16(save_p, battleovertime->minradius);
WRITEFIXED(save_p, battleovertime->x);
WRITEFIXED(save_p, battleovertime->y);
WRITEFIXED(save_p, battleovertime->z);
@ -3413,8 +3414,9 @@ static inline boolean P_NetUnArchiveMisc(void)
battlewanted[i] = READSINT8(save_p);
// battleovertime_t
battleovertime->enabled = (boolean)READUINT8(save_p);
battleovertime->enabled = READUINT8(save_p);
battleovertime->radius = READUINT16(save_p);
battleovertime->minradius = READUINT16(save_p);
battleovertime->x = READFIXED(save_p);
battleovertime->y = READFIXED(save_p);
battleovertime->z = READFIXED(save_p);

View file

@ -815,6 +815,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"chain", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Mementos Reaper
{"mkuma", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Trigger Happy Havoc Monokuma
{"toada", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Arid Sands Toad scream
{"bhurry", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // v1.0.2 Battle overtime
{"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // :shitsfree:
{"dbgsal", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Debug notification

View file

@ -890,6 +890,7 @@ typedef enum
sfx_chain,
sfx_mkuma,
sfx_toada,
sfx_bhurry,
sfx_itfree,
sfx_dbgsal,