diff --git a/src/d_player.h b/src/d_player.h index c6162a5bb..d02a39476 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -303,7 +303,7 @@ typedef enum // Item held stuff k_itemtype, // KITEM_ constant for item number k_itemamount, // Amount of said item - k_itemheld, // Are you holding an item? 1 = normal hold, 2 = rotation hold + k_itemheld, // Are you holding an item? // Some items use timers for their duration or effects k_attractiontimer, // Duration of Lightning Shield's item-break and item box pull diff --git a/src/dehacked.c b/src/dehacked.c index 515225dc4..1078da51a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6325,8 +6325,24 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DEADGREEN", //} //{ Jawz - "S_JAWZ", - "S_JAWZ_SHIELD", + "S_JAWZ1", + "S_JAWZ2", + "S_JAWZ3", + "S_JAWZ4", + "S_JAWZ5", + "S_JAWZ6", + "S_JAWZ_DUD1", + "S_JAWZ_DUD2", + "S_JAWZ_DUD3", + "S_JAWZ_DUD4", + "S_JAWZ_DUD5", + "S_JAWZ_DUD6", + "S_JAWZ_SHIELD1", + "S_JAWZ_SHIELD2", + "S_JAWZ_SHIELD3", + "S_JAWZ_SHIELD4", + "S_JAWZ_SHIELD5", + "S_JAWZ_SHIELD6", "S_JAWZ_DEAD", //} @@ -6583,7 +6599,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAYERBOMB", // Player bomb overlay "S_PLAYERITEM", // Player item overlay - "S_PLAYERBOMB_WHEEL", + + "S_KARMAWHEEL", // Karma player wheels #ifdef SEENAMES "S_NAMECHECK", @@ -7212,7 +7229,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FIREDITEM", "MT_PLAYERARROW", + "MT_KARMAHITBOX", + "MT_KARMAWHEEL", #ifdef SEENAMES "MT_NAMECHECK", diff --git a/src/info.c b/src/info.c index 834dcf0a1..89ad9b4ca 100644 --- a/src/info.c +++ b/src/info.c @@ -2638,27 +2638,43 @@ state_t states[NUMSTATES] = {SPR_BANA, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BANANA {SPR_BANA, 1, 175, {NULL}, 0, 0, S_NULL}, // S_BANANA_DEAD - {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENSHIELD2}, // S_GREENSHIELD1 - {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENSHIELD3}, // S_GREENSHIELD2 - {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENSHIELD4}, // S_GREENSHIELD3 - {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENSHIELD5}, // S_GREENSHIELD4 - {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENSHIELD6}, // S_GREENSHIELD5 - {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENSHIELD7}, // S_GREENSHIELD6 - {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENSHIELD8}, // S_GREENSHIELD7 - {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENSHIELD1}, // S_GREENSHIELD8 - {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENITEM2}, // S_GREENITEM1 - {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENITEM3}, // S_GREENITEM2 - {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENITEM4}, // S_GREENITEM3 - {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENITEM5}, // S_GREENITEM4 - {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENITEM6}, // S_GREENITEM5 - {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENITEM7}, // S_GREENITEM6 - {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENITEM8}, // S_GREENITEM7 - {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENITEM1}, // S_GREENITEM8 - {SPR_GSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADGREEN + {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENSHIELD2}, // S_GREENSHIELD1 + {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENSHIELD3}, // S_GREENSHIELD2 + {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENSHIELD4}, // S_GREENSHIELD3 + {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENSHIELD5}, // S_GREENSHIELD4 + {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENSHIELD6}, // S_GREENSHIELD5 + {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENSHIELD7}, // S_GREENSHIELD6 + {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENSHIELD8}, // S_GREENSHIELD7 + {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENSHIELD1}, // S_GREENSHIELD8 + {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENITEM2}, // S_GREENITEM1 + {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENITEM3}, // S_GREENITEM2 + {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENITEM4}, // S_GREENITEM3 + {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENITEM5}, // S_GREENITEM4 + {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENITEM6}, // S_GREENITEM5 + {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENITEM7}, // S_GREENITEM6 + {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENITEM8}, // S_GREENITEM7 + {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENITEM1}, // S_GREENITEM8 + {SPR_GSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADGREEN - {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ}, // S_JAWZ - {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_SHIELD}, // S_JAWZ_SHIELD - {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD + {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ2}, // S_JAWZ1 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ3}, // S_JAWZ2 + {SPR_JAWZ, 1, 1, {A_JawzChase}, 0, 0, S_JAWZ4}, // S_JAWZ3 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ5}, // S_JAWZ4 + {SPR_JAWZ, 2, 1, {A_JawzChase}, 0, 0, S_JAWZ6}, // S_JAWZ5 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ1}, // S_JAWZ6 + {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_DUD2}, // S_JAWZ_DUD1 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD3}, // S_JAWZ_DUD2 + {SPR_JAWZ, 1, 1, {NULL}, 0, 0, S_JAWZ_DUD4}, // S_JAWZ_DUD3 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD5}, // S_JAWZ_DUD4 + {SPR_JAWZ, 2, 1, {NULL}, 0, 0, S_JAWZ_DUD6}, // S_JAWZ_DUD5 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD1}, // S_JAWZ_DUD6 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD2}, // S_JAWZ_SHIELD1 + {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD3}, // S_JAWZ_SHIELD2 + {SPR_JAWZ, 5, 1, {NULL}, 0, 0, S_JAWZ_SHIELD4}, // S_JAWZ_SHIELD3 + {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD5}, // S_JAWZ_SHIELD4 + {SPR_JAWZ, 6, 1, {NULL}, 0, 0, S_JAWZ_SHIELD6}, // S_JAWZ_SHIELD5 + {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD1}, // S_JAWZ_SHIELD6 + {SPR_JAWZ, 8, 175, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD {SPR_FBLL, 13, 3, {NULL}, 0, 0, S_FIRETRAIL2}, // S_FIRETRAIL1 {SPR_FBLL, 14, 3, {NULL}, 0, 0, S_FIRETRAIL3}, // S_FIRETRAIL2 @@ -2899,7 +2915,8 @@ state_t states[NUMSTATES] = {SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM - {SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERWHEEL + + {SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK @@ -14483,7 +14500,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_BANANA -1, // doomednum - S_BANANA, // spawnstate + S_BANANA, // spawnstate 2, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14494,7 +14511,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BANANA_DEAD, // deathstate + S_BANANA_DEAD, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed @@ -14618,7 +14635,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_JAWZ -1, // doomednum - S_JAWZ, // spawnstate + S_JAWZ1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14645,7 +14662,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_JAWZ_DUD -1, // doomednum - S_JAWZ, // spawnstate + S_JAWZ_DUD1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14672,7 +14689,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_JAWZ_SHIELD -1, // doomednum - S_JAWZ_SHIELD, // spawnstate + S_JAWZ_SHIELD1, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -16587,6 +16604,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_KARMAWHEEL + -1, // doomednum + S_KARMAWHEEL, // 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 + 0, // speed + 8*FRACUNIT, // radius + 16*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOTHINK|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + S_NULL // raisestate + }, + // ============================================================================================================================// #ifdef SEENAMES diff --git a/src/info.h b/src/info.h index cea05a6e8..3a02f63cf 100644 --- a/src/info.h +++ b/src/info.h @@ -3167,8 +3167,24 @@ typedef enum state S_DEADGREEN, //} //{ Jawz - S_JAWZ, - S_JAWZ_SHIELD, + S_JAWZ1, + S_JAWZ2, + S_JAWZ3, + S_JAWZ4, + S_JAWZ5, + S_JAWZ6, + S_JAWZ_DUD1, + S_JAWZ_DUD2, + S_JAWZ_DUD3, + S_JAWZ_DUD4, + S_JAWZ_DUD5, + S_JAWZ_DUD6, + S_JAWZ_SHIELD1, + S_JAWZ_SHIELD2, + S_JAWZ_SHIELD3, + S_JAWZ_SHIELD4, + S_JAWZ_SHIELD5, + S_JAWZ_SHIELD6, S_JAWZ_DEAD, //} @@ -3425,7 +3441,8 @@ typedef enum state S_PLAYERBOMB, S_PLAYERITEM, - S_PLAYERWHEEL, + + S_KARMAWHEEL, #ifdef SEENAMES S_NAMECHECK, @@ -4071,7 +4088,9 @@ typedef enum mobj_type MT_FIREDITEM, MT_PLAYERARROW, + MT_KARMAHITBOX, + MT_KARMAWHEEL, #ifdef SEENAMES MT_NAMECHECK, diff --git a/src/k_kart.c b/src/k_kart.c index 4986e743c..b5486c77b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2079,7 +2079,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map dir = defaultDir; } - if (missile) + if (missile) // Shootables { if (mapthing == MT_FIREBALL) // Messy { @@ -2102,7 +2102,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + 0x06000000, 0, PROJSPEED); } } - else // Shells + else { if (dir == -1) { @@ -2986,14 +2986,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player && player->mo && player->mo->health > 0 && !player->spectator && !player->exiting && player->kartstuff[k_spinouttimer] == 0) { - // Eggman Monitor dropping - if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_eggmanheld]) + // First, the really specific, finicky items that function without the item being directly in your item slot. + // Eggman Monitor throwing + if (ATTACK_IS_DOWN && player->kartstuff[k_eggmanheld]) { K_ThrowKartItem(player, false, MT_FAKEITEM, -1, false); K_PlayTauntSound(player->mo); player->kartstuff[k_eggmanheld] = 0; } - // Rocket Sneaker power + // Rocket Sneaker else if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO && player->kartstuff[k_rocketsneakertimer] > 1) { @@ -3052,13 +3053,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mobj_t *mo; mobj_t *prev = NULL; - if (player->kartstuff[k_itemamount] > 1) - { - K_PlayTauntSound(player->mo); - player->kartstuff[k_itemheld] = 2; - } - else - player->kartstuff[k_itemheld] = 1; + //K_PlayTauntSound(player->mo); + player->kartstuff[k_itemheld] = 1; player->pflags |= PF_ATTACKDOWN; for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) @@ -3082,14 +3078,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) prev = mo; } } - else if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemheld] == 1) - { - K_ThrowKartItem(player, false, MT_BANANA, -1, false); - K_PlayTauntSound(player->mo); - player->kartstuff[k_itemamount]--; - player->kartstuff[k_itemheld] = 0; - } - else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld] == 2) // Banana x3 thrown + else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Banana x3 thrown { K_ThrowKartItem(player, false, MT_BANANA, -1, false); K_PlayTauntSound(player->mo); @@ -3126,61 +3115,34 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_ORBINAUT: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - /*if (player->kartstuff[k_itemamount] == 1) // Orbinaut x1 held + INT32 moloop; + + player->kartstuff[k_itemheld] = 1; + player->pflags |= PF_ATTACKDOWN; + //K_PlayTauntSound(player->mo); + S_StartSound(player->mo, sfx_s3k3a); + + for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { angle_t newangle; fixed_t newx; fixed_t newy; mobj_t *mo; - player->kartstuff[k_itemheld] = 1; - player->pflags |= PF_ATTACKDOWN; + newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_GREENSHIELD); - mo->threshold = 10; if (mo) - P_SetTarget(&mo->target, player->mo); - } - else if (player->kartstuff[k_itemamount] > 1) // Orbinaut x3 held - {*/ - INT32 moloop; - - player->kartstuff[k_itemheld] = 2; - player->pflags |= PF_ATTACKDOWN; - //K_PlayTauntSound(player->mo); - S_StartSound(player->mo, sfx_s3k3a); - - for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_GREENSHIELD); - if (mo) - { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT); - } + mo->threshold = 10; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; } - //} + } } - else if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemheld] == 1) - { - player->kartstuff[k_itemamount]--; - player->kartstuff[k_itemheld] = 0; - - K_ThrowKartItem(player, true, MT_GREENITEM, 1, false); - K_PlayTauntSound(player->mo); - } - else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld] == 2) // Orbinaut x3 thrown + else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Orbinaut x3 thrown { K_ThrowKartItem(player, true, MT_GREENITEM, 1, false); K_PlayTauntSound(player->mo); @@ -3194,63 +3156,34 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_JAWZ: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - /*if (player->kartstuff[k_itemamount] == 1) // Jawz x1 held + INT32 moloop; + + player->kartstuff[k_itemheld] = 1; + player->pflags |= PF_ATTACKDOWN; + //K_PlayTauntSound(player->mo); + S_StartSound(player->mo, sfx_s3k3a); + + for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { angle_t newangle; fixed_t newx; fixed_t newy; mobj_t *mo; - player->kartstuff[k_itemheld] = 1; - player->pflags |= PF_ATTACKDOWN; + newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); - mo->threshold = 10; if (mo) - P_SetTarget(&mo->target, player->mo); - } - else if (player->kartstuff[k_itemamount] > 1) // Jawz x2 held - {*/ - INT32 moloop; - - player->kartstuff[k_itemheld] = 2; - player->pflags |= PF_ATTACKDOWN; - //K_PlayTauntSound(player->mo); - S_StartSound(player->mo, sfx_s3k3a); - - for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); - if (mo) - { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT); - } + mo->threshold = 10; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; } - //} + } } - else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM && player->kartstuff[k_itemheld] == 1) // Jawz x1 thrown - { - player->kartstuff[k_itemamount]--; - player->kartstuff[k_itemheld] = 0; - if (player->kartstuff[k_throwdir] == 1 || player->kartstuff[k_throwdir] == 0) - K_ThrowKartItem(player, true, MT_JAWZ, 1, false); - else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in - K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); - K_PlayTauntSound(player->mo); - } - else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld] == 2) // Jawz x2 thrown + else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld]) // Jawz thrown { if (player->kartstuff[k_throwdir] == 1 || player->kartstuff[k_throwdir] == 0) K_ThrowKartItem(player, true, MT_JAWZ, 1, false); @@ -3258,6 +3191,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); K_PlayTauntSound(player->mo); player->pflags |= PF_ATTACKDOWN; + player->kartstuff[k_itemamount]--; if (!player->kartstuff[k_itemamount]) player->kartstuff[k_itemheld] = 0; @@ -3285,7 +3219,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_SetTarget(&player->mo->hnext, mo); } } - else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM) + else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM && player->kartstuff[k_itemheld]) { K_ThrowKartItem(player, false, MT_SSMINE, 1, true); K_PlayTauntSound(player->mo); diff --git a/src/p_inter.c b/src/p_inter.c index 2da571e63..84e567bf0 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -427,10 +427,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; if (player == special->target->player) return; - if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] - || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] - || player->kartstuff[k_invincibilitytimer] || player->powers[pw_flashing] - || player->kartstuff[k_balloon] <= 0) + if (player->kartstuff[k_balloon] <= 0) return; if (special->target->player->kartstuff[k_comebacktimer] @@ -440,25 +437,32 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->target->player->kartstuff[k_comebackmode] == 0) { - mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMPARTICLE); - boom->scale = special->target->scale; - boom->destscale = special->target->scale; - boom->momz = 5*FRACUNIT; - if (special->target->color) - boom->color = special->target->color; + if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] + || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] + || player->kartstuff[k_invincibilitytimer] || player->powers[pw_flashing]) + return; else - boom->color = SKINCOLOR_RED; - S_StartSound(boom, special->info->attacksound); + { + mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMPARTICLE); + boom->scale = special->target->scale; + boom->destscale = special->target->scale; + boom->momz = 5*FRACUNIT; + if (special->target->color) + boom->color = special->target->color; + else + boom->color = SKINCOLOR_RED; + S_StartSound(boom, special->info->attacksound); - K_ExplodePlayer(player, special->target); + K_ExplodePlayer(player, special->target); - special->target->player->kartstuff[k_comebackpoints] += 2; - 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_StealBalloon(special->target->player, player, true); + special->target->player->kartstuff[k_comebackpoints] += 2; + 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_StealBalloon(special->target->player, player, true); - special->target->player->kartstuff[k_comebacktimer] = comebacktime; + special->target->player->kartstuff[k_comebacktimer] = comebacktime; + } } else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, true)) { diff --git a/src/p_map.c b/src/p_map.c index 392c64432..e6c07afa1 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1633,13 +1633,11 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer] || thing->player->kartstuff[k_hyudorotimer] || thing->player->kartstuff[k_spinouttimer] || thing->player->kartstuff[k_invincibilitytimer] || thing->player->kartstuff[k_justbumped] - || (G_BattleGametype() && (thing->player->kartstuff[k_balloon] <= 0 - && (thing->player->kartstuff[k_comebacktimer]))) + || (G_BattleGametype() && thing->player->kartstuff[k_balloon] <= 0) || tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer] || tmthing->player->kartstuff[k_hyudorotimer] || tmthing->player->kartstuff[k_spinouttimer] || tmthing->player->kartstuff[k_invincibilitytimer] || tmthing->player->kartstuff[k_justbumped] - || (G_BattleGametype() && (tmthing->player->kartstuff[k_balloon] <= 0 - && (tmthing->player->kartstuff[k_comebacktimer])))) + || (G_BattleGametype() && tmthing->player->kartstuff[k_balloon] <= 0)) { return true; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 6e6c852b1..fb1da70a5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6695,11 +6695,8 @@ void P_MobjThinker(mobj_t *mobj) fixed_t z; const fixed_t radius = FixedHypot(mobj->target->radius, mobj->target->radius) + FixedHypot(mobj->radius, mobj->radius); // mobj's distance from its Target, or Radius. - //mobj->angle += FixedAngle(12*FRACUNIT); // mobj's actual speed. - if (mobj->lastlook > 0) - mobj->angle += FixedAngle(mobj->info->speed); - else - mobj->angle = (mobj->target->angle + ANGLE_180); + mobj->angle -= ANGLE_90; + mobj->angle += FixedAngle(mobj->info->speed); // If the player is on the ceiling, then flip your items as well. if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP) @@ -6750,6 +6747,7 @@ void P_MobjThinker(mobj_t *mobj) } mobj->z = z; mobj->momx = mobj->momy = 0; + mobj->angle += ANGLE_90; // Was this so hard? if ((mobj->type == MT_GREENSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) @@ -6778,7 +6776,7 @@ void P_MobjThinker(mobj_t *mobj) { if (mobj->lastlook == 1) { - const fixed_t spacing = FixedMul(mobj->info->radius, mobj->target->scale); + const fixed_t spacing = FixedMul(3*mobj->info->radius/2, mobj->target->scale); mobj_t *cur = mobj; mobj_t *targ = mobj->target; @@ -6789,27 +6787,31 @@ void P_MobjThinker(mobj_t *mobj) fixed_t targy; fixed_t targz; fixed_t speed; + fixed_t dist = spacing; if (cur != mobj) + { targ = cur->hprev; + dist = spacing/2; + } if (!targ || P_MobjWasRemoved(targ)) continue; ang = targ->angle; - targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, spacing); - targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, spacing); + targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, dist); + targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, dist); targz = targ->z; - speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), FRACUNIT/2); + speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), 3*FRACUNIT/4); if (P_IsObjectOnGround(targ)) targz = cur->floorz; cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy); - if (speed > spacing/2) - P_InstaThrust(cur, cur->angle, speed-(spacing/2)); + if (speed > dist) + P_InstaThrust(cur, cur->angle, speed-dist); - P_SetObjectMomZ(cur, FixedMul(targz - cur->z, FRACUNIT/2), false); + P_SetObjectMomZ(cur, FixedMul(targz - cur->z, 3*FRACUNIT/4) - gravity, false); if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) P_TeleportMove(cur, targx, targy, cur->z); @@ -8240,6 +8242,32 @@ void P_MobjThinker(mobj_t *mobj) else mobj->flags2 &= ~MF2_DONTDRAW; } + + // Now for the wheels + { + const fixed_t rad = mobjinfo[MT_PLAYER].radius; + mobj_t *cur = mobj->hnext; + + while (cur && !P_MobjWasRemoved(cur)) + { + fixed_t offx = rad; + fixed_t offy = rad; + + if (cur->lastlook == 1 || cur->lastlook == 3) + offx *= -1; + if (cur->lastlook == 2 || cur->lastlook == 3) + offy *= -1; + + P_TeleportMove(cur, mobj->x + offx, mobj->y + offy, mobj->z); + + if (mobj->flags2 & MF2_DONTDRAW) + cur->flags2 |= MF2_DONTDRAW; + else + cur->flags2 &= ~MF2_DONTDRAW; + + cur = cur->hnext; + } + } break; //} case MT_TURRET: @@ -9001,6 +9029,35 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_BLUEBALL: nummaprings++; break; + case MT_KARMAHITBOX: // SRB2Kart + { + const fixed_t rad = mobjinfo[MT_PLAYER].radius; + mobj_t *cur, *prev = mobj; + INT32 i; + + for (i = 0; i < 4; i++) + { + fixed_t offx = rad; + fixed_t offy = rad; + + if (i == 1 || i == 3) + offx *= -1; + if (i == 2 || i == 3) + offy *= -1; + + cur = P_SpawnMobj(mobj->x + offx, mobj->y + offy, mobj->z, MT_KARMAWHEEL); + cur->destscale = mobj->scale; + P_SetScale(cur, mobj->scale); + + cur->lastlook = i; + + P_SetTarget(&cur->hprev, prev); + P_SetTarget(&prev->hnext, cur); + + prev = cur; + } + } + break; default: break; } diff --git a/src/p_saveg.c b/src/p_saveg.c index cfbeccc97..dae613cce 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1029,7 +1029,6 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) const mobj_t *mobj = (const mobj_t *)th; UINT32 diff; UINT16 diff2; - UINT8 i; // Ignore stationary hoops - these will be respawned from mapthings. if (mobj->type == MT_HOOP) diff --git a/src/p_spec.c b/src/p_spec.c index 0565dbd7b..37797a9c4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4182,13 +4182,9 @@ DoneSection2: //except the time! player->starposttime = player->realtime; - if (P_IsLocalPlayer(player)) - { - if (player->laps < (UINT8)(cv_numlaps.value - 1)) - S_StartSound(NULL, sfx_mlap); - else if (player->laps == (UINT8)(cv_numlaps.value - 1)) - S_StartSound(NULL, sfx_mlap); - } + if (P_IsLocalPlayer(player) && (player->laps <= (UINT8)(cv_numlaps.value - 1))) + S_StartSound(NULL, sfx_s221); + // //player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostx = player->starposty = player->starpostz = 0; diff --git a/src/sounds.c b/src/sounds.c index 3cf54148b..5f09e525c 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -316,7 +316,7 @@ sfxinfo_t S_sfx[NUMSFX] = // Sonic 2 sounds {"s220", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s221", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s221", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Lap sound {"s222", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s223", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s224", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},