Merge pull request 'MiscFixes' (#104) from MiscFixes into master
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m33s

Reviewed-on: #104
This commit is contained in:
sigonasr2 2026-01-23 15:06:05 -06:00
commit 7d598b7469
12 changed files with 32 additions and 23 deletions

View File

@ -74,6 +74,7 @@ namespace BuffTests
Menu::InitializeMenus();
Tutorial::Initialize();
Stats::InitializeDamageReductionTable();
Monster::InitializeStrategies();
GameState::Initialize();
GameState::STATE=GameState::states.at(States::State::GAME_RUN);

View File

@ -81,6 +81,7 @@ namespace EnchantTests
Menu::InitializeMenus();
Tutorial::Initialize();
Stats::InitializeDamageReductionTable();
Monster::InitializeStrategies();
GameState::Initialize();
GameState::STATE=GameState::states.at(States::State::GAME_RUN);

View File

@ -283,7 +283,7 @@
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;$(ProjectDir)steam;$(ProjectDir)discord-files;C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\LabUser\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\niconiconii\OneDrive\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)steam;$(ProjectDir)discord-files;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>

View File

@ -444,6 +444,12 @@ bool AiL::OnConsoleCommand(const std::string& sCommand){
std::weak_ptr<Item>accessory{Inventory::AddItem(args[1])};
if(args.size()>=3)accessory.lock()->_EnchantItem(ItemEnchant{args[2]});
ConsoleOut()<<"Added "<<args[1]<<" to player's inventory."<<std::endl;
}else
if(args[0]=="/mana"){
if(args.size()>=2){
GetPlayer()->mana=std::stoi(args[1]);
ConsoleOut()<<"Set Player's mana to "<<GetPlayer()->mana<<std::endl;
}else ConsoleOut()<<"Usage: /mana <val>"<<std::endl;
}else{
ConsoleOut()<<"Invalid command! Use /help to see available commands."<<std::endl;
}
@ -1072,14 +1078,16 @@ void AiL::RenderWorld(float fElapsedTime){
const std::vector<Buff>damageReductionBuffs{player->GetBuffs(BuffType::DAMAGE_REDUCTION)};
const std::vector<Buff>inkSlowdownDebuff{player->GetBuffs(BuffType::INK_SLOWDOWN)};
const std::vector<Buff>curseDebuff{player->GetBuffs(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_DOT)};
const std::vector<Buff>hastenBuff{player->GetBuffs(BuffType::HASTEN)};
const bool displayCoinSymbol{player->GetBuffs(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_COIN).size()>0};
Pixel playerCol{WHITE};
if(attackBuffs.size()>0)playerCol={255,uint8_t(255*abs(sin(1.4f*attackBuffs[0].duration))),uint8_t(255*abs(sin(1.4f*attackBuffs[0].duration)))};
else if(adrenalineRushBuffs.size()>0)playerCol={uint8_t(255*abs(sin(6.f*adrenalineRushBuffs[0].duration))),255,uint8_t(255*abs(sin(6.f*adrenalineRushBuffs[0].duration)))};
else if(movespeedBuffs.size()>0)playerCol={uint8_t(255*abs(sin(2.f*movespeedBuffs[0].duration))),255,uint8_t(255*abs(sin(2.f*movespeedBuffs[0].duration)))};
else if(inkSlowdownDebuff.size()>0)playerCol={uint8_t(255*abs(sin(2.f*inkSlowdownDebuff[0].duration))),uint8_t(255*abs(sin(2.f*inkSlowdownDebuff[0].duration))),uint8_t(255*abs(sin(2.f*inkSlowdownDebuff[0].duration)))};
if(attackBuffs.size()>0)playerCol={255,uint8_t(255*abs(sin(1.4f*attackBuffs[0].lifetime))),uint8_t(255*abs(sin(1.4f*attackBuffs[0].lifetime)))};
else if(adrenalineRushBuffs.size()>0)playerCol={uint8_t(255*abs(sin(6.f*adrenalineRushBuffs[0].lifetime))),255,uint8_t(255*abs(sin(6.f*adrenalineRushBuffs[0].lifetime)))};
else if(movespeedBuffs.size()>0)playerCol={uint8_t(255*abs(sin(2.f*movespeedBuffs[0].lifetime))),255,uint8_t(255*abs(sin(2.f*movespeedBuffs[0].lifetime)))};
else if(inkSlowdownDebuff.size()>0)playerCol={uint8_t(255*abs(sin(2.f*inkSlowdownDebuff[0].lifetime))),uint8_t(255*abs(sin(2.f*inkSlowdownDebuff[0].lifetime))),uint8_t(255*abs(sin(2.f*inkSlowdownDebuff[0].lifetime)))};
else if(curseDebuff.size()>0)playerCol={uint8_t(128*abs(sin(2.f*GetRunTime()))+127),uint8_t(128*abs(sin(2.f*GetRunTime()))),uint8_t(128*abs(sin(2.f*GetRunTime()))+127)};
else if(hastenBuff.size()>0)playerCol={uint8_t(abs(sin(0.4f*GetRunTime()))+127),uint8_t(0),uint8_t(0)};
if(player->HasIframes())playerCol.a*=0.62f;
@ -1998,11 +2006,11 @@ void AiL::RenderHud(){
DrawDecal({2,2},GFX["heart_outline.png"].Decal(),{1.f,1.f},healthOutlineCol);
const Decal*heartImg{GFX["heart.png"].Decal()};
if(player->GetShield()>0)heartImg=GFX["shield_heart.png"].Decal();
float healthRatio{float(healthCounter.GetDisplayValue())/player->GetMaxHealth()};
float manaRatio{float(manaCounter.GetDisplayValue())/player->GetMaxMana()};
DrawPartialDecal(vf2d{2.f,floor(2+(15*(1-healthRatio)))},const_cast<Decal*>(heartImg),vf2d{0.f,floor(15*(1-healthRatio))},vf2d{17.f,floor(15*healthRatio)});
int healthRatio{int((float(healthCounter.GetDisplayValue())/player->GetMaxHealth())*100)};
int manaRatio{int((float(manaCounter.GetDisplayValue())/player->GetMaxMana())*100)};
DrawPartialDecal(vi2d{2,2+int((15*(100-healthRatio))/100.f)},const_cast<Decal*>(heartImg),vi2d{0,int(15*(100-healthRatio)/100.f)},vi2d{17,int(15*healthRatio/100.f)});
DrawDecal({2,20},GFX["mana_outline.png"].Decal());
DrawPartialDecal(vf2d{2,float(20+(15*(1-manaRatio)))},GFX["mana.png"].Decal(),vf2d{0.f,float(15*(1-manaRatio))},vf2d{17,float(15*manaRatio)});
DrawPartialDecal(vi2d{2,20+int((15*(100-manaRatio))/100.f)},GFX["mana.png"].Decal(),vi2d{0,int(15*(100-manaRatio)/100.f)},vi2d{17,int(15*manaRatio/100.f)});
std::string text=player->GetHealth()>0?std::to_string(healthCounter.GetDisplayValue()+shieldCounter.GetDisplayValue()):"X";
std::string text_mana=std::to_string(manaCounter.GetDisplayValue());

View File

@ -46,6 +46,7 @@ All rights reserved.
#include "SoundEffect.h"
INCLUDE_game
INCLUDE_GFX
void Menu::InitializeArtificerDisassembleWindow(){
Menu*artificerDisassembleWindow=CreateMenu(ARTIFICER_DISASSEMBLE,CENTERED,game->GetScreenSize()-vi2d{52,52});
@ -109,7 +110,7 @@ void Menu::InitializeArtificerDisassembleWindow(){
EnableDisassemblyDisplay();
RowItemDisplay&item{*DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component)};
Component<MenuItemItemButton>(data.menu.type,"Item Icon")->SetItem(item.GetItem().lock());
Component<MenuIconButton>(data.menu.type,"Disassembly Result")->SetIcon(item.GetItem().lock()->Icon().Decal());
Component<MenuIconButton>(data.menu.type,"Disassembly Result")->SetIcon(GFX[item.GetItem().lock()->FragmentIcon().value_or("pixel.png")].Decal());
Component<MenuLabel>(data.menu.type,"Disassembly Result Title")->SetLabel(item.GetItem().lock()->FragmentName());
Component<MenuLabel>(data.menu.type,"Fragment Total Count")->SetLabel(std::format("Currently Owned: {}",Inventory::GetItemCount(item.GetItem().lock()->FragmentName())));
return true;
@ -119,7 +120,7 @@ void Menu::InitializeArtificerDisassembleWindow(){
if(childComponent){
RowItemDisplay&item{childComponent.value().get()};
Component<MenuItemItemButton>(data.menu.type,"Item Icon")->SetItem(item.GetItem().lock());
Component<MenuIconButton>(data.menu.type,"Disassembly Result")->SetIcon(item.GetItem().lock()->Icon().Decal());
Component<MenuIconButton>(data.menu.type,"Disassembly Result")->SetIcon(GFX[item.GetItem().lock()->FragmentIcon().value_or("pixel.png")].Decal());
Component<MenuLabel>(data.menu.type,"Disassembly Result Title")->SetLabel(item.GetItem().lock()->FragmentName());
Component<MenuLabel>(data.menu.type,"Fragment Total Count")->SetLabel(std::format("Currently Owned: {}",Inventory::GetItemCount(item.GetItem().lock()->FragmentName())));
EnableDisassemblyDisplay();

View File

@ -7,4 +7,5 @@ Items with spaces must be surrounded in quotation marks "".
Valid Commands are:
/help - Shows this help file.
/give <Item Name> [Amount] - Gives an item of type <Item Name> into the player's inventory. Optionally adds [Amount] amount of items to the player's inventory.
/accessory <Accessory Name> [Enchant Name] - Gives an accessory of type <Accessory Name> into the player's inventory. Optionally adds an enchant of type [Enchant Name].
/accessory <Accessory Name> [Enchant Name] - Gives an accessory of type <Accessory Name> into the player's inventory. Optionally adds an enchant of type [Enchant Name].
/mana <val> - Sets player's mana to val.

View File

@ -497,13 +497,14 @@ void Monster::Draw()const{
const auto HasBuff=[&](const BuffType buff){return GetBuffs(buff).size()>0;};
//The lerpCutAmount is how much to divide the initial color by, which is used as the lerp oscillation amount. 0.5 means half the color is always active, and the other half linearly oscillates. 0.1 would mean 90% of the color is normal and 10% of the color oscillates.
const auto GetBuffBlendCol=[&](const BuffType buff,const float oscillationTime_s,const Pixel blendCol,const float lerpCutAmount=0.5f){return Pixel{uint8_t(blendCol.r*(1-lerpCutAmount)+blendCol.r*lerpCutAmount*abs(sin(oscillationTime_s*PI*GetBuffs(buff)[0].duration))),uint8_t(blendCol.g*(1-lerpCutAmount)+blendCol.g*lerpCutAmount*abs(sin(oscillationTime_s*PI*GetBuffs(buff)[0].duration))),uint8_t(blendCol.b*(1-lerpCutAmount)+blendCol.b*lerpCutAmount*abs(sin(oscillationTime_s*PI*GetBuffs(buff)[0].duration)))};};
const auto GetBuffBlendCol=[&](const BuffType buff,const float oscillationTime_s,const Pixel blendCol,const float lerpCutAmount=0.5f){return Pixel{uint8_t(blendCol.r*(1-lerpCutAmount)+blendCol.r*lerpCutAmount*abs(sin(oscillationTime_s*PI*GetBuffs(buff)[0].lifetime))),uint8_t(blendCol.g*(1-lerpCutAmount)+blendCol.g*lerpCutAmount*abs(sin(oscillationTime_s*PI*GetBuffs(buff)[0].lifetime))),uint8_t(blendCol.b*(1-lerpCutAmount)+blendCol.b*lerpCutAmount*abs(sin(oscillationTime_s*PI*GetBuffs(buff)[0].lifetime)))};};
if(HasBuff(BuffType::BURNING_ARROW_BURN))blendCol=GetBuffBlendCol(BuffType::BURNING_ARROW_BURN,1.f,{255,160,0});
else if(HasBuff(BuffType::DAMAGE_AMPLIFICATION))blendCol=GetBuffBlendCol(BuffType::DAMAGE_AMPLIFICATION,1.4f,{255,0,0});
else if(HasBuff(BuffType::CURSE_OF_DEATH))blendCol=GetBuffBlendCol(BuffType::CURSE_OF_DEATH,1.4f,{255,0,0});
else if(HasBuff(BuffType::COLOR_MOD))blendCol=GetBuffBlendCol(BuffType::COLOR_MOD,1.4f,PixelRaw(GetBuffs(BuffType::COLOR_MOD)[0].intensity),1.f);
else if(HasBuff(BuffType::SLOWDOWN))blendCol=GetBuffBlendCol(BuffType::SLOWDOWN,1.4f,{255,255,128},0.5f);
else if(HasBuff(BuffType::HASTEN))blendCol=GetBuffBlendCol(BuffType::HASTEN,0.4f,{128,0,0},1.f);
else if(glowPurpleBuff.has_value())blendCol=Pixel{uint8_t(255*abs(sin(1.4*glowPurpleBuff.value().duration))),uint8_t(255*abs(sin(1.4*glowPurpleBuff.value().duration))),uint8_t(128+127*abs(sin(1.4*glowPurpleBuff.value().duration)))};
const vf2d hitTimerOffset=vf2d{sin(20*PI*lastHitTimer+randomFrameOffset),0.f}*2.f*GetSizeMult();

View File

@ -716,10 +716,7 @@ class TMXParser{
int&neighborElement=newConnection.neighbors[direction];
if(neighborElement!=-1)ERR(std::format("WARNING! Connection Point in direction {} is already occupied by node {}!",direction,neighborElement));
const int val{key2.second.GetInteger()};
if(val==0){
LOG(std::format("WARNING! {} is supposedly connected to {}, this is very likely a mistake!!!",newConnection.name,State_OverworldMap::connections[val].name));
continue; //Prevents accidental connections to index 0 (Which shouldn't be happening)!
}
if(val==0)continue; //A value of "0" indicates it is unset in Tiled.
newConnection.neighbors[direction]=val;
}
}

View File

@ -12,11 +12,9 @@ You get placed in an arena that changes every 5 waves visually and spawns random
Instead of the area buffs i switched to giving highest exp and locking extra lore behind first time wave completions.
Red flashing entity with hasten buff
Mouse usage on overworld map might be screwed up with other menus open
"0" is always invalid? Potentially
Mana icon pixel snapping
For Demo Branch:
Cherry pick b715dd994d4921e9be1811ceb7eb84120a5e6455 from MiscFixes
Cherry pick f398adcde6bb5f8c3c0581f13f18e73d4417a46c from ConnectionPointFixes
DEMO
====

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 12298
#define VERSION_BUILD 12316
#define stringify(a) stringify_(a)
#define stringify_(a) #a

View File

@ -578,6 +578,7 @@
<object id="2" name="Temp Player Spawn" type="PlayerSpawnLocation" x="240" y="325" width="20" height="20"/>
<object id="3" name="Stage I-I" type="StagePlate" x="292" y="496" width="44" height="16">
<properties>
<property name="Connection 1 - North" type="object" value="0"/>
<property name="Connection 2 - East" type="object" value="5"/>
<property name="Connection 3 - South" type="object" value="4"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_1_1"/>