time unit for expected lifetime

This commit is contained in:
Yunfan Li
2023-09-05 00:56:12 +08:00
parent 1deac0bbc0
commit b4a5736c02
4 changed files with 5 additions and 5 deletions

View File

@@ -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()

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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