1
This commit is contained in:
parent
9a4cd817b8
commit
098b413ec5
@ -309,3 +309,5 @@ const int ADPLAY_BUFFID = 1006;
|
|||||||
const int FIXED_OBJECT_MAXID = 2018;
|
const int FIXED_OBJECT_MAXID = 2018;
|
||||||
|
|
||||||
const int MAX_ROOM_IDX = 2018;
|
const int MAX_ROOM_IDX = 2018;
|
||||||
|
|
||||||
|
const int VIEW_RANGE = 512;
|
||||||
|
@ -206,9 +206,9 @@ public:
|
|||||||
METAMGR_READ(level1room_shua_robot_min_num, 2);
|
METAMGR_READ(level1room_shua_robot_min_num, 2);
|
||||||
METAMGR_READ(level1room_shua_robot_max_num, 5);
|
METAMGR_READ(level1room_shua_robot_max_num, 5);
|
||||||
METAMGR_READ(level1room_die_robot_min_time, 10);
|
METAMGR_READ(level1room_die_robot_min_time, 10);
|
||||||
METAMGR_READ(level1room_die_robot_max_time, 20);
|
METAMGR_READ(level1room_die_robot_max_time, 14);
|
||||||
METAMGR_READ(level1room_die_robot_min_num, 1);
|
METAMGR_READ(level1room_die_robot_min_num, 1);
|
||||||
METAMGR_READ(level1room_die_robot_max_num, 5);
|
METAMGR_READ(level1room_die_robot_max_num, 3);
|
||||||
METAMGR_READ(level1room_robot_water, 8);
|
METAMGR_READ(level1room_robot_water, 8);
|
||||||
METAMGR_READ(level1room_robot_autodie_time, 10);
|
METAMGR_READ(level1room_robot_autodie_time, 10);
|
||||||
METAMGR_READ(level1room_robot_autodie_distance, 500);
|
METAMGR_READ(level1room_robot_autodie_distance, 500);
|
||||||
|
@ -2049,9 +2049,11 @@ void Room::ProcDieAndroid(int die_time, int die_num)
|
|||||||
std::vector<Android*> alive_humans;
|
std::vector<Android*> alive_humans;
|
||||||
alive_humans.reserve(human_hash_.size());
|
alive_humans.reserve(human_hash_.size());
|
||||||
for (auto& pair : human_hash_) {
|
for (auto& pair : human_hash_) {
|
||||||
if (pair.second->entity_subtype == EST_Android &&
|
if (pair.second->IsAndroid() &&
|
||||||
!pair.second->real_dead &&
|
!pair.second->real_dead &&
|
||||||
a8::HasBitFlag(pair.second->status, HS_Disable)) {
|
pair.second->team_uuid.empty() &&
|
||||||
|
!HasPlayerInRound(pair.second->GetPos(), VIEW_RANGE))
|
||||||
|
{
|
||||||
Android* hum = (Android*)pair.second;
|
Android* hum = (Android*)pair.second;
|
||||||
alive_humans.push_back(hum);
|
alive_humans.push_back(hum);
|
||||||
}
|
}
|
||||||
@ -2174,3 +2176,14 @@ void Room::CheckAutoDie(Human* target,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Room::HasPlayerInRound(const a8::Vec2& pos, float rad)
|
||||||
|
{
|
||||||
|
for (auto& pair : accountid_hash_) {
|
||||||
|
if (std::fabs(pair.second->GetPos().x - pos.x) < rad &&
|
||||||
|
std::fabs(pair.second->GetPos().y - pos.y) < rad) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -164,6 +164,7 @@ private:
|
|||||||
void ProcShuaAndroid(int shua_time, int shua_num);
|
void ProcShuaAndroid(int shua_time, int shua_num);
|
||||||
void ProcDieAndroid(int die_time, int die_num);
|
void ProcDieAndroid(int die_time, int die_num);
|
||||||
void CheckAutoDie(Human* hum, int autodie_time, int autodie_distance, int check_times);
|
void CheckAutoDie(Human* hum, int autodie_time, int autodie_distance, int check_times);
|
||||||
|
bool HasPlayerInRound(const a8::Vec2& pos, float rad);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int elapsed_time_ = 0;
|
int elapsed_time_ = 0;
|
||||||
|
@ -30,14 +30,12 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg)
|
|||||||
}
|
}
|
||||||
//游戏次数,吃鸡数,击杀数
|
//游戏次数,吃鸡数,击杀数
|
||||||
int game_times = a8::XValue(tmp_strings[0]);
|
int game_times = a8::XValue(tmp_strings[0]);
|
||||||
#if 0
|
|
||||||
if (!f8::IsOnlineEnv()) {
|
if (!f8::IsOnlineEnv()) {
|
||||||
game_times = 0;
|
game_times = 0;
|
||||||
if (!msg.team_uuid().empty()) {
|
if (!msg.team_uuid().empty()) {
|
||||||
game_times = 1;
|
game_times = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if 0
|
#if 0
|
||||||
int win_times = a8::XValue(tmp_strings[1]);
|
int win_times = a8::XValue(tmp_strings[1]);
|
||||||
int kill_times = a8::XValue(tmp_strings[2]);
|
int kill_times = a8::XValue(tmp_strings[2]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user