razuvious strategy

This commit is contained in:
Yunfan Li
2023-07-18 21:00:49 +08:00
parent 67a23fae3f
commit 9c1bb63d10
21 changed files with 326 additions and 265 deletions

View File

@@ -22,4 +22,16 @@ class ThreatValue : public Uint8CalculatedValue, public Qualified
uint8 Calculate(Unit* target);
};
class NeglectThreatResetValue : public ManualSetValue<bool>
{
public:
NeglectThreatResetValue(PlayerbotAI* ai, bool defaultValue = false, std::string name = "neglect threat") :
ManualSetValue<bool>(ai, defaultValue, name) {}
virtual bool Get() {
bool ret = value;
Reset();
return ret;
}
};
#endif

View File

@@ -291,6 +291,7 @@ class ValueContext : public NamedObjectContext<UntypedValue>
creators["find target"] = &ValueContext::find_target;
creators["boss target"] = &ValueContext::boss_target;
creators["nearest triggers"] = &ValueContext::nearest_triggers;
creators["neglect threat"] = &ValueContext::neglect_threat;
}
private:
@@ -486,6 +487,7 @@ class ValueContext : public NamedObjectContext<UntypedValue>
static UntypedValue* find_target(PlayerbotAI* ai) { return new FindTargetValue(ai); }
static UntypedValue* boss_target(PlayerbotAI* ai) { return new BossTargetValue(ai); }
static UntypedValue* nearest_triggers(PlayerbotAI* ai) { return new NearestTriggersValue(ai); }
static UntypedValue* neglect_threat(PlayerbotAI* ai) { return new NeglectThreatResetValue(ai); }
};
#endif