115 void GetClearedSongs(
int nSkillLevel,
const char *pszGroup, std::vector<bool> *pCleared);
348 int GetMedal(
const char *pszSong,
int nSkillLevel);
421 mPassword = pszPassword;
431 mNameLocked = nNameLocked;
482 void AddRecord(
const SongStats *pRecord);
486 void UpdateUnlocks(std::vector<UnlockableItem> *pUnlocks,
int nSkillLevel);
493 std::vector<UnlockableItem> *pUnlocks);
497 bool CheckCondition(
DataArray *pCondition,
int nSkillLevel);
501 bool CheckBeatNum(
int nCount,
int nSkillLevel);
505 void ParseFilter(
DataArray *pFilter,
int nSkillLevel, std::vector<const char *> *pSongs);
509 void BuildFiltered(
int nType,
510 const char *pszArena,
512 std::vector<const char *> *pSongs);
517 ExceptType(
int nType,
const char *pszArena,
int nSkillLevel, std::vector<const char *> *pSongs);
521 void ExceptTwoTypes(
int nType,
523 const char *pszArena,
525 std::vector<const char *> *pSongs);
529 void FromList(
DataArray *pList,
int nSkillLevel, std::vector<const char *> *pSongs);
533 bool CheckAllBeaten(
const std::vector<const char *> *pSongs,
int nSkillLevel);
537 bool CheckScoreTotal(
const std::vector<const char *> *pSongs,
int nSkillLevel,
int nTotal);
541 void RecordUnlock(
int nKind,
544 std::vector<UnlockableItem> *pUnlocks);
548 void ApplyUnlockNode(
DataArray *pNode,
int nSkillLevel, std::vector<UnlockableItem> *pUnlocks);
552 void PrefabUnlock(
DataArray *pNode, std::vector<UnlockableItem> *pUnlocks);
556 void ExpandPrefab(
const char *pszPrefab, std::vector<UnlockableItem> *pUnlocks);
560 void RecordPrefabPart(
DataArray *pPart, std::vector<UnlockableItem> *pUnlocks);
563 int GetFlagBit(
int nFlag);
566 void SetFlagBit(
int nFlag);
570 int GetPowerupBit(
const char *pszPowerup);
572 std::vector<const char *> mUnlocks;
574 std::vector<std::vector<const char *>> mSkillUnlocks;
576 std::vector<unsigned char> mPassedEntries;
581 std::vector<SongStats> mRecords;
585 const char *mPendingPowerup;
587 std::vector<const char *> mLastUnlocks;
588 unsigned char mFlags;
BinStream & operator>>(BinStream &stream, Campaign &profile)
Read a profile from a stream.
unsigned int g_dwUnlockAllSongs
Non-zero when every song counts as unlocked and finished.
unsigned int g_dwUnlockAllParts
Non-zero when every avatar part and emblem counts as unlocked.
BinStream & operator<<(BinStream &stream, const Campaign &profile)
Write a profile to a stream.
Parts and colours of a player's avatar, the Freq the Freq maker edits.
Definition avatarpartset.h:23
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Saved settings and progress of one player, among them the controller bindings.
Definition campaign.h:20
int GetArenaScoreToBeat(const char *pszArena, int nSkillLevel)
Report the arena score to beat, from the arena_scores of the "db" section.
Flag
Bits of mFlags.
Definition campaign.h:23
@ kFlagFreestyle
Definition campaign.h:27
@ kFlagNone
Definition campaign.h:29
@ kFlagMultiplier
Definition campaign.h:25
@ kFlagFreestyleTip
Definition campaign.h:28
@ kFlagSlowdown
Definition campaign.h:26
@ kFlagAutocatcher
Definition campaign.h:24
int GetCustom() const
Definition campaign.h:445
void SetNameLocked(int nNameLocked)
Definition campaign.h:430
void GetClearedSongs(int nSkillLevel, const char *pszGroup, std::vector< bool > *pCleared)
Report which songs of a group the player has cleared at a skill level.
static void UnlockAllParts()
Count every avatar part and emblem as unlocked for every profile.
Campaign & operator=(const Campaign &other)
Copy another profile into this one.
int HasSeenFreestyleTip()
Report whether the tip about the freestyle lap has shown.
void SetInputMap(const InputMap *pMap)
Replace the controller bindings and mark the profile modified.
const AvatarPartSet & GetAvatar() const
Definition campaign.h:465
const DateTime & GetBorn() const
Definition campaign.h:455
int GetNameLocked() const
Definition campaign.h:425
const String & GetPassword() const
Definition campaign.h:415
void SetAvatar(const AvatarPartSet &avatar)
Definition campaign.h:475
~Campaign()
Destroy the profile.
bool IsSongFinished(const char *pszSong, int nSkillLevel)
Report whether a song was finished at a skill level.
const char * TakePendingPowerup(int nSkillLevel)
Grant the power-up of mPendingPowerup once it is unlocked at a skill level, and clear it.
static void UnlockAllSongs()
Count every song as unlocked for every profile, by setting g_dwUnlockAllSongs.
void SetSoloOption(int nOption)
Record the display option for the solo game and mark the profile changed.
int IsModified() const
Report mModified.
AvatarPartSet & GetAvatar()
Definition campaign.h:470
bool CompletesTier(const char *pszSong, int nSkillLevel)
Report whether a song is the one song of its campaign tier the player has not yet won.
InputMap * GetInputMap()
Report the controller bindings.
void GetSongStats(const char *pszSong, int nSkillLevel, SongStats *pRecord)
Copy the record of a song at a skill level.
void SetOnlineOption(int nOption)
Record the display option for the online game.
int GetSoloOption() const
Report the display option the player chose for the solo game.
const String & GetName() const
Definition campaign.h:435
void Save(BinStream &stream) const
Write the profile, at version 6.
const char * FindFirstUnfinishedSong(int nSkillLevel)
Report the first song of the unlocked arenas the player has not finished at a skill level.
void GetUnlockedParts(int nPart, std::vector< const char * > *pTypes)
List the choices of an avatar part the player may use.
void GetUnlockedEmblems(std::vector< const char * > *pTypes)
List the emblems the player may use.
int GetHighestBeatenSkillLevel()
Report the highest skill level at which the player has beaten the game.
void SetModified(int nModified)
Set mModified.
bool HasBeatenGame(int nSkillLevel)
Report whether the player has beaten the game at a skill level, the symbol beat_game among the unlock...
bool IsUnlocked(const char *pszItem, int nSkillLevel)
Report whether the player has unlocked an item at a skill level.
Medal
Values of GetMedal() and GetMedalForScore(), one more than the goals of the score_goal of the song a ...
Definition campaign.h:36
@ kMedalFinished
Definition campaign.h:38
@ kMedalNone
Definition campaign.h:37
@ kMedalSecond
Definition campaign.h:40
@ kMedalFirst
Definition campaign.h:39
@ kMedalThird
Definition campaign.h:41
void SetPassword(const char *pszPassword)
Definition campaign.h:420
Campaign(const Campaign &other)
Copy a profile.
int GetMedalForScore(const char *pszSong, int nSkillLevel, int nScore, int nPercent)
Report the medal a score earns on a song at a skill level.
void SetCustom(int nCustom)
Definition campaign.h:450
void SetName(const char *pszName)
Definition campaign.h:440
void Load(BinStream &stream)
Read a profile Save() wrote, and rebuild the unlocks from the records.
int GetMedal(const char *pszSong, int nSkillLevel)
Report the medal of a song at a skill level.
void RemoveLockedItems(std::vector< const char * > *pItems)
Remove the items the player has not unlocked at any skill level from a list.
int GetOnlineOption() const
Report the display option the player chose for the online game.
Campaign()
Construct a profile with the default settings and the unlocks of the always entries.
void SetSeenFreestyleTip()
Record that the tip about the freestyle lap has shown.
void RecordResult(const SongStats *pRecord, std::vector< UnlockableItem > *pUnlocks)
Record the result of a song and collect the items it unlocks.
DateTime & GetBorn()
Definition campaign.h:460
int GetArenaScore(const char *pszArena, int nSkillLevel)
Report the sum of the best scores of the songs of an arena.
Reference-counted array of script data nodes.
Definition dataarray.h:20
Local date and time of the console clock.
Definition datetime.h:14
Best result of one player on one song at one skill level, as Campaign stores it.
Definition songstats.h:11
Growable text buffer that is also a PrnStream.
Definition string.h:19