Added overrides for playing default animations in move towards and run away scripts. Implemented Bomb Goblin AI. Include convenience methods for proximity knockback functions. Prepped AI functions for the Hawk and Stone Elementals. Release Build 9230.

This commit is contained in:
2024-05-05 23:57:02 -05:00
parent f5bfc0d34d
commit 79b595bbef
30 changed files with 537 additions and 82 deletions
+10
View File
@@ -1543,4 +1543,14 @@ const float Player::GetIframeTime()const{
const Renderable&Player::GetMinimapImage()const{
return minimapImg;
}
void Player::ProximityKnockback(const vf2d centerPoint,const float knockbackFactor){
geom2d::line<float>lineToPlayer(centerPoint,game->GetPlayer()->GetPos());
float dist=lineToPlayer.length();
if(dist<0.001f){
float randomDir=util::random(2*PI);
lineToPlayer={centerPoint,centerPoint+vf2d{cos(randomDir),sin(randomDir)}*1};
}
game->GetPlayer()->Knockback(lineToPlayer.vector().norm()*knockbackFactor);
}