diff --git a/src/d_player.h b/src/d_player.h index abd7d166..959b4ed3 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -32,12 +32,7 @@ // Extra abilities/settings for skins (combinable stuff) typedef enum { - SF_SUPER = 1, // Can turn super in singleplayer/co-op mode. - SF_SUPERANIMS = 1<<1, // If super, use the super sonic animations - SF_SUPERSPIN = 1<<2, // Should spin frames be played while super? - SF_HIRES = 1<<3, // Draw the sprite 2x as small? - SF_NOSKID = 1<<4, // No skid particles etc - SF_NOSPEEDADJUST = 1<<5, // Skin-specific version of disablespeedadjust + SF_HIRES = 1, // Draw the sprite 2x as small? } skinflags_t; //Primary and secondary skin abilities diff --git a/src/dehacked.c b/src/dehacked.c index 34cd86b6..64a6242f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8608,12 +8608,7 @@ struct { {"RW_RAIL",RW_RAIL}, // Character flags (skinflags_t) - {"SF_SUPER",SF_SUPER}, - {"SF_SUPERANIMS",SF_SUPERANIMS}, - {"SF_SUPERSPIN",SF_SUPERSPIN}, {"SF_HIRES",SF_HIRES}, - {"SF_NOSKID",SF_NOSKID}, - {"SF_NOSPEEDADJUST",SF_NOSPEEDADJUST}, // Character abilities! // Primary diff --git a/src/p_inter.c b/src/p_inter.c index dd27858f..35be83ad 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2952,66 +2952,6 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) } } -/* -static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) // SRB2kart - unused. -{ - fixed_t fallbackspeed; - angle_t ang; - - P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - - if (player->mo->eflags & MFE_VERTICALFLIP) - player->mo->z--; - else - player->mo->z++; - - if (player->mo->eflags & MFE_UNDERWATER) - P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); - else - P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); - - ang = R_PointToAngle2(inflictor->x, inflictor->y, player->mo->x, player->mo->y); - - // explosion and rail rings send you farther back, making it more difficult - // to recover - if (inflictor->flags2 & MF2_SCATTER && source) - { - fixed_t dist = P_AproxDistance(P_AproxDistance(source->x-player->mo->x, source->y-player->mo->y), source->z-player->mo->z); - - dist = FixedMul(128*FRACUNIT, inflictor->scale) - dist/4; - - if (dist < FixedMul(4*FRACUNIT, inflictor->scale)) - dist = FixedMul(4*FRACUNIT, inflictor->scale); - - fallbackspeed = dist; - } - else if (inflictor->flags2 & MF2_EXPLOSION) - { - if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(28*FRACUNIT, inflictor->scale); // 7x - else - fallbackspeed = FixedMul(20*FRACUNIT, inflictor->scale); // 5x - } - else if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(16*FRACUNIT, inflictor->scale); // 4x - else - fallbackspeed = FixedMul(4*FRACUNIT, inflictor->scale); // the usual amount of force - - P_InstaThrust(player->mo, ang, fallbackspeed); - - // SRB2kart - This shouldn't be reachable, but this frame is invalid. - //if (player->charflags & SF_SUPERANIMS) - // P_SetPlayerMobjState(player->mo, S_PLAY_SUPERHIT); - //else - P_SetPlayerMobjState(player->mo, player->mo->info->painstate); - - P_ResetPlayer(player); - - if (player->timeshit != UINT8_MAX) - ++player->timeshit; -} -*/ - void P_RemoveShield(player_t *player) { if (player->powers[pw_shield] & SH_FORCE) diff --git a/src/p_mobj.c b/src/p_mobj.c index c070560f..0130924c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -167,58 +167,8 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) I_Error("P_SetPlayerMobjState used for non-player mobj. Use P_SetMobjState instead!\n(Mobj type: %d, State: %d)", mobj->type, state); #endif - // Catch state changes for Super Sonic - /* // SRB2kart - don't need - if (player->powers[pw_super] && (player->charflags & SF_SUPERANIMS)) - { - switch (state) - { - case S_PLAY_STND: - case S_PLAY_TAP1: - case S_PLAY_TAP2: - case S_PLAY_GASP: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERSTAND); - return true; - case S_PLAY_FALL1: - case S_PLAY_SPRING: - case S_PLAY_RUN1: - case S_PLAY_RUN2: - case S_PLAY_RUN3: - case S_PLAY_RUN4: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERWALK1); - return true; - case S_PLAY_FALL2: - case S_PLAY_RUN5: - case S_PLAY_RUN6: - case S_PLAY_RUN7: - case S_PLAY_RUN8: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERWALK2); - return true; - case S_PLAY_SPD1: - case S_PLAY_SPD2: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERFLY1); - return true; - case S_PLAY_SPD3: - case S_PLAY_SPD4: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERFLY2); - return true; - case S_PLAY_TEETER1: - case S_PLAY_TEETER2: - P_SetPlayerMobjState(mobj, S_PLAY_SUPERTEETER); - return true; - case S_PLAY_ATK1: - case S_PLAY_ATK2: - case S_PLAY_ATK3: - case S_PLAY_ATK4: - if (!(player->charflags & SF_SUPERSPIN)) - return true; - break; - default: - break; - } - } // You were in pain state after taking a hit, and you're moving out of pain state now? - else */if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing(player) && state != mobj->info->painstate) + if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing(player) && state != mobj->info->painstate) { // Start flashing, since you've landed. player->powers[pw_flashing] = K_GetKartFlashing(player)-1; @@ -260,51 +210,6 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) st = &states[state]; mobj->state = st; mobj->tics = st->tics; - - // Adjust the player's animation speed to match their velocity. - if (!(disableSpeedAdjust || player->charflags & SF_NOSPEEDADJUST)) - { - fixed_t speed = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor)); // fixed_t speed = FixedDiv(player->speed, mobj->scale); - if (player->panim == PA_ROLL) - { - if (speed > 16<tics = 1; - else - mobj->tics = 2; - } - else if (player->panim == PA_FALL) - { - speed = FixedDiv(abs(mobj->momz), mobj->scale); - if (speed < 10<tics = 4; - else if (speed < 20<tics = 3; - else if (speed < 30<tics = 2; - else - mobj->tics = 1; - } - else if (P_IsObjectOnGround(mobj) || player->powers[pw_super]) // Only if on the ground or superflying. - { - if (player->panim == PA_WALK) - { - if (speed > 12<tics = 2; - else if (speed > 6<tics = 3; - else - mobj->tics = 4; - } - else if (player->panim == PA_RUN) - { - if (speed > 52<tics = 1; - else - mobj->tics = 2; - } - } - } - mobj->sprite = st->sprite; mobj->frame = st->frame; mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set diff --git a/src/p_user.c b/src/p_user.c index 7350b921..9dd7dc61 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3634,165 +3634,6 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) // SRB2kart - unused. } */ -#if 0 -// -// P_DoSuperStuff() -// -// Handle related superform functionality. -// -static void P_DoSuperStuff(player_t *player) -{ - mobj_t *spark; - ticcmd_t *cmd = &player->cmd; - //if (player->mo->state >= &states[S_PLAY_SUPERTRANS1] && player->mo->state <= &states[S_PLAY_SUPERTRANS9]) - // return; // don't do anything right now, we're in the middle of transforming! - - if (player->pflags & PF_NIGHTSMODE) - return; // NiGHTS Super doesn't mix with normal super - - // Does player have all emeralds? If so, flag the "Ready For Super!" - /*if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->health > 50) - player->pflags |= PF_SUPERREADY; - else - player->pflags &= ~PF_SUPERREADY;*/ - - if (player->powers[pw_super]) - { - // If you're super and not Sonic, de-superize! - if (!((ALL7EMERALDS(emeralds)) && (player->charflags & SF_SUPER)) && !(ALL7EMERALDS(player->powers[pw_emeralds]))) - { - player->powers[pw_super] = 0; - P_SetPlayerMobjState(player->mo, S_KART_STND1); - P_RestoreMusic(player); - P_SpawnShieldOrb(player); - - // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - else - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - if (gametype != GT_COOP) - { - HU_SetCEchoFlags(0); - HU_SetCEchoDuration(5); - HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players])); - } - return; - } - - // Deplete one ring every second while super - if ((leveltime % TICRATE == 0) && !(player->exiting)) - { - player->health--; - player->mo->health--; - } - - // future todo: a skin option for this, and possibly more colors - switch (player->skin) - { - case 1: /* Tails */ player->mo->color = SKINCOLOR_TSUPER1; break; - case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; - default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; - } - player->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); - - if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) - && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) - { - spark = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SUPERSPARK); - spark->destscale = player->mo->scale; - P_SetScale(spark, player->mo->scale); - } - - G_GhostAddColor(GHC_SUPER); - - // Ran out of rings while super! - if (player->health <= 1 || player->exiting) - { - player->powers[pw_emeralds] = 0; // lost the power stones - P_SpawnGhostMobj(player->mo); - - player->powers[pw_super] = 0; - - // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - else - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - if (gametype != GT_COOP) - player->powers[pw_flashing] = K_GetKartFlashing(player)-1; - -/* - if (player->mo->health > 0) - { - if ((player->pflags & PF_JUMPED) || (player->pflags & PF_SPINNING)) - P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); - else if (player->panim == PA_RUN) - P_SetPlayerMobjState(player->mo, S_PLAY_SPD1); - else if (player->panim == PA_WALK) - P_SetPlayerMobjState(player->mo, S_PLAY_RUN1); - else - P_SetPlayerMobjState(player->mo, S_PLAY_STND); - - if (!player->exiting) - { - player->health = 1; - player->mo->health = 1; - } - } -*/ - - // Inform the netgame that the champion has fallen in the heat of battle. - if (gametype != GT_COOP) - { - S_StartSound(NULL, sfx_s3k66); //let all players hear it. - HU_SetCEchoFlags(0); - HU_SetCEchoDuration(5); - HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[player-players])); - } - - // Resume normal music if you're the console player - P_RestoreMusic(player); - - // If you had a shield, restore its visual significance. - P_SpawnShieldOrb(player); - } - } -} -#endif - -// -// P_SuperReady -// -// Returns true if player is ready to turn super, duh -// -/*boolean P_SuperReady(player_t *player) -{ - if ((player->pflags & PF_SUPERREADY) && !player->powers[pw_super] && !player->powers[pw_tailsfly] - && !(player->powers[pw_shield] & SH_NOSTACK) - && !player->powers[pw_invulnerability] - && !(maptol & TOL_NIGHTS) // don't turn 'regular super' in nights levels - && player->pflags & PF_JUMPED - && ((player->charflags & SF_SUPER) || ALL7EMERALDS(player->powers[pw_emeralds]))) - return true; - - return false; -}*/ - // // P_DoJump // @@ -6382,99 +6223,6 @@ void P_ElementalFireTrail(player_t *player) } } -/*static void P_SkidStuff(player_t *player) -{ - fixed_t pmx = player->rmomx + player->cmomx; - fixed_t pmy = player->rmomy + player->cmomy; - - // Knuckles glides into the dirt. - // SRB2kart - don't need - if (player->pflags & PF_GLIDING && player->skidtime) - { - // Fell off a ledge... - if (!onground) - { - player->skidtime = 0; - player->pflags &= ~(PF_GLIDING|PF_JUMPED); - P_SetPlayerMobjState(player->mo, S_PLAY_FALL1); - } - // Get up and brush yourself off, idiot. - else if (player->glidetime > 15) - { - P_ResetPlayer(player); - P_SetPlayerMobjState(player->mo, S_PLAY_STND); - player->mo->momx = player->cmomx; - player->mo->momy = player->cmomy; - } - // Didn't stop yet? Skid FOREVER! - else if (player->skidtime == 1) - player->skidtime = 3*TICRATE+1; - // Spawn a particle every 3 tics. - else if (!(player->skidtime % 3)) - { - mobj_t *particle = P_SpawnMobj(player->mo->x + P_RandomRange(-player->mo->radius, player->mo->radius), player->mo->y + P_RandomRange(-player->mo->radius, player->mo->radius), - player->mo->z + (player->mo->eflags & MFE_VERTICALFLIP ? player->mo->height - mobjinfo[MT_PARTICLE].height : 0), - MT_PARTICLE); - particle->tics = 10; - - particle->eflags |= player->mo->eflags & MFE_VERTICALFLIP; - P_SetScale(particle, player->mo->scale >> 2); - particle->destscale = player->mo->scale << 2; - particle->scalespeed = FixedMul(particle->scalespeed, player->mo->scale); // scale the scaling speed! - P_SetObjectMomZ(particle, FRACUNIT, false); - S_StartSound(player->mo, sfx_s3k7e); // the proper "Knuckles eats dirt" sfx. - } - } - // Skidding! - elseif (onground && !(player->mo->eflags & MFE_GOOWATER) && !(player->pflags & (PF_JUMPED|PF_SPINNING|PF_SLIDING)) && !(player->charflags & SF_NOSKID)) - { - if (player->skidtime) - { - // Spawn a particle every 3 tics. - if (!(player->skidtime % 3)) - { - mobj_t *particle = P_SpawnMobj(player->mo->x, player->mo->y, - player->mo->z + (player->mo->eflags & MFE_VERTICALFLIP ? player->mo->height - mobjinfo[MT_PARTICLE].height : 0), - MT_PARTICLE); - particle->tics = 10; - - particle->eflags |= player->mo->eflags & MFE_VERTICALFLIP; - P_SetScale(particle, player->mo->scale >> 2); - particle->destscale = player->mo->scale << 2; - particle->scalespeed = FixedMul(particle->scalespeed, player->mo->scale); // scale the scaling speed! - P_SetObjectMomZ(particle, FRACUNIT, false); - } - } - else if (P_AproxDistance(pmx, pmy) >= FixedMul(player->runspeed/2, player->mo->scale) // if you were moving faster than half your run speed last frame - && (player->mo->momx != pmx || player->mo->momy != pmy) // and you are moving differently this frame - && P_GetPlayerControlDirection(player) == 2) // and your controls are pointing in the opposite direction to your movement - { // check for skidding - angle_t mang = R_PointToAngle2(0,0,pmx,pmy); // movement angle - angle_t pang = R_PointToAngle2(pmx,pmy,player->mo->momx,player->mo->momy); // push angle - angle_t dang = mang - pang; // delta angle - - if (dang > ANGLE_180) // Make delta angle always positive, invert it if it's negative. - dang = InvAngle(dang); - - // If your push angle is more than this close to a full 180 degrees, trigger a skid. - if (dang > ANGLE_157h) - { - player->skidtime = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; //player->skidtime = TICRATE/2; - S_StartSound(player->mo, sfx_skid); - if (player->panim != PA_WALK) - P_SetPlayerMobjState(player->mo, S_KART_WALK2); // SRB2kart - was S_PLAY_RUN4 - player->mo->tics = player->skidtime; - } - } - } - else { - if (player->skidtime) { - player->skidtime = 0; - S_StopSound(player->mo); - } - } -}*/ - // // P_MovePlayer static void P_MovePlayer(player_t *player) diff --git a/src/r_things.c b/src/r_things.c index 82264394..a40830ac 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2570,7 +2570,7 @@ void R_InitSkins(void) #ifdef SKINVALUES skin_cons_t[0].strvalue = skins[0].name; #endif - skin->flags = SF_SUPER|SF_SUPERANIMS|SF_SUPERSPIN; + skin->flags = 0; strcpy(skin->realname, "Sonic"); strcpy(skin->hudname, "SONIC");