Fix octopus arm transition damage to be true damage instead of player damage (no critical hits). Fix octopus arm transition jump target positions (return (0,0) now)

master
sigonasr2 2 months ago
parent 54c57a692f
commit 442b22f640
  1. 16
      Adventures in Lestoria/GiantOctopus.cpp
  2. 6
      Adventures in Lestoria/OctopusArm.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -78,23 +78,31 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s
if(m.F(A::CASTING_TIMER)<=0.f){ if(m.F(A::CASTING_TIMER)<=0.f){
int deadMonsterCount{0}; int deadMonsterCount{0};
std::vector<vf2d>tempArmLocs; std::vector<vf2d>tempArmLocs;
std::vector<std::any>liveArms{std::find_if(m.VEC(A::ARM_LIST).begin(),m.VEC(A::ARM_LIST).end(),[](const std::any&arm){ std::vector<std::any>liveArms;
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<Monster>&m{std::any_cast<std::weak_ptr<Monster>>(arm)}; const std::weak_ptr<Monster>&m{std::any_cast<std::weak_ptr<Monster>>(arm)};
return !m.expired()&&m.lock()->IsAlive(); return !m.expired()&&m.lock()->IsAlive();
})}; });
for(int index{0};std::any&arm:m.VEC(A::ARM_LIST)){ for(int index{0};std::any&arm:m.VEC(A::ARM_LIST)){
const std::weak_ptr<Monster>&armM{std::any_cast<std::weak_ptr<Monster>>(arm)}; const std::weak_ptr<Monster>&armM{std::any_cast<std::weak_ptr<Monster>>(arm)};
if(armM.expired()||armM.lock()->IsDead()){ if(armM.expired()||armM.lock()->IsDead()){
deadMonsterCount++; deadMonsterCount++;
if(!armM.expired())tempArmLocs.emplace_back(std::any_cast<vf2d>(armM.lock()->VEC(A::ARM_LOCATIONS)[index])); tempArmLocs.emplace_back(std::any_cast<vf2d>(m.VEC(A::ARM_LOCATIONS)[index]));
}else{
armM.lock()->V(A::JUMP_TARGET_POS)=std::any_cast<vf2d>(m.VEC(A::ARM_LOCATIONS)[index]);
} }
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<vf2d>(tempArm).str()));
});
const bool AtLeastOneArmAlive{deadMonsterCount!=m.VEC(A::ARM_LIST).size()}; const bool AtLeastOneArmAlive{deadMonsterCount!=m.VEC(A::ARM_LIST).size()};
if(deadMonsterCount>0&&AtLeastOneArmAlive){ if(deadMonsterCount>0&&AtLeastOneArmAlive){
const std::weak_ptr<Monster>&randomArm{std::any_cast<std::weak_ptr<Monster>>(liveArms[util::random()%liveArms.size()])}; const std::weak_ptr<Monster>&randomArm{std::any_cast<std::weak_ptr<Monster>>(liveArms[util::random()%liveArms.size()])};
const vf2d&randomLoc{std::any_cast<vf2d>(randomArm.lock()->VEC(A::ARM_LOCATIONS))}; const vf2d&randomLoc{std::any_cast<vf2d>(tempArmLocs[util::random()%tempArmLocs.size()])};
randomArm.lock()->PerformAnimation("SUBMERGE"); randomArm.lock()->PerformAnimation("SUBMERGE");
randomArm.lock()->GetCurrentAnimation().GetTotalAnimationDuration();
randomArm.lock()->SetPhase(strategy,randomArm.lock()->I(A::SUBMERGE_STRAT_ID)); randomArm.lock()->SetPhase(strategy,randomArm.lock()->I(A::SUBMERGE_STRAT_ID));
randomArm.lock()->GetFloat(A::RECOVERY_TIME)=randomArm.lock()->GetCurrentAnimation().GetTotalAnimationDuration(); randomArm.lock()->GetFloat(A::RECOVERY_TIME)=randomArm.lock()->GetCurrentAnimation().GetTotalAnimationDuration();
randomArm.lock()->SetCollisionRadius(0.f); randomArm.lock()->SetCollisionRadius(0.f);

@ -91,13 +91,12 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
})}; })};
if(boss!=MONSTER_LIST.end()){ if(boss!=MONSTER_LIST.end()){
Monster&bossMonster{**boss}; 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<Monster>&m){ std::for_each(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&OCTOPUS_ARM_NAME,&strategyName](const std::shared_ptr<Monster>&m){
if(m->GetName()==OCTOPUS_ARM_NAME){ if(m->GetName()==OCTOPUS_ARM_NAME){
m->PerformAnimation("SUBMERGE"); m->PerformAnimation("SUBMERGE");
m->SetPhase(strategyName,SUBMERGE); m->SetPhase(strategyName,SUBMERGE);
m->V(A::JUMP_TARGET_POS)=m->GetPos();
m->GetFloat(A::RECOVERY_TIME)=m->GetCurrentAnimation().GetTotalAnimationDuration(); 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; m.F(A::CASTING_TIMER)-=fElapsedTime;
if(m.F(A::CASTING_TIMER)<=0.f){ if(m.F(A::CASTING_TIMER)<=0.f){
m.PerformAnimation("IDLE",game->GetPlayer()->GetPos()); m.PerformAnimation("IDLE",game->GetPlayer()->GetPos());
m.SetCollisionRadius(m.GetOriginalCollisionRadius());
SETPHASE(SEARCH); SETPHASE(SEARCH);
} }
}break; }break;
@ -175,7 +175,9 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
m.F(A::RECOVERY_TIME)-=fElapsedTime; m.F(A::RECOVERY_TIME)-=fElapsedTime;
if(m.F(A::RECOVERY_TIME)<=0.f){ if(m.F(A::RECOVERY_TIME)<=0.f){
m.PerformAnimation("RISE"); m.PerformAnimation("RISE");
LOG(std::format("Moved from {}",m.GetPos().str()));
m.SetPos(m.V(A::JUMP_TARGET_POS)); 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(); m.F(A::CASTING_TIMER)=m.GetCurrentAnimation().GetTotalAnimationDuration();
SETPHASE(RISE_ANIMATION); SETPHASE(RISE_ANIMATION);
} }

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 11815 #define VERSION_BUILD 11828
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save