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:
@@ -976,4 +976,14 @@ void DeathSpawnInfo::Spawn(const vf2d monsterDeathPos,const bool onUpperLevel){
|
||||
for(uint8_t i=0;i<spawnAmt;i++){
|
||||
game->SpawnMonster(monsterDeathPos+spawnLocOffset,MONSTER_DATA.at(monsterSpawnName),onUpperLevel).iframe_timer=0.25f;
|
||||
}
|
||||
}
|
||||
|
||||
void Monster::ProximityKnockback(const vf2d centerPoint,const float knockbackFactor){
|
||||
geom2d::line<float>lineToMonster(centerPoint,game->GetPlayer()->GetPos());
|
||||
float dist=lineToMonster.length();
|
||||
if(dist<0.001f){
|
||||
float randomDir=util::random(2*PI);
|
||||
lineToMonster={centerPoint,centerPoint+vf2d{cos(randomDir),sin(randomDir)}*1};
|
||||
}
|
||||
game->GetPlayer()->Knockback(lineToMonster.vector().norm()*knockbackFactor);
|
||||
}
|
||||
Reference in New Issue
Block a user