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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user