This commit is contained in:
aozhiwei 2023-05-06 10:38:48 +08:00
parent 4f5b8d0d9b
commit 5214bc056e
2 changed files with 10 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include "glmhelper.h"
#include "mapinstance.h"
#include "bornpoint.h"
#include "killmgr.h"
#include "mt/Param.h"
#include "mt/Map.h"
@ -209,8 +210,9 @@ void Incubator::AutoAllocAndroid()
case GasMoving:
{
if (!hold_humans_.empty()){
KillMgr::Instance()->SetAutoDie();
Human* hum = hold_humans_[0];
if (room->GetGasData().GetGasMode() == GasWaiting &&
if (room->GetGasData().GetGasMode() == GasMoving &&
hold_humans_.size() > 1 &&
((rand() % 100) > 40)) {
Human* killer = nullptr;
@ -231,8 +233,10 @@ void Incubator::AutoAllocAndroid()
VP_Gas,
TEXT("battle_server_killer_gas", "毒圈"));
} else {
KillMgr::Instance()->UnSetAutoDie();
return;
}
KillMgr::Instance()->UnSetAutoDie();
hold_humans_.erase(hold_humans_.begin());
room->xtimer.ModifyTime(alloc_timer_, SERVER_FRAME_RATE * (3 + rand() % 5));
}

View File

@ -41,6 +41,8 @@ class KillMgr : public a8::Singleton<KillMgr>
void Init();
void UnInit();
void OnHumanDead(Human* dead_hum, KillInfo* info);
void SetAutoDie() { is_auto_die_ = true; };
void UnSetAutoDie() { is_auto_die_ = false; };
private:
void FillHintInfo(Human* dead_hum, KillInfo* info, RollMsgHintInfo& hint_info);
@ -56,5 +58,8 @@ private:
std::shared_ptr<cs::SMRollMsg> pb_msg);
private:
bool is_auto_die_ = false;
friend class PBUtils;
};