Add a new Beyond Luck achievement ; make Unstoppable more challenging.

This commit is contained in:
Alayan 2018-10-02 01:43:13 +02:00 committed by auriamg
parent 70eb11de4f
commit 69ee99c495
3 changed files with 18 additions and 5 deletions

View File

@ -41,7 +41,7 @@
<skidding goal="5"/>
</achievement>
<achievement id="6" check-type="all-at-least" reset-type="never"
name="Gold driver" description="Win against at least 3 opponents in all single player modes.">
name="Gold driver" description="Win against at least 3 AIs in normal race, time-trial, and follow the leader.">
<standard goal="1"/>
<std_timetrial goal="1"/>
<follow_leader goal="1"/>
@ -51,7 +51,7 @@
<poweruplover goal="10"/>
</achievement>
<achievement id="8" check-type="all-at-least" reset-type="never"
name="Unstoppable" description="Win 5 single races in a row.">
name="Beyond Luck" description="Win 5 single races in a row against at least 3 AIs.">
<wins goal="5"/>
</achievement>
<achievement id="9" check-type="all-at-least" reset-type="race"
@ -65,4 +65,8 @@
name="Mosquito Hunter" description="Take your opponents for mosquitos! With the swatter, squash at least 5 of them in a race.">
<swatter goal="5"/>
</achievement>
<achievement id="12" check-type="all-at-least" reset-type="never"
name="Unstoppable" description="Win 10 single races in a row in Expert or SuperTux against at least 5 AIs.">
<wins goal="10"/>
</achievement>
</achievements>

View File

@ -40,6 +40,7 @@ class Achievement;
class AchievementInfo
{
public:
//FIXME : try to get rid of this list
/** Some handy names for the various achievements. */
enum { ACHIEVE_COLUMBUS = 1,
ACHIEVE_FIRST = ACHIEVE_COLUMBUS,
@ -49,9 +50,10 @@ public:
ACHIEVE_SKIDDING = 5,
ACHIEVE_GOLD_DRIVER = 6,
ACHIEVE_POWERUP_LOVER = 7,
ACHIEVE_UNSTOPPABLE = 8,
ACHIEVE_BEYOND_LUCK = 8,
ACHIEVE_BANANA = 9,
ACHIEVE_MOSQUITO = 11
ACHIEVE_MOSQUITO = 11,
ACHIEVE_UNSTOPPABLE = 12
};
/** Achievement check type:

View File

@ -197,11 +197,18 @@ void AchievementsStatus::updateAchievementsProgress(unsigned int achieve_data_id
{
Achievement *gold_driver = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_GOLD_DRIVER);
Achievement *unstoppable = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_UNSTOPPABLE);
Achievement *beyond_luck = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_BEYOND_LUCK);
if (!beyond_luck->isAchieved())
{
beyond_luck->reset();
beyond_luck->increase("wins", "wins", m_variables[ACHIEVE_CONS_WON_RACES].counter);
}
if (!unstoppable->isAchieved())
{
unstoppable->reset();
unstoppable->increase("wins", "wins", m_variables[ACHIEVE_CONS_WON_RACES].counter);
unstoppable->increase("wins", "wins", m_variables[ACHIEVE_CONS_WON_RACES_HARD].counter);
}
if (!gold_driver->isAchieved())