diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 8175345b..ec716403 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -730,6 +730,10 @@ + + + + diff --git a/Adventures in Lestoria/Bullet.cpp b/Adventures in Lestoria/Bullet.cpp index e13d4fcb..3fff5c7b 100644 --- a/Adventures in Lestoria/Bullet.cpp +++ b/Adventures in Lestoria/Bullet.cpp @@ -192,8 +192,14 @@ BulletDestroyState Bullet::_MonsterHit(Monster&monster){ if(iframeTimerOnHit>0.f)monster.ApplyIframes(iframeTimerOnHit); return destroyBullet; } -BulletDestroyState Bullet::PlayerHit(Player*player){return BulletDestroyState::DESTROY;} -BulletDestroyState Bullet::MonsterHit(Monster&monster){return BulletDestroyState::DESTROY;} +BulletDestroyState Bullet::PlayerHit(Player*player){ + fadeOutTime=0.25f; + return BulletDestroyState::KEEP_ALIVE; +} +BulletDestroyState Bullet::MonsterHit(Monster&monster){ + fadeOutTime=0.25f; + return BulletDestroyState::KEEP_ALIVE; +} bool Bullet::OnUpperLevel(){return upperLevel;} const bool Bullet::IsDead()const{ diff --git a/Adventures in Lestoria/Bullet.h b/Adventures in Lestoria/Bullet.h index 7933c51c..24e7469f 100644 --- a/Adventures in Lestoria/Bullet.h +++ b/Adventures in Lestoria/Bullet.h @@ -43,6 +43,7 @@ All rights reserved. enum class BulletType{ UNDEFINED, + FEATHER, LARGE_TORNADO, }; diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h index 7a7add4e..89abaec2 100644 --- a/Adventures in Lestoria/BulletTypes.h +++ b/Adventures in Lestoria/BulletTypes.h @@ -221,4 +221,8 @@ struct LargeTornado:public Bullet{ void Update(float fElapsedTime)override; BulletDestroyState PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!! BulletDestroyState MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!! +}; + +struct Feather:public Bullet{ + Feather(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool hitsMultiple=false,float lifetime=INFINITE,bool friendly=false,Pixel col=WHITE,vf2d scale={1,1},float image_angle=0.f); }; \ No newline at end of file diff --git a/Adventures in Lestoria/Feather.cpp b/Adventures in Lestoria/Feather.cpp new file mode 100644 index 00000000..79249f9e --- /dev/null +++ b/Adventures in Lestoria/Feather.cpp @@ -0,0 +1,44 @@ +#pragma region License +/* +License (OLC-3) +~~~~~~~~~~~~~~~ + +Copyright 2024 Joshua Sigona + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions or derivations of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions or derivative works in binary form must reproduce the above +copyright notice. This list of conditions and the following disclaimer must be +reproduced in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may +be used to endorse or promote products derived from this software without specific +prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +Portions of this software are copyright © 2024 The FreeType +Project (www.freetype.org). Please see LICENSE_FT.txt for more information. +All rights reserved. +*/ +#pragma endregion + +#include "BulletTypes.h" + +Feather::Feather(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool hitsMultiple,float lifetime,bool friendly,Pixel col,vf2d scale,float image_angle) +:Bullet(pos,vel,radius,damage,"feather.png",upperLevel,hitsMultiple,lifetime,true,friendly,col){ + SetBulletType(BulletType::FEATHER); +} \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 8e9a25b8..207a1e40 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 9574 +#define VERSION_BUILD 9576 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/Zephy.cpp b/Adventures in Lestoria/Zephy.cpp index 6ec2cf87..feef3c0c 100644 --- a/Adventures in Lestoria/Zephy.cpp +++ b/Adventures in Lestoria/Zephy.cpp @@ -338,10 +338,12 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) m.phase=HALFHEALTH_PHASE; CreateBullet(LargeTornado)(ConfigVec("Mid Phase.Large Tornado Position"),ConfigPixels("Mid Phase.Large Tornado Suction"),ConfigFloat("Mid Phase.Large Tornado Knockup Duration"),ConfigFloat("Mid Phase.Large Tornado Knockback Amount"),ConfigInt("Mid Phase.Large Tornado Damage"),ConfigFloat("Mid Phase.Large Tornado Radius"),INFINITY,m.OnUpperLevel())EndBullet; BULLET_LIST.back()->SetFadeinTime(1.0f); + m.F(A::SHOOT_TIMER)=2.f; } } }break; case HALFHEALTH_PHASE:{ + m.F(A::SHOOT_TIMER)-=fElapsedTime; m.ApplyIframes(1.f); m.UpdateFacingDirection(Direction::SOUTH); m.PerformAnimation("ATTACK"); @@ -350,10 +352,32 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) std::for_each(BULLET_LIST.begin(),BULLET_LIST.end(),[](std::unique_ptr&bullet){ if(bullet->GetBulletType()==BulletType::LARGE_TORNADO){ bullet->fadeOutTime=1.f; + }else if(bullet->GetBulletType()==BulletType::FEATHER){ + bullet->fadeOutTime=0.25f; } }); game->SetWindSpeed({}); } + + if(m.F(A::SHOOT_TIMER)<=0.f){ + const auto GetHighestFeatherRateFromConfig=[&](const uint8_t monsterAliveCount){ + uint8_t highestMatch=0U; + float featherRate=0.f; + const auto featherRateKeys=Config("Mid Phase.Feather Spawn Rate").GetKeys(); + std::for_each(featherRateKeys.begin(),featherRateKeys.end(),[&](const std::pair&data){ + const int monsterCount=std::stoi(data.first); + if(monsterAliveCount>=monsterCount&&monsterCount>highestMatch){ + highestMatch=monsterCount; + featherRate=1.f/ConfigFloat(std::format("Mid Phase.Feather Spawn Rate.{}",data.first)); + } + }); + return featherRate; + }; + + CreateBullet(Feather)(ConfigVec("Mid Phase.Large Tornado Position"),vf2d{ConfigPixels("Mid Phase.Feather Speed"),util::random(2*PI)}.cart(),ConfigFloat("Mid Phase.Feather Radius"),ConfigInt("Mid Phase.Feather Damage"),m.OnUpperLevel(),false,INFINITE,false,WHITE)EndBullet; + + m.F(A::SHOOT_TIMER)=GetHighestFeatherRateFromConfig(game->BossEncounterMobCount()); + } }break; } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index d0a0d737..6907f629 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -879,6 +879,21 @@ MonsterStrategy Large Tornado Suction = 100units/s Large Tornado Knockup Duration = 0.75s Large Tornado Knockback Amount = 300 + + # We are specifying rates based on number of remaining targets. + Feather Spawn Rate + { + 6 monsters = 2/s + 5 monsters = 2.5/s + 4 monsters = 3/s + 3 monsters = 3.5/s + 2 monsters = 4/s + 1 monster = 4.5/s + } + + Feather Speed = 150units/s + Feather Radius = 4px + Feather Damage = 10 } } Stone Golem diff --git a/Adventures in Lestoria/assets/config/gfx/gfx.txt b/Adventures in Lestoria/assets/config/gfx/gfx.txt index 063e7490..77988794 100644 --- a/Adventures in Lestoria/assets/config/gfx/gfx.txt +++ b/Adventures in Lestoria/assets/config/gfx/gfx.txt @@ -105,6 +105,7 @@ Images GFX_WindObjects = commercial_assets/wind_solid_objects.png GFX_LargeTornado = large_tornado.png GFX_SafeAreaIndicator = safeIndicatorGradient.png + GFX_Feather = feather.png # Ability Icons GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png diff --git a/Adventures in Lestoria/assets/feather.png b/Adventures in Lestoria/assets/feather.png new file mode 100644 index 00000000..12b6ba9c Binary files /dev/null and b/Adventures in Lestoria/assets/feather.png differ diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index 7c9abd65..449ba452 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 6534b591..df6a581e 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ