diff --git a/Adventures in Lestoria/Bomb.cpp b/Adventures in Lestoria/Bomb.cpp index 53118749..d6e188aa 100644 --- a/Adventures in Lestoria/Bomb.cpp +++ b/Adventures in Lestoria/Bomb.cpp @@ -40,6 +40,7 @@ All rights reserved. #include "util.h" #include "AdventuresInLestoria.h" #include "BombBoom.h" +#include "SoundEffect.h" INCLUDE_DATA INCLUDE_ANIMATION_DATA @@ -67,6 +68,7 @@ void Bomb::Update(float fElapsedTime){ z=0; //Force the bomb to be grounded. fadeOutTime=bombFadeoutTime; game->AddEffect(std::make_unique(pos,0.f,OnUpperLevel(),vf2d{radius,radius}/12.f/1.5f/*Upscale 24x24 to 36x36*/,1.f,vf2d{},WHITE,0.f,0.f,true)); + SoundEffect::PlaySFX("Bomb Explode",pos); float distToPlayer=geom2d::line(pos,game->GetPlayer()->GetPos()).length(); if(friendly){ const MonsterHurtList hurtEnemies=game->HurtEnemies(pos,radius,damage,OnUpperLevel(),z); diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 80a55262..2cff2454 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -979,11 +979,11 @@ void DeathSpawnInfo::Spawn(const vf2d monsterDeathPos,const bool onUpperLevel){ } void Monster::ProximityKnockback(const vf2d centerPoint,const float knockbackFactor){ - geom2d::linelineToMonster(centerPoint,game->GetPlayer()->GetPos()); + geom2d::linelineToMonster(centerPoint,GetPos()); float dist=lineToMonster.length(); if(dist<0.001f){ float randomDir=util::random(2*PI); lineToMonster={centerPoint,centerPoint+vf2d{cos(randomDir),sin(randomDir)}*1}; } - game->GetPlayer()->Knockback(lineToMonster.vector().norm()*knockbackFactor); + Knockback(lineToMonster.vector().norm()*knockbackFactor); } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index e5872932..8ba32c26 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -233,6 +233,7 @@ private: vf2d mountedSprOffset{}; private: struct STRATEGY{ + static std::string ERR; static int _GetInt(Monster&m,std::string param,std::string strategy,int index=0); static float _GetFloat(Monster&m,std::string param,std::string strategy,int index=0); static Pixel _GetPixel(Monster&m,std::string param,std::string strategy,int index=0); diff --git a/Adventures in Lestoria/RUN_STRATEGY.cpp b/Adventures in Lestoria/RUN_STRATEGY.cpp index 8185e377..13dab894 100644 --- a/Adventures in Lestoria/RUN_STRATEGY.cpp +++ b/Adventures in Lestoria/RUN_STRATEGY.cpp @@ -42,6 +42,8 @@ All rights reserved. INCLUDE_DATA INCLUDE_STRATEGY_DATA +std::string Monster::STRATEGY::ERR{}; + void Monster::InitializeStrategies(){ STRATEGY_DATA.insert("Run Towards",Monster::STRATEGY::RUN_TOWARDS); STRATEGY_DATA.insert("Shoot Afar",Monster::STRATEGY::SHOOT_AFAR); @@ -103,7 +105,7 @@ const std::string&Monster::STRATEGY::_GetString(Monster&m,std::string param,std: return DATA["MonsterStrategy"][strategy].GetProperty(param).GetString(index); }else{ ERR(std::format("Monster {} trying to read non-existent String Property {}[{}] for Strategy {}. THIS SHOULD NOT BE HAPPENING!",m.GetName(),param,index,strategy)) - return{}; + return ERR; } } vf2d Monster::STRATEGY::_GetVec(Monster&m,std::string param,std::string strategy,int index){ @@ -131,7 +133,7 @@ const datafile&Monster::STRATEGY::_Get(Monster&m,std::string param,std::string s return DATA["MonsterStrategy"][strategy].GetProperty(param); }else{ ERR(std::format("Monster {} trying to read non-existent Data Property {} for Strategy {}",m.GetName(),param,strategy)); - return{}; + return DATA; } } Pixel Monster::STRATEGY::_GetPixel(Monster&m,std::string param,std::string strategy,int index){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 76948412..e17ca3f3 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 0 -#define VERSION_BUILD 9237 +#define VERSION_BUILD 9247 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/audio/events.txt b/Adventures in Lestoria/assets/config/audio/events.txt index bab2d69a..2ce91308 100644 --- a/Adventures in Lestoria/assets/config/audio/events.txt +++ b/Adventures in Lestoria/assets/config/audio/events.txt @@ -13,6 +13,12 @@ Events # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) File[0] = bear_slam.ogg, 70% } + Bomb Explode + { + CombatSound = True + # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) + File[0] = bomb_explosion.ogg, 100% + } Button Click { # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) diff --git a/Adventures in Lestoria/assets/sounds/bomb_explosion.ogg b/Adventures in Lestoria/assets/sounds/bomb_explosion.ogg new file mode 100644 index 00000000..12f295cb Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/bomb_explosion.ogg differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 26ecb459..88008866 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ