diff --git a/data/achievements.xml b/data/achievements.xml index feb017a98..551c882cc 100644 --- a/data/achievements.xml +++ b/data/achievements.xml @@ -29,5 +29,9 @@ title="Skid-row" description="Make 5 skidding in a single race"> + + + diff --git a/src/achievements/achievement_info.hpp b/src/achievements/achievement_info.hpp index 5e52989bf..21ac3bba2 100644 --- a/src/achievements/achievement_info.hpp +++ b/src/achievements/achievement_info.hpp @@ -33,7 +33,7 @@ class Achievement; -/** This is the base class for storing the definition of an achievement, e.g. +/** This is the base class for storing the definition of an achievement, e.g. * title, description (which is common for all achievements), but also how * to achieve this achievement. * \ingroup achievements @@ -47,13 +47,14 @@ public: ACHIEVE_STRIKE = 2, ACHIEVE_ARCH_ENEMY = 3, ACHIEVE_MARATHONER = 4, - ACHIEVE_SKIDDING = 5 + ACHIEVE_SKIDDING = 5, + ACHIEVE_POWERUP_LOVER = 6 }; - /** Achievement check type: + /** Achievement check type: * ALL_AT_LEAST: All goal values must be reached (or exceeded). * ONE_AT_LEAST: At least one current value reaches or exceedes the goal. */ - enum AchievementCheckType + enum AchievementCheckType { AC_ALL_AT_LEAST, AC_ONE_AT_LEAST diff --git a/src/items/powerup.cpp b/src/items/powerup.cpp index c86cc85cd..37652d70a 100644 --- a/src/items/powerup.cpp +++ b/src/items/powerup.cpp @@ -18,6 +18,9 @@ #include "items/powerup.hpp" +#include "achievements/achievement_info.hpp" +#include "config/player_manager.hpp" + #include "audio/sfx_base.hpp" #include "audio/sfx_manager.hpp" #include "config/stk_config.hpp" @@ -170,6 +173,10 @@ void Powerup::adjustSound() */ void Powerup::use() { + // The player gets an achievement point for using a powerup + if (m_type != PowerupManager::POWERUP_NOTHING && m_owner->getController()->isPlayerController()) + PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_POWERUP_LOVER, "poweruplover"); + // Play custom kart sound when collectible is used //TODO: what about the bubble gum? if (m_type != PowerupManager::POWERUP_NOTHING && m_type != PowerupManager::POWERUP_SWATTER && @@ -237,7 +244,7 @@ void Powerup::use() m_sound_use->play(); pos.setY(hit_point.getY()-0.05f); - + ItemManager::get()->newItem(Item::ITEM_BUBBLEGUM, pos, normal, m_owner); } else // if the kart is looking forward, use the bubblegum as a shield