Fix equipment upgrade tests, left them in by accident. Added kill amount achievements. Release Build 8530.

mac-build
sigonasr2 8 months ago
parent de52654380
commit e3f79e6965
  1. 1
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 3
      Adventures in Lestoria/Monster.cpp
  3. 8
      Adventures in Lestoria/SaveFile.cpp
  4. 4
      Adventures in Lestoria/TODO.txt
  5. 28
      Adventures in Lestoria/Unlock.cpp
  6. 4
      Adventures in Lestoria/Unlock.h
  7. 2
      Adventures in Lestoria/Version.h
  8. 2
      Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx
  9. 5
      Adventures in Lestoria/assets/config/Achievements.txt
  10. 43
      Adventures in Lestoria/assets/config/items/Equipment.txt
  11. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3712,7 +3712,6 @@ void AiL::ResetGame(bool changeToMainMenu){
for(int i=0;i<GetLoadoutSize();i++){
game->ClearLoadoutItem(i);
}
Unlock::unlocks.clear();
Unlock::Initialize();
State_OverworldMap::SetStageMarker("Story I");
State_OverworldMap::UpdateCurrentConnectionPoint(*State_OverworldMap::currentConnectionPoint);

@ -47,6 +47,7 @@ All rights reserved.
#include "MonsterAttribute.h"
#include "ItemDrop.h"
#include "SoundEffect.h"
#include "Unlock.h"
INCLUDE_ANIMATION_DATA
INCLUDE_MONSTER_DATA
@ -723,6 +724,8 @@ void Monster::OnDeath(){
}
}
Unlock::IncreaseKillCount();
if(hasStrategyDeathFunction){
GameEvent::AddEvent(std::make_unique<MonsterStrategyGameEvent>(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy()));
}

@ -134,6 +134,8 @@ const void SaveFile::SaveGame(){
saveFile["Game Time"].SetReal(game->GetRuntime());
saveFile["TravelingMerchant"].SetString(std::string(Merchant::GetCurrentTravelingMerchant().GetKeyName()));
saveFile["Achievement"]["KillCount"].SetInt(Unlock::GetKillCount());
#pragma region Save Keyboard/Controller mappings
//NOTE: We are shadowing code from InputKeyboardWindow! If at some point the retrival method for getting input displays changes, we likely will be changing the code here as well!
//ALSO NOTE: The menu inputs are saved to the system file while gameplay inputs are per-character and saved to the character settings file!
@ -390,6 +392,12 @@ void SaveFile::LoadFile(){
}
}
#pragma region Achievement-related loading
if(loadFile.HasProperty("Achievement.KillCount")){
Unlock::SetKillCount(loadFile.GetProperty("Achievement.KillCount").GetInt());
}
#pragma endregion
GameState::ChangeState(States::OVERWORLD_MAP,0.5f);
}else{
LOG(std::format("WARNING! File {} does not exist for loading!","save_file_path"_S+std::format("save.{:04}",saveFileID)));

@ -55,6 +55,8 @@ FULLY_DECKED_OUT
Include a Reset Achievements button in Settings
============================================
============================================
Consider a "killed by player" / "marked by player" flag for monsters to determine if a player gets credit for a monster kill (for achievements)
Make another actions config file for the main build (The app # is different)

@ -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");
}
@ -75,3 +78,28 @@ 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;
}

@ -45,6 +45,8 @@ class Unlock{
friend class SaveFile;
static std::set<std::string>unlocks;
static void Initialize();
static int monsterKillCount;
static void SetKillCount(int newKillCount);
public:
//Provide a map's actual name to trigger unlocks for all connected areas. You can get the current map you are on via State_OverworldMap::GetCurrentConnectionPoint().map
static void UnlockArea(std::string mapName);
@ -52,4 +54,6 @@ public:
static void UnlockCurrentMap();
static bool IsUnlocked(std::string mapName);
static bool IsUnlocked(ConnectionPoint&cp);
static void IncreaseKillCount();
static const int GetKillCount();
};

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_BUILD 8524
#define VERSION_BUILD 8530
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="11" nextobjectid="181">
<map version="1.10" tiledversion="1.10.2" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="11" nextobjectid="393">
<properties>
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>

@ -21,6 +21,7 @@ Achievement
}
Kill Unlocks
{
# Achievements that start with "Kill Monsters" will be checked when a monster is killed.
Kill Monsters 1
{
API Name = "KILL_SLIME_1"
@ -36,6 +37,10 @@ Achievement
API Name = "KILL_SLIME_3"
Monster Kill Count = 1000
}
##################################
Slime King
{
API Name = "SLIME_KING"

@ -151,78 +151,99 @@ Equipment
{
# When this crafting recipe is available.
AvailableChapter = 1
Item[0] = Green Slime Remains,5
Gold = 1
Gold = 5
Level[1]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Green Slime Remains,7
Gold = 1
Gold = 12
}
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 = 1
Gold = 18
}
Level[3]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Red Slime Remains,3
Item[1] = Green Slime Remains,6
Gold = 1
Gold = 24
}
Level[4]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Blue Slime Remains,3
Item[1] = Green Slime Remains,7
Gold = 1
Gold = 32
}
Level[5]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Wolf Skin,1
Item[1] = Red Slime Remains,4
Gold = 1
Gold = 40
}
Level[6]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Yellow Slime Remains,1
Item[1] = Red Slime Remains,6
Gold = 1
Gold = 50
}
Level[7]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Wolf Skin,1
Item[1] = Yellow Slime Remains,2
Gold = 1
Gold = 65
}
Level[8]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Red Slime Remains,8
Item[1] = Green Slime Remains,4
Gold = 1
Gold = 80
}
Level[9]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Wolf Skin,2
Item[1] = Yellow Slime Remains,3
Gold = 1
Gold = 100
}
Level[10]
{
# When this enhancement is available.
AvailableChapter = 1
Item[0] = Green Gemstone,1
Item[1] = Wolf Skin,1
Gold = 1
Gold = 150
}
}
}

Loading…
Cancel
Save