diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 85ef9e8d..1049be07 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -1866,7 +1866,7 @@ void AiL::RenderHud(){ } Pixel healthOutlineCol=BLACK; - if(player->GetHealth()/player->GetMaxHealth()<="Player.Health Warning Pct"_F/100.f){ + if(player->GetHealth()/float(player->GetMaxHealth())<="Player.Health Warning Pct"_F/100.f){ float runTimeAmt=fmod(GetRunTime(),"Player.Health Warning Flicker Time"_F*2); if(runTimeAmt<"Player.Health Warning Flicker Time"_F){ healthOutlineCol="Player.Health Warning Outline Color"_Pixel; diff --git a/Adventures in Lestoria/Audio.cpp b/Adventures in Lestoria/Audio.cpp index dd82f7f3..c80da7b2 100644 --- a/Adventures in Lestoria/Audio.cpp +++ b/Adventures in Lestoria/Audio.cpp @@ -341,7 +341,7 @@ void Audio::Update(){ Self().fadeToTargetVolumeTime=std::max(0.f,Self().fadeToTargetVolumeTime-game->GetElapsedTime()); for(int counter=0;float&vol:Self().prevVolumes){ const BGM¤tBgm=Self().bgm[Self().currentBGM]; - Engine().SetVolume(currentBgm.GetChannelIDs()[counter],util::lerp(vol,Self().GetCalculatedBGMVolume(Self().targetVolumes[counter]),1-(Self().fadeToTargetVolumeTime/currentBgm.GetFadeTime()))); + Engine().SetVolume(currentBgm.GetChannelIDs()[counter],util::lerp(Self().GetCalculatedBGMVolume(vol),Self().GetCalculatedBGMVolume(Self().targetVolumes[counter]),1-(Self().fadeToTargetVolumeTime/currentBgm.GetFadeTime()))); counter++; } } diff --git a/Adventures in Lestoria/Debris.cpp b/Adventures in Lestoria/Debris.cpp index f7683e69..4a770a2a 100644 --- a/Adventures in Lestoria/Debris.cpp +++ b/Adventures in Lestoria/Debris.cpp @@ -46,14 +46,18 @@ INCLUDE_game Debris::Debris(const vf2d pos,const vf2d vel,const int damage,const float radius,const float knockbackAmt,const float rotSpd,const float lifetime,bool upperLevel,bool friendly,Pixel col,const vf2d scale) :Bullet(pos,vel,radius,damage,"commercial_assets/wind_solid_objects.png",upperLevel,false,lifetime,false,friendly,col,scale),knockbackAmt(knockbackAmt),rotatingSpd(rotSpd),randomFrame(util::random(GFX["commercial_assets/wind_solid_objects.png"].Sprite()->Size().x/24)){} void Debris::Update(float fElapsedTime){ - image_angle+=rotatingSpd; + image_angle+=rotatingSpd*fElapsedTime; } bool Debris::PlayerHit(Player*player){ player->Knockback(vel.norm()*knockbackAmt); + deactivated=true; + fadeOutTime=0.5f; return true; } bool Debris::MonsterHit(Monster&monster){ monster.Knockback(vel.norm()*knockbackAmt); + deactivated=true; + fadeOutTime=0.5f; return true; } void Debris::Draw(const Pixel blendCol)const{ diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index c87364a3..b8c4206a 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -250,9 +250,9 @@ const int Player::GetHealth()const{ return hp; } -const float Player::GetMaxHealth()const{ +const int Player::GetMaxHealth()const{ const float hpPctIncrease=GetStat("Health")*GetStat("Health %")/100.f; - return GetStat("Health")+hpPctIncrease; + return int(GetStat("Health")+hpPctIncrease); } const int Player::GetMana()const{ @@ -809,7 +809,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){ hurtRumbleTime="Player.Hurt Rumble Time"_F; Input::StartVibration(); - Input::SetLightbar(PixelLerp(DARK_RED,GREEN,GetHealth()/GetMaxHealth())); + Input::SetLightbar(PixelLerp(DARK_RED,GREEN,GetHealth()/float(GetMaxHealth()))); if(lastHitTimer>0){ damageNumberPtr.get()->damage+=int(mod_dmg); @@ -821,7 +821,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){ } lastHitTimer=0.05f; - if(!lowHealthSoundPlayed&&lowHealthSoundPlayedTimer==0.f&&GetHealth()/GetMaxHealth()<="Player.Health Warning Pct"_F/100.f){ + if(!lowHealthSoundPlayed&&lowHealthSoundPlayedTimer==0.f&&GetHealth()/float(GetMaxHealth())<="Player.Health Warning Pct"_F/100.f){ SoundEffect::PlaySFX("Health Warning",SoundEffect::CENTERED); lowHealthSoundPlayed=true; lowHealthSoundPlayedTimer="Player.Health Warning Cooldown"_F; @@ -1088,7 +1088,7 @@ bool Player::Heal(int damage,bool suppressDamageNumber){ if(!suppressDamageNumber&&damage>0){ DAMAGENUMBER_LIST.push_back(std::make_shared(GetPos(),damage,true,HEALTH_GAIN)); } - Input::SetLightbar(PixelLerp(DARK_RED,GREEN,GetHealth()/GetMaxHealth())); + Input::SetLightbar(PixelLerp(DARK_RED,GREEN,GetHealth()/float(GetMaxHealth()))); return true; } @@ -1358,7 +1358,7 @@ void Player::PerformHPRecovery(){ Heal(hpRecoveryAmt); } - if(GetHealth()/GetMaxHealth()>"Player.Health Warning Pct"_F/100.f){ + if(GetHealth()/float(GetMaxHealth())>"Player.Health Warning Pct"_F/100.f){ lowHealthSoundPlayed=false; } } diff --git a/Adventures in Lestoria/Player.h b/Adventures in Lestoria/Player.h index 98153b76..5fb2f82e 100644 --- a/Adventures in Lestoria/Player.h +++ b/Adventures in Lestoria/Player.h @@ -115,7 +115,7 @@ public: const float&GetBaseStat(std::string_view a)const; void SetBaseStat(std::string_view a,float val); void SetBaseStat(ItemAttribute a,float val); - const float GetMaxHealth()const; + const int GetMaxHealth()const; const int GetHealth()const; const int GetMana()const; const int GetMaxMana()const; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 805190a4..516ad13e 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 3 -#define VERSION_BUILD 9515 +#define VERSION_BUILD 9522 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/Zephy.cpp b/Adventures in Lestoria/Zephy.cpp index 5be4e10f..92f75e36 100644 --- a/Adventures in Lestoria/Zephy.cpp +++ b/Adventures in Lestoria/Zephy.cpp @@ -97,7 +97,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) }); }break; case IDLE:{ - const int randomAttackChoice=1; + const int randomAttackChoice=2; switch(randomAttackChoice){ case 0:{ @@ -273,7 +273,17 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) game->SetWindSpeed({}); } if(m.F(A::SHOOT_TIMER)<=0.f){ + vf2d debrisSpawningOffset={-200.f,util::random(WINDOW_SIZE.y)-WINDOW_SIZE.y/2.f}; //Assume left landing site. + if(!LeftLandingSite)debrisSpawningOffset*=-1.f; + vf2d debrisSpd={util::random_range(ConfigFloatArr("Wind Attack.Wind Projectile X Speed Range",0),ConfigFloatArr("Wind Attack.Wind Projectile X Speed Range",1)),util::random_range(ConfigFloatArr("Wind Attack.Wind Projectile Y Speed Range",0),ConfigFloatArr("Wind Attack.Wind Projectile Y Speed Range",1))}; + if(!LeftLandingSite)debrisSpd*=-1.f; + + const float sizeMultiplier=util::random_range(0.75f,1.25f); + + CreateBullet(Debris)(m.GetPos()+debrisSpawningOffset,debrisSpd,ConfigInt("Wind Attack.Debris Damage"),ConfigFloat("Wind Attack.Debris Radius")*sizeMultiplier,ConfigFloat("Wind Attack.Debris Knockback Multiplier"),util::random_range(util::degToRad(-180.f),util::degToRad(180.f)),INFINITE,m.OnUpperLevel(),false,WHITE,vf2d{1.f,1.f}*sizeMultiplier)EndBullet; + + m.F(A::SHOOT_TIMER)=ConfigFloat("Wind Attack.Wind Projectile Spawn Rate"); } }break; case HALFHEALTH_PHASE:{ diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 667e167e..5a5e4a4e 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -829,6 +829,8 @@ MonsterStrategy # In Units Fly Up Height = 700 + Debris Damage = 40 + Left Landing Site = 1608, 1728 Right Landing Site = 2472, 1728 @@ -842,9 +844,12 @@ MonsterStrategy Wind Duration = 18s Wind Projectile Spawn Rate = 0.5s - Wind Projectile X Speed Range = 120px/s, 240px/s + Wind Projectile X Speed Range = 180px/s, 240px/s Wind Projectile Y Speed Range = -32px/s, 32px/s + Debris Radius = 8 + Debris Knockback Multiplier = 100 + Wind Overlay Sprite = "wind_vignette.png" Wind Overlay Color = 64, 64, 64, 255 diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index c77146c8..13d99717 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index fcacae20..e069aa2f 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ