This commit is contained in:
aozhiwei 2024-02-19 10:36:36 +08:00
parent 5929d739cc
commit 23dea8487d
3 changed files with 153 additions and 84 deletions

View File

@ -50,6 +50,11 @@
</node>
<node class="True" id="107" />
</node>
<node class="Condition" id="118">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::CanAttack()" />
<property Opr="const bool true" />
</node>
<node class="Selector" id="100">
<node class="IfElse" id="9">
<node class="Condition" id="10">

View File

@ -37,40 +37,73 @@
<node class="DecoratorWeight" id="24">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="IfElse" id="6">
<node class="Condition" id="7">
<node class="IfElse" id="26">
<node class="Condition" id="27">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
<property Opl="Self.HeroAgent::CanAttack()" />
<property Opr="const bool false" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="17">
<node class="SelectorProbability" id="9">
<node class="DecoratorWeight" id="10">
<node class="IfElse" id="34">
<node class="Condition" id="35">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsMoving()" />
<property Opr="const bool false" />
</node>
<node class="SelectorProbability" id="28">
<node class="DecoratorWeight" id="29">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="11">
<node class="ReferencedBehavior" id="30">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<node class="DecoratorWeight" id="31">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 0" />
<node class="ReferencedBehavior" id="13">
<property ReferenceBehavior="const string &quot;task/RandomShot&quot;" />
<property Task="Self.HeroAgent::RandomShot(0,0,{x=0;y=0;z=0;})" />
<property Weight="const int 50" />
<node class="Action" id="32">
<property Method="Self.HeroAgent::CoIdle(1000,1500)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="DecoratorWeight" id="14">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 60" />
<node class="Action" id="15">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="True" id="36" />
</node>
<node class="IfElse" id="6">
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="17">
<node class="SelectorProbability" id="9">
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="11">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 0" />
<node class="ReferencedBehavior" id="13">
<property ReferenceBehavior="const string &quot;task/RandomShot&quot;" />
<property Task="Self.HeroAgent::RandomShot(0,0,{x=0;y=0;z=0;})" />
</node>
</node>
<node class="DecoratorWeight" id="14">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 60" />
<node class="Action" id="15">
<property Method="Self.HeroAgent::CoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
</node>

View File

@ -27,62 +27,93 @@
<property Method="Self.HeroAgent::RegisterEvents(1:kMobaModeReviveEvent)" />
<property ResultOption="BT_INVALID" />
</node>
<node class="IfElse" id="6">
<node class="Condition" id="7">
<node class="IfElse" id="33">
<node class="Condition" id="34">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
<property Opl="Self.HeroAgent::CanAttack()" />
<property Opr="const bool false" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="4">
<node class="Action" id="5">
<property Method="Self.HeroAgent::CoGetNextMobaModeRoadPoint()" />
<property ResultOption="BT_INVALID" />
<node class="IfElse" id="15">
<node class="Condition" id="35">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::IsMoving()" />
<property Opr="const bool true" />
</node>
<node class="Sequence" id="21">
<node class="Assignment" id="22">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_1" />
<property Opr="Self.BaseAgent::GetTickCount()" />
</node>
<node class="Parallel" id="9">
<property ChildFinishPolicy="CHILDFINISH_ONCE" />
<property ExitPolicy="EXIT_NONE" />
<property FailurePolicy="FAIL_ON_ONE" />
<property SuccessPolicy="SUCCEED_ON_ONE" />
<node class="Action" id="10">
<property Method="Self.HeroAgent::CoFindPath(glm::vec3 Self.HeroAgent::out_point0)" />
<property ResultOption="BT_INVALID" />
<attachment class="Precondition" id="11" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Enter" />
</attachment>
<attachment class="Effector" id="12" flag="effector">
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 1" />
<property Phase="Both" />
</attachment>
<node class="True" id="36" />
<node class="SelectorProbability" id="37">
<node class="DecoratorWeight" id="38">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="ReferencedBehavior" id="39">
<property ReferenceBehavior="const string &quot;task/RandomWalk&quot;" />
<property Task="Self.HeroAgent::RandomWalk(0,0,{x=0;y=0;z=0;})" />
</node>
<node class="DecoratorLoop" id="13">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<attachment class="Precondition" id="14" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Equal" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Both" />
</attachment>
<node class="Sequence" id="16">
<node class="IfElse" id="15">
</node>
<node class="DecoratorWeight" id="40">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<node class="Action" id="41">
<property Method="Self.HeroAgent::CoIdle(500,1500)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</node>
</node>
<node class="IfElse" id="6">
<node class="Condition" id="7">
<property Operator="Equal" />
<property Opl="Self.HeroAgent::SearchEnemy(500)" />
<property Opr="const behaviac::EBTStatus BT_SUCCESS" />
</node>
<node class="ReferencedBehavior" id="8">
<property ReferenceBehavior="const string &quot;task/ChaseToKill&quot;" />
<property Task="Self.HeroAgent::ChaseToKill(0,0,0)" />
</node>
<node class="Sequence" id="4">
<node class="Action" id="5">
<property Method="Self.HeroAgent::CoGetNextMobaModeRoadPoint()" />
<property ResultOption="BT_INVALID" />
</node>
<node class="Sequence" id="21">
<node class="Assignment" id="22">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_1" />
<property Opr="Self.BaseAgent::GetTickCount()" />
</node>
<node class="Parallel" id="9">
<property ChildFinishPolicy="CHILDFINISH_LOOP" />
<property ExitPolicy="EXIT_NONE" />
<property FailurePolicy="FAIL_ON_ONE" />
<property SuccessPolicy="SUCCEED_ON_ONE" />
<node class="Action" id="10">
<property Method="Self.HeroAgent::CoFindPath(glm::vec3 Self.HeroAgent::out_point0)" />
<property ResultOption="BT_INVALID" />
<attachment class="Precondition" id="11" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Enter" />
</attachment>
<attachment class="Effector" id="12" flag="effector">
<property Operator="Assign" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 1" />
<property Phase="Both" />
</attachment>
</node>
<node class="DecoratorLoop" id="13">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<attachment class="Precondition" id="14" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Equal" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr2="const int 0" />
<property Phase="Both" />
</attachment>
<node class="Sequence" id="16">
<node class="Condition" id="17">
<property Operator="Greater" />
<property Opl="Self.BaseAgent::DeltaTime(int Self.HeroAgent::_$local_task_param_$_1)" />
@ -105,15 +136,15 @@
</node>
</node>
<node class="False" id="23" />
</node>
<node class="Assignment" id="19">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="const int 1" />
</node>
<node class="Action" id="20">
<property Method="Self.BaseAgent::AbortCoroutine(kCoFindPath)" />
<property ResultOption="BT_SUCCESS" />
<node class="Assignment" id="19">
<property CastRight="false" />
<property Opl="int Self.HeroAgent::_$local_task_param_$_0" />
<property Opr="const int 1" />
</node>
<node class="Action" id="20">
<property Method="Self.BaseAgent::AbortCoroutine(kCoFindPath)" />
<property ResultOption="BT_SUCCESS" />
</node>
</node>
</node>
</node>