|
|
|
@ -45,6 +45,7 @@ All rights reserved. |
|
|
|
|
using A=Attribute; |
|
|
|
|
|
|
|
|
|
INCLUDE_game |
|
|
|
|
INCLUDE_MONSTER_LIST |
|
|
|
|
|
|
|
|
|
void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string strategy){ |
|
|
|
|
enum PhaseName{ |
|
|
|
@ -53,10 +54,32 @@ void Monster::STRATEGY::GIANT_OCTOPUS(Monster&m,float fElapsedTime,std::string s |
|
|
|
|
}; |
|
|
|
|
switch(PHASE()){ |
|
|
|
|
case IDENTIFY_ARMS:{ |
|
|
|
|
|
|
|
|
|
m.F(A::CASTING_TIMER)=util::random_range(ConfigFloatArr("Tentacle Move Timer",0),ConfigFloatArr("Tentacle Move Timer",1)); |
|
|
|
|
for(std::shared_ptr<Monster>&arm:MONSTER_LIST){ |
|
|
|
|
const std::string OCTOPUS_ARM_NAME{"Octopus Arm"}; |
|
|
|
|
if(arm->GetName()==OCTOPUS_ARM_NAME){ |
|
|
|
|
std::weak_ptr<Monster>armPtr{arm}; |
|
|
|
|
m.VEC(A::ARM_LIST).emplace_back(armPtr); |
|
|
|
|
m.VEC(A::ARM_LOCATIONS).emplace_back(armPtr.lock()->GetPos()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case NORMAL:{ |
|
|
|
|
|
|
|
|
|
m.F(A::CASTING_TIMER)-=fElapsedTime; |
|
|
|
|
if(m.F(A::CASTING_TIMER)<=0.f){ |
|
|
|
|
int deadMonsterCount{0}; |
|
|
|
|
std::vector<vf2d>tempArmLocs; |
|
|
|
|
for(size_t i=0U;std::any&arm:m.VEC(A::ARM_LIST)){ |
|
|
|
|
const std::weak_ptr<Monster>&m{std::any_cast<std::weak_ptr<Monster>>(arm)}; |
|
|
|
|
if(m.expired()||m.lock()->IsDead()){ |
|
|
|
|
deadMonsterCount++; |
|
|
|
|
tempArmLocs.emplace_back(std::any_cast<vf2d>(m.VEC(A::ARM_LOCATIONS))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(deadMonsterCount>0){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |