1
This commit is contained in:
parent
4f5b8d0d9b
commit
5214bc056e
@ -9,6 +9,7 @@
|
|||||||
#include "glmhelper.h"
|
#include "glmhelper.h"
|
||||||
#include "mapinstance.h"
|
#include "mapinstance.h"
|
||||||
#include "bornpoint.h"
|
#include "bornpoint.h"
|
||||||
|
#include "killmgr.h"
|
||||||
|
|
||||||
#include "mt/Param.h"
|
#include "mt/Param.h"
|
||||||
#include "mt/Map.h"
|
#include "mt/Map.h"
|
||||||
@ -209,8 +210,9 @@ void Incubator::AutoAllocAndroid()
|
|||||||
case GasMoving:
|
case GasMoving:
|
||||||
{
|
{
|
||||||
if (!hold_humans_.empty()){
|
if (!hold_humans_.empty()){
|
||||||
|
KillMgr::Instance()->SetAutoDie();
|
||||||
Human* hum = hold_humans_[0];
|
Human* hum = hold_humans_[0];
|
||||||
if (room->GetGasData().GetGasMode() == GasWaiting &&
|
if (room->GetGasData().GetGasMode() == GasMoving &&
|
||||||
hold_humans_.size() > 1 &&
|
hold_humans_.size() > 1 &&
|
||||||
((rand() % 100) > 40)) {
|
((rand() % 100) > 40)) {
|
||||||
Human* killer = nullptr;
|
Human* killer = nullptr;
|
||||||
@ -231,8 +233,10 @@ void Incubator::AutoAllocAndroid()
|
|||||||
VP_Gas,
|
VP_Gas,
|
||||||
TEXT("battle_server_killer_gas", "毒圈"));
|
TEXT("battle_server_killer_gas", "毒圈"));
|
||||||
} else {
|
} else {
|
||||||
|
KillMgr::Instance()->UnSetAutoDie();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
KillMgr::Instance()->UnSetAutoDie();
|
||||||
hold_humans_.erase(hold_humans_.begin());
|
hold_humans_.erase(hold_humans_.begin());
|
||||||
room->xtimer.ModifyTime(alloc_timer_, SERVER_FRAME_RATE * (3 + rand() % 5));
|
room->xtimer.ModifyTime(alloc_timer_, SERVER_FRAME_RATE * (3 + rand() % 5));
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,8 @@ class KillMgr : public a8::Singleton<KillMgr>
|
|||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
void OnHumanDead(Human* dead_hum, KillInfo* info);
|
void OnHumanDead(Human* dead_hum, KillInfo* info);
|
||||||
|
void SetAutoDie() { is_auto_die_ = true; };
|
||||||
|
void UnSetAutoDie() { is_auto_die_ = false; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void FillHintInfo(Human* dead_hum, KillInfo* info, RollMsgHintInfo& hint_info);
|
void FillHintInfo(Human* dead_hum, KillInfo* info, RollMsgHintInfo& hint_info);
|
||||||
@ -56,5 +58,8 @@ private:
|
|||||||
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
std::shared_ptr<cs::SMRollMsg> pb_msg);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool is_auto_die_ = false;
|
||||||
|
|
||||||
friend class PBUtils;
|
friend class PBUtils;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user