diff --git a/src/d_player.h b/src/d_player.h index 135b1dc23..11e40c04e 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -225,6 +225,7 @@ typedef enum NUMKARTRESULTS, KDROP_STONESHOETRAP, + KCAPSULE_RING, // Power-ups exist in the same enum as items so it's easy // for paper items to be reused for them. diff --git a/src/deh_tables.c b/src/deh_tables.c index be1d9b33c..156abb635 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5229,6 +5229,7 @@ struct int_const_s const INT_CONST[] = { {"KRITEM_TRIPLEGACHABOM",KRITEM_TRIPLEGACHABOM}, {"NUMKARTRESULTS",NUMKARTRESULTS}, {"KDROP_STONESHOETRAP",KDROP_STONESHOETRAP}, + {"KCAPSULE_RING", KCAPSULE_RING}, {"FIRSTPOWERUP",FIRSTPOWERUP}, {"POWERUP_SMONITOR",POWERUP_SMONITOR}, {"POWERUP_BARRIER",POWERUP_BARRIER}, diff --git a/src/info.c b/src/info.c index c115c1f1f..381efaf67 100644 --- a/src/info.c +++ b/src/info.c @@ -506,6 +506,7 @@ char sprnames[NUMSPRITES + 1][5] = "ITEM", "ITMO", "ITMI", + "IBON", "ITMN", "PWRB", "RBOW", // power-up aura diff --git a/src/info.h b/src/info.h index a207dca6a..157d7a163 100644 --- a/src/info.h +++ b/src/info.h @@ -1047,6 +1047,7 @@ typedef enum sprite SPR_ITEM, SPR_ITMO, SPR_ITMI, + SPR_IBON, SPR_ITMN, SPR_PWRB, SPR_RBOW, // power-up aura diff --git a/src/k_kart.c b/src/k_kart.c index 84a45dc3e..71d8e143d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -16293,6 +16293,10 @@ void K_UpdateMobjItemOverlay(mobj_t *part, SINT8 itemType, UINT8 itemCount) part->sprite = SPR_STON; part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE|4; break; + case KCAPSULE_RING: + part->sprite = SPR_IBON; + part->frame = FF_FULLBRIGHT|FF_PAPERSPRITE; + break; default: if (itemType >= FIRSTPOWERUP) { diff --git a/src/p_inter.c b/src/p_inter.c index 4a2b17d68..1d580e371 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -533,7 +533,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (K_IsSPBInGame()) // don't spawn a second SPB return; break; - case KITEM_SUPERRING: + case KCAPSULE_RING: if (!P_CanPickupItem(player, PICKUP_RINGORSPHERE)) // no cheaty rings return; break; @@ -546,7 +546,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } // Ring Capsules shouldn't affect pickup cheese, they're just used as condensed ground-ring placements. - if (special->threshold != KITEM_SUPERRING) + if (special->threshold != KCAPSULE_RING) P_UpdateLastPickup(player, 3); S_StartSound(toucher, special->info->deathsound); @@ -2052,7 +2052,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->fuse = 5*TICRATE; else if (K_CapsuleTimeAttackRules() == true) ; // Don't respawn (internal) - else if (target->threshold == KITEM_SUPERRING) + else if (target->threshold == KCAPSULE_RING) target->fuse = 20*TICRATE; else target->fuse = 40*TICRATE; @@ -2119,7 +2119,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (!(target->flags2 & MF2_STRONGBOX)) { // special behavior for ring capsules - if (target->threshold == KITEM_SUPERRING) + if (target->threshold == KCAPSULE_RING) { K_AwardPlayerRings(player, 5 * target->movecount, true); break; diff --git a/src/p_mobj.c b/src/p_mobj.c index 4da79e5af..e11732c66 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4452,7 +4452,7 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj) UINT32 newRenderFlags = 0; boolean colorized; - if (itemType < 1 || itemType >= NUMKARTITEMS) + if (itemType < 1 || (itemType >= NUMKARTITEMS && itemType != KCAPSULE_RING)) itemType = KITEM_SAD; // update invincibility properties @@ -4471,7 +4471,7 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj) // update cap colors if (mobj->extravalue2) color = mobj->extravalue2; - else if (itemType == KITEM_SUPERRING) + else if (itemType == KCAPSULE_RING) { color = SKINCOLOR_GOLD; newRenderFlags |= RF_SEMIBRIGHT; @@ -4514,7 +4514,8 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj) if (mobj->movecount - 1 > K_GetOrbinautItemFrame(mobj->movecount)) count = mobj->movecount; break; - case KITEM_SUPERRING: // always display the number, and multiply it by 5 + case KCAPSULE_RING: + // always display the number, and multiply it by 5 if (mobj->flags2 & MF2_STRONGBOX) count = mobj->movecount * 20; // give Super Rings else @@ -11519,7 +11520,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) // set default item & count #if 0 // set to 1 to test capsules with random items, e.g. with objectplace if (P_RandomChance(PR_ITEM_SPAWNER, FRACUNIT/3)) - mobj->threshold = KITEM_SUPERRING; + mobj->threshold = KCAPSULE_RING; else if (P_RandomChance(PR_ITEM_SPAWNER, FRACUNIT/3)) mobj->threshold = KITEM_SPB; else if (P_RandomChance(PR_ITEM_SPAWNER, FRACUNIT/3)) @@ -11528,7 +11529,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->threshold = P_RandomRange(PR_ITEM_SPAWNER, 1, NUMKARTITEMS - 1); mobj->movecount = P_RandomChance(PR_ITEM_SPAWNER, FRACUNIT/3) ? 1 : P_RandomKey(PR_ITEM_SPAWNER, 32) + 1; #else - mobj->threshold = KITEM_SUPERRING; // default item is super ring + mobj->threshold = KCAPSULE_RING; // default item is ring mobj->movecount = 1; #endif @@ -14118,9 +14119,11 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) if (!P_IsObjectOnGround(mobj)) mobj->flags |= MF_NOGRAVITY; - // Angle = item type + // First argument = item type (or 0 for KCAPSULE_RING) if (mthing->thing_args[0] > 0 && mthing->thing_args[0] < NUMKARTITEMS) + { mobj->threshold = mthing->thing_args[0]; + } // Parameter = extra items (x5 for rings) mobj->movecount += mthing->thing_args[1];