Revamped the unlock system. Currently it supports the following methods:
DP - dance points, what Miryokuteki had in place AP - arcade points, like MAX2 arcade SP - song points, like MAX2 home (though I don't know the exact system) CS - clear stages, like 5th home Somewhat strewn but not supported yet: !! - Toastys seen EC - cleared extra stages EF - fail extra stage (don't quote me on these two yet, I haven't tried them yet) RO - roulette (theres fifteen roulette slots, but its not implemented yet) Also updated the INI to store values for these means of unlocking. The system still isn't "optimized" yet, though.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#ifndef UNLOCK_SYSTEM_H
|
||||
#define UNLOCK_SYSTEM_H
|
||||
#include "grade.h"
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: UnlockSystem
|
||||
@@ -10,28 +14,61 @@
|
||||
Kevin Slaughter
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
enum UnlockTypes { UNLOCK_AP, UNLOCK_DP, UNLOCK_SP,
|
||||
UNLOCK_EC, UNLOCK_EF, UNLOCK_SC,
|
||||
UNLOCK_TT, UNLOCK_RO};
|
||||
|
||||
struct SongEntry
|
||||
{
|
||||
float m_fDancePointsRequired; // Ammount of Dance Points needed to unlock this song
|
||||
CString m_sSongName; /* Name of the song in the DWI/SM file itself.. This allows
|
||||
for a lot easier compatibility since a lot of people's
|
||||
song folders are named differantly, song names tend to
|
||||
be the same in the file.*/
|
||||
float m_fDancePointsRequired; // Amount of Dance Points needed to unlock this song
|
||||
float m_fArcadePointsRequired;
|
||||
float m_fSongPointsRequired;
|
||||
float m_fExtraStagesCleared;
|
||||
float m_fExtraStagesFailed;
|
||||
float m_fStagesCleared;
|
||||
float m_fToastysSeen;
|
||||
int m_iRouletteSeed;
|
||||
|
||||
bool isLocked;
|
||||
|
||||
SongEntry();
|
||||
|
||||
bool SelectableWheel();
|
||||
bool SelectableRoulette();
|
||||
|
||||
bool updateLocked();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
class UnlockSystem
|
||||
{
|
||||
public:
|
||||
UnlockSystem();
|
||||
float NumPointsUntilNextUnlock();
|
||||
bool SongIsLocked( CString sSongName );
|
||||
bool SongIsRoulette( CString sSongName );
|
||||
bool LoadFromDATFile( CString sPath );
|
||||
bool m_bAllSongsAreUnlocked; // Quick way to check if all songs are unlocked
|
||||
vector<SongEntry> m_SongEntries; // All locked songs are stored here
|
||||
|
||||
// bool m_bAllSongsAreUnlocked; // Quick way to check if all songs are unlocked
|
||||
vector<SongEntry> m_SongEntries; // All locked songs are stored here
|
||||
|
||||
float UnlockAddAP(Grade credit);
|
||||
float UnlockAddDP(float credit);
|
||||
float UnlockAddSP(Grade credit);
|
||||
float UnlockClearExtraStage();
|
||||
float UnlockFailExtraStage();
|
||||
float UnlockClearStage();
|
||||
float UnlockToasty();
|
||||
bool UnlockRouletteSeed(int seed);
|
||||
|
||||
private:
|
||||
void SortSongEntriesArray();
|
||||
bool ParseRow(CString text, CString &type, float &qty,
|
||||
CString &songname);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user