This commit is contained in:
aozhiwei 2023-04-01 15:04:32 +08:00
parent 195e8fb999
commit f5da282ce0

View File

@ -6,10 +6,12 @@
#include "room.h"
#include "roomobstacle.h"
#include "hero.h"
#include "mapinstance.h"
#include "mt/AirDrop.h"
#include "mt/MapThing.h"
#include "mt/Hero.h"
#include "mt/Map.h"
AirDrop::AirDrop(Room* room)
{
@ -93,8 +95,21 @@ void AirDrop::ShuaMon(const glm::vec3& center, const std::vector<int>& airdrop_m
const mt::Hero* hero_meta = mt::Hero::GetById(hero_id);
if (hero_meta) {
int team_id = 666;
glm::vec3 pos;
glm::vec3 dir;
glm::vec3 ref_point = center;
glm::vec3 point;
glm::vec3 pos = center;
room_->map_instance->Scale(ref_point);
if (room_->map_instance->FindRandomPointAroundCircle
(
center,
80 * room_->GetMapMeta()->scale(),
point
)) {
room_->map_instance->UnScale(point);
pos = point;
}
glm::vec3 dir = GlmHelper::UP;
GlmHelper::RotateY(dir, a8::RandAngle());
Hero* hero = room_->CreateHero(nullptr,
hero_meta,
pos,