Try making random item more accurate for battle (#135 point 1, still needs testing)

This commit is contained in:
NepDisk 2025-09-28 11:01:54 -04:00
parent df819b303d
commit 1e1404162e
3 changed files with 10 additions and 18 deletions

View file

@ -411,7 +411,7 @@ boolean K_IsPlayerLosing(player_t *player)
INT32 winningpos = 1;
UINT8 i, pcount = 0;
if (itembreaker && numgotboxes == 0)
if (itembreaker && numtargets == 0)
return true; // Didn't even TRY?
if (itembreaker || bossinfo.boss)

View file

@ -10624,16 +10624,11 @@ void A_ItemPop(mobj_t *actor)
remains->flags2 = actor->flags2; // Transfer flags2
remains->fuse = actor->fuse; // Transfer respawn timer
remains->cvmem = leveltime;
remains->threshold = actor->threshold;
if (remains->threshold != 69 && remains->threshold != 70)
{
remains->threshold = 68;
}
remains->threshold = (actor->threshold == 69 ? 69 : 68);
// To insure this information doesn't have to be rediscovered every time you look at this function...
// A threshold of 0 is for a "living", ordinary random item.
// 68 means regular popped random item debris.
// 69 used to mean old Karma Item behaviour (now you can replicate this with MF2_DONTRESPAWN).
// 70 is a powered up Overtime item.
// 69 means Karmabomb dropped Item behaviour
remains->skin = NULL;
remains->spawnpoint = actor->spawnpoint;
@ -10650,7 +10645,7 @@ void A_ItemPop(mobj_t *actor)
{
K_AwardScaledPlayerRings(actor->target->player, ASR_ITEMBOX);
if (numgotboxes < 3)
if (numtargets < 4)
{
actor->target->player->itemtype = KITEM_POGOSPRING;
actor->target->player->itemamount += 1;
@ -10660,7 +10655,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags2 &= ~MF2_AMBUSH;
// Here at mapload in battle?
if ((gametyperules & GTR_BUMPERS) && (actor->flags2 & MF2_BOSSNOTRAP))
if (gametyperules & GTR_BUMPERS && actor->threshold != 69)
numgotboxes++;
P_RemoveMobj(actor);

View file

@ -10268,7 +10268,7 @@ static void P_MonitorFuseThink(mobj_t *mobj)
static boolean P_FuseThink(mobj_t *mobj)
{
if (mobj->fuse <= TICRATE && (mobj->type == MT_RANDOMITEM || mobj->type == MT_EGGMANITEM || mobj->type == MT_FALLINGROCK))
if (mobj->fuse <= TICRATE && ((mobj->type == MT_RANDOMITEM && mobj->threshold == 69) || mobj->type == MT_EGGMANITEM || mobj->type == MT_FALLINGROCK))
mobj->renderflags ^= RF_DONTDRAW;
mobj->fuse--;
@ -10296,7 +10296,7 @@ static boolean P_FuseThink(mobj_t *mobj)
{
;
}
else if (gametype == GT_BATTLE)
else if (gametyperules & GTR_BATTLEBOXES)
{
if (mobj->threshold != 69)
break;
@ -10315,7 +10315,7 @@ static boolean P_FuseThink(mobj_t *mobj)
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type);
// Transfer flags2 (strongbox, objectflip, bossnotrap)
newmobj->flags2 = mobj->flags2 & ~MF2_DONTDRAW;
newmobj->flags2 = mobj->flags2;
}
P_RemoveMobj(mobj); // make sure they disappear
@ -12131,7 +12131,7 @@ void P_RespawnSpecials(void)
INT32 time = 30*TICRATE; // Respawn things in empty dedicated servers
mapthing_t *mthing = NULL;
if ((gametyperules & GTR_BATTLEBOXES) && numgotboxes >= (4*nummapboxes/5) && !itembreaker) // Battle Mode respawns all boxes in a different way
if ((gametyperules & GTR_BATTLEBOXES) && !itembreaker && numgotboxes >= (4*nummapboxes/5)) // Battle Mode respawns all boxes in a different way
{
thinker_t *th;
@ -13590,10 +13590,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
}
case MT_RANDOMITEM:
{
if (leveltime < 3)
{
mobj->flags2 |= MF2_BOSSNOTRAP; // mark as here on map start
}
mobj->flags2 |= MF2_BOSSNOTRAP; // mark as here on map start
nummapboxes++;
break;
}