diff --git a/.gitignore b/.gitignore
index 4ddbe5ab..e6331368 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@
*.sln.docstates
emsdk
emscripten
+release
commercial_assets
*.o
*.h.gch
@@ -400,3 +401,6 @@ test.cpp
/x64/Release/Adventures in Lestoria.zip
/x64/Release/Adventures in Lestoria_web.zip
/x64/Release/AdventuresInLestoria_web.zip
+Adventures in Lestoria/packkey.cpp
+Adventures in Lestoria/packkey.cpp
+packkey.cpp
\ No newline at end of file
diff --git a/Adventures in Lestoria/Adventures in Lestoria.tiled-project b/Adventures in Lestoria/Adventures in Lestoria.tiled-project
index c66b6fde..5f23812a 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.tiled-project
+++ b/Adventures in Lestoria/Adventures in Lestoria.tiled-project
@@ -50,7 +50,7 @@
"foresty1_1",
"overworld",
"foresty_boss",
- "foresty_loop1"
+ "base_camp"
],
"valuesAsFlags": false
},
diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
index 2c240039..96c4fbf3 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
@@ -162,7 +162,7 @@
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
- C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories)
+ C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories)
/MP20 %(AdditionalOptions)
4099;5030;4715;4172;4834
@@ -170,7 +170,7 @@
Console
true
C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria;%(AdditionalLibraryDirectories)
- discord_game_sdk.dll.lib;freetype.lib;$(CoreLibraryDependencies);%(AdditionalDependencies);
+ discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);%(AdditionalDependencies);
powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h"
@@ -190,14 +190,14 @@
true
stdcpp20
/MP20 %(AdditionalOptions)
- C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include
+ C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include
- Console
+ Windows
true
true
true
- discord_game_sdk.dll.lib;freetype.lib;$(CoreLibraryDependencies);%(AdditionalDependencies);discord_game_sdk.dll.lib
+ discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);%(AdditionalDependencies);discord_game_sdk.dll.lib
powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h"
@@ -329,6 +329,7 @@
+
@@ -401,6 +402,7 @@
+
@@ -513,6 +515,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -762,6 +812,10 @@
+
+
+
+
@@ -790,9 +844,11 @@
+
+
diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
index af5ad58c..8cf54293 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
@@ -88,6 +88,9 @@
{c90a78bc-c74d-4609-b758-69320d7741e5}
+
+ {ac44510a-638e-4ae5-8529-2c68dddad459}
+
@@ -483,6 +486,147 @@
Header Files\Interface
+
+ Header Files\Interface
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files\steam
+
+
+ Header Files
+
+
+ Header Files\steam
+
@@ -851,6 +995,9 @@
Source Files\Effects
+
+ Source Files
+
@@ -858,6 +1005,10 @@
Documentation
+
+
+ Header Files\steam
+
diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp
index fa9e8c0b..81468f41 100644
--- a/Adventures in Lestoria/AdventuresInLestoria.cpp
+++ b/Adventures in Lestoria/AdventuresInLestoria.cpp
@@ -74,10 +74,12 @@ All rights reserved.
#include "InventoryScrollableWindowComponent.h"
#ifndef __EMSCRIPTEN__
#include "discord.h"
+ #include "steam/steam_api.h"
#endif
#include "GameSettings.h"
#include "LoadingScreen.h"
#include "Tutorial.h"
+#include "SteamKeyboardCallbackHandler.h"
INCLUDE_EMITTER_LIST
INCLUDE_ITEM_CATEGORIES
@@ -133,11 +135,13 @@ InputGroup AiL::KEY_SCROLLLEFT;
InputGroup AiL::KEY_SCROLLRIGHT;
InputGroup AiL::KEY_SCROLLHORZ;
InputGroup AiL::KEY_SCROLLHORZ_L;
+InputGroup AiL::KEY_SCROLLHORZ_R;
InputGroup AiL::KEY_SCROLLVERT;
InputGroup AiL::KEY_SCROLLVERT_R;
InputGroup AiL::KEY_SCROLLVERT_L;
InputGroup AiL::KEY_SCROLL;
InputGroup AiL::KEY_SHOULDER;
+InputGroup AiL::KEY_SHOULDER2;
InputGroup AiL::KEY_CHANGE_LOADOUT;
InputGroup AiL::KEY_MOUSE_RIGHT;
@@ -149,11 +153,14 @@ float AiL::SIZE_CHANGE_SPEED=1;
AiL::AiL()
{
+ debugLogger.open("debug.log");
utils::datafile::Read(DATA,"assets/config/configuration.txt");
std::filesystem::create_directories("save_file_path"_S);
_DEBUG_MAP_LOAD_INFO=bool("debug_map_load_info"_I);
+ MONSTER_LIST.reserve(500); //This is going to make it so the monster limit is soft-capped. We have hitlists in this game that may store pointers to monsters, this hopefully protects them from invalidated pointers. Worst-case-scenario we get double hits when there are more than 500 monsters on-screen at once which I really don't think will ever occur.
+
std::string CONFIG_PATH = "config_path"_S;
std::string GFX_CONFIG = CONFIG_PATH + "gfx_config"_S;
@@ -203,7 +210,7 @@ AiL::AiL()
std::vectorvalues=DATA.GetProperty("class_list").GetValues();
for(const std::string&cl:values){
- std::cout<Init(false);
+ Input::LoadSteamButtonIcons();
+ Input::ingameControlsHandle=SteamInput()->GetActionSetHandle("InGameControls");
+ )
+
+ #ifndef __EMSCRIPTEN__
+ if(steamKeyboardCallbackListener==nullptr){
+ steamKeyboardCallbackListener=new SteamKeyboardCallbackHandler();
+ }
+ #endif
utils::datafile::INITIAL_SETUP_COMPLETE=true;
@@ -327,7 +347,7 @@ bool AiL::OnUserCreate(){
if(!gamepack.Loaded()&&"GENERATE_GAMEPACK"_B){
gamepack.SavePack("assets/"+"gamepack_file"_S,PACK_KEY);
- std::cout<<"Game Pack has been generated!"<cooldownSoundInstance)){
+ Audio::Engine().SetVolume(GetPlayer()->cooldownSoundInstance,Audio::GetCalculatedSFXVolume("Audio.Casting Sound Volume"_F/100.f));
+ }
+
if(!GamePaused()){
GameState::STATE->OnUserUpdate(this);
}else{
@@ -348,10 +379,8 @@ bool AiL::OnUserUpdate(float fElapsedTime){
InputListener::Update();
Tutorial::Update();
Audio::Update();
- RenderWorld(GetElapsedTime());
GameState::STATE->Draw(this);
RenderMenu();
- Tutorial::Draw();
GameState::STATE->DrawOverlay(this);
RenderFadeout();
LoadingScreen::Draw();
@@ -360,7 +389,7 @@ bool AiL::OnUserUpdate(float fElapsedTime){
if(Discord){
auto result=Discord->RunCallbacks();
if(result!=::discord::Result::Ok){
- std::cout<<"Discord Error Code "<GetVelocity()==vf2d{0,0}&&player->CanMove()){
+ if(player->GetVelocity().mag()<"Player.Move Allowed Velocity Lower Limit"_F&&player->CanMove()){
auto GetPlayerStaircaseDirection=[&](){
for(LayerTag&layer:MAP_DATA[GetCurrentLevel()].LayerData){
int truncatedPlayerX=int(player->GetX())/game->GetCurrentMapData().tilewidth;
@@ -733,7 +763,7 @@ void AiL::UpdateBullets(float fElapsedTime){
}
std::erase_if(BULLET_LIST,[](std::unique_ptr&b){return b->dead;});
}
-const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z){
+const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upperLevel,float z)const{
MonsterHurtList hitList;
for(Monster&m:MONSTER_LIST){
if(geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){
@@ -744,6 +774,34 @@ const MonsterHurtList AiL::HurtEnemies(vf2d pos,float radius,int damage,bool upp
return hitList;
}
+const MonsterHurtList AiL::HurtEnemiesNotHit(vf2d pos,float radius,int damage,HitList&hitList,bool upperLevel,float z){
+ MonsterHurtList affectedList;
+ for(Monster&m:MONSTER_LIST){
+ if(!hitList.count(&m)&&geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){
+ HurtReturnValue returnVal=m.Hurt(damage,upperLevel,z);
+ affectedList.push_back({&m,returnVal});
+ hitList.insert(&m);
+ }
+ }
+ return affectedList;
+}
+
+const MonsterHurtList AiL::HurtEnemiesConeNotHit(vf2d pos,float radius,float angle,float sweepAngle,int damage,HitList&hitList,bool upperLevel,float z){
+ MonsterHurtList affectedList;
+ for(Monster&m:MONSTER_LIST){
+ if(!hitList.count(&m)&&geom2d::overlaps(geom2d::circle(pos,radius),geom2d::circle(m.GetPos(),12*m.GetSizeMult()))){
+ float angleToMonster=geom2d::line{pos,m.GetPos()}.vector().polar().y;
+ float angleDiff=util::angle_difference(angleToMonster,angle);
+ if(abs(angleDiff)<=sweepAngle){
+ HurtReturnValue returnVal=m.Hurt(damage,upperLevel,z);
+ affectedList.push_back({&m,returnVal});
+ hitList.insert(&m);
+ }
+ }
+ }
+ return affectedList;
+}
+
void AiL::PopulateRenderLists(){
monstersBeforeLower.clear();
monstersAfterLower.clear();
@@ -1639,6 +1697,7 @@ Player*AiL::GetPlayer(){
}
void AiL::RenderHud(){
+ if(!displayHud)return;
healthCounter.Update();
manaCounter.Update();
@@ -1691,12 +1750,42 @@ void AiL::RenderHud(){
RenderCastbar(CastInfo{"Exiting Level...",GetPlayer()->GetEndZoneStandTime(),"Player.End Zone Wait Time"_F});
}
+ Pixel healthOutlineCol=BLACK;
+ if(player->GetHealth()/player->GetMaxHealth()<="Player.Health Warning Pct"_F/100.f){
+ float runTimeAmt=fmod(GetRuntime(),"Player.Health Warning Flicker Time"_F*2);
+ if(runTimeAmt<"Player.Health Warning Flicker Time"_F){
+ healthOutlineCol="Player.Health Warning Outline Color"_Pixel;
+ }
+
+ Input::SetLightbar(healthOutlineCol);
+ }
+
+ DrawDecal({2,2},GFX["heart_outline.png"].Decal(),{1.f,1.f},healthOutlineCol);
DrawDecal({2,2},GFX["heart.png"].Decal());
DrawDecal({2,20},GFX["mana.png"].Decal());
std::string text=player->GetHealth()>0?std::to_string(healthCounter.GetDisplayValue()):"X";
std::string text_mana=std::to_string(manaCounter.GetDisplayValue());
- DrawShadowStringPropDecal({20,3},text,healthCounter.GetDisplayColor(),BLACK,{2,2},INFINITE);
+
+ DrawShadowStringPropDecal({20,3},text,healthCounter.GetDisplayColor(),healthOutlineCol,{2,2},INFINITE);
DrawShadowStringPropDecal({24,23},text_mana,manaCounter.GetDisplayColor(),BLACK,{1.5f,1.5f},INFINITE);
+
+ #pragma region Show Max Health/Max Mana
+ if(GameSettings::ShowMaxHealth()){
+ vf2d healthTextSize=GetTextSizeProp(text)*vf2d{2.f,2.f};
+
+ std::string maxHealthText="/"+std::to_string(int(player->GetMaxHealth()));
+ float maxHealthTextHeight=GetTextSizeProp(maxHealthText).y;
+ DrawShadowStringPropDecal(vf2d{20,3}+healthTextSize+vf2d{1.f,-maxHealthTextHeight},maxHealthText,{200,200,200,255},healthOutlineCol,{1.f,1.f},INFINITE);
+ }
+ if(GameSettings::ShowMaxMana()){
+ vf2d manaTextSize=GetTextSizeProp(text_mana)*vf2d{1.5f,1.5f};
+
+ std::string maxManaText="/"+std::to_string(player->GetMaxMana());
+ float maxManaTextHeight=GetTextSizeProp(maxManaText).y;
+ DrawShadowStringPropDecal(vf2d{24,23}+manaTextSize+vf2d{1.f,-maxManaTextHeight},maxManaText,{200,200,255,255},BLACK,{1.f,1.f},INFINITE);
+ }
+ #pragma endregion
+
if(player->notEnoughManaDisplay.second>0){
std::string displayText="Not enough mana for "+player->notEnoughManaDisplay.first+"!";
DrawShadowStringPropDecal(vf2d{float(ScreenWidth()/2),float(ScreenHeight()/4)}-GetTextSizeProp(displayText)/2,displayText,DARK_RED,VERY_DARK_RED);
@@ -1895,7 +1984,7 @@ void AiL::InitializeLevel(std::string mapFile,MapName map){
MAP_TILESETS["assets/maps/"+baseSourceDir].reflectiveData=tileset.GetData().ReflectiveData;
MAP_TILESETS["assets/maps/"+baseSourceDir].isTerrain=tileset.GetData().isTerrain;
MAP_TILESETS["assets/maps/"+baseSourceDir].collision.SetInitialized();
- std::cout<<"assets/maps/"+baseSourceDir<<" Animation Data Size: "<Load(mapPath,&gamepack);
@@ -1906,7 +1995,7 @@ void AiL::InitializeLevel(std::string mapFile,MapName map){
gamepack.AddFile(mapPath);
}
}else{
- std::cout<<"WARNING! "<Create(tileset.GetData().imagewidth,tileset.GetData().imageheight);
SetDrawTarget(r->Sprite());
int tileXCount=tileset.GetData().imagewidth/tileset.GetData().tilewidth;
@@ -1948,7 +2037,7 @@ void AiL::InitializeLevel(std::string mapFile,MapName map){
}
if(MAP_DATA[map].MapData.optimized){
- std::cout<<"Generating optimized map for Map "<