22 #include "challenges/challenge_data.hpp" 23 #include "race/race_manager.hpp" 25 #include <irrString.h> 37 const int CHALLENGE_POINTS[] = { 6, 7, 8, 10 };
38 const 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();
99 void grandPrixFinished ();
100 void save (
UTFWriter &out,
bool current_player=
false);
102 void setCurrentChallenge(
const std::string &challenge_id);
107 const std::vector<const ChallengeData*>
115 m_hard_challenges + m_best_challenges); }
118 int getNumReqMetInLowerDiff ()
const;
133 int getNumMediumTrophies()
const {
return m_medium_challenges; }
175 const ChallengeStatus *getCurrentChallengeStatus()
const {
return m_current_challenge; }
181 std::map<std::string, ChallengeStatus*>::const_iterator it =
182 m_challenges_state.find(
id);
183 assert(it!=m_challenges_state.end());
const ChallengeStatus * getChallengeStatus(const std::string &id) const
Returns a challenge given the challenge id.
Definition: story_mode_status.hpp:179
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
Difficulty
Game difficulty.
Definition: race_manager.hpp:229
utility class used to write wide (UTF-16 or UTF-32, depending of size of wchar_t) XML files ...
Definition: utf_writer.hpp:34
bool isFirstTime() const
Returns if this is the first time the intro is shown.
Definition: story_mode_status.hpp:145
int getNumCompletedChallenges() const
Returns the number of completed challenges.
Definition: story_mode_status.hpp:114
bool m_first_time
Set to false after the initial stuff (intro, select kart, etc.)
Definition: story_mode_status.hpp:69
void setFirstTime(bool ft)
Sets if this is the first time the intro is shown.
Definition: story_mode_status.hpp:142
Definition: three_d_animation.hpp:32
int getNumHardTrophies() const
Returns the number of fulfilled challenges at hard level.
Definition: story_mode_status.hpp:136
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
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 setSpeedrunFinished()
Sets if the player has finished a valid speedrun.
Definition: story_mode_status.hpp:154
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 clearUnlocked()
Clear the list of recently unlocked challenges.
Definition: story_mode_status.hpp:111
The state of a challenge for one player.
Definition: challenge_status.hpp:52
void setStoryModeTimer(int milliseconds)
Sets the story mode timer.
Definition: story_mode_status.hpp:160
const ChallengeStatus * m_current_challenge
A pointer to the current challenge, or NULL if no challenge is active.
Definition: story_mode_status.hpp:62
void setFinished()
Sets if the player has beaten Nolock.
Definition: story_mode_status.hpp:148
int getPointsBefore() const
Returns the number of points before the previous point increase.
Definition: story_mode_status.hpp:124
the description of one challenge
Definition: challenge_data.hpp:34
This class contains the progression through challenges for the story mode.
Definition: story_mode_status.hpp:48
bool isFinished() const
Returns if the player has beaten Nolock.
Definition: story_mode_status.hpp:151
utility class used to parse XML files
Definition: xml_node.hpp:47
const std::vector< const ChallengeData * > getRecentlyCompletedChallenges()
Returns the list of recently unlocked features (e.g.
Definition: story_mode_status.hpp:108
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
bool isSpeedrunFinished() const
Returns if the player has finished a valid speedrun.
Definition: story_mode_status.hpp:157
int getNumBestTrophies() const
Returns the number of fulfilled challenges at best level.
Definition: story_mode_status.hpp:139
int getPoints() const
Returns the number of points accumulated.
Definition: story_mode_status.hpp:121
int getNextUnlockPoints() const
Returns the number of points needed by the next unlockable.
Definition: story_mode_status.hpp:127