Add a new achievement : Mosquito Hunter
This commit is contained in:
parent
949c16cfb0
commit
24944a810c
@ -51,5 +51,8 @@
|
||||
<achievement id="10" secret="yes" check-type="all-at-least" reset-type="race"
|
||||
name="It's secret" description="Really ... a secret.">
|
||||
</achievement>
|
||||
|
||||
<achievement id="11" check-type="all-at-least" reset-type="race"
|
||||
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>
|
||||
</achievements>
|
||||
|
@ -51,7 +51,8 @@ public:
|
||||
ACHIEVE_GOLD_DRIVER = 6,
|
||||
ACHIEVE_POWERUP_LOVER = 7,
|
||||
ACHIEVE_UNSTOPPABLE = 8,
|
||||
ACHIEVE_BANANA = 9
|
||||
ACHIEVE_BANANA = 9,
|
||||
ACHIEVE_MOSQUITO = 11
|
||||
};
|
||||
|
||||
/** Achievement check type:
|
||||
|
@ -25,10 +25,11 @@
|
||||
// TODO: move some constants to KartProperties, use all constants from KartProperties
|
||||
|
||||
#include "items/swatter.hpp"
|
||||
|
||||
#include "achievements/achievement_info.hpp"
|
||||
#include "audio/music_manager.hpp"
|
||||
#include "audio/sfx_base.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "graphics/explosion.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
@ -296,6 +297,15 @@ void Swatter::squashThingsAround()
|
||||
kart->setSquash(kp->getSquashDuration() * kart->getPlayerDifficulty()->getSquashDuration(),
|
||||
kp->getSquashSlowdown() * kart->getPlayerDifficulty()->getSquashSlowdown());
|
||||
|
||||
//Handle achievement if the swatter is used by the current player
|
||||
const StateManager::ActivePlayer *const ap = m_kart->getController()
|
||||
->getPlayer();
|
||||
if (ap && ap->getConstProfile() == PlayerManager::getCurrentPlayer())
|
||||
{
|
||||
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_MOSQUITO,
|
||||
"swatter", 1);
|
||||
}
|
||||
|
||||
if (kart->getAttachment()->getType()==Attachment::ATTACH_BOMB)
|
||||
{ // make bomb explode
|
||||
kart->getAttachment()->update(10000);
|
||||
|
Loading…
Reference in New Issue
Block a user