1
This commit is contained in:
parent
e0a8ea8b03
commit
d8b1d6484d
@ -4182,3 +4182,22 @@ bool Creature::IsOb()
|
||||
{
|
||||
return a8::HasBitFlag(status, CS_IsOb);
|
||||
}
|
||||
|
||||
bool Creature::HaveBallingEnemy()
|
||||
{
|
||||
bool have = false;
|
||||
TraverseCreatures
|
||||
(
|
||||
[this, &have] (Creature* c, bool& stop)
|
||||
{
|
||||
if (c->team_id != team_id && !c->HasBuffEffect(kBET_Hide) && !c->IsCar()) {
|
||||
float distance = c->GetPos().Distance2D2(GetPos());
|
||||
if (distance <= mt::Param::s().battling_detection_range) {
|
||||
have = true;
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return have;
|
||||
}
|
||||
|
@ -411,6 +411,7 @@ class Creature : public MoveableEntity
|
||||
void AdjustMobaBornDir();
|
||||
int GetBattleStartTime();
|
||||
bool IsOb();
|
||||
bool HaveBallingEnemy();
|
||||
|
||||
protected:
|
||||
virtual void OnBuffRemove(Buff& buff);
|
||||
|
Loading…
x
Reference in New Issue
Block a user