Move Chapter 2 story to the correct story configuration file. Fix bug where closing a dialog didn't set the state to the previous state the game was in, but instead assumed it was Game Run. Which meant the player could attempt to leave the camp and be presented with the level complete window for no reason. Release Build 10415.

mac-build
sigonasr2 4 months ago
parent fe42089080
commit 57c5a2f579
  1. 6
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 14
      Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
  3. 2
      Adventures in Lestoria/AdventuresInLestoria.cpp
  4. 26
      Adventures in Lestoria/Chapter 2.txt
  5. 7
      Adventures in Lestoria/GameState.cpp
  6. 3
      Adventures in Lestoria/GameState.h
  7. 1
      Adventures in Lestoria/Menu.cpp
  8. 2
      Adventures in Lestoria/NPC.cpp
  9. 6
      Adventures in Lestoria/State_Dialog.cpp
  10. 2
      Adventures in Lestoria/Version.h
  11. 7
      Adventures in Lestoria/VisualNovel.cpp
  12. 2
      Adventures in Lestoria/VisualNovel.h
  13. 26
      Adventures in Lestoria/assets/config/story/Chapter 2.txt
  14. BIN
      x64/Release/Adventures in Lestoria.exe

@ -1170,7 +1170,11 @@
<Text Include="assets\config\shops\Chapter 5 Merchants.txt" /> <Text Include="assets\config\shops\Chapter 5 Merchants.txt" />
<Text Include="assets\config\shops\Chapter 6 Merchants.txt" /> <Text Include="assets\config\shops\Chapter 6 Merchants.txt" />
<Text Include="assets\config\story\Chapter 1.txt" /> <Text Include="assets\config\story\Chapter 1.txt" />
<Text Include="Chapter 2.txt" /> <Text Include="assets\config\story\Chapter 2.txt" />
<Text Include="assets\config\story\Chapter 3.txt" />
<Text Include="assets\config\story\Chapter 4.txt" />
<Text Include="assets\config\story\Chapter 5.txt" />
<Text Include="assets\config\story\Chapter 6.txt" />
<Text Include="Chapter_1_2nd_Boss.txt" /> <Text Include="Chapter_1_2nd_Boss.txt" />
<Text Include="Chapter_1_Creatures_Part_2.txt" /> <Text Include="Chapter_1_Creatures_Part_2.txt" />
<Text Include="Chapter_2_Boss.txt" /> <Text Include="Chapter_2_Boss.txt" />

@ -1346,7 +1346,19 @@
<Text Include="Crawler_Artificer.txt"> <Text Include="Crawler_Artificer.txt">
<Filter>Documentation\Mechanics</Filter> <Filter>Documentation\Mechanics</Filter>
</Text> </Text>
<Text Include="Chapter 2.txt"> <Text Include="assets\config\story\Chapter 2.txt">
<Filter>Configurations\Story</Filter>
</Text>
<Text Include="assets\config\story\Chapter 3.txt">
<Filter>Configurations\Story</Filter>
</Text>
<Text Include="assets\config\story\Chapter 4.txt">
<Filter>Configurations\Story</Filter>
</Text>
<Text Include="assets\config\story\Chapter 5.txt">
<Filter>Configurations\Story</Filter>
</Text>
<Text Include="assets\config\story\Chapter 6.txt">
<Filter>Configurations\Story</Filter> <Filter>Configurations\Story</Filter>
</Text> </Text>
</ItemGroup> </ItemGroup>

@ -437,7 +437,7 @@ bool AiL::DownPressed(){
} }
void AiL::HandleUserInput(float fElapsedTime){ void AiL::HandleUserInput(float fElapsedTime){
if(!Menu::stack.empty())return; //A window being opened means there's no user input allowed. if(!Menu::stack.empty()||GameState::STATE==GameState::states[States::DIALOG])return; //A window being opened means there's no user input allowed.
if(GetKey(SCROLL).bPressed)displayHud=!displayHud; if(GetKey(SCROLL).bPressed)displayHud=!displayHud;
bool setIdleAnimation=true; bool setIdleAnimation=true;

@ -1,26 +0,0 @@
===ARTIFICER_INTRO===
{BACKGROUND commercial_assets/Forest Clearing Campsite_Day.png}
[Artificer]
Hello adventurer! Welcome to my artificing station! I have not met you yet, may I have the pleasure of knowing your name?
[You]
Hello, my name is [You].
[Artificer]
Excellent! Nice to meet you, [You]. At my station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
This should let you get some use out of all those extra rings you're carrying around, eh?
[You]
Great, I think I could make good use of this. Thank you.
===ARTIFICER_HELP===
[Artificer]
At this station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
You can make use of those extra rings you have been piling up!

@ -49,6 +49,8 @@ INCLUDE_game
#define NEW_STATE(state,class) GameState::states[state]=NEW class(); #define NEW_STATE(state,class) GameState::states[state]=NEW class();
States::State GameState::currentState;
void GameState::Initialize(){ void GameState::Initialize(){
NEW_STATE(States::GAME_RUN,State_GameRun); NEW_STATE(States::GAME_RUN,State_GameRun);
NEW_STATE(States::OVERWORLD_MAP,State_OverworldMap); NEW_STATE(States::OVERWORLD_MAP,State_OverworldMap);
@ -62,6 +64,7 @@ void GameState::Initialize(){
void GameState::_ChangeState(States::State newState){ void GameState::_ChangeState(States::State newState){
GameState*prevState=STATE; GameState*prevState=STATE;
currentState=newState;
if(!states.count(newState)){ if(!states.count(newState)){
ERR("WARNING! State not defined for state "<<newState<<"!") ERR("WARNING! State not defined for state "<<newState<<"!")
} }
@ -88,3 +91,7 @@ void GameState::GetAnyMousePress(int32_t mouseButton){}
void GameState::GetAnyMouseRelease(int32_t mouseButton){} void GameState::GetAnyMouseRelease(int32_t mouseButton){}
void GameState::DrawOverlay(AiL*game){}; void GameState::DrawOverlay(AiL*game){};
States::State GameState::GetCurrentState(){
return currentState;
}

@ -59,8 +59,10 @@ namespace States{
class GameState{ class GameState{
friend class AiL; friend class AiL;
friend class VisualNovel;
private: private:
static void _ChangeState(States::State newState); static void _ChangeState(States::State newState);
static States::State currentState;
public: public:
inline static GameState*STATE=nullptr; inline static GameState*STATE=nullptr;
inline static std::map<States::State,GameState*>states; inline static std::map<States::State,GameState*>states;
@ -76,4 +78,5 @@ public:
virtual void GetAnyMouseRelease(int32_t mouseButton); virtual void GetAnyMouseRelease(int32_t mouseButton);
static void ChangeState(States::State newState,float fadeOutDuration=0,uint8_t mosaicEffect=1U); static void ChangeState(States::State newState,float fadeOutDuration=0,uint8_t mosaicEffect=1U);
virtual void OnLevelLoad()=0; virtual void OnLevelLoad()=0;
static States::State GetCurrentState();
}; };

@ -179,7 +179,6 @@ void Menu::MenuSelect(AiL*game){
} }
void Menu::Update(AiL*game){ void Menu::Update(AiL*game){
if(!draggingComponent){ if(!draggingComponent){
HoverMenuSelect(game); HoverMenuSelect(game);
} }

@ -67,7 +67,7 @@ void Monster::STRATEGY::NPC(Monster&m,float fElapsedTime,std::string strategy){
float distFromPlayer=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).length(); float distFromPlayer=geom2d::line<float>(m.GetPos(),game->GetPlayer()->GetPos()).length();
if(distFromPlayer<ConfigFloat("Interaction Distance")/100.f*24.f){ if(distFromPlayer<ConfigFloat("Interaction Distance")/100.f*24.f){
m.F(A::TARGET_TIMER)=std::min(m.F(A::TARGET_TIMER)+fElapsedTime,ConfigFloat("Interaction Display Ease in Timer")); m.F(A::TARGET_TIMER)=std::min(m.F(A::TARGET_TIMER)+fElapsedTime,ConfigFloat("Interaction Display Ease in Timer"));
if(game->KEY_CONFIRM.Released()&&Menu::stack.size()==0){ if(GameState::STATE!=GameState::states[States::DIALOG]&&game->KEY_CONFIRM.Released()&&Menu::stack.size()==0){
if(m.npcData.function=="Blacksmith"){ if(m.npcData.function=="Blacksmith"){
Menu::OpenMenu(MenuType::BLACKSMITH); Menu::OpenMenu(MenuType::BLACKSMITH);
//First reset all items displayed in the blacksmith's shop (showing only our equipment.) //First reset all items displayed in the blacksmith's shop (showing only our equipment.)

@ -41,15 +41,15 @@ All rights reserved.
#include "AdventuresInLestoria.h" #include "AdventuresInLestoria.h"
void State_Dialog::OnStateChange(GameState*prevState){ void State_Dialog::OnStateChange(GameState*prevState){
Menu::CloseAllMenus(); if(Menu::IsMenuOpen())Menu::CloseAllMenus();
}; };
void State_Dialog::OnLevelLoad(){} void State_Dialog::OnLevelLoad(){}
void State_Dialog::OnUserUpdate(AiL*game){ void State_Dialog::OnUserUpdate(AiL*game){
GameState::states[States::GAME_RUN]->OnUserUpdate(game); GameState::states[VisualNovel::novel.previousState]->OnUserUpdate(game);
VisualNovel::novel.Update(); VisualNovel::novel.Update();
game->ClearTimedOutGarbage(); game->ClearTimedOutGarbage();
}; };
void State_Dialog::Draw(AiL*game){ void State_Dialog::Draw(AiL*game){
GameState::states[States::GAME_RUN]->Draw(game); GameState::states[VisualNovel::novel.previousState]->Draw(game);
VisualNovel::novel.Draw(0U); VisualNovel::novel.Draw(0U);
}; };

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 10402 #define VERSION_BUILD 10415
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -193,6 +193,7 @@ void VisualNovel::Reset(){
commandIndex=0; commandIndex=0;
} }
void VisualNovel::LoadDialog(std::string dialogName,std::function<void()>dialogFinishedCallbackFunc){ void VisualNovel::LoadDialog(std::string dialogName,std::function<void()>dialogFinishedCallbackFunc){
novel.previousState=GameState::GetCurrentState();
novel.dialogFinishedCallbackFunc=dialogFinishedCallbackFunc; novel.dialogFinishedCallbackFunc=dialogFinishedCallbackFunc;
novel.storyLevel=dialogName; novel.storyLevel=dialogName;
novel.Reset(); novel.Reset();
@ -218,7 +219,7 @@ void VisualNovel::LoadVisualNovel(std::string storyLevelName){
} }
void VisualNovel::Update(){ void VisualNovel::Update(){
Audio::SetBGMPitch(audioPitch); Audio::SetBGMPitch(audioPitch);
if(transitionTime==0&&game->KEY_CONFIRM.Pressed()){ if(transitionTime==0&&game->KEY_CONFIRM.Released()){
activeText=U""; activeText=U"";
novel.ExecuteNextCommand(); novel.ExecuteNextCommand();
} }
@ -236,7 +237,9 @@ void VisualNovel::ExecuteNextCommand(){
}else{ }else{
if(GameState::STATE==GameState::states[States::DIALOG]){ if(GameState::STATE==GameState::states[States::DIALOG]){
Reset(); Reset();
GameState::STATE=GameState::states[States::GAME_RUN]; Menu::themeSelection=novel.prevTheme;
GameState::STATE=GameState::states[novel.previousState];
GameState::currentState=novel.previousState;
dialogFinishedCallbackFunc(); dialogFinishedCallbackFunc();
}else{ }else{
if(game->GetCurrentMapName()=="NPCs.Greg.Camp Notification Unlock Condition"_S&& if(game->GetCurrentMapName()=="NPCs.Greg.Camp Notification Unlock Condition"_S&&

@ -41,6 +41,7 @@ All rights reserved.
#include "safemap.h" #include "safemap.h"
#include <set> #include <set>
#include "olcPGEX_TTF.h" #include "olcPGEX_TTF.h"
#include "GameState.h"
class VisualNovel; class VisualNovel;
@ -180,6 +181,7 @@ public:
private: private:
static std::set<std::string>graphicsToLoad; static std::set<std::string>graphicsToLoad;
static safemap<std::string,std::vector<std::unique_ptr<Command>>>storyLevelData; static safemap<std::string,std::vector<std::unique_ptr<Command>>>storyLevelData;
States::State previousState{};
static VisualNovel novel; static VisualNovel novel;
VisualNovel(); VisualNovel();

@ -0,0 +1,26 @@
===ARTIFICER_INTRO===
{BACKGROUND commercial_assets/Forest Clearing Campsite_Day.png}
[Artificer]
Hello adventurer! Welcome to my artificing station! I have not met you yet, may I have the pleasure of knowing your name?
[You]
Hello, my name is [You].
[Artificer]
Excellent! Nice to meet you, [You]. At my station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
This should let you get some use out of all those extra rings you're carrying around, eh?
[You]
Great, I think I could make good use of this. Thank you.
===ARTIFICER_HELP===
[Artificer]
At this station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
You can make use of those extra rings you have been piling up!
Loading…
Cancel
Save