From b27c70987929711d04acdef3ebc76ed2c5b57a9a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 15 Dec 2018 19:14:30 -0500 Subject: [PATCH] a bunch of stuff I left uncommited --- src/d_netcmd.c | 4 +-- src/dehacked.c | 2 ++ src/doomdef.h | 2 +- src/doomstat.h | 4 +-- src/info.c | 34 +++++++++++++++++-- src/info.h | 2 ++ src/k_kart.c | 6 +++- src/p_inter.c | 13 ++++++-- src/p_mobj.c | 84 +++++++++++++++++++++++++++++++++++++---------- src/p_saveg.c | 8 ++--- src/sdl/i_video.c | 2 +- 11 files changed, 127 insertions(+), 34 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 06f65bcaa..9cf61bc5f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4327,9 +4327,9 @@ void D_GameTypeChanged(INT32 lastgametype) case GT_TEAMMATCH: if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits { - // default settings for match: 3 mins, no pointlimit + // default settings for match: 2 mins, no pointlimit CV_SetValue(&cv_pointlimit, 0); - CV_SetValue(&cv_timelimit, 3); + CV_SetValue(&cv_timelimit, 2); } if (!cv_itemrespawntime.changed) CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally diff --git a/src/dehacked.c b/src/dehacked.c index 1e4a9266a..46b90e8af 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7101,6 +7101,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_OVERTIMEFOG", "S_OVERTIMEORB", + "S_OVERTIMEBEAM", #ifdef SEENAMES "S_NAMECHECK", @@ -7891,6 +7892,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_OVERTIMEFOG", "MT_OVERTIMEORB", + "MT_OVERTIMEBEAM", #ifdef SEENAMES "MT_NAMECHECK", diff --git a/src/doomdef.h b/src/doomdef.h index a35f3291d..0791e07e9 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -140,7 +140,7 @@ extern FILE *logstream; #endif -//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 +#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 #ifdef DEVELOP #define VERSION 0 // Game version #define SUBVERSION 0 // more precise version number diff --git a/src/doomstat.h b/src/doomstat.h index eb0af90f9..aa92e45ed 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -476,8 +476,8 @@ extern SINT8 pickedvote; typedef struct { 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) + fixed_t radius, minradius; ///< Radius of kill field + fixed_t x, y, z; ///< Position to center on } battleovertime_t; extern battleovertime_t *battleovertime; diff --git a/src/info.c b/src/info.c index ae9696edc..917e5ddec 100644 --- a/src/info.c +++ b/src/info.c @@ -3395,7 +3395,8 @@ state_t states[NUMSTATES] = {SPR_FWRK, 4|FF_FULLBRIGHT, TICRATE, {NULL}, 0, 0, S_NULL}, // S_KARMAFIREWORKTRAIL {SPR_OTFG, FF_FULLBRIGHT|FF_TRANS50, TICRATE, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEFOG - {SPR_OTFG, 1|FF_FULLBRIGHT, 8, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEORB + {SPR_OTFG, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEORB + {SPR_OTFG, 3|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEBEAM #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK @@ -20072,7 +20073,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 16<type == MT_RANDOMITEM) + return 10<type) { case MT_PLAYER: @@ -4396,7 +4400,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->kartstuff[k_wanted]++; if (battleovertime->enabled >= 5*TICRATE) { - if (P_AproxDistance(player->mo->x - battleovertime->x, player->mo->y - battleovertime->y) > (battleovertime->radius<mo->x - battleovertime->x, player->mo->y - battleovertime->y) > battleovertime->radius) { player->kartstuff[k_killfield]++; if (player->kartstuff[k_killfield] > 4*TICRATE) diff --git a/src/p_inter.c b/src/p_inter.c index 037a3566e..6e4b6f0e9 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -373,7 +373,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; case MT_RANDOMITEM: // SRB2kart if (!P_CanPickupItem(player, 1)) + { + if (G_BattleGametype() && special->threshold == 70 && special->health) + { + K_KartBouncing(toucher, special, false, false); + special->extravalue1 = 6; + } return; + } if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) { @@ -1792,7 +1799,7 @@ void P_CheckTimeLimit(void) //Optional tie-breaker for Match/CTF else*/ -//#define TESTOVERTIMEINFREEPLAY +#define TESTOVERTIMEINFREEPLAY if (cv_overtime.value) { #ifndef TESTOVERTIMEINFREEPLAY @@ -1839,8 +1846,8 @@ void P_CheckTimeLimit(void) battleovertime->x = item->x; battleovertime->y = item->y; battleovertime->z = item->z; - battleovertime->radius = 4096; - battleovertime->minradius = (cv_overtime.value == 2 ? 40 : 512); + battleovertime->radius = 4096*mapheaderinfo[gamemap-1]->mobj_scale; + battleovertime->minradius = (cv_overtime.value == 2 ? 40 : 512)*mapheaderinfo[gamemap-1]->mobj_scale; battleovertime->enabled++; S_StartSound(NULL, sfx_kc47); } diff --git a/src/p_mobj.c b/src/p_mobj.c index 5ae74d947..a37c26d78 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6417,6 +6417,7 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool fixed_t flatz[MAXPLANESPERSECTOR]; UINT8 numflats = 0; mobj_t *mo; + fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale; subsector_t *ss = R_IsPointInSubsector(x, y); sector_t *sec; @@ -6424,6 +6425,18 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool return; sec = ss->sector; + switch(type) + { + case MT_OVERTIMEFOG: + scale *= 4; + break; + case MT_OVERTIMEORB: + scale += battleovertime->radius/1024; + break; + default: + break; + } + // convoluted stuff JUST to get all of the planes we need to draw orbs on :V if (sec->floorpic != skyflatnum) @@ -6438,9 +6451,9 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool if (sec->ceilingpic != skyflatnum && ceiling) { #ifdef ESLOPE - flatz[numflats] = (sec->c_slope ? P_GetZAt(sec->c_slope, x, y) : sec->ceilingheight) - mobjinfo[MT_THOK].height; + flatz[numflats] = (sec->c_slope ? P_GetZAt(sec->c_slope, x, y) : sec->ceilingheight) - FixedMul(mobjinfo[type].height, scale); #else - flatz[numflats] = (sec->ceilingheight) - mobjinfo[MT_THOK].height; + flatz[numflats] = (sec->ceilingheight) - FixedMul(mobjinfo[type].height, scale); #endif numflats++; } @@ -6464,9 +6477,9 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool if (*rover->bottompic != skyflatnum && ceiling) { #ifdef ESLOPE - flatz[numflats] = (*rover->b_slope ? P_GetZAt(*rover->b_slope, x, y) : *rover->bottomheight) - mobjinfo[MT_THOK].height; + flatz[numflats] = (*rover->b_slope ? P_GetZAt(*rover->b_slope, x, y) : *rover->bottomheight) - FixedMul(mobjinfo[type].height, scale); #else - flatz[numflats] = (*rover->bottomheight) - mobjinfo[MT_THOK].height; + flatz[numflats] = (*rover->bottomheight) - FixedMul(mobjinfo[type].height, scale); #endif numflats++; } @@ -6487,20 +6500,20 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool continue; } + P_SetScale(mo, scale); + switch(type) { case MT_OVERTIMEFOG: - P_SetScale(mo, 4*mo->scale); mo->destscale = 8*mo->scale; mo->momz = P_RandomRange(1,8)*mo->scale; break; case MT_OVERTIMEORB: - P_SetScale(mo, 2*mo->scale); mo->destscale = mo->scale/4; if ((leveltime/2) & 1) mo->frame++; if (battleovertime->enabled < 5*TICRATE) - mo->frame |= FF_TRANS50; + mo->flags2 |= MF2_SHADOW; /*if (i == 0 && !((leveltime/2) % 3 == 0)) S_StartSoundAtVolume(mo, sfx_s1b1, 64);*/ break; @@ -6514,6 +6527,7 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool void P_RunBattleOvertime(void) { UINT8 i, j; + UINT16 orbs = 16; if (battleovertime->enabled < 5*TICRATE) { @@ -6526,28 +6540,45 @@ void P_RunBattleOvertime(void) else { if (battleovertime->radius > battleovertime->minradius) - battleovertime->radius--; + battleovertime->radius -= mapheaderinfo[gamemap-1]->mobj_scale; else battleovertime->radius = battleovertime->minradius; } if (leveltime & 1) { - for (i = 0; i < 16; i++) // 16 base orbs + UINT8 transparency = tr_trans50; + + if (!splitscreen && players[displayplayer].mo) { - angle_t ang = FixedAngle(((45*i) * (FRACUNIT>>1)) + ((leveltime % 360)<radius - (2*mobjinfo[MT_OVERTIMEORB].radius))<x + P_ReturnThrustX(NULL, ang, dist); - fixed_t y = battleovertime->y + P_ReturnThrustY(NULL, ang, dist); - P_SpawnOvertimeParticles(x, y, MT_OVERTIMEORB, true); + INT32 dist = P_AproxDistance(battleovertime->x-players[displayplayer].mo->x, battleovertime->y-players[displayplayer].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<radius, 16*mapheaderinfo[gamemap-1]->mobj_scale)>>FRACBITS); + for (i = 0; i < orbs; i++) + { + angle_t ang = FixedAngle(((360/orbs) * i * (FRACUNIT>>1)) + (((leveltime*2) % 360)<x + P_ReturnThrustX(NULL, ang, battleovertime->radius); + fixed_t y = battleovertime->y + P_ReturnThrustY(NULL, ang, battleovertime->radius); + P_SpawnOvertimeParticles(x, y, MT_OVERTIMEORB, true); } if (battleovertime->enabled < 5*TICRATE) return; if (!S_IdPlaying(sfx_s3kd4s)) // global ambience - S_StartSoundAtVolume(NULL, sfx_s3kd4s, min(255, (4096-battleovertime->radius)/2)); + S_StartSoundAtVolume(NULL, sfx_s3kd4s, min(255, ((4096*mapheaderinfo[gamemap-1]->mobj_scale) - battleovertime->radius)>>FRACBITS / 2)); for (i = 0; i < 16; i++) { @@ -6556,7 +6587,7 @@ void P_RunBattleOvertime(void) { fixed_t x = battleovertime->x + ((P_RandomRange(-64,64) * 128)<y + ((P_RandomRange(-64,64) * 128)<radius + (4*mobjinfo[MT_OVERTIMEFOG].radius))<radius + (8*mobjinfo[MT_OVERTIMEFOG].radius); j++; if (P_AproxDistance(x-battleovertime->x, y-battleovertime->y) < closestdist) continue; @@ -7172,7 +7203,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->x = mobj->target->x; mobj->y = mobj->target->y; - if (!splitscreen) + if (!splitscreen && players[displayplayer].mo) { scale = mobj->target->scale + FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x, players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale); @@ -9274,6 +9305,25 @@ void P_MobjThinker(mobj_t *mobj) { mobj->color = (1 + (leveltime % (MAXSKINCOLORS-1))); mobj->colorized = true; + if (mobj->extravalue1) + mobj->extravalue1--; + else if (battleovertime->enabled) + { + fixed_t dist = P_AproxDistance(P_AproxDistance(battleovertime->x-mobj->x, battleovertime->y-mobj->y), battleovertime->z-mobj->z); + if (dist > mobj->scale) + { + angle_t hang = R_PointToAngle2(mobj->x, mobj->y, battleovertime->x, battleovertime->y); + angle_t vang = R_PointToAngle2(mobj->z, 0, battleovertime->z, dist); + mobj->momx += FixedMul(FixedMul(mobj->scale, FINECOSINE(hang>>ANGLETOFINESHIFT)), FINECOSINE(vang>>ANGLETOFINESHIFT)); + mobj->momy += FixedMul(FixedMul(mobj->scale, FINESINE(hang>>ANGLETOFINESHIFT)), FINECOSINE(vang>>ANGLETOFINESHIFT)); + mobj->momz += FixedMul(mobj->scale, FINESINE(vang>>ANGLETOFINESHIFT)); + } + else + { + mobj->momx = mobj->momy = mobj->momz = 0; + P_TeleportMove(mobj, battleovertime->x, battleovertime->y, battleovertime->z); + } + } } else { diff --git a/src/p_saveg.c b/src/p_saveg.c index b70c7f83c..f23179280 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3300,8 +3300,8 @@ 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->radius); + WRITEFIXED(save_p, battleovertime->minradius); WRITEFIXED(save_p, battleovertime->x); WRITEFIXED(save_p, battleovertime->y); WRITEFIXED(save_p, battleovertime->z); @@ -3415,8 +3415,8 @@ static inline boolean P_NetUnArchiveMisc(void) // battleovertime_t battleovertime->enabled = READUINT8(save_p); - battleovertime->radius = READUINT16(save_p); - battleovertime->minradius = 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); diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 78dfc820c..8bbd60e89 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1370,7 +1370,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) #endif // Create a window - window = SDL_CreateWindow("SRB2Kart "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + window = SDL_CreateWindow("FortniteKart "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, realwidth, realheight, flags); if (window == NULL)