第二场刷到指定出生点
This commit is contained in:
parent
45acd5264e
commit
edb0faa6d2
@ -59,7 +59,8 @@ void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info)
|
||||
init_info.grid_service = grid_service_;
|
||||
init_info.map_service = map_service_;
|
||||
init_info.spawn_points = &spawn_points_;
|
||||
init_info.newbie_born_point_meta = newbie_born_point_;
|
||||
init_info.level0room_born_point_meta = level0room_born_point_;
|
||||
init_info.level1room_born_point_meta = level1room_born_point_;
|
||||
init_info.loots = &loots_;
|
||||
init_info.buildings = &buildings_;
|
||||
init_info.level0room_spec_things = &level0room_spec_things_;
|
||||
@ -106,7 +107,11 @@ void MapMgr::CreateThings()
|
||||
}
|
||||
if (spawn_points_hash.find(MetaMgr::Instance()->newbie_born_point) !=
|
||||
spawn_points_hash.end()) {
|
||||
newbie_born_point_ = spawn_points_hash[MetaMgr::Instance()->newbie_born_point];
|
||||
level0room_born_point_ = spawn_points_hash[MetaMgr::Instance()->newbie_born_point];
|
||||
}
|
||||
if (spawn_points_hash.find(MetaMgr::Instance()->level1room_born_point) !=
|
||||
spawn_points_hash.end()) {
|
||||
level1room_born_point_ = spawn_points_hash[MetaMgr::Instance()->level1room_born_point];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,8 @@ class MapMgr : public a8::Singleton<MapMgr>
|
||||
MapService* map_service_ = nullptr;
|
||||
GridService* grid_service_ = nullptr;
|
||||
std::vector<MetaData::MapTplThing*> spawn_points_;
|
||||
MetaData::MapTplThing* newbie_born_point_ = nullptr;
|
||||
MetaData::MapTplThing* level0room_born_point_ = nullptr;
|
||||
MetaData::MapTplThing* level1room_born_point_ = nullptr;
|
||||
std::vector<MetaData::MapTplThing*> loots_;
|
||||
std::vector<Building*> buildings_;
|
||||
std::vector<MetaData::MapTplThing*> level0room_spec_things_;
|
||||
|
@ -240,6 +240,7 @@ public:
|
||||
METAMGR_READ(level1room_robot_water, 8);
|
||||
METAMGR_READ(level1room_robot_autodie_time, 10);
|
||||
METAMGR_READ(level1room_robot_autodie_distance, 500);
|
||||
METAMGR_READ_STR(level1room_born_point, "");
|
||||
|
||||
METAMGR_READ(refresh_robot_min_num, 5);
|
||||
METAMGR_READ(refresh_robot_max_num, 10);
|
||||
|
@ -100,6 +100,7 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
||||
int level1room_robot_water = 0;
|
||||
int level1room_robot_autodie_time = 0;
|
||||
int level1room_robot_autodie_distance = 0;
|
||||
std::string level1room_born_point;
|
||||
|
||||
int refresh_robot_min_num = 0;
|
||||
int refresh_robot_max_num = 0;
|
||||
|
@ -51,7 +51,8 @@ void Room::InitData(RoomInitInfo& init_info)
|
||||
map_service = init_info.map_service;
|
||||
map_meta_ = init_info.map_meta;
|
||||
spawn_points_ = init_info.spawn_points;
|
||||
newbie_born_point_meta_ = init_info.newbie_born_point_meta;
|
||||
level0room_born_point_meta_ = init_info.level0room_born_point_meta;
|
||||
level1room_born_point_meta_ = init_info.level1room_born_point_meta;
|
||||
loots_ = init_info.loots;
|
||||
buildings_ = init_info.buildings;
|
||||
level0room_spec_things_ = init_info.level0room_spec_things;
|
||||
@ -1464,8 +1465,11 @@ void Room::CreateSpawnPoints()
|
||||
BornPoint born_point;
|
||||
born_point.thing_tpl = thing_tpl;
|
||||
born_point_hash_[uniid] = born_point;
|
||||
if (thing_tpl == newbie_born_point_meta_) {
|
||||
newbie_born_point_uniid_ = uniid;
|
||||
if (thing_tpl == level0room_born_point_meta_) {
|
||||
level0room_born_point_uniid_ = uniid;
|
||||
}
|
||||
if (thing_tpl == level1room_born_point_meta_) {
|
||||
level1room_born_point_uniid_ = uniid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1571,7 +1575,7 @@ void Room::SecondRandPoint()
|
||||
}
|
||||
CombineTeamBornPoint();
|
||||
if (room_type_ == RT_NewBrid) {
|
||||
BornPoint* newbie_point = GetBornPoint(newbie_born_point_uniid_);
|
||||
BornPoint* newbie_point = GetBornPoint(level0room_born_point_uniid_);
|
||||
if (newbie_point && first_newbie_) {
|
||||
ForceSetBornPoint(first_newbie_, newbie_point);
|
||||
} else {
|
||||
@ -1579,10 +1583,16 @@ void Room::SecondRandPoint()
|
||||
}
|
||||
}
|
||||
if (room_type_ == RT_MidBrid) {
|
||||
BornPoint* newbie_point = GetBornPoint(level0room_born_point_uniid_);
|
||||
for (auto& pair : accountid_hash_) {
|
||||
pair.second->on_grid_chg = std::bind(&Room::OnHumanGridChg,
|
||||
this,
|
||||
std::placeholders::_1);
|
||||
for (Human* member : *pair.second->team_members) {
|
||||
if (newbie_point) {
|
||||
ForceSetBornPoint(member, newbie_point);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
@ -206,7 +206,8 @@ private:
|
||||
std::string map_tpl_name_;
|
||||
RoomType_e room_type_ = RT_NewBrid;
|
||||
const std::vector<MetaData::MapTplThing*>* spawn_points_ = nullptr;
|
||||
const MetaData::MapTplThing* newbie_born_point_meta_ = nullptr;
|
||||
const MetaData::MapTplThing* level0room_born_point_meta_ = nullptr;
|
||||
const MetaData::MapTplThing* level1room_born_point_meta_ = nullptr;
|
||||
const std::vector<MetaData::MapTplThing*>* loots_ = nullptr;
|
||||
const std::vector<Building*>* buildings_ = nullptr;
|
||||
const std::vector<MetaData::MapTplThing*>* level0room_spec_things_ = nullptr;
|
||||
@ -223,7 +224,8 @@ private:
|
||||
MetaData::AirLine* airline_ = nullptr;
|
||||
a8::XTimerAttacher xtimer_attacher_;
|
||||
size_t airdrop_times_ = 0;
|
||||
int newbie_born_point_uniid_ = 0;
|
||||
int level0room_born_point_uniid_ = 0;
|
||||
int level1room_born_point_uniid_ = 0;
|
||||
bool show_handed_ = false;
|
||||
|
||||
int current_teamid_ = 0;
|
||||
|
@ -151,7 +151,8 @@ struct RoomInitInfo
|
||||
GridService* grid_service = nullptr;
|
||||
MapService* map_service = nullptr;
|
||||
const std::vector<MetaData::MapTplThing*>* spawn_points = nullptr;
|
||||
const MetaData::MapTplThing* newbie_born_point_meta = nullptr;
|
||||
const MetaData::MapTplThing* level0room_born_point_meta = nullptr;
|
||||
const MetaData::MapTplThing* level1room_born_point_meta = nullptr;
|
||||
const std::vector<MetaData::MapTplThing*>* loots = nullptr;
|
||||
const std::vector<Building*>* buildings = nullptr;
|
||||
const std::vector<MetaData::MapTplThing*>* level0room_spec_things = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user