1
This commit is contained in:
parent
edf4d25c83
commit
b3ef379109
@ -92,10 +92,18 @@ void Incubator::AllocAndroid(Human* target, int num, std::vector<Human*>* androi
|
|||||||
if (room->GetFrameNo() < wait_alloc_time_ * SERVER_FRAME_RATE) {
|
if (room->GetFrameNo() < wait_alloc_time_ * SERVER_FRAME_RATE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hold_humans_.size() <= 6 && room->GetGasData().new_area_meta->GetSmallRingCount() < 3) {
|
if (hold_humans_.size() < 1) {
|
||||||
ShowHand();
|
|
||||||
return;
|
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
|
#if 1
|
||||||
num = 1;
|
num = 1;
|
||||||
#endif
|
#endif
|
||||||
@ -484,12 +492,16 @@ void Incubator::NextWave()
|
|||||||
void Incubator::ShowHand()
|
void Incubator::ShowHand()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
glm::vec3 center;
|
||||||
a8::XPrintf("ShowHand hold_humans_.size:%d\n", {hold_humans_.size()});
|
a8::XPrintf("ShowHand hold_humans_.size:%d\n", {hold_humans_.size()});
|
||||||
#endif
|
#endif
|
||||||
for (auto& hum : hold_humans_) {
|
for (auto& hum : hold_humans_) {
|
||||||
glm::vec3 point = glm::vec3(room->GetGasData().new_area_meta->GetLastArea()->x1(),
|
glm::vec3 point = glm::vec3(room->GetGasData().new_area_meta->GetLastArea()->x1(),
|
||||||
6.0f,
|
6.0f,
|
||||||
room->GetGasData().new_area_meta->GetLastArea()->y1());
|
room->GetGasData().new_area_meta->GetLastArea()->y1());
|
||||||
|
#ifdef DEBUG
|
||||||
|
center = point;
|
||||||
|
#endif
|
||||||
Global::Instance()->verify_set_pos = 1;
|
Global::Instance()->verify_set_pos = 1;
|
||||||
hum->GetMutablePos().FromGlmVec3(point);
|
hum->GetMutablePos().FromGlmVec3(point);
|
||||||
Global::Instance()->verify_set_pos = 0;
|
Global::Instance()->verify_set_pos = 0;
|
||||||
@ -511,4 +523,13 @@ void Incubator::ShowHand()
|
|||||||
hum->MustBeAddBuff(hum, kTraceBuffId);
|
hum->MustBeAddBuff(hum, kTraceBuffId);
|
||||||
}
|
}
|
||||||
hold_humans_.clear();
|
hold_humans_.clear();
|
||||||
|
#ifdef DEBUG
|
||||||
|
room->TraversePlayerList
|
||||||
|
(
|
||||||
|
[this, center] (Player* hum)
|
||||||
|
{
|
||||||
|
hum->GetMutablePos().FromGlmVec3(center);
|
||||||
|
room->grid_service->MoveCreature(hum);
|
||||||
|
});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -455,8 +455,8 @@ Human* Room::FindEnemy(Human* hum, float range)
|
|||||||
if (!hum->dead &&
|
if (!hum->dead &&
|
||||||
!a8::HasBitFlag(hum->status, CS_Disable) &&
|
!a8::HasBitFlag(hum->status, CS_Disable) &&
|
||||||
hum->team_id != myself->team_id) {
|
hum->team_id != myself->team_id) {
|
||||||
if (a8::HasBitFlag(hum->status, CS_DisableAttackAndroid) &&
|
if (a8::HasBitFlag(myself->status, CS_DisableAttackAndroid) &&
|
||||||
target->IsAndroid()) {
|
hum->IsAndroid()) {
|
||||||
} else {
|
} else {
|
||||||
float distance = hum->GetPos().Distance2D2(myself->GetPos());
|
float distance = hum->GetPos().Distance2D2(myself->GetPos());
|
||||||
if (distance <= range) {
|
if (distance <= range) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user