Added Mob::HasTargetReflection()

This commit is contained in:
Uleat 2017-01-30 17:38:17 -05:00
parent dc308e2ecb
commit da9792160d
2 changed files with 3 additions and 2 deletions

View File

@ -2273,7 +2273,7 @@ void Bot::AI_Process() {
if(AI_movement_timer->Check()) {
if (!IsMoving()) {
if (GetClass() == ROGUE) {
if ((GetTarget()->GetTarget() == this) && !GetTarget()->IsFeared() && !GetTarget()->IsStunned()) {
if (HasTargetReflection() && !GetTarget()->IsFeared() && !GetTarget()->IsStunned()) {
// Hate redux actions
if (evade_timer.Check(false)) {
// Attempt to evade
@ -2299,7 +2299,7 @@ void Bot::AI_Process() {
float newZ = 0;
FaceTarget(GetTarget());
if (PlotPositionAroundTarget(this, newX, newY, newZ)) {
Bot::BotGroupSay(this, "Backing off of %s", GetTarget()->GetCleanName());
Emote("steps back from %s", GetTarget()->GetCleanName());
CalculateNewPosition2(newX, newY, newZ, GetRunspeed());
return;
}

View File

@ -420,6 +420,7 @@ public:
strn0cpy(name, GetName(), 64); return; };
inline Mob* GetTarget() const { return target; }
virtual void SetTarget(Mob* mob);
inline bool HasTargetReflection() const { return (target && target->target == this); }
virtual inline float GetHPRatio() const { return max_hp == 0 ? 0 : ((float)cur_hp/max_hp*100); }
virtual inline int GetIntHPRatio() const { return max_hp == 0 ? 0 : static_cast<int>(cur_hp * 100 / max_hp); }
inline int32 GetAC() const { return AC; }