This commit is contained in:
aozhiwei 2023-08-16 15:31:05 +08:00
parent 55a14af63e
commit 08994498ff
4 changed files with 20 additions and 2 deletions

View File

@ -9,6 +9,11 @@
<property Prototype="Self.BaseAgent::ChaseToKill(0)" />
<property IsHTN="false" />
<node class="Sequence" id="1">
<node class="Assignment" id="9">
<property CastRight="false" />
<property Opl="int Self.AndroidAgent::_$local_task_param_$_0" />
<property Opr="int Self.BaseAgent::find_enemy_target_uniid" />
</node>
<node class="Action" id="2">
<property Method="Self.BaseAgent::SetCurrentTarget(int Self.AndroidAgent::_$local_task_param_$_0)" />
<property ResultOption="BT_SUCCESS" />

View File

@ -46,7 +46,7 @@
<property ReferenceBehavior="const string &quot;boss_40101_attack&quot;" />
</node>
<node class="Action" id="8">
<property Method="Self.BaseAgent::CoFindPathToCurrentTarget(60)" />
<property Method="Self.BaseAgent::CoFindPathToCurrentTarget(0)" />
<property ResultOption="BT_INVALID" />
</node>
</node>

View File

@ -45,8 +45,13 @@ bool AndroidAgent::IsCrazeModePrepareMode()
if (!IsCrazeMode()) {
return false;
}
#ifdef DEBUG
if (GetOwner()->room->GetFrameNo() - GetOwner()->AsHuman()->enable_frameno > SERVER_FRAME_RATE * 5) {
return false;
#else
if (GetOwner()->room->GetFrameNo() - GetOwner()->AsHuman()->enable_frameno > SERVER_FRAME_RATE * 20) {
return false;
#endif
} else {
if (GetSafeAreaRadius() < 200) {
return false;

View File

@ -308,6 +308,9 @@ behaviac::EBTStatus BaseAgent::SelectUseableSkill(const behaviac::vector<int> sk
if (!current_target_.Get()) {
return behaviac::BT_FAILURE;
}
if (GlmHelper::IsEqual2D(GetOwner()->GetPos().ToGlmVec3(),
current_target_.Get()->GetPos().ToGlmVec3())) {
}
for (int skill_id : skill_ids) {
Skill* skill = GetOwner()->GetSkill(skill_id);
if (skill && GetOwner()->CanUseSkill(skill->GetSkillId())) {
@ -366,10 +369,15 @@ behaviac::EBTStatus BaseAgent::CoMoveToCurrentTarget(float distance)
if (!current_target_.Get()) {
return behaviac::BT_FAILURE;
}
float target_distance = GetOwner()->GetPos().Distance2D2(current_target_.Get()->GetPos());
if (target_distance > 2) {
return behaviac::BT_SUCCESS;
}
/*
if (GlmHelper::IsEqual2D(GetOwner()->GetPos().ToGlmVec3(),
current_target_.Get()->GetPos().ToGlmVec3())) {
return behaviac::BT_SUCCESS;
}
}*/
auto context = MAKE_BTCONTEXT
(
CreatureWeakPtr target;