1
This commit is contained in:
parent
6ff76243b9
commit
f55179f4b2
@ -1824,6 +1824,18 @@ void Human::_UpdateMove(int speed)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Human::ChangeToRace(RaceType_e race, int level)
|
||||
{
|
||||
if (race != kHumanRace ||
|
||||
race != kZombieRace) {
|
||||
abort();
|
||||
}
|
||||
race_ = race;
|
||||
level_ = level;
|
||||
room->frame_event.AddRaceChg(this);
|
||||
room->frame_event.AddLevelChg(this);
|
||||
}
|
||||
|
||||
void Human::_InternalUpdateMove(float speed)
|
||||
{
|
||||
float nx = move_dir.x * speed;
|
||||
|
@ -280,6 +280,7 @@ class Human : public MoveableEntity
|
||||
ObjectSyncFlags* GetObjectSyncFlags(int obj_uniid);
|
||||
void _UpdateMove(int speed);
|
||||
RaceType_e GetRace() { return race_; }
|
||||
void ChangeToRace(RaceType_e race, int level);
|
||||
|
||||
protected:
|
||||
void _InternalUpdateMove(float speed);
|
||||
|
@ -1780,6 +1780,9 @@ void Room::NotifyGameStart()
|
||||
if (room_type_ == RT_NewBrid || room_type_ == RT_MidBrid) {
|
||||
NewBieRoomStart();
|
||||
}
|
||||
if (GetRoomMode() == kZombieMode) {
|
||||
ZombieModeStart();
|
||||
}
|
||||
InitAndroidAI();
|
||||
}
|
||||
|
||||
@ -2644,6 +2647,24 @@ void Room::NewBieRoomStart()
|
||||
}
|
||||
}
|
||||
|
||||
void Room::ZombieModeStart()
|
||||
{
|
||||
if (GetRoomMode() != kZombieMode) {
|
||||
if (human_hash_.size() != GetRoomMaxPlayerNum()) {
|
||||
abort();
|
||||
}
|
||||
std::vector<Human*> human_list;
|
||||
for (auto& pair : human_hash_) {
|
||||
human_list.push_back(pair.second);
|
||||
}
|
||||
std::random_shuffle(human_list.begin(), human_list.end());
|
||||
for (size_t i = 0; i < 2; ++i) {
|
||||
Human* hum = human_list[i];
|
||||
hum->ChangeToRace(kZombieRace, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Human* Room::GetOneCanEnableAndroid()
|
||||
{
|
||||
std::vector<Human*> humans;
|
||||
|
@ -195,6 +195,7 @@ private:
|
||||
void CombineTeamBornPoint();
|
||||
void ForceSetBornPoint(Human* hum, BornPoint* born_point);
|
||||
void NewBieRoomStart();
|
||||
void ZombieModeStart();
|
||||
void CreateLevel0RoomSpecThings();
|
||||
bool CanAddToScene(Human* hum);
|
||||
void SyncFrameData();
|
||||
|
Loading…
x
Reference in New Issue
Block a user