diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 98170254..cddb49e7 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -57,6 +57,9 @@ All rights reserved. #include "GameSettings.h" #include "Unlock.h" #include "Tutorial.h" +#ifndef __EMSCRIPTEN__ + #include +#endif INCLUDE_MONSTER_DATA INCLUDE_MONSTER_LIST @@ -1301,9 +1304,8 @@ void Player::AddXP(const uint32_t xpGain){ currentLevelXP+=xpGain; totalXPEarned+=xpGain; if(Level()=nextLevelXP){ - currentLevelXP-=nextLevelXP; + while(currentLevelXP>=NextLevelXPRequired()){ + currentLevelXP-=NextLevelXPRequired(); SetLevel(Level()+1); OnLevelUp(); } @@ -1324,6 +1326,18 @@ void Player::OnLevelUp(){ stats.SetBaseStat("Health",GetBaseStat("Health")+hpGrowthRate); stats.SetBaseStat("Attack",GetBaseStat("Attack")+atkGrowthRate); Heal(GetBaseStat("Health")); + + if(SteamUserStats()){ + for(auto&[key,size]:DATA.GetProperty("Achievement.Class Unlocks")){ + datafile&unlock=DATA.GetProperty(std::format("Achievement.Class Unlocks.{}",key)); + if(classutils::StringToClass(unlock["Class Requirement"].GetString())==GetClass()&& + Level()-1SetAchievement(unlock["API Name"].GetString().c_str()); + SteamUserStats()->StoreStats(); + } + } + } } const uint8_t Player::LevelCap()const{ return levelCap; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 61dce457..184a844c 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 0 #define VERSION_PATCH 0 -#define VERSION_BUILD 8532 +#define VERSION_BUILD 8534 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Achievements.txt b/Adventures in Lestoria/assets/config/Achievements.txt index 7cea9c6a..a1f95c36 100644 --- a/Adventures in Lestoria/assets/config/Achievements.txt +++ b/Adventures in Lestoria/assets/config/Achievements.txt @@ -70,16 +70,19 @@ Achievement Warrior Lv5 { API Name = "WARRIOR_LV5" + Class Requirement = Warrior Level Requirement = 5 } Ranger Lv5 { API Name = "RANGER_LV5" + Class Requirement = Ranger Level Requirement = 5 } Wizard Lv5 { API Name = "WIZARD_LV5" + Class Requirement = Wizard Level Requirement = 5 } } diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 82a13019..9d2e84e0 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ