diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index c263f954..2f79433d 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -1176,7 +1176,7 @@ void AiL::RenderWorld(float fElapsedTime){ m.strategyDraw(this,m,MONSTER_DATA[m.GetName()].GetAIStrategy()); it=monstersBeforeLower.erase(it); if(it==monstersBeforeLower.end())break; - --it; + if(it!=monstersBeforeLower.begin())--it; continue; } break; @@ -1187,7 +1187,7 @@ void AiL::RenderWorld(float fElapsedTime){ b.Draw(); it=bulletsLower.erase(it); if(it==bulletsLower.end())break; - --it; + if(it!=bulletsLower.begin())--it; continue; } break; @@ -1198,7 +1198,7 @@ void AiL::RenderWorld(float fElapsedTime){ e.Draw(); it=backgroundEffectsLower.erase(it); if(it==backgroundEffectsLower.end())break; - --it; + if(it!=backgroundEffectsLower.begin())--it; continue; } break; @@ -1209,7 +1209,7 @@ void AiL::RenderWorld(float fElapsedTime){ drop.Draw(); it=dropsBeforeLower.erase(it); if(it==dropsBeforeLower.end())break; - --it; + if(it!=dropsBeforeLower.begin())--it; continue; } break; @@ -1229,7 +1229,7 @@ void AiL::RenderWorld(float fElapsedTime){ m.strategyDraw(this,m,MONSTER_DATA[m.GetName()].GetAIStrategy()); it=monstersAfterLower.erase(it); if(it==monstersAfterLower.end())break; - --it; + if(it!=monstersAfterLower.begin())--it; continue; } break; @@ -1240,7 +1240,7 @@ void AiL::RenderWorld(float fElapsedTime){ drop.Draw(); it=dropsAfterLower.erase(it); if(it==dropsAfterLower.end())break; - --it; + if(it!=dropsAfterLower.begin())--it; continue; } break; @@ -1251,7 +1251,7 @@ void AiL::RenderWorld(float fElapsedTime){ e.Draw(); it=foregroundEffectsLower.erase(it); if(it==foregroundEffectsLower.end())break; - --it; + if(it!=foregroundEffectsLower.begin())--it; continue; } break; @@ -1423,7 +1423,7 @@ void AiL::RenderWorld(float fElapsedTime){ m.strategyDraw(this,m,MONSTER_DATA[m.GetName()].GetAIStrategy()); it=monstersBeforeUpper.erase(it); if(it==monstersBeforeUpper.end())break; - --it; + if(it!=monstersBeforeUpper.begin())--it; continue; } break; @@ -1434,7 +1434,7 @@ void AiL::RenderWorld(float fElapsedTime){ b.Draw(); it=bulletsUpper.erase(it); if(it==bulletsUpper.end())break; - --it; + if(it!=bulletsUpper.begin())--it; continue; } break; @@ -1445,7 +1445,7 @@ void AiL::RenderWorld(float fElapsedTime){ e.Draw(); it=backgroundEffectsUpper.erase(it); if(it==backgroundEffectsUpper.end())break; - --it; + if(it!=backgroundEffectsUpper.begin())--it; continue; } break; @@ -1456,7 +1456,7 @@ void AiL::RenderWorld(float fElapsedTime){ drop.Draw(); it=dropsBeforeUpper.erase(it); if(it==dropsBeforeUpper.end())break; - --it; + if(it!=dropsBeforeUpper.begin())--it; continue; } break; @@ -1476,7 +1476,7 @@ void AiL::RenderWorld(float fElapsedTime){ m.strategyDraw(this,m,MONSTER_DATA[m.GetName()].GetAIStrategy()); it=monstersAfterUpper.erase(it); if(it==monstersAfterUpper.end())break; - --it; + if(it!=monstersAfterUpper.begin())--it; continue; } break; @@ -1487,7 +1487,7 @@ void AiL::RenderWorld(float fElapsedTime){ drop.Draw(); it=dropsAfterUpper.erase(it); if(it==dropsAfterUpper.end())break; - --it; + if(it!=dropsAfterUpper.begin())--it; continue; } break; @@ -1498,7 +1498,7 @@ void AiL::RenderWorld(float fElapsedTime){ e.Draw(); it=foregroundEffectsUpper.erase(it); if(it==foregroundEffectsUpper.end())break; - --it; + if(it!=foregroundEffectsUpper.begin())--it; continue; } break; diff --git a/Adventures in Lestoria/State_GameRun.cpp b/Adventures in Lestoria/State_GameRun.cpp index 04380daa..11140fda 100644 --- a/Adventures in Lestoria/State_GameRun.cpp +++ b/Adventures in Lestoria/State_GameRun.cpp @@ -43,6 +43,8 @@ All rights reserved. #include "VisualNovel.h" #include "State_OverworldMap.h" #include "GameEvent.h" +#include "MenuComponent.h" +#include "Unlock.h" INCLUDE_MONSTER_LIST INCLUDE_game @@ -73,7 +75,11 @@ void State_GameRun::OnStateChange(GameState*prevState){ game->LoadLevel(State_OverworldMap::GetCurrentConnectionPoint().map); } -void State_GameRun::OnLevelLoad(){} +void State_GameRun::OnLevelLoad(){ + Component(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut( + !Unlock::IsUnlocked("HUB")||game->GetCurrentMapName()=="HUB" + ); +} void State_GameRun::OnUserUpdate(AiL*game){ game->bossDisplayTimer=std::max(0.f,game->bossDisplayTimer-game->GetElapsedTime()); if(game->encounterStarted&&game->totalBossEncounterMobs>0){ diff --git a/Adventures in Lestoria/State_OverworldMap.cpp b/Adventures in Lestoria/State_OverworldMap.cpp index e3780d6a..5dcfc166 100644 --- a/Adventures in Lestoria/State_OverworldMap.cpp +++ b/Adventures in Lestoria/State_OverworldMap.cpp @@ -92,15 +92,6 @@ void State_OverworldMap::OnUserUpdate(AiL*game){ game->UpdateCamera(game->GetElapsedTime()); game->GetPlayer()->Update(game->GetElapsedTime()); - if(game->GetKey(PGUP).bHeld){ - mosaicAmt+=game->GetElapsedTime()*10; - game->SetMosaicEffect(uint8_t(mosaicAmt)); - } - if(game->GetKey(PGDN).bHeld){ - mosaicAmt-=game->GetElapsedTime()*10; - game->SetMosaicEffect(uint8_t(mosaicAmt)); - } - if(game->GetPlayer()->GetPos()!=playerTargetPos){ if(geom2d::line(game->GetPlayer()->GetPos(),playerTargetPos).length()<2){ game->GetPlayer()->SetPos(playerTargetPos); diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 6aae2d89..1cdd2a02 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -3,8 +3,6 @@ March 6th -> Discord/Friend Playtesting March 30th -> Public Demo Release -- Foreground tile depth correction for tiles w/hitboxes - - Add Death screen (Zoom in on fatal blow, slow time down... Display some game over text... Allow retry or return to world map.) - Track items used during a stage, on death, restore the loadout item quantities used. diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 90e3287a..67351788 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 7635 +#define VERSION_BUILD 7644 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/olcUTIL_Geometry2D.h b/Adventures in Lestoria/olcUTIL_Geometry2D.h index c8fb3c3c..d6884aa7 100644 --- a/Adventures in Lestoria/olcUTIL_Geometry2D.h +++ b/Adventures in Lestoria/olcUTIL_Geometry2D.h @@ -580,7 +580,11 @@ namespace olc::utils::geom2d // Given a real distance, get point along line inline constexpr olc::v_2d rpoint(const T& distance) const { - return start + vector().norm() * distance; + if(distance<=0){ + return start; + }else{ + return start + vector().norm() * distance; + } } // Given a unit distance, get point along line diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 1cba930c..95956a58 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ