This commit is contained in:
aozhiwei 2023-06-15 16:36:34 +08:00
parent edf4d25c83
commit b3ef379109
2 changed files with 25 additions and 4 deletions

View File

@ -92,10 +92,18 @@ void Incubator::AllocAndroid(Human* target, int num, std::vector<Human*>* androi
if (room->GetFrameNo() < wait_alloc_time_ * SERVER_FRAME_RATE) {
return;
}
if (hold_humans_.size() <= 6 && room->GetGasData().new_area_meta->GetSmallRingCount() < 3) {
ShowHand();
if (hold_humans_.size() < 1) {
return;
}
if (hold_humans_.size() <= 6) {
if (room->GetGasData().new_area_meta->GetSmallRingCount() < 4) {
ShowHand();
}
return;
}
#ifdef DEBUG
a8::XPrintf("SmallRingCount:%d \n", {room->GetGasData().new_area_meta->GetSmallRingCount()});
#endif
#if 1
num = 1;
#endif
@ -484,12 +492,16 @@ void Incubator::NextWave()
void Incubator::ShowHand()
{
#ifdef DEBUG
glm::vec3 center;
a8::XPrintf("ShowHand hold_humans_.size:%d\n", {hold_humans_.size()});
#endif
for (auto& hum : hold_humans_) {
glm::vec3 point = glm::vec3(room->GetGasData().new_area_meta->GetLastArea()->x1(),
6.0f,
room->GetGasData().new_area_meta->GetLastArea()->y1());
#ifdef DEBUG
center = point;
#endif
Global::Instance()->verify_set_pos = 1;
hum->GetMutablePos().FromGlmVec3(point);
Global::Instance()->verify_set_pos = 0;
@ -511,4 +523,13 @@ void Incubator::ShowHand()
hum->MustBeAddBuff(hum, kTraceBuffId);
}
hold_humans_.clear();
#ifdef DEBUG
room->TraversePlayerList
(
[this, center] (Player* hum)
{
hum->GetMutablePos().FromGlmVec3(center);
room->grid_service->MoveCreature(hum);
});
#endif
}

View File

@ -455,8 +455,8 @@ Human* Room::FindEnemy(Human* hum, float range)
if (!hum->dead &&
!a8::HasBitFlag(hum->status, CS_Disable) &&
hum->team_id != myself->team_id) {
if (a8::HasBitFlag(hum->status, CS_DisableAttackAndroid) &&
target->IsAndroid()) {
if (a8::HasBitFlag(myself->status, CS_DisableAttackAndroid) &&
hum->IsAndroid()) {
} else {
float distance = hum->GetPos().Distance2D2(myself->GetPos());
if (distance <= range) {