From b4a5736c02c830a05e9f7195c8abc6aae167ae36 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Tue, 5 Sep 2023 00:56:12 +0800 Subject: [PATCH] time unit for expected lifetime --- src/strategy/triggers/GenericTriggers.cpp | 2 +- src/strategy/triggers/GenericTriggers.h | 2 +- src/strategy/values/ExpectedLifetimeValue.cpp | 2 +- src/strategy/warlock/WarlockTriggers.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/strategy/triggers/GenericTriggers.cpp b/src/strategy/triggers/GenericTriggers.cpp index 707d5c70..d8290760 100644 --- a/src/strategy/triggers/GenericTriggers.cpp +++ b/src/strategy/triggers/GenericTriggers.cpp @@ -207,7 +207,7 @@ bool TargetInSightTrigger::IsActive() bool DebuffTrigger::IsActive() { - return BuffTrigger::IsActive() && GetTarget() && (1000 * GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime; + return BuffTrigger::IsActive() && GetTarget() && (GetTarget()->GetHealth() / AI_VALUE(float, "expected group dps")) >= needLifeTime; } bool DebuffOnBossTrigger::IsActive() diff --git a/src/strategy/triggers/GenericTriggers.h b/src/strategy/triggers/GenericTriggers.h index 3376d92d..7b6bc339 100644 --- a/src/strategy/triggers/GenericTriggers.h +++ b/src/strategy/triggers/GenericTriggers.h @@ -315,7 +315,7 @@ class TargetInSightTrigger : public Trigger class DebuffTrigger : public BuffTrigger { public: - DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false, float needLifeTime = 8000.0f) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner), needLifeTime(needLifeTime) { } + DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false, float needLifeTime = 8.0f) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner), needLifeTime(needLifeTime) { } std::string const GetTargetName() override { return "current target"; } bool IsActive() override; diff --git a/src/strategy/values/ExpectedLifetimeValue.cpp b/src/strategy/values/ExpectedLifetimeValue.cpp index 397f9bf7..0d4d6352 100644 --- a/src/strategy/values/ExpectedLifetimeValue.cpp +++ b/src/strategy/values/ExpectedLifetimeValue.cpp @@ -9,7 +9,7 @@ float ExpectedLifetimeValue::Calculate() return 0.0f; } float dps = AI_VALUE(float, "expected group dps"); - float res = target->GetHealth() / dps * 1000; + float res = target->GetHealth() / dps; // bot->Say(target->GetName() + " lifetime: " + std::to_string(res), LANG_UNIVERSAL); return res; } diff --git a/src/strategy/warlock/WarlockTriggers.h b/src/strategy/warlock/WarlockTriggers.h index 3050012c..cdefd8c0 100644 --- a/src/strategy/warlock/WarlockTriggers.h +++ b/src/strategy/warlock/WarlockTriggers.h @@ -29,7 +29,7 @@ class SpellstoneTrigger : public BuffTrigger class CurseOfAgonyTrigger : public DebuffTrigger { public: - CurseOfAgonyTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "curse of agony", 1, true, 20000.0f) { } + CurseOfAgonyTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "curse of agony", 1, true, 20.0f) { } }; DEBUFF_CHECKISOWNER_TRIGGER(CorruptionTrigger, "corruption"); @@ -44,7 +44,7 @@ class CorruptionOnAttackerTrigger : public DebuffOnAttackerTrigger class CastCurseOfAgonyOnAttackerTrigger : public DebuffOnAttackerTrigger { public: - CastCurseOfAgonyOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "curse of agony", true, 20000.0f) { } + CastCurseOfAgonyOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "curse of agony", true, 20.0f) { } }; class SiphonLifeOnAttackerTrigger : public DebuffOnAttackerTrigger