This commit is contained in:
aozhiwei 2022-08-27 11:10:38 +08:00
parent 079c704393
commit acdfbeb9ca

View File

@ -1,5 +1,7 @@
#include "precompile.h" #include "precompile.h"
#include <a8/collision.h>
#include "metamgr.h" #include "metamgr.h"
#include "room.h" #include "room.h"
#include "collider.h" #include "collider.h"
@ -12,6 +14,8 @@
#include "roomobstacle.h" #include "roomobstacle.h"
#include "explosion.h" #include "explosion.h"
#include "entityfactory.h" #include "entityfactory.h"
#include "player.h"
#include "incubator.h"
RoomObstacle::RoomObstacle():Obstacle() RoomObstacle::RoomObstacle():Obstacle()
{ {
@ -907,4 +911,24 @@ void RoomObstacle::ActivePortal()
if (room->IsGameOver()) { if (room->IsGameOver()) {
return; return;
} }
bool ready = true;
room->TraversePlayerList
(
a8::XParams(),
[this, &ready] (Player* hum, a8::XParams& param)
{
if (!a8::IntersectCircleCircle
(
hum->GetPos(),
hum->GetRadius(),
GetPos(),
meta->i->height()
)) {
ready = false;
}
}
);
if (ready) {
room->GetIncubator()->NextWave();
}
} }