This commit is contained in:
aozhiwei 2023-06-29 17:38:59 +08:00
parent 67d5e43e7c
commit a305d70851
4 changed files with 17 additions and 17 deletions

View File

@ -46,12 +46,10 @@ glm::vec3& AndroidAgent::AdjustShotDir(glm::vec3& shot_dir)
bool AndroidAgent::IsCrazeMode()
{
return false;
return a8::HasBitFlag(GetOwner()->status, CS_CrazeMode);
}
bool AndroidAgent::IsCrazeModePrepareMode()
{
return false;
return a8::HasBitFlag(GetOwner()->status, CS_CrazeMode);
}

View File

@ -495,6 +495,13 @@ behaviac::EBTStatus BaseAgent::CoRunGas()
if (GetOwner()->dead) {
return behaviac::BT_FAILURE;
}
if (context->find_ok) {
if (GetOwner()->GetMovement()->GetPathSize() <= 0) {
return behaviac::BT_SUCCESS;
} else {
return behaviac::BT_RUNNING;
}
}
if (GetSafeAreaRadius() < 200) {
return behaviac::BT_SUCCESS;
}
@ -521,8 +528,11 @@ behaviac::EBTStatus BaseAgent::CoRunGas()
bool ok = GetOwner()->room->map_instance->FindConnectableNearestPoint(center, 50, point);
if (ok) {
GetOwner()->room->map_instance->Scale(point);
context->find_ok = true;
context->target_pos = point;
bool ret = GetOwner()->GetMovement()->FindPath(point, 0);
if (ret) {
context->find_ok = true;
context->target_pos = point;
}
}
return behaviac::BT_RUNNING;
};

View File

@ -2369,19 +2369,7 @@ void Creature::UpdateMove()
}
}
room->grid_service->MoveCreature(this);
if (a8::HasBitFlag(status, CS_CrazeMode) && IsNearGas(100)) {
GetMutablePos() = old_pos;
GetMovement()->ClearPath();
glm::vec2 dir2 = room->GetGasData().pos_new - room->GetGasData().pos_old;
glm::vec3 dir = glm::vec3(dir2.x, 0.0f, dir2.y);
if (std::abs(dir.x) > FLT_EPSILON ||
std::abs(dir.y) > FLT_EPSILON ||
std::abs(dir.z) > FLT_EPSILON
) {
GlmHelper::Normalize(dir);
SetMoveDir(dir);
}
} else if (room->IsPveRoom() && IsEntityType(ET_Hero) && IsNearGas(20)) {
if (room->IsPveRoom() && IsEntityType(ET_Hero) && IsNearGas(20)) {
GetMutablePos() = old_pos;
GetMovement()->ClearPath();
glm::vec3 dir = GetPos().ToGlmVec3() - old_pos.ToGlmVec3();

View File

@ -516,8 +516,11 @@ void Incubator::ShowHand()
room->EnableHuman(hum);
hum->MustBeAddBuff(hum, kTraceBuffId);
a8::SetBitFlag(hum->status, CS_CrazeMode);
#if 0
a8::SetBitFlag(hum->status, CS_DisableAttackAndroid);
#endif
}
#if 0
room->xtimer.SetIntervalEx
(
SERVER_FRAME_RATE,
@ -537,6 +540,7 @@ void Incubator::ShowHand()
}
},
&room->xtimer_attacher_);
#endif
hold_humans_.clear();
}