From d48670b545d9a955d2ef2aca09d3ddc454c1f54e Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sat, 28 Oct 2023 22:21:51 +0800 Subject: [PATCH] move random for rpg --- src/strategy/actions/MovementActions.cpp | 2 +- src/strategy/generic/RpgStrategy.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 12639509..d0618cff 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -1491,7 +1491,7 @@ bool MoveRandomAction::Execute(Event event) bool MoveRandomAction::isUseful() { - return !botAI->HasRealPlayerMaster(); + return !AI_VALUE(GuidPosition, "rpg target") && !botAI->HasRealPlayerMaster(); } bool MoveInsideAction::Execute(Event event) diff --git a/src/strategy/generic/RpgStrategy.cpp b/src/strategy/generic/RpgStrategy.cpp index 986c11d4..058e32c8 100644 --- a/src/strategy/generic/RpgStrategy.cpp +++ b/src/strategy/generic/RpgStrategy.cpp @@ -32,7 +32,7 @@ NextAction** RpgStrategy::getDefaultActions() void RpgStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("choose rpg target", 5.0f), nullptr))); - triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("move random", 1.10f), NULL))); + triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("move random", 1.10f), NULL))); triggers.push_back(new TriggerNode("far from rpg target", NextAction::array(0, new NextAction("move to rpg target", 5.0f), nullptr))); //Sub actions