diff --git a/src/d_player.h b/src/d_player.h index afe193528..d17d84868 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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]; diff --git a/src/deh_soc.c b/src/deh_soc.c index 4f47e1480..e1d147f8c 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -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); diff --git a/src/m_cond.c b/src/m_cond.c index a0ac581be..a621c6704 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -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"; diff --git a/src/m_cond.h b/src/m_cond.h index d78ea4791..989a7a3ff 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -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) diff --git a/src/p_inter.c b/src/p_inter.c index ffcb5c647..6e965b542 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -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