UCRP_GROWCONSECUTIVEBEAMS

- Condition1 = GrowConsecutiveBeams 4
- "touch the blue beams from your own Shrink at least 4 times before returning to normal size
This commit is contained in:
toaster 2023-10-19 19:44:37 +01:00
parent 6211c0b222
commit 42233cfb9e
6 changed files with 31 additions and 0 deletions

View file

@ -433,6 +433,9 @@ struct roundconditions_t
tic_t continuousdraft;
tic_t continuousdraft_best;
UINT8 consecutive_grow_lasers;
UINT8 best_consecutive_grow_lasers;
mobjeflag_t wet_player;
// 32 triggers, one bit each, for map execution

View file

@ -3015,6 +3015,18 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
return;
}
}
else if (fastcmp(params[0], "GROWCONSECUTIVEBEAMS"))
{
PARAMCHECK(1);
ty = UCRP_GROWCONSECUTIVEBEAMS;
re = get_number(params[1]);
if (re < 2 || re > UINT8_MAX)
{
deh_warning("Touch count %d out of range (2 - %u) for condition ID %d", re, UINT8_MAX, id+1);
return;
}
}
else if (fastcmp(params[0], "TRIGGER"))
{
PARAMCHECK(1);

View file

@ -3842,6 +3842,7 @@ void K_RemoveGrowShrink(player_t *player)
}
player->growshrinktimer = 0;
player->roundconditions.consecutive_grow_lasers = 0;
}
boolean K_IsBigger(mobj_t *compare, mobj_t *other)

View file

@ -1643,6 +1643,8 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
return (player->roundconditions.maxspeed >= cn->requirement);
case UCRP_DRAFTDURATION:
return (player->roundconditions.continuousdraft_best >= ((tic_t)cn->requirement)*TICRATE);
case UCRP_GROWCONSECUTIVEBEAMS:
return (player->roundconditions.best_consecutive_grow_lasers >= cn->requirement);
case UCRP_TRIGGER: // requires map trigger set
return !!(player->roundconditions.unlocktriggers & (1 << cn->requirement));
@ -2457,6 +2459,8 @@ static const char *M_GetConditionString(condition_t *cn)
);
case UCRP_DRAFTDURATION:
return va("consistently draft off other racers for %u seconds", cn->requirement);
case UCRP_GROWCONSECUTIVEBEAMS:
return va("touch the blue beams from your own Shrink at least %u times before returning to normal size", cn->requirement);
case UCRP_TRIGGER:
return "do something special";

View file

@ -118,6 +118,7 @@ typedef enum
UCRP_SPEEDOMETER, // >= [percentage]
UCRP_DRAFTDURATION, // >= [time, seconds]
UCRP_GROWCONSECUTIVEBEAMS, // touch more than n times consecutively
UCRP_TRIGGER, // Map execution trigger [id]

View file

@ -547,6 +547,16 @@ boolean Obj_ShrinkLaserCollide(mobj_t *gun, mobj_t *victim)
victim->player->growshrinktimer += 6*TICRATE;
S_StartSound(victim, sfx_kc5a);
if (victim->player->roundconditions.consecutive_grow_lasers < UINT8_MAX)
{
victim->player->roundconditions.consecutive_grow_lasers++;
if (victim->player->roundconditions.consecutive_grow_lasers > victim->player->roundconditions.best_consecutive_grow_lasers)
{
victim->player->roundconditions.best_consecutive_grow_lasers
= victim->player->roundconditions.consecutive_grow_lasers;
}
}
if (prevTimer <= 0)
{
victim->scalespeed = mapobjectscale/TICRATE;