|
|
|
@ -85,16 +85,19 @@ void Monster::STRATEGY::BEAR(Monster&m,float fElapsedTime,std::string strategy){ |
|
|
|
|
SoundEffect::PlaySFX("Bear Slam Attack",m.GetPos()+m.V(A::LOCKON_POS)); |
|
|
|
|
m.I(A::PHASE)=0; |
|
|
|
|
geom2d::circle<float>attackCircle={m.GetPos()+m.V(A::LOCKON_POS),float(operator""_Pixels(ConfigFloat("Smash Attack Diameter"))/2.f)}; |
|
|
|
|
float lockOnDistToPlayer=geom2d::line<float>(m.V(A::LOCKON_POS),game->GetPlayer()->GetPos()).length(); |
|
|
|
|
float lockOnDistToPlayer=geom2d::line<float>(game->GetPlayer()->GetPos(),m.V(A::LOCKON_POS)).length(); |
|
|
|
|
if(geom2d::overlaps(attackCircle,game->GetPlayer()->Hitbox())){ |
|
|
|
|
if(game->GetPlayer()->Hurt(m.GetAttack(),m.OnUpperLevel(),0.f)){ |
|
|
|
|
game->GetPlayer()->Knockup(ConfigFloat("Attack Knockup Duration")); |
|
|
|
|
vf2d playerDirVecNorm=geom2d::line<float>(game->GetPlayer()->GetPos(),m.V(A::LOCKON_POS)).vector().norm(); |
|
|
|
|
game->GetPlayer()->Knockback(playerDirVecNorm*ConfigFloat("Attack Knockback Amount")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for(Monster&otherM:MONSTER_LIST){ |
|
|
|
|
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&& |
|
|
|
|
geom2d::overlaps(attackCircle,otherM.Hitbox())){ |
|
|
|
|
if(!otherM.AttackAvoided(m.GetZ())&&&m!=&otherM&&geom2d::overlaps(attackCircle,otherM.Hitbox())){ |
|
|
|
|
otherM.Knockup(ConfigFloat("Attack Knockup Duration")); |
|
|
|
|
vf2d monsterDirVecNorm=geom2d::line<float>(m.V(A::LOCKON_POS),otherM.GetPos()).vector().norm(); |
|
|
|
|
game->GetPlayer()->Knockback(monsterDirVecNorm*ConfigFloat("Attack Knockback Amount")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
m.spriteRot=0.f; |
|
|
|
|