1
This commit is contained in:
parent
49edba7957
commit
2f0bee2fd8
@ -112,7 +112,7 @@ void AndroidAI::DoAttack()
|
||||
}
|
||||
if (owner->updated_times % 10 == 0) {
|
||||
Human* enemy = owner->room->FindEnemy((Human*)owner);
|
||||
if (enemy) {
|
||||
if (enemy && !enemy->HasBuffEffect(BET_Invincible) && !enemy->HasBuffEffect(BET_Hide)) {
|
||||
Human* sender = (Human*)owner;
|
||||
a8::Vec2 shot_dir = enemy->pos - sender->pos;
|
||||
if (std::abs(shot_dir.x) > FLT_EPSILON ||
|
||||
|
@ -1384,6 +1384,11 @@ void Human::RemoveBuff(int buff_id)
|
||||
}
|
||||
}
|
||||
|
||||
bool Human::HasBuffEffect(int buff_effect_id)
|
||||
{
|
||||
return GetBuffByEffectId(buff_effect_id) != nullptr;
|
||||
}
|
||||
|
||||
void Human::_UpdateMove(int speed)
|
||||
{
|
||||
for (int i = 0; i < speed; ++i) {
|
||||
|
@ -201,6 +201,7 @@ class Human : public Entity
|
||||
void TriggerBuff(std::set<Entity*>& target_list, BuffTriggerType_e trigger_type);
|
||||
void AddBuff(MetaData::Buff* buff_meta);
|
||||
void RemoveBuff(int buff_id);
|
||||
bool HasBuffEffect(int buff_effect_id);
|
||||
|
||||
protected:
|
||||
void _UpdateMove(int speed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user