This commit is contained in:
aozhiwei 2021-05-07 19:41:57 +08:00
parent d40c8d5348
commit 52fb6567b2
4 changed files with 13 additions and 5 deletions

View File

@ -55,8 +55,7 @@ void Bullet::OnHit(std::set<Entity*>& objects)
case ET_Player: case ET_Player:
{ {
Human* hum = (Human*)target; Human* hum = (Human*)target;
if (hum->HasBuffEffect(kBET_Invincible) || if (hum->IsInvincible()) {
hum->HasBuffEffect(kBET_AdPlaying)) {
continue; continue;
} }
if (sender.Get()->room->GetRoomMode() == kZombieMode && if (sender.Get()->room->GetRoomMode() == kZombieMode &&

View File

@ -1076,7 +1076,7 @@ bool Creature::IsProperTarget(Creature* target)
if (room->GetRoomMode() == kZombieMode && GetRace() == target->GetRace()) { if (room->GetRoomMode() == kZombieMode && GetRace() == target->GetRace()) {
return false; return false;
} }
if (target->HasBuffEffect(kBET_Invincible)) { if (target->IsInvincible()) {
return false; return false;
} }
if (target->HasBuffEffect(kBET_Hide)) { if (target->HasBuffEffect(kBET_Hide)) {
@ -1580,3 +1580,12 @@ void Creature::RemoveMoreObstacle(int buff_id, int id, int num)
{ {
} }
bool Creature::IsInvincible()
{
return HasBuffEffect(kBET_Invincible) ||
HasBuffEffect(kBET_AdPlaying) ||
HasBuffEffect(kBET_Driver) ||
HasBuffEffect(kBET_Passenger)
;
}

View File

@ -150,6 +150,7 @@ class Creature : public MoveableEntity
void UpdateSkill(); void UpdateSkill();
bool FreezeOperate(); bool FreezeOperate();
void SlaveOnRemove(Entity* slave); void SlaveOnRemove(Entity* slave);
bool IsInvincible();
private: private:

View File

@ -51,8 +51,7 @@ void FragMiTask::Done()
); );
for (auto& target : objects) { for (auto& target : objects) {
if (target->HasBuffEffect(kBET_Invincible) || if (target->IsInvincible()) {
target->HasBuffEffect(kBET_AdPlaying)) {
continue; continue;
} }
if (sender.Get()->room->GetRoomMode() == kZombieMode && if (sender.Get()->room->GetRoomMode() == kZombieMode &&