This commit is contained in:
aozhiwei 2023-08-16 18:57:55 +08:00
parent 06ff506672
commit 35d3ae5343
3 changed files with 26 additions and 9 deletions

View File

@ -45,13 +45,8 @@ 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

@ -370,7 +370,7 @@ behaviac::EBTStatus BaseAgent::CoMoveToCurrentTarget(float distance)
return behaviac::BT_FAILURE;
}
float target_distance = GetOwner()->GetPos().Distance2D2(current_target_.Get()->GetPos());
if (target_distance > 2) {
if (target_distance > 1 && target_distance < 2) {
return behaviac::BT_SUCCESS;
}
/*
@ -384,7 +384,7 @@ behaviac::EBTStatus BaseAgent::CoMoveToCurrentTarget(float distance)
);
context->target = current_target_;
if (target_distance < 2) {
if (target_distance < 1) {
GetOwner()->GetMovement()->CalcTargetPos(60);
} else {
glm::vec3 dir = GetOwner()->GetPos().CalcDir(context->target.Get()->GetPos());
@ -512,6 +512,9 @@ behaviac::EBTStatus BaseAgent::CoShot()
}
glm::vec3 dir = GetOwner()->GetPos().CalcDir(current_target_.Get()->GetPos());
if (GlmHelper::Norm(dir) > GetAttackRange()) {
#ifdef DEBUG
a8::XPrintf("CoShot Failed %f\n", {GlmHelper::Norm(dir)});
#endif
return behaviac::BT_FAILURE;
}
bool shot_ok = false;

View File

@ -824,8 +824,27 @@ void Creature::TriggerOneObjectBuff(Skill* skill, Creature* target, BuffTriggerT
Skill* Creature::GetSkill(int skill_id)
{
if (skill_id < 10) {
switch (skill_id) {
case 0:
{
return GetMainSkill();
}
break;
case 1:
{
return GetMainSkill();
}
break;
default:
{
return nullptr;
}
}
} else {
auto itr = skill_hash_.find(skill_id);
return itr != skill_hash_.end() ? itr->second.get() : nullptr;
}
}
bool Creature::CanUseSkill(int skill_id)