Add in more AI.
This commit is contained in:
parent
5e02dd6590
commit
f5038d4a24
@ -56,6 +56,7 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
|
|||||||
SEARCH,
|
SEARCH,
|
||||||
PREPARE_ATTACK,
|
PREPARE_ATTACK,
|
||||||
ATTACK_ANIMATION,
|
ATTACK_ANIMATION,
|
||||||
|
SUBMERGE,
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto GetAttackArc=[attackRadius=ConfigFloat("Attack Radius"),attackArc=ConfigFloat("Attack Arc")](const Monster&m){
|
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 GIANT_OCTOPUS_NAME{"Giant Octopus"};
|
||||||
const std::string OCTOPUS_ARM_NAME{"Octopus Arm"};
|
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<Monster>&m){
|
auto boss{std::find_if(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&GIANT_OCTOPUS_NAME](const std::shared_ptr<Monster>&m){
|
||||||
return m->GetName()==GIANT_OCTOPUS_NAME;
|
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};
|
Monster&bossMonster{**boss};
|
||||||
bossMonster.Hurt(bossDamageOnDeath,m.OnUpperLevel(),m.GetZ());
|
bossMonster.Hurt(bossDamageOnDeath,m.OnUpperLevel(),m.GetZ());
|
||||||
}
|
}
|
||||||
std::for_each(MONSTER_LIST.begin(),MONSTER_LIST.end(),[&OCTOPUS_ARM_NAME](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->SetPhase(strategyName,SUBMERGE);
|
||||||
|
m->GetFloat(A::RECOVERY_TIME)=m->GetCurrentAnimation().GetTotalAnimationDuration();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@ -149,5 +154,13 @@ void Monster::STRATEGY::OCTOPUS_ARM(Monster&m,float fElapsedTime,std::string str
|
|||||||
SETPHASE(SEARCH);
|
SETPHASE(SEARCH);
|
||||||
}
|
}
|
||||||
}break;
|
}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;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,8 +22,8 @@ Tentacles:
|
|||||||
- The Tentacles wiggle a bit around between attacks
|
- The Tentacles wiggle a bit around between attacks
|
||||||
- Wiggle phase is 2-4 seconds.
|
- Wiggle phase is 2-4 seconds.
|
||||||
- Tentacle stopps moving for 1 sec before attacking, already indicating where it will attack.
|
- 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 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)
|
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.
|
Instead of wiggling around the tentacles supmerge here in between attacks.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user