Merge branch 'fortnite' into 'master'

Battle sudden death

See merge request KartKrew/Kart!166
This commit is contained in:
Sal 2019-10-03 01:27:09 -04:00
commit 8338d3e71c
17 changed files with 831 additions and 331 deletions

View file

@ -409,7 +409,8 @@ consvar_t cv_itemfinder = {"itemfinder", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff,
// Scoring type options // 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_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}; consvar_t cv_rollingdemos = {"rollingdemos", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -4743,8 +4744,8 @@ static void TimeLimit_OnChange(void)
if (cv_timelimit.value != 0) if (cv_timelimit.value != 0)
{ {
CONS_Printf(M_GetText("Levels will end after %d minute%s.\n"),cv_timelimit.value,cv_timelimit.value == 1 ? "" : "s"); // Graue 11-17-2003 CONS_Printf(M_GetText("Levels will end after %d second%s.\n"),cv_timelimit.value,cv_timelimit.value == 1 ? "" : "s"); // Graue 11-17-2003
timelimitintics = cv_timelimit.value * 60 * TICRATE; timelimitintics = cv_timelimit.value * TICRATE;
//add hidetime for tag too! //add hidetime for tag too!
if (G_TagGametype()) if (G_TagGametype())
@ -4794,9 +4795,9 @@ void D_GameTypeChanged(INT32 lastgametype)
case GT_TEAMMATCH: case GT_TEAMMATCH:
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
{ {
// default settings for match: no timelimit, no pointlimit // default settings for match: 2 mins, no pointlimit
CV_SetValue(&cv_pointlimit, 0); CV_SetValue(&cv_pointlimit, 0);
CV_SetValue(&cv_timelimit, 0); CV_SetValue(&cv_timelimit, 120);
} }
if (!cv_itemrespawntime.changed) if (!cv_itemrespawntime.changed)
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
@ -5102,7 +5103,7 @@ static void Hidetime_OnChange(void)
//uh oh, gotta change timelimitintics now too //uh oh, gotta change timelimitintics now too
if (G_TagGametype()) if (G_TagGametype())
timelimitintics = (cv_timelimit.value * 60 * TICRATE) + (hidetime * TICRATE); timelimitintics = (cv_timelimit.value * TICRATE) + (hidetime * TICRATE);
} }
static void Command_Showmap_f(void) static void Command_Showmap_f(void)

View file

@ -330,6 +330,7 @@ typedef enum
k_tiregrease, // Reduced friction timer after hitting a horizontal spring k_tiregrease, // Reduced friction timer after hitting a horizontal spring
k_springstars, // Spawn stars around a player when they hit a spring k_springstars, // Spawn stars around a player when they hit a spring
k_springcolor, // Color of spring stars k_springcolor, // Color of spring stars
k_killfield, // How long have you been in the kill field, stay in too long and lose a bumper
NUMKARTSTUFF NUMKARTSTUFF
} kartstufftype_t; } kartstufftype_t;

View file

@ -7201,6 +7201,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_TIREGREASE", "S_TIREGREASE",
"S_OVERTIMEFOG",
"S_OVERTIMEORB",
"S_OVERTIMEBEAM",
#ifdef SEENAMES #ifdef SEENAMES
"S_NAMECHECK", "S_NAMECHECK",
#endif #endif
@ -7995,6 +7999,10 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_DRAFTDUST", "MT_DRAFTDUST",
"MT_TIREGREASE", "MT_TIREGREASE",
"MT_OVERTIMEFOG",
"MT_OVERTIMEORB",
"MT_OVERTIMEBEAM",
#ifdef SEENAMES #ifdef SEENAMES
"MT_NAMECHECK", "MT_NAMECHECK",
#endif #endif
@ -8483,7 +8491,8 @@ static const char *const KARTSTUFF_LIST[] = {
"GROWCANCEL", "GROWCANCEL",
"TIREGREASE", "TIREGREASE",
"SPRINGSTARS", "SPRINGSTARS",
"SPRINGCOLOR" "SPRINGCOLOR",
"KILLFIELD"
}; };
#endif #endif

View file

@ -487,6 +487,15 @@ extern INT16 votelevels[5][2];
extern SINT8 votes[MAXPLAYERS]; extern SINT8 votes[MAXPLAYERS];
extern SINT8 pickedvote; extern SINT8 pickedvote;
/** Battle overtime information
*/
extern struct battleovertime
{
UINT16 enabled; ///< Has this been initalized yet?
fixed_t radius, minradius; ///< Radius of kill field
fixed_t x, y, z; ///< Position to center on
} battleovertime;
extern tic_t hidetime; extern tic_t hidetime;
extern UINT32 timesBeaten; // # of times the game has been beaten. extern UINT32 timesBeaten; // # of times the game has been beaten.

View file

@ -261,6 +261,9 @@ INT16 votelevels[5][2]; // Levels that were rolled by the host
SINT8 votes[MAXPLAYERS]; // Each player's vote SINT8 votes[MAXPLAYERS]; // Each player's vote
SINT8 pickedvote; // What vote the host rolls SINT8 pickedvote; // What vote the host rolls
// Battle overtime system
struct battleovertime battleovertime;
// Server-sided, synched variables // Server-sided, synched variables
SINT8 battlewanted[4]; // WANTED players in battle, worth x2 points SINT8 battlewanted[4]; // WANTED players in battle, worth x2 points
tic_t wantedcalcdelay; // Time before it recalculates WANTED tic_t wantedcalcdelay; // Time before it recalculates WANTED

View file

@ -70,7 +70,7 @@ char sprnames[NUMSPRITES + 1][5] =
"DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA","MKMP", "DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA","MKMP",
"RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT","RFRT", "RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT","RFRT",
"PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL","RGSP", "PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL","RGSP",
"DRAF","GRES","XMS4","XMS5","VIEW" "DRAF","GRES","OTFG","XMS4","XMS5","VIEW"
}; };
// Doesn't work with g++, needs actionf_p1 (don't modify this comment) // Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -3454,6 +3454,10 @@ state_t states[NUMSTATES] =
{SPR_GRES, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 2, 4, S_NULL}, // S_TIREGREASE {SPR_GRES, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 2, 4, S_NULL}, // S_TIREGREASE
{SPR_OTFG, FF_FULLBRIGHT|FF_TRANS50, TICRATE, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEFOG
{SPR_OTFG, 2|FF_FULLBRIGHT|FF_PAPERSPRITE, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEORB
{SPR_OTFG, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEBEAM
#ifdef SEENAMES #ifdef SEENAMES
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
#endif #endif
@ -20300,6 +20304,94 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate S_NULL // raisestate
}, },
{ // MT_OVERTIMEFOG
-1, // doomednum
S_OVERTIMEFOG, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16<<FRACBITS, // radius
32<<FRACBITS, // height
-1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_OVERTIMEORB
-1, // doomednum
S_OVERTIMEORB, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16<<FRACBITS, // radius
48<<FRACBITS, // height
-1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_OVERTIMEBEAM
-1, // doomednum
S_OVERTIMEBEAM, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
48<<FRACBITS, // radius
48<<FRACBITS, // height
-1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
8<<FRACBITS, // radius
16<<FRACBITS, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
// ============================================================================================================================// // ============================================================================================================================//
#ifdef SEENAMES #ifdef SEENAMES

View file

@ -784,6 +784,8 @@ typedef enum sprite
SPR_DRAF, SPR_DRAF,
SPR_GRES, SPR_GRES,
SPR_OTFG,
// Xmas-specific sprites that don't fit aboxe // Xmas-specific sprites that don't fit aboxe
SPR_XMS4, SPR_XMS4,
SPR_XMS5, SPR_XMS5,
@ -4116,6 +4118,10 @@ typedef enum state
S_TIREGREASE, S_TIREGREASE,
S_OVERTIMEFOG,
S_OVERTIMEORB,
S_OVERTIMEBEAM,
#ifdef SEENAMES #ifdef SEENAMES
S_NAMECHECK, S_NAMECHECK,
#endif #endif
@ -4927,6 +4933,10 @@ typedef enum mobj_type
MT_DRAFTDUST, MT_DRAFTDUST,
MT_TIREGREASE, MT_TIREGREASE,
MT_OVERTIMEFOG,
MT_OVERTIMEORB,
MT_OVERTIMEBEAM,
#ifdef SEENAMES #ifdef SEENAMES
MT_NAMECHECK, MT_NAMECHECK,
#endif #endif

View file

@ -5139,6 +5139,25 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->mo->color = player->skincolor; player->mo->color = player->skincolor;
} }
} }
else if (player->kartstuff[k_killfield]) // You're gonna REALLY diiiiie
{
const INT32 flashtime = 4<<(4-(player->kartstuff[k_killfield]/TICRATE));
if (player->kartstuff[k_killfield] == 1 || (player->kartstuff[k_killfield] % (flashtime/2) != 0))
{
player->mo->colorized = false;
player->mo->color = player->skincolor;
}
else if (player->kartstuff[k_killfield] % flashtime == 0)
{
player->mo->colorized = true;
player->mo->color = SKINCOLOR_BYZANTIUM;
}
else
{
player->mo->colorized = true;
player->mo->color = SKINCOLOR_RUBY;
}
}
else if (player->kartstuff[k_ringboost] && (leveltime & 1)) // ring boosting else if (player->kartstuff[k_ringboost] && (leveltime & 1)) // ring boosting
{ {
player->mo->colorized = true; player->mo->colorized = true;
@ -5310,8 +5329,28 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
K_KartPlayerHUDUpdate(player); K_KartPlayerHUDUpdate(player);
if (G_BattleGametype() && player->kartstuff[k_bumper] > 0) if (G_BattleGametype() && player->kartstuff[k_bumper] > 0
&& !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer]
&& !player->kartstuff[k_respawn] && !player->powers[pw_flashing])
{
player->kartstuff[k_wanted]++; player->kartstuff[k_wanted]++;
if (battleovertime.enabled >= 10*TICRATE)
{
if (P_AproxDistance(player->mo->x - battleovertime.x, player->mo->y - battleovertime.y) > battleovertime.radius)
{
player->kartstuff[k_killfield]++;
if (player->kartstuff[k_killfield] > 4*TICRATE)
{
K_SpinPlayer(player, NULL, 0, NULL, false);
//player->kartstuff[k_killfield] = 1;
}
}
else if (player->kartstuff[k_killfield] > 0)
player->kartstuff[k_killfield]--;
}
}
else if (player->kartstuff[k_killfield] > 0)
player->kartstuff[k_killfield]--;
if (P_IsObjectOnGround(player->mo)) if (P_IsObjectOnGround(player->mo))
player->kartstuff[k_waterskip] = 0; player->kartstuff[k_waterskip] = 0;
@ -7044,6 +7083,7 @@ static patch_t *kp_lapanim_emblem[2];
static patch_t *kp_lapanim_hand[3]; static patch_t *kp_lapanim_hand[3];
static patch_t *kp_yougotem; static patch_t *kp_yougotem;
static patch_t *kp_itemminimap;
void K_LoadKartHUDGraphics(void) void K_LoadKartHUDGraphics(void)
{ {
@ -7344,6 +7384,7 @@ void K_LoadKartHUDGraphics(void)
} }
kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX); kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX);
kp_itemminimap = (patch_t *) W_CachePatchName("MMAPITEM", PU_HUDGFX);
} }
// For the item toggle menu // For the item toggle menu
@ -8869,7 +8910,7 @@ static void K_drawKartPlayerCheck(void)
} }
} }
static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, patch_t *AutomapPic) static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, patch_t *icon, UINT8 *colormap, patch_t *AutomapPic)
{ {
// amnum xpos & ypos are the icon's speed around the HUD. // amnum xpos & ypos are the icon's speed around the HUD.
// The number being divided by is for how fast it moves. // The number being divided by is for how fast it moves.
@ -8878,8 +8919,6 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
// am xpos & ypos are the icon's starting position. Withouht // am xpos & ypos are the icon's starting position. Withouht
// it, they wouldn't 'spawn' on the top-right side of the HUD. // it, they wouldn't 'spawn' on the top-right side of the HUD.
UINT8 skin = 0;
fixed_t amnumxpos, amnumypos; fixed_t amnumxpos, amnumypos;
INT32 amxpos, amypos; INT32 amxpos, amypos;
@ -8890,9 +8929,6 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
fixed_t xoffset, yoffset; fixed_t xoffset, yoffset;
fixed_t xscale, yscale, zoom; fixed_t xscale, yscale, zoom;
if (mo->skin)
skin = ((skin_t*)mo->skin)-skins;
maxx = maxy = INT32_MAX; maxx = maxy = INT32_MAX;
minx = miny = INT32_MIN; minx = miny = INT32_MIN;
minx = bsp->bbox[0][BOXLEFT]; minx = bsp->bbox[0][BOXLEFT];
@ -8929,39 +8965,23 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
yscale = FixedDiv(AutomapPic->height, mapheight); yscale = FixedDiv(AutomapPic->height, mapheight);
zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20); zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20);
amnumxpos = (FixedMul(mo->x, zoom) - FixedMul(xoffset, zoom)); amnumxpos = (FixedMul(objx, zoom) - FixedMul(xoffset, zoom));
amnumypos = -(FixedMul(mo->y, zoom) - FixedMul(yoffset, zoom)); amnumypos = -(FixedMul(objy, zoom) - FixedMul(yoffset, zoom));
if (encoremode) if (encoremode)
amnumxpos = -amnumxpos; amnumxpos = -amnumxpos;
amxpos = amnumxpos + ((x + AutomapPic->width/2 - (facemmapprefix[skin]->width/2))<<FRACBITS); amxpos = amnumxpos + ((hudx + AutomapPic->width/2 - (icon->width/2))<<FRACBITS);
amypos = amnumypos + ((y + AutomapPic->height/2 - (facemmapprefix[skin]->height/2))<<FRACBITS); amypos = amnumypos + ((hudy + AutomapPic->height/2 - (icon->height/2))<<FRACBITS);
// do we want this? it feels unnecessary. easier to just modify the amnumxpos? // do we want this? it feels unnecessary. easier to just modify the amnumxpos?
/*if (encoremode) /*if (encoremode)
{ {
flags |= V_FLIP; flags |= V_FLIP;
amxpos = -amnumxpos + ((x + AutomapPic->width/2 + (facemmapprefix[skin]->width/2))<<FRACBITS); amxpos = -amnumxpos + ((hudx + AutomapPic->width/2 + (icon->width/2))<<FRACBITS);
}*/ }*/
if (!mo->color) // 'default' color V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, icon, colormap);
V_DrawSciencePatch(amxpos, amypos, flags, facemmapprefix[skin], FRACUNIT);
else
{
UINT8 *colormap;
if (mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE);
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap);
if (mo->player
&& ((G_RaceGametype() && mo->player->kartstuff[k_position] == spbplace)
|| (G_BattleGametype() && K_IsPlayerWanted(mo->player))))
{
V_DrawFixedPatch(amxpos - (4<<FRACBITS), amypos - (4<<FRACBITS), FRACUNIT, flags, kp_wantedreticle, NULL);
}
}
} }
static void K_drawKartMinimap(void) static void K_drawKartMinimap(void)
@ -8971,6 +8991,8 @@ static void K_drawKartMinimap(void)
INT32 i = 0; INT32 i = 0;
INT32 x, y; INT32 x, y;
INT32 minimaptrans, splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split) INT32 minimaptrans, splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split)
UINT8 skin = 0;
UINT8 *colormap = NULL;
SINT8 localplayers[4]; SINT8 localplayers[4];
SINT8 numlocalplayers = 0; SINT8 numlocalplayers = 0;
@ -8979,6 +9001,8 @@ static void K_drawKartMinimap(void)
if (gamestate != GS_LEVEL) if (gamestate != GS_LEVEL)
return; return;
// Only draw for the first player
// Maybe move this somewhere else where this won't be a concern?
if (stplyr != &players[displayplayers[0]]) if (stplyr != &players[displayplayers[0]])
return; return;
@ -9024,6 +9048,20 @@ static void K_drawKartMinimap(void)
x -= SHORT(AutomapPic->leftoffset); x -= SHORT(AutomapPic->leftoffset);
y -= SHORT(AutomapPic->topoffset); y -= SHORT(AutomapPic->topoffset);
// Draw the super item in Battle
if (G_BattleGametype() && battleovertime.enabled)
{
if (battleovertime.enabled >= 10*TICRATE || (battleovertime.enabled & 1))
{
const INT32 prevsplitflags = splitflags;
splitflags &= ~V_HUDTRANSHALF;
splitflags |= V_HUDTRANS;
colormap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE);
K_drawKartMinimapIcon(battleovertime.x, battleovertime.y, x, y, splitflags, kp_itemminimap, colormap, AutomapPic);
splitflags = prevsplitflags;
}
}
// initialize // initialize
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
localplayers[i] = -1; localplayers[i] = -1;
@ -9034,7 +9072,20 @@ static void K_drawKartMinimap(void)
demoghost *g = ghosts; demoghost *g = ghosts;
while (g) while (g)
{ {
K_drawKartMinimapHead(g->mo, x, y, splitflags, AutomapPic); if (g->mo->skin)
skin = ((skin_t*)g->mo->skin)-skins;
else
skin = 0;
if (g->mo->color)
{
if (g->mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, g->mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, g->mo->color, GTC_CACHE);
}
else
colormap = NULL;
K_drawKartMinimapIcon(g->mo->x, g->mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
g = g->next; g = g->next;
} }
@ -9067,7 +9118,7 @@ static void K_drawKartMinimap(void)
} }
} }
if (P_IsDisplayPlayer(&players[i])) if (i == displayplayers[0] || i == displayplayers[1] || i == displayplayers[2] || i == displayplayers[3])
{ {
// Draw display players on top of everything else // Draw display players on top of everything else
localplayers[numlocalplayers] = i; localplayers[numlocalplayers] = i;
@ -9075,7 +9126,26 @@ static void K_drawKartMinimap(void)
continue; continue;
} }
K_drawKartMinimapHead(players[i].mo, x, y, splitflags, AutomapPic); if (players[i].mo->skin)
skin = ((skin_t*)players[i].mo->skin)-skins;
else
skin = 0;
if (players[i].mo->color)
{
if (players[i].mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, players[i].mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, players[i].mo->color, GTC_CACHE);
}
else
colormap = NULL;
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
// Target reticule
if ((G_RaceGametype() && players[i].kartstuff[k_position] == spbplace)
|| (G_BattleGametype() && K_IsPlayerWanted(&players[i])))
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
} }
} }
@ -9087,7 +9157,28 @@ static void K_drawKartMinimap(void)
{ {
if (i == -1) if (i == -1)
continue; // this doesn't interest us continue; // this doesn't interest us
K_drawKartMinimapHead(players[localplayers[i]].mo, x, y, splitflags, AutomapPic);
if (players[localplayers[i]].mo->skin)
skin = ((skin_t*)players[localplayers[i]].mo->skin)-skins;
else
skin = 0;
if (players[localplayers[i]].mo->color)
{
if (players[localplayers[i]].mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, players[localplayers[i]].mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, players[localplayers[i]].mo->color, GTC_CACHE);
}
else
colormap = NULL;
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
// Target reticule
if ((G_RaceGametype() && players[localplayers[i]].kartstuff[k_position] == spbplace)
|| (G_BattleGametype() && K_IsPlayerWanted(&players[localplayers[i]])))
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
} }
} }

View file

@ -8299,7 +8299,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags = actor->flags; // Transfer flags remains->flags = actor->flags; // Transfer flags
remains->flags2 = actor->flags2; // Transfer flags2 remains->flags2 = actor->flags2; // Transfer flags2
remains->fuse = actor->fuse; // Transfer respawn timer remains->fuse = actor->fuse; // Transfer respawn timer
remains->threshold = (actor->threshold == 69 ? 69 : 68); remains->threshold = (actor->threshold == 70 ? 70 : (actor->threshold == 69 ? 69 : 68));
remains->skin = NULL; remains->skin = NULL;
remains->spawnpoint = actor->spawnpoint; remains->spawnpoint = actor->spawnpoint;
@ -8313,7 +8313,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags2 &= ~MF2_AMBUSH; remains->flags2 &= ~MF2_AMBUSH;
if (G_BattleGametype() && actor->threshold != 69) if (G_BattleGametype() && (actor->threshold != 69 && actor->threshold != 70))
numgotboxes++; numgotboxes++;
P_RemoveMobj(actor); P_RemoveMobj(actor);

View file

@ -1775,6 +1775,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
} }
} }
// Easily make it so that overtime works offline
//#define TESTOVERTIMEINFREEPLAY
/** Checks if the level timer is over the timelimit and the round should end, /** Checks if the level timer is over the timelimit and the round should end,
* unless you are in overtime. In which case leveltime may stretch out beyond * unless you are in overtime. In which case leveltime may stretch out beyond
* timelimitintics and overtime's status will be checked here each tick. * timelimitintics and overtime's status will be checked here each tick.
@ -1785,7 +1788,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
*/ */
void P_CheckTimeLimit(void) void P_CheckTimeLimit(void)
{ {
INT32 i, k; INT32 i;
if (!cv_timelimit.value) if (!cv_timelimit.value)
return; return;
@ -1819,71 +1822,76 @@ void P_CheckTimeLimit(void)
} }
} }
} }
else*/
//Optional tie-breaker for Match/CTF //Optional tie-breaker for Match/CTF
else*/ if (cv_overtime.value) if (cv_overtime.value)
{ {
INT32 playerarray[MAXPLAYERS]; #ifndef TESTOVERTIMEINFREEPLAY
INT32 tempplayer = 0; boolean foundone = false; // Overtime is used for closing off down to a specific item.
INT32 spectators = 0;
INT32 playercount = 0;
//Figure out if we have enough participating players to care.
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (players[i].exiting) if (!playeringame[i] || players[i].spectator)
continue;
if (foundone)
{
#endif
// Initiate the kill zone
if (!battleovertime.enabled)
{
INT32 b = 0;
thinker_t *th;
mobj_t *item = NULL;
P_RespawnBattleBoxes(); // FORCE THESE TO BE RESPAWNED FOR THIS!!!!!!!
// Find us an item box to center on.
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
mobj_t *thismo;
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
thismo = (mobj_t *)th;
if (thismo->type != MT_RANDOMITEM)
continue;
if (thismo->threshold == 69) // Disappears
continue;
b++;
// Only select items that are on the ground, ignore ones in the air. Ambush flag inverts this rule.
if ((!P_IsObjectOnGround(thismo)) != (thismo->flags2 & MF2_AMBUSH))
continue;
if (item == NULL || (b < nummapboxes && P_RandomChance(((nummapboxes-b)*FRACUNIT)/nummapboxes))) // This is to throw off the RNG some
item = thismo;
if (b >= nummapboxes) // end early if we've found them all already
break;
}
if (item == NULL) // no item found, could happen if every item is in the air or has ambush flag, or the map has none
{
CONS_Alert(CONS_WARNING, "No usuable items for Battle overtime!\n");
return; return;
if (playeringame[i] && players[i].spectator)
spectators++;
} }
if ((D_NumPlayers() - spectators) > 1) item->threshold = 70; // Set constant respawn
{ battleovertime.x = item->x;
// Play the starpost sfx after the first second of overtime. battleovertime.y = item->y;
if (gamestate == GS_LEVEL && (leveltime == (timelimitintics + TICRATE))) battleovertime.z = item->z;
S_StartSound(NULL, sfx_strpst); battleovertime.radius = 4096*mapobjectscale;
battleovertime.minradius = (cv_overtime.value == 2 ? 40 : 512) * mapobjectscale;
// Normal Match battleovertime.enabled = 1;
if (!G_GametypeHasTeams()) S_StartSound(NULL, sfx_kc47);
{
//Store the nodes of participating players in an array.
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
{
playerarray[playercount] = i;
playercount++;
} }
}
if (playercount > MAXPLAYERS)
playercount = MAXPLAYERS;
//Sort 'em.
for (i = 1; i < playercount; i++)
{
for (k = i; k < playercount; k++)
{
if (players[playerarray[i-1]].marescore < players[playerarray[k]].marescore)
{
tempplayer = playerarray[i-1];
playerarray[i-1] = playerarray[k];
playerarray[k] = tempplayer;
}
}
}
//End the round if the top players aren't tied.
if (players[playerarray[0]].marescore == players[playerarray[1]].marescore)
return; return;
#ifndef TESTOVERTIMEINFREEPLAY
} }
else else
{ foundone = true;
//In team match and CTF, determining a tie is much simpler. =P
if (redscore == bluescore)
return;
}
} }
#endif
} }
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -1894,9 +1902,6 @@ void P_CheckTimeLimit(void)
return; return;
P_DoPlayerExit(&players[i]); P_DoPlayerExit(&players[i]);
} }
/*if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);*/
} }
/** Checks if a player's score is over the pointlimit and the round should end. /** Checks if a player's score is over the pointlimit and the round should end.

View file

@ -211,6 +211,7 @@ extern tic_t itemrespawntime[ITEMQUESIZE];
extern size_t iquehead, iquetail; extern size_t iquehead, iquetail;
extern consvar_t cv_gravity/*, cv_viewheight*/; extern consvar_t cv_gravity/*, cv_viewheight*/;
void P_RespawnBattleBoxes(void);
void P_RespawnSpecials(void); void P_RespawnSpecials(void);
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type); mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
@ -229,6 +230,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
void P_RunOverlays(void); void P_RunOverlays(void);
fixed_t P_CalculateShadowFloor(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed_t radius, fixed_t height, boolean flip, boolean player); fixed_t P_CalculateShadowFloor(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed_t radius, fixed_t height, boolean flip, boolean player);
void P_RunShadows(void); void P_RunShadows(void);
void P_RunBattleOvertime(void);
void P_MobjThinker(mobj_t *mobj); void P_MobjThinker(mobj_t *mobj);
boolean P_RailThinker(mobj_t *mobj); boolean P_RailThinker(mobj_t *mobj);
void P_PushableThinker(mobj_t *mobj); void P_PushableThinker(mobj_t *mobj);

View file

@ -6486,6 +6486,216 @@ static void P_RemoveShadow(mobj_t *thing)
} }
} }
// SAL'S KART BATTLE MODE OVERTIME HANDLER
#define MAXPLANESPERSECTOR (MAXFFLOORS+1)*2
static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, fixed_t scale, mobjtype_t type, boolean ceiling)
{
UINT8 i;
fixed_t flatz[MAXPLANESPERSECTOR];
boolean flip[MAXPLANESPERSECTOR];
UINT8 numflats = 0;
mobj_t *mo;
subsector_t *ss = R_IsPointInSubsector(x, y);
sector_t *sec;
if (!ss)
return;
sec = ss->sector;
// convoluted stuff JUST to get all of the planes we need to draw orbs on :V
for (i = 0; i < MAXPLANESPERSECTOR; i++)
flip[i] = false;
if (sec->floorpic != skyflatnum)
{
#ifdef ESLOPE
flatz[numflats] = (sec->f_slope ? P_GetZAt(sec->f_slope, x, y) : sec->floorheight);
#else
flatz[numflats] = (sec->floorheight);
#endif
numflats++;
}
if (sec->ceilingpic != skyflatnum && ceiling)
{
#ifdef ESLOPE
flatz[numflats] = (sec->c_slope ? P_GetZAt(sec->c_slope, x, y) : sec->ceilingheight) - FixedMul(mobjinfo[type].height, scale);
#else
flatz[numflats] = (sec->ceilingheight) - FixedMul(mobjinfo[type].height, scale);
#endif
flip[numflats] = true;
numflats++;
}
if (sec->ffloors)
{
ffloor_t *rover;
for (rover = sec->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
continue;
if (*rover->toppic != skyflatnum)
{
#ifdef ESLOPE
flatz[numflats] = (*rover->t_slope ? P_GetZAt(*rover->t_slope, x, y) : *rover->topheight);
#else
flatz[numflats] = (*rover->topheight);
#endif
numflats++;
}
if (*rover->bottompic != skyflatnum && ceiling)
{
#ifdef ESLOPE
flatz[numflats] = (*rover->b_slope ? P_GetZAt(*rover->b_slope, x, y) : *rover->bottomheight) - FixedMul(mobjinfo[type].height, scale);
#else
flatz[numflats] = (*rover->bottomheight) - FixedMul(mobjinfo[type].height, scale);
#endif
flip[numflats] = true;
numflats++;
}
}
}
if (numflats <= 0) // no flats
return;
for (i = 0; i < numflats; i++)
{
mo = P_SpawnMobj(x, y, flatz[i], type);
// Lastly, if this can see the skybox mobj, then... we just wasted our time :V
if (skyboxmo[0] && !P_MobjWasRemoved(skyboxmo[0]))
{
const fixed_t sbz = skyboxmo[0]->z;
fixed_t checkz = sec->floorheight;
while (checkz < sec->ceilingheight)
{
P_TeleportMove(skyboxmo[0], skyboxmo[0]->x, skyboxmo[0]->y, checkz);
if (P_CheckSight(skyboxmo[0], mo))
{
P_RemoveMobj(mo);
break;
}
else
checkz += 32*mapobjectscale;
}
P_TeleportMove(skyboxmo[0], skyboxmo[0]->x, skyboxmo[0]->y, sbz);
if (P_MobjWasRemoved(mo))
continue;
}
P_SetScale(mo, scale);
if (flip[i])
{
mo->flags2 |= MF2_OBJECTFLIP;
mo->eflags |= MFE_VERTICALFLIP;
}
switch(type)
{
case MT_OVERTIMEFOG:
mo->destscale = 8*mo->scale;
mo->momz = P_RandomRange(1,8)*mo->scale;
break;
case MT_OVERTIMEORB:
//mo->destscale = mo->scale/4;
mo->frame += ((leveltime/4) % 8);
/*if (battleovertime.enabled < 10*TICRATE)
mo->flags2 |= MF2_SHADOW;*/
mo->angle = R_PointToAngle2(mo->x, mo->y, battleovertime.x, battleovertime.y) + ANGLE_90;
mo->z += P_RandomRange(0,48) * mo->scale;
break;
default:
break;
}
}
}
#undef MAXPLANESPERSECTOR
void P_RunBattleOvertime(void)
{
UINT16 i, j;
if (battleovertime.enabled < 10*TICRATE)
{
battleovertime.enabled++;
if (battleovertime.enabled == TICRATE)
S_StartSound(NULL, sfx_bhurry);
if (battleovertime.enabled == 10*TICRATE)
S_StartSound(NULL, sfx_kc40);
}
else
{
if (battleovertime.radius > battleovertime.minradius)
battleovertime.radius -= mapobjectscale;
else
battleovertime.radius = battleovertime.minradius;
}
if (leveltime & 1)
{
UINT8 transparency = tr_trans50;
if (!splitscreen && players[displayplayers[0]].mo)
{
INT32 dist = P_AproxDistance(battleovertime.x-players[displayplayers[0]].mo->x, battleovertime.y-players[displayplayers[0]].mo->y);
transparency = max(0, NUMTRANSMAPS - ((256 + (dist>>FRACBITS)) / 256));
}
if (transparency < NUMTRANSMAPS)
{
mobj_t *beam = P_SpawnMobj(battleovertime.x, battleovertime.y, battleovertime.z + (mobjinfo[MT_RANDOMITEM].height/2), MT_OVERTIMEBEAM);
P_SetScale(beam, beam->scale*2);
if (transparency > 0)
beam->frame |= transparency<<FF_TRANSSHIFT;
}
}
// 16 orbs at the normal minimum size of 512
{
const fixed_t pi = (22<<FRACBITS) / 7; // loose approximation, this doesn't need to be incredibly precise
fixed_t scale = mapobjectscale + (battleovertime.radius/2048);
fixed_t sprwidth = 32*scale;
fixed_t circumference = FixedMul(pi, battleovertime.radius<<1);
UINT16 orbs = circumference / sprwidth;
angle_t angoff = ANGLE_MAX / orbs;
for (i = 0; i < orbs; i++)
{
angle_t ang = (i * angoff) + FixedAngle((leveltime/2)<<FRACBITS);
fixed_t x = battleovertime.x + P_ReturnThrustX(NULL, ang, battleovertime.radius - FixedMul(mobjinfo[MT_OVERTIMEORB].radius, scale));
fixed_t y = battleovertime.y + P_ReturnThrustY(NULL, ang, battleovertime.radius - FixedMul(mobjinfo[MT_OVERTIMEORB].radius, scale));
P_SpawnOvertimeParticles(x, y, scale, MT_OVERTIMEORB, false);
}
}
if (battleovertime.enabled < 10*TICRATE)
return;
/*if (!S_IdPlaying(sfx_s3kd4s)) // global ambience
S_StartSoundAtVolume(NULL, sfx_s3kd4s, min(255, ((4096*mapobjectscale) - battleovertime.radius)>>FRACBITS / 2));*/
for (i = 0; i < 16; i++)
{
j = 0;
while (j < 32) // max attempts
{
fixed_t x = battleovertime.x + ((P_RandomRange(-64,64) * 128)<<FRACBITS);
fixed_t y = battleovertime.y + ((P_RandomRange(-64,64) * 128)<<FRACBITS);
fixed_t closestdist = battleovertime.radius + (8*mobjinfo[MT_OVERTIMEFOG].radius);
j++;
if (P_AproxDistance(x-battleovertime.x, y-battleovertime.y) < closestdist)
continue;
P_SpawnOvertimeParticles(x, y, 4*mapobjectscale, MT_OVERTIMEFOG, false);
break;
}
}
}
void A_BossDeath(mobj_t *mo); void A_BossDeath(mobj_t *mo);
// AI for the Koopa boss. // AI for the Koopa boss.
static void P_KoopaThinker(mobj_t *koopa) static void P_KoopaThinker(mobj_t *koopa)
@ -7097,7 +7307,7 @@ void P_MobjThinker(mobj_t *mobj)
mobj->x = mobj->target->x; mobj->x = mobj->target->x;
mobj->y = mobj->target->y; mobj->y = mobj->target->y;
if (!splitscreen) if (!splitscreen && players[displayplayers[0]].mo)
{ {
scale = mobj->target->scale + FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayers[0]].mo->x-mobj->target->x, scale = mobj->target->scale + FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayers[0]].mo->x-mobj->target->x,
players[displayplayers[0]].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale); players[displayplayers[0]].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale);
@ -9317,6 +9527,40 @@ void P_MobjThinker(mobj_t *mobj)
trail->color = mobj->color; trail->color = mobj->color;
} }
break; break;
case MT_RANDOMITEM:
if (G_BattleGametype() && mobj->threshold == 70)
{
mobj->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
mobj->colorized = true;
if (battleovertime.enabled)
{
angle_t ang = FixedAngle((leveltime % 360) << FRACBITS);
fixed_t z = battleovertime.z;
fixed_t dist;
mobj_t *ghost;
/*if (z < mobj->subsector->sector->floorheight)
z = mobj->subsector->sector->floorheight;*/
if (mobj->extravalue1 < 512)
mobj->extravalue1++;
dist = mobj->extravalue1 * mapobjectscale;
P_TeleportMove(mobj, battleovertime.x + P_ReturnThrustX(NULL, ang, dist),
battleovertime.y + P_ReturnThrustY(NULL, ang, dist), z);
ghost = P_SpawnGhostMobj(mobj);
ghost->fuse = 4;
ghost->frame |= FF_FULLBRIGHT;
}
}
else
{
mobj->color = SKINCOLOR_NONE;
mobj->colorized = false;
}
break;
//} //}
case MT_TURRET: case MT_TURRET:
P_MobjCheckWater(mobj); P_MobjCheckWater(mobj);
@ -9581,7 +9825,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
P_RemoveMobj(mobj); // make sure they disappear P_RemoveMobj(mobj); // make sure they disappear
return; return;
case MT_RANDOMITEM: case MT_RANDOMITEM:
if (G_BattleGametype()) if (G_BattleGametype() && (mobj->threshold != 70))
{ {
if (mobj->threshold != 69) if (mobj->threshold != 69)
break; break;
@ -9597,8 +9841,11 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
else else
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type); newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type);
P_SpawnMobj(newmobj->x, newmobj->y, newmobj->z, MT_EXPLODE); // poof into existance
// Transfer flags2 (strongbox, objectflip) // Transfer flags2 (strongbox, objectflip)
newmobj->flags2 = mobj->flags2 & ~MF2_DONTDRAW; newmobj->flags2 = mobj->flags2 & ~MF2_DONTDRAW;
if (mobj->threshold == 70)
newmobj->threshold = 70;
} }
P_RemoveMobj(mobj); // make sure they disappear P_RemoveMobj(mobj); // make sure they disappear
return; return;
@ -10958,22 +11205,13 @@ void P_PrecipitationEffects(void)
} }
} }
// void P_RespawnBattleBoxes(void)
// P_RespawnSpecials
//
void P_RespawnSpecials(void)
{ {
UINT8 p, pcount = 0;
tic_t time = 30*TICRATE; // Respawn things in empty dedicated servers
fixed_t x, y, z;
subsector_t *ss;
mobj_t *mo = NULL;
mapthing_t *mthing = NULL;
if (G_BattleGametype() && numgotboxes >= (4*nummapboxes/5)) // Battle Mode respawns all boxes in a different way
{
thinker_t *th; thinker_t *th;
if (!G_BattleGametype())
return;
for (th = thinkercap.next; th != &thinkercap; th = th->next) for (th = thinkercap.next; th != &thinkercap; th = th->next)
{ {
mobj_t *box; mobj_t *box;
@ -11009,7 +11247,22 @@ void P_RespawnSpecials(void)
if (numgotboxes < 0) if (numgotboxes < 0)
numgotboxes = 0; numgotboxes = 0;
} }
//
// P_RespawnSpecials
//
void P_RespawnSpecials(void)
{
UINT8 p, pcount = 0;
tic_t time = 30*TICRATE; // Respawn things in empty dedicated servers
fixed_t x, y, z;
subsector_t *ss;
mobj_t *mo = NULL;
mapthing_t *mthing = NULL;
if (G_BattleGametype() && numgotboxes >= (4*nummapboxes/5)) // Battle Mode respawns all boxes in a different way
P_RespawnBattleBoxes();
// wait time depends on player count // wait time depends on player count
for (p = 0; p < MAXPLAYERS; p++) for (p = 0; p < MAXPLAYERS; p++)

View file

@ -3290,6 +3290,14 @@ static void P_NetArchiveMisc(void)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
WRITESINT8(save_p, battlewanted[i]); WRITESINT8(save_p, battlewanted[i]);
// battleovertime_t
WRITEUINT16(save_p, battleovertime.enabled);
WRITEFIXED(save_p, battleovertime.radius);
WRITEFIXED(save_p, battleovertime.minradius);
WRITEFIXED(save_p, battleovertime.x);
WRITEFIXED(save_p, battleovertime.y);
WRITEFIXED(save_p, battleovertime.z);
WRITEUINT32(save_p, wantedcalcdelay); WRITEUINT32(save_p, wantedcalcdelay);
WRITEUINT32(save_p, indirectitemcooldown); WRITEUINT32(save_p, indirectitemcooldown);
WRITEUINT32(save_p, hyubgone); WRITEUINT32(save_p, hyubgone);
@ -3399,6 +3407,14 @@ static inline boolean P_NetUnArchiveMisc(void)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
battlewanted[i] = READSINT8(save_p); battlewanted[i] = READSINT8(save_p);
// battleovertime_t
battleovertime.enabled = READUINT16(save_p);
battleovertime.radius = READFIXED(save_p);
battleovertime.minradius = READFIXED(save_p);
battleovertime.x = READFIXED(save_p);
battleovertime.y = READFIXED(save_p);
battleovertime.z = READFIXED(save_p);
wantedcalcdelay = READUINT32(save_p); wantedcalcdelay = READUINT32(save_p);
indirectitemcooldown = READUINT32(save_p); indirectitemcooldown = READUINT32(save_p);
hyubgone = READUINT32(save_p); hyubgone = READUINT32(save_p);

View file

@ -2403,6 +2403,8 @@ static void P_LevelInitStuff(void)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
battlewanted[i] = -1; battlewanted[i] = -1;
memset(&battleovertime, 0, sizeof(struct battleovertime));
} }
// //

View file

@ -664,6 +664,8 @@ void P_Ticker(boolean run)
if (run) if (run)
{ {
P_RunThinkers(); P_RunThinkers();
if (G_BattleGametype() && battleovertime.enabled)
P_RunBattleOvertime();
// Run any "after all the other thinkers" stuff // Run any "after all the other thinkers" stuff
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
@ -821,6 +823,8 @@ void P_PreTicker(INT32 frames)
} }
P_RunThinkers(); P_RunThinkers();
if (G_BattleGametype() && battleovertime.enabled)
P_RunBattleOvertime();
// Run any "after all the other thinkers" stuff // Run any "after all the other thinkers" stuff
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)

View file

@ -815,6 +815,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"chain", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Mementos Reaper {"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 {"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 {"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
{"bsnipe", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Banana sniping {"bsnipe", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Banana sniping
{"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // :shitsfree: {"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // :shitsfree:
{"dbgsal", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Debug notification {"dbgsal", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Debug notification

View file

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