This commit is contained in:
aozhiwei 2023-03-24 13:48:14 +08:00
parent 4feaeec930
commit 3d9b77dd7d
7 changed files with 34 additions and 5 deletions

View File

@ -2,11 +2,17 @@
#include "bornpoint.h"
#include "mt/Map.h"
Position BornPoint::RandPoint() const
{
Position pos;
pos.SetX(5120.000000000000);
pos.SetY(6.250846862793);
pos.SetZ(5120.000000000000);
if (wo_meta) {
pos.FromGlmVec3(wo_meta->pos);
} else {
pos.SetX(5120.000000000000);
pos.SetY(6.250846862793);
pos.SetZ(5120.000000000000);
}
return pos;
}

View File

@ -19,6 +19,14 @@ namespace mt
abort();
}
#endif
{
std::vector<std::string> strings;
a8::Split(born_point(), strings, ',');
_spawn_point = glm::vec3(
(float)a8::XValue(strings[0]).GetDouble(),
(float)a8::XValue(strings[1]).GetDouble(),
(float)a8::XValue(strings[2]).GetDouble());
}
}
float PveGemini::GetHpMul(int num) const

View File

@ -14,6 +14,8 @@ namespace mt
void Init1();
float GetHpMul(int num) const;
glm::vec3 _spawn_point;
private:
std::vector<float> hp_muls;
std::vector<float> hp_mul;

View File

@ -14,11 +14,13 @@ namespace mtb
int gemini_lv() const { return gemini_lv_; };
int gemini_limit() const { return gemini_limit_; };
const std::string multiplayer_enemy_hp_mul() const { return multiplayer_enemy_hp_mul_; };
const std::string born_point() const { return born_point_; };
bool has_gemini_id() const { return __flags__.test(0);};
bool has_gemini_lv() const { return __flags__.test(1);};
bool has_gemini_limit() const { return __flags__.test(2);};
bool has_multiplayer_enemy_hp_mul() const { return __flags__.test(3);};
bool has_born_point() const { return __flags__.test(4);};
protected:
@ -26,9 +28,10 @@ namespace mtb
int gemini_lv_ = 0;
int gemini_limit_ = 0;
std::string multiplayer_enemy_hp_mul_;
std::string born_point_;
public:
std::bitset<4> __flags__;
std::bitset<5> __flags__;
};
};

View File

@ -686,11 +686,12 @@ namespace mtb
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("PveGemini", 4, 0);
meta_class = new a8::reflect::Class("PveGemini", 5, 0);
meta_class->SetSimpleField(0, "gemini_id", a8::reflect::ET_INT32, my_offsetof2(PveGemini, gemini_id_));
meta_class->SetSimpleField(1, "gemini_lv", a8::reflect::ET_INT32, my_offsetof2(PveGemini, gemini_lv_));
meta_class->SetSimpleField(2, "gemini_limit", a8::reflect::ET_INT32, my_offsetof2(PveGemini, gemini_limit_));
meta_class->SetSimpleField(3, "multiplayer_enemy_hp_mul", a8::reflect::ET_STRING, my_offsetof2(PveGemini, multiplayer_enemy_hp_mul_));
meta_class->SetSimpleField(4, "born_point", a8::reflect::ET_STRING, my_offsetof2(PveGemini, born_point_));
}
return meta_class;
}

View File

@ -2149,6 +2149,11 @@ void Room::CreateSpawnPoints()
int uniid = AllocUniid();
std::shared_ptr<BornPoint> born_point = std::make_shared<BornPoint>();
born_point_hash_[uniid] = born_point;
if (IsPveRoom()) {
std::shared_ptr<mt::WorldObject> wo_meta = std::make_shared<mt::WorldObject>();
wo_meta->pos = pve_instance->_spawn_point;
born_point->wo_meta = wo_meta;
}
}
}
}
@ -3793,6 +3798,9 @@ int Room::GetPolyExtFlag(int poly_idx)
void Room::CreateWorldObjects()
{
if (IsPveRoom()) {
return;
}
for (auto& itr : GetMapMeta()->_world_objects) {
std::shared_ptr<mt::WorldObject> obj = itr;
switch ((WorldObjectType_e)obj->object_type) {

View File

@ -520,6 +520,7 @@ message PveGemini
optional int32 gemini_lv = 2;
optional int32 gemini_limit = 3;
optional string multiplayer_enemy_hp_mul = 4;
optional string born_point = 5;
}
message PveGeminiContent