1
This commit is contained in:
parent
8a3593701e
commit
00ffaf6641
@ -393,13 +393,18 @@ int Incubator::GetPveLeftTime()
|
|||||||
void Incubator::NextWave()
|
void Incubator::NextWave()
|
||||||
{
|
{
|
||||||
if (room->pve_data.GetWave() < wave_timers_.size()) {
|
if (room->pve_data.GetWave() < wave_timers_.size()) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
a8::XPrintf("NextWave \n", {});
|
||||||
|
#endif
|
||||||
int acc_time = 0;
|
int acc_time = 0;
|
||||||
{
|
{
|
||||||
xtimer_list* timer = wave_timers_[room->pve_data.GetWave()];
|
xtimer_list* timer = wave_timers_[room->pve_data.GetWave()];
|
||||||
int remain_time = room->xtimer.GetRemainTime(timer);
|
int remain_time = room->xtimer.GetRemainTime(timer);
|
||||||
room->xtimer.ModifyTimer(timer, 0);
|
room->xtimer.ModifyTimer
|
||||||
|
(timer, room->pve_mode_meta->pb->wave_prepare_time() * SERVER_FRAME_RATE);
|
||||||
acc_time = remain_time;
|
acc_time = remain_time;
|
||||||
}
|
}
|
||||||
|
acc_time -= room->pve_mode_meta->pb->wave_prepare_time() * SERVER_FRAME_RATE;
|
||||||
for (int i = room->pve_data.GetWave(); i < wave_timers_.size(); ++i) {
|
for (int i = room->pve_data.GetWave(); i < wave_timers_.size(); ++i) {
|
||||||
xtimer_list* timer = wave_timers_[i];
|
xtimer_list* timer = wave_timers_[i];
|
||||||
int remain_time = room->xtimer.GetRemainTime(timer);
|
int remain_time = room->xtimer.GetRemainTime(timer);
|
||||||
|
@ -127,18 +127,33 @@ void PveData::FlyDoor(Room* room, a8::Vec2& point, int radius)
|
|||||||
killed_num
|
killed_num
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
room->TraverseHumanList
|
room->xtimer.AddDeadLineTimerAndAttach
|
||||||
(
|
(
|
||||||
a8::XParams(),
|
room->pve_mode_meta->pb->wave_prepare_time() * SERVER_FRAME_RATE,
|
||||||
[this, room, &point, radius] (Human* hum, a8::XParams& param)
|
a8::XParams()
|
||||||
|
.SetSender(room)
|
||||||
|
.SetParam1(point.x)
|
||||||
|
.SetParam2(point.y)
|
||||||
|
.SetParam3(radius),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
{
|
{
|
||||||
a8::Vec2 dir = a8::Vec2::UP;
|
Room* room = (Room*)param.sender.GetUserData();
|
||||||
dir.Rotate(a8::RandAngle());
|
a8::Vec2 point((float)param.param1.GetDouble(), (float)param.param2.GetDouble());
|
||||||
a8::Vec2 new_pos = point + dir * a8::RandEx(1, radius);
|
float radius = param.param3.GetDouble();
|
||||||
hum->SetPos(new_pos);
|
room->TraverseHumanList
|
||||||
//hum->TryAddBuff(hum, 1025);
|
(
|
||||||
room->grid_service->MoveCreature(hum);
|
a8::XParams(),
|
||||||
return true;
|
[room, &point, radius] (Human* hum, a8::XParams& param)
|
||||||
});
|
{
|
||||||
|
a8::Vec2 dir = a8::Vec2::UP;
|
||||||
|
dir.Rotate(a8::RandAngle());
|
||||||
|
a8::Vec2 new_pos = point + dir * a8::RandEx(1, radius);
|
||||||
|
hum->SetPos(new_pos);
|
||||||
|
//hum->TryAddBuff(hum, 1025);
|
||||||
|
room->grid_service->MoveCreature(hum);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
&room->xtimer_attacher_.timer_list_);
|
||||||
room->GetIncubator()->NextWave();
|
room->GetIncubator()->NextWave();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user