diff --git a/Adventures in Lestoria/Hawk.cpp b/Adventures in Lestoria/Hawk.cpp index b64589da..f93a6173 100644 --- a/Adventures in Lestoria/Hawk.cpp +++ b/Adventures in Lestoria/Hawk.cpp @@ -40,13 +40,38 @@ All rights reserved. #include "Monster.h" #include "MonsterStrategyHelpers.h" #include "BulletTypes.h" +#include "util.h" -INCLUDE_ANIMATION_DATA -INCLUDE_BULLET_LIST INCLUDE_game using A=Attribute; +/* +* Attack Strategie: Fly circles at the edge of the Players Screen. every 8 seconds charge on players location to the other corner of the screen. +* */ + void Monster::STRATEGY::HAWK(Monster&m,float fElapsedTime,std::string strategy){ + enum PhaseName{ + INITIALIZE, + FLYING, + CHARGE + }; + + switch(m.phase){ + case INITIALIZE:{ + m.SetZ(ConfigFloat("Flight Height")-ConfigFloat("Flight Height Variance")+util::random_range(0,ConfigFloat("Flight Height Variance")*2)); + m.B(A::RANDOM_DIRECTION)=int(util::random_range(0,2)); + m.phase=FLYING; + m.AddBuff(BuffType::SELF_INFLICTED_SLOWDOWN,INFINITE,util::random_range(0,ConfigFloat("Flight Speed Variance")/100)); + }break; + case FLYING:{ + float dirToPlayer{util::pointTo(game->GetPlayer()->GetPos(),m.GetPos()).polar().y}; + dirToPlayer+=m.B(A::RANDOM_DIRECTION)?0.25*PI:-0.25*PI; + m.target=game->GetPlayer()->GetPos()+vf2d{ConfigFloat("Flight Distance"),dirToPlayer}.cart(); + RUN_TOWARDS(m,fElapsedTime,"Run Towards"); + }break; + case CHARGE:{ + }break; + } } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 2cff2454..61d0359d 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -182,7 +182,7 @@ bool Monster::_SetX(float x,const bool monsterInvoked){ pos.x=std::clamp(x,game->GetCurrentMapData().tilewidth/2.f*GetSizeMult(),float(game->GetCurrentMapData().width*game->GetCurrentMapData().tilewidth-game->GetCurrentMapData().tilewidth/2.f*GetSizeMult())); Moved(); return true; - } else { + }else{ geom2d::rectcollision={collisionRect.pos,collisionRect.size}; bool insideArenaBounds=true; #pragma region Calculate Arena Bounds check for Bosses @@ -194,7 +194,7 @@ bool Monster::_SetX(float x,const bool monsterInvoked){ } #pragma endregion #pragma region lambdas - auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||(!isBoss&&!geom2d::overlaps(newPos,collision));}; + auto NoEnemyCollisionWithTile=[&](){return IgnoresTerrainCollision()||(isBoss&&insideArenaBounds)||(!isBoss&&!geom2d::overlaps(newPos,collision));}; #pragma endregion collision.pos+=tilePos; if(NoEnemyCollisionWithTile()){ @@ -233,7 +233,7 @@ bool Monster::_SetY(float y,const bool monsterInvoked){ } #pragma endregion #pragma region lambdas - auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||(!isBoss&&!geom2d::overlaps(newPos,collision));}; + auto NoEnemyCollisionWithTile=[&](){return IgnoresTerrainCollision()||(isBoss&&insideArenaBounds)||(!isBoss&&!geom2d::overlaps(newPos,collision));}; #pragma endregion collision.pos+=tilePos; if(NoEnemyCollisionWithTile()){ @@ -986,4 +986,9 @@ void Monster::ProximityKnockback(const vf2d centerPoint,const float knockbackFac lineToMonster={centerPoint,centerPoint+vf2d{cos(randomDir),sin(randomDir)}*1}; } Knockback(lineToMonster.vector().norm()*knockbackFactor); +} + + +const bool Monster::IgnoresTerrainCollision()const{ + return MONSTER_DATA.at(GetName()).IgnoresTerrainCollision(); } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index 8ba32c26..7c971928 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -162,6 +162,7 @@ public: const Direction GetFacingDirectionToTarget(vf2d target)const; const bool HasFourWaySprites()const; const bool HasMountedMonster()const; + const bool IgnoresTerrainCollision()const; private: std::string name; vf2d pos; diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index eb633c19..acd098ea 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -159,7 +159,8 @@ void MonsterData::InitializeMonsterData(){ strategyName, DATA["Monsters"][MonsterName]["CollisionDmg"].GetInt() ); - + + if(DATA["Monsters"][MonsterName].HasProperty("Ignore Collisions"))monster.ignoresCollision=DATA["Monsters"][MonsterName]["Ignore Collisions"].GetBool(); if(DATA["Monsters"][MonsterName].HasProperty("Mounted Animation"))monster.mountedAnimName=DATA["Monsters"][MonsterName]["Mounted Animation"].GetString(); if(DATA["Monsters"][MonsterName].HasProperty("Mounted Animation Offset")){ if(DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetValueCount()==2)monster.mountedAnimationOffset={DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetReal(0),DATA["Monsters"][MonsterName]["Mounted Animation Offset"].GetReal(1)}; @@ -398,4 +399,8 @@ const std::optionalMonsterData::GetMountedAnimation()const{ const vf2d&MonsterData::GetMountedAnimationOffset()const{ if(!HasMountedAnimation())ERR("WARNING! Trying to get a mounted animation offset for a monster that doesn't have a mounted animation to begin with!"); return mountedAnimationOffset; +} + +const bool MonsterData::IgnoresTerrainCollision()const{ + return ignoresCollision; } \ No newline at end of file diff --git a/Adventures in Lestoria/MonsterData.h b/Adventures in Lestoria/MonsterData.h index 1752f486..1f69e2fb 100644 --- a/Adventures in Lestoria/MonsterData.h +++ b/Adventures in Lestoria/MonsterData.h @@ -94,6 +94,7 @@ public: const bool HasMountedAnimation()const; const std::optionalGetMountedAnimation()const; const vf2d&GetMountedAnimationOffset()const; + const bool IgnoresTerrainCollision()const; private: std::string name; int hp; @@ -116,4 +117,5 @@ private: bool fourWayDirectionalSprites=false; //When this flag is set, a monster has 4-way animations instead of the default 1-direction animation. std::optionalmountedAnimName; vf2d mountedAnimationOffset{}; + bool ignoresCollision{false}; //If set to true, this monster does not run into terrain. }; \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index e17ca3f3..42c85e5a 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 9247 +#define VERSION_BUILD 9252 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/2_1.tmx b/Adventures in Lestoria/assets/Campaigns/2_1.tmx index ddbcf75c..727c7bae 100644 --- a/Adventures in Lestoria/assets/Campaigns/2_1.tmx +++ b/Adventures in Lestoria/assets/Campaigns/2_1.tmx @@ -1,5 +1,5 @@ - + @@ -1922,5 +1922,15 @@ + + + + + + + + + + diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 3da37f16..2f4f130b 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -698,7 +698,14 @@ MonsterStrategy } Hawk { - + # Amount of Z (in pixels) the Hawk flies at. + Flight Height = 48 + # Amount of Z (in pixels) higher or lower the Hawk chooses to fly at. + Flight Height Variance = 8 + # 0-X% application of a slowdown debuff to vary the speeds of each Hawk. + Flight Speed Variance = 20% + # How far from the player the Hawk circles around. + Flight Distance = 240 } Stone Elemental { diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 2af1aaed..72af5de8 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -719,10 +719,12 @@ Monsters # Animations must be defined in the same order as they are in their sprite sheets # The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator. IDLE = 1, 0.6, Repeat - JUMP = 1, 0.2, Repeat - SHOOT = 1, 0.2, OneShot - DEATH = 1, 0.15, OneShot + JUMP = 4, 0.2, Repeat + ATTACK = 2, 0.2, OneShot + DEATH = 3, 0.15, OneShot } + + Ignore Collisions = True Hurt Sound = Monster Hurt Death Sound = Slime Dead diff --git a/Adventures in Lestoria/assets/config/credits.txt b/Adventures in Lestoria/assets/config/credits.txt index 672afc0e..b9de5468 100644 --- a/Adventures in Lestoria/assets/config/credits.txt +++ b/Adventures in Lestoria/assets/config/credits.txt @@ -17,57 +17,60 @@ Credits LINE[14]="&" LINE[15]="#D8F4F5Killer Rabbit Media#FFFFFF" LINE[16]=" " - LINE[17]="Tools & Tech" - LINE[18]="~~~~~~~~~~~~~~~~" - LINE[19]="Game Engine" - LINE[20]="#FE9900javidx9#FFFFFF" - LINE[21]="#FEF500olc::PixelGameEngine v.2.25#FFFFFF" - LINE[22]=" " - LINE[23]="olcPGEX_MiniAudio Copyright` 2024 by Moros Smith under the OLC-3 License" - LINE[24]=" " - LINE[25]="olcPGEX_ViewPort by Gorbit99" - LINE[26]=" " - LINE[27]="miniaudio library Copyright` 2024 by David Reid under the MIT No Attribution License" - LINE[28]="Ogg Vorbis audio decoder - v1.22 - public domain http://nothings.org/stb_vorbis/" + LINE[17]="Monster Artist" + LINE[18]="#00EBE7Kashif Ali#FFFFFF" + LINE[19]=" " + LINE[20]="Tools & Tech" + LINE[21]="~~~~~~~~~~~~~~~~" + LINE[22]="Game Engine" + LINE[23]="#FE9900javidx9#FFFFFF" + LINE[24]="#FEF500olc::PixelGameEngine v.2.25#FFFFFF" + LINE[25]=" " + LINE[26]="olcPGEX_MiniAudio Copyright` 2024 by Moros Smith under the OLC-3 License" + LINE[27]=" " + LINE[28]="olcPGEX_ViewPort by Gorbit99" LINE[29]=" " - LINE[30]="Portions of this software are copyright ` 2024 The FreeType Project (www.freetype.org). All rights reserved." - LINE[31]=" " - LINE[32]="Assets" - LINE[33]="~~~~~~~~~~~~~~~~" - LINE[34]="Pokemon-based Nico Yazawa sprite that started it all..." - LINE[35]="DeviantArt: @kirbysmith" - LINE[36]=" " - LINE[37]="Animated Slime by Calciumtrice - Creative Commons Attribution 3.0." - LINE[38]=" " - LINE[39]="ERA OF FANTASY - GRASSLANDS" - LINE[40]="X: @Namatnieks" + LINE[30]="miniaudio library Copyright` 2024 by David Reid under the MIT No Attribution License" + LINE[31]="Ogg Vorbis audio decoder - v1.22 - public domain http://nothings.org/stb_vorbis/" + LINE[32]=" " + LINE[33]="Portions of this software are copyright ` 2024 The FreeType Project (www.freetype.org). All rights reserved." + LINE[34]=" " + LINE[35]="Assets" + LINE[36]="~~~~~~~~~~~~~~~~" + LINE[37]="Pokemon-based Nico Yazawa sprite that started it all..." + LINE[38]="DeviantArt: @kirbysmith" + LINE[39]=" " + LINE[40]="Animated Slime by Calciumtrice - Creative Commons Attribution 3.0." LINE[41]=" " - LINE[42]="*** Minifantasy - Tiny Overworld v1.0 ***" - LINE[43]="Minifantasy is an original idea by Krishna Palacio" + LINE[42]="ERA OF FANTASY - GRASSLANDS" + LINE[43]="X: @Namatnieks" LINE[44]=" " - LINE[45]="Public Domain Font Authors" - LINE[46]="c64esque by andraaspar" - LINE[47]="Habbo by Omni" - LINE[48]="Unknown by Anonymous" - LINE[49]=" " - LINE[50]="Nb Pixel Font Bundle" - LINE[51]="Nb Pixel Font Bundle 2" + LINE[45]="*** Minifantasy - Tiny Overworld v1.0 ***" + LINE[46]="Minifantasy is an original idea by Krishna Palacio" + LINE[47]=" " + LINE[48]="Public Domain Font Authors" + LINE[49]="c64esque by andraaspar" + LINE[50]="Habbo by Omni" + LINE[51]="Unknown by Anonymous" LINE[52]=" " - LINE[53]=" " - LINE[54]="Game License" - LINE[55]="~~~~~~~~~~~~~~~~" - LINE[56]="License (OLC-3)" - LINE[57]="~~~~~~~~~~~~~~~" - LINE[58]=" " - LINE[59]="Copyright ` 2024 Sig Productions " - LINE[60]=" " - LINE[61]="Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:" - LINE[62]=" " - LINE[63]="1. Redistributions or derivations of source code must retain the above copyright notice, this list of conditions and the following disclaimer." - LINE[64]=" " - LINE[65]="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." - LINE[66]=" " - LINE[67]="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." - LINE[68]=" " - LINE[69]="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." + LINE[53]="Nb Pixel Font Bundle" + LINE[54]="Nb Pixel Font Bundle 2" + LINE[55]=" " + LINE[56]=" " + LINE[57]="Game License" + LINE[58]="~~~~~~~~~~~~~~~~" + LINE[59]="License (OLC-3)" + LINE[60]="~~~~~~~~~~~~~~~" + LINE[61]=" " + LINE[62]="Copyright ` 2024 Sig Productions " + LINE[63]=" " + LINE[64]="Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:" + LINE[65]=" " + LINE[66]="1. Redistributions or derivations of source code must retain the above copyright notice, this list of conditions and the following disclaimer." + LINE[67]=" " + LINE[68]="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." + LINE[69]=" " + LINE[70]="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." + LINE[71]=" " + LINE[72]="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." } \ No newline at end of file diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 88008866..ab8879ab 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ