diff --git a/Adventures in Lestoria/GiantOctopus.cpp b/Adventures in Lestoria/GiantOctopus.cpp index 1bd074d2..550616e2 100644 --- a/Adventures in Lestoria/GiantOctopus.cpp +++ b/Adventures in Lestoria/GiantOctopus.cpp @@ -78,23 +78,31 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s if(m.F(A::CASTING_TIMER)<=0.f){ int deadMonsterCount{0}; std::vectortempArmLocs; - std::vectorliveArms{std::find_if(m.VEC(A::ARM_LIST).begin(),m.VEC(A::ARM_LIST).end(),[](const std::any&arm){ + std::vectorliveArms; + std::copy_if(m.VEC(A::ARM_LIST).begin(),m.VEC(A::ARM_LIST).end(),std::back_inserter(liveArms),[](const std::any&arm){ const std::weak_ptr&m{std::any_cast>(arm)}; return !m.expired()&&m.lock()->IsAlive(); - })}; + }); for(int index{0};std::any&arm:m.VEC(A::ARM_LIST)){ const std::weak_ptr&armM{std::any_cast>(arm)}; if(armM.expired()||armM.lock()->IsDead()){ deadMonsterCount++; - if(!armM.expired())tempArmLocs.emplace_back(std::any_cast(armM.lock()->VEC(A::ARM_LOCATIONS)[index])); + tempArmLocs.emplace_back(std::any_cast(m.VEC(A::ARM_LOCATIONS)[index])); + }else{ + armM.lock()->V(A::JUMP_TARGET_POS)=std::any_cast(m.VEC(A::ARM_LOCATIONS)[index]); } index++; } + int counter{}; + std::for_each(tempArmLocs.begin(),tempArmLocs.end(),[counter](const std::any tempArm){ + LOG(std::format("Arm Loc {}: {}",counter,std::any_cast(tempArm).str())); + }); const bool AtLeastOneArmAlive{deadMonsterCount!=m.VEC(A::ARM_LIST).size()}; if(deadMonsterCount>0&&AtLeastOneArmAlive){ const std::weak_ptr&randomArm{std::any_cast>(liveArms[util::random()%liveArms.size()])}; - const vf2d&randomLoc{std::any_cast(randomArm.lock()->VEC(A::ARM_LOCATIONS))}; + const vf2d&randomLoc{std::any_cast(tempArmLocs[util::random()%tempArmLocs.size()])}; randomArm.lock()->PerformAnimation("SUBMERGE"); + randomArm.lock()->GetCurrentAnimation().GetTotalAnimationDuration(); randomArm.lock()->SetPhase(strategy,randomArm.lock()->I(A::SUBMERGE_STRAT_ID)); randomArm.lock()->GetFloat(A::RECOVERY_TIME)=randomArm.lock()->GetCurrentAnimation().GetTotalAnimationDuration(); randomArm.lock()->SetCollisionRadius(0.f); diff --git a/Adventures in Lestoria/OctopusArm.cpp b/Adventures in Lestoria/OctopusArm.cpp index f0ba6b2a..93a78b85 100644 --- a/Adventures in Lestoria/OctopusArm.cpp +++ b/Adventures in Lestoria/OctopusArm.cpp @@ -91,13 +91,12 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str })}; if(boss!=MONSTER_LIST.end()){ Monster&bossMonster{**boss}; - bossMonster.Hurt(bossDamageOnDeath,m.OnUpperLevel(),m.GetZ()); + bossMonster._DealTrueDamage(bossDamageOnDeath); } 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->V(A::JUMP_TARGET_POS)=m->GetPos(); m->GetFloat(A::RECOVERY_TIME)=m->GetCurrentAnimation().GetTotalAnimationDuration(); } }); @@ -110,6 +109,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str m.F(A::CASTING_TIMER)-=fElapsedTime; if(m.F(A::CASTING_TIMER)<=0.f){ m.PerformAnimation("IDLE",game->GetPlayer()->GetPos()); + m.SetCollisionRadius(m.GetOriginalCollisionRadius()); SETPHASE(SEARCH); } }break; @@ -175,7 +175,9 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str m.F(A::RECOVERY_TIME)-=fElapsedTime; if(m.F(A::RECOVERY_TIME)<=0.f){ m.PerformAnimation("RISE"); + LOG(std::format("Moved from {}",m.GetPos().str())); m.SetPos(m.V(A::JUMP_TARGET_POS)); + LOG(std::format("to {}. Expected to go to {}",m.GetPos().str(),m.V(A::JUMP_TARGET_POS).str())); m.F(A::CASTING_TIMER)=m.GetCurrentAnimation().GetTotalAnimationDuration(); SETPHASE(RISE_ANIMATION); } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index c4ee1da5..9694eb80 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 11815 +#define VERSION_BUILD 11828 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 7aad82d8..3e714491 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ