UCRP_GACHABOMMISER

Break a target (Prison Egg/UFO) using exactly one Gachabom again and again
Becomes invalid if an Insta-Whip collides with a target, or you throw two at the same time
This commit is contained in:
toaster 2023-10-17 21:09:22 +01:00
parent 01b97cb829
commit 3e494a342c
7 changed files with 27 additions and 0 deletions

View file

@ -417,7 +417,9 @@ struct roundconditions_t
UINT8 hittrackhazard[((MAX_LAPS+1)/8) + 1];
// Attack-based conditions
targetdamaging_t targetdamaging;
UINT8 gachabom_miser;
mobjeflag_t wet_player;

View file

@ -3034,6 +3034,11 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
return;
}
}
else if (fastcmp(params[0], "GACHABOMMISER"))
{
//PARAMCHECK(1);
ty = UCRP_GACHABOMMISER;
}
else
{
deh_warning("Invalid condition name %s for condition ID %d", params[0], id+1);

View file

@ -11722,6 +11722,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_ThrowKartItem(player, true, MT_GACHABOM, 0, 0, 0);
K_PlayAttackTaunt(player->mo);
player->itemamount--;
player->roundconditions.gachabom_miser = (
(player->roundconditions.gachabom_miser == 0)
? 1 : 0xFF
);
K_UpdateHnextList(player, false);
}
break;

View file

@ -1695,6 +1695,12 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
case UCRP_TARGETATTACKMETHOD:
return (player->roundconditions.targetdamaging == (targetdamaging_t)cn->requirement);
case UCRP_GACHABOMMISER:
return (
player->roundconditions.targetdamaging == UFOD_GACHABOM
&& player->roundconditions.gachabom_miser != 0xFF
);
case UCRP_WETPLAYER:
return (((player->roundconditions.wet_player & cn->requirement) == 0)
&& !player->roundconditions.fell_off); // Levels with water tend to texture their pits as water too
@ -2435,6 +2441,9 @@ static const char *M_GetConditionString(condition_t *cn)
return va("using only %s", work);
}
case UCRP_GACHABOMMISER:
return "using exactly one Gachabom repeatedly";
case UCRP_WETPLAYER:
return va("without %s %s",
(cn->requirement & MFE_TOUCHWATER) ? "touching any" : "going into",

View file

@ -126,6 +126,7 @@ typedef enum
UCRP_TRACKHAZARD, // (Don't) get hit by a track hazard (maybe specific lap)
UCRP_TARGETATTACKMETHOD, // Break targets/UFO using only one method
UCRP_GACHABOMMISER, // Break targets/UFO using exactly one Gachabom repeatedly
UCRP_WETPLAYER, // Don't touch [strictness] [fluid]
} conditiontype_t;

View file

@ -73,6 +73,8 @@ bool award_target(mobj_t* mobj)
{
player->itemtype = KITEM_GACHABOM;
player->itemamount++;
if (player->roundconditions.gachabom_miser == 1)
player->roundconditions.gachabom_miser = 0;
return true;
}

View file

@ -987,6 +987,10 @@ void P_TrackRoundConditionTargetDamage(targetdamaging_t targetdamaging)
if (players[g_localplayers[i]].spectator)
continue;
players[i].roundconditions.targetdamaging |= targetdamaging;
/* -- the following isn't needed because we can just check for targetdamaging == UFOD_GACHABOM
if (targetdamaging != UFOD_GACHABOM)
players[i].roundconditions.gachabom_miser = 0xFF;
*/
}
}