8.空袭,恢复正常,支持测试配置

This commit is contained in:
aozhiwei 2021-06-21 06:28:01 +00:00
parent f58f5acf65
commit 4b256e23bc

View File

@ -3928,11 +3928,20 @@ void Room::AirRaid(int airraid_id)
}
a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle());
a8::Vec2 center = gas_data_.pos_new + dir * (500 + rand() % 300);
a8::Vec2 center = gas_data_.pos_new + dir * (100 + rand() % gas_data_.new_area_meta->i->rad());
#if 1
Player* hum = GetOneAlivePlayer();
if (hum) {
center = hum->GetPos();
{
std::vector<Player*> humans;
GetAlivePlayers(humans, GetRoomMaxPlayerNum());
if (humans.size() > 3) {
std::random_shuffle(humans.begin(), humans.end());
for (Human* hum : humans) {
if (!hum->poisoning) {
center = hum->GetPos() + dir * (200 + rand() % 500);
break;
}
}
}
}
#endif
frame_event.AddAirRaid(raid_meta->i->appear_time(), center, raid_meta->i->rad());