diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
index 0e142bd6..bdd98353 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
@@ -852,6 +852,10 @@
+
+
+
+
diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
index e1a4b3ae..744660cd 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
@@ -1298,6 +1298,9 @@
Source Files\Interface
+
+ Source Files\Monster Strategies
+
diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h
index 111f7986..cf11ef86 100644
--- a/Adventures in Lestoria/BulletTypes.h
+++ b/Adventures in Lestoria/BulletTypes.h
@@ -281,9 +281,10 @@ private:
const float knockbackAmt;
};
-struct FallingStone:public Bullet{
+struct FallingBullet:public Bullet{
//The position for this bullet represents where the falling stone should land.
- FallingStone(vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple=false,float knockbackAmt=0.f,float lifetime=INFINITE,bool friendly=false,Pixel col=WHITE,vf2d scale={1,1},float image_angle=0.f,float spellCircleRotation=0.f,float spellCircleRotationSpd=0.f,Pixel insigniaCol=WHITE,float insigniaRotation=0.f,float insigniaRotationSpd=0.f);
+ FallingBullet(vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple=false,float knockbackAmt=0.f,float lifetime=INFINITE,bool friendly=false,Pixel col=WHITE,vf2d scale={1,1},float image_angle=0.f,float spellCircleRotation=0.f,float spellCircleRotationSpd=0.f,Pixel insigniaCol=WHITE,float insigniaRotation=0.f,float insigniaRotationSpd=0.f);
+ FallingBullet(const std::string&imgName,vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple=false,float knockbackAmt=0.f,float lifetime=INFINITE,bool friendly=false,Pixel col=WHITE,vf2d scale={1,1},float image_angle=0.f,float spellCircleRotation=0.f,float spellCircleRotationSpd=0.f,Pixel insigniaCol=WHITE,float insigniaRotation=0.f,float insigniaRotationSpd=0.f);
protected:
void Update(float fElapsedTime)override;
void Draw(const Pixel blendCol)const override;
diff --git a/Adventures in Lestoria/Effect.h b/Adventures in Lestoria/Effect.h
index 6bcd96e1..1eea2bc6 100644
--- a/Adventures in Lestoria/Effect.h
+++ b/Adventures in Lestoria/Effect.h
@@ -55,7 +55,7 @@ enum class EffectType{
struct Effect{
friend class AiL;
- friend struct FallingStone;
+ friend struct FallingBullet;
vf2d pos={0,0};
float lifetime=0;
float fadeout=0;
diff --git a/Adventures in Lestoria/FallingStone.cpp b/Adventures in Lestoria/FallingStone.cpp
index e127f713..e07e634a 100644
--- a/Adventures in Lestoria/FallingStone.cpp
+++ b/Adventures in Lestoria/FallingStone.cpp
@@ -45,14 +45,17 @@ All rights reserved.
INCLUDE_game
-FallingStone::FallingStone(vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple,float knockbackAmt,float lifetime,bool friendly,Pixel col,vf2d scale,float image_angle,float spellCircleRotation,float spellCircleRotationSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd)
-:Bullet(targetPos,vel,radius,damage,"rock.png",upperLevel,false,lifetime+0.1f,false,friendly,col,scale,image_angle),targetPos(targetPos),zVel(zVel),indicatorDisplayTime(indicatorDisplayTime),knockbackAmt(knockbackAmt),
+FallingBullet::FallingBullet(const std::string&imgName,vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple,float knockbackAmt,float lifetime,bool friendly,Pixel col,vf2d scale,float image_angle,float spellCircleRotation,float spellCircleRotationSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd)
+:Bullet(targetPos,vel,radius,damage,imgName,upperLevel,false,lifetime+0.1f,false,friendly,col,scale,image_angle),targetPos(targetPos),zVel(zVel),indicatorDisplayTime(indicatorDisplayTime),knockbackAmt(knockbackAmt),
indicator(targetPos,lifetime+0.1f,"range_indicator.png","spell_insignia.png",upperLevel,radius/12.f,0.5f,{},col,spellCircleRotation,spellCircleRotationSpd,false,radius/12.f,0.f,{},insigniaCol,insigniaRotation,insigniaRotationSpd,false){
pos+=-vel*lifetime;
z=-zVel*lifetime;
}
-void FallingStone::Update(float fElapsedTime){
+FallingBullet::FallingBullet(vf2d targetPos,vf2d vel,float zVel,float indicatorDisplayTime,float radius,int damage,bool upperLevel,bool hitsMultiple,float knockbackAmt,float lifetime,bool friendly,Pixel col,vf2d scale,float image_angle,float spellCircleRotation,float spellCircleRotationSpd,Pixel insigniaCol,float insigniaRotation,float insigniaRotationSpd)
+:FallingBullet("rock.png",targetPos,vel,zVel,indicatorDisplayTime,radius,damage,upperLevel,hitsMultiple,knockbackAmt,lifetime,friendly,col,scale,image_angle,spellCircleRotation,spellCircleRotationSpd,insigniaCol,insigniaRotation,insigniaRotationSpd){}
+
+void FallingBullet::Update(float fElapsedTime){
z+=zVel*fElapsedTime;
lastTrailEffect-=fElapsedTime;
if(z<=0.f){
@@ -82,11 +85,11 @@ void FallingStone::Update(float fElapsedTime){
}
indicator.Update(fElapsedTime);
}
-void FallingStone::Draw(const Pixel blendCol)const{
+void FallingBullet::Draw(const Pixel blendCol)const{
if(lifetime<=indicatorDisplayTime){
indicator._Draw();
}
Bullet::Draw(blendCol);
}
-void FallingStone::ModifyOutgoingDamageData(HurtDamageInfo&data){}
\ No newline at end of file
+void FallingBullet::ModifyOutgoingDamageData(HurtDamageInfo&data){}
\ No newline at end of file
diff --git a/Adventures in Lestoria/GhostOfPirateCaptain.cpp b/Adventures in Lestoria/GhostOfPirateCaptain.cpp
new file mode 100644
index 00000000..e5e1e565
--- /dev/null
+++ b/Adventures in Lestoria/GhostOfPirateCaptain.cpp
@@ -0,0 +1,116 @@
+#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 "MonsterStrategyHelpers.h"
+#include "util.h"
+#include "AdventuresInLestoria.h"
+#include "SoundEffect.h"
+#include "BulletTypes.h"
+
+using A=Attribute;
+
+INCLUDE_game
+INCLUDE_MONSTER_LIST
+
+void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std::string strategy){
+ enum PhaseName{
+ INIT,
+ NORMAL,
+ };
+
+ static const uint8_t PHASE_COUNT{DATA.GetProperty("MonsterStrategy.Ghost of Pirate Captain").GetValueCount()};
+ static std::vectorPHASES{};
+
+ const auto AdvanceCannonPhase{[&m,&strategy](){
+ m.GetFloat(A::CANNON_TIMER)=0.f;
+ if(m.GetInt(A::CANNON_PHASE)+1>=PHASE_COUNT)m.GetInt(A::CANNON_SHOT_TYPE)=util::random()%5;
+ m.GetInt(A::CANNON_PHASE)=(m.GetInt(A::CANNON_PHASE)+1)%PHASE_COUNT;
+ }};
+
+ switch(PHASE()){
+ case INIT:{
+ for(int i:std::ranges::iota_view(PHASE_COUNT)){
+ PHASES.emplace_back(DATA.GetProperty("MonsterStrategy.Ghost of Pirate Captain").GetInt(i));
+ }
+ m.I(A::CANNON_SHOT_TYPE)=util::random()%5;
+ }break;
+ case NORMAL:{
+ m.F(A::CANNON_TIMER)+=fElapsedTime;
+ switch(PHASES[m.I(A::CANNON_PHASE)]){
+ enum CannonPhaseType{
+ CANNON_SHOT,
+ SILENCE,
+ SHRAPNEL_SHOT,
+ };
+ case CANNON_SHOT:{//Normal Cannon Shot. Takes on one of five varieties.
+ enum CannonShotType{
+ BOMBARDMENT,//every shot is at a random location within 900 Range of the player. (This is also the move during hide and seek.)
+ PRECISE_BOMBARDMENT,//same as before but within 700 range of the player.
+ LINE,//the 4th or 5th hit would hit the player if the player doesnt move at all.
+ SHARPSHOOTER,//aiming directly at the player, skipping every 2nd shot. (only 4 instead of 8 shots)
+ PREDICTION,//shoots in the direction of the current or last players movement and predicts where the player would be in 2.8 seconds. (slightly further then where the player would be at impact. thats why 2.8 instead of 2.5 seconds)
+ };
+ switch(m.I(A::CANNON_SHOT_TYPE)){
+ case BOMBARDMENT:{
+
+ }break;
+ case PRECISE_BOMBARDMENT:{
+
+ }break;
+ case LINE:{
+
+ }break;
+ case SHARPSHOOTER:{
+
+ }break;
+ case PREDICTION:{
+
+ }break;
+ }
+ if(m.F(A::CANNON_TIMER)>=ConfigFloat("Cannon Shot Delay"))AdvanceCannonPhase();
+ }break;
+ case SILENCE:{
+ if(m.F(A::CANNON_TIMER)>=ConfigFloat("Silence Time"))AdvanceCannonPhase();
+ }break;
+ case SHRAPNEL_SHOT:{
+ if(m.F(A::CANNON_TIMER)>=ConfigFloat("Shrapnel Shot Delay"))AdvanceCannonPhase();
+ }break;
+ }
+ }break;
+ }
+}
\ No newline at end of file
diff --git a/Adventures in Lestoria/GiantOctopus.cpp b/Adventures in Lestoria/GiantOctopus.cpp
index d7452c4f..3d831791 100644
--- a/Adventures in Lestoria/GiantOctopus.cpp
+++ b/Adventures in Lestoria/GiantOctopus.cpp
@@ -53,6 +53,7 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
IDENTIFY_ARMS,
NORMAL,
HURT_ANIMATION,
+ DEAD,
};
if(!m.B(A::ARM_SPEEDS_INCREASED)&&m.GetHealth()<=ConfigInt("Arm Speedup Health Threshold")){
@@ -75,9 +76,7 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
if(!GFX.count(takoyakiImgDir))ERR(std::format("WARNING! Could not find item image {}",takoyakiImgDir));
game->AddEffect(std::make_unique(m.GetPos(),INFINITE,"item_img_directory"_S+"Takoyaki.png",m.OnUpperLevel(),1.f,0.f,vf2d{4.f,4.f},vf2d{},WHITE));
m.SetLifetime(4.f);
- m.F(A::SHOOT_TIMER)=ConfigFloat("Shoot Frequency");
- m.F(A::SHOOT_ANIMATION_TIME)=m.GetAnimation("ATTACK").GetTotalAnimationDuration();
- m.I(A::ATTACK_COUNT)=0;
+ SETPHASE(DEAD);
return false;
});
SETPHASE(IDENTIFY_ARMS);
@@ -175,5 +174,6 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
case HURT_ANIMATION:{
}break;
+ case DEAD:{}break;
}
}
\ No newline at end of file
diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h
index 89bb65e8..cebe3fb8 100644
--- a/Adventures in Lestoria/Monster.h
+++ b/Adventures in Lestoria/Monster.h
@@ -380,6 +380,7 @@ private:
static void GIANT_CRAB(Monster&m,float fElapsedTime,std::string strategy);
static void GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string strategy);
static void OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string strategy);
+ static void GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std::string strategy);
};
bool bumpedIntoTerrain=false; //Gets set to true before a strategy executes if the monster runs into some terrain on this frame.
bool attackedByPlayer=false; //Gets set to true before a strategy executes if the monster has been attacked by the player.
diff --git a/Adventures in Lestoria/MonsterAttribute.h b/Adventures in Lestoria/MonsterAttribute.h
index b9af6eb7..d580bf85 100644
--- a/Adventures in Lestoria/MonsterAttribute.h
+++ b/Adventures in Lestoria/MonsterAttribute.h
@@ -163,4 +163,7 @@ enum class Attribute{
LAST_SHOOT_TIMER,
BULLET_COUNT_AFTER_INK_ATTACK,
LAST_INK_SHOOT_TIMER,
+ CANNON_TIMER,
+ CANNON_PHASE,
+ CANNON_SHOT_TYPE,
};
\ No newline at end of file
diff --git a/Adventures in Lestoria/RUN_STRATEGY.cpp b/Adventures in Lestoria/RUN_STRATEGY.cpp
index 942c8232..86b30834 100644
--- a/Adventures in Lestoria/RUN_STRATEGY.cpp
+++ b/Adventures in Lestoria/RUN_STRATEGY.cpp
@@ -77,6 +77,7 @@ void Monster::InitializeStrategies(){
STRATEGY_DATA.insert("Giant Crab",Monster::STRATEGY::GIANT_CRAB);
STRATEGY_DATA.insert("Giant Octopus",Monster::STRATEGY::GIANT_OCTOPUS);
STRATEGY_DATA.insert("Octopus Arm",Monster::STRATEGY::OCTOPUS_ARM);
+ STRATEGY_DATA.insert("Ghost of Pirate Captain",Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN);
STRATEGY_DATA.SetInitialized();
}
diff --git a/Adventures in Lestoria/StoneGolem.cpp b/Adventures in Lestoria/StoneGolem.cpp
index afc1e963..535e43b8 100644
--- a/Adventures in Lestoria/StoneGolem.cpp
+++ b/Adventures in Lestoria/StoneGolem.cpp
@@ -330,7 +330,7 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str
m.PerformAnimation("CAST");
for(int i:std::ranges::iota_view(0,ConfigInt("Stone Rain.Stone Count"))){
- CreateBullet(FallingStone)(game->camera.GetViewPosition()+vf2d{util::random(game->ScreenWidth()),util::random(game->ScreenHeight())},ConfigVec("Stone Rain.Stone Vel"),ConfigFloatArr("Stone Rain.Stone Vel",2),ConfigFloat("Stone Rain.Indicator Time"),ConfigPixels("Stone Rain.Stone Radius"),ConfigInt("Stone Rain.Stone Damage"),m.OnUpperLevel(),false,ConfigFloat("Stone Rain.Stone Knockback Amt"),util::random_range(ConfigFloatArr("Stone Rain.Stone Fall Delay",0),ConfigFloatArr("Stone Rain.Stone Fall Delay",1)),false,ConfigPixel("Stone Rain.Stone Spell Circle Color"),vf2d{ConfigFloat("Stone Rain.Stone Radius")/100.f*2.f,ConfigFloat("Stone Rain.Stone Radius")/100.f*2.f},util::random(2*PI),util::random(2*PI),util::degToRad(ConfigFloat("Stone Rain.Stone Spell Circle Rotation Spd")),ConfigPixel("Stone Rain.Stone Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Rain.Stone Spell Insignia Rotation Spd")))EndBullet;
+ CreateBullet(FallingBullet)(game->camera.GetViewPosition()+vf2d{util::random(game->ScreenWidth()),util::random(game->ScreenHeight())},ConfigVec("Stone Rain.Stone Vel"),ConfigFloatArr("Stone Rain.Stone Vel",2),ConfigFloat("Stone Rain.Indicator Time"),ConfigPixels("Stone Rain.Stone Radius"),ConfigInt("Stone Rain.Stone Damage"),m.OnUpperLevel(),false,ConfigFloat("Stone Rain.Stone Knockback Amt"),util::random_range(ConfigFloatArr("Stone Rain.Stone Fall Delay",0),ConfigFloatArr("Stone Rain.Stone Fall Delay",1)),false,ConfigPixel("Stone Rain.Stone Spell Circle Color"),vf2d{ConfigFloat("Stone Rain.Stone Radius")/100.f*2.f,ConfigFloat("Stone Rain.Stone Radius")/100.f*2.f},util::random(2*PI),util::random(2*PI),util::degToRad(ConfigFloat("Stone Rain.Stone Spell Circle Rotation Spd")),ConfigPixel("Stone Rain.Stone Spell Insignia Color"),util::random(2*PI),util::degToRad(ConfigFloat("Stone Rain.Stone Spell Insignia Rotation Spd")))EndBullet;
}
}
}
diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h
index 4ae2582e..b0812ade 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 11935
+#define VERSION_BUILD 11936
#define stringify(a) stringify_(a)
#define stringify_(a) #a
diff --git a/Adventures in Lestoria/assets/Campaigns/Boss_3.tmx b/Adventures in Lestoria/assets/Campaigns/Boss_3.tmx
index 46165786..a9af8880 100644
--- a/Adventures in Lestoria/assets/Campaigns/Boss_3.tmx
+++ b/Adventures in Lestoria/assets/Campaigns/Boss_3.tmx
@@ -1,5 +1,5 @@
-