diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 11defbfa..32518cd5 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -2019,6 +2019,7 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){ ItemDrop::drops.clear(); GameEvent::events.clear(); Audio::SetBGMPitch(1.f); + Audio::SetAudioEvent("Default Volume"); game->view.SetZoom(1.f,game->view.WorldToScreen(game->camera.GetViewPosition())); SetMosaicEffect(1U); worldColor=WHITE; diff --git a/Adventures in Lestoria/LevelCompleteWindow.cpp b/Adventures in Lestoria/LevelCompleteWindow.cpp index fa275e64..84c407af 100644 --- a/Adventures in Lestoria/LevelCompleteWindow.cpp +++ b/Adventures in Lestoria/LevelCompleteWindow.cpp @@ -78,7 +78,7 @@ void Menu::InitializeLevelCompleteWindow(){ return true; }; - levelCompleteWindow->ADD("Level Details Outline",MenuComponent)(geom2d::rect{{windowSize.size.x-72.f,32},{71,72}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END; + levelCompleteWindow->ADD("Level Details Outline",MenuComponent)(geom2d::rect{{windowSize.size.x-72.f,32},{71,72}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE|ButtonAttr::FIT_TO_LABEL)END; levelCompleteWindow->ADD("Level EXP Gain Outline",MenuLabel)(geom2d::rect{{windowSize.size.x-72.f,104},{71,36}},"+ Exp",1,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; levelCompleteWindow->ADD("Next Button",MenuComponent)(geom2d::rect{{windowSize.size.x-72.f,144},{71,32}},"Proceed\nto Camp",nextButtonAction,ButtonAttr::FIT_TO_LABEL)END; diff --git a/Adventures in Lestoria/PauseMenu.cpp b/Adventures in Lestoria/PauseMenu.cpp index 01b44e48..24bd0371 100644 --- a/Adventures in Lestoria/PauseMenu.cpp +++ b/Adventures in Lestoria/PauseMenu.cpp @@ -69,6 +69,7 @@ void Menu::InitializePauseWindow(){ },ButtonAttr::FIT_TO_LABEL)END; pauseWindow->ADD("Return to Camp Button",MenuComponent)(geom2d::rect{{6.f,112.f},{84.f,24.f}},"Return to Camp",[](MenuFuncData data){ Component(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Summary"); + Component(LEVEL_COMPLETE,"Level Details Outline")->SetLabel(""); GameState::ChangeState(States::LEVEL_COMPLETE,0.4f); return true; },ButtonAttr::FIT_TO_LABEL)END; diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index becfea05..f5929ce3 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -983,6 +983,7 @@ void Player::CheckEndZoneCollision(){ endZoneStandTime+=game->GetElapsedTime(); if(endZoneStandTime>="Player.End Zone Wait Time"_F){ Component(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Completed"); + Component(LEVEL_COMPLETE,"Level Details Outline")->SetLabel("Complete Bonus\n +10% XP"); if(Unlock::IsUnlocked("HUB")){ Component(LEVEL_COMPLETE,"Next Button")->SetLabel("Proceed\nto Camp"); }else{ diff --git a/Adventures in Lestoria/State_LevelComplete.cpp b/Adventures in Lestoria/State_LevelComplete.cpp index 0b9da4e5..9d84742d 100644 --- a/Adventures in Lestoria/State_LevelComplete.cpp +++ b/Adventures in Lestoria/State_LevelComplete.cpp @@ -57,11 +57,10 @@ void State_LevelComplete::OnStateChange(GameState*prevState){ Menu::CloseAllMenus(); } levelUpTextPos={-100.f,-100.f}; - Component(MenuType::LEVEL_COMPLETE,"Level EXP Gain Outline")->SetLabel(std::format("+{} Exp",game->GetPlayer()->GetAccumulatedXP())); Component(MenuType::LEVEL_COMPLETE,"XP Bar")->ResetProgressBar(game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired()); accumulatedXP=game->GetPlayer()->GetAccumulatedXP(); - game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP()); - + + float xpBonus=1.1f; //10% XP bonus for finishing a stage. if(Component(LEVEL_COMPLETE,"Stage Complete Label")->GetLabel()!="Stage Summary"){ //If the label says stage summary, we didn't actually the level. Don't reward any stage items to the player. for(const ItemMapData&data:game->GetCurrentMap().GetStageLoot()){ uint8_t amountDiff=data.maxAmt-data.minAmt; @@ -75,7 +74,16 @@ void State_LevelComplete::OnStateChange(GameState*prevState){ } } } + xpBonus=1.0f; } + + + accumulatedXP*=xpBonus; + + Component(MenuType::LEVEL_COMPLETE,"Level EXP Gain Outline")->SetLabel(std::format("+{} Exp",accumulatedXP)); + + game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP()); + game->GetPlayer()->SetState(State::NORMAL); Menu::OpenMenu(LEVEL_COMPLETE); }; diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 7b701dc5..3370ada6 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -2,8 +2,6 @@ February 28th -> Begin Internal Game Playtesting March 6th -> Discord/Friend Playtesting March 30th -> Public Demo Release -Add Bonus XP when completing a stage - - Hide mouse cursor during controller play. Reveal it again during mouse play. - Auto aim causes retreat-type moves to aim away from the auto target, and prefer the direction the player's moving in. diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 2bcda6c3..06cb601e 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 7700 +#define VERSION_BUILD 7706 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/VisualNovel.cpp b/Adventures in Lestoria/VisualNovel.cpp index ac04a76f..e412cc7d 100644 --- a/Adventures in Lestoria/VisualNovel.cpp +++ b/Adventures in Lestoria/VisualNovel.cpp @@ -139,6 +139,14 @@ void VisualNovel::Initialize(){ if(line.find("{PAUSE")!=std::string::npos){//Pause command if(arguments.size()!=0)ERR("Arguments size is "<()); + }else + if(line.find("{AUDIOPITCH")!=std::string::npos){//Pause command + if(arguments.size()!=1)ERR("Arguments size is "<(arguments[0])); + }else + if(line.find("{BGM")!=std::string::npos){//Pause command + if(arguments.size()!=1)ERR("Arguments size is "<(arguments[0])); }else{ ERR("Unknown command "<&command:storyLevelData.at(storyLevelName)){ novel.commands.push_back(command.get()); } + Audio::PlayBGM("story"); GameState::ChangeState(States::STORY,0.5f,10U); novel.ExecuteNextCommand(); novel.prevTheme=Menu::GetCurrentTheme().GetThemeName(); Menu::themeSelection="Purple"; } void VisualNovel::Update(){ + Audio::SetBGMPitch(audioPitch); if(transitionTime==0&&game->KEY_CONFIRM.Pressed()){ activeText=U""; novel.ExecuteNextCommand(); @@ -383,4 +393,20 @@ CommandType::CommandType DialogCommand::GetType(){return CommandType::DIALOG;} void PauseCommand::Execute(VisualNovel&vn){} PauseCommand::PauseCommand(){} -CommandType::CommandType PauseCommand::GetType(){return CommandType::PAUSE;} \ No newline at end of file +CommandType::CommandType PauseCommand::GetType(){return CommandType::PAUSE;} + +void AudioPitchCommand::Execute(VisualNovel&vn){ + vn.audioPitch=pitch; + vn.ExecuteNextCommand(); +} +AudioPitchCommand::AudioPitchCommand(std::string pitch) +:pitch(std::stof(pitch)){} +CommandType::CommandType AudioPitchCommand::GetType(){return CommandType::AUDIOPITCH;} + +void BGMCommand::Execute(VisualNovel&vn){ + Audio::PlayBGM(songName); + vn.ExecuteNextCommand(); +} +BGMCommand::BGMCommand(std::string songName) +:songName(songName){} +CommandType::CommandType BGMCommand::GetType(){return CommandType::BGM;} \ No newline at end of file diff --git a/Adventures in Lestoria/VisualNovel.h b/Adventures in Lestoria/VisualNovel.h index 7c6525bd..da46f485 100644 --- a/Adventures in Lestoria/VisualNovel.h +++ b/Adventures in Lestoria/VisualNovel.h @@ -52,7 +52,9 @@ namespace CommandType{ BACKGROUND, RIGHT, LEFT, - LOCATION + LOCATION, + AUDIOPITCH, + BGM, }; } @@ -122,6 +124,22 @@ public: CommandType::CommandType GetType()final override; }; +class AudioPitchCommand final:public Command{ + float pitch; +public: + void Execute(VisualNovel&vn)override; + AudioPitchCommand(std::string pitch); + CommandType::CommandType GetType()final override; +}; + +class BGMCommand final:public Command{ + std::string songName; +public: + void Execute(VisualNovel&vn)override; + BGMCommand(std::string songName); + CommandType::CommandType GetType()final override; +}; + class VisualNovel{ friend class State_Story; friend class AiL; @@ -133,6 +151,7 @@ class VisualNovel{ friend class SpeakerCommand; friend class DialogCommand; friend class PauseCommand; + friend class AudioPitchCommand; std::string storyLevel; std::u32string speakerDisplayName=U""; std::u32string actualSpeakerName=U""; @@ -153,6 +172,7 @@ class VisualNovel{ float backgroundScrollAmt=0; float prevBackgroundScrollAmt=0; static constexpr float maxTextScrollTime=1.0f; + float audioPitch=1.f; public: static Font font,narratorFont,locationFont; private: diff --git a/Adventures in Lestoria/assets/config/audio/bgm.txt b/Adventures in Lestoria/assets/config/audio/bgm.txt index e2800e3d..67598a35 100644 --- a/Adventures in Lestoria/assets/config/audio/bgm.txt +++ b/Adventures in Lestoria/assets/config/audio/bgm.txt @@ -111,4 +111,22 @@ BGM Default Volume = 0%,70%,0%,0%,70%,70%,0% } } + + story + { + Track Name = Foresty Story + + channel[0]=foresty1_1_drums.ogg + channel[1]=foresty1_1_flute.ogg + channel[2]=foresty1_1_strings.ogg + channel[3]=foresty1_1_xtra perc.ogg + + # Transition time between one phase to the next. + Fade Time = 2.0 + + Events + { + Default Volume = 20%,70%,70%,70% + } + } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/story/Chapter 1.txt b/Adventures in Lestoria/assets/config/story/Chapter 1.txt index 34d281f5..03fd25b7 100644 --- a/Adventures in Lestoria/assets/config/story/Chapter 1.txt +++ b/Adventures in Lestoria/assets/config/story/Chapter 1.txt @@ -1,6 +1,9 @@ ===STORY_1_1=== {LOCATION Bleakport Outskirts} {BACKGROUND sea.png} +{BGM story} +{AUDIOPITCH 0.4} + [] You are on your way from Bleakport to the Lestorian Forest, where slimes can be found. @@ -124,6 +127,7 @@ You keep an eye on Sherman as he recovers. The next day you wake to find Sherman no longer lying down but is instead sitting on the grass. +{AUDIOPITCH 1.0} {BACKGROUND commercial_assets/Forest Clearing Campsite_Day.png} [Sherman] @@ -178,6 +182,7 @@ Guess I have to take that answer for now. I am on my way to the Forest then. Bye ===STORY_1_2=== {LOCATION Lestorian Forest} {BACKGROUND sea.png} +{BGM story} [?,Greg] Did you defeat the Monsters? @@ -286,6 +291,8 @@ See you later. ===STORY_1_3=== {LOCATION Stone Wall} {BACKGROUND sea.png} +{BGM story} +{AUDIOPITCH 0.4} [] You see a crack in the Stone Wall. @@ -329,6 +336,7 @@ Then... {RIGHT} *click* {BACKGROUND cave_dark.png} +{AUDIOPITCH 0.05} Darkness. The Stone Cube is still glowing in your hand, but the glow is now very faint. @@ -345,6 +353,9 @@ Returning seems to be no problem, until... Halfway back you suddenly feel a movement. +{BGM foresty_boss} +{AUDIOPITCH 1.0} + An #C72500Earthquake#FFFFFF! It's not a strong one but presents a threat remaining inside a cavern. diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 6bfc7964..e8fabb5b 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ