This commit is contained in:
aozhiwei 2023-10-24 14:51:45 +08:00
parent 1a8a0abdb7
commit a53766bf49
2 changed files with 13 additions and 13 deletions

View File

@ -188,17 +188,17 @@
<property Opr2="const bool true" /> <property Opr2="const bool true" />
<property Phase="Both" /> <property Phase="Both" />
</attachment> </attachment>
<attachment class="Precondition" id="53" flag="precondition"> <node class="Selector" id="42">
<property BinaryOperator="And" /> <node class="Condition" id="53">
<property Operator="Greater" /> <property Operator="Greater" />
<property Opl="Self.HeroAgent::GetLastAttackPassTime()" /> <property Opl="Self.HeroAgent::GetLastAttackPassTime()" />
<property Opr2="Self.BaseAgent::RandRange(8000,12000)" /> <property Opr="Self.BaseAgent::RandRange(5000,8000)" />
<property Phase="Both" /> </node>
</attachment> <node class="Condition" id="54">
<node class="Condition" id="42"> <property Operator="Equal" />
<property Operator="Equal" /> <property Opl="Self.HeroAgent::TargetInRange(550)" />
<property Opl="Self.HeroAgent::TargetInRange(550)" /> <property Opr="const bool false" />
<property Opr="const bool true" /> </node>
</node> </node>
<node class="Action" id="43"> <node class="Action" id="43">
<property Method="current_target_agent.TargetAgent::Abandon(2,3)" /> <property Method="current_target_agent.TargetAgent::Abandon(2,3)" />

View File

@ -938,7 +938,7 @@ behaviac::EBTStatus HeroAgent::CoGetRunAwayPoint()
auto context = MAKE_BTCONTEXT auto context = MAKE_BTCONTEXT
( (
int try_count = 0; int try_count = 0;
int step_len = 50; int step_len = 200;
); );
auto co = std::make_shared<BtCoroutine>(context, co_id, "CoGetRunAwayPoint"); auto co = std::make_shared<BtCoroutine>(context, co_id, "CoGetRunAwayPoint");
co->runing_cb = co->runing_cb =
@ -966,7 +966,7 @@ behaviac::EBTStatus HeroAgent::CoGetRunAwayPoint()
GlmHelper::Normalize(dir); GlmHelper::Normalize(dir);
glm::vec3 center = owner_->GetPos().ToGlmVec3() + glm::vec3 center = owner_->GetPos().ToGlmVec3() +
dir * (50.0f + (float)(context->try_count + 1) * context->step_len); dir * (50.0f + (float)context->step_len);
owner_->room->map_instance->Scale(center); owner_->room->map_instance->Scale(center);
glm::vec3 point; glm::vec3 point;
bool ok = owner_->room->map_instance->FindConnectableNearestPoint(center, 50, point); bool ok = owner_->room->map_instance->FindConnectableNearestPoint(center, 50, point);