From 8408b1fef4fdec3f858cf4f37b12bbd2a14974bb Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 3 Jun 2018 20:11:08 -0400 Subject: [PATCH] Some Battle fixes and additions - mapgotboxes is synched - Karma bombs/items flash while spinning out - Karma bombs have a sound + explosion when hitting someone - Karma bombs can no longer attempt to attack a player that is flashing and have to WAIT... again - Fixed MT_GREENITEM's bounce sound, after breaking from last commit (WHY ARE YOU ABUSING MARIO MODE SOUNDS, STOP, AGHH) --- src/info.c | 2 +- src/k_kart.c | 6 +++++- src/p_map.c | 30 ++++++++++++++++++++++++++---- src/p_saveg.c | 2 ++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/info.c b/src/info.c index 979715bf..3c7e2894 100644 --- a/src/info.c +++ b/src/info.c @@ -14686,7 +14686,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // seestate sfx_tossed, // seesound 8, // reactiontime - sfx_tink, // attacksound + sfx_mario1, // attacksound S_NULL, // painstate 0, // painchance sfx_None, // painsound diff --git a/src/k_kart.c b/src/k_kart.c index 94ab9077..c4da0b22 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3268,7 +3268,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (player->kartstuff[k_comebackmode] == 1 && player->mo->tracer->state != &states[S_PLAYERITEM]) P_SetMobjState(player->mo->tracer, S_PLAYERITEM); - player->mo->tracer->flags2 &= ~MF2_DONTDRAW; + + if (player->powers[pw_flashing] && (leveltime & 1)) + player->mo->tracer->flags2 |= MF2_DONTDRAW; + else + player->mo->tracer->flags2 &= ~MF2_DONTDRAW; } } else if (G_RaceGametype() || player->kartstuff[k_balloon] > 0) diff --git a/src/p_map.c b/src/p_map.c index 9191038b..05e12064 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1668,21 +1668,42 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player->kartstuff[k_balloon] <= 0 || tmthing->player->kartstuff[k_balloon] <= 0) { if (thing->player->kartstuff[k_comebackmode] == 0 - && tmthing->player->kartstuff[k_balloon] > 0) + && (tmthing->player->kartstuff[k_balloon] > 0 + && !tmthing->player->powers[pw_flashing])) { + mobj_t *boom = P_SpawnMobj(thing->x, thing->y, thing->z, MT_BOOMPARTICLE); + boom->scale = thing->scale; + boom->destscale = thing->scale; + boom->momz = 5*FRACUNIT; + if (thing->player->skincolor) + boom->color = thing->player->skincolor; + else + boom->color = SKINCOLOR_RED; + S_StartSound(boom, sfx_s3k4e); K_ExplodePlayer(tmthing->player, thing); thing->player->kartstuff[k_comebacktimer] = comebacktime; return true; } else if (tmthing->player->kartstuff[k_comebackmode] == 0 - && thing->player->kartstuff[k_balloon] > 0) + && (thing->player->kartstuff[k_balloon] > 0 + && !thing->player->powers[pw_flashing])) { + mobj_t *boom = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_BOOMPARTICLE); + boom->scale = tmthing->scale; + boom->destscale = tmthing->scale; + boom->momz = 5*FRACUNIT; + if (tmthing->player->skincolor) + boom->color = tmthing->player->skincolor; + else + boom->color = SKINCOLOR_RED; + S_StartSound(boom, sfx_s3k4e); K_ExplodePlayer(thing->player, tmthing); tmthing->player->kartstuff[k_comebacktimer] = comebacktime; return true; } else if (thing->player->kartstuff[k_comebackmode] == 1 - && (tmthing->player->kartstuff[k_balloon] > 0 && P_CanPickupItem(tmthing->player, true))) + && (tmthing->player->kartstuff[k_balloon] > 0 + && P_CanPickupItem(tmthing->player, true))) { thing->player->kartstuff[k_comebackmode] = 0; thing->player->kartstuff[k_comebackpoints]++; @@ -1695,7 +1716,8 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } else if (tmthing->player->kartstuff[k_comebackmode] == 1 - && (thing->player->kartstuff[k_balloon] > 0 && P_CanPickupItem(thing->player, true))) + && (thing->player->kartstuff[k_balloon] > 0 + && P_CanPickupItem(thing->player, true))) { tmthing->player->kartstuff[k_comebackmode] = 0; tmthing->player->kartstuff[k_comebackpoints]++; diff --git a/src/p_saveg.c b/src/p_saveg.c index eaa38813..e1a9944a 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3252,6 +3252,7 @@ static void P_NetArchiveMisc(void) WRITEUINT8(save_p, mirrormode); WRITEUINT8(save_p, franticitems); WRITEUINT8(save_p, comeback); + WRITEINT32(save_p, numgotboxes); // Probably shouldn't need nummapboxes // Is it paused? if (paused) @@ -3343,6 +3344,7 @@ static inline boolean P_NetUnArchiveMisc(void) mirrormode = (boolean)READUINT8(save_p); franticitems = (boolean)READUINT8(save_p); comeback = (boolean)READUINT8(save_p); + numgotboxes = READINT32(save_p); // Is it paused? if (READUINT8(save_p) == 0x2f)