1
This commit is contained in:
parent
55a14af63e
commit
08994498ff
@ -9,6 +9,11 @@
|
|||||||
<property Prototype="Self.BaseAgent::ChaseToKill(0)" />
|
<property Prototype="Self.BaseAgent::ChaseToKill(0)" />
|
||||||
<property IsHTN="false" />
|
<property IsHTN="false" />
|
||||||
<node class="Sequence" id="1">
|
<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">
|
<node class="Action" id="2">
|
||||||
<property Method="Self.BaseAgent::SetCurrentTarget(int Self.AndroidAgent::_$local_task_param_$_0)" />
|
<property Method="Self.BaseAgent::SetCurrentTarget(int Self.AndroidAgent::_$local_task_param_$_0)" />
|
||||||
<property ResultOption="BT_SUCCESS" />
|
<property ResultOption="BT_SUCCESS" />
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<property ReferenceBehavior="const string "boss_40101_attack"" />
|
<property ReferenceBehavior="const string "boss_40101_attack"" />
|
||||||
</node>
|
</node>
|
||||||
<node class="Action" id="8">
|
<node class="Action" id="8">
|
||||||
<property Method="Self.BaseAgent::CoFindPathToCurrentTarget(60)" />
|
<property Method="Self.BaseAgent::CoFindPathToCurrentTarget(0)" />
|
||||||
<property ResultOption="BT_INVALID" />
|
<property ResultOption="BT_INVALID" />
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
|
@ -45,8 +45,13 @@ bool AndroidAgent::IsCrazeModePrepareMode()
|
|||||||
if (!IsCrazeMode()) {
|
if (!IsCrazeMode()) {
|
||||||
return false;
|
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) {
|
if (GetOwner()->room->GetFrameNo() - GetOwner()->AsHuman()->enable_frameno > SERVER_FRAME_RATE * 20) {
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
if (GetSafeAreaRadius() < 200) {
|
if (GetSafeAreaRadius() < 200) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -308,6 +308,9 @@ behaviac::EBTStatus BaseAgent::SelectUseableSkill(const behaviac::vector<int> sk
|
|||||||
if (!current_target_.Get()) {
|
if (!current_target_.Get()) {
|
||||||
return behaviac::BT_FAILURE;
|
return behaviac::BT_FAILURE;
|
||||||
}
|
}
|
||||||
|
if (GlmHelper::IsEqual2D(GetOwner()->GetPos().ToGlmVec3(),
|
||||||
|
current_target_.Get()->GetPos().ToGlmVec3())) {
|
||||||
|
}
|
||||||
for (int skill_id : skill_ids) {
|
for (int skill_id : skill_ids) {
|
||||||
Skill* skill = GetOwner()->GetSkill(skill_id);
|
Skill* skill = GetOwner()->GetSkill(skill_id);
|
||||||
if (skill && GetOwner()->CanUseSkill(skill->GetSkillId())) {
|
if (skill && GetOwner()->CanUseSkill(skill->GetSkillId())) {
|
||||||
@ -366,10 +369,15 @@ behaviac::EBTStatus BaseAgent::CoMoveToCurrentTarget(float distance)
|
|||||||
if (!current_target_.Get()) {
|
if (!current_target_.Get()) {
|
||||||
return behaviac::BT_FAILURE;
|
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(),
|
if (GlmHelper::IsEqual2D(GetOwner()->GetPos().ToGlmVec3(),
|
||||||
current_target_.Get()->GetPos().ToGlmVec3())) {
|
current_target_.Get()->GetPos().ToGlmVec3())) {
|
||||||
return behaviac::BT_SUCCESS;
|
return behaviac::BT_SUCCESS;
|
||||||
}
|
}*/
|
||||||
auto context = MAKE_BTCONTEXT
|
auto context = MAKE_BTCONTEXT
|
||||||
(
|
(
|
||||||
CreatureWeakPtr target;
|
CreatureWeakPtr target;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user