Make Skid-Row use a generic counter
This commit is contained in:
parent
09f5376312
commit
5405933e2e
@ -234,6 +234,14 @@ void AchievementsStatus::updateAchievementsProgress(unsigned int achieve_data_id
|
||||
banana_lover->reset();
|
||||
banana_lover->increase("banana", "banana", m_variables[ACHIEVE_BANANA_1RACE].counter);
|
||||
}
|
||||
|
||||
Achievement *skidding = PlayerManager::getCurrentAchievementsStatus()->getAchievement(AchievementInfo::ACHIEVE_SKIDDING);
|
||||
|
||||
if (!skidding->isAchieved())
|
||||
{
|
||||
skidding->reset();
|
||||
skidding->increase("skidding", "skidding", m_variables[ACHIEVE_SKIDDING_1LAP].counter);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -282,6 +290,7 @@ void AchievementsStatus::onRaceEnd(bool aborted)
|
||||
|
||||
m_variables[ACHIEVE_POWERUP_USED_1RACE].counter = 0;
|
||||
m_variables[ACHIEVE_BANANA_1RACE].counter = 0;
|
||||
m_variables[ACHIEVE_SKIDDING_1RACE].counter = 0;
|
||||
|
||||
// Prevent restart from being abused to get consecutive wins achievement
|
||||
if (aborted)
|
||||
@ -299,4 +308,6 @@ void AchievementsStatus::onLapEnd()
|
||||
for (iter = m_achievements.begin(); iter != m_achievements.end(); ++iter) {
|
||||
iter->second->onLapEnd();
|
||||
}
|
||||
|
||||
m_variables[ACHIEVE_SKIDDING_1LAP].counter = 0;
|
||||
} // onLapEnd
|
||||
|
@ -61,8 +61,12 @@ public :
|
||||
// Count the number of bananas hit
|
||||
ACHIEVE_BANANA = 8,
|
||||
ACHIEVE_BANANA_1RACE = 9,
|
||||
// Count how many times the player skidded
|
||||
ACHIEVE_SKIDDING_1LAP = 10,
|
||||
ACHIEVE_SKIDDING_1RACE = 11,
|
||||
ACHIEVE_SKIDDING = 12,
|
||||
|
||||
ACHIEVE_DATA_NUM = 10
|
||||
ACHIEVE_DATA_NUM = 13
|
||||
};
|
||||
|
||||
private:
|
||||
|
@ -21,7 +21,7 @@
|
||||
#ifdef SKID_DEBUG
|
||||
# include "graphics/show_curve.hpp"
|
||||
#endif
|
||||
#include "achievements/achievement_info.hpp"
|
||||
#include "achievements/achievements_status.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "karts/kart.hpp"
|
||||
#include "karts/kart_gfx.hpp"
|
||||
@ -516,7 +516,11 @@ void Skidding::update(int ticks, bool is_on_ground,
|
||||
if (m_kart->getController()->canGetAchievements())
|
||||
{
|
||||
PlayerManager::increaseAchievement(
|
||||
AchievementInfo::ACHIEVE_SKIDDING, "skidding");
|
||||
AchievementsStatus::ACHIEVE_SKIDDING_1LAP, 1);
|
||||
PlayerManager::increaseAchievement(
|
||||
AchievementsStatus::ACHIEVE_SKIDDING_1RACE, 1);
|
||||
PlayerManager::increaseAchievement(
|
||||
AchievementsStatus::ACHIEVE_SKIDDING, 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user