mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
UCRP_DRAFTDURATION
"consistently draft off other racers for [parameter] seconds" Actually counts leniency tics too, but if the leniency hits 0 it gets reset.
This commit is contained in:
parent
0f06807c65
commit
a6ef8d357c
5 changed files with 31 additions and 4 deletions
|
|
@ -429,6 +429,9 @@ struct roundconditions_t
|
|||
|
||||
fixed_t maxspeed;
|
||||
|
||||
tic_t continuousdraft;
|
||||
tic_t continuousdraft_best;
|
||||
|
||||
mobjeflag_t wet_player;
|
||||
|
||||
// 32 triggers, one bit each, for map execution
|
||||
|
|
|
|||
|
|
@ -2966,6 +2966,18 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
|
|||
return;
|
||||
}
|
||||
}
|
||||
else if (fastcmp(params[0], "DRAFTDURATION"))
|
||||
{
|
||||
PARAMCHECK(1);
|
||||
ty = UCRP_DRAFTDURATION;
|
||||
re = get_number(params[1]);
|
||||
|
||||
if (re < 5)
|
||||
{
|
||||
deh_warning("Duration %d seconds too low for condition ID %d", re, id+1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (fastcmp(params[0], "TRIGGER"))
|
||||
{
|
||||
PARAMCHECK(1);
|
||||
|
|
|
|||
10
src/k_kart.c
10
src/k_kart.c
|
|
@ -1466,7 +1466,8 @@ static void K_UpdateDraft(player_t *player)
|
|||
|
||||
if (K_TryDraft(player, otherPlayer->mo, minDist, draftdistance, leniency) == true)
|
||||
{
|
||||
return; // Finished doing our draft.
|
||||
//return;
|
||||
goto draftdurationhandling; // Finished doing our draft.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1501,7 +1502,14 @@ static void K_UpdateDraft(player_t *player)
|
|||
{
|
||||
player->draftpower = 0;
|
||||
player->lastdraft = -1;
|
||||
player->roundconditions.continuousdraft = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
draftdurationhandling:
|
||||
player->roundconditions.continuousdraft++;
|
||||
if (player->roundconditions.continuousdraft > player->roundconditions.continuousdraft_best)
|
||||
player->roundconditions.continuousdraft_best = player->roundconditions.continuousdraft;
|
||||
}
|
||||
|
||||
void K_KartPainEnergyFling(player_t *player)
|
||||
|
|
|
|||
|
|
@ -1611,6 +1611,8 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
|||
|
||||
case UCRP_SPEEDOMETER:
|
||||
return (player->roundconditions.maxspeed >= cn->requirement);
|
||||
case UCRP_DRAFTDURATION:
|
||||
return (player->roundconditions.continuousdraft_best >= ((tic_t)cn->requirement)*TICRATE);
|
||||
|
||||
case UCRP_TRIGGER: // requires map trigger set
|
||||
return !!(player->roundconditions.unlocktriggers & (1 << cn->requirement));
|
||||
|
|
@ -2359,6 +2361,8 @@ static const char *M_GetConditionString(condition_t *cn)
|
|||
if (!gamedata->everseenspecial)
|
||||
return NULL;
|
||||
return "smash the UFO Catcher";
|
||||
case UCRP_CHASEDBYSPB:
|
||||
return "while chased by a Self-Propelled Bomb";
|
||||
|
||||
case UCRP_MAKERETIRE:
|
||||
{
|
||||
|
|
@ -2402,9 +2406,8 @@ static const char *M_GetConditionString(condition_t *cn)
|
|||
? "" : "at least",
|
||||
cn->requirement
|
||||
);
|
||||
|
||||
case UCRP_CHASEDBYSPB:
|
||||
return "while chased by a Self-Propelled Bomb";
|
||||
case UCRP_DRAFTDURATION:
|
||||
return va("consistently draft off other racers for %u seconds", cn->requirement);
|
||||
|
||||
case UCRP_TRIGGER:
|
||||
return "do something special";
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ typedef enum
|
|||
UCRP_RINGSEXACT, // == [rings]
|
||||
|
||||
UCRP_SPEEDOMETER, // >= [percentage]
|
||||
UCRP_DRAFTDURATION, // >= [time, seconds]
|
||||
|
||||
UCRP_TRIGGER, // Map execution trigger [id]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue