Add dialog loading function to call and trigger Dialog game state. Add Artificer Introduction tutorial task.

mac-build
sigonasr2 7 months ago
parent fdc02351bb
commit cf5c63847c
  1. 1
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 3
      Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
  3. 6
      Adventures in Lestoria/NPC.cpp
  4. 1
      Adventures in Lestoria/Tutorial.cpp
  5. 11
      Adventures in Lestoria/Tutorial.h
  6. 11
      Adventures in Lestoria/VisualNovel.cpp
  7. 1
      Adventures in Lestoria/VisualNovel.h

@ -1169,6 +1169,7 @@
<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="Chapter_1_2nd_Boss.txt" />
<Text Include="Chapter_1_Creatures_Part_2.txt" />
<Text Include="Chapter_2_Boss.txt" />

@ -1343,6 +1343,9 @@
<Text Include="Crawler_Artificer.txt">
<Filter>Documentation\Mechanics</Filter>
</Text>
<Text Include="Chapter 2.txt">
<Filter>Configurations\Story</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<Image Include="assets\heart.ico">

@ -45,6 +45,7 @@ All rights reserved.
#include "RowInventoryScrollableWindowComponent.h"
#include "InventoryCreator.h"
#include "Tutorial.h"
#include "VisualNovel.h"
using A=Attribute;
@ -85,7 +86,10 @@ void Monster::STRATEGY::NPC(Monster&m,float fElapsedTime,std::string strategy){
Menu::OpenMenu(MenuType::MERCHANT);
}else
if(m.npcData.function=="Artificer"){
Menu::OpenMenu(MenuType::MERCHANT);
if(!Tutorial::TaskIsComplete(TutorialTaskName::ARTIFICER_INTRO)){
Tutorial::CompleteTask(TutorialTaskName::ARTIFICER_INTRO);
VisualNovel::LoadDialog("ARTIFICER_INTRO");
}
}
}
}else{

@ -51,6 +51,7 @@ void Tutorial::Initialize(){
CREATETASK(TutorialTaskName::USE_RECOVERY_ITEMS,UseRecoveryItemsTask);
CREATETASK(TutorialTaskName::BLACKSMITH,BlacksmithTask);
CREATETASK(TutorialTaskName::EQUIP_GEAR,EquipGearTask);
CREATETASK(TutorialTaskName::ARTIFICER_INTRO,ArtificerIntroductionTask);
currentTaskState=TutorialTaskName::SET_LOADOUT_ITEM;
ResetTasks();
}

@ -63,6 +63,7 @@ enum class TutorialTaskName{
USE_RECOVERY_ITEMS,
BLACKSMITH,
EQUIP_GEAR,
ARTIFICER_INTRO,
NONE,
};
@ -355,4 +356,14 @@ private:
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"to equip your new gear.",255,InputType::KEY,{0.85f,1.f},"Open the #FFCF0CCharacter#FFFFFF menu with ");
}
}
};
class ArtificerIntroductionTask:public TutorialTask{
public:
inline ArtificerIntroductionTask():TutorialTask(){};
private:
virtual inline bool CompleteCondition()override final{
return false;
}
virtual inline void OnComplete()override final{}
};

@ -192,6 +192,17 @@ void VisualNovel::Reset(){
commands.clear();
commandIndex=0;
}
void VisualNovel::LoadDialog(std::string dialogName){
novel.storyLevel=dialogName;
novel.Reset();
for(std::unique_ptr<Command>&command:storyLevelData.at(dialogName)){
novel.commands.push_back(command.get());
}
GameState::ChangeState(States::DIALOG);
novel.ExecuteNextCommand();
novel.prevTheme=Menu::GetCurrentTheme().GetThemeName();
Menu::themeSelection="Purple";
}
void VisualNovel::LoadVisualNovel(std::string storyLevelName){
novel.storyLevel=storyLevelName;
novel.Reset();

@ -187,6 +187,7 @@ public:
VisualNovel(VisualNovel&)=delete;
VisualNovel(VisualNovel&&)=delete;
static void Initialize();
static void LoadDialog(std::string dialogName);
static void LoadVisualNovel(std::string storyLevelName);
void ExecuteNextCommand();
void Update();

Loading…
Cancel
Save