From c8dba733d085031b0eeca1604bb754408bd96c9b Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Wed, 6 Sep 2023 20:03:22 +0000 Subject: [PATCH] Added in config parameters for slime king Co-authored-by: sigonasr2 --- Crawler/Monster.h | 2 ++ Crawler/RUN_STRATEGY.cpp | 5 ++- Crawler/SlimeKing.cpp | 12 +++++++ Crawler/assets/config/MonsterStrategies.txt | 39 +++++++++++++++++++++ Crawler/test | 3 -- 5 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 Crawler/SlimeKing.cpp delete mode 100644 Crawler/test diff --git a/Crawler/Monster.h b/Crawler/Monster.h index dd162474..ce531b51 100644 --- a/Crawler/Monster.h +++ b/Crawler/Monster.h @@ -50,6 +50,7 @@ struct MonsterData{ static std::mapimgs; }; + struct Monster{ friend struct STRATEGY; private: @@ -136,6 +137,7 @@ private: static void RUN_TOWARDS(Monster&m,float fElapsedTime,int strategyNumber); static void SHOOT_AFAR(Monster&m,float fElapsedTime,int strategyNumber); static void TURRET(Monster&m,float fElapsedTime,int strategyNumber); + static void SLIMEKING(Monster&m,float fElapsedTime,int strategyNumber); }; }; diff --git a/Crawler/RUN_STRATEGY.cpp b/Crawler/RUN_STRATEGY.cpp index cdc05764..7a64530b 100644 --- a/Crawler/RUN_STRATEGY.cpp +++ b/Crawler/RUN_STRATEGY.cpp @@ -34,8 +34,11 @@ void Monster::STRATEGY::RUN_STRATEGY(Monster&m,float fElapsedTime){ case 1:{//Shoot Afar Monster::STRATEGY::SHOOT_AFAR(m,fElapsedTime,m.strategy); }break; - case 2:{//Turret. + case 2:{//Turret Monster::STRATEGY::TURRET(m,fElapsedTime,m.strategy); }break; + case 3:{//Slime King + Monster::STRATEGY::SLIMEKING(m,fElapsedTime,m.strategy); + }break; } } \ No newline at end of file diff --git a/Crawler/SlimeKing.cpp b/Crawler/SlimeKing.cpp new file mode 100644 index 00000000..d4373718 --- /dev/null +++ b/Crawler/SlimeKing.cpp @@ -0,0 +1,12 @@ +#include "Monster.h" +#include "MonsterStrategyHelpers.h" +#include "DEFINES.h" +#include "Crawler.h" +#include "utils.h" + +INCLUDE_game +INCLUDE_BULLET_LIST + +void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumber){ + +} \ No newline at end of file diff --git a/Crawler/assets/config/MonsterStrategies.txt b/Crawler/assets/config/MonsterStrategies.txt index 169d548c..a4bc992c 100644 --- a/Crawler/assets/config/MonsterStrategies.txt +++ b/Crawler/assets/config/MonsterStrategies.txt @@ -68,4 +68,43 @@ MonsterStrategy BulletSize = 30 BulletColor = 0, 255, 0, 255 } + 3 + { + # The Slime King Boss script. + Name = Slime King + Phase1 + { + Size = 800 + ShootRepeatTime = 4.0 + ShootRingCount = 3 + #In degrees. + RingOffset = 10 + # Number of pattern repeats before a jump occurs. + JumpAfter = 4 + AirborneTime = 3.0 + LandingRingCount = 1 + LandingRecoveryTime = 2.0 + } + Phase2 + { + Size = 600 + # Percentage of health to transition to Phase 2 + Change = 75% + MonsterSpawnOnChange = Red Slime, 2 + + } + Phase2Change = 75 + Phase2Size = 600 + # Percentage of health to transition to Phase 3 + Phase3Change = 50 + Phase3Size = 400 + # Percentage of health to transition to Phase 4 + Phase4Change = 25 + Phase4Size = 200 + # How often the enemy shoots. + ShootingSpeed = 0.6 + BulletSpeed = 450 + BulletSize = 30 + BulletColor = 0, 255, 0, 255 + } } \ No newline at end of file diff --git a/Crawler/test b/Crawler/test deleted file mode 100644 index 8bed73c2..00000000 --- a/Crawler/test +++ /dev/null @@ -1,3 +0,0 @@ -test 1 -test 2 -test 3 \ No newline at end of file