This commit is contained in:
aozhiwei 2023-06-14 19:56:08 +08:00
parent 4d7268ef43
commit c572332f5f
2 changed files with 36 additions and 2 deletions

View File

@ -17,6 +17,7 @@
#include "mt/PveGeminiMode.h"
#include "mt/PveGeminiContent.h"
#include "mt/Text.h"
#include "mt/SafeArea.h"
void Incubator::Init()
{
@ -151,7 +152,7 @@ void Incubator::AllocAndroid(Human* target, int num, std::vector<Human*>* androi
room->BroadcastDebugMsg(a8::Format("投放机器人 分配失败 %d", {hold_humans_.size()}));
}
#endif
if (hold_humans_.size() <= 6) {
if (hold_humans_.size() <= 6 && room->GetGasData().new_area_meta->GetSmallRingCount() < 3) {
ShowHand();
}
}
@ -477,5 +478,29 @@ void Incubator::NextWave()
void Incubator::ShowHand()
{
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());
Global::Instance()->verify_set_pos = 1;
hum->GetMutablePos().FromGlmVec3(point);
Global::Instance()->verify_set_pos = 0;
a8::SetBitFlag(hum->status, CS_CrazeMode);
a8::SetBitFlag(hum->status, CS_DisableAttackAndroid);
room->xtimer.SetTimeoutEx
(
SERVER_FRAME_RATE * 20,
[hum] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
a8::UnSetBitFlag(hum->status, CS_DisableAttackAndroid);
}
},
&hum->xtimer_attacher);
room->EnableHuman(hum);
hum->MustBeAddBuff(hum, kTraceBuffId);
}
hold_humans_.clear();
}

View File

@ -22,6 +22,7 @@ namespace mt
if (itr->second.at(itr->second.size() - 1)->id() + 1 != id()) {
abort();
}
itr->second.push_back(this);
}
}
if (!boss().empty()) {
@ -45,7 +46,15 @@ namespace mt
void SafeArea::StaticPostInit()
{
for (auto& pair : type_hash_) {
if (pair.second.size() < 1) {
abort();
}
int ring_count = pair.second.size() - 1;
auto last_area = pair.second.at(pair.second.size() - 1);
for (auto& meta : pair.second) {
meta->small_ring_count_ = ring_count--;
meta->last_area_ = last_area;
}
}
}