From 842430dbdbf8cb64e9e35aecf9e0c90e9c7c8b78 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 7 Oct 2018 18:53:46 -0400 Subject: [PATCH 1/6] 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 67071d88..6166c8f8 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 c0fb24fb..496aa0cc 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 d0f4be59..5b52a6c2 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 b37c8f49..d07e2f3e 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 7cab42a5..6b240df1 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 2d287d0f..2aef9d5d 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 5ca9a104..565802b2 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 d400f013..d0bbc4b5 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 ab47fec3..57b4dd43 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 a6a229dea823aa51a52b5152cb00a5297bb8a380 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 8 Oct 2018 16:20:30 -0400 Subject: [PATCH 2/6] 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 d07e2f3e..5180b9cc 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 8379bd3d3182d36740f42d904464721bde2f3eea Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 10 Oct 2018 14:56:50 -0400 Subject: [PATCH 3/6] 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 f01f874c..0d42ae77 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 7ef8dc71..fafd09d7 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 687d8714..f14d2121 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 172c7d75..5c7d22ee 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 da68d40760e3a41e375d4f9286976577750cbda5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 10 Oct 2018 17:31:09 -0400 Subject: [PATCH 4/6] 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 fafd09d7..19c90c7b 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 5c7d22ee..2f238ce6 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 005bb7a5e0f0690bf627517f5e194abbad293b98 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 10 Oct 2018 17:46:23 -0400 Subject: [PATCH 5/6] 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 2f238ce6..1414c238 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 b01643e0436f7187042639fce646682e64aab33c Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 13 Oct 2018 23:38:16 +0100 Subject: [PATCH 6/6] 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 1414c238..fcf99f80 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);