diff --git a/Adventures in Lestoria/Arc.cpp b/Adventures in Lestoria/Arc.cpp index 4809319d..c1ea08c7 100644 --- a/Adventures in Lestoria/Arc.cpp +++ b/Adventures in Lestoria/Arc.cpp @@ -41,22 +41,31 @@ All rights reserved. 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]); +Arc::Arc(const vf2d pos,const float radius,const float pointingAngle,const float sweepAngle) +:pos(pos),radius(radius),pointingAngle(pointingAngle),sweepAngle(sweepAngle){ + if(sweepAngle<0.f)ERR(std::format("WARNING! Sweep angle must be greater than or equal to 0! Provided Sweep Angle: {}",sweepAngle)); + //Use cut-off point between two angles + poly.pos.emplace_back(pos); //Always add 0,0 + float smallestAng{util::radToDeg(pointingAngle-sweepAngle)+90}; + float largestAng{util::radToDeg(pointingAngle+sweepAngle)+90}; + while(smallestAng<0.f)smallestAng+=360; + while(largestAng<0.f)largestAng+=360; + int startInd{int(std::fmod(smallestAng/4+1,90))}; + int endInd{int(std::fmod(largestAng/4+1,90))}; + if(startInd>endInd){ + startInd=(startInd+3)%90; + }else{ + endInd=(endInd+3)%90; } - poly.pos.emplace_back(vf2d{}); //Connect back to itself. + for(int i=startInd;i!=endInd;i=(i+1)%game->circleCooldownPoints.size()){ + poly.pos.emplace_back(pos+game->circleCooldownPoints[i]*radius); + } + poly.pos.emplace_back(pos); //Connect back to itself. } -void Arc::Draw(AiL*game,const vf2d pos,const float pointingAngle,const float sweepAngle,const Pixel col){ +void Arc::Draw(AiL*game,const Pixel col){ game->SetDecalStructure(DecalStructure::FAN); game->view.DrawPolygonDecal(nullptr,poly.pos,poly.pos,col); } const bool Arc::overlaps(const vf2d checkPos)const{ - + return geom2d::overlaps(checkPos,poly); } \ No newline at end of file diff --git a/Adventures in Lestoria/Arc.h b/Adventures in Lestoria/Arc.h index 58fdf265..fe04bb6c 100644 --- a/Adventures in Lestoria/Arc.h +++ b/Adventures in Lestoria/Arc.h @@ -38,18 +38,20 @@ All rights reserved. #pragma once #include "olcUTIL_Geometry2D.h" +#include "Pixel.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); + //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. MUST BE POSITIVE + Arc(const vf2d pos,const float radius,const float pointingAngle,const float sweepAngle); + void Draw(AiL*game,const Pixel col); const bool overlaps(const vf2d checkPos)const; private: const vf2d pos; const float pointingAngle; const float sweepAngle; + const float radius; geom2d::polygonpoly; }; \ No newline at end of file diff --git a/Adventures in Lestoria/Oktopus boss.txt b/Adventures in Lestoria/Oktopus boss.txt index d33c66ca..67f23c62 100644 --- a/Adventures in Lestoria/Oktopus boss.txt +++ b/Adventures in Lestoria/Oktopus boss.txt @@ -2,7 +2,7 @@ Giant Octopus 42000 HP Boss boss has a permanent 80% DMG reduction. -Tentacle +Tentacle 6000 HP When a Tentacle dies boss takes 6000 Dmg There are 8 Tentacles @@ -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/Oscillator.h b/Adventures in Lestoria/Oscillator.h index 9cb1043a..e65fbbfb 100644 --- a/Adventures in Lestoria/Oscillator.h +++ b/Adventures in Lestoria/Oscillator.h @@ -41,7 +41,7 @@ All rights reserved. template class Oscillator{ - friend class ThrownProjectile; + friend struct ThrownProjectile; public: inline Oscillator() :Oscillator({},{},0.f){} diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 268f3017..ecee2baa 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 11757 +#define VERSION_BUILD 11776 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak new file mode 100644 index 00000000..ecd984e1 Binary files /dev/null and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/Adventures in Lestoria/olcPixelGameEngine.h b/Adventures in Lestoria/olcPixelGameEngine.h index 99181bdd..b3753ec1 100644 --- a/Adventures in Lestoria/olcPixelGameEngine.h +++ b/Adventures in Lestoria/olcPixelGameEngine.h @@ -383,6 +383,7 @@ return 0; #define OLC_PGE_DEF #pragma region std_includes +#define Arc _OLDARC // O------------------------------------------------------------------------------O // | STANDARD INCLUDES | // O------------------------------------------------------------------------------O @@ -573,6 +574,8 @@ namespace X11 #endif #pragma endregion +#undef Arc + // O------------------------------------------------------------------------------O // | olcPixelGameEngine INTERFACE DECLARATION | // O------------------------------------------------------------------------------O diff --git a/Adventures in Lestoria/olcUTIL_Geometry2D.h b/Adventures in Lestoria/olcUTIL_Geometry2D.h index 4103105d..6575a57e 100644 --- a/Adventures in Lestoria/olcUTIL_Geometry2D.h +++ b/Adventures in Lestoria/olcUTIL_Geometry2D.h @@ -1112,8 +1112,8 @@ namespace olc::utils::geom2d { int index{1}; std::vector>tris; - while(index{polygon.pos[0],polygon.pos[index],polygon.pos[index+1]}))return true; + while(index{p2.pos[0],p2.pos[index],p2.pos[index+1]}))return true; index++; } return false; diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 95e29360..58f61ad9 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ