From 592c4482a96e8f18dc87c8b5ce95266051951825 Mon Sep 17 00:00:00 2001 From: ZTsukei Date: Thu, 2 Mar 2017 17:59:35 -0500 Subject: [PATCH] Thwomps now squish the player - might need to reduce player height to 1 or something temporarily Mushrooms rewritten to not use Instathrust, instead they jack up your accel to 10x. Feels nicer. Floor mushroom panels no longer activate while above them Mushrooms force player to accelerate (and cannot brake) K_PlayTauntSound works now. (YES YES YES HUP HUP YES HUP HERE WE GO) Star and Mega sfx might stop correctly now in netgames (need to test) Item box radius and height increased from 32 to 36. --- src/doomdef.h | 10 +++---- src/g_game.c | 4 +-- src/info.c | 4 +-- src/k_kart.c | 80 +++++++++++++++++++++------------------------------ src/p_map.c | 3 +- src/p_spec.c | 25 ++++------------ src/sounds.c | 9 ++++++ src/sounds.h | 8 ++++++ 8 files changed, 66 insertions(+), 77 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 2f91afad..04250b03 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -143,16 +143,16 @@ extern FILE *logstream; #define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 #ifdef DEVELOP #define VERSION 102 // Game version -#define SUBVERSION 4 // more precise version number +#define SUBVERSION 5 // more precise version number #define VERSIONSTRING "Development EXE" -#define VERSIONSTRINGW "v1.2.04" +#define VERSIONSTRINGW "v1.2.05" // most interface strings are ignored in development mode. // we use comprevision and compbranch instead. #else #define VERSION 102 // Game version -#define SUBVERSION 4 // more precise version number -#define VERSIONSTRING "DevEXE v1.2.04" -#define VERSIONSTRINGW L"v1.2.04" +#define SUBVERSION 5 // more precise version number +#define VERSIONSTRING "DevEXE v1.2.05" +#define VERSIONSTRINGW L"v1.2.05" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif diff --git a/src/g_game.c b/src/g_game.c index 0adccb78..b94371aa 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1052,12 +1052,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) */ // forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward. - if (PLAYER1INPUTDOWN(gc_accelerate)) + if (PLAYER1INPUTDOWN(gc_accelerate) || player->kartstuff[k_mushroomtimer]) { cmd->buttons |= BT_ACCELERATE; forward = forwardmove[speed]; } - if (PLAYER1INPUTDOWN(gc_brake)) + if (PLAYER1INPUTDOWN(gc_brake) && !player->kartstuff[k_mushroomtimer]) { cmd->buttons |= BT_BRAKE; forward -= forwardmove[speed]; diff --git a/src/info.c b/src/info.c index 9f99d060..c859a628 100644 --- a/src/info.c +++ b/src/info.c @@ -14075,8 +14075,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_pop, // deathsound 60*FRACUNIT, // speed - 32*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // radius + 36*FRACUNIT, // height 0, // display offset 100, // mass 0, // damage diff --git a/src/k_kart.c b/src/k_kart.c index 64e4cd39..e6b4015b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1036,54 +1036,39 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) K_KartItemRoulette(player, cmd); // Roulette Code - // Looping and stopping of the horrible horrible star SFX ~Sryder - /* - if (player->mo->health > 0 && player->mo->player->kartstuff[k_startimer])// If you have invincibility + // Stopping of the horrible star SFX + if (player->mo->health <= 0 || player->mo->player->kartstuff[k_startimer] <= 0 + || player->mo->player->kartstuff[k_growshrinktimer] > 0) // If you don't have invincibility (or mega is active too) { - if (!P_IsLocalPlayer(player)) // If it isn't the current player - { - if (!S_SoundPlaying(NULL, sfx_star)) // and it isn't still playing - S_StartSound(player->mo, sfx_star); // play it again - } - } - else if (player->mo->health <= 0 || player->mo->player->kartstuff[k_startimer] <= 0 || player->mo->player->kartstuff[k_growshrinktimer] > 0) // If you don't have invincibility (or mega is active too) - { - if (S_SoundPlaying(player->mo, sfx_star)) // But the sound is playing - S_StopSoundByID(player->mo, sfx_star); // Stop it + if (S_SoundPlaying(player->mo, sfx_star)) // But the sound is playing + S_StopSoundByID(player->mo, sfx_star); // Stop it } - // And now the same for the mega mushroom SFX ~Sryder - if (player->mo->health > 0 && player->mo->player->kartstuff[k_growshrinktimer] > 0) // If you are big - { - if (!P_IsLocalPlayer(player)) // If it isn't the current player - { - if (!S_SoundPlaying(NULL, sfx_mega)) // and it isn't still playing - S_StartSound(player->mo, sfx_mega); // play it again - } - } - else // If you aren't big + // And the same for the mega mushroom SFX + if (!(player->mo->health > 0 && player->mo->player->kartstuff[k_growshrinktimer] > 0)) // If you aren't big { if (S_SoundPlaying(player->mo, sfx_mega)) // But the sound is playing S_StopSoundByID(player->mo, sfx_mega); // Stop it } - */ } void K_PlayTauntSound(mobj_t *source) { - return; // Doesn't work yet... - INT32 prandom; - - prandom = P_RandomFixed(); - - if (prandom <= 63) - S_StartSound(source, sfx_taunt1); - else if (prandom <= 127) - S_StartSound(source, sfx_taunt2); - else if (prandom <= 191) - S_StartSound(source, sfx_taunt3); - else - S_StartSound(source, sfx_taunt4); + switch (P_RandomFixed() % 4) + { + case 1: + S_StartSound(source, sfx_taunt1); + return; + case 2: + S_StartSound(source, sfx_taunt2); + return; + case 3: + S_StartSound(source, sfx_taunt3); + return; + case 4: + S_StartSound(source, sfx_taunt4); + return; + } } fixed_t K_GetKartBoostPower(player_t *player, boolean speedonly) @@ -1115,7 +1100,7 @@ fixed_t K_GetKartBoostPower(player_t *player, boolean speedonly) boostvalue += 10; // 10/8 speed (*1.250) numboosts++; } - if (player->kartstuff[k_startimer] && speedonly) + if (player->kartstuff[k_startimer]) { // Star boostvalue += 11; // 11/8 speed (*1.375) numboosts++; @@ -1126,9 +1111,15 @@ fixed_t K_GetKartBoostPower(player_t *player, boolean speedonly) boostvalue += 12; // 12/8 speed (*1.500) numboosts++; } - if (player->kartstuff[k_mushroomtimer] && speedonly) + if ((player->kartstuff[k_mushroomtimer] && speedonly) + || (player->kartstuff[k_mushroomtimer] > mushroomtime/4)) { // Mushroom - boostvalue += 12; // 12/8 speed (*1.500) + if (speedonly) + boostvalue += 12; // 12/8 speed (*1.500) + else if (player->kartstuff[k_driftboost]) + boostvalue += 68; + else + boostvalue += 80; numboosts++; } if (numboosts) // If any of the above apply... @@ -1784,7 +1775,7 @@ void K_DoLightning(player_t *player, boolean bluelightning) if (player->kartstuff[k_sounds]) // Prevents taunt sounds from playing every time the button is pressed return; - //K_PlayTauntSound(player->mo); + K_PlayTauntSound(player->mo); player->kartstuff[k_sounds] = 50; } @@ -2517,13 +2508,6 @@ void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground) if (((player->kartstuff[k_mushroomtimer] > 0 && player->kartstuff[k_boosting] == 0) || (player->kartstuff[k_mushroomtimer] > 0 && ATTACK_IS_DOWN && NO_BOO)) && onground) { - cmd->forwardmove = 1; - if (player->kartstuff[k_drift] >= 1) - P_InstaThrust(player->mo, player->mo->angle+ANGLE_45, 55*FRACUNIT); - else if (player->kartstuff[k_drift] <= -1) - P_InstaThrust(player->mo, player->mo->angle-ANGLE_45, 55*FRACUNIT); - else - P_InstaThrust(player->mo, player->mo->angle, 55*FRACUNIT); player->kartstuff[k_boosting] = 1; } else if (player->kartstuff[k_mushroomtimer] == 0 && player->kartstuff[k_boosting] == 1) diff --git a/src/p_map.c b/src/p_map.c index 1cb7eedc..e7722c14 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3925,7 +3925,8 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) killer = P_SpawnMobj(thing->x, thing->y, thing->z, MT_NULL); killer->threshold = 44; // Special flag for crushing } - P_DamageMobj(thing, killer, killer, 10000); + //P_DamageMobj(thing, killer, killer, 10000); + K_SquishPlayer(thing, killer); // SRB2kart - Squish instead of kill } } } diff --git a/src/p_spec.c b/src/p_spec.c index 00be73a2..749096fd 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3888,8 +3888,9 @@ DoneSection2: // P_SetPlayerMobjState(player->mo, S_PLAY_FALL1); break; - - case 6: // Super Sonic transformer // SRB2kart 190117- Replaced. This is now a Mushroom Boost Panel + case 6: // SRB2kart 190117 - Mushroom Boost Panel + if (!P_IsObjectOnGround(player->mo)) + break; if (!player->kartstuff[k_floorboost]) player->kartstuff[k_floorboost] = 3; else @@ -3897,27 +3898,13 @@ DoneSection2: K_DoMushroom(player, false); break; - /* if (player->mo->health > 0 && !player->bot && (player->charflags & SF_SUPER) && !player->powers[pw_super] && ALL7EMERALDS(emeralds)) - P_DoSuperTransformation(player, true); - break; */ - - case 7: // Make player spin // SRB2kart 190117- Replaced. This is now an Oil Slick (Oddly ironic considering) + case 7: // SRB2kart 190117 - Oil Slick + if (!P_IsObjectOnGround(player->mo)) + break; player->kartstuff[k_spinouttype] = -1; K_SpinPlayer(player, NULL); break; - /* if (!(player->pflags & PF_SPINNING) && P_IsObjectOnGround(player->mo) && (player->charability2 == CA2_SPINDASH)) - { - player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); - S_StartAttackSound(player->mo, sfx_spin); - - if (abs(player->rmomx) < FixedMul(5*FRACUNIT, player->mo->scale) - && abs(player->rmomy) < FixedMul(5*FRACUNIT, player->mo->scale)) - P_InstaThrust(player->mo, player->mo->angle, FixedMul(10*FRACUNIT, player->mo->scale)); - } - break; */ - case 8: // Zoom Tube Start { INT32 sequence; diff --git a/src/sounds.c b/src/sounds.c index 838acfc3..5d32d1c3 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -497,6 +497,15 @@ sfxinfo_t S_sfx[NUMSFX] = {"mkitm7", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mkitm8", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mkitmF", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + + // SRB2kart - Skin sounds + {"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR}, + {"klose", false, 64, 0, -1, NULL, 0, SKSLOSE, -1, LUMPERROR}, + {"slow", false, 128, 0, -1, NULL, 0, SKSSLOW, -1, LUMPERROR}, + {"taunt1", false, 64, 64, -1, NULL, 0, SKSPLTNT1, -1, LUMPERROR}, + {"taunt2", false, 64, 64, -1, NULL, 0, SKSPLTNT2, -1, LUMPERROR}, + {"taunt3", false, 64, 64, -1, NULL, 0, SKSPLTNT3, -1, LUMPERROR}, + {"taunt4", false, 64, 64, -1, NULL, 0, SKSPLTNT4, -1, LUMPERROR}, // skin sounds free slots to add sounds at run time (Boris HACK!!!) // initialized to NULL diff --git a/src/sounds.h b/src/sounds.h index 3ba30bce..03888a2a 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -38,6 +38,14 @@ typedef enum SKSSKID, SKSGASP, SKSJUMP, + // SRB2kart + SKSWIN, + SKSLOSE, + SKSSLOW, + SKSPLTNT1, + SKSPLTNT2, + SKSPLTNT3, + SKSPLTNT4, NUMSKINSOUNDS } skinsound_t;