diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
index da94c361..7b83359d 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
@@ -923,8 +923,6 @@
-
-
@@ -960,8 +958,6 @@
-
-
diff --git a/Adventures in Lestoria/Stone_Elemental.cpp b/Adventures in Lestoria/Stone_Elemental.cpp
index 67e78766..8ab4a3c8 100644
--- a/Adventures in Lestoria/Stone_Elemental.cpp
+++ b/Adventures in Lestoria/Stone_Elemental.cpp
@@ -40,13 +40,58 @@ 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;
+/*
+* Every 2 seconds after completing an attack do one of the following attacks:
+Casts a Stone Pillar on the location of the Player: radius 350. Hits with 3 seconds delay. Becomes an solid object (Player colision) and decays after 5 seconds again.
+ If the Stone pillar would hit the Stone Elemental it will move out of its range.
+Shoot a Stone (bullet) in the direction of the target.
+ The Stone gets created in form of a Cone and tracks the player movement without moving for the first second.
+ Once it locks it doesnt move for another second. then it starts flying towards the player with 3x the normal Bullet speed.
+Dive under earth and show up 1 second later in a random location 400-700 away from player. while emerging shoot a ring of bullets (0.5x Attack)
+ (maybe emerge with 200 away from anything with colision to avoid the Elemental getting stuck? Other solutions for that are welcome aswell)
+if range to player > 1200 always use 3rd attack
+*/
+
void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string strategy){
+ enum PhaseName{
+ WAITING,
+ STONE_PILLAR_CAST,
+ STONE_PILLAR_ATTACK,
+ SHOOT_STONE_CAST,
+ SHOOT_STONE_ATTACK,
+ DIVE_UNDERGROUND_DIG,
+ DIVE_UNDERGROUND_SURFACE,
+ };
+
+ switch(m.phase){
+ case WAITING:{
+ m.F(A::ATTACK_COOLDOWN)+=fElapsedTime;
+
+ float distToPlayer=util::distance(m.GetPos(),game->GetPlayer()->GetPos());
+ if(distToPlayer>=ConfigPixels("Auto Dive Range"))m.phase=DIVE_UNDERGROUND_DIG;
+
+ if(m.F(A::ATTACK_COOLDOWN)>=ConfigFloat("Attack Wait Time")){
+ switch(util::random()%3){
+ case 0:m.phase=STONE_PILLAR_CAST;break;
+ case 1:m.phase=SHOOT_STONE_CAST;break;
+ case 2:m.phase=DIVE_UNDERGROUND_DIG;break;
+ }
+ }
+ }break;
+ case STONE_PILLAR_CAST:{
+
+ }break;
+ case SHOOT_STONE_CAST:{
+
+ }break;
+ case DIVE_UNDERGROUND_DIG:{
+ }break;
+ }
}
\ No newline at end of file
diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h
index cdb4b2d0..ddfc6fd4 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 9266
+#define VERSION_BUILD 9268
#define stringify(a) stringify_(a)
#define stringify_(a) #a
diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt
index 4f8eb36e..31487294 100644
--- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt
+++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt
@@ -719,6 +719,10 @@ MonsterStrategy
}
Stone Elemental
{
-
+ # Amount of time between attacks.
+ Attack Wait Time = 2s
+
+ # Minimum Distance the Stone Elemental will always perform a dive
+ Auto Dive Range = 1200
}
}
\ No newline at end of file
diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt
index 710087da..293207d6 100644
--- a/Adventures in Lestoria/assets/config/Monsters.txt
+++ b/Adventures in Lestoria/assets/config/Monsters.txt
@@ -760,10 +760,12 @@ Monsters
# Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse)
# 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
+ IDLE = 2, 0.6, Repeat
+ WALK = 4, 0.2, Repeat
+ TOSS ROCK = 4, 0.2, OneShot
+ DEATH = 4, 0.15, OneShot
+ ROCK TOSS CAST = 2, 0.3, Repeat
+ STONE PILLAR CAST = 2, 0.3, Repeat
}
Hurt Sound = Monster Hurt
diff --git a/Adventures in Lestoria/util.cpp b/Adventures in Lestoria/util.cpp
index 0c1e68d9..2d994599 100644
--- a/Adventures in Lestoria/util.cpp
+++ b/Adventures in Lestoria/util.cpp
@@ -201,4 +201,8 @@ float util::angle_difference(float angle_1, float angle_2)
angle_diff += 2 * PI;
return -angle_diff;
+}
+
+const float util::distance(const vf2d&point1,const vf2d&point2){
+ return vf2d{point1-point2}.mag();
}
\ No newline at end of file
diff --git a/Adventures in Lestoria/util.h b/Adventures in Lestoria/util.h
index 8f8f9582..b55ca0a9 100644
--- a/Adventures in Lestoria/util.h
+++ b/Adventures in Lestoria/util.h
@@ -61,6 +61,7 @@ namespace olc::util{
std::u32string WrapText(PixelGameEngine*pge,std::u32string str,int width,Font&font,vd2d scale);
float angle_difference(float angle_1, float angle_2);
std::string GetHash(std::string file);
+ const float distance(const vf2d&point1,const vf2d&point2);
}
template
diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe
index 44665c00..ead22aaf 100644
Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ