mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-25 06:26:24 +00:00
Rename groupmaster to groupleader and related variables. (#1875)
Fix the naming conventions. Master should be reserved to identify a bots Master. groupleaders are not necessarily group masters and it should be clear what the bot is looking for. (In most solo cases leader=master)
This commit is contained in:
@@ -62,7 +62,7 @@ class MeleeFormation : public FollowFormation
|
||||
public:
|
||||
MeleeFormation(PlayerbotAI* botAI) : FollowFormation(botAI, "melee") {}
|
||||
|
||||
std::string const GetTargetName() override { return "master target"; }
|
||||
std::string const GetTargetName() override { return "group leader"; }
|
||||
};
|
||||
|
||||
class QueueFormation : public FollowFormation
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "MasterTargetValue.h"
|
||||
#include "GroupLeaderValue.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
Unit* MasterTargetValue::Calculate() { return botAI->GetGroupMaster(); }
|
||||
Unit* GroupLeaderValue::Calculate() { return botAI->GetGroupLeader(); }
|
||||
@@ -3,18 +3,18 @@
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_MASTERTARGETVALUE_H
|
||||
#define _PLAYERBOT_MASTERTARGETVALUE_H
|
||||
#ifndef _PLAYERBOT_GROUPLEADERVALUE_H
|
||||
#define _PLAYERBOT_GROUPLEADERVALUE_H
|
||||
|
||||
#include "Value.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
class Unit;
|
||||
|
||||
class MasterTargetValue : public UnitCalculatedValue
|
||||
class GroupLeaderValue : public UnitCalculatedValue
|
||||
{
|
||||
public:
|
||||
MasterTargetValue(PlayerbotAI* botAI, std::string const name = "master target") : UnitCalculatedValue(botAI, name)
|
||||
GroupLeaderValue(PlayerbotAI* botAI, std::string const name = "group leader") : UnitCalculatedValue(botAI, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ GuidVector GroupMembersValue::Calculate()
|
||||
|
||||
bool IsFollowingPartyValue::Calculate()
|
||||
{
|
||||
if (botAI->GetGroupMaster() == bot)
|
||||
if (botAI->GetGroupLeader() == bot)
|
||||
return true;
|
||||
|
||||
if (botAI->HasStrategy("follow", BOT_STATE_NON_COMBAT))
|
||||
@@ -39,15 +39,15 @@ bool IsFollowingPartyValue::Calculate()
|
||||
|
||||
bool IsNearLeaderValue::Calculate()
|
||||
{
|
||||
Player* groupMaster = botAI->GetGroupMaster();
|
||||
Player* groupLeader = botAI->GetGroupLeader();
|
||||
|
||||
if (!groupMaster)
|
||||
if (!groupLeader)
|
||||
return false;
|
||||
|
||||
if (groupMaster == bot)
|
||||
if (groupLeader == bot)
|
||||
return true;
|
||||
|
||||
return sServerFacade->GetDistance2d(bot, botAI->GetGroupMaster()) < sPlayerbotAIConfig->sightDistance;
|
||||
return sServerFacade->GetDistance2d(bot, botAI->GetGroupLeader()) < sPlayerbotAIConfig->sightDistance;
|
||||
}
|
||||
|
||||
bool BoolANDValue::Calculate()
|
||||
@@ -154,8 +154,8 @@ bool GroupReadyValue::Calculate()
|
||||
|
||||
// We only wait for members that are in range otherwise we might be waiting for bots stuck in dead loops
|
||||
// forever.
|
||||
if (botAI->GetGroupMaster() &&
|
||||
sServerFacade->GetDistance2d(member, botAI->GetGroupMaster()) > sPlayerbotAIConfig->sightDistance)
|
||||
if (botAI->GetGroupLeader() &&
|
||||
sServerFacade->GetDistance2d(member, botAI->GetGroupLeader()) > sPlayerbotAIConfig->sightDistance)
|
||||
continue;
|
||||
|
||||
if (member->GetHealthPct() < sPlayerbotAIConfig->almostFullHealth)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "Formations.h"
|
||||
#include "GrindTargetValue.h"
|
||||
#include "GroupValues.h"
|
||||
#include "GroupLeaderValue.h"
|
||||
#include "GuildValues.h"
|
||||
#include "HasAvailableLootValue.h"
|
||||
#include "HasTotemValue.h"
|
||||
@@ -51,7 +52,6 @@
|
||||
#include "LootStrategyValue.h"
|
||||
#include "MaintenanceValues.h"
|
||||
#include "ManaSaveLevelValue.h"
|
||||
#include "MasterTargetValue.h"
|
||||
#include "NearestAdsValue.h"
|
||||
#include "NearestCorpsesValue.h"
|
||||
#include "NearestFriendlyPlayersValue.h"
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
creators["party member to resurrect"] = &ValueContext::party_member_to_resurrect;
|
||||
creators["current target"] = &ValueContext::current_target;
|
||||
creators["self target"] = &ValueContext::self_target;
|
||||
creators["master target"] = &ValueContext::master;
|
||||
creators["group leader"] = &ValueContext::group_leader;
|
||||
creators["line target"] = &ValueContext::line_target;
|
||||
creators["tank target"] = &ValueContext::tank_target;
|
||||
creators["dps target"] = &ValueContext::dps_target;
|
||||
@@ -439,7 +439,7 @@ private:
|
||||
static UntypedValue* current_target(PlayerbotAI* botAI) { return new CurrentTargetValue(botAI); }
|
||||
static UntypedValue* old_target(PlayerbotAI* botAI) { return new CurrentTargetValue(botAI); }
|
||||
static UntypedValue* self_target(PlayerbotAI* botAI) { return new SelfTargetValue(botAI); }
|
||||
static UntypedValue* master(PlayerbotAI* botAI) { return new MasterTargetValue(botAI); }
|
||||
static UntypedValue* group_leader(PlayerbotAI* botAI) { return new GroupLeaderValue(botAI); }
|
||||
static UntypedValue* line_target(PlayerbotAI* botAI) { return new LineTargetValue(botAI); }
|
||||
static UntypedValue* tank_target(PlayerbotAI* botAI) { return new TankTargetValue(botAI); }
|
||||
static UntypedValue* dps_target(PlayerbotAI* botAI) { return new DpsTargetValue(botAI); }
|
||||
|
||||
Reference in New Issue
Block a user