19#ifndef HEADER_CHALLENGE_DATA_HPP
20#define HEADER_CHALLENGE_DATA_HPP
28#include "race/race_manager.hpp"
64 irr::core::stringw m_user_name;
67 const irr::core::stringw getUnlockedMessage()
const;
91 SPECIAL_MAX_REQ_IN_LOWER_DIFF
105 int m_position[RaceManager::DIFFICULTY_COUNT];
106 int m_default_num_karts[RaceManager::DIFFICULTY_COUNT];
107 std::string m_ai_kart_ident[RaceManager::DIFFICULTY_COUNT];
108 std::string m_replay_files[RaceManager::DIFFICULTY_COUNT];
109 float m_time[RaceManager::DIFFICULTY_COUNT];
110 int m_energy[RaceManager::DIFFICULTY_COUNT];
113 std::string m_track_id;
114 std::string m_filename;
117 bool m_is_unlock_list;
118 bool m_is_ghost_replay;
122 void error(
const char *
id)
const;
138 int m_unlock_special_value;
148 virtual void check()
const;
152 void addUnlockModeReward(
const std::string &internal_mode_name,
153 const irr::core::stringw &user_mode_name);
154 void addUnlockGPReward(
const std::string &gp_name);
155 void addUnlockDifficultyReward(
const std::string &internal_name,
156 const irr::core::stringw &user_name);
157 void addUnlockKartReward(
const std::string &internal_name,
158 const irr::core::stringw &user_name);
167 const std::vector<UnlockableFeature>&
182 assert(
m_mode==CM_SINGLE_RACE);
190 assert(
m_mode==CM_GRAND_PRIX);
198 assert(
m_mode==CM_SINGLE_RACE);
245 return m_position[difficulty];
253 return m_default_num_karts[difficulty];
260 return m_time[difficulty];
267 return m_energy[difficulty];
274 return m_ai_kart_ident[difficulty];
Definition: challenge_data.hpp:60
the description of one challenge
Definition: challenge_data.hpp:35
float getTimeRequirement(RaceManager::Difficulty difficulty) const
Returns the maximum time in which the kart must finish.
Definition: challenge_data.hpp:258
int getVersion() const
Returns the version number of this challenge.
Definition: challenge_data.hpp:162
void setChallengeId(const std::string &s)
Sets the id of this challenge.
Definition: challenge_data.hpp:176
bool getReverse() const
Return reverse mode.
Definition: challenge_data.hpp:204
RaceManager::MinorRaceModeType m_minor
The minor type, used when m_mode is CM_GP or CM_RACE only.
Definition: challenge_data.hpp:101
const std::string & getTrackId() const
Returns the track associated with this challenge.
Definition: challenge_data.hpp:180
int getNumTrophies() const
Get number of required trophies to start this challenge.
Definition: challenge_data.hpp:207
SpecialUnlockType getSpecialType() const
Returns the special unlock list value.
Definition: challenge_data.hpp:225
ChallengeModeType m_mode
The challenge mode of this challenge.
Definition: challenge_data.hpp:98
bool isUnlockList() const
Returns if this challenge is an unlock list.
Definition: challenge_data.hpp:222
const irr::core::stringw getChallengeDescription() const
Returns the description of this challenge.
Definition: challenge_data.cpp:293
void setUnlocks(const std::string &id, ChallengeData::RewardType reward)
Adds all rewards for fulfilling this challenge.
Definition: challenge_data.cpp:380
std::vector< UnlockableFeature > m_feature
Features to unlock.
Definition: challenge_data.hpp:128
std::string m_id
Short, internal name for this challenge.
Definition: challenge_data.hpp:125
int m_version
Version number of the challenge.
Definition: challenge_data.hpp:116
int getEnergy(RaceManager::Difficulty difficulty) const
Return the energy that a kart must at least have at the end of a race.
Definition: challenge_data.hpp:265
virtual void check() const
Checks if this challenge is valid, i.e.
Definition: challenge_data.cpp:346
int getMaxPosition(RaceManager::Difficulty difficulty) const
Returns the maximum position the player must have in order to win.
Definition: challenge_data.hpp:243
int getNumKarts(RaceManager::Difficulty difficulty) const
Returns the number of karts to use.
Definition: challenge_data.hpp:251
RewardType
The type of reward you get when fulfilling this challenge.
Definition: challenge_data.hpp:40
const std::vector< UnlockableFeature > & getFeatures() const
Returns the list of unlockable features for this challenge.
Definition: challenge_data.hpp:168
int m_num_completed_challenges
Number of completed challenges required to access this challenge (esp.
Definition: challenge_data.hpp:134
bool isSingleRace() const
Returns if this challenge is a grand prix.
Definition: challenge_data.hpp:216
SpecialUnlockType m_unlock_special_type
Variables only used by unlock lists.
Definition: challenge_data.hpp:137
RaceManager::MinorRaceModeType getMinorMode() const
Returns the minor mode of this challenge.
Definition: challenge_data.hpp:234
int getNumLaps() const
Return number of laps.
Definition: challenge_data.hpp:196
const std::string & getAIKartIdent(RaceManager::Difficulty difficulty) const
Returns the name of the AI to use (used for boss challenge).
Definition: challenge_data.hpp:272
int m_num_trophies
Number of trophies required to access this challenge.
Definition: challenge_data.hpp:131
virtual GPLevel isGPFulfilled() const
Returns true if this GP challenge is fulfilled.
Definition: challenge_data.cpp:557
void addUnlockTrackReward(const std::string &track_name)
Sets that the given track will be unlocked if this challenge is unlocked.
Definition: challenge_data.cpp:642
GPLevel
The level of completion of a GP challenge.
Definition: challenge_data.hpp:51
int getSpecialValue() const
Returns the special unlock list value.
Definition: challenge_data.hpp:228
ChallengeModeType getMode() const
Returns the challenge mode of this challenge.
Definition: challenge_data.hpp:231
bool isGhostReplay() const
Returns if this challenge is using ghost replay.
Definition: challenge_data.hpp:219
virtual bool isChallengeFulfilled(bool check_best=false) const
Returns true if this (non-GP) challenge is fulfilled.
Definition: challenge_data.cpp:490
ChallengeModeType
The various types of challenges that we support, which esp.
Definition: challenge_data.hpp:81
int getNumChallenges() const
Get number of required completed challenges to start this challenge.
Definition: challenge_data.hpp:210
const std::string & getGPId() const
Returns the id of the grand prix associated with this challenge.
Definition: challenge_data.hpp:188
SpecialUnlockType
The type of value stored by m_unlock_special_value.
Definition: challenge_data.hpp:89
void setRace(RaceManager::Difficulty d) const
sets the right parameters in RaceManager to try this challenge
Definition: challenge_data.cpp:422
const std::string & getChallengeId() const
Returns the id of the challenge.
Definition: challenge_data.hpp:172
bool isGrandPrix() const
Returns if this challenge is a grand prix.
Definition: challenge_data.hpp:213
MinorRaceModeType
Minor variants to the major types of race.
Definition: race_manager.hpp:110
AISuperPower
True if the AI should have additional abbilities, e.g.
Definition: race_manager.hpp:134
Difficulty
Game difficulty.
Definition: race_manager.hpp:230