Estimated dps calculation

This commit is contained in:
Yunfan Li
2024-09-01 17:11:46 +08:00
parent ae37876848
commit 360a025b34
15 changed files with 165 additions and 128 deletions

View File

@@ -172,7 +172,7 @@ public:
creators["rtsc"] = &ChatActionContext::rtsc;
creators["naxx chat shortcut"] = &ChatActionContext::naxx_chat_shortcut;
creators["bwl chat shortcut"] = &ChatActionContext::bwl_chat_shortcut;
creators["tell expected dps"] = &ChatActionContext::tell_expected_dps;
creators["tell estimated dps"] = &ChatActionContext::tell_estimated_dps;
creators["join"] = &ChatActionContext::join;
creators["calc"] = &ChatActionContext::calc;
}
@@ -271,7 +271,7 @@ private:
static Action* rtsc(PlayerbotAI* botAI) { return new RTSCAction(botAI); }
static Action* naxx_chat_shortcut(PlayerbotAI* ai) { return new NaxxChatShortcutAction(ai); }
static Action* bwl_chat_shortcut(PlayerbotAI* ai) { return new BwlChatShortcutAction(ai); }
static Action* tell_expected_dps(PlayerbotAI* ai) { return new TellExpectedDpsAction(ai); }
static Action* tell_estimated_dps(PlayerbotAI* ai) { return new TellEstimatedDpsAction(ai); }
static Action* join(PlayerbotAI* ai) { return new JoinGroupAction(ai); }
static Action* calc(PlayerbotAI* ai) { return new TellCalculateItemAction(ai); }
};

View File

@@ -364,5 +364,5 @@ bool CastDebuffSpellAction::isUseful()
return false;
}
return CastAuraSpellAction::isUseful() &&
(target->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime;
(target->GetHealth() / AI_VALUE(float, "estimated group dps")) >= needLifeTime;
}

View File

@@ -130,10 +130,10 @@ bool TellAuraAction::Execute(Event event)
return true;
}
bool TellExpectedDpsAction::Execute(Event event)
bool TellEstimatedDpsAction::Execute(Event event)
{
float dps = AI_VALUE(float, "expected group dps");
botAI->TellMaster("Expected Group DPS: " + std::to_string(dps));
float dps = AI_VALUE(float, "estimated group dps");
botAI->TellMaster("Estimated Group DPS: " + std::to_string(dps));
return true;
}

View File

@@ -30,10 +30,10 @@ public:
virtual bool Execute(Event event);
};
class TellExpectedDpsAction : public Action
class TellEstimatedDpsAction : public Action
{
public:
TellExpectedDpsAction(PlayerbotAI* ai) : Action(ai, "tell expected dps") {}
TellEstimatedDpsAction(PlayerbotAI* ai) : Action(ai, "tell estimated dps") {}
virtual bool Execute(Event event);
};