From 379dbaa92c9694f73fc33a8d58fb07fdc3b32c12 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 23 Sep 2018 19:55:46 +0100 Subject: [PATCH 01/22] Here's my progress on making demoplayback camera less shit. I know what probably needs to be done to make it thorough is to replace all the consoleplayer stuff with displayplayer stuff in demoplayback, but don't feel like doing that right now. --- src/p_user.c | 5 ++--- src/r_main.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d3407bd65..a59986e76 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8349,6 +8349,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall angle = thiscam->angle; else if (leveltime < starttime) angle = focusangle + FixedAngle(camrotate*FRACUNIT); + else if (demoplayback) + angle = players[consoleplayer].cmd.angleturn<<16; else { angle_t input = focusangle + FixedAngle(camrotate<angle; @@ -8361,9 +8363,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall input = InvAngle(input); angle = thiscam->angle + input; - - if (demoplayback && player == &players[consoleplayer]) - localangle = angle; } if (!resetcalled && (leveltime > starttime) diff --git a/src/r_main.c b/src/r_main.c index 5990224c2..4cf2d8798 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -857,7 +857,7 @@ void R_SkyboxFrame(player_t *player) { aimingangle = player->aiming; viewangle = player->mo->angle; - if (!demoplayback && player->playerstate != PST_DEAD) + if (/*!demoplayback && */player->playerstate != PST_DEAD) { if (player == &players[consoleplayer]) { @@ -1136,7 +1136,7 @@ void R_SetupFrame(player_t *player, boolean skybox) aimingangle = player->aiming; viewangle = viewmobj->angle; - if (!demoplayback && player->playerstate != PST_DEAD) + if (/*!demoplayback && */player->playerstate != PST_DEAD) { if (player == &players[consoleplayer]) { From 68a06a14c8ab16a0ae91cf2cf29e2dc501a03b90 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 7 Oct 2018 18:53:46 -0400 Subject: [PATCH 02/22] Rocket Sneakers appear beside you --- src/dehacked.c | 8 ++- src/info.c | 42 ++++++++++-- src/info.h | 7 ++ src/k_kart.c | 158 ++++++++++++++++++++++++++++++++++++++++++---- src/k_kart.h | 2 +- src/lua_baselib.c | 4 +- src/p_inter.c | 9 +++ src/p_mobj.c | 72 ++++++++++++++------- src/p_spec.c | 2 +- 9 files changed, 260 insertions(+), 44 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 67071d88c..6166c8f85 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6309,6 +6309,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_WIPEOUTTRAIL4", "S_WIPEOUTTRAIL5", + // Rocket sneaker + "S_ROCKETSNEAKER_L", + "S_ROCKETSNEAKER_R", + //{ Eggman Monitor "S_FAKEITEM1", "S_FAKEITEM2", @@ -7291,6 +7295,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_DRIFTSPARK", "MT_DRIFTDUST", + "MT_ROCKETSNEAKER", // Rocket sneakers + "MT_FAKESHIELD", "MT_FAKEITEM", @@ -7302,7 +7308,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_JAWZ", // Jawz stuff "MT_JAWZ_DUD", - "MT_JAWZ_SHIELD", + "MT_JAWZ_SHIELD", "MT_PLAYERRETICULE", // Jawz reticule diff --git a/src/info.c b/src/info.c index c0fb24fb4..496aa0cc7 100644 --- a/src/info.c +++ b/src/info.c @@ -56,12 +56,12 @@ char sprnames[NUMSPRITES + 1][5] = "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", //SRB2kart Sprites "SPRG","BSPR","RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE", - "KINV","KINF","WIPD","DRIF","DUST","FITM","BANA","ORBN","JAWZ","SSMN", - "KRBM","BHOG","BHBM","BLIG","LIGH","THNS","SINK","SITR","KBLN","DEZL", - "POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO", - "CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO", - "ITEM","ITMO","ITMI","ITMN","WANT","PBOM","RETI","AIDU","KSPK","LZI1", - "LZI2","KLIT","VIEW" + "KINV","KINF","WIPD","DRIF","DUST","RSHE","FITM","BANA","ORBN","JAWZ", + "SSMN","KRBM","BHOG","BHBM","BLIG","LIGH","THNS","SINK","SITR","KBLN", + "DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM", + "SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB", + "ARRO","ITEM","ITMO","ITMI","ITMN","WANT","PBOM","RETI","AIDU","KSPK", + "LZI1","LZI2","KLIT","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -2623,6 +2623,9 @@ state_t states[NUMSTATES] = {SPR_WIPD, 3, 3, {NULL}, 0, 0, S_WIPEOUTTRAIL5}, // S_WIPEOUTTRAIL4 {SPR_WIPD, 4, 3, {NULL}, 0, 0, S_NULL}, // S_WIPEOUTTRAIL5 + {SPR_RSHE, 0, -1, {NULL}, 0, 0, S_NULL}, // S_ROCKETSNEAKER_L + {SPR_RSHE, 1, -1, {NULL}, 0, 0, S_NULL}, // S_ROCKETSNEAKER_R + {SPR_FITM, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM2}, // S_FAKEITEM1 {SPR_FITM, 1|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM3}, // S_FAKEITEM2 {SPR_FITM, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM4}, // S_FAKEITEM3 @@ -14802,6 +14805,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_ROCKETSNEAKER + -1, // doomednum + S_ROCKETSNEAKER_L, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_tossed, // 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_s3k5d, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 16*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_s3kc0s, // activesound + MF_SPECIAL|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_FAKESHIELD -1, // doomednum S_FAKEITEM1, // spawnstate diff --git a/src/info.h b/src/info.h index d0f4be596..5b52a6c25 100644 --- a/src/info.h +++ b/src/info.h @@ -596,6 +596,7 @@ typedef enum sprite SPR_DUST, // Drift Dust // Kart Items + SPR_RSHE, // Rocket sneaker SPR_FITM, // Eggman Monitor SPR_BANA, // Banana Peel SPR_ORBN, // Orbinaut @@ -3155,6 +3156,10 @@ typedef enum state S_WIPEOUTTRAIL4, S_WIPEOUTTRAIL5, + // Rocket sneaker + S_ROCKETSNEAKER_L, + S_ROCKETSNEAKER_R, + //{ Eggman Monitor S_FAKEITEM1, S_FAKEITEM2, @@ -4154,6 +4159,8 @@ typedef enum mobj_type MT_DRIFTSPARK, MT_DRIFTDUST, + MT_ROCKETSNEAKER, + MT_FAKESHIELD, MT_FAKEITEM, diff --git a/src/k_kart.c b/src/k_kart.c index b37c8f494..d07e2f3ec 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1006,6 +1006,12 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) weight = (against->player->kartweight)<player) + weight = (against->player->kartweight*2)<player) @@ -2969,25 +2975,45 @@ static void K_DoHyudoroSteal(player_t *player) } } -void K_DoSneaker(player_t *player, boolean doPFlag) +void K_DoSneaker(player_t *player, INT32 type) { - const fixed_t prevboost = player->kartstuff[k_speedboost]; + fixed_t prevboost = player->kartstuff[k_speedboost]; if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) S_StartSound(player->mo, sfx_cdfm01); if (!player->kartstuff[k_sneakertimer]) { - mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BOOSTFLAME); - P_SetTarget(&overlay->target, player->mo); - overlay->destscale = player->mo->scale; - P_SetScale(overlay, player->mo->scale); + if (type == 2) + { + if (player->mo->hnext) + { + mobj_t *cur = player->mo->hnext; + while (cur && !P_MobjWasRemoved(cur)) + { + if (!cur->tracer) + { + mobj_t *overlay = P_SpawnMobj(cur->x, cur->y, cur->z, MT_BOOSTFLAME); + P_SetTarget(&overlay->target, cur); + P_SetTarget(&cur->tracer, overlay); + P_SetScale(overlay, (overlay->destscale = 3*cur->scale/4)); + } + cur = cur->hnext; + } + } + } + else + { + mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BOOSTFLAME); + P_SetTarget(&overlay->target, player->mo); + P_SetScale(overlay, (overlay->destscale = player->mo->scale)); + } } player->kartstuff[k_sneakertimer] = sneakertime; K_SpawnDashDustRelease(player); - if (doPFlag) + if (type != 0) { player->pflags |= PF_ATTACKDOWN; K_PlayBoostTaunt(player->mo); @@ -3206,6 +3232,7 @@ void K_DropHnextList(player_t *player) break; // intentionally do nothing case MT_SINK_SHIELD: + case MT_ROCKETSNEAKER: return; default: continue; @@ -3553,6 +3580,92 @@ static void K_MoveHeldObjects(player_t *player) } } break; + case MT_ROCKETSNEAKER: // Special rocket sneaker stuff + { + mobj_t *cur = player->mo->hnext; + INT32 num = 0; + + while (cur && !P_MobjWasRemoved(cur)) + { + const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); + angle_t angoffset; + fixed_t targx, targy, targz; + + cur->flags &= ~MF_NOCLIPTHING; + + if (player->kartstuff[k_rocketsneakertimer] <= TICRATE && (leveltime & 1)) + cur->flags2 |= MF2_DONTDRAW; + else + cur->flags2 &= ~MF2_DONTDRAW; + + if (num & 1) + P_SetMobjStateNF(cur, S_ROCKETSNEAKER_L); + else + P_SetMobjStateNF(cur, S_ROCKETSNEAKER_R); + + if (!player->kartstuff[k_rocketsneakertimer] || cur->extravalue2 || !cur->health) + { + num = (num+1) % 2; + cur = cur->hnext; + continue; + } + + if (cur->extravalue1 < radius) + cur->extravalue1 += FixedMul(P_AproxDistance(cur->extravalue1, radius), FRACUNIT/12); + if (cur->extravalue1 > radius) + cur->extravalue1 = radius; + + // Shrink your items if the player shrunk too. + P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), player->mo->scale))); + +#if 1 + { + angle_t input = player->mo->angle - cur->angle; + boolean invert = (input > ANGLE_180); + if (invert) + input = InvAngle(input); + + input = FixedAngle(AngleFixed(input)/4); + if (invert) + input = InvAngle(input); + + cur->angle = cur->angle + input; + } +#else + cur->angle = player->mo->angle; +#endif + + angoffset = ANGLE_90 + (ANGLE_180 * num); + + targx = player->mo->x + P_ReturnThrustX(cur, cur->angle + angoffset, cur->extravalue1); + targy = player->mo->y + P_ReturnThrustY(cur, cur->angle + angoffset, cur->extravalue1); + + { // bobbing, copy pasted from my kimokawaiii entry + const fixed_t pi = (22<>ANGLETOFINESHIFT) & FINEMASK); + targz = (player->mo->z + (player->mo->height/2)) + sine; + } + + if (cur->tracer) + { + fixed_t diffx, diffy, diffz; + + diffx = targx - cur->x; + diffy = targy - cur->y; + diffz = targz - cur->z; + + P_TeleportMove(cur->tracer, cur->tracer->x + diffx + P_ReturnThrustX(cur, cur->angle + angoffset, 6*cur->scale), + cur->tracer->y + diffy + P_ReturnThrustY(cur, cur->angle + angoffset, 6*cur->scale), cur->tracer->z + diffz); + P_SetScale(cur->tracer, (cur->tracer->destscale = 3*cur->scale/4)); + } + + P_TeleportMove(cur, targx, targy, targz); + + num = (num+1) % 2; + cur = cur->hnext; + } + } + break; default: break; } @@ -4473,7 +4586,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO && player->kartstuff[k_rocketsneakertimer] > 1) { - K_DoSneaker(player, true); + K_DoSneaker(player, 2); K_PlayBoostTaunt(player->mo); player->kartstuff[k_rocketsneakertimer] -= 5; if (player->kartstuff[k_rocketsneakertimer] < 1) @@ -4490,7 +4603,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_SNEAKER: if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO) { - K_DoSneaker(player, true); + K_DoSneaker(player, 1); K_PlayBoostTaunt(player->mo); player->kartstuff[k_itemamount]--; } @@ -4499,10 +4612,33 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO && player->kartstuff[k_rocketsneakertimer] == 0) { - K_DoSneaker(player, true); + INT32 moloop; + mobj_t *mo = NULL; + mobj_t *prev = player->mo; + K_PlayBoostTaunt(player->mo); + //player->kartstuff[k_itemheld] = 1; + S_StartSound(player->mo, sfx_s3k3a); + + //K_DoSneaker(player, 2); + player->kartstuff[k_rocketsneakertimer] = itemtime; player->kartstuff[k_itemamount]--; + K_UpdateHnextList(player, true); + + for (moloop = 0; moloop < 2; moloop++) + { + mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_ROCKETSNEAKER); + mo->flags |= MF_NOCLIPTHING; + mo->angle = player->mo->angle; + mo->threshold = 10; + mo->movecount = moloop%2; + mo->movedir = mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + P_SetTarget(&mo->hprev, prev); + P_SetTarget(&prev->hnext, mo); + prev = mo; + } } break; case KITEM_INVINCIBILITY: @@ -5008,7 +5144,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->kartstuff[k_boostcharge] <= 36) { player->kartstuff[k_startboost] = 0; - K_DoSneaker(player, false); + K_DoSneaker(player, 0); player->kartstuff[k_sneakertimer] = 70; // PERFECT BOOST!! if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) // Let everyone hear this one diff --git a/src/k_kart.h b/src/k_kart.h index 7cab42a59..6b240df14 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -36,7 +36,7 @@ void K_SpawnBoostTrail(player_t *player); void K_SpawnSparkleTrail(mobj_t *mo); void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_DriftDustHandling(mobj_t *spawner); -void K_DoSneaker(player_t *player, boolean doPFlag); +void K_DoSneaker(player_t *player, INT32 type); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_UpdateHnextList(player_t *player, boolean clean); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2d287d0f5..2aef9d5d2 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2219,11 +2219,11 @@ static int lib_kDriftDustHandling(lua_State *L) static int lib_kDoSneaker(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - boolean doPFlag = luaL_checkboolean(L, 2); + INT32 type = luaL_checkinteger(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - K_DoSneaker(player, doPFlag); + K_DoSneaker(player, type); return 0; } diff --git a/src/p_inter.c b/src/p_inter.c index 5ca9a1041..565802b28 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -589,6 +589,15 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->kartstuff[k_roulettetype] = 1; } return; + case MT_ROCKETSNEAKER: + if (!player->mo) + return; + if (special->extravalue2) + return; + if (special->target && player->mo == special->target) + return; + K_KartBouncing(player->mo, special, false, false); + return; // ***************************************** // // Rings, coins, spheres, weapon panels, etc // diff --git a/src/p_mobj.c b/src/p_mobj.c index d400f013c..d0bbc4b5e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6637,20 +6637,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_SSMINE_SHIELD: case MT_FAKESHIELD: case MT_SINK_SHIELD: - /*if (mobj->health > 0 && mobj->target && mobj->target->player - && mobj->target->player->health > 0 && !mobj->target->player->spectator) - { - // Was this so hard? -- Handled this with K_UpdateHnextList instead of thinking it away... - if ((mobj->type == MT_ORBINAUT_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) - || (mobj->type == MT_JAWZ_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ) - || (mobj->movedir > 0 && ((UINT16)mobj->target->player->kartstuff[k_itemamount] < mobj->movedir)) - || (!mobj->target->player->kartstuff[k_itemheld])) - { - P_RemoveMobj(mobj); - return; - } - } - else*/ if ((mobj->health > 0 + if ((mobj->health > 0 && (!mobj->target || !mobj->target->player || mobj->target->player->health <= 0 || mobj->target->player->spectator)) || (mobj->health <= 0 && mobj->z <= mobj->floorz) || P_CheckDeathPitCollide(mobj)) // When in death state @@ -8249,16 +8236,24 @@ void P_MobjThinker(mobj_t *mobj) return; } - P_TeleportMove(mobj, mobj->target->x + P_ReturnThrustX(mobj, mobj->target->angle+ANGLE_180, mobj->target->radius), - mobj->target->y + P_ReturnThrustY(mobj, mobj->target->angle+ANGLE_180, mobj->target->radius), mobj->target->z); mobj->angle = mobj->target->angle; + P_TeleportMove(mobj, mobj->target->x + P_ReturnThrustX(mobj, mobj->angle+ANGLE_180, mobj->target->radius), + mobj->target->y + P_ReturnThrustY(mobj, mobj->angle+ANGLE_180, mobj->target->radius), mobj->target->z); P_SetScale(mobj, mobj->target->scale); - if (mobj->target->player) { - if (mobj->target->player->kartstuff[k_sneakertimer] > mobj->movecount) - P_SetMobjState(mobj, S_BOOSTFLAME); - mobj->movecount = mobj->target->player->kartstuff[k_sneakertimer]; + player_t *p = NULL; + if (mobj->target->target && mobj->target->target->player) + p = mobj->target->target->player; + else if (mobj->target->player) + p = mobj->target->player; + + if (p) + { + if (p->kartstuff[k_sneakertimer] > mobj->movecount) + P_SetMobjState(mobj, S_BOOSTFLAME); + mobj->movecount = p->kartstuff[k_sneakertimer]; + } } if (mobj->state == &states[S_BOOSTSMOKESPAWNER]) @@ -8272,7 +8267,7 @@ void P_MobjThinker(mobj_t *mobj) smoke->momy = mobj->target->momy/2; smoke->momz = mobj->target->momz/2; - P_Thrust(smoke, mobj->target->angle+FixedAngle(P_RandomRange(135, 225)<mobj_scale); + P_Thrust(smoke, mobj->angle+FixedAngle(P_RandomRange(135, 225)<mobj_scale); } break; case MT_SPARKLETRAIL: @@ -8350,6 +8345,39 @@ void P_MobjThinker(mobj_t *mobj) P_TeleportMove(mobj, destx, desty, mobj->target->z); break; } + case MT_ROCKETSNEAKER: + if (!mobj->target || !mobj->target->health) + { + P_RemoveMobj(mobj); + return; + } + if (mobj->target->player && !mobj->target->player->kartstuff[k_rocketsneakertimer]) + { + mobj->flags &= ~MF_NOGRAVITY; + mobj->angle += ANGLE_45; + + if (!mobj->extravalue2) + { + if (mobj->eflags & MFE_VERTICALFLIP) + mobj->z -= mobj->height; + else + mobj->z += mobj->height; + + S_StartSound(mobj, mobj->info->deathsound); + P_SetObjectMomZ(mobj, 8*FRACUNIT, false); + P_InstaThrust(mobj, R_PointToAngle2(mobj->target->x, mobj->target->y, mobj->x, mobj->y)+ANGLE_90, 16*FRACUNIT); + mobj->momx += mobj->target->momx; + mobj->momy += mobj->target->momy; + mobj->momz += mobj->target->momz; + mobj->extravalue2 = 1; + } + else if (P_IsObjectOnGround(mobj)) + { + P_RemoveMobj(mobj); + return; + } + } + break; case MT_KARMAHITBOX: if (!mobj->target || !mobj->target->health || !mobj->target->player || mobj->target->player->spectator || (G_RaceGametype() || mobj->target->player->kartstuff[k_bumper])) @@ -9335,7 +9363,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD: case MT_SSMINE: case MT_SSMINE_SHIELD: case MT_BALLHOG: case MT_SINK: - case MT_THUNDERSHIELD: + case MT_THUNDERSHIELD: case MT_ROCKETSNEAKER: P_SpawnShadowMobj(mobj); default: break; diff --git a/src/p_spec.c b/src/p_spec.c index ab47fec3f..57b4dd435 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4036,7 +4036,7 @@ DoneSection2: player->kartstuff[k_floorboost] = 3; else player->kartstuff[k_floorboost] = 2; - K_DoSneaker(player, false); + K_DoSneaker(player, 0); } break; From 59dbb95ce01098502ba0fb503c7c8cc8f08459ff Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 8 Oct 2018 16:20:30 -0400 Subject: [PATCH 03/22] boostcam scales based on previous boost --- src/k_kart.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d07e2f3ec..5180b9ccf 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2977,10 +2977,27 @@ static void K_DoHyudoroSteal(player_t *player) void K_DoSneaker(player_t *player, INT32 type) { - fixed_t prevboost = player->kartstuff[k_speedboost]; + fixed_t intendedboost; + + switch (gamespeed) + { + case 0: + intendedboost = 53740+768; + break; + case 2: + intendedboost = 17294+768; + break; + default: + intendedboost = 32768; + break; + } if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) + { S_StartSound(player->mo, sfx_cdfm01); + if (intendedboost > player->kartstuff[k_speedboost]) + player->kartstuff[k_destboostcam] = FixedMul(FRACUNIT, FixedDiv((intendedboost - player->kartstuff[k_speedboost]), intendedboost)); + } if (!player->kartstuff[k_sneakertimer]) { @@ -3018,10 +3035,6 @@ void K_DoSneaker(player_t *player, INT32 type) player->pflags |= PF_ATTACKDOWN; K_PlayBoostTaunt(player->mo); } - - K_GetKartBoostPower(player); - if (player->kartstuff[k_speedboost] > prevboost) - player->kartstuff[k_destboostcam] = FRACUNIT; } static void K_DoShrink(player_t *player) From b8db9581c2aa763389018877cfbcda4cf200df87 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 10 Oct 2018 14:56:50 -0400 Subject: [PATCH 04/22] Last batch of tweaks - Rocket sneaker meter depletes more slowly when idle, but depletes much more when using it. This balances out to give it a couple more boosts when you use it well, but allows you to waste it more quickly when you don't want it anymore. Also demonstrates better to new players to not spam it like a gold shroom! - Vibrating frames on sneakers when they aren't being used. - Shoe weight is less strong. --- src/dehacked.c | 2 ++ src/info.c | 2 ++ src/info.h | 2 ++ src/k_kart.c | 20 ++++++++------------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index f01f874c7..0d42ae77d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6314,6 +6314,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Rocket sneaker "S_ROCKETSNEAKER_L", "S_ROCKETSNEAKER_R", + "S_ROCKETSNEAKER_LVIBRATE", + "S_ROCKETSNEAKER_RVIBRATE", //{ Eggman Monitor "S_FAKEITEM1", diff --git a/src/info.c b/src/info.c index 7ef8dc719..fafd09d70 100644 --- a/src/info.c +++ b/src/info.c @@ -2625,6 +2625,8 @@ state_t states[NUMSTATES] = {SPR_RSHE, 0, -1, {NULL}, 0, 0, S_NULL}, // S_ROCKETSNEAKER_L {SPR_RSHE, 1, -1, {NULL}, 0, 0, S_NULL}, // S_ROCKETSNEAKER_R + {SPR_RSHE, 2, -1, {NULL}, 0, 0, S_NULL}, // S_ROCKETSNEAKER_LVIBRATE + {SPR_RSHE, 3, -1, {NULL}, 0, 0, S_NULL}, // S_ROCKETSNEAKER_RVIBRATE {SPR_FITM, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM2}, // S_FAKEITEM1 {SPR_FITM, 1|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM3}, // S_FAKEITEM2 diff --git a/src/info.h b/src/info.h index 687d87147..f14d21212 100644 --- a/src/info.h +++ b/src/info.h @@ -3159,6 +3159,8 @@ typedef enum state // Rocket sneaker S_ROCKETSNEAKER_L, S_ROCKETSNEAKER_R, + S_ROCKETSNEAKER_LVIBRATE, + S_ROCKETSNEAKER_RVIBRATE, //{ Eggman Monitor S_FAKEITEM1, diff --git a/src/k_kart.c b/src/k_kart.c index 172c7d759..5c7d22ee5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -997,14 +997,9 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) weight = (against->player->kartweight)<player) - weight = (against->player->kartweight*2)<player) weight = (against->player->kartweight)<kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) { S_StartSound(player->mo, sfx_cdfm01); + K_SpawnDashDustRelease(player); if (intendedboost > player->kartstuff[k_speedboost]) player->kartstuff[k_destboostcam] = FixedMul(FRACUNIT, FixedDiv((intendedboost - player->kartstuff[k_speedboost]), intendedboost)); - K_SpawnDashDustRelease(player); } if (!player->kartstuff[k_sneakertimer]) @@ -3599,6 +3594,7 @@ static void K_MoveHeldObjects(player_t *player) while (cur && !P_MobjWasRemoved(cur)) { const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); + boolean vibrate = ((leveltime & 1) && !cur->tracer); angle_t angoffset; fixed_t targx, targy, targz; @@ -3610,9 +3606,9 @@ static void K_MoveHeldObjects(player_t *player) cur->flags2 &= ~MF2_DONTDRAW; if (num & 1) - P_SetMobjStateNF(cur, S_ROCKETSNEAKER_L); + P_SetMobjStateNF(cur, (vibrate ? S_ROCKETSNEAKER_LVIBRATE : S_ROCKETSNEAKER_L)); else - P_SetMobjStateNF(cur, S_ROCKETSNEAKER_R); + P_SetMobjStateNF(cur, (vibrate ? S_ROCKETSNEAKER_RVIBRATE : S_ROCKETSNEAKER_R)); if (!player->kartstuff[k_rocketsneakertimer] || cur->extravalue2 || !cur->health) { @@ -4690,7 +4686,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { K_DoSneaker(player, 2); K_PlayBoostTaunt(player->mo); - player->kartstuff[k_rocketsneakertimer] -= 5; + player->kartstuff[k_rocketsneakertimer] -= 2*TICRATE; if (player->kartstuff[k_rocketsneakertimer] < 1) player->kartstuff[k_rocketsneakertimer] = 1; } @@ -4724,7 +4720,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) //K_DoSneaker(player, 2); - player->kartstuff[k_rocketsneakertimer] = itemtime; + player->kartstuff[k_rocketsneakertimer] = itemtime*3; player->kartstuff[k_itemamount]--; K_UpdateHnextList(player, true); @@ -6157,7 +6153,7 @@ static void K_drawKartItem(void) if (itembar && hudtrans) { const INT32 barlength = (splitscreen > 1 ? 12 : 24); - const INT32 max = itemtime; // timer's normal highest value + const INT32 max = itemtime*3; // timer's normal highest value const INT32 length = min(barlength, (itembar * barlength) / max); const INT32 height = (offset ? 1 : 2); const INT32 x = (offset ? 17 : 11), y = (offset ? 27 : 35); From 0f2ec53255fcf2e6d1873ad7bc646866fb074f4c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 10 Oct 2018 17:31:09 -0400 Subject: [PATCH 05/22] Removed bumping K_KartBouncing is so flaky, I have no idea why it refuses to work. --- src/info.c | 2 +- src/k_kart.c | 1 - src/p_inter.c | 9 --------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/info.c b/src/info.c index fafd09d70..19c90c7b1 100644 --- a/src/info.c +++ b/src/info.c @@ -14831,7 +14831,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_s3kc0s, // activesound - MF_SPECIAL|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, diff --git a/src/k_kart.c b/src/k_kart.c index 5c7d22ee5..2f238ce6b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -999,7 +999,6 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) break; case MT_ORBINAUT: case MT_ORBINAUT_SHIELD: - case MT_ROCKETSNEAKER: if (against->player) weight = (against->player->kartweight)<target->player->kartstuff[k_eggmanblame] = -1; } return; - case MT_ROCKETSNEAKER: - if (!player->mo) - return; - if (special->extravalue2) - return; - if (special->target && player->mo == special->target) - return; - K_KartBouncing(player->mo, special, false, false); - return; // ***************************************** // // Rings, coins, spheres, weapon panels, etc // From cd30ae3fb1356334a799f24b670add6e936caedf Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 10 Oct 2018 17:46:23 -0400 Subject: [PATCH 06/22] para --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2f238ce6b..1414c2385 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4719,7 +4719,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) //K_DoSneaker(player, 2); - player->kartstuff[k_rocketsneakertimer] = itemtime*3; + player->kartstuff[k_rocketsneakertimer] = (itemtime*3); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player, true); @@ -6152,7 +6152,7 @@ static void K_drawKartItem(void) if (itembar && hudtrans) { const INT32 barlength = (splitscreen > 1 ? 12 : 24); - const INT32 max = itemtime*3; // timer's normal highest value + const INT32 max = (itemtime*3); // timer's normal highest value const INT32 length = min(barlength, (itembar * barlength) / max); const INT32 height = (offset ? 1 : 2); const INT32 x = (offset ? 17 : 11), y = (offset ? 27 : 35); From 665d2c1f2c94f678fcd0dffcfd73b29a0aff819f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 13 Oct 2018 17:54:53 -0400 Subject: [PATCH 07/22] Hard Mode is an unlockable Unlocks at 30 emblems, or 100 matches played --- src/command.c | 25 +++++++++++++++++++++++++ src/d_netcmd.c | 7 +++++++ src/dehacked.c | 2 ++ src/m_cond.c | 33 +++++++++++++++++++-------------- src/m_cond.h | 7 ++++--- 5 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/command.c b/src/command.c index df5ffa4f5..3ca7cb3a6 100644 --- a/src/command.c +++ b/src/command.c @@ -1600,6 +1600,31 @@ void CV_AddValue(consvar_t *var, INT32 increment) return; } } + else if (var == &cv_kartspeed) + { + INT32 maxspeed = (M_SecretUnlocked(SECRET_HARDSPEED) ? 2 : 1); + // Special case for the kartspeed variable, used only directly from the menu to prevent selecting hard mode + if (increment > 0) // Going up! + { + newvalue = var->value + 1; + if (newvalue > maxspeed) + newvalue = 0; + var->value = newvalue; + var->string = var->PossibleValue[var->value].strvalue; + var->func(); + return; + } + else if (increment < 0) // Going down! + { + newvalue = var->value - 1; + if (newvalue < 0) + newvalue = maxspeed; + var->value = newvalue; + var->string = var->PossibleValue[var->value].strvalue; + var->func(); + return; + } + } #ifdef PARANOIA if (currentindice == -1) I_Error("CV_AddValue: current value %d not found in possible value\n", diff --git a/src/d_netcmd.c b/src/d_netcmd.c index da303f266..b45322c8e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -5233,6 +5233,13 @@ static void KartFrantic_OnChange(void) static void KartSpeed_OnChange(void) { + if (!M_SecretUnlocked(SECRET_HARDSPEED) && cv_kartspeed.value == 2) + { + CONS_Printf(M_GetText("You haven't earned this yet.\n")); + CV_StealthSetValue(&cv_kartspeed, 1); + return; + } + if (G_RaceGametype()) { if ((UINT8)cv_kartspeed.value != gamespeed && gamestate == GS_LEVEL && leveltime > starttime) diff --git a/src/dehacked.c b/src/dehacked.c index 4a7599b9d..0082775bd 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2430,6 +2430,8 @@ static void readunlockable(MYFILE *f, INT32 num) unlockables[num].type = SECRET_ENCORE; else if (fastcmp(word2, "HELLATTACK")) unlockables[num].type = SECRET_HELLATTACK; + else if (fastcmp(word2, "HARDSPEED")) + unlockables[num].type = SECRET_HARDSPEED; else unlockables[num].type = (INT16)i; } diff --git a/src/m_cond.c b/src/m_cond.c index 80b863316..7387a8044 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -101,10 +101,11 @@ unlockable_t unlockables[MAXUNLOCKABLES] = /* 02 */ {"SMK Cup", "", -1, 2, SECRET_NONE, 0, false, false, 0}, /* 03 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, - /* 04 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, - /* 05 */ {"Hell Attack", "", 5, 5, SECRET_HELLATTACK, 0, false, false, 0}, + /* 04 */ {"Hard Game Speed", "", -1, 4, SECRET_HARDSPEED, 0, false, false, 0}, + /* 05 */ {"Encore Mode", "", 4, 5, SECRET_ENCORE, 0, false, false, 0}, + /* 06 */ {"Hell Attack", "", 6, 6, SECRET_HELLATTACK, 0, false, false, 0}, - /* 06 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 07 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, }; // Default number of emblems and extra emblems @@ -120,23 +121,27 @@ void M_SetupDefaultConditionSets(void) M_AddRawCondition(1, 1, UC_TOTALEMBLEMS, 5, 0, 0); M_AddRawCondition(1, 2, UC_MATCHESPLAYED, 10, 0, 0); - // -- 2: Collect 15 emblems OR play 25 matches - M_AddRawCondition(2, 1, UC_TOTALEMBLEMS, 15, 0, 0); + // -- 2: Collect 10 emblems OR play 25 matches + M_AddRawCondition(2, 1, UC_TOTALEMBLEMS, 10, 0, 0); M_AddRawCondition(2, 2, UC_MATCHESPLAYED, 25, 0, 0); - // -- 3: Collect 30 emblems OR play 50 matches - M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 30, 0, 0); + // -- 3: Collect 20 emblems OR play 50 matches + M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 20, 0, 0); M_AddRawCondition(3, 2, UC_MATCHESPLAYED, 50, 0, 0); - // -- 4: Collect 40 emblems OR play 150 matches - M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 40, 0, 0); - M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 150, 0, 0); + // -- 4: Collect 30 emblems OR play 100 matches + M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 30, 0, 0); + M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 100, 0, 0); - // -- 5: Collect 50 emblems ONLY - M_AddRawCondition(5, 1, UC_TOTALEMBLEMS, 50, 0, 0); + // -- 5: Collect 40 emblems OR play 150 matches + M_AddRawCondition(5, 1, UC_TOTALEMBLEMS, 40, 0, 0); + M_AddRawCondition(5, 2, UC_MATCHESPLAYED, 150, 0, 0); - // -- 10: Play 100 matches - M_AddRawCondition(10, 1, UC_MATCHESPLAYED, 100, 0, 0); + // -- 6: Collect 50 emblems ONLY + M_AddRawCondition(6, 1, UC_TOTALEMBLEMS, 50, 0, 0); + + // -- 10: Play 300 matches + M_AddRawCondition(10, 1, UC_MATCHESPLAYED, 300, 0, 0); } void M_AddRawCondition(UINT8 set, UINT8 id, conditiontype_t c, INT32 r, INT16 x1, INT16 x2) diff --git a/src/m_cond.h b/src/m_cond.h index 81b6803c8..f48e6fbe9 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -113,7 +113,7 @@ typedef struct } unlockable_t; // I have NO idea why these are going negative, but whatever. -#define SECRET_NONE -6 // Does nil. Use with levels locked by UnlockRequired +#define SECRET_NONE -6 // Does nil. Use with levels locked by UnlockRequired #define SECRET_ITEMFINDER -5 // Enables Item Finder/Emblem Radar #define SECRET_EMBLEMHINTS -4 // Enables Emblem Hints #define SECRET_PANDORA -3 // Enables Pandora's Box @@ -124,8 +124,9 @@ typedef struct #define SECRET_WARP 2 // Selectable warp #define SECRET_SOUNDTEST 3 // Sound Test #define SECRET_CREDITS 4 // Enables Credits -#define SECRET_ENCORE 5 // Enables Encore mode cvar -#define SECRET_HELLATTACK 6 // Map Hell in record attack +#define SECRET_ENCORE 5 // Enables Encore mode cvar +#define SECRET_HELLATTACK 6 // Map Hell in record attack +#define SECRET_HARDSPEED 7 // Enables Hard gamespeed // If you have more secrets than these variables allow in your game, // you seriously need to get a life. From 801f21f36fa199a5406e7cfcd8a64406a6e5f554 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 13 Oct 2018 23:38:16 +0100 Subject: [PATCH 08/22] Fix to itembar visual length problem --- src/k_kart.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 1414c2385..fcf99f808 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6151,9 +6151,10 @@ static void K_drawKartItem(void) // Extensible meter, currently only used for rocket sneaker... if (itembar && hudtrans) { - const INT32 barlength = (splitscreen > 1 ? 12 : 24); - const INT32 max = (itemtime*3); // timer's normal highest value - const INT32 length = min(barlength, (itembar * barlength) / max); + const INT32 barlength = (splitscreen > 1 ? 12 : 26); + const INT32 maxl = (itemtime*3) - barlength; // timer's normal highest value + const INT32 fill = ((itembar*barlength)/maxl); + const INT32 length = min(barlength, fill); const INT32 height = (offset ? 1 : 2); const INT32 x = (offset ? 17 : 11), y = (offset ? 27 : 35); From 3186af9e51f57adf98b4d5cd7a79693eac72f5c5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 14 Oct 2018 17:45:28 -0400 Subject: [PATCH 09/22] Remove most gameplay prints A couple of the extraneous ones (karma interactions, bumper stealing, lap start notifications) have been removed outright. The rest that I could think of have been changed to use CON_LogMessage, so that they still go into log.txt when rereading a fun chat session but not showing themselves in gameplay. Necessary gameplay prints, such as players being defeated or coming back in Battle, have been kept until there's a suitable replacement for them in the future. --- src/d_clisrv.c | 12 ++++++------ src/d_netcmd.c | 6 +++--- src/g_game.c | 8 ++++---- src/k_kart.c | 9 ++------- src/p_inter.c | 6 ------ src/p_spec.c | 12 +++--------- src/p_user.c | 5 +++-- 7 files changed, 21 insertions(+), 37 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ec3aa444e..2dd044bc8 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1635,18 +1635,18 @@ static void CL_LoadReceivedSavegame(void) if (P_LoadNetGame()) { - CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap)); + CON_LogMessage(va(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap))); if (strlen(mapheaderinfo[gamemap-1]->lvlttl) > 0) { - CONS_Printf(": %s", mapheaderinfo[gamemap-1]->lvlttl); + CON_LogMessage(va(": %s", mapheaderinfo[gamemap-1]->lvlttl)); if (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) - CONS_Printf(" %s", mapheaderinfo[gamemap-1]->zonttl); + CON_LogMessage(va(" %s", mapheaderinfo[gamemap-1]->zonttl)); else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) - CONS_Printf(M_GetText(" ZONE")); + CON_LogMessage(M_GetText(" ZONE")); if (strlen(mapheaderinfo[gamemap-1]->actnum) > 0) - CONS_Printf(" %s", mapheaderinfo[gamemap-1]->actnum); + CON_LogMessage(va(" %s", mapheaderinfo[gamemap-1]->actnum)); } - CONS_Printf("\"\n"); + CON_LogMessage("\"\n"); } else { diff --git a/src/d_netcmd.c b/src/d_netcmd.c index da303f266..ce2bbecbc 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -420,7 +420,7 @@ static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, " consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL}; // log elemental hazards -- not a netvar, is local to current player -consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_hazardlog = {"hazardlog", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_forceskin = {"forceskin", "-1", CV_NETVAR|CV_CALL|CV_CHEAT, NULL, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -3217,11 +3217,11 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80'); } else if (NetPacket.packet.newteam == 3) - /*CONS_Printf(M_GetText("%s entered the game.\n"), player_names[playernum])*/; + CON_LogMessage(va(M_GetText("%s entered the game.\n"), player_names[playernum])); else if (players[playernum].pflags & PF_WANTSTOJOIN) players[playernum].pflags &= ~PF_WANTSTOJOIN; else - CONS_Printf(M_GetText("%s became a spectator.\n"), player_names[playernum]); + CON_LogMessage(va(M_GetText("%s became a spectator.\n"), player_names[playernum])); //reset view if you are changed, or viewing someone who was changed. if (playernum == consoleplayer || displayplayer == playernum) diff --git a/src/g_game.c b/src/g_game.c index 8d706bbf3..6e8c01e99 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3051,7 +3051,7 @@ void G_ExitLevel(void) } if (netgame || multiplayer) - CONS_Printf(M_GetText("The round has ended.\n")); + CON_LogMessage(M_GetText("The round has ended.\n")); // Remove CEcho text on round end. HU_DoCEcho(""); @@ -4341,13 +4341,13 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool { char *title = G_BuildMapTitle(gamemap); - CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap)); + CON_LogMessage(va(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap))); if (title) { - CONS_Printf(": %s", title); + CON_LogMessage(va(": %s", title)); Z_Free(title); } - CONS_Printf("\"\n"); + CON_LogMessage("\"\n"); } } diff --git a/src/k_kart.c b/src/k_kart.c index 24acd3f27..b7c8721fb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2042,13 +2042,8 @@ void K_StealBumper(player_t *player, player_t *victim, boolean force) } } - if (netgame) - { - if (player->kartstuff[k_bumper] <= 0) - CONS_Printf(M_GetText("%s is back in the game!\n"), player_names[player-players]); - else if (cv_hazardlog.value) - CONS_Printf(M_GetText("%s stole a bumper from %s!\n"), player_names[player-players], player_names[victim-players]); - } + if (netgame && player->kartstuff[k_bumper] <= 0) + CONS_Printf(M_GetText("%s is back in the game!\n"), player_names[player-players]); newbumper = player->kartstuff[k_bumper]; if (newbumper <= 1) diff --git a/src/p_inter.c b/src/p_inter.c index cd0ed8938..11f2f5043 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -510,8 +510,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } special->target->player->kartstuff[k_comebackpoints] += 2 * (K_IsPlayerWanted(player) ? 2 : 1); - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]); if (special->target->player->kartstuff[k_comebackpoints] >= 3) K_StealBumper(special->target->player, player, true); special->target->player->kartstuff[k_comebacktimer] = comebacktime; @@ -527,8 +525,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->target->player->kartstuff[k_comebackmode] = 0; special->target->player->kartstuff[k_comebackpoints]++; - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[special->target->player-players], player_names[player-players]); if (special->target->player->kartstuff[k_comebackpoints] >= 3) K_StealBumper(special->target->player, player, true); special->target->player->kartstuff[k_comebacktimer] = comebacktime; @@ -560,8 +556,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->target->player->kartstuff[k_comebackmode] = 0; special->target->player->kartstuff[k_comebackpoints]++; - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s gave an \"item\" to %s.\n"), player_names[special->target->player-players], player_names[player-players]); if (special->target->player->kartstuff[k_comebackpoints] >= 3) K_StealBumper(special->target->player, player, true); special->target->player->kartstuff[k_comebacktimer] = comebacktime; diff --git a/src/p_spec.c b/src/p_spec.c index 143efd90b..f723a6e7b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -36,6 +36,7 @@ #include "lua_hook.h" // LUAh_LinedefExecute #include "k_kart.h" // SRB2kart +#include "console.h" // CON_LogMessage #ifdef HW3SOUND #include "hardware/hw3sound.h" @@ -4215,15 +4216,8 @@ DoneSection2: if (player->pflags & PF_NIGHTSMODE) player->drillmeter += 48*20; - if (netgame) - { - if (player->laps >= (UINT8)cv_numlaps.value) - CONS_Printf(M_GetText("%s has finished the race.\n"), player_names[player-players]); - else if (player->laps == (UINT8)(cv_numlaps.value - 1)) - CONS_Printf("%s started the final lap\n", player_names[player-players]); - else - CONS_Printf(M_GetText("%s started lap %u\n"), player_names[player-players], (UINT32)player->laps+1); - } + if (netgame && player->laps >= (UINT8)cv_numlaps.value) + CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players])); // SRB2Kart: save best lap for record attack if (player == &players[consoleplayer]) diff --git a/src/p_user.c b/src/p_user.c index e49c8fda1..71ff53dab 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -45,6 +45,7 @@ // SRB2kart #include "m_cond.h" // M_UpdateUnlockablesAndExtraEmblems #include "k_kart.h" +#include "console.h" // CON_LogMessage #ifdef HW3SOUND #include "hardware/hw3sound.h" @@ -8732,7 +8733,7 @@ boolean P_SpectatorJoinGame(player_t *player) if (P_IsLocalPlayer(player) && displayplayer != consoleplayer) displayplayer = consoleplayer; - CONS_Printf(M_GetText("%s entered the game.\n"), player_names[player-players]); + CON_LogMessage(va(M_GetText("%s entered the game.\n"), player_names[player-players])); return true; // no more player->mo, cannot continue. } return false; @@ -8878,7 +8879,7 @@ static void P_CalcPostImg(player_t *player) void P_DoTimeOver(player_t *player) { if (netgame && player->health > 0) - CONS_Printf(M_GetText("%s ran out of time.\n"), player_names[player-players]); + CON_LogMessage(va(M_GetText("%s ran out of time.\n"), player_names[player-players])); player->pflags |= PF_TIMEOVER; From 055d9ecc69cd1a788be2d3e292826bf719d9d5ba Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 14 Oct 2018 17:54:18 -0400 Subject: [PATCH 10/22] restore --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 71ff53dab..3c419e64f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8879,7 +8879,7 @@ static void P_CalcPostImg(player_t *player) void P_DoTimeOver(player_t *player) { if (netgame && player->health > 0) - CON_LogMessage(va(M_GetText("%s ran out of time.\n"), player_names[player-players])); + CONS_Printf(M_GetText("%s ran out of time.\n"), player_names[player-players]); player->pflags |= PF_TIMEOVER; From 876f5517a1e72eb6086c0a7fbabef7c107e4369c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 15 Oct 2018 17:40:25 -0400 Subject: [PATCH 11/22] remove all hit msgs & cv_hazardlog --- src/d_netcmd.c | 5 -- src/d_netcmd.h | 2 - src/p_inter.c | 196 ------------------------------------------------- 3 files changed, 203 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ce2bbecbc..de635aa5c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -419,9 +419,6 @@ consvar_t cv_numlaps = {"numlaps", "3", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_con static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}}; consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL}; -// log elemental hazards -- not a netvar, is local to current player -consvar_t cv_hazardlog = {"hazardlog", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; - consvar_t cv_forceskin = {"forceskin", "-1", CV_NETVAR|CV_CALL|CV_CHEAT, NULL, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -594,8 +591,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_numlaps); CV_RegisterVar(&cv_basenumlaps); - CV_RegisterVar(&cv_hazardlog); - CV_RegisterVar(&cv_autobalance); CV_RegisterVar(&cv_teamscramble); CV_RegisterVar(&cv_scrambleonchange); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index aee243cf3..bbd96d699 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -81,8 +81,6 @@ extern consvar_t cv_basenumlaps; extern UINT32 timelimitintics; extern consvar_t cv_allowexitlevel; -extern consvar_t cv_hazardlog; - extern consvar_t cv_autobalance; extern consvar_t cv_teamscramble; extern consvar_t cv_scrambleonchange; diff --git a/src/p_inter.c b/src/p_inter.c index 11f2f5043..15cea7b51 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1661,199 +1661,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } } -// -/** Prints death messages relating to a dying or hit player. - * - * \param player Affected player. - * \param inflictor The attack weapon used, can be NULL. - * \param source The attacker, can be NULL. - */ -static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *source) -{ - const char *str = NULL; - boolean deathonly = false; - boolean deadsource = false; - boolean deadtarget = false; - // player names complete with control codes - char targetname[MAXPLAYERNAME+4]; - char sourcename[MAXPLAYERNAME+4]; - - if (G_RaceGametype()) - return; // Not in coop, etc. - - if (!player) - return; // Impossible! - - if (player->spectator) - return; // No messages for dying (crushed) spectators. - - if (!netgame) - return; // Presumably it's obvious what's happening in splitscreen. - -#ifdef HAVE_BLUA - if (LUAh_HurtMsg(player, inflictor, source)) - return; -#endif - - deadtarget = (player->health <= 0); - - // Target's name - snprintf(targetname, sizeof(targetname), "%s%s%s", - CTFTEAMCODE(player), - player_names[player - players], - CTFTEAMENDCODE(player)); - - if (source) - { - // inflictor shouldn't be NULL if source isn't - I_Assert(inflictor != NULL); - - if (source->player) - { - // Source's name (now that we know there is one) - snprintf(sourcename, sizeof(sourcename), "%s%s%s", - CTFTEAMCODE(source->player), - player_names[source->player - players], - CTFTEAMENDCODE(source->player)); - - // We don't care if it's us. - // "Player 1's [redacted] killed Player 1." - if (source->player->playerstate == PST_DEAD && source->player != player && - (inflictor->flags2 & MF2_BEYONDTHEGRAVE)) - deadsource = true; - - if (inflictor->flags & MF_PUSHABLE) - { - str = M_GetText("%s%s's playtime with heavy objects %s %s.\n"); - } - else switch (inflictor->type) - { - case MT_PLAYER: - if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) - str = M_GetText("%s%s's armageddon blast %s %s.\n"); - else if (inflictor->player->powers[pw_invulnerability]) - str = M_GetText("%s%s's invincibility aura %s %s.\n"); - else if (inflictor->player->powers[pw_super]) - str = M_GetText("%s%s's super aura %s %s.\n"); - else - str = M_GetText("%s%s's tagging hand %s %s.\n"); - break; - case MT_SPINFIRE: - str = M_GetText("%s%s's elemental fire trail %s %s.\n"); - break; - case MT_THROWNBOUNCE: - str = M_GetText("%s%s's bounce ring %s %s.\n"); - break; - case MT_THROWNINFINITY: - str = M_GetText("%s%s's infinity ring %s %s.\n"); - break; - case MT_THROWNAUTOMATIC: - str = M_GetText("%s%s's automatic ring %s %s.\n"); - break; - case MT_THROWNSCATTER: - str = M_GetText("%s%s's scatter ring %s %s.\n"); - break; - // TODO: For next two, figure out how to determine if it was a direct hit or splash damage. -SH - case MT_THROWNEXPLOSION: - str = M_GetText("%s%s's explosion ring %s %s.\n"); - break; - case MT_THROWNGRENADE: - str = M_GetText("%s%s's grenade ring %s %s.\n"); - break; - case MT_REDRING: - if (inflictor->flags2 & MF2_RAILRING) - str = M_GetText("%s%s's rail ring %s %s.\n"); - else - str = M_GetText("%s%s's thrown ring %s %s.\n"); - break; - default: - str = M_GetText("%s%s %s %s.\n"); - break; - } - - CONS_Printf(str, - deadsource ? M_GetText("The late ") : "", - sourcename, - deadtarget ? M_GetText("killed") : M_GetText("hit"), - targetname); - return; - } - else switch (source->type) - { - case MT_NULL: - switch(source->threshold) - { - case 42: - deathonly = true; - str = M_GetText("%s drowned.\n"); - break; - case 43: - str = M_GetText("%s was %s by spikes.\n"); - break; - case 44: - deathonly = true; - str = M_GetText("%s was crushed.\n"); - break; - } - break; - case MT_EGGMANICO: - case MT_EGGMANBOX: - str = M_GetText("%s was %s by Eggman's nefarious TV magic.\n"); - break; - case MT_SPIKE: - str = M_GetText("%s was %s by spikes.\n"); - break; - default: - str = M_GetText("%s was %s by an environmental hazard.\n"); - break; - } - } - else - { - // null source, environment kills - // TERRIBLE HACK for hit damage because P_DoPlayerPain moves the player... - // I'll put it back, I promise! - player->mo->z -= player->mo->momz+1; - if (P_PlayerTouchingSectorSpecial(player, 1, 2)) - str = M_GetText("%s was %s by chemical water.\n"); - else if (P_PlayerTouchingSectorSpecial(player, 1, 3)) - str = M_GetText("%s was %s by molten lava.\n"); - else if (P_PlayerTouchingSectorSpecial(player, 1, 4)) - str = M_GetText("%s was %s by electricity.\n"); - else if (deadtarget) - { - deathonly = true; - if (P_PlayerTouchingSectorSpecial(player, 1, 6) - || P_PlayerTouchingSectorSpecial(player, 1, 7)) - str = M_GetText("%s fell into a bottomless pit.\n"); - else if (P_PlayerTouchingSectorSpecial(player, 1, 12)) - str = M_GetText("%s asphyxiated in space.\n"); - else - str = M_GetText("%s died.\n"); - } - if (!str) - str = M_GetText("%s was %s by an environmental hazard.\n"); - - player->mo->z += player->mo->momz+1; - } - - if (!str) // Should not happen! Unless we missed catching something above. - return; - - // Don't log every hazard hit if they don't want us to. - if (!deadtarget && !cv_hazardlog.value) - return; - - if (deathonly) - { - if (!deadtarget) - return; - CONS_Printf(str, targetname); - } - else - CONS_Printf(str, targetname, deadtarget ? M_GetText("killed") : M_GetText("hit")); -} - /** 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 * timelimitintics and overtime's status will be checked here each tick. @@ -2813,7 +2620,6 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou /*if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) { P_AddPlayerScore(source->player, 1); //award points to tagger. - P_HitDeathMessages(player, inflictor, source); if (gametype == GT_TAG) //survivor { @@ -3503,8 +3309,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (player->health < 0) player->health = 0; - P_HitDeathMessages(player, inflictor, source); - P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); } From 0717db3f3112da1e4c96b166bb5f79f5f5f6969f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 15 Oct 2018 18:41:34 -0400 Subject: [PATCH 12/22] Prevent spectate griefing If the player count dips below what was stored on the start of the last lap, then don't do time over so that someone can't just spectate at the end of a race out of rage. Y'all are assholes :V --- src/doomstat.h | 1 + src/g_game.c | 1 + src/k_kart.c | 1 + src/p_inter.c | 2 +- src/p_saveg.c | 2 ++ src/p_setup.c | 1 + src/p_spec.c | 13 ++++++++++++- 7 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 296c11bfe..1c5e4aa63 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -461,6 +461,7 @@ extern tic_t indirectitemcooldown; extern tic_t spbincoming; extern UINT8 spbplayer; extern tic_t mapreset; +extern UINT8 nospectategrief; extern boolean legitimateexit; extern boolean comebackshowninfo; diff --git a/src/g_game.c b/src/g_game.c index 8d706bbf3..8e7321866 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -267,6 +267,7 @@ tic_t indirectitemcooldown; // Cooldown before any more Shrink, SPB, or any othe tic_t spbincoming; // Timer before SPB hits, can switch targets at this point UINT8 spbplayer; // Player num that used the last SPB tic_t mapreset; // Map reset delay when enough players have joined an empty game +UINT8 nospectategrief; // How many players need to be in-game to eliminate last; for preventing spectate griefing // Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players) boolean legitimateexit; // Did this client actually finish the match? diff --git a/src/k_kart.c b/src/k_kart.c index 24acd3f27..ba9ee8396 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -31,6 +31,7 @@ // spbincoming is the timer before k_deathsentence is cast on the player in 1st // spbplayer is the last player who fired a SPB // mapreset is set when enough players fill an empty server +// nospectategrief is the players in-game needed to eliminate the person in last //{ SRB2kart Color Code diff --git a/src/p_inter.c b/src/p_inter.c index cd0ed8938..22141bb95 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2150,7 +2150,7 @@ boolean P_CheckRacers(void) numplayersingame++; } - if (numplayersingame > 1) // if there's more than one player in-game, this is safe to do + if (numplayersingame >= nospectategrief) // prevent spectate griefing { // check if we just got unlucky and there was only one guy who was a problem for (j = i+1; j < MAXPLAYERS; j++) diff --git a/src/p_saveg.c b/src/p_saveg.c index ffcc8789a..a4a5d6391 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3273,6 +3273,7 @@ static void P_NetArchiveMisc(void) WRITEUINT32(save_p, spbincoming); WRITEUINT8(save_p, spbplayer); WRITEUINT32(save_p, mapreset); + WRITEUINT8(save_p, nospectategrief); // Is it paused? if (paused) @@ -3379,6 +3380,7 @@ static inline boolean P_NetUnArchiveMisc(void) spbincoming = READUINT32(save_p); spbplayer = READUINT8(save_p); mapreset = READUINT32(save_p); + nospectategrief = READUINT8(save_p); // Is it paused? if (READUINT8(save_p) == 0x2f) diff --git a/src/p_setup.c b/src/p_setup.c index 78a597112..4fe721d70 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3027,6 +3027,7 @@ boolean P_SetupLevel(boolean skipprecip) spbincoming = 0; spbplayer = 0; mapreset = 0; + nospectategrief = 0; // clear special respawning que iquehead = iquetail = 0; diff --git a/src/p_spec.c b/src/p_spec.c index 143efd90b..328156605 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4249,12 +4249,23 @@ DoneSection2: S_StartSound(NULL, sfx_s221); } - // //player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostx = player->starposty = player->starpostz = 0; // Play the starpost sound for 'consistency' // S_StartSound(player->mo, sfx_strpst); + + // Figure out how many are playing on the last lap, to prevent spectate griefing + if (!nospectategrief && player->laps == (UINT8)(cv_numlaps.value - 1)) + { + UINT8 i; + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator) + continue; + nospectategrief++; + } + } } else if (player->starpostnum) { From bda7d70c15f574564f57e3875cab1742417cc267 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 15 Oct 2018 22:02:10 -0400 Subject: [PATCH 13/22] Quick fix for banana cheat not showing all unlockables Plus, this is generally better, as a mod could let you unlock stuff "out-of-order" --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 03e74a9a0..c3d431b57 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5096,7 +5096,7 @@ static void M_DrawChecklist(void) { if (unlockables[i].name[0] == 0 || unlockables[i].nochecklist || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS - || !M_Achieved(unlockables[i].showconditionset - 1)) + || (!M_Achieved(unlockables[i].showconditionset - 1) && !unlockables[i].unlocked)) continue; ++line; From 43656e070423558afb8027c4fcfe77e0d5828d34 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Oct 2018 12:23:05 -0400 Subject: [PATCH 14/22] == --> >= --- src/p_spec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index 328156605..8d84a1fe5 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4256,7 +4256,7 @@ DoneSection2: // S_StartSound(player->mo, sfx_strpst); // Figure out how many are playing on the last lap, to prevent spectate griefing - if (!nospectategrief && player->laps == (UINT8)(cv_numlaps.value - 1)) + if (!nospectategrief && player->laps >= (UINT8)(cv_numlaps.value - 1)) { UINT8 i; for (i = 0; i < MAXPLAYERS; i++) From 93f5c5c1f0c42b0b32fd2fa6972a89ffba7b7442 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Oct 2018 20:56:04 -0400 Subject: [PATCH 15/22] Prevent point grief (Needs tested) --- src/y_inter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 5d7456dd5..fea9a9b40 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -296,9 +296,9 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32)) else data.match.pos[data.match.numplayers] = data.match.numplayers+1; - if (!rankingsmode && !(players[i].pflags & PF_TIMEOVER) && (data.match.pos[data.match.numplayers] != numplayersingame)) + if (!rankingsmode && !(players[i].pflags & PF_TIMEOVER) && (data.match.pos[data.match.numplayers] != nospectategrief)) { - data.match.increase[i] = numplayersingame - data.match.pos[data.match.numplayers]; + data.match.increase[i] = nospectategrief - data.match.pos[data.match.numplayers]; players[i].score += data.match.increase[i]; } From efc37b002b9128ef25463a5098a70ef9c236906c Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 17 Oct 2018 13:40:17 +0100 Subject: [PATCH 16/22] Some token efforts to make singleplayer mode (accessible only via `-warp` and `map mapxx -force`) not COMPLETELY broken. * Fixed the conditionals for `suicide` and `retry` commands - `suicide` is now allowed in singleplayer, and `retry` no longer checks your lives (for now). * Disable the "traditional" level reload method (which `retry` tried to use), since it was completely broken with the other changes we've made. Mapchanges only. * Made retries cause a mapchange, per the above. * Disable the last source of skincolor trampling in the game - loading a level while not netgame or record attacking. --- src/d_netcmd.c | 9 +++++---- src/g_game.c | 10 ++++++---- src/m_menu.c | 10 +++++----- src/p_setup.c | 2 +- src/r_things.c | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 17ae1242d..3bb9a0d67 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2388,11 +2388,12 @@ static void Command_Suicide(void) }*/ // Retry is quicker. Probably should force people to use it. - if (!(netgame || multiplayer)) + // nope, this is srb2kart - a complete retry is overkill + /*if (!(netgame || multiplayer)) { CONS_Printf(M_GetText("You can't use this in Single Player! Use \"retry\" instead.\n")); return; - } + }*/ SendNetXCmd(XD_SUICIDE, &buf, 4); } @@ -4792,10 +4793,10 @@ void Command_Retry_f(void) CONS_Printf(M_GetText("You must be in a level to use this.\n")); else if (netgame || multiplayer) CONS_Printf(M_GetText("This only works in single player.\n")); - else if (!&players[consoleplayer] || players[consoleplayer].lives <= 1) + /*else if (!&players[consoleplayer] || players[consoleplayer].lives <= 1) CONS_Printf(M_GetText("You can't retry without any lives remaining!\n")); else if (G_IsSpecialStage(gamemap)) - CONS_Printf(M_GetText("You can't retry special stages!\n")); + CONS_Printf(M_GetText("You can't retry special stages!\n"));*/ else { M_ClearMenus(true); diff --git a/src/g_game.c b/src/g_game.c index ee1ee053a..c24590fdb 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2100,10 +2100,12 @@ void G_Ticker(boolean run) G_ClearRetryFlag(); // Costs a life to retry ... unless the player in question is dead already. - if (G_GametypeUsesLives() && players[consoleplayer].playerstate == PST_LIVE) + /*if (G_GametypeUsesLives() && players[consoleplayer].playerstate == PST_LIVE) players[consoleplayer].lives -= 1; - G_DoReborn(consoleplayer); + G_DoReborn(consoleplayer);*/ + + D_MapChange(gamemap, gametype, cv_kartencore.value, true, 1, false, false); } for (i = 0; i < MAXPLAYERS; i++) @@ -2935,7 +2937,7 @@ void G_DoReborn(INT32 playernum) if (oldmo) G_ChangePlayerReferences(oldmo, players[playernum].mo); } - else if (countdowntimeup || (!multiplayer && gametype == GT_COOP)) + /*else if (countdowntimeup || (!multiplayer && !modeattacking)) { // reload the level from scratch if (countdowntimeup) @@ -3004,7 +3006,7 @@ void G_DoReborn(INT32 playernum) #ifdef HAVE_BLUA } #endif - } + }*/ else { // respawn at the start diff --git a/src/m_menu.c b/src/m_menu.c index 2f848a2a1..8f3a5df6d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2865,18 +2865,18 @@ void M_StartControlPanel(void) } else if (!(netgame || multiplayer)) // Single Player { - if (gamestate != GS_LEVEL || ultimatemode) // intermission, so gray out stuff. + if (gamestate != GS_LEVEL /*|| ultimatemode*/) // intermission, so gray out stuff. { SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_GRAYEDOUT) : (IT_DISABLED); SPauseMenu[spause_retry].status = IT_GRAYEDOUT; } else { - INT32 numlives = 2; + //INT32 numlives = 2; SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - if (&players[consoleplayer]) + /*if (&players[consoleplayer]) { numlives = players[consoleplayer].lives; if (players[consoleplayer].playerstate != PST_LIVE) @@ -2887,7 +2887,7 @@ void M_StartControlPanel(void) // for me to want to use the short if statement syntax if (numlives <= 1 || G_IsSpecialStage(gamemap)) SPauseMenu[spause_retry].status = (IT_GRAYEDOUT); - else + else*/ SPauseMenu[spause_retry].status = (IT_STRING | IT_CALL); } @@ -4962,7 +4962,7 @@ static void M_RetryResponse(INT32 ch) static void M_Retry(INT32 choice) { (void)choice; - M_StartMessage(M_GetText("Retry this act from the last starpost?\n\n(Press 'Y' to confirm)\n"),M_RetryResponse,MM_YESNO); + M_StartMessage(M_GetText("Start this race over?\n\n(Press 'Y' to confirm)\n"),M_RetryResponse,MM_YESNO); } static void M_SelectableClearMenus(INT32 choice) diff --git a/src/p_setup.c b/src/p_setup.c index a606dca07..7c593ec95 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2209,7 +2209,7 @@ static void P_LevelInitStuff(void) players[i].lives = cv_startinglives.value; } #else - players[i].lives = 1; + players[i].lives = 1; // SRB2Kart #endif players[i].realtime = countdown = countdown2 = 0; diff --git a/src/r_things.c b/src/r_things.c index 802b3235e..a468f14df 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2699,7 +2699,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) player->jumpfactor = skin->jumpfactor; - if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) + /*if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) { if (playernum == consoleplayer) CV_StealthSetValue(&cv_playercolor, skin->prefcolor); @@ -2712,7 +2712,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) player->skincolor = skin->prefcolor; if (player->mo) player->mo->color = player->skincolor; - } + }*/ if (player->mo) P_SetScale(player->mo, player->mo->scale); From 1a698f65bb3427556c742c3e2b89709b99b9ae04 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 17 Oct 2018 13:38:31 -0400 Subject: [PATCH 17/22] < --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index fea9a9b40..6a7e305c2 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -296,7 +296,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32)) else data.match.pos[data.match.numplayers] = data.match.numplayers+1; - if (!rankingsmode && !(players[i].pflags & PF_TIMEOVER) && (data.match.pos[data.match.numplayers] != nospectategrief)) + if (!rankingsmode && !(players[i].pflags & PF_TIMEOVER) && (data.match.pos[data.match.numplayers] < nospectategrief)) { data.match.increase[i] = nospectategrief - data.match.pos[data.match.numplayers]; players[i].score += data.match.increase[i]; From 0172d5191e828a19b17a691a4f65235642cf58fd Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 17 Oct 2018 19:27:34 +0100 Subject: [PATCH 18/22] Disable rings, NiGHTS wing-emblems, special placement patterns, and team rings. Also, tweak the hoop spawning routine to correctly P_SetTarget the hnexts and hprevs, since I'm mucking around in there. --- src/p_mobj.c | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 32ac65502..537316f62 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11235,7 +11235,7 @@ ML_NOCLIMB : Direction not controllable void P_SpawnHoopsAndRings(mapthing_t *mthing) { mobj_t *mobj = NULL; - INT32 r, i; + INT32 /*r,*/ i; fixed_t x, y, z, finalx, finaly, finalz; sector_t *sec; TVector v, *res; @@ -11309,8 +11309,8 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) mobj = P_SpawnMobj(finalx, finaly, finalz, MT_HOOP); - if (maptol & TOL_XMAS) - P_SetMobjState(mobj, mobj->info->seestate + (i & 1)); + //if (maptol & TOL_XMAS) + //P_SetMobjState(mobj, mobj->info->seestate + (i & 1)); mobj->z -= mobj->height/2; P_SetTarget(&mobj->target, hoopcenter); // Link the sprite to the center. @@ -11319,8 +11319,10 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) // Link all the sprites in the hoop together if (nextmobj) { - mobj->hprev = nextmobj; - mobj->hprev->hnext = mobj; + P_SetTarget(&mobj->hprev, nextmobj); + P_SetTarget(&mobj->hprev->hnext, mobj); + //mobj->hprev = nextmobj; + //mobj->hprev->hnext = mobj; } else mobj->hprev = mobj->hnext = NULL; @@ -11350,8 +11352,10 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) // Link all the collision sprites together. mobj->hnext = NULL; - mobj->hprev = nextmobj; - mobj->hprev->hnext = mobj; + P_SetTarget(&mobj->hprev, nextmobj); + P_SetTarget(&mobj->hprev->hnext, mobj); + //mobj->hprev = nextmobj; + //mobj->hprev->hnext = mobj; nextmobj = mobj; } @@ -11377,8 +11381,10 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) // Link all the collision sprites together. mobj->hnext = NULL; - mobj->hprev = nextmobj; - mobj->hprev->hnext = mobj; + P_SetTarget(&mobj->hprev, nextmobj); + P_SetTarget(&mobj->hprev->hnext, mobj); + //mobj->hprev = nextmobj; + //mobj->hprev->hnext = mobj; nextmobj = mobj; } @@ -11451,8 +11457,8 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) mobj = P_SpawnMobj(finalx, finaly, finalz, MT_HOOP); - if (maptol & TOL_XMAS) - P_SetMobjState(mobj, mobj->info->seestate + (i & 1)); + //if (maptol & TOL_XMAS) + //P_SetMobjState(mobj, mobj->info->seestate + (i & 1)); mobj->z -= mobj->height/2; P_SetTarget(&mobj->target, hoopcenter); // Link the sprite to the center. @@ -11461,8 +11467,10 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) // Link all the sprites in the hoop together if (nextmobj) { - mobj->hprev = nextmobj; - mobj->hprev->hnext = mobj; + P_SetTarget(&mobj->hprev, nextmobj); + P_SetTarget(&mobj->hprev->hnext, mobj); + //mobj->hprev = nextmobj; + //mobj->hprev->hnext = mobj; } else mobj->hprev = mobj->hnext = NULL; @@ -11503,8 +11511,10 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) // Link all the collision sprites together. mobj->hnext = NULL; - mobj->hprev = nextmobj; - mobj->hprev->hnext = mobj; + P_SetTarget(&mobj->hprev, nextmobj); + P_SetTarget(&mobj->hprev->hnext, mobj); + //mobj->hprev = nextmobj; + //mobj->hprev->hnext = mobj; nextmobj = mobj; } @@ -11512,6 +11522,8 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) return; } + else return; // srb2kart - no rings or ring-like objects in R1 + /* // Wing logo item. else if (mthing->type == mobjinfo[MT_NIGHTSWING].doomednum) { @@ -11805,7 +11817,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) } } return; - } + }*/ } // From 2121bbae84ce22a2808e1883555c0ae196089953 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 17 Oct 2018 19:10:23 -0400 Subject: [PATCH 19/22] No more vanilla democam, for real --- src/g_game.c | 7 +++++++ src/g_game.h | 1 - src/p_user.c | 4 +--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index ee1ee053a..4cf7be6cd 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4496,6 +4496,13 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum) G_CopyTiccmd(cmd, &oldcmd, 1); + // SRB2kart: Copy-pasted from ticcmd building, removes that crappy demo cam + if (((players[displayplayer].mo && players[displayplayer].speed > 0) // Moving + || (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn + || (players[displayplayer].spectator || objectplacing)) // Not a physical player + && !(players[displayplayer].kartstuff[k_spinouttimer] && players[displayplayer].kartstuff[k_sneakertimer])) // Spinning and boosting cancels out spinout + localangle += (cmd->angleturn<<16); + if (!(demoflags & DF_GHOST) && *demo_p == DEMOMARKER) { // end of demo data stream diff --git a/src/g_game.h b/src/g_game.h index e34a69860..4dab9a764 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -188,7 +188,6 @@ void G_StopMetalDemo(void); ATTRNORETURN void FUNCNORETURN G_StopMetalRecording(void); void G_StopDemo(void); boolean G_CheckDemoStatus(void); -char *G_DemoPlayerName(char *defdemoname); boolean G_IsSpecialStage(INT32 mapnum); boolean G_GametypeUsesLives(void); diff --git a/src/p_user.c b/src/p_user.c index a09d35e14..86f89d45a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8215,7 +8215,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall // if (leveltime > 0 && timeinmap <= 0) // return true; - if (player->pflags & PF_NIGHTSMODE) + if (demoplayback) { focusangle = mo->angle; focusaiming = 0; @@ -8310,8 +8310,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall angle = thiscam->angle; else if (leveltime < starttime) angle = focusangle + FixedAngle(camrotate*FRACUNIT); - else if (demoplayback) - angle = players[consoleplayer].cmd.angleturn<<16; else { angle_t input = focusangle + FixedAngle(camrotate<angle; From 9b05eb0b98ee59f4976129dad25677c4e3c6c9da Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 18 Oct 2018 16:15:59 +0100 Subject: [PATCH 20/22] Play the traditional thundershield manifestation sound when a thundershield is manifested, plus a minor eye towards forward compatibility in the condition for manifestation. --- src/k_kart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index fccb68674..dd1a95ff1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4867,13 +4867,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } break; case KITEM_THUNDERSHIELD: - if (player->kartstuff[k_curshield] <= 0) + if (player->kartstuff[k_curshield] != 1) { mobj_t *shield = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THUNDERSHIELD); P_SetScale(shield, (shield->destscale = (5*shield->destscale)>>2)); P_SetTarget(&shield->target, player->mo); + S_StartSound(shield, sfx_s3k41); player->kartstuff[k_curshield] = 1; - } + } if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { K_DoThunderShield(player); From 6f7a0a5acfcfbe9dffa338404d19496221d02878 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 18 Oct 2018 16:18:54 +0100 Subject: [PATCH 21/22] Fix indentation. --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index dd1a95ff1..1bd4bc212 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4874,7 +4874,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_SetTarget(&shield->target, player->mo); S_StartSound(shield, sfx_s3k41); player->kartstuff[k_curshield] = 1; - } + } if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { K_DoThunderShield(player); From 62d16b877f8c35fe19d0664799c9f693c29af247 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 18 Oct 2018 18:13:00 +0100 Subject: [PATCH 22/22] A bunch of spectator-joining-round tweaks. * Re-enable the flashing-set thing on attempting to join with the item key. I spoke to Sal privately about this - turns out some keys ALWAYS send key presses instead of only sending one, and shift - what I have item bound to - is one of the problematic ones. * Make the no-joining-game-after-20-seconds thing happen 20 seconds after the TIMER has started, not the level (ie, take starttime into account) --- src/k_kart.c | 2 +- src/p_user.c | 2 +- src/st_stuff.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index fccb68674..36a0154a2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5339,7 +5339,7 @@ void K_CheckSpectateStatus(void) return; if (numingame < 2 || leveltime < starttime || mapreset) // Allow if the match hasn't started yet continue; - if (leveltime > 20*TICRATE) // DON'T allow if the match is 20 seconds in + if (leveltime > (starttime + 20*TICRATE)) // DON'T allow if the match is 20 seconds in return; if (G_RaceGametype() && players[i].laps) // DON'T allow if the race is at 2 laps return; diff --git a/src/p_user.c b/src/p_user.c index 472d7c27f..de5addf9f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9150,7 +9150,7 @@ void P_PlayerThink(player_t *player) if ((netgame || splitscreen) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing]) { player->pflags ^= PF_WANTSTOJOIN; - //player->powers[pw_flashing] = TICRATE + 1; + player->powers[pw_flashing] = TICRATE/2 + 1; /*if (P_SpectatorJoinGame(player)) return; // player->mo was removed.*/ } diff --git a/src/st_stuff.c b/src/st_stuff.c index 45e0deb58..01bb42f53 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1953,7 +1953,9 @@ static void ST_overlayDrawer(void) { // SRB2kart: changed positions & text V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -")); - if (stplyr->pflags & PF_WANTSTOJOIN) + if (stplyr->powers[pw_flashing]) + V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - . . .")); + else if (stplyr->pflags & PF_WANTSTOJOIN) V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Cancel Join")); /*else if (G_GametypeHasTeams()) V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/