Save File implemented.

pull/28/head
sigonasr2 1 year ago
parent dd2146ebda
commit 5e5e8f5656
  1. 4
      Crawler/AttributableStat.cpp
  2. 7
      Crawler/AttributableStat.h
  3. 8
      Crawler/Crawler.vcxproj
  4. 6
      Crawler/Crawler.vcxproj.filters
  5. 6
      Crawler/Item.h
  6. 8
      Crawler/Player.cpp
  7. 2
      Crawler/Player.h
  8. 101
      Crawler/SaveFile.cpp
  9. 51
      Crawler/SaveFile.h
  10. 9
      Crawler/SaveFileWindow.cpp
  11. 2
      Crawler/State_LevelComplete.cpp
  12. 2
      Crawler/State_OverworldMap.cpp
  13. 1
      Crawler/Unlock.h
  14. 2
      Crawler/Version.h
  15. 3
      Crawler/assets/config/configuration.txt
  16. 344
      Crawler/assets/saves/save.0000
  17. 331
      Crawler/assets/saves/save.0001
  18. 344
      Crawler/assets/saves/save.0002
  19. 344
      Crawler/assets/saves/save.0003
  20. 354
      Crawler/assets/saves/save.0004
  21. 1
      Crawler/config.h
  22. 2
      Crawler/emscripten_build.ps1
  23. 2
      Crawler/olcPixelGameEngine.h
  24. BIN
      Crawler/pge.data
  25. 2
      Crawler/pge.js
  26. BIN
      Crawler/pge.wasm

@ -173,4 +173,8 @@ const bool ItemAttribute::operator==(const ItemAttribute&rhs)const{
const bool ItemAttribute::ShowAsDecimal()const{
return showDecimal;
}
const std::string_view ItemAttribute::ActualName()const{
return originalName;
}

@ -62,6 +62,7 @@ public:
ItemAttribute(std::string_view originalName,std::string_view name,bool isPct,bool showDecimal,std::string_view modifies=""sv);
static ItemAttribute&Get(const std::string_view name,const std::optional<std::variant<Player*,Monster*>>target={});
const std::string_view Name()const;
const std::string_view ActualName()const;
const std::string_view Modifies()const;
const bool DisplayAsPercent()const;
const bool ShowAsDecimal()const;
@ -100,5 +101,11 @@ public:
}
return 0;
}
inline auto begin()const{
return attributes.begin();
}
inline auto end()const{
return attributes.end();
}
};

@ -424,6 +424,10 @@
</SubType>
</ClInclude>
<ClInclude Include="safemap.h" />
<ClInclude Include="SaveFile.h">
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="ScrollableWindowComponent.h" />
<ClInclude Include="InventoryScrollableWindowComponent.h" />
<ClInclude Include="SpawnEncounterLabel.h" />
@ -560,6 +564,10 @@
<ClCompile Include="PulsatingFire.cpp" />
<ClCompile Include="Ranger.cpp" />
<ClCompile Include="RUN_STRATEGY.cpp" />
<ClCompile Include="SaveFile.cpp">
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="SaveFileWindow.cpp">
<SubType>
</SubType>

@ -393,6 +393,9 @@
<ClInclude Include="TextEntryLabel.h">
<Filter>Header Files\Interface</Filter>
</ClInclude>
<ClInclude Include="SaveFile.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Player.cpp">
@ -659,6 +662,9 @@
<ClCompile Include="SaveFileWindow.cpp">
<Filter>Source Files\Interface</Filter>
</ClCompile>
<ClCompile Include="SaveFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />

@ -163,11 +163,12 @@ private:
uint32_t amt;
uint8_t enhancementLevel;
ItemInfo*it;
Stats randomizedStats;
void SetAmt(uint32_t newAmt);
static ItemEnhancementFunctionPrimingData enhanceFunctionPrimed;
static int IsBlankStaticCallCounter;
const bool _IsBlank()const;
static ItemEnhancementFunctionPrimingData enhanceFunctionPrimed;
Stats randomizedStats;
public:
Item();
Item(uint32_t amt,IT item,uint8_t enhancementLevel=0);
@ -224,6 +225,7 @@ public:
class Inventory{
friend class ItemInfo;
friend class Item;
friend class SaveFile;
public:
static void AddItem(IT it,uint32_t amt=1,bool monsterDrop=false);
//Returns the actual amount available in your main inventory.

@ -1032,6 +1032,14 @@ const ItemAttributable&Player::GetStats()const{
return stats.GetStats();
};
const ItemAttributable&EntityStats::GetBaseStats()const{
return baseStats;
};
const ItemAttributable&Player::GetBaseStats()const{
return stats.GetBaseStats();
};
ItemAttribute&Player::Get(std::string_view attr){
return ItemAttribute::Get(attr,this);
}

@ -68,6 +68,7 @@ class EntityStats{
public:
void RecalculateEquipStats(); //Called when equipment is updated.
const ItemAttributable&GetStats()const;
const ItemAttributable&GetBaseStats()const;
const float&GetStat(ItemAttribute stat)const; //Get stats with equipment applied.
const float&GetStat(std::string_view stat)const; //Get stats with equipment applied.
const float&GetBaseStat(ItemAttribute stat)const;
@ -221,6 +222,7 @@ public:
void CancelCast();
const ItemAttributable&GetStats()const;
const ItemAttributable&GetBaseStats()const;
void ResetAccumulatedXP();
const uint32_t GetAccumulatedXP()const;
void AddAccumulatedXP(const uint32_t xpGain);

@ -0,0 +1,101 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2018 - 2022 OneLoneCoder.com
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#include <filesystem>
#include "config.h"
#include "Item.h"
#include "Crawler.h"
#include "Unlock.h"
#include "State_OverworldMap.h"
#include "SaveFile.h"
INCLUDE_game
size_t SaveFile::saveFileID=0;
std::string SaveFile::saveFileName="";
const size_t SaveFile::GetSaveFileCount(){
size_t count=0;
for(auto&path:std::filesystem::directory_iterator("save_file_path"_S)){
if(path.is_regular_file()){
count++;
}
}
return count;
}
const void SaveFile::SaveGame(){
utils::datafile saveFile;
utils::datafile::INITIAL_SETUP_COMPLETE=false;
for(size_t itemCount=0;auto&[name,item]:Inventory::_inventory){
saveFile["Items"][std::format("Item[{}]",itemCount)]["Amt"].SetInt(item->Amt());
saveFile["Items"][std::format("Item[{}]",itemCount)]["Enhancement Level"].SetInt(item->EnhancementLevel());
saveFile["Items"][std::format("Item[{}]",itemCount)]["Item Name"].SetString(item->ActualName());
saveFile["Items"][std::format("Item[{}]",itemCount)]["Equip Slot"].SetInt(int(Inventory::GetSlotEquippedIn(item)));
for(const auto&[attr,val]:item->RandomStats()){
saveFile["Items"][std::format("Item[{}]",itemCount)]["Attributes"][std::string(attr.ActualName())].SetReal(val);
}
itemCount++;
}
saveFile["Player"]["Class"].SetString(game->GetPlayer()->GetClassName());
saveFile["Player"]["Level"].SetInt(game->GetPlayer()->Level());
saveFile["Player"]["Current EXP"].SetInt(game->GetPlayer()->CurrentXP());
saveFile["Player"]["Total EXP"].SetInt(game->GetPlayer()->TotalXP());
for(const auto&[attr,val]:game->GetPlayer()->GetBaseStats()){
saveFile["Player"]["Base Stats"][std::string(attr.ActualName())].SetReal(val);
}
for(const std::string&unlockName:Unlock::unlocks){
saveFile["Unlocks"][unlockName].SetString("True");
}
saveFile["Overworld Map Location"].SetString(State_OverworldMap::GetCurrentConnectionPoint().name);
saveFile["Chapter"].SetInt(game->GetCurrentChapter());
saveFile["Save Name"].SetString(std::string(GetSaveFileName()));
utils::datafile::INITIAL_SETUP_COMPLETE=true;
utils::datafile::Write(saveFile,"save_file_path"_S+std::format("save.{:04}",saveFileID));
}
const std::string_view SaveFile::GetSaveFileName(){
return saveFileName;
}
const void SaveFile::SetSaveFileName(std::string_view saveFileName){
SaveFile::saveFileName=saveFileName;
}
const void SaveFile::SetSaveFileID(size_t saveFileID){
SaveFile::saveFileID=saveFileID;
}

@ -0,0 +1,51 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2018 - 2022 OneLoneCoder.com
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#pragma once
#undef GetSaveFileName(); //Stupid Windows
class SaveFile{
static size_t saveFileID;
static std::string saveFileName;
public:
static const std::string_view GetSaveFileName();
static const void SetSaveFileName(std::string_view saveFileName);
static const size_t GetSaveFileCount();
static const void SaveGame();
static const void SetSaveFileID(size_t saveFileID);
};

@ -38,11 +38,18 @@ All rights reserved.
#include "Menu.h"
#include "TextEntryLabel.h"
#include "MenuComponent.h"
#include "SaveFile.h"
void Menu::InitializeSaveFileWindow(){
Menu*saveFileWindow=CreateMenu(SAVE_FILE_NAME,CENTERED,vi2d{96,96});
saveFileWindow->ADD("Save File Name Text Entry",TextEntryLabel)({{-8,36},{112,24}},"",16U,2.f,ComponentAttr::FIT_TO_LABEL|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::BACKGROUND)END;
saveFileWindow->ADD("Back Button",MenuComponent)({{-8,68},{48,12}},"Back",[](MenuFuncData data){Menu::CloseMenu();game->TextEntryEnable(false);return true;})END;
saveFileWindow->ADD("Continue Button",MenuComponent)({{56,68},{48,12}},"Begin",MenuType::CLASS_SELECTION,[](MenuFuncData data){game->TextEntryEnable(false);return true;})END;
saveFileWindow->ADD("Continue Button",MenuComponent)({{56,68},{48,12}},"Begin",MenuType::CLASS_SELECTION,[](MenuFuncData data){
SaveFile::SetSaveFileName(game->TextEntryGetString());
SaveFile::SetSaveFileID(SaveFile::GetSaveFileCount());
game->TextEntryEnable(false);
SaveFile::SaveGame();
return true;
})END;
}

@ -40,6 +40,7 @@ All rights reserved.
#include "DEFINES.h"
#include "Menu.h"
#include "MenuLabel.h"
#include "SaveFile.h"
INCLUDE_MONSTER_LIST
INCLUDE_game
@ -51,6 +52,7 @@ void State_LevelComplete::OnStateChange(GameState*prevState){
Component<MenuLabel>(MenuType::LEVEL_COMPLETE,"Level EXP Gain Outline")->SetLabel(std::format("+{} Exp",game->GetPlayer()->GetAccumulatedXP()));
game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP());
game->GetPlayer()->SetState(State::NORMAL);
SaveFile::SaveGame();
Menu::OpenMenu(LEVEL_COMPLETE);
};
void State_LevelComplete::OnUserUpdate(Crawler*game){

@ -46,6 +46,7 @@ All rights reserved.
#include "EncountersSpawnListScrollableWindowComponent.h"
#include "VisualNovel.h"
#include "State_OverworldMap.h"
#include "SaveFile.h"
INCLUDE_MONSTER_LIST
INCLUDE_game
@ -169,6 +170,7 @@ ConnectionPoint&State_OverworldMap::GetCurrentConnectionPoint(){
void State_OverworldMap::StartLevel(){
game->UpdateDiscordStatus(State_OverworldMap::GetCurrentConnectionPoint().name,game->GetPlayer()->GetClassName());
SaveFile::SaveGame();
if(State_OverworldMap::GetCurrentConnectionPoint().map.starts_with("STORY")){
VisualNovel::LoadVisualNovel(State_OverworldMap::GetCurrentConnectionPoint().map);
}else{

@ -42,6 +42,7 @@ All rights reserved.
class Unlock{
friend class Crawler;
friend class SaveFile;
static std::set<std::string>unlocks;
static void Initialize();
public:

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

@ -71,6 +71,9 @@ merchant_directory = config/shops/
# Item Stats Config
item_stats_config = items/ItemStats.txt
# Save Files Location
save_file_path = assets/saves/
# Dialog font and size.
dialog_font_size = c64esque,12

@ -0,0 +1,344 @@
Items
{
Item[0]
{
Amt = 10
Enhancement Level = 0
Item Name = Bandages
Equip Slot = 0
}
Item[1]
{
Amt = 22
Enhancement Level = 0
Item Name = Blue Slime Remains
Equip Slot = 0
}
Item[2]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Armor
Equip Slot = 0
}
Item[3]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Gloves
Equip Slot = 0
}
Item[4]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Pants
Equip Slot = 0
}
Item[5]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Armor
Equip Slot = 0
}
Item[6]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Helmet
Equip Slot = 0
}
Item[7]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Pants
Equip Slot = 0
}
Item[8]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Shoes
Equip Slot = 0
}
Item[9]
{
Amt = 3
Enhancement Level = 0
Item Name = Elixir of Bear Strength
Equip Slot = 0
}
Item[10]
{
Amt = 40
Enhancement Level = 0
Item Name = Green Slime Remains
Equip Slot = 0
}
Item[11]
{
Amt = 1
Enhancement Level = 0
Item Name = Laser Sword
Equip Slot = 0
}
Item[12]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Gloves
Equip Slot = 0
}
Item[13]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Helmet
Equip Slot = 0
}
Item[14]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Pants
Equip Slot = 0
}
Item[15]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Shoes
Equip Slot = 0
}
Item[16]
{
Amt = 16
Enhancement Level = 0
Item Name = Minor Health Potion
Equip Slot = 0
}
Item[17]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 2.000000
Health = 19.000000
Mana = 1.000000
Move Spd = 3.000000
}
}
Item[18]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 2.000000
Health = 7.000000
Mana = 3.000000
Move Spd = 3.000000
}
}
Item[19]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 3.000000
Health = 18.000000
Mana = 2.000000
Move Spd = 3.000000
}
}
Item[20]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[21]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[22]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[23]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[24]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[25]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[26]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[27]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Helmet
Equip Slot = 0
}
Item[28]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Shoes
Equip Slot = 0
}
Item[29]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Sword
Equip Slot = 0
}
Item[30]
{
Amt = 1
Enhancement Level = 0
Item Name = Wooden Sword
Equip Slot = 0
}
}
Player
{
Class = Warrior
Level = 1
Current EXP = 0
Total EXP = 0
Base Stats
{
Attack = 10.000000
CDR = 0.000000
Crit Dmg = 50.000000
Crit Rate = 0.000000
Defense = 0.000000
HP/6 Recovery = 0.000000
Health = 0.000000
Mana = 100.000000
Move Spd = 100.000000
}
}
Unlocks
{
CAMPAIGN_1_1 = True
WORLD_MAP = True
}
Overworld Map Location = Stage I-I
Chapter = 1
Save Name = Test File

@ -0,0 +1,331 @@
Items
{
Item[0]
{
Amt = 10
Enhancement Level = 0
Item Name = Bandages
Equip Slot = 0
}
Item[1]
{
Amt = 15
Enhancement Level = 0
Item Name = Blue Slime Remains
Equip Slot = 0
}
Item[2]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Armor
Equip Slot = 0
}
Item[3]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Gloves
Equip Slot = 0
}
Item[4]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Pants
Equip Slot = 0
}
Item[5]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Armor
Equip Slot = 0
}
Item[6]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Helmet
Equip Slot = 0
}
Item[7]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Pants
Equip Slot = 0
}
Item[8]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Shoes
Equip Slot = 0
}
Item[9]
{
Amt = 3
Enhancement Level = 0
Item Name = Elixir of Bear Strength
Equip Slot = 0
}
Item[10]
{
Amt = 25
Enhancement Level = 0
Item Name = Green Slime Remains
Equip Slot = 0
}
Item[11]
{
Amt = 1
Enhancement Level = 4
Item Name = Laser Sword
Equip Slot = 0
}
Item[12]
{
Amt = 1
Enhancement Level = 4
Item Name = Leather Gloves
Equip Slot = 0
}
Item[13]
{
Amt = 1
Enhancement Level = 4
Item Name = Leather Helmet
Equip Slot = 0
}
Item[14]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Pants
Equip Slot = 0
}
Item[15]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Shoes
Equip Slot = 0
}
Item[16]
{
Amt = 2
Enhancement Level = 0
Item Name = Red Slime Remains
Equip Slot = 0
}
Item[17]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 4.000000
Health = 16.000000
Mana = 3.000000
Move Spd = 2.000000
}
}
Item[18]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 2.000000
Health = 19.000000
Mana = 1.000000
Move Spd = 2.000000
}
}
Item[19]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[20]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[21]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[22]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[23]
{
Amt = 1
Enhancement Level = 4
Item Name = Shell Gloves
Equip Slot = 8
}
Item[24]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[25]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[26]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Helmet
Equip Slot = 0
}
Item[27]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Shoes
Equip Slot = 32
}
Item[28]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Sword
Equip Slot = 0
}
Item[29]
{
Amt = 1
Enhancement Level = 0
Item Name = Wooden Sword
Equip Slot = 0
}
}
Player
{
Class = Ranger
Level = 1
Current EXP = 44
Total EXP = 44
Base Stats
{
Attack = 0.000000
Attack Spd = 0.000000
CDR = 0.000000
Crit Dmg = 50.000000
Crit Rate = 0.000000
Damage Reduction = 0.000000
Defense = 0.000000
HP Recovery = 0.000000
HP/4 Recovery = 0.000000
HP/6 Recovery = 0.000000
Health = 0.000000
Mana = 100.000000
Move Spd = 105.000000
}
}
Unlocks
{
CAMPAIGN_1_1 = True
CAMPAIGN_1_2 = True
WORLD_MAP = True
}
Overworld Map Location = Story I
Chapter = 1
Save Name = Test File 2

@ -0,0 +1,344 @@
Items
{
Item[0]
{
Amt = 10
Enhancement Level = 0
Item Name = Bandages
Equip Slot = 0
}
Item[1]
{
Amt = 22
Enhancement Level = 0
Item Name = Blue Slime Remains
Equip Slot = 0
}
Item[2]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Armor
Equip Slot = 0
}
Item[3]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Gloves
Equip Slot = 0
}
Item[4]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Pants
Equip Slot = 0
}
Item[5]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Armor
Equip Slot = 0
}
Item[6]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Helmet
Equip Slot = 0
}
Item[7]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Pants
Equip Slot = 0
}
Item[8]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Shoes
Equip Slot = 0
}
Item[9]
{
Amt = 3
Enhancement Level = 0
Item Name = Elixir of Bear Strength
Equip Slot = 0
}
Item[10]
{
Amt = 40
Enhancement Level = 0
Item Name = Green Slime Remains
Equip Slot = 0
}
Item[11]
{
Amt = 1
Enhancement Level = 0
Item Name = Laser Sword
Equip Slot = 0
}
Item[12]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Gloves
Equip Slot = 0
}
Item[13]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Helmet
Equip Slot = 0
}
Item[14]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Pants
Equip Slot = 0
}
Item[15]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Shoes
Equip Slot = 0
}
Item[16]
{
Amt = 16
Enhancement Level = 0
Item Name = Minor Health Potion
Equip Slot = 0
}
Item[17]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 2.000000
Health = 12.000000
Mana = 4.000000
Move Spd = 3.000000
}
}
Item[18]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 2.000000
Health = 16.000000
Mana = 2.000000
Move Spd = 3.000000
}
}
Item[19]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 4.000000
Health = 14.000000
Mana = 3.000000
Move Spd = 3.000000
}
}
Item[20]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[21]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[22]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[23]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[24]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[25]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[26]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[27]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Helmet
Equip Slot = 0
}
Item[28]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Shoes
Equip Slot = 0
}
Item[29]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Sword
Equip Slot = 0
}
Item[30]
{
Amt = 1
Enhancement Level = 0
Item Name = Wooden Sword
Equip Slot = 0
}
}
Player
{
Class = Warrior
Level = 1
Current EXP = 0
Total EXP = 0
Base Stats
{
Attack = 10.000000
CDR = 0.000000
Crit Dmg = 50.000000
Crit Rate = 0.000000
Defense = 0.000000
HP/6 Recovery = 0.000000
Health = 0.000000
Mana = 100.000000
Move Spd = 100.000000
}
}
Unlocks
{
CAMPAIGN_1_1 = True
WORLD_MAP = True
}
Overworld Map Location = Stage I-I
Chapter = 1
Save Name = dfaf

@ -0,0 +1,344 @@
Items
{
Item[0]
{
Amt = 10
Enhancement Level = 0
Item Name = Bandages
Equip Slot = 0
}
Item[1]
{
Amt = 22
Enhancement Level = 0
Item Name = Blue Slime Remains
Equip Slot = 0
}
Item[2]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Armor
Equip Slot = 0
}
Item[3]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Gloves
Equip Slot = 0
}
Item[4]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Pants
Equip Slot = 0
}
Item[5]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Armor
Equip Slot = 4
}
Item[6]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Helmet
Equip Slot = 1
}
Item[7]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Pants
Equip Slot = 16
}
Item[8]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Shoes
Equip Slot = 32
}
Item[9]
{
Amt = 3
Enhancement Level = 0
Item Name = Elixir of Bear Strength
Equip Slot = 0
}
Item[10]
{
Amt = 40
Enhancement Level = 0
Item Name = Green Slime Remains
Equip Slot = 0
}
Item[11]
{
Amt = 1
Enhancement Level = 0
Item Name = Laser Sword
Equip Slot = 0
}
Item[12]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Gloves
Equip Slot = 0
}
Item[13]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Helmet
Equip Slot = 0
}
Item[14]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Pants
Equip Slot = 0
}
Item[15]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Shoes
Equip Slot = 0
}
Item[16]
{
Amt = 16
Enhancement Level = 0
Item Name = Minor Health Potion
Equip Slot = 0
}
Item[17]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 3.000000
Health = 19.000000
Mana = 1.000000
Move Spd = 3.000000
}
}
Item[18]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 4.000000
Health = 20.000000
Mana = 1.000000
Move Spd = 1.000000
}
}
Item[19]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 3.000000
Health = 12.000000
Mana = 4.000000
Move Spd = 2.000000
}
}
Item[20]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[21]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[22]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[23]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[24]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[25]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[26]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[27]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Helmet
Equip Slot = 0
}
Item[28]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Shoes
Equip Slot = 0
}
Item[29]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Sword
Equip Slot = 0
}
Item[30]
{
Amt = 1
Enhancement Level = 0
Item Name = Wooden Sword
Equip Slot = 0
}
}
Player
{
Class = Warrior
Level = 1
Current EXP = 0
Total EXP = 0
Base Stats
{
Attack = 10.000000
CDR = 0.000000
Crit Dmg = 50.000000
Crit Rate = 0.000000
Defense = 0.000000
HP/6 Recovery = 0.000000
Health = 0.000000
Mana = 100.000000
Move Spd = 100.000000
}
}
Unlocks
{
CAMPAIGN_1_1 = True
WORLD_MAP = True
}
Overworld Map Location = Stage I-I
Chapter = 1
Save Name = Test File

@ -0,0 +1,354 @@
Items
{
Item[0]
{
Amt = 9
Enhancement Level = 0
Item Name = Bandages
Equip Slot = 0
}
Item[1]
{
Amt = 22
Enhancement Level = 0
Item Name = Blue Slime Remains
Equip Slot = 0
}
Item[2]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Armor
Equip Slot = 0
}
Item[3]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Gloves
Equip Slot = 8
}
Item[4]
{
Amt = 1
Enhancement Level = 0
Item Name = Bone Pants
Equip Slot = 16
}
Item[5]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Armor
Equip Slot = 0
}
Item[6]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Helmet
Equip Slot = 0
}
Item[7]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Pants
Equip Slot = 0
}
Item[8]
{
Amt = 1
Enhancement Level = 0
Item Name = Copper Shoes
Equip Slot = 0
}
Item[9]
{
Amt = 2
Enhancement Level = 0
Item Name = Elixir of Bear Strength
Equip Slot = 0
}
Item[10]
{
Amt = 42
Enhancement Level = 0
Item Name = Green Slime Remains
Equip Slot = 0
}
Item[11]
{
Amt = 1
Enhancement Level = 0
Item Name = Laser Sword
Equip Slot = 0
}
Item[12]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Gloves
Equip Slot = 0
}
Item[13]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Helmet
Equip Slot = 0
}
Item[14]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Pants
Equip Slot = 0
}
Item[15]
{
Amt = 1
Enhancement Level = 0
Item Name = Leather Shoes
Equip Slot = 0
}
Item[16]
{
Amt = 16
Enhancement Level = 0
Item Name = Minor Health Potion
Equip Slot = 0
}
Item[17]
{
Amt = 4
Enhancement Level = 0
Item Name = Red Slime Remains
Equip Slot = 0
}
Item[18]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 128
Attributes
{
Attack = 4.000000
Health = 17.000000
Mana = 1.000000
Move Spd % = 3.000000
}
}
Item[19]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 3.000000
Health = 8.000000
Mana = 3.000000
Move Spd % = 1.000000
}
}
Item[20]
{
Amt = 1
Enhancement Level = 0
Item Name = Ring of the Slime King
Equip Slot = 0
Attributes
{
Attack = 3.000000
Health = 6.000000
Mana = 1.000000
Move Spd % = 3.000000
}
}
Item[21]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[22]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[23]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Armor
Equip Slot = 0
}
Item[24]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[25]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[26]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[27]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Gloves
Equip Slot = 0
}
Item[28]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Helmet
Equip Slot = 0
}
Item[29]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Shoes
Equip Slot = 0
}
Item[30]
{
Amt = 1
Enhancement Level = 0
Item Name = Shell Sword
Equip Slot = 0
}
Item[31]
{
Amt = 1
Enhancement Level = 0
Item Name = Wooden Sword
Equip Slot = 0
}
}
Player
{
Class = Wizard
Level = 1
Current EXP = 44
Total EXP = 44
Base Stats
{
Attack = 15.000000
CDR = 0.000000
Crit Dmg = 50.000000
Crit Rate = 0.000000
Defense = 0.000000
HP6 Recovery % = 0.000000
Health = 80.000000
Health % = 0.000000
Mana = 100.000000
Move Spd % = 100.000000
}
}
Unlocks
{
CAMPAIGN_1_1 = True
WORLD_MAP = True
}
Overworld Map Location = Stage I-I
Chapter = 1
Save Name = Test File

@ -36,6 +36,7 @@ All rights reserved.
*/
#pragma endregion
#pragma once
#include "olcPixelGameEngine.h"
#include "olcUTIL_DataFile.h"
using namespace olc;

@ -1,2 +1,2 @@
~\Documents\emsdk\emsdk_env.ps1 activate latest
em++ -std=c++20 --proxy-to-worker -fexperimental-library -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 -s USE_FREETYPE=1 $(Get-ChildItem *.cpp) -sFETCH -o pge.html --preload-file assets
em++ -std=c++20 --proxy-to-worker -fexperimental-library -O2 -s ALLOW_MEMORY_GROWTH=1 -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s USE_LIBPNG=1 -s USE_FREETYPE=1 $(Get-ChildItem *.cpp) -s FETCH=1 -o pge.html --preload-file assets

@ -7204,7 +7204,7 @@ namespace olc
emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
strcpy(attr.requestMethod, "GET");
attr.attributes=EMSCRIPTEN_FETCH_LOAD_TO_MEMORY|EMSCRIPTEN_FETCH_SYNCHRONOUS;
attr.attributes=EMSCRIPTEN_FETCH_LOAD_TO_MEMORY|EMSCRIPTEN_FETCH_SYNCHRONOUS|EMSCRIPTEN_FETCH_REPLACE;
emscripten_fetch_t*fetch=emscripten_fetch(&attr,std::string(url).c_str()); // Blocks here until the operation is complete.
if(fetch->status==200){
printf("Finished downloading %llu bytes from URL %s.\n", fetch->numBytes, fetch->url);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 MiB

After

Width:  |  Height:  |  Size: 16 MiB

File diff suppressed because one or more lines are too long

Binary file not shown.
Loading…
Cancel
Save