22#include "challenges/challenge_data.hpp"
23#include "race/race_manager.hpp"
37const int CHALLENGE_POINTS[] = { 6, 7, 8, 10 };
38const int GP_FACTOR = 3;
58 std::map<std::string, ChallengeStatus*> m_challenges_state;
66 int m_next_unlock_points;
71 int m_easy_challenges;
72 int m_medium_challenges;
73 int m_hard_challenges;
74 int m_best_challenges;
77 bool m_story_mode_finished;
81 bool m_valid_speedrun_finished;
84 int m_story_mode_milliseconds;
85 int m_speedrun_milliseconds;
92 void computeActive (
bool first_call=
false);
93 bool isLocked (
const std::string& feature);
94 void unlockFeatureByList();
107 const std::vector<const ChallengeData*>
115 m_hard_challenges + m_best_challenges); }
133 int getNumMediumTrophies()
const {
return m_medium_challenges; }
181 std::map<std::string, ChallengeStatus*>::const_iterator it =
182 m_challenges_state.find(
id);
183 assert(it!=m_challenges_state.end());
the description of one challenge
Definition: challenge_data.hpp:35
The state of a challenge for one player.
Definition: challenge_status.hpp:53
Difficulty
Game difficulty.
Definition: race_manager.hpp:230
This class contains the progression through challenges for the story mode.
Definition: story_mode_status.hpp:49
int getNumCompletedChallenges() const
Returns the number of completed challenges.
Definition: story_mode_status.hpp:114
void setCurrentChallenge(const std::string &challenge_id)
Set the current challenge (or NULL if no challenge is done).
Definition: story_mode_status.cpp:265
void unlockFeature(ChallengeStatus *c, RaceManager::Difficulty d, bool do_save=true)
Unlocks a feature.
Definition: story_mode_status.cpp:247
std::map< std::string, bool > m_locked_features
Contains whether each feature of the challenge is locked or unlocked.
Definition: story_mode_status.hpp:52
void grandPrixFinished()
This is called when a GP is finished.
Definition: story_mode_status.cpp:305
int getNumBestTrophies() const
Returns the number of fulfilled challenges at best level.
Definition: story_mode_status.hpp:139
void setSpeedrunTimer(int milliseconds)
Sets the story mode timer.
Definition: story_mode_status.hpp:168
int getNumEasyTrophies() const
Returns the number of fulfilled challenges at easy level.
Definition: story_mode_status.hpp:130
void setSpeedrunFinished()
Sets if the player has finished a valid speedrun.
Definition: story_mode_status.hpp:154
int getNumHardTrophies() const
Returns the number of fulfilled challenges at hard level.
Definition: story_mode_status.hpp:136
int getNumReqMetInLowerDiff() const
Returns the number of challenges with the superTux time beaten in a lower difficulty.
Definition: story_mode_status.cpp:384
bool isFirstTime() const
Returns if this is the first time the intro is shown.
Definition: story_mode_status.hpp:145
void addStatus(ChallengeStatus *cs)
Adds a ChallengeStatus with the specified id to the set of all statuses of this object.
Definition: story_mode_status.cpp:89
bool m_first_time
Set to false after the initial stuff (intro, select kart, etc.)
Definition: story_mode_status.hpp:69
int getSpeedrunTimer()
Gets the speedrun timer This is designed to be used on loading and once story mode is completed ; it ...
Definition: story_mode_status.hpp:173
const ChallengeStatus * m_current_challenge
A pointer to the current challenge, or NULL if no challenge is active.
Definition: story_mode_status.hpp:62
int getNextUnlockPoints() const
Returns the number of points needed by the next unlockable.
Definition: story_mode_status.hpp:127
std::vector< const ChallengeData * > m_unlocked_features
Recently unlocked features (they are waiting here until they are shown to the user)
Definition: story_mode_status.hpp:56
void setFirstTime(bool ft)
Sets if this is the first time the intro is shown.
Definition: story_mode_status.hpp:142
int getStoryModeTimer()
Gets the story mode timer This is designed to be used on loading and once story mode is completed ; i...
Definition: story_mode_status.hpp:165
int getPoints() const
Returns the number of points accumulated.
Definition: story_mode_status.hpp:121
void raceFinished()
This is called when a race is finished.
Definition: story_mode_status.cpp:275
const std::vector< const ChallengeData * > getRecentlyCompletedChallenges()
Returns the list of recently unlocked features (e.g.
Definition: story_mode_status.hpp:108
int getPointsBefore() const
Returns the number of points before the previous point increase.
Definition: story_mode_status.hpp:124
bool isFinished() const
Returns if the player has beaten Nolock.
Definition: story_mode_status.hpp:151
void clearUnlocked()
Clear the list of recently unlocked challenges.
Definition: story_mode_status.hpp:111
const ChallengeStatus * getChallengeStatus(const std::string &id) const
Returns a challenge given the challenge id.
Definition: story_mode_status.hpp:179
void save(UTFWriter &out, bool current_player=false)
Writes the data of this StoryModeStatus to the specified stream.
Definition: story_mode_status.cpp:344
void setFinished()
Sets if the player has beaten Nolock.
Definition: story_mode_status.hpp:148
bool isSpeedrunFinished() const
Returns if the player has finished a valid speedrun
Definition: story_mode_status.hpp:157
void setStoryModeTimer(int milliseconds)
Sets the story mode timer.
Definition: story_mode_status.hpp:160
utility class used to write wide (UTF-16 or UTF-32, depending of size of wchar_t) XML files
Definition: utf_writer.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48