Add 5s to the FTL countdown when the leader is hit by a flyable

This commit is contained in:
Alayan 2018-10-12 18:18:23 +02:00
parent 2e6b7fd8ac
commit 089f6d108e
2 changed files with 15 additions and 0 deletions

View File

@ -221,6 +221,20 @@ bool FollowTheLeaderRace::isRaceOver()
}
} // isRaceOver
//-----------------------------------------------------------------------------
/** If the leader kart is hit, increase the delay to the next elimination */
bool FollowTheLeaderRace::kartHit(int kart_id, int hitter)
{
if (kart_id == 0)
{
int countdown = getTimeTicks();
countdown += stk_config->time2Ticks(5.0f);
setTicks(countdown);
}
return false;
}
//-----------------------------------------------------------------------------
/** Called at the end of a race. Updates highscores, pauses the game, and
* informs the unlock manager about the finished race. This function must

View File

@ -54,6 +54,7 @@ public:
virtual void init() OVERRIDE;
virtual void terminateRace() OVERRIDE;
virtual bool isRaceOver() OVERRIDE;
virtual bool kartHit(int kart_id, int hitter = -1) OVERRIDE;
// ------------------------------------------------------------------------
/** Returns if this type of race has laps. */
virtual bool raceHasLaps() OVERRIDE { return false; }