Remove overtime stuff

This commit is contained in:
NepDisk 2024-12-17 00:47:36 -05:00
parent 4b1324da69
commit e1720e7b3a
14 changed files with 55 additions and 472 deletions

View file

@ -4576,11 +4576,6 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_GAINAX_MID1",
"S_GAINAX_MID2",
"S_OVERTIME_BULB1",
"S_OVERTIME_BULB2",
"S_OVERTIME_LASER",
"S_OVERTIME_CENTER",
"S_WAYPOINTORB",
"S_WAYPOINTSPLAT",
"S_EGOORB",
@ -5659,9 +5654,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_KARMAFIREWORK",
"MT_GAINAX",
"MT_OVERTIME_PARTICLE",
"MT_OVERTIME_CENTER",
"MT_FOLLOWER",
"MT_FOLLOWERBUBBLE_FRONT",
"MT_FOLLOWERBUBBLE_BACK",

View file

@ -730,10 +730,6 @@ char sprnames[NUMSPRITES + 1][5] =
"LENS",
"GRES",
"OTBU",
"OTLS",
"OTCP",
"WAYP",
"EGOO",
@ -5143,11 +5139,6 @@ state_t states[NUMSTATES] =
{SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|5, 14, {NULL}, 14, 1, S_GAINAX_MID2}, // S_GAINAX_MID1
{SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|19, -1, {NULL}, 1, 1, S_NULL}, // S_GAINAX_MID2
{SPR_OTBU, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_BULB1
{SPR_OTBU, FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_BULB2
{SPR_OTLS, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_LASER
{SPR_OTCP, 0, -1, {NULL}, 0, 0, S_NULL}, // S_OVERTIME_CENTER
{SPR_WAYP, 0, 1, {NULL}, 0, 0, S_NULL}, // S_WAYPOINTORB
{SPR_WAYP, 1|FF_FLOORSPRITE, 1, {NULL}, 0, 0, S_NULL}, // S_WAYPOINTSPLAT
{SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOORB
@ -28240,60 +28231,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_OVERTIME_PARTICLE
-1, // doomednum
S_NULL, // 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
24<<FRACBITS, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_OVERTIME_CENTER
3775, // doomednum
S_OVERTIME_CENTER, // 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
12<<FRACBITS, // radius
72<<FRACBITS, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_FOLLOWER
-1, // doomednum
S_INVISIBLE, // spawnstate

View file

@ -1287,10 +1287,6 @@ typedef enum sprite
SPR_LENS,
SPR_GRES,
SPR_OTBU,
SPR_OTLS,
SPR_OTCP,
SPR_WAYP,
SPR_EGOO,
@ -5569,11 +5565,6 @@ typedef enum state
S_GAINAX_MID1,
S_GAINAX_MID2,
S_OVERTIME_BULB1,
S_OVERTIME_BULB2,
S_OVERTIME_LASER,
S_OVERTIME_CENTER,
S_WAYPOINTORB,
S_WAYPOINTSPLAT,
S_EGOORB,
@ -6672,9 +6663,6 @@ typedef enum mobj_type
MT_KARMAFIREWORK,
MT_GAINAX,
MT_OVERTIME_PARTICLE,
MT_OVERTIME_CENTER,
MT_FOLLOWER,
MT_FOLLOWERBUBBLE_FRONT,
MT_FOLLOWERBUBBLE_BACK,

View file

@ -20,9 +20,6 @@
#include "k_grandprix.h" // K_CanChangeRules
#include "p_spec.h"
// Battle overtime info
struct battleovertime battleovertime;
// Item Breaker mode enabled for this map?
boolean itembreaker = false;
@ -328,7 +325,6 @@ UINT8 K_NumEmeralds(player_t *player)
void K_RunPaperItemSpawners(void)
{
const boolean overtime = (battleovertime.enabled >= 10*TICRATE);
tic_t interval = 8*TICRATE;
const boolean canmakeemeralds = true; //(!(itembreaker || bossinfo.boss));
@ -354,12 +350,6 @@ void K_RunPaperItemSpawners(void)
return;
}
if (overtime == true)
{
// Double frequency of items
interval /= 2;
}
if (((leveltime - starttime) % interval) != 0)
{
return;
@ -383,65 +373,6 @@ void K_RunPaperItemSpawners(void)
pcount++;
}
if (overtime == true)
{
SINT8 flip = 1;
// Just find emeralds, no paper spots
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
mo = (mobj_t *)th;
if (mo->type == MT_EMERALD)
{
emeraldsSpawned |= mo->extravalue1;
}
}
if (canmakeemeralds)
{
for (i = 0; i < 7; i++)
{
UINT32 emeraldFlag = (1 << i);
if (!(emeraldsSpawned & emeraldFlag))
{
firstUnspawnedEmerald = emeraldFlag;
break;
}
}
}
if (firstUnspawnedEmerald != 0)
{
K_SpawnChaosEmerald(
battleovertime.x, battleovertime.y, battleovertime.z + (128 * mapobjectscale * flip),
FixedAngle(P_RandomRange(0, 359) * FRACUNIT), flip,
firstUnspawnedEmerald
);
}
else
{
K_CreatePaperItem(
battleovertime.x, battleovertime.y, battleovertime.z + (128 * mapobjectscale * flip),
FixedAngle(P_RandomRange(0, 359) * FRACUNIT), flip,
0, 0
);
if (gametyperules & GTR_SPHERES)
{
K_SpawnSphereBox(
battleovertime.x, battleovertime.y, battleovertime.z + (128 * mapobjectscale * flip),
FixedAngle(P_RandomRange(0, 359) * FRACUNIT), flip,
10
);
}
}
}
else
{
if (pcount > 0)
{
@ -575,134 +506,6 @@ void K_RunPaperItemSpawners(void)
}
}
static void K_SpawnOvertimeLaser(fixed_t x, fixed_t y, fixed_t scale)
{
UINT8 i, j;
for (i = 0; i <= r_splitscreen; i++)
{
player_t *player = &players[displayplayers[i]];
fixed_t zpos;
SINT8 flip;
if (player == NULL || player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
{
continue;
}
if (player->mo->eflags & MFE_VERTICALFLIP)
{
zpos = player->mo->z + player->mo->height;
}
else
{
zpos = player->mo->z;
}
flip = P_MobjFlip(player->mo);
for (j = 0; j < 3; j++)
{
mobj_t *mo = P_SpawnMobj(x, y, zpos, MT_OVERTIME_PARTICLE);
if (player->mo->eflags & MFE_VERTICALFLIP)
{
mo->flags2 |= MF2_OBJECTFLIP;
mo->eflags |= MFE_VERTICALFLIP;
}
mo->angle = R_PointToAngle2(mo->x, mo->y, battleovertime.x, battleovertime.y) + ANGLE_90;
mo->renderflags |= (RF_DONTDRAW & ~(K_GetPlayerDontDrawFlag(player)));
P_SetScale(mo, scale);
switch (j)
{
case 0:
P_SetMobjState(mo, S_OVERTIME_BULB1);
if (leveltime & 1)
mo->frame += 1;
//P_SetScale(mo, mapobjectscale);
zpos += 35 * mo->scale * flip;
break;
case 1:
P_SetMobjState(mo, S_OVERTIME_LASER);
if (leveltime & 1)
mo->frame += 3;
else
mo->frame += (leveltime / 2) % 3;
//P_SetScale(mo, scale);
zpos += 346 * mo->scale * flip;
if (battleovertime.enabled < 10*TICRATE)
mo->renderflags |= RF_TRANS50;
break;
case 2:
P_SetMobjState(mo, S_OVERTIME_BULB2);
if (leveltime & 1)
mo->frame += 1;
//P_SetScale(mo, mapobjectscale);
break;
default:
I_Error("Bruh moment has occured\n");
return;
}
}
}
}
void K_RunBattleOvertime(void)
{
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 > 0)
{
const fixed_t minradius = 768 * mapobjectscale;
if (battleovertime.radius > minradius)
battleovertime.radius -= 2*mapobjectscale;
else
battleovertime.radius = minradius;
}
if (battleovertime.radius > 0)
{
const INT32 orbs = 32;
const angle_t angoff = ANGLE_MAX / orbs;
const UINT8 spriteSpacing = 128;
fixed_t circumference = FixedMul(M_PI_FIXED, battleovertime.radius * 2);
fixed_t scale = max(circumference / spriteSpacing / orbs, mapobjectscale);
fixed_t size = FixedMul(mobjinfo[MT_OVERTIME_PARTICLE].radius, scale);
fixed_t posOffset = max(battleovertime.radius - size, 0);
INT32 i;
for (i = 0; i < orbs; i++)
{
angle_t ang = (i * angoff) + FixedAngle((leveltime * FRACUNIT) / 4);
fixed_t x = battleovertime.x + P_ReturnThrustX(NULL, ang, posOffset);
fixed_t y = battleovertime.y + P_ReturnThrustY(NULL, ang, posOffset);
K_SpawnOvertimeLaser(x, y, scale);
}
}
}
void K_SpawnPlayerBattleBumpers(player_t *p)
{
if (!p->mo || p->bumper <= 0)

View file

@ -8,13 +8,6 @@
extern "C" {
#endif
extern struct battleovertime
{
UINT16 enabled; ///< Has this been initalized yet?
fixed_t radius; ///< Radius of kill field
fixed_t x, y, z; ///< Position to center on
} battleovertime;
extern boolean itembreaker;
extern INT32 nummapboxes, numgotboxes; // keep track of spawned battle mode items
extern UINT8 numtargets;
@ -30,7 +23,6 @@ mobj_t *K_SpawnSphereBox(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 f
void K_DropEmeraldsFromPlayer(player_t *player, UINT32 emeraldType);
UINT8 K_NumEmeralds(player_t *player);
void K_RunPaperItemSpawners(void);
void K_RunBattleOvertime(void);
void K_SpawnPlayerBattleBumpers(player_t *p);
void K_BattleInit(void);

View file

@ -162,7 +162,6 @@ static patch_t *kp_lapanim_emblem[2];
static patch_t *kp_lapanim_hand[3];
static patch_t *kp_yougotem;
static patch_t *kp_itemminimap;
static patch_t *kp_alagles[10];
static patch_t *kp_blagles[6];
@ -554,7 +553,6 @@ void K_LoadKartHUDGraphics(void)
}
HU_UpdatePatch(&kp_yougotem, "YOUGOTEM");
HU_UpdatePatch(&kp_itemminimap, "MMAPITEM");
sprintf(buffer, "ALAGLESx");
for (i = 0; i < 10; ++i)
@ -3470,20 +3468,6 @@ static void K_drawKartMinimap(void)
x -= SHORT(AutomapPic->leftoffset);
y -= SHORT(AutomapPic->topoffset);
// Draw the super item in Battle
if (gametype == GT_BATTLE && 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, K_RainbowColor(leveltime), GTC_CACHE);
K_drawKartMinimapIcon(battleovertime.x, battleovertime.y, x, y, splitflags, kp_itemminimap, colormap, AutomapPic);
splitflags = prevsplitflags;
}
}
// initialize
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
localplayers[i] = -1;

View file

@ -6777,29 +6777,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
K_KartPlayerHUDUpdate(player);
if (battleovertime.enabled && !(player->pflags & PF_ELIMINATED) && player->bumper <= 0 && player->karmadelay <= 0)
{
if (player->overtimekarma)
player->overtimekarma--;
else
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_TIMEOVER);
}
if ((battleovertime.enabled >= 10*TICRATE) && !(player->pflags & PF_ELIMINATED) && !player->exiting)
{
fixed_t distanceToBarrier = 0;
if (battleovertime.radius > 0)
{
distanceToBarrier = R_PointToDist2(player->mo->x, player->mo->y, battleovertime.x, battleovertime.y) - (player->mo->radius * 2);
}
if (distanceToBarrier > battleovertime.radius)
{
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_TIMEOVER);
}
}
if (P_IsObjectOnGround(player->mo))
player->waterskip = 0;

View file

@ -12,6 +12,7 @@
/// \brief Handling interactions (i.e., collisions)
#include "doomdef.h"
#include "doomstat.h"
#include "i_system.h"
#include "am_map.h"
#include "g_game.h"
@ -679,119 +680,86 @@ void P_TouchStarPost(mobj_t *post, player_t *player, boolean snaptopost)
*/
void P_CheckTimeLimit(void)
{
INT32 i;
INT32 i, k;
#ifndef TESTOVERTIMEINFREEPLAY
if (itembreaker) // Item Breaker overrides any time limit settings
return;
#endif
if (!(gametyperules & GTR_TIMELIMIT))
if (!cv_timelimit.value)
return;
if (bossinfo.boss == true)
return;
if (exitcountdown)
if (!(multiplayer || netgame))
return;
if (!timelimitintics)
if ((gametyperules & GTR_TIMELIMIT))
return;
if (secretextratime)
{
secretextratime--;
timelimitintics++;
}
else if (extratimeintics)
{
timelimitintics++;
if (leveltime & 1)
;
else
{
if (extratimeintics > 20)
{
extratimeintics -= 20;
timelimitintics += 20;
}
else
{
timelimitintics += extratimeintics;
extratimeintics = 0;
}
S_StartSound(NULL, sfx_ptally);
}
}
if (leveltime < (timelimitintics + starttime))
return;
if (gameaction == ga_completed)
return;
if ((cv_overtime.value) && (gametyperules & GTR_OVERTIME))
if (cv_overtime.value)
{
#ifndef TESTOVERTIMEINFREEPLAY
boolean foundone = false; // Overtime is used for closing off down to a specific item.
INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0;
INT32 spectators = 0;
INT32 playercount = 0;
//Figure out if we have enough participating players to care.
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].exiting)
return;
if (playeringame[i] && players[i].spectator)
spectators++;
}
if (foundone)
if ((D_NumPlayers() - spectators) > 1)
{
// Play the starpost sfx after the first second of overtime.
if (gamestate == GS_LEVEL && (leveltime == (timelimitintics + TICRATE)))
S_StartSound(NULL, sfx_strpst);
// Normal Match
if (!G_GametypeHasTeams())
{
#endif
// Initiate the kill zone
if (!battleovertime.enabled)
//Store the nodes of participating players in an array.
for (i = 0; i < MAXPLAYERS; i++)
{
thinker_t *th;
mobj_t *center = NULL;
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
if (playeringame[i] && !players[i].spectator)
{
mobj_t *thismo;
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
thismo = (mobj_t *)th;
if (thismo->type == MT_OVERTIME_CENTER)
{
center = thismo;
break;
}
playerarray[playercount] = i;
playercount++;
}
if (center == NULL || P_MobjWasRemoved(center))
{
CONS_Alert(CONS_WARNING, "No center point for overtime!\n");
battleovertime.x = 0;
battleovertime.y = 0;
battleovertime.z = 0;
}
else
{
battleovertime.x = center->x;
battleovertime.y = center->y;
battleovertime.z = center->z;
}
battleovertime.radius = 4096 * mapobjectscale;
battleovertime.enabled = 1;
S_StartSound(NULL, sfx_kc47);
}
return;
#ifndef TESTOVERTIMEINFREEPLAY
if (playercount > MAXPLAYERS)
playercount = MAXPLAYERS;
//Sort 'em.
for (i = 1; i < playercount; i++)
{
for (k = i; k < playercount; k++)
{
if (players[playerarray[i-1]].roundscore < players[playerarray[k]].roundscore)
{
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]].roundscore == players[playerarray[1]].roundscore)
return;
}
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++)

View file

@ -7147,16 +7147,6 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
case MT_EMERALD:
{
if (battleovertime.enabled >= 10*TICRATE)
{
fixed_t distance = R_PointToDist2(mobj->x, mobj->y, battleovertime.x, battleovertime.y);
if (distance > battleovertime.radius)
{
// Delete emeralds to let them reappear
P_KillMobj(mobj, NULL, NULL, DMG_NORMAL);
}
}
if (leveltime % 3 == 0)
{
@ -8401,32 +8391,6 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
trail->color = mobj->color;
}
break;
case MT_SPHEREBOX:
if (gametype == GT_BATTLE && mobj->threshold == 70)
{
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_MoveOrigin(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;
}
}
break;
default:
// check mobj against possible water content, before movement code
P_MobjCheckWater(mobj);
@ -8598,8 +8562,6 @@ static boolean P_FuseThink(mobj_t *mobj)
// Transfer flags2 (strongbox, objectflip, bossnotrap)
newmobj->flags2 = mobj->flags2;
if (mobj->threshold == 70)
newmobj->threshold = 70;
}
P_RemoveMobj(mobj); // make sure they disappear

View file

@ -5009,13 +5009,6 @@ static void P_NetArchiveMisc(savebuffer_t *save, boolean resending)
for (i = 0; i < 4; i++)
WRITESINT8(save->p, battlewanted[i]);
// battleovertime_t
WRITEUINT16(save->p, battleovertime.enabled);
WRITEFIXED(save->p, battleovertime.radius);
WRITEFIXED(save->p, battleovertime.x);
WRITEFIXED(save->p, battleovertime.y);
WRITEFIXED(save->p, battleovertime.z);
WRITEUINT32(save->p, wantedcalcdelay);
WRITEUINT32(save->p, indirectitemcooldown);
WRITEUINT32(save->p, mapreset);
@ -5180,13 +5173,6 @@ FUNCINLINE static ATTRINLINE boolean P_NetUnArchiveMisc(savebuffer_t *save, bool
for (i = 0; i < 4; i++)
battlewanted[i] = READSINT8(save->p);
// battleovertime_t
battleovertime.enabled = READUINT16(save->p);
battleovertime.radius = READFIXED(save->p);
battleovertime.x = READFIXED(save->p);
battleovertime.y = READFIXED(save->p);
battleovertime.z = READFIXED(save->p);
wantedcalcdelay = READUINT32(save->p);
indirectitemcooldown = READUINT32(save->p);
mapreset = READUINT32(save->p);

View file

@ -7738,7 +7738,6 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
for (i = 0; i < 4; i++)
battlewanted[i] = -1;
memset(&battleovertime, 0, sizeof(struct battleovertime));
speedscramble = encorescramble = -1;
}

View file

@ -480,9 +480,6 @@ static void P_RunThinkers(void)
if (gametyperules & GTR_PAPERITEMS)
K_RunPaperItemSpawners();
if ((gametyperules & GTR_BUMPERS) && battleovertime.enabled)
K_RunBattleOvertime();
ps_acs_time = I_GetPreciseTime();
ACS_Tick();
ps_acs_time = I_GetPreciseTime() - ps_acs_time;

View file

@ -1089,7 +1089,6 @@ sfxinfo_t S_sfx[NUMSFX] =
{"mkuma", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Monokuma"}, // Trigger Happy Havoc Monokuma
{"toada", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"}, // Arid Sands Toad scream
{"gemhit", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"}, // Opulence gem/coin tumbling
{"bhurry", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Hurry up!"}, // v1.0.2 Battle overtime
{"bsnipe", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Sniped"}, // Banana sniping
{"join", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Player joined server
{"leave", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Player left server

View file

@ -1156,7 +1156,6 @@ typedef enum
sfx_mkuma,
sfx_toada,
sfx_gemhit,
sfx_bhurry,
sfx_bsnipe,
sfx_join,
sfx_leave,