From c19a779851d38e48361009dcfc11fc879a8f3f82 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 14 Aug 2018 15:23:38 +0100 Subject: [PATCH] Odds and ends of bugfixing and polish. * Flashing Eggman-hit players. * Fix typo with Rocket Shoe item bar, and make it extensible for potential future purposes since I was fiddling with it anyways. * More complete playerarrow visuals for various items. * Eggman fake (and debug) item get sounds. --- src/info.c | 4 ++-- src/info.h | 1 + src/k_kart.c | 53 ++++++++++++++++++++++++++++++++----------------- src/p_mobj.c | 56 +++++++++++++++++++++++++++++++++++++++++----------- src/sounds.c | 2 ++ src/sounds.h | 2 ++ 6 files changed, 86 insertions(+), 32 deletions(-) diff --git a/src/info.c b/src/info.c index 2e8b74e6..c642b67e 100644 --- a/src/info.c +++ b/src/info.c @@ -59,8 +59,8 @@ char sprnames[NUMSPRITES + 1][5] = "FITM","BANA","ORBN","JAWZ","SSMN","KRBM","BHOG","BHBM","BLIG","LIGH", "THNS","SINK","SITR","KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES", "GBAS","SPRS","BUZB","CHOM","SACO","CRAB","SHAD","BRNG","BUMP","FLEN", - "CLAS","PSHW","ISTA","ISTB","ARRO","ITEM","ITMI","ITMN","WANT","PBOM", - "VIEW" + "CLAS","PSHW","ISTA","ISTB","ARRO","ITEM","ITMO","ITMI","ITMN","WANT", + "PBOM","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) diff --git a/src/info.h b/src/info.h index 4e2be267..98d628b3 100644 --- a/src/info.h +++ b/src/info.h @@ -631,6 +631,7 @@ typedef enum sprite SPR_ARRO, // player arrows SPR_ITEM, + SPR_ITMO, SPR_ITMI, SPR_ITMN, SPR_WANT, diff --git a/src/k_kart.c b/src/k_kart.c index be4f97b1..cadc6721 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -790,7 +790,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) player->kartstuff[k_itemroulette] = 0; player->kartstuff[k_roulettetype] = 0; if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_mkitmF); + S_StartSound(NULL, sfx_mkitmE); return; } @@ -801,7 +801,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) player->kartstuff[k_itemroulette] = 0; player->kartstuff[k_roulettetype] = 0; if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_mkitmF); + S_StartSound(NULL, sfx_dbgsal); return; } @@ -3019,7 +3019,26 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) ghost->fuse = 4; ghost->frame |= FF_FULLBRIGHT; } - else if (player->kartstuff[k_growshrinktimer] != 0) + else if (player->kartstuff[k_eggmanexplode]) + { + INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE); + if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0)) + { + player->mo->colorized = false; + player->mo->color = player->skincolor; + } + else if (player->kartstuff[k_eggmanexplode] % flashtime == 0) + { + player->mo->colorized = true; + player->mo->color = SKINCOLOR_BLACK; + } + else + { + player->mo->colorized = true; + player->mo->color = SKINCOLOR_CRIMSON; + } + } + else if (player->kartstuff[k_growshrinktimer]) { if (player->kartstuff[k_growshrinktimer] % 5 == 0) { @@ -4913,6 +4932,7 @@ static void K_drawKartItem(void) patch_t *localbg = ((splitscreen > 1) ? kp_itembg[2] : kp_itembg[0]); patch_t *localinv = ((splitscreen > 1) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]); INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); + INT32 itembar = 0; if (stplyr->kartstuff[k_itemroulette]) { @@ -4964,6 +4984,7 @@ static void K_drawKartItem(void) } else if (stplyr->kartstuff[k_rocketsneakertimer] > 1) { + itembar = stplyr->kartstuff[k_rocketsneakertimer]; if (leveltime & 1) localpatch = kp_rocketsneaker[offset]; else if (!(leveltime & 1)) @@ -5033,29 +5054,25 @@ static void K_drawKartItem(void) else V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, localpatch); - // Meter for rocket sneaker, could be extended to work for any other timer item... - if (stplyr->kartstuff[k_rocketsneakertimer]) + // Extensible meter, currently only used for rocket sneaker... + if (itembar) { - const INT32 barlength = (splitscreen > 1 ? 12 : 2); - const INT32 timer = stplyr->kartstuff[k_rocketsneakertimer]; // item's timer + const INT32 barlength = (splitscreen > 1 ? 12 : 24); const INT32 max = itemtime; // timer's normal highest value - INT32 length = min(barlength, (timer * barlength) / max); + INT32 length = min(barlength, (itembar * barlength) / max); INT32 height = (splitscreen > 1 ? 1 : 2); INT32 x = (splitscreen > 1 ? 17 : 11), y = (splitscreen > 1 ? 27 : 35); V_DrawScaledPatch(ITEM_X+x, ITEM_Y+y, V_HUDTRANS|splitflags, kp_itemtimer[offset]); - // The dark "AA" edges on the sides - V_DrawFill(ITEM_X+x+1, ITEM_Y+y+1, length, height, 12); + // The left dark "AA" edge + V_DrawFill(ITEM_X+x+1, ITEM_Y+y+1, (length == 2 ? 2 : 1), height, 12); // The bar itself - if (length >= 3) + if (length > 2) { - if (height == 1) - V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-1, height, 120); - else - { - V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-1, height, 8); - V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-1, height/2, 120); - } + V_DrawFill(ITEM_X+x+length, ITEM_Y+y+1, 1, height, 12); // the right one + if (height == 2) + V_DrawFill(ITEM_X+x+2, ITEM_Y+y+2, length-2, 1, 8); // the dulled underside + V_DrawFill(ITEM_X+x+2, ITEM_Y+y+1, length-2, 1, 120); // the shine } } diff --git a/src/p_mobj.c b/src/p_mobj.c index e0c03730..cba03bcb 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6964,6 +6964,45 @@ void P_MobjThinker(mobj_t *mobj) P_SetMobjState(mobj, S_PLAYERARROW_BOX); mobj->tracer->sprite = SPR_ITEM; mobj->tracer->frame = FF_FULLBRIGHT|(((mobj->target->player->kartstuff[k_itemroulette] % (13*3)) / 3) + 1); + mobj->tracer->flags2 &= ~MF2_DONTDRAW; + } + else if (mobj->target->player->kartstuff[k_stolentimer] > 0) + { + P_SetMobjState(mobj, S_PLAYERARROW_BOX); + mobj->tracer->sprite = SPR_ITEM; + mobj->tracer->frame = FF_FULLBRIGHT|KITEM_HYUDORO; + if (!(leveltime & 2)) + mobj->tracer->flags2 |= MF2_DONTDRAW; + else + mobj->tracer->flags2 &= ~MF2_DONTDRAW; + } + else if ((mobj->target->player->kartstuff[k_stealingtimer] > 0) && (leveltime & 2)) + { + P_SetMobjState(mobj, S_PLAYERARROW_BOX); + mobj->tracer->sprite = SPR_ITEM; + mobj->tracer->frame = FF_FULLBRIGHT|KITEM_HYUDORO; + mobj->tracer->flags2 &= ~MF2_DONTDRAW; + } + else if (mobj->target->player->kartstuff[k_eggmanexplode] > 1) + { + P_SetMobjState(mobj, S_PLAYERARROW_BOX); + mobj->tracer->sprite = SPR_ITEM; + mobj->tracer->frame = FF_FULLBRIGHT|KITEM_EGGMAN; + if (leveltime & 1) + mobj->tracer->flags2 |= MF2_DONTDRAW; + else + mobj->tracer->flags2 &= ~MF2_DONTDRAW; + } + else if (mobj->target->player->kartstuff[k_growshrinktimer] > 0) + { + P_SetMobjState(mobj, S_PLAYERARROW_BOX); + mobj->tracer->sprite = SPR_ITEM; + mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW; + + if (leveltime & 1) + mobj->tracer->flags2 |= MF2_DONTDRAW; + else + mobj->tracer->flags2 &= ~MF2_DONTDRAW; } else if (mobj->target->player->kartstuff[k_itemtype]) { @@ -6971,6 +7010,10 @@ void P_MobjThinker(mobj_t *mobj) switch (mobj->target->player->kartstuff[k_itemtype]) { + case KITEM_ORBINAUT: + mobj->tracer->sprite = SPR_ITMO; + mobj->tracer->frame = FF_FULLBRIGHT|(min(mobj->target->player->kartstuff[k_itemamount]-1, 3)); + break; case KITEM_INVINCIBILITY: mobj->tracer->sprite = SPR_ITMI; mobj->tracer->frame = FF_FULLBRIGHT|((leveltime % (7*3)) / 3); @@ -6985,18 +7028,7 @@ void P_MobjThinker(mobj_t *mobj) break; } - if (mobj->target->player->kartstuff[k_growshrinktimer] > 0) - { - mobj->tracer->sprite = SPR_ITEM; - mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW; - - if (leveltime & 1) - mobj->tracer->flags2 |= MF2_DONTDRAW; - else - mobj->tracer->flags2 &= ~MF2_DONTDRAW; - } - else - mobj->tracer->flags2 &= ~MF2_DONTDRAW; + mobj->tracer->flags2 &= ~MF2_DONTDRAW; } else { diff --git a/src/sounds.c b/src/sounds.c index 3b41dfa1..991941e0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -799,6 +799,7 @@ 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}, + {"mkitmE", true, 72, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"clash", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"tossed", false, 150, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -810,6 +811,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds {"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 0f8d5a3b..2f073273 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -871,6 +871,7 @@ typedef enum sfx_mkitm7, sfx_mkitm8, sfx_mkitmF, + sfx_mkitmE, sfx_clash, sfx_tossed, sfx_shelit, @@ -882,6 +883,7 @@ typedef enum sfx_noooo1, sfx_noooo2, sfx_hogbom, + sfx_dbgsal, sfx_kwin, sfx_klose,