UCRP_HITDRAFTERLOOKBACK

"hit a racer drafting off you while looking back at them"
Self-explanatory set of conditions
Wrote a commented out more compicated check for valid angles between player and target, but lastdraft probably is good enough for these purpses
This commit is contained in:
toaster 2023-10-18 02:05:12 +01:00
parent 065fc0b89c
commit 83acdaa0cf
5 changed files with 17 additions and 0 deletions

View file

@ -418,6 +418,7 @@ struct roundconditions_t
boolean spb_neuter;
boolean landmine_dunk;
boolean hit_midair;
boolean hit_drafter_lookback;
boolean returntosender_mark;
UINT8 hittrackhazard[((MAX_LAPS+1)/8) + 1];

View file

@ -2997,6 +2997,7 @@ static void readcondition(UINT16 set, UINT32 id, char *word2)
|| (++offset && fastcmp(params[0], "SPBNEUTER"))
|| (++offset && fastcmp(params[0], "LANDMINEDUNK"))
|| (++offset && fastcmp(params[0], "HITMIDAIR"))
|| (++offset && fastcmp(params[0], "HITDRAFTERLOOKBACK"))
|| (++offset && fastcmp(params[0], "RETURNMARKTOSENDER")))
{
//PARAMCHECK(1);

View file

@ -1642,6 +1642,8 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
return (player->roundconditions.landmine_dunk);
case UCRP_HITMIDAIR:
return (player->roundconditions.hit_midair);
case UCRP_HITDRAFTERLOOKBACK:
return (player->roundconditions.hit_drafter_lookback);
case UCRP_RETURNMARKTOSENDER:
return (player->roundconditions.returntosender_mark);
@ -2428,6 +2430,8 @@ static const char *M_GetConditionString(condition_t *cn)
return "dunk a Land Mine on another racer's head";
case UCRP_HITMIDAIR:
return "hit another racer with a projectile while you're both in the air";
case UCRP_HITDRAFTERLOOKBACK:
return "hit a racer drafting off you while looking back at them";
case UCRP_RETURNMARKTOSENDER:
return "when cursed with Eggmark, blow up the racer responsible";

View file

@ -129,6 +129,7 @@ typedef enum
UCRP_SPBNEUTER, // Kill an SPB with Lightning
UCRP_LANDMINEDUNK, // huh? you died? that's weird. all i did was try to hug you...
UCRP_HITMIDAIR, // Hit another player mid-air with a kartfielditem
UCRP_HITDRAFTERLOOKBACK, // Hit a player that's behind you, while looking back at them, and they're drafting off you
UCRP_RETURNMARKTOSENDER, // Hit the player responsible for Eggman Marking you with that explosion
UCRP_TRACKHAZARD, // (Don't) get hit by a track hazard (maybe specific lap)

View file

@ -2699,6 +2699,16 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
source->player->roundconditions.checkthisframe = true;
}
if (source->player->roundconditions.hit_drafter_lookback == false
&& source != target
&& target->player->lastdraft == (source->player - players)
&& (K_GetKartButtons(source->player) & BT_LOOKBACK) == BT_LOOKBACK
/*&& (AngleDelta(K_MomentumAngle(source), R_PointToAngle2(source->x, source->y, target->x, target->y)) > ANGLE_90)*/)
{
source->player->roundconditions.hit_drafter_lookback = true;
source->player->roundconditions.checkthisframe = true;
}
if (source == target
&& !P_MobjWasRemoved(inflictor)
&& inflictor->type == MT_SPBEXPLOSION