diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 39d1fc92..042f0b9a 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -280,9 +280,6 @@ bool AiL::OnUserCreate(){ SoundEffect::Initialize(); Menu::InitializeMenus(); - - Inventory::AddItem("Minor Health Potion"s,3); - Inventory::AddItem("Bandages"s,10); ChangePlayerClass(WARRIOR); @@ -928,7 +925,7 @@ void AiL::RenderWorld(float fElapsedTime){ view.DrawPartialRotatedDecal(pos+vf2d{0,-player->GetZ()*(std::signbit(scale.y)?-1:1)},player->GetFrame().GetSourceImage()->Decal(),player->GetSpinAngle(),{12,12},player->GetFrame().GetSourceRect().pos,player->GetFrame().GetSourceRect().size,playerScale*scale,attackBuffs.size()>0?Pixel{255,uint8_t(255*abs(sin(1.4*attackBuffs[0].duration))),uint8_t(255*abs(sin(1.4*attackBuffs[0].duration)))}:WHITE); SetDecalMode(DecalMode::NORMAL); if(player->GetState()==State::BLOCK){ - view.DrawDecal(player->GetPos()-vf2d{12,12},GFX["block.png"].Decal()); + view.DrawDecal(player->GetPos()+vf2d{0,-player->GetZ()*(std::signbit(scale.y)?-1:1)}-vf2d{12,12},GFX["block.png"].Decal()); } }; @@ -3477,25 +3474,29 @@ void AiL::InitializePlayerLevelCap(){ std::cout<<"Level cap detected as "<levelCap)<SetRuntime(0.0); player->level=1; player->stats.Reset(); player->ResetAccumulatedXP(); player->totalXPEarned=0; player->SetMoney(100U); + player->Initialize(); for(int i=0;iClearLoadoutItem(i); } Unlock::unlocks.clear(); Unlock::Initialize(); - State_OverworldMap::SetStageMarker("Stage I-I"); + State_OverworldMap::SetStageMarker("Story I"); State_OverworldMap::UpdateCurrentConnectionPoint(*State_OverworldMap::currentConnectionPoint); State_OverworldMap::ResetConnectionPoints(); SetChapter(1); diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 6742f5bd..7040403c 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -284,7 +284,7 @@ public: void EndGame(); void UpdateDiscordStatus(std::string levelName,std::string className); void InitializePlayerLevelCap(); - void ResetGame(); + void ResetGame(bool changeToMainMenu=true); void OnRequestCompleted(const std::string_view receivedData)const override; void DisableFadeIn(const bool disable); //vi2d provides a tile in world coords. diff --git a/Adventures in Lestoria/CharacterMenuWindow.cpp b/Adventures in Lestoria/CharacterMenuWindow.cpp index 0402e272..8f43ab8d 100644 --- a/Adventures in Lestoria/CharacterMenuWindow.cpp +++ b/Adventures in Lestoria/CharacterMenuWindow.cpp @@ -68,14 +68,19 @@ void Menu::InitializeCharacterMenuWindow(){ characterMenuWindow->ADD("Level Class Display",MenuLabel)(geom2d::rect{vf2d{126.f,windowSize.y-28},{118.f,8.f}},std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName()),1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; characterMenuWindow->ADD("XP Bar",ProgressBar)(geom2d::rect{vf2d{126.f,10.f+windowSize.y-28},{118.f,8.f}},Pixel{247,183,82},BLACK,game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired(),"xp")END; - const static std::arraydisplayAttrs{ - "Health", - "Attack", - "Defense", - "Move Spd %", - "CDR", - "Crit Rate", - "Crit Dmg", + struct AttributeData{ + std::string attrName; + const std::functioncalcFunc; + }; + + const static std::arraydisplayAttrs{ + AttributeData{"Health",[&]()->int{return game->GetPlayer()->GetHealth();}}, + AttributeData{"Attack",[&]()->int{return game->GetPlayer()->GetAttack();}}, + AttributeData{"Defense",[&]()->int{return game->GetPlayer()->GetStat("Defense");}}, + AttributeData{"Move Spd %",[&]()->int{return ceil(game->GetPlayer()->GetMoveSpdMult()*100);}}, + AttributeData{"CDR",[&]()->int{return ceil(game->GetPlayer()->GetCooldownReductionPct()*100);}}, + AttributeData{"Crit Rate",[&]()->int{return ceil(game->GetPlayer()->GetCritRatePct()*100);}}, + AttributeData{"Crit Dmg",[&]()->int{return ceil(game->GetPlayer()->GetCritDmgPct()*100);}}, }; const static std::arrayslotNames{"Helmet","Weapon","Armor","Gloves","Pants","Shoes","Ring 1","Ring 2"}; @@ -93,8 +98,8 @@ void Menu::InitializeCharacterMenuWindow(){ Component(data.component.lock()->parentMenu,"Equip Selection Bottom Outline")->Disable(); Component(data.component.lock()->parentMenu,"Equip Selection Select Button")->Disable(); Component(data.component.lock()->parentMenu,"Character Rotating Display")->Enable(); - for(int counter=0;const std::string&attribute:displayAttrs){ - std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label"); + for(int counter=0;const AttributeData&attribute:displayAttrs){ + std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); statDisplayLabel.lock()->SetStatChangeAmt(0); } data.menu.SetSelection(std::string_view(std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(data.menu.I(A::EQUIP_TYPE)))-1]))); @@ -165,8 +170,8 @@ void Menu::InitializeCharacterMenuWindow(){ comp.lock()->SetSelected(false); } comp.lock()->SetSelected(true); - for(int counter=0;const std::string&attribute:displayAttrs){ - std::shared_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label"); + for(int counter=0;const AttributeData&attribute:displayAttrs){ + std::shared_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); statDisplayLabel->SetStatChangeAmt(0); } std::shared_ptrequipButton=Component(CHARACTER_MENU,"Equip Slot "+slotNames[data.parentComponent.lock()->I(A::INDEXED_THEME)]); @@ -185,8 +190,8 @@ void Menu::InitializeCharacterMenuWindow(){ const std::weak_ptrbuttonItem=button.lock()->GetItem(); std::vectorstatsBeforeEquip; EquipSlot slot=EquipSlot(button.lock()->I(Attribute::EQUIP_TYPE)); - for(const std::string&attribute:displayAttrs){ - statsBeforeEquip.push_back(game->GetPlayer()->GetStat(attribute)); + for(const AttributeData&attribute:displayAttrs){ + statsBeforeEquip.push_back(attribute.calcFunc()); } std::weak_ptrequippedItem=Inventory::GetEquip(slot); @@ -196,9 +201,9 @@ void Menu::InitializeCharacterMenuWindow(){ if(slot==EquipSlot::RING2)otherItem=Inventory::GetEquip(EquipSlot::RING1); if(OppositeRingSlotDoesNotMatchCurrentEquip(button.lock())){ //If we find that the opposite ring slot is equipped to us, this would be an item swap or the exact same ring, therefore no stat calculations apply. Inventory::EquipItem(buttonItem,slot); - for(int counter=0;const std::string&attribute:displayAttrs){ - std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label"); - int statChangeAmt=game->GetPlayer()->GetStat(attribute)-statsBeforeEquip[counter]; + for(int counter=0;const AttributeData&attribute:displayAttrs){ + std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); + int statChangeAmt=attribute.calcFunc()-statsBeforeEquip[counter]; statDisplayLabel.lock()->SetStatChangeAmt(statChangeAmt); counter++; } @@ -219,8 +224,8 @@ void Menu::InitializeCharacterMenuWindow(){ }); equip->SetMouseOutFunc( [](MenuFuncData data){ - for(int counter=0;const std::string&attribute:displayAttrs){ - std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label"); + for(int counter=0;const AttributeData&attribute:displayAttrs){ + std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); statDisplayLabel.lock()->SetStatChangeAmt(0); counter++; } @@ -298,10 +303,10 @@ void Menu::InitializeCharacterMenuWindow(){ characterMenuWindow->ADD("Stat Display Outline",MenuComponent)(geom2d::rect{{245,28},{62,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END; int yOffset=0; - for(const std::string&attribute:displayAttrs){ - std::string attrStr=GetLabelText(ItemAttribute::Get(attribute)); - auto attrLabel=characterMenuWindow->ADD("Attribute "+std::string(ItemAttribute::Get(attribute).Name())+" Label",StatLabel)(geom2d::rect{{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute),1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; - Menu::AddEquipStatListener(attrLabel); + for(const AttributeData&attribute:displayAttrs){ + std::string attrStr=GetLabelText(ItemAttribute::Get(attribute.attrName)); + auto attrLabel=characterMenuWindow->ADD("Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label",StatLabel)(geom2d::rect{{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute.attrName),attribute.calcFunc,1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; + //Menu::AddEquipStatListener(attrLabel); yOffset+=20; } diff --git a/Adventures in Lestoria/ClassSelectionWindow.cpp b/Adventures in Lestoria/ClassSelectionWindow.cpp index 935e5faa..9fba51b1 100644 --- a/Adventures in Lestoria/ClassSelectionWindow.cpp +++ b/Adventures in Lestoria/ClassSelectionWindow.cpp @@ -77,6 +77,11 @@ void Menu::InitializeClassSelectionWindow(){ classSelectionWindow->ADD("Confirm",MenuComponent)(geom2d::rect{{outlineSize.x+4-navigationButtonSize.x-2,outlineSize.y+29-navigationButtonSize.y-14},navigationButtonSize},"Confirm",[](MenuFuncData data){ std::string selectedClass=data.component.lock()->S(A::CLASS_SELECTION); + + //Player starting items. + Inventory::AddItem("Minor Health Potion"s,3); + Inventory::AddItem("Bandages"s,10); + data.game->ChangePlayerClass(classutils::StringToClass(selectedClass)); #ifdef __EMSCRIPTEN__ if(SaveFile::IsOnline()){ diff --git a/Adventures in Lestoria/EquipSlotButton.h b/Adventures in Lestoria/EquipSlotButton.h index 1753d925..62a157d5 100644 --- a/Adventures in Lestoria/EquipSlotButton.h +++ b/Adventures in Lestoria/EquipSlotButton.h @@ -62,4 +62,12 @@ public: inline const EquipSlot GetSlot()const{ return slot; } + inline virtual void DrawDecal(ViewPort&window,bool focused)override final{ + MenuItemItemButton::DrawDecal(window,focused); + if(!itemRef.expired()&&itemRef.lock()->EnhancementLevel()>0){ + const std::string enhanceLevelStr="+"+std::to_string(itemRef.lock()->EnhancementLevel()); + vi2d enhanceLevelStrSize=game->GetTextSize(enhanceLevelStr)*0.75f; + window.DrawShadowStringDecal(rect.pos+rect.size-enhanceLevelStrSize,enhanceLevelStr,GREEN,BLACK,vf2d{0.75f,0.75f}); + } + } }; \ No newline at end of file diff --git a/Adventures in Lestoria/Item.cpp b/Adventures in Lestoria/Item.cpp index c331d90a..b108a486 100644 --- a/Adventures in Lestoria/Item.cpp +++ b/Adventures in Lestoria/Item.cpp @@ -638,7 +638,7 @@ const std::string Item::DisplayName()const{ if(_IsBlank())return BLANK_ITEM_NAME; std::string name=ActualName(); if(IsEquippable()&&EnhancementLevel()>0){ - name+=" [+"+std::to_string(EnhancementLevel())+"]"; + name+=" [#00FF00+"+std::to_string(EnhancementLevel())+"#FFFFFF]"; } return name; } diff --git a/Adventures in Lestoria/LevelCompleteWindow.cpp b/Adventures in Lestoria/LevelCompleteWindow.cpp index b0f6bb63..7321c957 100644 --- a/Adventures in Lestoria/LevelCompleteWindow.cpp +++ b/Adventures in Lestoria/LevelCompleteWindow.cpp @@ -66,21 +66,27 @@ void Menu::InitializeLevelCompleteWindow(){ levelCompleteWindow->ADD("Stage Loot Label",MenuLabel)(geom2d::rect{{0,108},{windowSize.size.x-80.f,12}},"Stage Loot",1,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE)END; auto stageLootWindow=levelCompleteWindow->ADD("Stage Loot Window",InventoryScrollableWindowComponent)(geom2d::rect{{0,120},{windowSize.size.x-80.f,60}},"Stage Loot Popup Item Name","Stage Loot Popup Item Description",DO_NOTHING,InventoryCreator::Player_InventoryUpdate)END; Menu::AddInventoryListener(stageLootWindow,"Stage Loot"); + + auto overworldMapAction=[](MenuFuncData data){ + if(Component(LEVEL_COMPLETE,"Stage Complete Label")->GetLabel()!="Stage Summary"){ //If the label says stage summary, we didn't actually complete the level. Don't unlock anything new for the player. + Unlock::UnlockArea(State_OverworldMap::GetCurrentConnectionPoint().map); + Merchant::RandomizeTravelingMerchant(); + } + GameState::ChangeState(States::OVERWORLD_MAP,0.25f); + return true; + }; auto nextButtonAction=[](MenuFuncData data){ Unlock::UnlockArea(State_OverworldMap::GetCurrentConnectionPoint().map); Merchant::RandomizeTravelingMerchant(); - if(Unlock::IsUnlocked("STORY_1_1")){ - GameState::ChangeState(States::GAME_HUB,0.25f); - }else{ - GameState::ChangeState(States::OVERWORLD_MAP,0.25f); - } + GameState::ChangeState(States::GAME_HUB,0.25f); return true; }; - 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; + levelCompleteWindow->ADD("Level Details Outline",MenuComponent)(geom2d::rect{{windowSize.size.x-72.f,32},{71,56}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE|ButtonAttr::FIT_TO_LABEL)END; + levelCompleteWindow->ADD("Level EXP Gain Outline",MenuLabel)(geom2d::rect{{windowSize.size.x-72.f,88},{71,36}},"+ Exp",1,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; + levelCompleteWindow->ADD("Overworld Button",MenuComponent)(geom2d::rect{{windowSize.size.x-72.f,128},{71,24}},"Return\nto Map",overworldMapAction,ButtonAttr::FIT_TO_LABEL)END; + levelCompleteWindow->ADD("Next Button",MenuComponent)(geom2d::rect{{windowSize.size.x-72.f,156},{71,24}},"Proceed\nto Camp",nextButtonAction,ButtonAttr::FIT_TO_LABEL)END; levelCompleteWindow->ADD("Monster Loot Popup Item Name",PopupMenuLabel)(geom2d::rect{{0,108},{windowSize.size.x-80.f,12}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; levelCompleteWindow->ADD("Monster Loot Popup Item Description",PopupMenuLabel)(geom2d::rect{{0,120},{windowSize.size.x-80.f,60}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; diff --git a/Adventures in Lestoria/PauseMenu.cpp b/Adventures in Lestoria/PauseMenu.cpp index 36f226e7..9d6267c9 100644 --- a/Adventures in Lestoria/PauseMenu.cpp +++ b/Adventures in Lestoria/PauseMenu.cpp @@ -43,6 +43,7 @@ All rights reserved. #include "AdventuresInLestoria.h" #include "CharacterRotatingDisplay.h" #include "ClassInfo.h" +#include "Unlock.h" INCLUDE_game INCLUDE_GFX @@ -69,9 +70,14 @@ void Menu::InitializePauseWindow(){ Menu::OpenMenu(SETTINGS); return true; },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){ + pauseWindow->ADD("Return to Camp Button",MenuComponent)(geom2d::rect{{6.f,112.f},{84.f,24.f}},"Leave Area",[](MenuFuncData data){ Component(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Summary"); Component(LEVEL_COMPLETE,"Level Details Outline")->SetLabel(""); + if(Unlock::IsUnlocked("STORY_1_1")){ + Component(LEVEL_COMPLETE,"Next Button")->Enable(); + }else{ + Component(LEVEL_COMPLETE,"Next Button")->Disable(); + } 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 70247585..f156f76b 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1035,9 +1035,9 @@ void Player::CheckEndZoneCollision(){ Component(LEVEL_COMPLETE,"Stage Complete Label")->SetLabel("Stage Completed"); Component(LEVEL_COMPLETE,"Level Details Outline")->SetLabel("Complete Bonus\n +10% XP"); if(Unlock::IsUnlocked("STORY_1_1")){ - Component(LEVEL_COMPLETE,"Next Button")->SetLabel("Proceed\nto Camp"); + Component(LEVEL_COMPLETE,"Next Button")->Enable(); }else{ - Component(LEVEL_COMPLETE,"Next Button")->SetLabel("Proceed"); + Component(LEVEL_COMPLETE,"Next Button")->Disable(); } GameState::ChangeState(States::LEVEL_COMPLETE); } diff --git a/Adventures in Lestoria/ProgressBar.h b/Adventures in Lestoria/ProgressBar.h index d2314e57..5e24c41d 100644 --- a/Adventures in Lestoria/ProgressBar.h +++ b/Adventures in Lestoria/ProgressBar.h @@ -69,8 +69,8 @@ public: this->subText=subText; } inline virtual void DrawDecal(ViewPort&window,bool focused)override final{ - - float barPct=float(currentProgress)/float(finalProgress); + float barPct=0.f; + if(finalProgress>0.01f)barPct=float(currentProgress)/float(finalProgress); vf2d barSize=rect.size-vf2d{2.f,2.f}; Pixel lighterCol=backCol; lighterCol.r=std::min(255U,lighterCol.r+30U); diff --git a/Adventures in Lestoria/StatLabel.h b/Adventures in Lestoria/StatLabel.h index 58ddc755..18db80f2 100644 --- a/Adventures in Lestoria/StatLabel.h +++ b/Adventures in Lestoria/StatLabel.h @@ -45,16 +45,17 @@ INCLUDE_game class StatLabel:public MenuLabel{ private: + const std::functionstatCalculation; ItemAttribute stat; int value=0; int statChangeAmt=0; public: - inline StatLabel(geom2d::rectrect,ItemAttribute stat,int scale=1,ComponentAttr attributes=ComponentAttr::NONE) - :MenuLabel(rect,"",scale,attributes),stat(stat){ + inline StatLabel(geom2d::rectrect,ItemAttribute stat,const std::functionstatCalculation,int scale=1,ComponentAttr attributes=ComponentAttr::NONE) + :MenuLabel(rect,"",scale,attributes),stat(stat),statCalculation(statCalculation){ border=attributes&ComponentAttr::OUTLINE; this->background=attributes&ComponentAttr::BACKGROUND; showDefaultLabel=false; - SetValue(game->GetPlayer()->GetStat(stat)); + SetValue(statCalculation()); } void SetValue(int value){ this->value=value; @@ -68,9 +69,6 @@ protected: inline void SetLabel(std::string text)override final{ MenuLabel::SetLabel(text); } - inline void OnEquipStatsUpdate()override final{ - SetValue(game->GetPlayer()->GetStat(stat)); - } inline void UpdateLabel(){ std::string attrStr=std::string(stat.Name())+"\n "; attrStr+=std::to_string(value); @@ -85,4 +83,10 @@ protected: } SetLabel(attrStr); } + inline virtual void Update(AiL*game)override final{ + MenuLabel::Update(game); + + SetValue(statCalculation()); + UpdateLabel(); + } }; \ No newline at end of file diff --git a/Adventures in Lestoria/State_Death.cpp b/Adventures in Lestoria/State_Death.cpp index def24fb4..ce2b4e94 100644 --- a/Adventures in Lestoria/State_Death.cpp +++ b/Adventures in Lestoria/State_Death.cpp @@ -55,7 +55,7 @@ void State_Death::OnStateChange(GameState*prevState){ } game->GetPlayer()->SetState(State::DEATH); if(!Unlock::IsUnlocked("STORY_1_1")){ - Component(DEATH,"Return to Camp Button")->SetLabel(" Return to \nStage Select"); + Component(DEATH,"Return to Camp Button")->SetLabel(" Return to \nStage Select"); }else{ Component(DEATH,"Return to Camp Button")->SetLabel("Return to Camp"); } @@ -64,9 +64,7 @@ void State_Death::OnStateChange(GameState*prevState){ accTime=0.f; } void State_Death::OnLevelLoad(){ - Component(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut( - !Unlock::IsUnlocked("STORY_1_1")||game->GetCurrentMapName()=="HUB" - ); + Component(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(false); } void State_Death::OnUserUpdate(AiL*game){ accTime+=game->GetElapsedTime(); diff --git a/Adventures in Lestoria/State_GameRun.cpp b/Adventures in Lestoria/State_GameRun.cpp index 95fd1428..4ba81b92 100644 --- a/Adventures in Lestoria/State_GameRun.cpp +++ b/Adventures in Lestoria/State_GameRun.cpp @@ -77,9 +77,7 @@ void State_GameRun::OnStateChange(GameState*prevState){ game->LoadLevel(State_OverworldMap::GetCurrentConnectionPoint().map); } void State_GameRun::OnLevelLoad(){ - Component(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut( - !Unlock::IsUnlocked("STORY_1_1")||game->GetCurrentMapName()=="HUB" - ); + Component(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(false); if(!Tutorial::TaskIsComplete(TutorialTaskName::MOVE_AROUND)){ Tutorial::SetNextTask(TutorialTaskName::MOVE_AROUND); } diff --git a/Adventures in Lestoria/State_LevelComplete.cpp b/Adventures in Lestoria/State_LevelComplete.cpp index 9d84742d..521097c6 100644 --- a/Adventures in Lestoria/State_LevelComplete.cpp +++ b/Adventures in Lestoria/State_LevelComplete.cpp @@ -61,7 +61,7 @@ void State_LevelComplete::OnStateChange(GameState*prevState){ accumulatedXP=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. + if(Component(LEVEL_COMPLETE,"Stage Complete Label")->GetLabel()!="Stage Summary"){ //If the label says stage summary, we didn't actually complete 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; uint8_t randomAmt=data.maxAmt; @@ -102,7 +102,7 @@ void State_LevelComplete::OnUserUpdate(AiL*game){ if(accumulatedXP>0){ lastXPChangeTimer-=game->GetElapsedTime(); Audio::Engine().SetVolume(xpGainSound,0.6f); - while(lastXPChangeTimer<=0.f){ + if(lastXPChangeTimer<=0.f){ int incrementAmt=int(accumulatedXP/(1/"Interface.HUD XP Bar Tick Rate"_F))+1; accumulatedXP-=incrementAmt; auto progressBar=Component(MenuType::LEVEL_COMPLETE,"XP Bar"); @@ -113,7 +113,7 @@ void State_LevelComplete::OnUserUpdate(AiL*game){ progressBar->ResetProgressBar(progressBar->GetCurrentProgress()-progressBar->GetFinalProgress(),game->GetPlayer()->NextLevelXPRequired()); SoundEffect::PlaySFX("Level Up",SoundEffect::CENTERED); } - lastXPChangeTimer+="Interface.HUD XP Bar Tick Rate"_F; + lastXPChangeTimer="Interface.HUD XP Bar Tick Rate"_F; } }else{ Audio::Engine().SetVolume(xpGainSound,0.f); diff --git a/Adventures in Lestoria/State_MainMenu.cpp b/Adventures in Lestoria/State_MainMenu.cpp index a72b5d63..6764821b 100644 --- a/Adventures in Lestoria/State_MainMenu.cpp +++ b/Adventures in Lestoria/State_MainMenu.cpp @@ -55,6 +55,7 @@ void State_MainMenu::OnLevelLoad(){ game->GetPlayer()->SetIframes(999999.f); game->GetPlayer()->SetInvisible(true); SelectAndMoveToNewFocusArea(); + game->ResetGame(false); } void State_MainMenu::OnUserUpdate(AiL*game){ game->GetPlayer()->SetIframes(999999.f); diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 529c1740..22bc01fb 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -28,4 +28,4 @@ Materials for initial craft seems to be wrong? need to recheck do we need a minimap? (maybe with fog of war?) Maybe polling that once testing with more people. should gemstones dropp from boss stages aswell? (Maybe lower droprate?) chasing blue slime as warrior aint no fun, nerf there move spd (-5% maybe?) -feature to lock accesoires to protect them from selling would be nice \ No newline at end of file +feature to lock accesoires to protect them from selling would be nice diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 4d2a0534..2b276165 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -38,8 +38,8 @@ All rights reserved. #pragma once #define VERSION_MAJOR 0 #define VERSION_MINOR 4 -#define VERSION_PATCH 3 -#define VERSION_BUILD 7885 +#define VERSION_PATCH 4 +#define VERSION_BUILD 7886 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx b/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx index 49678a85..6268cd68 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx @@ -1,5 +1,5 @@ - + diff --git a/Adventures in Lestoria/assets/Campaigns/1_8.tmx b/Adventures in Lestoria/assets/Campaigns/1_8.tmx index 639f872e..d99138dc 100644 --- a/Adventures in Lestoria/assets/Campaigns/1_8.tmx +++ b/Adventures in Lestoria/assets/Campaigns/1_8.tmx @@ -1,5 +1,5 @@ - + diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 9a20e3d3..150656b3 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ