1
This commit is contained in:
parent
896be1d621
commit
0f19b56010
@ -2053,7 +2053,7 @@ void Human::UpdateViewObjects()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (view_objects_.size() < 2) {
|
if (view_objects_.size() < 2) {
|
||||||
room->GetIncubator()->AllocAndroid(this, 1 + rand() % 2);
|
room->GetIncubator()->AllocAndroid(this, 1 + rand() % 2, nullptr);
|
||||||
if (!refresh_view_timer_.expired()) {
|
if (!refresh_view_timer_.expired()) {
|
||||||
room->xtimer.ModifyTime
|
room->xtimer.ModifyTime
|
||||||
(refresh_view_timer_,
|
(refresh_view_timer_,
|
||||||
|
@ -64,7 +64,7 @@ void Incubator::UnInit()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Incubator::AllocAndroid(Human* target, int num)
|
void Incubator::AllocAndroid(Human* target, int num, std::vector<Human*>* androids)
|
||||||
{
|
{
|
||||||
if (!room->xtimer.IsRunning()) {
|
if (!room->xtimer.IsRunning()) {
|
||||||
A8_ABORT();
|
A8_ABORT();
|
||||||
@ -236,8 +236,9 @@ void Incubator::AutoAllocAndroid()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Incubator::ActiveAndroid(Human* hum, Human* android)
|
Human* Incubator::ActiveAndroid(Human* hum)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
glm::vec3 center = glm::vec3(room->GetGasData().pos_new.x,
|
glm::vec3 center = glm::vec3(room->GetGasData().pos_new.x,
|
||||||
0.0f,
|
0.0f,
|
||||||
room->GetGasData().pos_new.y);
|
room->GetGasData().pos_new.y);
|
||||||
@ -272,6 +273,7 @@ void Incubator::ActiveAndroid(Human* hum, Human* android)
|
|||||||
android->GetPos().GetY()
|
android->GetPos().GetY()
|
||||||
}));
|
}));
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Incubator::OnEnterNewWave(int wave)
|
void Incubator::OnEnterNewWave(int wave)
|
||||||
|
@ -12,9 +12,9 @@ class Incubator
|
|||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
void InitPve();
|
void InitPve();
|
||||||
void AllocAndroid(Human* target, int num);
|
void AllocAndroid(Human* target, int num, std::vector<Human*>* androids);
|
||||||
void RecycleAndroid(Human* hum);
|
void RecycleAndroid(Human* hum);
|
||||||
void ActiveAndroid(Human* hum, Human* android);
|
Human* ActiveAndroid(Human* hum);
|
||||||
bool IsTimeOut() { return timeout_; };
|
bool IsTimeOut() { return timeout_; };
|
||||||
int GetPveLeftTime();
|
int GetPveLeftTime();
|
||||||
void NextWave();
|
void NextWave();
|
||||||
|
@ -845,7 +845,7 @@ Human* Room::GetWatchWarTarget(Human* hum)
|
|||||||
std::vector<Human*> players;
|
std::vector<Human*> players;
|
||||||
std::vector<Human*> humans;
|
std::vector<Human*> humans;
|
||||||
for (auto& pair : human_hash_) {
|
for (auto& pair : human_hash_) {
|
||||||
if (pair.first != hum->GetUniId() && !pair.second->dead) {
|
if (pair.first != hum->GetUniId() && !pair.second->dead && !a8::HasBitFlag(pair.second->status, CS_Disable)) {
|
||||||
if (pair.second->IsPlayer()) {
|
if (pair.second->IsPlayer()) {
|
||||||
players.push_back(pair.second);
|
players.push_back(pair.second);
|
||||||
} else {
|
} else {
|
||||||
@ -870,8 +870,8 @@ Human* Room::GetWatchWarTarget(Human* hum)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (target && target->IsAndroid() && a8::HasBitFlag(target->status, CS_Disable)) {
|
if (!target) {
|
||||||
incubator_->ActiveAndroid(hum, target);
|
target = incubator_->ActiveAndroid(hum);
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user