Merge branch 'master' of https://github.com/whichrakesh/stk-code into whichrakesh-master

Fix counting of bananas only for current player. Fixed conflicts.
Conflicts:
	src/achievements/achievement_info.hpp
This commit is contained in:
hiker 2014-04-22 17:20:40 +10:00
commit 2e3adee1a2
5 changed files with 28 additions and 15 deletions

BIN
data/.achievements.xml.swp Normal file

Binary file not shown.

View File

@ -18,15 +18,15 @@
<ball goal="10"/>
</achievement>
<achievement id="3" check-type="one-at-least" reset-type="race"
title="Arch Enemy" description="Hit the same kart at least 5 times in one race">
title="Arch Enemy" description="Hit the same kart at least 5 times in one race.">
<hit goal="5"/>
</achievement>
<achievement id="4" check-type="all-at-least" reset-type="race"
title="Marathoner" description="Make a race with 5 laps or more">
title="Marathoner" description="Make a race with 5 laps or more.">
<laps goal="5"/>
</achievement>
<achievement id="5" check-type="all-at-least" reset-type="lap"
title="Skid-row" description="Make 5 skidding in a single lap">
title="Skid-row" description="Make 5 skidding in a single lap.">
<skidding goal="5"/>
</achievement>
<achievement id="6" check-type="all-at-least" reset-type="never"
@ -37,11 +37,15 @@
<opponents goal="3"/>
</achievement>
<achievement id="7" check-type="all-at-least" reset-type="race"
title="Powerup Love" description="Use 10 or more powerups in a race">
title="Powerup Love" description="Use 10 or more powerups in a race.">
<poweruplover goal="10"/>
</achievement>
<achievement id="8" check-type="all-at-least" reset-type="never"
title="Unstoppable" description="Win 5 single races in a row">
title="Unstoppable" description="Win 5 single races in a row.">
<wins goal="5"/>
</achievement>
<achievement id="9" check-type="all-at-least" reset-after-race="yes"
title="Banana Lover" description="Collect at least 5 bananas in one race.">
<banana goal="5"/>
</achievement>
</achievements>

View File

@ -147,7 +147,7 @@ bool AchievementInfo::checkCompletion(Achievement * achievement) const
return false;
}
default:
Log::fatal("AchievementInfo", "Missing check for tpye %d.",
Log::fatal("AchievementInfo", "Missing check for type %d.",
m_check_type);
} // switch

View File

@ -50,8 +50,10 @@ public:
ACHIEVE_SKIDDING = 5,
ACHIEVE_GOLD_DRIVER = 6,
ACHIEVE_POWERUP_LOVER = 7,
ACHIEVE_UNSTOPPABLE = 8
ACHIEVE_UNSTOPPABLE = 8,
ACHIEVE_BANANA = 9
};
/** 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.

View File

@ -19,7 +19,9 @@
#include "items/attachment.hpp"
#include <algorithm>
#include "achievements/achievement_info.hpp"
#include "audio/sfx_base.hpp"
#include "config/player_manager.hpp"
#include "config/stk_config.hpp"
#include "config/user_config.hpp"
#include "graphics/explosion.hpp"
@ -223,6 +225,11 @@ void Attachment::clear()
*/
void Attachment::hitBanana(Item *item, int new_attachment)
{
const StateManager::ActivePlayer *const ap = m_kart->getController()
->getPlayer();
if(ap && ap->getConstProfile()==PlayerManager::getCurrentPlayer())
PlayerManager::increaseAchievement(AchievementInfo::ACHIEVE_BANANA,
"banana",1 );
//Bubble gum shield effect:
if(m_type == ATTACH_BUBBLEGUM_SHIELD ||
m_type == ATTACH_NOLOK_BUBBLEGUM_SHIELD)