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. 9
      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 6 Merchants.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_Creatures_Part_2.txt" />
<Text Include="Chapter_2_Boss.txt" />

@ -1346,7 +1346,19 @@
<Text Include="Crawler_Artificer.txt">
<Filter>Documentation\Mechanics</Filter>
</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>
</Text>
</ItemGroup>

@ -437,7 +437,7 @@ bool AiL::DownPressed(){
}
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;
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();
States::State GameState::currentState;
void GameState::Initialize(){
NEW_STATE(States::GAME_RUN,State_GameRun);
NEW_STATE(States::OVERWORLD_MAP,State_OverworldMap);
@ -62,6 +64,7 @@ void GameState::Initialize(){
void GameState::_ChangeState(States::State newState){
GameState*prevState=STATE;
currentState=newState;
if(!states.count(newState)){
ERR("WARNING! State not defined for state "<<newState<<"!")
}
@ -87,4 +90,8 @@ void GameState::GetAnyKeyRelease(Key k){}
void GameState::GetAnyMousePress(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{
friend class AiL;
friend class VisualNovel;
private:
static void _ChangeState(States::State newState);
static States::State currentState;
public:
inline static GameState*STATE=nullptr;
inline static std::map<States::State,GameState*>states;
@ -76,4 +78,5 @@ public:
virtual void GetAnyMouseRelease(int32_t mouseButton);
static void ChangeState(States::State newState,float fadeOutDuration=0,uint8_t mosaicEffect=1U);
virtual void OnLevelLoad()=0;
static States::State GetCurrentState();
};

@ -179,7 +179,6 @@ void Menu::MenuSelect(AiL*game){
}
void Menu::Update(AiL*game){
if(!draggingComponent){
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();
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"));
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"){
Menu::OpenMenu(MenuType::BLACKSMITH);
//First reset all items displayed in the blacksmith's shop (showing only our equipment.)

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

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

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

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