From f5038d4a243c664625ffb4ff710bb829bc98eb44 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 12 Nov 2024 19:25:44 -0600 Subject: [PATCH] Add in more AI. --- Adventures in Lestoria/OctopusArm.cpp | 19 ++++++++++++++++--- Adventures in Lestoria/Oktopus boss.txt | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Adventures in Lestoria/OctopusArm.cpp b/Adventures in Lestoria/OctopusArm.cpp index b9d2dc4c..4d8aa023 100644 --- a/Adventures in Lestoria/OctopusArm.cpp +++ b/Adventures in Lestoria/OctopusArm.cpp @@ -56,6 +56,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str SEARCH, PREPARE_ATTACK, ATTACK_ANIMATION, + SUBMERGE, }; const auto GetAttackArc=[attackRadius=ConfigFloat("Attack Radius"),attackArc=ConfigFloat("Attack Arc")](const Monster&m){ @@ -79,7 +80,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str const std::string GIANT_OCTOPUS_NAME{"Giant Octopus"}; const std::string OCTOPUS_ARM_NAME{"Octopus Arm"}; - if(!MONSTER_DATA.count(GIANT_OCTOPUS_NAME))ERR("WARNING! Octopus" + if(!MONSTER_DATA.count(GIANT_OCTOPUS_NAME))ERR(std::format("WARNING! {} does not exist on the map! THIS SHOULD NOT BE HAPPENING!",GIANT_OCTOPUS_NAME)); auto boss{std::find_if(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&GIANT_OCTOPUS_NAME](const std::shared_ptr&m){ return m->GetName()==GIANT_OCTOPUS_NAME; @@ -88,8 +89,12 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str Monster&bossMonster{**boss}; bossMonster.Hurt(bossDamageOnDeath,m.OnUpperLevel(),m.GetZ()); } - std::for_each(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&OCTOPUS_ARM_NAME](const std::shared_ptr&m){ - if(m->GetName()==OCTOPUS_ARM_NAME) + std::for_each(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&OCTOPUS_ARM_NAME,&strategyName](const std::shared_ptr&m){ + if(m->GetName()==OCTOPUS_ARM_NAME){ + m->PerformAnimation("SUBMERGE"); + m->SetPhase(strategyName,SUBMERGE); + m->GetFloat(A::RECOVERY_TIME)=m->GetCurrentAnimation().GetTotalAnimationDuration(); + } }); return false; }); @@ -149,5 +154,13 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str SETPHASE(SEARCH); } }break; + case SUBMERGE:{ + m.F(A::RECOVERY_TIME)-=fElapsedTime; + if(m.F(A::RECOVERY_TIME)<=0.f){ + m.PerformAnimation("RISE"); + m.F(A::CASTING_TIMER)=m.GetCurrentAnimation().GetTotalAnimationDuration(); + SETPHASE(RISE_ANIMATION); + } + }break; } } \ No newline at end of file diff --git a/Adventures in Lestoria/Oktopus boss.txt b/Adventures in Lestoria/Oktopus boss.txt index 67f23c62..1d5e9aa1 100644 --- a/Adventures in Lestoria/Oktopus boss.txt +++ b/Adventures in Lestoria/Oktopus boss.txt @@ -22,8 +22,8 @@ Tentacles: - The Tentacles wiggle a bit around between attacks - Wiggle phase is 2-4 seconds. - Tentacle stopps moving for 1 sec before attacking, already indicating where it will attack. -- The Tentacle attacks with its entire wheight slaming the position where the player was when the movement stopped. - The Tentacle rest on the floor for a short period after an attack ~1 sec (can vary a bit depending how animation looks smoother) +- The Tentacle attacks with its entire wheight slaming the position where the player was when the movement stopped. Reference for Tentacle attack https://youtu.be/YtR521QdsNk?si=_TUxuH-3HLnwr_t9&t=475 (Should start at time stamp 07:55 with a bossfight) Instead of wiggling around the tentacles supmerge here in between attacks.