This commit is contained in:
aozhiwei 2021-03-29 17:14:58 +08:00
parent a3090b629b
commit ac398bf60f
4 changed files with 16 additions and 10 deletions

View File

@ -893,3 +893,17 @@ void Creature::ResetAction()
action_target_id = 0;
need_sync_active_player = true;
}
bool Creature::IsProperTarget(Creature* target)
{
return true;
}
bool Creature::IsEnemy(Creature* target)
{
if (room->GetRoomMode() == kZombieMode) {
return target->GetRace() != GetRace();
} else {
return team_id != target->team_id;
}
}

View File

@ -57,6 +57,8 @@ class Creature : public MoveableEntity
void AddPassiveSkill(int skill_id);
void ClearPassiveSkill();
bool IsProperTarget(Creature* target);
bool IsEnemy(Creature* target);
virtual void SelectSkillTargets(Skill* skill,
const a8::Vec2& target_pos,
std::set<Entity*>& target_list);

View File

@ -2032,15 +2032,6 @@ void Human::WinExp(Human* sender, int exp)
}
}
bool Human::IsEnemy(Human* hum)
{
if (room->GetRoomMode() == kZombieMode) {
return hum->GetRace() != GetRace();
} else {
return team_id != hum->team_id;
}
}
RoomObstacle* Human::SummonObstacle(int id, const a8::Vec2& pos)
{
RoomObstacle* obstacle = room->CreateObstacle(id, pos.x, pos.y);

View File

@ -247,7 +247,6 @@ class Human : public Creature
int GetSeat() { return seat_; }
void SetSeat(int seat) { seat_ = seat; }
void DeadDrop();
bool IsEnemy(Human* hum);
RoomObstacle* SummonObstacle(int id, const a8::Vec2& pos);
virtual std::string GetName() override { return name;};