diff --git a/src/deh_tables.c b/src/deh_tables.c index a6a7c35cb..7023fb9a2 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4650,6 +4650,12 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_DEBTSPIKEC", "S_DEBTSPIKED", "S_DEBTSPIKEE", + + // Sparks when driving on stairs + "S_JANKSPARK1", + "S_JANKSPARK2", + "S_JANKSPARK3", + "S_JANKSPARK4", }; // RegEx to generate this from info.h: ^\tMT_([^,]+), --> \t"MT_\1", @@ -5451,6 +5457,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_DRIFTSPARK", "MT_BRAKEDRIFT", "MT_DRIFTDUST", + "MT_JANKSPARK", "MT_ROCKETSNEAKER", // Rocket sneakers diff --git a/src/info.c b/src/info.c index 51cce3e7d..7273f58d1 100644 --- a/src/info.c +++ b/src/info.c @@ -541,6 +541,7 @@ char sprnames[NUMSPRITES + 1][5] = "DRIF", // Drift Sparks "BDRF", // Brake drift sparks "DRWS", // Drift dust sparks + "JANK", // Stair janking sparks // Kart Items "RSHE", // Rocket sneaker @@ -5227,6 +5228,12 @@ state_t states[NUMSTATES] = {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKED}, // S_DEBTSPIKEC {SPR_DEBT, 6|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKEE}, // S_DEBTSPIKED {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE1}, // S_DEBTSPIKEE + + // Sparks when driving on stairs + {SPR_JANK, 0, 1, {NULL}, 0, 0, S_JANKSPARK2}, // S_JANKSPARK1 + {SPR_JANK, FF_PAPERSPRITE|FF_FULLBRIGHT|FF_ANIMATE, 4, {NULL}, 3, 1, S_JANKSPARK3}, // S_JANKSPARK2 + {SPR_JANK, 0, 0, {A_SetCustomValue}, -1, 5, S_JANKSPARK4}, // S_JANKSPARK3 + {SPR_JANK, 0, 0, {A_ChangeAngleRelative}, 180, 180, S_JANKSPARK2}, // S_JANKSPARK4 }; mobjinfo_t mobjinfo[NUMMOBJTYPES] = @@ -23473,6 +23480,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_JANKSPARK + -1, // doomednum + S_JANKSPARK1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 8, // speed + 8*FRACUNIT, // radius + 8*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_FLOAT|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_ROCKETSNEAKER -1, // doomednum S_ROCKETSNEAKER_L, // spawnstate diff --git a/src/info.h b/src/info.h index 527dc5a05..58d1dfd76 100644 --- a/src/info.h +++ b/src/info.h @@ -1093,6 +1093,7 @@ typedef enum sprite SPR_DRIF, // Drift Sparks SPR_BDRF, // Brake drift sparks SPR_DRWS, // Drift dust sparks + SPR_JANK, // Stair janking sparks // Kart Items SPR_RSHE, // Rocket sneaker @@ -5642,6 +5643,11 @@ typedef enum state S_DEBTSPIKED, S_DEBTSPIKEE, + S_JANKSPARK1, + S_JANKSPARK2, + S_JANKSPARK3, + S_JANKSPARK4, + S_FIRSTFREESLOT, S_LASTFREESLOT = S_FIRSTFREESLOT + NUMSTATEFREESLOTS - 1, NUMSTATES @@ -6462,6 +6468,7 @@ typedef enum mobj_type MT_DRIFTSPARK, MT_BRAKEDRIFT, MT_DRIFTDUST, + MT_JANKSPARK, MT_ROCKETSNEAKER, diff --git a/src/k_kart.c b/src/k_kart.c index 99cab4ea7..d8503e1a9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7679,6 +7679,11 @@ SINT8 K_Sliptiding(player_t *player) return p[k_drift] ? 0 : p[k_aizdriftstrat]; } +INT32 K_StairJankFlip(INT32 value) +{ + return P_AltFlip(value, 2); +} + static void K_KartSpindashDust(mobj_t *parent) { fixed_t rad = FixedDiv(FixedHypot(parent->radius, parent->radius), parent->scale); diff --git a/src/k_kart.h b/src/k_kart.h index 09665d8ab..a5ebb9534 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -85,6 +85,7 @@ boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); void K_UpdateSteeringValue(player_t *player, INT16 destSteering); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); INT32 K_GetKartDriftSparkValue(player_t *player); +INT32 K_StairJankFlip(INT32 value); void K_SpawnDriftBoostExplosion(player_t *player, int stage); void K_KartUpdatePosition(player_t *player); mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT8 amount); diff --git a/src/p_enemy.c b/src/p_enemy.c index 8ef33a38e..5e6952469 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -14819,4 +14819,4 @@ void A_InvincSparkleRotate(mobj_t *actor) actor->momz = actor->target->momz; // Give momentum for eventual interp builds idk. actor->angle += ANG1*10*(actor->extravalue2); // Arbitrary value, change this if you want, I suppose. -} \ No newline at end of file +} diff --git a/src/p_map.c b/src/p_map.c index f9eac42b8..ef4f6f1cf 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2638,9 +2638,19 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) if (stairjank > stairstep && thing->player) { /* use a shorter sound if not two tics have passed - * since the last step */ + * since the last step */ S_StartSound(thing, thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268); + + if (!thing->player->stairjank) + { + mobj_t * spark = P_SpawnMobjFromMobj(thing, + 0, 0, 0, MT_JANKSPARK); + spark->fuse = 9; + spark->cusval = K_StairJankFlip(ANGLE_90); + P_SetTarget(&spark->target, thing); + } + thing->player->stairjank = 17; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 49165162d..c90b84fec 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6887,6 +6887,21 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->renderflags |= RF_DONTDRAW; } break; + case MT_JANKSPARK: + if (!mobj->target) + { + P_RemoveMobj(mobj); + return false; + } + if (mobj->fuse == 1 && mobj->target->player && + mobj->target->player->stairjank >= 8) + { + mobj->fuse = 9; + } + P_TeleportMove(mobj, mobj->target->x, + mobj->target->y, mobj->target->z); + mobj->angle = mobj->target->angle + mobj->cusval; + break; case MT_PLAYERRETICULE: if (!mobj->target || !mobj->target->health) { diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c index f6ae0655f..447eb6925 100644 --- a/src/r_patchrotation.c +++ b/src/r_patchrotation.c @@ -53,8 +53,8 @@ static angle_t R_PlayerSpriteRotation(player_t *player) if (player->stairjank) { - rollAngle += P_AltFlip(ANGLE_11hh / 2 / - (17 / player->stairjank), 2); + rollAngle += K_StairJankFlip(ANGLE_11hh / 2 / + (17 / player->stairjank)); } return rollAngle;