This commit is contained in:
aozhiwei 2022-12-28 19:19:43 +08:00
parent a1d4fcd0c0
commit bbd187541c

View File

@ -6,6 +6,8 @@
#include "hero.h"
#include "player.h"
#include "pbutils.h"
#include "glmhelper.h"
#include "mt/Param.h"
#include "mt/Hero.h"
#include "mt/PveGemini.h"
@ -64,9 +66,9 @@ void Incubator::AllocAndroid(Human* target, int num)
A8_ABORT();
}
int try_count = 0;
a8::Vec2 dir = a8::Vec2::UP;
glm::vec3 dir = GlmHelper::UP;
while (num > 0 && try_count < 20 && !hold_humans_.empty()) {
dir.Rotate(a8::RandAngle());
GlmHelper::RotateY(dir, a8::RandAngle());
int rand_len = rand() % mt::Param::s().incubator_rand_length;
Human* hum = hold_humans_[0];
Position old_pos = hum->GetPos();
@ -227,10 +229,12 @@ void Incubator::AutoAllocAndroid()
void Incubator::ActiveAndroid(Human* hum, Human* android)
{
a8::Vec2 center = room->GetGasData().pos_new;
glm::vec3 center = glm::vec3(room->GetGasData().pos_new.x,
0.0f,
room->GetGasData().pos_new.y);
float start_distance = a8::RandEx(200, 600);
a8::Vec2 start_dir = a8::Vec2::UP;
start_dir.Rotate(a8::RandAngle());
glm::vec3 start_dir = GlmHelper::UP;
GlmHelper::RotateY(start_dir, a8::RandAngle());
android->SetPos(hum->GetPos());
int try_count = 0;
@ -326,13 +330,7 @@ void Incubator::SpawnWaveMon(int wave)
int team_id = 666;
Creature* master = nullptr;
// 999
#if 1
glm::vec3 dir = GlmHelper::UP;
#else
a8::Vec2 dir = hero_pos;
dir.Normalize();
#endif
Hero* hero = room->CreateHero(master,
hero_meta,