diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 96f37bf7..7dc5aad3 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -282,7 +282,7 @@ NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpplatest - C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\LabUser\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\niconiconii\OneDrive\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories) + C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;$(ProjectDir)steam;$(ProjectDir)discord-files;C:\Users\LabUser\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\LabUser\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\niconiconii\OneDrive\Documents\include;C:\Users\niconiconii\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories) true @@ -374,6 +374,10 @@ + + + + @@ -764,6 +768,10 @@ + + + + diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters index c28e8dbc..ecf5023c 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters @@ -708,6 +708,9 @@ Header Files\Interface + + Header Files\Utils + @@ -1265,6 +1268,9 @@ Source Files\Monster Strategies + + Source Files\Utils + diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 1e0af5ba..f8554f29 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -3693,7 +3693,7 @@ void AiL::InitializeGraphics(){ circleCooldownPoints.emplace_back(vf2d{0,0}); squareCircleCooldownPoints.emplace_back(vf2d{0,0}); for(int i=0;i<=360;i+=4){ - float angle=util::degToRad(float(i))-PI/2; + float angle=util::degToRad(float(i))-PI/2; #pragma region Cooldown Circles if(i==0){circleCooldownPoints.emplace_back(vf2d{cos(angle),sin(angle)});} circleCooldownPoints.emplace_back(vf2d{cos(angle),sin(angle)}); diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index de58562e..31f06bee 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -102,6 +102,7 @@ class AiL : public olc::PixelGameEngine friend class Audio; friend class Minimap; friend class MiniAudio; + friend class Arc; std::unique_ptrplayer; SplashScreen splash; public: diff --git a/Adventures in Lestoria/Arc.cpp b/Adventures in Lestoria/Arc.cpp new file mode 100644 index 00000000..4809319d --- /dev/null +++ b/Adventures in Lestoria/Arc.cpp @@ -0,0 +1,62 @@ +#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 "Arc.h" +#include "AdventuresInLestoria.h" + +INCLUDE_game + +Arc::Arc(const vf2d pos,const float pointingAngle,const float sweepAngle) +:pos(pos),pointingAngle(pointingAngle),sweepAngle(sweepAngle){ + //Use cut-off point between two angles + poly.pos.emplace_back(vf2d{}); //Always add 0,0 + int startInd{int(std::fmod(util::radToDeg(pointingAngle-sweepAngle)/4,90))}; + int endInd{int(std::fmod(util::radToDeg(pointingAngle+sweepAngle)/4,90))}; + if(startInd>endInd)std::swap(startInd,endInd); + for(int i=startInd;icircleCooldownPoints[i]); + } + poly.pos.emplace_back(vf2d{}); //Connect back to itself. +} +void Arc::Draw(AiL*game,const vf2d pos,const float pointingAngle,const float sweepAngle,const Pixel col){ + game->SetDecalStructure(DecalStructure::FAN); + game->view.DrawPolygonDecal(nullptr,poly.pos,poly.pos,col); +} +const bool Arc::overlaps(const vf2d checkPos)const{ + +} \ No newline at end of file diff --git a/Adventures in Lestoria/Arc.h b/Adventures in Lestoria/Arc.h new file mode 100644 index 00000000..58fdf265 --- /dev/null +++ b/Adventures in Lestoria/Arc.h @@ -0,0 +1,55 @@ +#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 +#pragma once + +#include "olcUTIL_Geometry2D.h" + +class AiL; + +class Arc{ +public: + //Define a sweep angle such that each direction will arc that way. Example: PI/2 means a sweep angle from -PI/2 to PI/2. + Arc(const vf2d pos,const float pointingAngle,const float sweepAngle); + void Draw(AiL*game,const vf2d pos,const float pointingAngle,const float sweepAngle,const Pixel col); + const bool overlaps(const vf2d checkPos)const; +private: + const vf2d pos; + const float pointingAngle; + const float sweepAngle; + geom2d::polygonpoly; +}; \ No newline at end of file diff --git a/Adventures in Lestoria/Goblin_Bomb.cpp b/Adventures in Lestoria/Goblin_Bomb.cpp index 525b4eaa..4459423a 100644 --- a/Adventures in Lestoria/Goblin_Bomb.cpp +++ b/Adventures in Lestoria/Goblin_Bomb.cpp @@ -65,7 +65,7 @@ void Monster::STRATEGY::GOBLIN_BOMB(Monster&m,float fElapsedTime,std::string str m.F(A::SHOOT_TIMER)=m.randomFrameOffset; SETPHASE(RUN); }break; - case RUN:{ + case RUN:{ m.F(A::SHOOT_TIMER)+=fElapsedTime; m.F(A::SHOOT_ANIMATION_TIME)-=fElapsedTime; float distToPlayer=geom2d::line(m.GetPos(),game->GetPlayer()->GetPos()).length(); diff --git a/Adventures in Lestoria/OctopusArm.cpp b/Adventures in Lestoria/OctopusArm.cpp index 1074e90a..09c8a5b7 100644 --- a/Adventures in Lestoria/OctopusArm.cpp +++ b/Adventures in Lestoria/OctopusArm.cpp @@ -48,14 +48,24 @@ INCLUDE_game void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string strategy){ enum PhaseName{ - RUN, - FLY_AWAY, + INIT, + RISE_ANIMATION, + SEARCH, }; switch(PHASE()){ - case RUN:{ - + case INIT:{ + m.PerformAnimation("RISE",game->GetPlayer()->GetPos()); + m.F(A::CASTING_TIMER)=m.GetCurrentAnimation().GetTotalAnimationDuration(); + SETPHASE(RISE_ANIMATION); + }break; + case RISE_ANIMATION:{ + m.F(A::CASTING_TIMER)-=fElapsedTime; + if(m.F(A::CASTING_TIMER)<=0.f){ + m.PerformAnimation("IDLE",game->GetPlayer()->GetPos()); + SETPHASE(SEARCH); + } }break; - case FLY_AWAY:{ + case SEARCH:{ }break; } diff --git a/Adventures in Lestoria/Oktopus boss.txt b/Adventures in Lestoria/Oktopus boss.txt index 5267cf6a..d33c66ca 100644 --- a/Adventures in Lestoria/Oktopus boss.txt +++ b/Adventures in Lestoria/Oktopus boss.txt @@ -13,7 +13,7 @@ Big bullet: 90 Tentacle: 50 Attack moves -- Boss shots 1 bullet every second +- Boss shots 1 bullet every second - Every 6. Shot Boss Shots a big bullet that explodes when i gets close to the Player and form a new ring of bullets flying away in a whirl instead of a straight line. (Boss rests for 2 seconds after big bullet) - Tentacels do a delayed attack - Every Tentacle and the boss get a 10% Attack buff on each Tentacle death diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 80127e23..268f3017 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 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 11756 +#define VERSION_BUILD 11757 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 69ca893d..3b49e04b 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -1793,6 +1793,7 @@ Monsters ATTACKING = 4, 0.15, PingPong DEATH = 5, 0.15, OneShot RISE = 5, 0.15, ReverseOneShot + ATTACK = 2, 0.3, Repeat } # Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak deleted file mode 100644 index 90528cfa..00000000 Binary files a/Adventures in Lestoria/assets/gamepack.pak and /dev/null differ diff --git a/Adventures in Lestoria/olcUTIL_Geometry2D.h b/Adventures in Lestoria/olcUTIL_Geometry2D.h index 78204461..4103105d 100644 --- a/Adventures in Lestoria/olcUTIL_Geometry2D.h +++ b/Adventures in Lestoria/olcUTIL_Geometry2D.h @@ -1103,7 +1103,21 @@ namespace olc::utils::geom2d return s >= T2(0) && v >= T2(0) && (s + v) <= T2(2) * A * sign; } + + // overlaps(p,p) + // Check if point overlaps with polygon + template + inline constexpr bool overlaps(const olc::v_2d& p1, const polygon& p2) + { + int index{1}; + std::vector>tris; + while(index{polygon.pos[0],polygon.pos[index],polygon.pos[index+1]}))return true; + index++; + } + return false; + } // overlaps(p,p) // Check if point overlaps with point (analagous to contains()) diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 9c05d196..95e29360 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ