Fix equipment upgrade tests, left them in by accident. Added kill amount achievements. Release Build 8530.
This commit is contained in:
@@ -47,8 +47,11 @@ All rights reserved.
|
||||
INCLUDE_DATA
|
||||
|
||||
std::set<std::string>Unlock::unlocks;
|
||||
int Unlock::monsterKillCount=0;
|
||||
|
||||
void Unlock::Initialize(){
|
||||
unlocks.clear();
|
||||
monsterKillCount=0;
|
||||
UnlockArea("WORLD_MAP");
|
||||
}
|
||||
|
||||
@@ -74,4 +77,29 @@ bool Unlock::IsUnlocked(ConnectionPoint&cp){
|
||||
|
||||
void Unlock::UnlockCurrentMap(){
|
||||
UnlockArea(State_OverworldMap::GetCurrentConnectionPoint().map);
|
||||
}
|
||||
|
||||
void Unlock::IncreaseKillCount(){
|
||||
monsterKillCount++;
|
||||
if(SteamUserStats()){
|
||||
datafile&killUnlocks=DATA.GetProperty("Achievement.Kill Unlocks");
|
||||
for(auto&[key,size]:killUnlocks){
|
||||
if(key.starts_with("Kill Monsters")){
|
||||
int killRequirement=killUnlocks[key]["Monster Kill Count"].GetInt();
|
||||
if(monsterKillCount-1<killRequirement&& //These two checks make sure we're actually passing the kill requirement and not just over the kill requirement immediately.
|
||||
monsterKillCount==killRequirement){
|
||||
SteamUserStats()->SetAchievement(killUnlocks[key]["API Name"].GetString().c_str());
|
||||
SteamUserStats()->StoreStats();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const int Unlock::GetKillCount(){
|
||||
return monsterKillCount;
|
||||
}
|
||||
|
||||
void Unlock::SetKillCount(int newKillCount){
|
||||
monsterKillCount=newKillCount;
|
||||
}
|
||||
Reference in New Issue
Block a user