diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 2d03f7d2..7e267dac 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -856,6 +856,7 @@ + diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters index 016a1363..44dac6c3 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters @@ -1160,6 +1160,9 @@ Configurations + + Configurations + diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 81468f41..ae5ca20d 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -232,6 +232,9 @@ AiL::AiL() std::string CREDITS_CONFIG = CONFIG_PATH + "credits_config"_S; utils::datafile::Read(DATA,CREDITS_CONFIG); + std::string ACHIEVEMENT_CONFIG = CONFIG_PATH + "achievement_config"_S; + utils::datafile::Read(DATA,ACHIEVEMENT_CONFIG); + utils::datafile::DEBUG_ACCESS_OPTIONS="debug_access_options"_I; sAppName = "GAME_NAME"_S; @@ -2461,6 +2464,7 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){ }); LoadingScreen::AddPhase([&](){ + if(SteamUserStats())SteamUserStats()->StoreStats(); ClearGarbage(); return true; }); @@ -2693,6 +2697,9 @@ bool Steam_Init(){ LOG(std::format("STEAM[{}]: {}",severity,std::string(message))); }); } + if(SteamUserStats()){ + SteamUserStats()->RequestCurrentStats(); + } return true; } #endif diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 38073cfa..4e6e3810 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -22,9 +22,10 @@ Ursule, Mother of Bears Destroyer (<1 Minute Kill) Tough as Steel - Obtain Level 5 on Warrior Skilled Marksman - Obtain Level 5 on Ranger Controller of Elements - Obtain Level 5 on Wizard -Maxed out a Weapon in Chapter 1 -Maxed out an Armor piece in Chapter 1 -Wear a full set of maxed out gear ++5 a Weapon ++5 an Armor piece ++10 an Armor piece +Fully Decked out - Wear a full set of maxed out gear Beat the Devs - Obtained a Time Medal Speedrunner - Obtained 11 Time Medals @@ -32,6 +33,28 @@ SetAchievement File Hash on Save/Load. +Movement still possible when alt-tabbing + +KILL_SLIME_1 +KILL_SLIME_2 +KILL_SLIME_3 +CAMP_UNLOCK +BLACKSMITH_UNLOCK +CHAPTER1_COMPLETE +SLIME_KING +SLIME_KING_DESTROYER +URSULE +URSULE_DESTROYER +WARRIOR_LV5 +RANGER_LV5 +WIZARD_LV5 +WEAPON_LV5 +ARMOR_LV5 +ARMOR_LV10 +FULLY_DECKED_OUT + +Include a Reset Achievements button in Settings + ============================================ Make another actions config file for the main build (The app # is different) \ No newline at end of file diff --git a/Adventures in Lestoria/Unlock.cpp b/Adventures in Lestoria/Unlock.cpp index eeae723c..18275044 100644 --- a/Adventures in Lestoria/Unlock.cpp +++ b/Adventures in Lestoria/Unlock.cpp @@ -38,6 +38,13 @@ All rights reserved. #include "Unlock.h" #include "State_OverworldMap.h" #include "config.h" +#include "olcUTIL_DataFile.h" +#include "DEFINES.h" +#ifndef __EMSCRIPTEN__ + #include +#endif + +INCLUDE_DATA std::setUnlock::unlocks; @@ -48,6 +55,13 @@ void Unlock::Initialize(){ void Unlock::UnlockArea(std::string mapName){ if(mapName=="NPCs.Sherman.Potion Crafting Unlock Condition"_S&& //When we beat the bonus chapter 1 fight, before sherman's potion crafting is unlocked, if the current map we just unlocked for is the bonus boss stage we will notify the Hub connection point and reset it so the player has a notification to go there again. !Unlock::IsUnlocked("NPCs.Sherman.Potion Crafting Unlock Condition"_S))State_OverworldMap::ConnectionPointFromString("HUB").value()->ResetVisitedFlag(); + if(SteamUserStats()){ + datafile&areaUnlocks=DATA.GetProperty("Achievement.Area Unlocks"); + for(auto&[key,size]:areaUnlocks){ + datafile&unlock = areaUnlocks[key]; + if(mapName==unlock["Unlock Name"].GetString())SteamUserStats()->SetAchievement(unlock["API Name"].GetString().c_str()); + } + } unlocks.insert(mapName); } bool Unlock::IsUnlocked(std::string mapName){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 836b40b4..b6f42bd3 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 8515 +#define VERSION_BUILD 8524 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Achievements/BronzeBorder.xcf b/Adventures in Lestoria/assets/Achievements/BronzeBorder.xcf index 8b91f087..9a79ef04 100644 Binary files a/Adventures in Lestoria/assets/Achievements/BronzeBorder.xcf and b/Adventures in Lestoria/assets/Achievements/BronzeBorder.xcf differ diff --git a/Adventures in Lestoria/assets/Achievements/armor_10.png b/Adventures in Lestoria/assets/Achievements/armor_10.png new file mode 100644 index 00000000..198e35f6 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/armor_10.png differ diff --git a/Adventures in Lestoria/assets/Achievements/armor_10_locked.png b/Adventures in Lestoria/assets/Achievements/armor_10_locked.png new file mode 100644 index 00000000..4c6c7554 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/armor_10_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/armor_5.png b/Adventures in Lestoria/assets/Achievements/armor_5.png new file mode 100644 index 00000000..d38de0a7 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/armor_5.png differ diff --git a/Adventures in Lestoria/assets/Achievements/armor_5_locked.png b/Adventures in Lestoria/assets/Achievements/armor_5_locked.png new file mode 100644 index 00000000..dd045478 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/armor_5_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/blacksmith_unlock.png b/Adventures in Lestoria/assets/Achievements/blacksmith_unlock.png new file mode 100644 index 00000000..d7c02891 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/blacksmith_unlock.png differ diff --git a/Adventures in Lestoria/assets/Achievements/blacksmith_unlock_locked.png b/Adventures in Lestoria/assets/Achievements/blacksmith_unlock_locked.png new file mode 100644 index 00000000..6a28f3cc Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/blacksmith_unlock_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/camp_unlock.png b/Adventures in Lestoria/assets/Achievements/camp_unlock.png new file mode 100644 index 00000000..37621091 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/camp_unlock.png differ diff --git a/Adventures in Lestoria/assets/Achievements/camp_unlock_locked.png b/Adventures in Lestoria/assets/Achievements/camp_unlock_locked.png new file mode 100644 index 00000000..af5a5f77 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/camp_unlock_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/chapter1_complete.png b/Adventures in Lestoria/assets/Achievements/chapter1_complete.png new file mode 100644 index 00000000..c8a5a5d9 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/chapter1_complete.png differ diff --git a/Adventures in Lestoria/assets/Achievements/chapter1_complete_locked.png b/Adventures in Lestoria/assets/Achievements/chapter1_complete_locked.png new file mode 100644 index 00000000..8d0fa7fb Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/chapter1_complete_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/fully_decked_out.png b/Adventures in Lestoria/assets/Achievements/fully_decked_out.png new file mode 100644 index 00000000..d4ffdb78 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/fully_decked_out.png differ diff --git a/Adventures in Lestoria/assets/Achievements/fully_decked_out_locked.png b/Adventures in Lestoria/assets/Achievements/fully_decked_out_locked.png new file mode 100644 index 00000000..d5c1f33b Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/fully_decked_out_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/ranger_level5.png b/Adventures in Lestoria/assets/Achievements/ranger_level5.png new file mode 100644 index 00000000..dc632a51 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/ranger_level5.png differ diff --git a/Adventures in Lestoria/assets/Achievements/ranger_level5_locked.png b/Adventures in Lestoria/assets/Achievements/ranger_level5_locked.png new file mode 100644 index 00000000..bc23197b Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/ranger_level5_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/slime_king.png b/Adventures in Lestoria/assets/Achievements/slime_king.png new file mode 100644 index 00000000..3f8a277b Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/slime_king.png differ diff --git a/Adventures in Lestoria/assets/Achievements/slime_king_destroyer.png b/Adventures in Lestoria/assets/Achievements/slime_king_destroyer.png new file mode 100644 index 00000000..b9d1ac43 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/slime_king_destroyer.png differ diff --git a/Adventures in Lestoria/assets/Achievements/slime_king_destroyer_locked.png b/Adventures in Lestoria/assets/Achievements/slime_king_destroyer_locked.png new file mode 100644 index 00000000..613e9763 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/slime_king_destroyer_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/slime_king_locked.png b/Adventures in Lestoria/assets/Achievements/slime_king_locked.png new file mode 100644 index 00000000..a9e24e13 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/slime_king_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/ursule_destroyer_unlock.png b/Adventures in Lestoria/assets/Achievements/ursule_destroyer_unlock.png new file mode 100644 index 00000000..9e6ad733 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/ursule_destroyer_unlock.png differ diff --git a/Adventures in Lestoria/assets/Achievements/ursule_destroyer_unlock_locked.png b/Adventures in Lestoria/assets/Achievements/ursule_destroyer_unlock_locked.png new file mode 100644 index 00000000..7fce6f7f Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/ursule_destroyer_unlock_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/ursule_unlock.png b/Adventures in Lestoria/assets/Achievements/ursule_unlock.png new file mode 100644 index 00000000..2a3c863e Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/ursule_unlock.png differ diff --git a/Adventures in Lestoria/assets/Achievements/ursule_unlock_locked.png b/Adventures in Lestoria/assets/Achievements/ursule_unlock_locked.png new file mode 100644 index 00000000..00a95bd5 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/ursule_unlock_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/warrior_level5.png b/Adventures in Lestoria/assets/Achievements/warrior_level5.png new file mode 100644 index 00000000..c808f4da Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/warrior_level5.png differ diff --git a/Adventures in Lestoria/assets/Achievements/warrior_level5_locked.png b/Adventures in Lestoria/assets/Achievements/warrior_level5_locked.png new file mode 100644 index 00000000..46f55fe6 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/warrior_level5_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/weapon_5.png b/Adventures in Lestoria/assets/Achievements/weapon_5.png new file mode 100644 index 00000000..981decdd Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/weapon_5.png differ diff --git a/Adventures in Lestoria/assets/Achievements/weapon_5_locked.png b/Adventures in Lestoria/assets/Achievements/weapon_5_locked.png new file mode 100644 index 00000000..ae832ab3 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/weapon_5_locked.png differ diff --git a/Adventures in Lestoria/assets/Achievements/wizard_level5.png b/Adventures in Lestoria/assets/Achievements/wizard_level5.png new file mode 100644 index 00000000..19cbe917 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/wizard_level5.png differ diff --git a/Adventures in Lestoria/assets/Achievements/wizard_level5_locked.png b/Adventures in Lestoria/assets/Achievements/wizard_level5_locked.png new file mode 100644 index 00000000..a8ec4ff3 Binary files /dev/null and b/Adventures in Lestoria/assets/Achievements/wizard_level5_locked.png differ diff --git a/Adventures in Lestoria/assets/config/Achievements.txt b/Adventures in Lestoria/assets/config/Achievements.txt new file mode 100644 index 00000000..a379869f --- /dev/null +++ b/Adventures in Lestoria/assets/config/Achievements.txt @@ -0,0 +1,98 @@ +Achievement +{ + Area Unlocks + { + # Area Unlocks are automatically checked when a new map unlock is achieved. + Camp Unlock + { + API Name = "CAMP_UNLOCK" + Unlock Name = "STORY_1_1" + } + Blacksmith Unlock + { + API Name = "BLACKSMITH_UNLOCK" + Unlock Name = "STORY_1_2" + } + Chapter 2 Unlock + { + API Name = "CHAPTER1_COMPLETE" + Unlock Name = "STORY_1_3" + } + } + Kill Unlocks + { + Kill Monsters 1 + { + API Name = "KILL_SLIME_1" + Monster Kill Count = 100 + } + Kill Monsters 2 + { + API Name = "KILL_SLIME_2" + Monster Kill Count = 250 + } + Kill Monsters 3 + { + API Name = "KILL_SLIME_3" + Monster Kill Count = 1000 + } + Slime King + { + API Name = "SLIME_KING" + } + Slime King Destroyer + { + API Name = "SLIME_KING_DESTROYER" + Time Limit = 60s + } + Ursule + { + API Name = "URSULE" + } + Ursule Destroyer + { + API Name = "URSULE_DESTROYER" + Time Limit = 60s + } + } + Class Unlocks + { + Warrior Lv5 + { + API Name = "WARRIOR_LV5" + Level Requirement = 5 + } + Ranger Lv5 + { + API Name = "RANGER_LV5" + Level Requirement = 5 + } + Wizard Lv5 + { + API Name = "WIZARD_LV5" + Level Requirement = 5 + } + } + Equip Unlocks + { + Weapon Lv5 + { + API Name = "WEAPON_LV5" + Upgrade Requirement = 5 + } + Armor Lv5 + { + API Name = "ARMOR_LV5" + Upgrade Requirement = 5 + } + Armor Lv10 + { + API Name = "ARMOR_LV10" + Upgrade Requirement = 10 + } + Fully Decked Out + { + API Name = "FULLY_DECKED_OUT" + } + } +} \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/configuration.txt b/Adventures in Lestoria/assets/config/configuration.txt index fed894ee..13ed7564 100644 --- a/Adventures in Lestoria/assets/config/configuration.txt +++ b/Adventures in Lestoria/assets/config/configuration.txt @@ -28,6 +28,9 @@ player_config = Player.txt # Monster Properties Loading Config monsters_config = Monsters.txt +# Achievement Config +achievement_config = Achievements.txt + # NPC Loading Config npc_config = NPCs.txt diff --git a/Adventures in Lestoria/assets/config/items/Equipment.txt b/Adventures in Lestoria/assets/config/items/Equipment.txt index 46e3739b..8a1cbca7 100644 --- a/Adventures in Lestoria/assets/config/items/Equipment.txt +++ b/Adventures in Lestoria/assets/config/items/Equipment.txt @@ -151,99 +151,78 @@ Equipment { # When this crafting recipe is available. AvailableChapter = 1 - Item[0] = Green Slime Remains,5 - Gold = 5 + Gold = 1 Level[1] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Green Slime Remains,7 - Gold = 12 + Gold = 1 } Level[2] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Wolf Skin,1 - Item[1] = Red Slime Remains,1 - Item[2] = Blue Slime Remains,1 - Gold = 18 + Gold = 1 } Level[3] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Red Slime Remains,3 - Item[1] = Green Slime Remains,6 - Gold = 24 + Gold = 1 } Level[4] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Blue Slime Remains,3 - Item[1] = Green Slime Remains,7 - Gold = 32 + Gold = 1 } Level[5] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Wolf Skin,1 - Item[1] = Red Slime Remains,4 - Gold = 40 + Gold = 1 } Level[6] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Yellow Slime Remains,1 - Item[1] = Red Slime Remains,6 - Gold = 50 + Gold = 1 } Level[7] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Wolf Skin,1 - Item[1] = Yellow Slime Remains,2 - Gold = 65 + Gold = 1 } Level[8] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Red Slime Remains,8 - Item[1] = Green Slime Remains,4 - Gold = 80 + Gold = 1 } Level[9] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Wolf Skin,2 - Item[1] = Yellow Slime Remains,3 - Gold = 100 + Gold = 1 } Level[10] { # When this enhancement is available. AvailableChapter = 1 - Item[0] = Green Gemstone,1 - Item[1] = Wolf Skin,1 - Gold = 150 + Gold = 1 } } } diff --git a/Adventures in Lestoria/olcPixelGameEngine.h b/Adventures in Lestoria/olcPixelGameEngine.h index b7db8bfb..7647076f 100644 --- a/Adventures in Lestoria/olcPixelGameEngine.h +++ b/Adventures in Lestoria/olcPixelGameEngine.h @@ -4690,7 +4690,15 @@ namespace olc { bHasMouseFocus = state; } void PixelGameEngine::olc_UpdateKeyFocus(bool state) - { bHasInputFocus = state; } + { + if(!state){ + for (uint32_t i = 0; i < 256; i++) + { + olc_UpdateKeyState(i,false); + } + } + bHasInputFocus = state; + } void PixelGameEngine::olc_DropFiles(int32_t x, int32_t y, const std::vector& vFiles) { diff --git a/Adventures in Lestoria/util.cpp b/Adventures in Lestoria/util.cpp index 1255e074..a80f466b 100644 --- a/Adventures in Lestoria/util.cpp +++ b/Adventures in Lestoria/util.cpp @@ -148,7 +148,10 @@ std::u32string util::WrapText(PixelGameEngine*pge,std::u32string str,int width,F return newStr; } +#pragma region std::string util::GetHash(std::string fileName) //DO NOT MODIFY! std::string util::GetHash(std::string fileName){ + //WARNING! This function is used to save/load files! This means if we ever modify this function all previous save files + //will no longer work! IN OTHER WORDS: DO NOT MODIFY THIS FUNCTION! std::ifstream file(fileName); std::string hash=""; uint8_t hashIndex=0; @@ -172,6 +175,7 @@ std::string util::GetHash(std::string fileName){ } return hash; } +#pragma endregion long double operator""_Pixels(long double unitDist){ return unitDist/100*24.; diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 51f38ada..d3b6afff 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ