1
This commit is contained in:
parent
ea53d6bd8a
commit
195e8fb999
@ -5,6 +5,7 @@
|
||||
#include "airdrop.h"
|
||||
#include "room.h"
|
||||
#include "roomobstacle.h"
|
||||
#include "hero.h"
|
||||
|
||||
#include "mt/AirDrop.h"
|
||||
#include "mt/MapThing.h"
|
||||
@ -88,61 +89,29 @@ void AirDrop::Exec(int appear_time, int box_id, int airdrop_id)
|
||||
|
||||
void AirDrop::ShuaMon(const glm::vec3& center, const std::vector<int>& airdrop_mon_list, float radius)
|
||||
{
|
||||
int last_hero_idx = 0;
|
||||
for (int hero_id : airdrop_mon_list) {
|
||||
const mt::Hero* hero_meta = mt::Hero::GetById(hero_id);
|
||||
if (hero_meta) {
|
||||
int team_id = 666;
|
||||
Creature* master = nullptr;
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
glm::vec3 born_dir = center;
|
||||
glm::vec3 born_offset(hero_meta->radius() + 1 + radius + (50 * i),
|
||||
0.0f,
|
||||
hero_meta->radius() + 1 + radius + (50 * i));
|
||||
GlmHelper::RotateY(born_offset, GlmHelper::CalcAngle(born_dir, GlmHelper::UP));
|
||||
GlmHelper::RotateY(born_offset, (last_hero_idx + i) * 0.5);
|
||||
|
||||
glm::vec3 hero_pos = center + born_offset;
|
||||
glm::vec3 dir = born_offset;
|
||||
GlmHelper::Normalize(dir);
|
||||
|
||||
Position pos;
|
||||
pos.SetX(hero_pos.x);
|
||||
pos.SetY(hero_pos.y);
|
||||
|
||||
// 888
|
||||
#if 0
|
||||
CircleCollider collider;
|
||||
collider.pos = hero_pos;
|
||||
collider.rad = hero_meta->radius();
|
||||
if (!map_service->CollisionDetection
|
||||
(
|
||||
this,
|
||||
false,
|
||||
pos,
|
||||
&collider
|
||||
)) {
|
||||
Hero* hero = CreateHero(master,
|
||||
hero_meta,
|
||||
pos,
|
||||
dir,
|
||||
team_id);
|
||||
if (!hero) {
|
||||
A8_ABORT();
|
||||
}
|
||||
last_hero_idx = i;
|
||||
#ifdef DEBUG
|
||||
BroadcastDebugMsg(a8::Format("ShuaMon pos:%d,%d hero_id:%d",
|
||||
{
|
||||
hero_pos.x,
|
||||
hero_pos.y,
|
||||
hero->meta->id()
|
||||
}));
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}//end for i
|
||||
}//end if
|
||||
}//end for hero_id
|
||||
glm::vec3 pos;
|
||||
glm::vec3 dir;
|
||||
Hero* hero = room_->CreateHero(nullptr,
|
||||
hero_meta,
|
||||
pos,
|
||||
dir,
|
||||
team_id);
|
||||
if (hero) {
|
||||
#ifdef DEBUG
|
||||
room_->BroadcastDebugMsg
|
||||
(a8::Format("ShuaMon pos:%f,%f,%f hero_id:%d",
|
||||
{
|
||||
hero->GetPos().GetX(),
|
||||
hero->GetPos().GetY(),
|
||||
hero->GetPos().GetZ(),
|
||||
hero_meta->id()
|
||||
}));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user