diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index b1586470..b526c42f 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -901,6 +901,10 @@ + + + + diff --git a/Adventures in Lestoria/Animation.cpp b/Adventures in Lestoria/Animation.cpp index 4c440eb5..37a93cda 100644 --- a/Adventures in Lestoria/Animation.cpp +++ b/Adventures in Lestoria/Animation.cpp @@ -239,6 +239,7 @@ void sig::Animation::InitializeAnimations(){ CreateHorizontalAnimationSequence("goblin_bomb.png",4,{24,24},AnimationData{.frameDuration{0.2f},.style{Animate2D::Style::PingPong}}); CreateHorizontalAnimationSequence("goblin_bomb_fuse.png",4,{24,24},AnimationData{.frameDuration{1.f},.style{Animate2D::Style::OneShot}}); CreateHorizontalAnimationSequence("bomb_boom.png",5,{36,36},AnimationData{.frameDuration{0.2f},.style{Animate2D::Style::OneShot}}); + CreateHorizontalAnimationSequence("tornado2.png",4,{24,48},AnimationData{.frameDuration{0.1f},.style{Animate2D::Style::Repeat}}); CreateStillAnimation("meteor.png",{192,192}); diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h index ac6d67f4..abf606c7 100644 --- a/Adventures in Lestoria/BulletTypes.h +++ b/Adventures in Lestoria/BulletTypes.h @@ -135,7 +135,6 @@ struct DaggerStab:public Bullet{ }; struct DaggerSlash:public Bullet{ - Monster&sourceMonster; Direction facingDir; float frameDuration; @@ -184,4 +183,16 @@ struct LevitatingRock:public Bullet{ void Draw()const override; void AssignMaster(LevitatingRock*masterRock); const bool IsMaster()const; +}; + +struct Tornado:public Bullet{ + float rotatingSpd{}; + vf2d polarAngle{}; + vf2d centerPoint{}; + float knockupDuration{}; + float knockbackAmt{}; + Tornado(vf2d centerPoint,float distance,float initialRot,float rotSpd,float spd,int damage,const float knockupAmt,const float knockbackAmt,const float lifetime,bool upperLevel,bool friendly=false,Pixel col=WHITE,const vf2d scale={1,1}); + void Update(float fElapsedTime)override; + bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!! + bool MonsterHit(Monster&monster)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _MonsterHit()!! }; \ No newline at end of file diff --git a/Adventures in Lestoria/Tornado.cpp b/Adventures in Lestoria/Tornado.cpp new file mode 100644 index 00000000..c3516245 --- /dev/null +++ b/Adventures in Lestoria/Tornado.cpp @@ -0,0 +1,70 @@ +#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" +#include "Player.h" +#include "util.h" + +Tornado::Tornado(vf2d centerPoint,float distance,float initialRot,float rotSpd,float spd,int damage,const float knockupDuration,const float knockbackAmt,const float lifetime,bool upperLevel,bool friendly,Pixel col,const vf2d scale) + :polarAngle({distance,initialRot}),rotatingSpd(rotSpd),knockupDuration(knockupDuration),knockbackAmt(knockbackAmt),Bullet(centerPoint+polarAngle.cart(),{},6.f,damage,"tornado2.png",upperLevel,true,lifetime,false,friendly,col,scale){} + +void Tornado::Update(float fElapsedTime){ + rot+=rotatingSpd; + + polarAngle={polarAngle.x,rot}; + + pos=centerPoint+polarAngle.cart(); +} + +bool Tornado::PlayerHit(Player*player){ + player->Knockback(util::pointTo(centerPoint,player->GetPos())*knockbackAmt); + player->Knockup(knockupDuration); + + player->ApplyIframes(knockupDuration); + + return true; +} + +bool Tornado::MonsterHit(Monster&monster){ + if(monster.IgnoresTerrainCollision())return false; //All airborne enemy types won't care about this. + + monster.Knockback(util::pointTo(centerPoint,monster.GetPos())*knockbackAmt); + monster.Knockup(knockupDuration); + + return true; +} \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 4659fc79..5ce0ac14 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 9447 +#define VERSION_BUILD 9451 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/Zephy.cpp b/Adventures in Lestoria/Zephy.cpp index 96eeb0f8..177a0679 100644 --- a/Adventures in Lestoria/Zephy.cpp +++ b/Adventures in Lestoria/Zephy.cpp @@ -53,6 +53,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) IDLE, FLY_ACROSS_PREPARE, FLY_ACROSS, + TORNADO_ATTACK_PREPARE, TORNADO_ATTACK, WIND_ATTACK, HALFHEALTH_PHASE, @@ -76,7 +77,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) m.phase=IDLE; }break; case IDLE:{ - const int randomAttackChoice=util::random()%1; + const int randomAttackChoice=util::random()%2; switch(randomAttackChoice){ case 0:{ @@ -89,7 +90,8 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) m.phase=FLY_ACROSS_PREPARE; }break; case 1:{ - m.phase=TORNADO_ATTACK; + m.phase=TORNADO_ATTACK_PREPARE; + m.target=ConfigVec("Tornado Attack.Arena Center"); }break; case 2:{ m.phase=WIND_ATTACK; @@ -130,7 +132,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) CreateBullet(Bullet)(m.GetPos()+vf2d{xOffset+util::random_range(-3.f,3.f),-util::random(10.f)-4.f},vf2d{0.f,ConfigFloat("Fly Across Attack.Attack Y Speed")},1,ConfigInt("Fly Across Attack.Poop Damage"),"birdpoop.png",m.OnUpperLevel(),false,INFINITY,false,false,WHITE,vf2d{util::random_range(0.2f,0.3f),util::random_range(0.2f,0.3f)},util::random(2*PI)) .SetIframeTimeOnHit(0.25f)EndBullet; } - m.F(A::SHOOT_TIMER)=ConfigFloat("Fly Across Attack.Attack Frequency"); + m.F(A::SHOOT_TIMER)=ConfigFloat("Fly Across Attack.Landing Area"); } if(m.ReachedTargetPos()){ m.phase=IDLE; @@ -138,6 +140,15 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy) m.targetAcquireTimer=0.f; } }break; + case TORNADO_ATTACK_PREPARE:{ + m.targetAcquireTimer=20.f; + RUN_TOWARDS(m,fElapsedTime,"Run Towards"); + if(m.ReachedTargetPos()){ + m.phase=TORNADO_ATTACK; + m.PerformAnimation("ATTACK",Direction::SOUTH); + m.targetAcquireTimer=0.f; + } + }break; case TORNADO_ATTACK:{ }break; diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 3d0ef9cf..fca93b47 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -795,5 +795,25 @@ MonsterStrategy # Defined in units/sec Attack Y Speed = 150 } + Tornado Attack + { + # Landing point for the attack. Defaults to Arena Center. + Landing Area = 2040, 1752 + + Attack Duration = 9s + + Knockup Duration = 0.7s + Knockback Amount = 2.0 + + Tornados + { + # For each Ring: Distance from Boss in Units, # of tornados, Rotation Speed (degrees/sec). + # Freely add/subtract rings to create or remove more tornados. + Ring 1 = 100, 2, 120 + Ring 2 = 200, 3, -75 + Ring 3 = 300, 5, 60 + Ring 4 = 400, 8, -40 + } + } } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/gfx/gfx.txt b/Adventures in Lestoria/assets/config/gfx/gfx.txt index de7d4c62..26330e33 100644 --- a/Adventures in Lestoria/assets/config/gfx/gfx.txt +++ b/Adventures in Lestoria/assets/config/gfx/gfx.txt @@ -98,6 +98,7 @@ Images GFX_RockOutline = rock_outline.png GFX_BossIndicator = bossIndicator.png GFX_BirdPoop = birdpoop.png + GFX_Tornado = tornado2.png # Ability Icons GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index 2cfcb4cc..7c7e6c7b 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/Adventures in Lestoria/assets/spr_spell_tornado_strip4.png b/Adventures in Lestoria/assets/spr_spell_tornado_strip4.png new file mode 100644 index 00000000..ee180022 Binary files /dev/null and b/Adventures in Lestoria/assets/spr_spell_tornado_strip4.png differ diff --git a/Adventures in Lestoria/assets/tornado.png b/Adventures in Lestoria/assets/tornado.png new file mode 100644 index 00000000..99adab6a Binary files /dev/null and b/Adventures in Lestoria/assets/tornado.png differ diff --git a/Adventures in Lestoria/assets/tornado2.png b/Adventures in Lestoria/assets/tornado2.png new file mode 100644 index 00000000..4eba2aaa Binary files /dev/null and b/Adventures in Lestoria/assets/tornado2.png differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 0fc204f5..32469ba4 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ