1389 lines
48 KiB
C++
1389 lines
48 KiB
C++
#include "precompile.h"
|
|
|
|
#include "metadata.h"
|
|
#include "metamgr.h"
|
|
|
|
#include "framework/cpp/utils.h"
|
|
|
|
namespace MetaData
|
|
{
|
|
void Parameter::Init()
|
|
{
|
|
int_val = a8::XValue(i->param_value());
|
|
float_val = a8::XValue(i->param_value());
|
|
str_val = a8::XValue(i->param_value()).GetString();
|
|
}
|
|
|
|
void Map::Init()
|
|
{
|
|
rand_space = 0;
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->template_list(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
assert(strings2.size() == 2);
|
|
rand_space += a8::XValue(strings2[1]).GetInt();
|
|
template_list.push_back(std::make_tuple(
|
|
strings2[0],
|
|
rand_space
|
|
));
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->airdrops(), strings, '|');
|
|
for (auto& str : strings) {
|
|
airdrops.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->airraids(), strings, '|');
|
|
for (auto& str : strings) {
|
|
airraids.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->car_num_limit(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
car_num_limit[a8::XValue(strings2[0]).GetInt()] = a8::XValue(strings2[1]).GetInt();
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->game_start_buff_list(), strings, ':');
|
|
for (auto& str : strings) {
|
|
buff_list.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->refresh_robot(), strings, '|');
|
|
if (strings.size() != 2) {
|
|
abort();
|
|
}
|
|
{
|
|
std::vector<std::string> strings2;
|
|
a8::Split(strings[0], strings2, '-');
|
|
if (strings2.size() != 2) {
|
|
abort();
|
|
}
|
|
refresh_robot_min_num = a8::XValue(strings2[0]);
|
|
refresh_robot_max_num = a8::XValue(strings2[1]);
|
|
}
|
|
{
|
|
std::vector<std::string> strings2;
|
|
a8::Split(strings[1], strings2, '-');
|
|
if (strings2.size() != 2) {
|
|
abort();
|
|
}
|
|
refresh_robot_min_time = a8::XValue(strings2[0]);
|
|
refresh_robot_max_time = a8::XValue(strings2[1]);
|
|
}
|
|
if (refresh_robot_min_num >= refresh_robot_max_num) {
|
|
abort();
|
|
}
|
|
if (refresh_robot_min_time >= refresh_robot_max_time) {
|
|
abort();
|
|
}
|
|
if (refresh_robot_min_num <= 0 || refresh_robot_max_num <= 0 ||
|
|
refresh_robot_min_time <= 0 || refresh_robot_max_time <= 0) {
|
|
abort();
|
|
}
|
|
}
|
|
first_safearea_center = a8::Vec2(i->map_width() / 2.0f,
|
|
i->map_height() / 2.0f);
|
|
if (!i->first_safearea_center().empty()) {
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->first_safearea_center(), strings, ':');
|
|
if (strings.size() != 2) {
|
|
abort();
|
|
}
|
|
first_safearea_center = a8::Vec2(a8::XValue(strings[0]).GetDouble(),
|
|
a8::XValue(strings[1]).GetDouble());
|
|
}
|
|
if (i->player() < 10) {
|
|
abort();
|
|
}
|
|
}
|
|
|
|
void Map::Init2()
|
|
{
|
|
std::vector<MetaData::SafeAreaPos*>* pos_list = MetaMgr::Instance()->GetSafeAreaPosList(i->safearea());
|
|
MetaData::SafeArea* area_meta = MetaMgr::Instance()->GetSafeArea(i->safearea());
|
|
if (area_meta && pos_list) {
|
|
std::vector<MetaData::SafeArea*> area_list;
|
|
MetaData::SafeArea* cur_area_meta = area_meta;
|
|
while (cur_area_meta) {
|
|
area_list.push_back(cur_area_meta);
|
|
cur_area_meta = MetaMgr::Instance()->GetSafeArea(cur_area_meta->i->id() + 1);
|
|
}
|
|
|
|
for (MetaData::SafeAreaPos* pos_meta : *pos_list) {
|
|
if (area_list.size() != pos_meta->poses.size()) {
|
|
abort();
|
|
}
|
|
for (size_t j = 0; j < area_list.size(); ++j) {
|
|
a8::Vec2 pos = pos_meta->poses[j];
|
|
if (pos.x < 0 || pos.y < 0) {
|
|
abort();
|
|
}
|
|
if (pos.x > i->map_width() || pos.y > i->map_height()) {
|
|
abort();
|
|
}
|
|
if (j > 0) {
|
|
a8::Vec2 pre_pos = pos_meta->poses[j - 1];
|
|
MetaData::SafeArea* pre_area_meta = area_list[j - 1];
|
|
float distance = pos.Distance(pre_pos);
|
|
if (distance + area_meta->i->rad() < pre_area_meta->i->rad()) {
|
|
} else {
|
|
abort();
|
|
}
|
|
}
|
|
}//end for i
|
|
}
|
|
}
|
|
}
|
|
|
|
std::string Map::RandTemplate()
|
|
{
|
|
if (rand_space <= 0) {
|
|
return "";
|
|
}
|
|
int rnd = rand() % rand_space;
|
|
for (auto& tpl : template_list) {
|
|
if (rnd <= std::get<1>(tpl)) {
|
|
return std::get<0>(tpl);
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
int Map::GetCarLimit(int car_id)
|
|
{
|
|
auto itr = car_num_limit.find(car_id);
|
|
return itr != car_num_limit.end() ? itr->second : 666;
|
|
}
|
|
|
|
a8::Vec2 Map::GetCenter() const
|
|
{
|
|
a8::Vec2 center(i->map_width() / 2, i->map_height() / 2);
|
|
return center;
|
|
}
|
|
|
|
void MapThing::Init()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_list(), strings, '|');
|
|
for (const std::string& tmp_str : strings) {
|
|
buff_list.push_back(a8::XValue(tmp_str));
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->monster_list(), strings, '|');
|
|
for (const std::string& tmp_str : strings) {
|
|
airdrop_mon_list.push_back(a8::XValue(tmp_str));
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->special_damage_type(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int n = a8::XValue(str);
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(special_damage_type, n);
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->receive_special_damage_type(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int n = a8::XValue(str);
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(receive_special_damage_type, n);
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->sweep_tags(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int n = a8::XValue(str);
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(sweep_tags, n);
|
|
}
|
|
}
|
|
{
|
|
int_param1 = a8::XValue(i->param1());
|
|
float_param1 = a8::XValue(i->param1()).GetDouble();
|
|
}
|
|
{
|
|
int_param2 = a8::XValue(i->param2());
|
|
float_param2 = a8::XValue(i->param2()).GetDouble();
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param2(), strings, '|');
|
|
for (auto& str : strings) {
|
|
param2_list.push_back(a8::XValue(str));
|
|
}
|
|
}
|
|
}
|
|
|
|
void Equip::Init()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->bullet_born_offset(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
assert(strings2.size() >= 2);
|
|
bullet_born_offset.push_back
|
|
(std::make_tuple(
|
|
a8::XValue(strings2[0]).GetDouble(),
|
|
a8::XValue(strings2[1]).GetDouble(),
|
|
strings2.size() > 2 ? a8::XValue(strings2[2]).GetDouble() : 0,
|
|
strings2.size() > 3 ? a8::XValue(strings2[3]).GetInt() : 0,
|
|
strings2.size() > 4 ? a8::XValue(strings2[4]).GetInt() : 0
|
|
)
|
|
);
|
|
lock_time += strings2.size() > 3 ? a8::XValue(strings2[3]).GetInt() : 0;
|
|
if (strings2.size() > 4 && a8::XValue(strings2[4]).GetInt() == 1) {
|
|
lock_time = 0;
|
|
}
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->volume(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
assert(strings2.size() == 2);
|
|
if (strings2.size() >= 2) {
|
|
size_t slot = a8::XValue(strings2[0]);
|
|
size_t num = a8::XValue(strings2[1]);
|
|
if (slot >= 0 && slot < volume.size()){
|
|
volume[slot] = num;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
int_param1 = a8::XValue(i->param1());
|
|
float_param1 = a8::XValue(i->param1()).GetDouble();
|
|
}
|
|
{
|
|
int_param2 = a8::XValue(i->param2());
|
|
float_param2 = a8::XValue(i->param2()).GetDouble();
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->launch_dev(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
if (strings2.size() >= 2) {
|
|
shoot_offsets.push_back(std::make_tuple
|
|
(1,
|
|
a8::Vec2(
|
|
(float)a8::XValue(strings2[0]).GetDouble(),
|
|
(float)a8::XValue(strings2[1]).GetDouble())
|
|
)
|
|
);
|
|
} else {
|
|
shoot_offsets.push_back(std::make_tuple
|
|
(0,
|
|
a8::Vec2(
|
|
0.0f,
|
|
0.0f
|
|
)
|
|
));
|
|
}
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> time_strings;
|
|
a8::Split(i->power_time(), time_strings, '|');
|
|
std::vector<std::string> gun_strings;
|
|
a8::Split(i->power_gun(), gun_strings, '|');
|
|
std::vector<std::string> buff_strings;
|
|
a8::Split(i->power_buff(), buff_strings, '|');
|
|
if (time_strings.size() == gun_strings.size() && gun_strings.size() == buff_strings.size()) {
|
|
int last_time = -1;
|
|
for (size_t i = 0; i < time_strings.size(); ++i) {
|
|
int time = a8::XValue(time_strings[i]);
|
|
int gun = a8::XValue(gun_strings[i]);
|
|
int buff = a8::XValue(buff_strings[i]);
|
|
power_charge.push_back(std::make_tuple(time, gun, buff));
|
|
if (time <= last_time) {
|
|
abort();
|
|
}
|
|
last_time = time;
|
|
}
|
|
} else {
|
|
abort();
|
|
}
|
|
}
|
|
{
|
|
if (i->buffid() != 0) {
|
|
buff_meta = MetaMgr::Instance()->GetBuff(i->buffid());
|
|
if (!buff_meta) {
|
|
abort();
|
|
}
|
|
}
|
|
}
|
|
if (i->equip_type() == EQUIP_TYPE_CAR) {
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param1(), strings, '|');
|
|
int j = 0;
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
if (strings2.size() >= 2) {
|
|
switch (j) {
|
|
case 0:
|
|
{
|
|
car_active_buff_id = a8::XValue(strings2[1]).GetInt();
|
|
}
|
|
break;
|
|
case 1:
|
|
{
|
|
car_deactive_buff_id = a8::XValue(strings2[1]).GetInt();
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
car_buff_list.push_back
|
|
(std::make_tuple
|
|
(
|
|
(float)a8::XValue(strings2[0]).GetDouble(),
|
|
a8::XValue(strings2[1]).GetInt())
|
|
);
|
|
}
|
|
break;
|
|
}
|
|
} else {
|
|
abort();
|
|
}
|
|
++j;
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->special_damage_type(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int n = a8::XValue(str);
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(special_damage_type, n);
|
|
}
|
|
}
|
|
}
|
|
|
|
void Equip::Init2()
|
|
{
|
|
if (i->equip_type() == EQUIP_TYPE_WEAPON) {
|
|
MetaData::Equip* bullet = MetaMgr::Instance()->GetEquip(i->use_bullet());
|
|
if (!bullet) {
|
|
#if 0
|
|
a8::XPrintf("no bullet %d\n", {i->id()});
|
|
#else
|
|
abort();
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
|
|
int Equip::GetWeaponIdx()
|
|
{
|
|
int weapon_idx = -1;
|
|
if (i->equip_type() == EQUIP_TYPE_WEAPON) {
|
|
if (i->equip_subtype() == 1) {
|
|
return 0;
|
|
} else {
|
|
return GUN_SLOT1;
|
|
}
|
|
}
|
|
return weapon_idx;
|
|
}
|
|
|
|
bool Equip::Match(CondAddBuff_e cond, int val, int val2)
|
|
{
|
|
switch (cond) {
|
|
case kCondBuffUpdateWeaponId:
|
|
case kCondBuffShotWeaponId:
|
|
{
|
|
return val == i->id();
|
|
}
|
|
break;
|
|
case kCondBuffUpdateWeaponSlot:
|
|
case kCondBuffShotWeaponSlot:
|
|
{
|
|
return val == i->_inventory_slot();
|
|
}
|
|
break;
|
|
case kCondBuffUpdateWeaponType:
|
|
case kCondBuffShotWeaponType:
|
|
{
|
|
return val == i->equip_subtype() &&
|
|
(val2 == 0 || val2 == i->equip_type());
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
return false;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void EquipUpgrade::Init()
|
|
{
|
|
const int MAX_LV = 20;
|
|
for (int j = 0; j < MAX_LV; ++j) {
|
|
std::array<float, kHAT_End>& attrs = a8::FastAppend(level_attrs);
|
|
for (size_t k = 0; k < kHAT_End; ++k) {
|
|
attrs[k] = 0;
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
if (!i->spera_attr().empty()) {
|
|
a8::Split(i->spera_attr(), strings, '|');
|
|
} else {
|
|
a8::Split(i->attr_type(), strings, '|');
|
|
}
|
|
int level = 1;
|
|
for (auto& str : strings) {
|
|
if (str.empty()) {
|
|
continue;
|
|
}
|
|
++level;
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ';');
|
|
for (auto& str2 : strings2) {
|
|
std::vector<std::string> strings3;
|
|
a8::Split(str2, strings3, ':');
|
|
if (strings3.size() != 2) {
|
|
abort();
|
|
}
|
|
int attr_type = a8::XValue(strings3[0]);
|
|
int attr_value = a8::XValue(strings3[1]);
|
|
if (attr_type <= kHAT_End) {
|
|
level_attrs[level][attr_type] = attr_value;
|
|
}
|
|
}
|
|
}//end for strings
|
|
for (int i = level; i < MAX_LV; ++i) {
|
|
level_attrs[i] = level_attrs[level];
|
|
}
|
|
}
|
|
}
|
|
|
|
float EquipUpgrade::GetAttrValue(int level, int attr_type)
|
|
{
|
|
if (level < 1) {
|
|
return 0;
|
|
}
|
|
if (level > (int)level_attrs.size()) {
|
|
return 0;
|
|
}
|
|
if (attr_type <= kHAT_End) {
|
|
return level_attrs[level][attr_type];
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void Player::Init()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->volume(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
assert(strings2.size() == 2);
|
|
if (strings2.size() >= 2) {
|
|
size_t slot = a8::XValue(strings2[0]);
|
|
size_t num = a8::XValue(strings2[1]);
|
|
if (slot >= 0 && slot < volume.size()){
|
|
volume[slot] = num;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->init_buffs(), strings, '|');
|
|
for (auto& str : strings) {
|
|
init_buffs.push_back(a8::XValue(str));
|
|
}
|
|
}
|
|
}
|
|
|
|
void PlayerSkin::Init()
|
|
{
|
|
|
|
}
|
|
|
|
void Robot::Init()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->skin_id(), strings, '|');
|
|
for (auto& str : strings) {
|
|
skin_id.push_back(a8::XValue(str));
|
|
}
|
|
if (skin_id.size() != 3) {
|
|
abort();
|
|
}
|
|
}
|
|
}
|
|
|
|
void Drop::Init()
|
|
{
|
|
std::vector<std::string> item_list;
|
|
{
|
|
a8::Split(i->item_id(), item_list, '|');
|
|
}
|
|
std::vector<std::string> num_list;
|
|
{
|
|
a8::Split(i->num(), num_list, '|');
|
|
}
|
|
std::vector<std::string> weight_list;
|
|
{
|
|
a8::Split(i->weight(), weight_list, '|');
|
|
}
|
|
assert(item_list.size() == num_list.size() &&
|
|
item_list.size() == weight_list.size());
|
|
total_weight = 0;
|
|
for (size_t i = 0; i < item_list.size(); ++i) {
|
|
total_weight += a8::XValue(weight_list[i]).GetInt();
|
|
std::vector<int> itemids;
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(item_list[i], strings, ':');
|
|
for (auto& str : strings) {
|
|
itemids.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
std::vector<int> nums;
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(num_list[i], strings, ':');
|
|
for (auto& str : strings) {
|
|
nums.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
assert(itemids.size() == nums.size());
|
|
#if 1
|
|
std::vector<int> item_lvs;
|
|
for (size_t ii = 0; ii < itemids.size(); ++ii) {
|
|
item_lvs.push_back(1);
|
|
}
|
|
#endif
|
|
if (this->i->type() == 1) {
|
|
auto item_tuple = std::make_tuple(
|
|
itemids,
|
|
nums,
|
|
item_lvs,
|
|
a8::XValue(weight_list[i]).GetInt()
|
|
);
|
|
items.push_back(item_tuple);
|
|
} else {
|
|
auto item_tuple = std::make_tuple(
|
|
itemids,
|
|
nums,
|
|
item_lvs,
|
|
total_weight
|
|
);
|
|
items.push_back(item_tuple);
|
|
}
|
|
}
|
|
assert(i->type() == 1 || i->type() == 2);
|
|
}
|
|
|
|
void Drop::RandItems(std::vector<std::tuple<int, int, int>>& drop_items)
|
|
{
|
|
if (i->type() == 1) {
|
|
for (auto& item : items) {
|
|
if ((rand() % 10000) <= std::get<3>(item)) {
|
|
for (size_t i = 0; i < std::get<0>(item).size(); ++i) {
|
|
drop_items.push_back(std::make_tuple(
|
|
std::get<0>(item)[i],
|
|
std::get<1>(item)[i],
|
|
std::get<2>(item)[i]
|
|
));
|
|
}
|
|
}
|
|
}
|
|
} else if (total_weight > 0) {
|
|
int rnd = rand() % (total_weight + 1);
|
|
for (auto& item : items) {
|
|
if (std::get<3>(item) >= rnd) {
|
|
for (size_t i = 0; i < std::get<0>(item).size(); ++i) {
|
|
drop_items.push_back(std::make_tuple(
|
|
std::get<0>(item)[i],
|
|
std::get<1>(item)[i],
|
|
std::get<2>(item)[i]
|
|
));
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void Building::Init()
|
|
{
|
|
for (auto& door_meta : i->doorobj()) {
|
|
Door* p_door = nullptr;
|
|
for (auto& door : doors) {
|
|
if (door.door_id == door_meta.id()) {
|
|
p_door = &door;
|
|
break;
|
|
}
|
|
}
|
|
if (!p_door) {
|
|
p_door = &a8::FastAppend(doors);
|
|
p_door->door_id = door_meta.id();
|
|
}
|
|
switch (door_meta.type()) {
|
|
case 1:
|
|
{
|
|
p_door->state0 = &door_meta;
|
|
}
|
|
break;
|
|
case 2:
|
|
{
|
|
p_door->state1 = &door_meta;
|
|
}
|
|
break;
|
|
}
|
|
}//end for
|
|
|
|
for (auto& door : doors) {
|
|
if (door.door_id == 0 ||
|
|
!door.state0 || !door.state1) {
|
|
abort();
|
|
} else {
|
|
#if 0
|
|
if (door.state1->x() < door.state0.x()) {
|
|
if (door.state1.y() < door.state0.y()) {
|
|
|
|
} else {
|
|
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
}
|
|
|
|
metatable::BuildingJson* building_meta = (metatable::BuildingJson*)i;
|
|
for (auto& loot : *building_meta->mutable_lootobj()) {
|
|
loot.set__rand_space(0);
|
|
std::vector<std::string> strings;
|
|
a8::Split(loot.things(), strings, '\n');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
assert(strings2.size() == 2);
|
|
loot.set__rand_space(
|
|
loot._rand_space() +
|
|
a8::XValue(strings2[1]).GetInt()
|
|
);
|
|
auto p = loot.add__things();
|
|
p->set_key(a8::XValue(strings2[0]));
|
|
p->set_value(loot._rand_space());
|
|
}
|
|
}
|
|
}
|
|
|
|
void MapTplThing::Init()
|
|
{
|
|
param1_int = a8::XValue(i->param1());
|
|
metatable::MapTplThingJson* mutable_i = (metatable::MapTplThingJson*)i;
|
|
if (mutable_i->object_type() == "spawn_point") {
|
|
mutable_i->set__object_type(kMOT_SpawnPoint);
|
|
} else if (mutable_i->object_type() == "monster_spawn_point") {
|
|
mutable_i->set__object_type(kMOT_MonsterSpawnPoint);
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param1(), strings, '|');
|
|
for (auto& str : strings) {
|
|
heros.push_back(a8::XValue(str));
|
|
}
|
|
} else {
|
|
mutable_i->set__object_type(kMOT_Object);
|
|
rand_space = 0;
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->things(), strings, '\n');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
assert(strings2.size() >= 2);
|
|
rand_space += a8::XValue(strings2[1]).GetInt();
|
|
int num = strings2.size() > 2 ? a8::XValue(strings2[2]).GetInt() : 1;
|
|
num = std::max(num, 1);
|
|
things.push_back(std::make_tuple(
|
|
a8::XValue(strings2[0]),
|
|
rand_space,
|
|
num
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
int MapTplThing::RandThing(int& num)
|
|
{
|
|
num = 0;
|
|
if (rand_space <= 0) {
|
|
return 0;
|
|
}
|
|
int rnd = rand() % rand_space;
|
|
for (auto& tuple : things) {
|
|
if (std::get<1>(tuple) > rnd) {
|
|
num = std::get<2>(tuple);
|
|
return std::get<0>(tuple);
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void AirRaid::Init()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->raid_wave(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
raid_waves.push_back(std::make_tuple(
|
|
a8::XValue(strings2[0]).GetInt(),
|
|
a8::XValue(strings2[1]).GetInt()
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
void AirLine::Init()
|
|
{
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->start_point(), strings, ':');
|
|
start_point_x = a8::XValue(strings[0]).GetDouble();
|
|
start_point_y = a8::XValue(strings[1]).GetDouble();
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->end_point(), strings, ':');
|
|
end_point_x = a8::XValue(strings[0]).GetDouble();
|
|
end_point_y = a8::XValue(strings[1]).GetDouble();
|
|
}
|
|
}
|
|
|
|
void Skill::Init()
|
|
{
|
|
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_list(), strings, '|');
|
|
for (auto& str : strings) {
|
|
buff_list.insert(a8::XValue(str));
|
|
}
|
|
}
|
|
{
|
|
const google::protobuf::Descriptor* descriptor = i->GetDescriptor();
|
|
const google::protobuf::Reflection* reflection = i->GetReflection();
|
|
for (int idx = 1; idx <= 100; ++idx) {
|
|
MetaData::SkillPhase phase;
|
|
{
|
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_time_offset", {idx}));
|
|
if (!field_desc) {
|
|
break;
|
|
}
|
|
phase.phase_idx = phases.size() + 1;
|
|
phase.time_offset = reflection->GetInt32(*(metatable::Skill*)i, field_desc);
|
|
}
|
|
{
|
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_func", {idx}));
|
|
phase.func_id = (SkillFunc_e)reflection->GetInt32(*(metatable::Skill*)i, field_desc);
|
|
}
|
|
{
|
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param1", {idx}));
|
|
phase.param1_str = reflection->GetString(*(metatable::Skill*)i, field_desc);
|
|
}
|
|
{
|
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param2", {idx}));
|
|
phase.param2_str = reflection->GetString(*(metatable::Skill*)i, field_desc);
|
|
}
|
|
{
|
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param3", {idx}));
|
|
phase.param3_str = reflection->GetString(*(metatable::Skill*)i, field_desc);
|
|
}
|
|
if (phase.func_id != kSkill_FuncNone) {
|
|
phase.param1 = a8::XValue(phase.param1_str);
|
|
phase.param2 = a8::XValue(phase.param2_str);
|
|
phase.param3 = a8::XValue(phase.param3_str);
|
|
phases.push_back(phase);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void Skill::Init2()
|
|
{
|
|
int skill_id = i->skill_id();
|
|
if (!(i->skill_type() == kActiveSkill || i->skill_type() == kPassiveSkill)) {
|
|
abort();
|
|
}
|
|
#if 0
|
|
if (!(i->use_method() == 1 || i->use_method() == 2 || i->use_method() == 3)) {
|
|
abort();
|
|
}
|
|
#endif
|
|
{
|
|
for (int buff_id : buff_list) {
|
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
|
|
if (!buff_meta) {
|
|
abort();
|
|
}
|
|
if (i->skill_type() == kPassiveSkill) {
|
|
if (buff_meta->i->trigger_type() != kBTT_UseSkill) {
|
|
abort();
|
|
}
|
|
}
|
|
auto itr = trigger_type_buffs.find(buff_meta->i->trigger_type());
|
|
if (itr != trigger_type_buffs.end()) {
|
|
itr->second.insert(buff_meta);
|
|
} else {
|
|
trigger_type_buffs[buff_meta->i->trigger_type()] = std::set<MetaData::Buff*>({buff_meta});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
bool Skill::IsTurnOverSkill()
|
|
{
|
|
return !phases.empty() && phases[0].func_id == kSkill_TurnOver;
|
|
}
|
|
|
|
void Buff::Init()
|
|
{
|
|
param1 = a8::XValue(i->buff_param1()).GetDouble();
|
|
param2 = a8::XValue(i->buff_param2()).GetDouble();
|
|
param3 = a8::XValue(i->buff_param3()).GetDouble();
|
|
param4 = a8::XValue(i->buff_param4()).GetDouble();
|
|
param5 = a8::XValue(i->buff_param5()).GetDouble();
|
|
int_param1 = a8::XValue(i->buff_param1());
|
|
int_param2 = a8::XValue(i->buff_param2());
|
|
int_param3 = a8::XValue(i->buff_param3());
|
|
int_param4 = a8::XValue(i->buff_param4());
|
|
int_param5 = a8::XValue(i->buff_param5());
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->child_buff(), strings, '|');
|
|
for (auto& str : strings) {
|
|
child_buff_list.push_back(a8::XValue(str));
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->immune_buffeffect_list(), strings, '|');
|
|
for (auto& str : strings) {
|
|
immune_buffeffect.insert(a8::XValue(str));
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_param1(), strings, '|');
|
|
for (auto& str : strings) {
|
|
param1_int_list.push_back(a8::XValue(str).GetInt());
|
|
param1_int_set.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_param2(), strings, '|');
|
|
if (i->buff_param2().find(":") != std::string::npos) {
|
|
abort();
|
|
}
|
|
for (auto& str : strings) {
|
|
param2_int_list.push_back(a8::XValue(str).GetInt());
|
|
param2_int_set.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_param3(), strings, '|');
|
|
for (auto& str : strings) {
|
|
param3_int_list.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_param4(), strings, '|');
|
|
for (auto& str : strings) {
|
|
param4_int_list.push_back(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->only_spec_race(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int n = a8::XValue(str);
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(only_spec_race, n);
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->exclude_spec_race(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int n = a8::XValue(str);
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(exclude_spec_race, n);
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->tag(), strings, '|');
|
|
for (auto& str : strings) {
|
|
tags.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->post_remove_action(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
if (strings2.size() >= 2) {
|
|
std::vector<std::string> strings3;
|
|
a8::Split(strings2[1], strings3, ';');
|
|
if (strings2[0] == "remove_buff_by_id" ||
|
|
strings2[0] == "remove_buff_by_effect" ||
|
|
strings2[0] == "add_buff") {
|
|
auto& action = a8::FastAppend(post_remove_action);
|
|
if (strings2[0] == "remove_buff_by_id") {
|
|
std::get<0>(action) = kRemoveBuffByIdAction;
|
|
} else if (strings2[0] == "remove_buff_by_effect") {
|
|
std::get<0>(action) = kRemoveBuffByEffectAction;
|
|
} else if (strings2[0] == "add_buff") {
|
|
std::get<0>(action) = kAddBuffAction;
|
|
}
|
|
for (auto& str3 : strings3) {
|
|
if (!str3.empty()) {
|
|
std::get<1>(action).push_back(a8::XValue(str3));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->buff_param1(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
if (strings2.size() >= 4) {
|
|
int through_wall = a8::XValue(strings2[0]);
|
|
float x = a8::XValue(strings2[1]).GetDouble();
|
|
float y = a8::XValue(strings2[2]).GetDouble();
|
|
int hero_id = a8::XValue(strings2[3]);
|
|
int num = strings2.size() > 4 ? a8::XValue(strings2[4]).GetInt() : 10000;
|
|
int life_time = strings2.size() > 5 ? a8::XValue(strings2[5]).GetInt() : 1000;
|
|
hero_infos.push_back
|
|
(
|
|
std::make_tuple(through_wall, x, y, hero_id, num, life_time)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
if (i->buff_effect() == kBET_BatchAddBuff) {
|
|
std::vector<std::string> strings1;
|
|
a8::Split(i->buff_param1(), strings1, '|');
|
|
for (auto& str1 : strings1) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str1, strings2, '|');
|
|
for (auto& str2 : strings2) {
|
|
if (str2.size() < 1) {
|
|
abort();
|
|
}
|
|
auto& p = a8::FastAppend(batch_add_list);
|
|
if (str2[0] != '!') {
|
|
//概率
|
|
std::vector<std::string> strings3;
|
|
a8::Split(str2, strings3, ':');
|
|
if (strings3.size() != 2) {
|
|
abort();
|
|
}
|
|
if (a8::XValue(strings3[1]).GetInt() <= 0) {
|
|
abort();
|
|
}
|
|
std::get<0>(p) = -1;
|
|
std::get<1>(p).push_back
|
|
(
|
|
std::make_tuple(a8::XValue(strings3[0]),
|
|
a8::XValue(strings3[1]))
|
|
);
|
|
} else {
|
|
//权重
|
|
std::vector<std::string> strings3;
|
|
a8::Split(str2, strings3, '$');
|
|
int rand_space = 0;
|
|
for (const std::string& str3 : strings3) {
|
|
std::vector<std::string> strings4;
|
|
a8::Split(str3, strings4, ':');
|
|
if (strings4.size() != 2) {
|
|
abort();
|
|
}
|
|
std::string tmp_str = strings4[0];
|
|
a8::ReplaceString(tmp_str, "!", "");
|
|
int buff_id = a8::XValue(tmp_str);
|
|
int weight = a8::XValue(strings4[1]);
|
|
if (weight <= 0) {
|
|
abort();
|
|
}
|
|
|
|
rand_space += weight;
|
|
std::get<1>(p).push_back
|
|
(
|
|
std::make_tuple(buff_id,
|
|
rand_space)
|
|
);
|
|
}
|
|
std::get<0>(p) = rand_space;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (i->buff_effect() == kBET_CondAddBuff) {
|
|
if (!IsValidCondBuff(int_param1)) {
|
|
abort();
|
|
}
|
|
}
|
|
}
|
|
|
|
void Buff::Init2()
|
|
{
|
|
switch (i->buff_effect()) {
|
|
case kBET_ChgAttr:
|
|
{
|
|
assert(int_param2 == 1 || int_param2 == 2);
|
|
if (int_param2 == 2) {
|
|
if (i->buff_param3().find('.') != std::string::npos) {
|
|
abort();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case kBET_SummonHero:
|
|
{
|
|
for (auto& info : hero_infos) {
|
|
int hero_id = std::get<3>(info);
|
|
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id);
|
|
if (!hero_meta) {
|
|
abort();
|
|
}
|
|
MetaData::AI* ai_meta = MetaMgr::Instance()->GetHeroAI(hero_meta->i->ai());
|
|
if (!ai_meta) {
|
|
abort();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case kBET_DelayAddBuff:
|
|
{
|
|
assert(param1 < i->duration_time());
|
|
if (!MetaMgr::Instance()->GetBuff(int_param2)) {
|
|
abort();
|
|
}
|
|
}
|
|
break;
|
|
case kBET_IntervalAddBuff:
|
|
{
|
|
assert(int_param1 < i->duration_time() * 1000);
|
|
if (!MetaMgr::Instance()->GetBuff(int_param2)) {
|
|
abort();
|
|
}
|
|
}
|
|
break;
|
|
case kBET_BatchAddBuff:
|
|
{
|
|
for (auto& tuple : batch_add_list) {
|
|
int rand_space = std::get<0>(tuple);
|
|
const auto& items = std::get<1>(tuple);
|
|
if (rand_space == -1) {
|
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(std::get<0>(items[0]));
|
|
if (!buff_meta) {
|
|
abort();
|
|
}
|
|
} else {
|
|
for (const auto& item : items) {
|
|
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(std::get<0>(item));
|
|
if (!buff_meta) {
|
|
abort();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
default:
|
|
{
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
bool Buff::EffectCanStack()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool Buff::IsImmuneBuffEffect(int buff_effect)
|
|
{
|
|
return immune_buffeffect.find(buff_effect) != immune_buffeffect.end();
|
|
}
|
|
|
|
bool Buff::Match(CondAddBuff_e cond, int val)
|
|
{
|
|
switch (cond) {
|
|
case kCondBuffUpdateBuffId:
|
|
{
|
|
return val == i->buff_id();
|
|
}
|
|
break;
|
|
case kCondBuffUpdateBuffEffect:
|
|
{
|
|
return val == i->buff_effect();
|
|
}
|
|
break;
|
|
default:
|
|
{
|
|
return false;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Dress::Init()
|
|
{
|
|
for (int j = 0; j < i->max_lv(); ++j) {
|
|
std::array<float, kHAT_End>& attrs = a8::FastAppend(level_attrs);
|
|
for (size_t k = 0; k < kHAT_End; ++k) {
|
|
attrs[k] = 0;
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->attr_type(), strings, '|');
|
|
for (auto& str : strings) {
|
|
std::vector<std::string> strings2;
|
|
a8::Split(str, strings2, ':');
|
|
if (strings2.size() != 3) {
|
|
abort();
|
|
}
|
|
int attr_type = a8::XValue(strings2[0]);
|
|
int attr_level = a8::XValue(strings2[1]);
|
|
float attr_value = a8::XValue(strings2[2]).GetDouble();
|
|
if (attr_type < kHAT_End) {
|
|
if (attr_level >= 0 && attr_level < i->max_lv()) {
|
|
for (int j = 1; j < i->max_lv(); ++j) {
|
|
if (j % attr_type == 0) {
|
|
level_attrs[j][attr_type] = attr_value * (j / attr_level);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
float Dress::GetAttrValue(int level, int attr_type)
|
|
{
|
|
if (level < 1) {
|
|
return 0;
|
|
}
|
|
if (level > (int)level_attrs.size()) {
|
|
return 0;
|
|
}
|
|
if (attr_type < kHAT_End) {
|
|
return level_attrs[level][attr_type];
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void RankReward::Init()
|
|
{
|
|
}
|
|
|
|
void AI::Init()
|
|
{
|
|
param1 = a8::XValue(i->param1()).GetDouble();
|
|
param2 = a8::XValue(i->param2()).GetDouble();
|
|
param3 = a8::XValue(i->param3()).GetDouble();
|
|
param4 = a8::XValue(i->param4()).GetDouble();
|
|
param5 = a8::XValue(i->param5()).GetDouble();
|
|
int_param1 = a8::XValue(i->param1());
|
|
int_param2 = a8::XValue(i->param2());
|
|
int_param3 = a8::XValue(i->param3());
|
|
int_param4 = a8::XValue(i->param4());
|
|
int_param5 = a8::XValue(i->param5());
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param1(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int_list_param1.push_back(a8::XValue(str).GetInt());
|
|
int_set_param1.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param2(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int_list_param2.push_back(a8::XValue(str).GetInt());
|
|
int_set_param2.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param3(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int_list_param3.push_back(a8::XValue(str).GetInt());
|
|
int_set_param3.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param4(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int_list_param4.push_back(a8::XValue(str).GetInt());
|
|
int_set_param4.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->param5(), strings, '|');
|
|
for (auto& str : strings) {
|
|
int_list_param5.push_back(a8::XValue(str).GetInt());
|
|
int_set_param5.insert(a8::XValue(str).GetInt());
|
|
}
|
|
}
|
|
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->random_move_idle_time(), strings, ';');
|
|
if (!i->random_move_idle_time().empty()) {
|
|
random_move_idle_time_ = std::make_tuple
|
|
(
|
|
a8::XValue(strings[0]).GetInt(),
|
|
a8::XValue(strings[1]).GetInt()
|
|
);
|
|
} else {
|
|
random_move_idle_time_ = std::make_tuple
|
|
(
|
|
2,
|
|
3
|
|
);
|
|
}
|
|
}
|
|
{
|
|
std::vector<std::string> strings;
|
|
a8::Split(i->random_move_time(), strings, ';');
|
|
if (!i->random_move_time().empty()) {
|
|
random_move_time_ = std::make_tuple
|
|
(
|
|
a8::XValue(strings[0]).GetInt(),
|
|
a8::XValue(strings[1]).GetInt()
|
|
);
|
|
} else {
|
|
random_move_time_ = std::make_tuple
|
|
(
|
|
3,
|
|
5
|
|
);
|
|
}
|
|
}
|
|
if (i->ai_kind() == kAI_MineSweeper) {
|
|
for (int n : int_list_param2) {
|
|
if (n <= 0 || n > 63) {
|
|
abort();
|
|
}
|
|
a8::SetBitFlag(bits_param2, n);
|
|
}
|
|
}
|
|
}
|
|
|
|
void AI::Init2()
|
|
{
|
|
|
|
}
|
|
|
|
int AI::GetMoveIdleTime()
|
|
{
|
|
return a8::RandEx(
|
|
std::get<0>(random_move_idle_time_),
|
|
std::get<1>(random_move_idle_time_)
|
|
);
|
|
}
|
|
|
|
int AI::GetMoveTime()
|
|
{
|
|
return a8::RandEx(
|
|
std::get<0>(random_move_time_),
|
|
std::get<1>(random_move_time_)
|
|
);
|
|
}
|
|
|
|
void SafeAreaPos::Init()
|
|
{
|
|
std::vector<a8::Vec2> tmp_list;
|
|
{
|
|
tmp_list.push_back(a8::Vec2(i->x1(), i->y1()));
|
|
tmp_list.push_back(a8::Vec2(i->x2(), i->y2()));
|
|
tmp_list.push_back(a8::Vec2(i->x3(), i->y3()));
|
|
tmp_list.push_back(a8::Vec2(i->x4(), i->y4()));
|
|
tmp_list.push_back(a8::Vec2(i->x5(), i->y5()));
|
|
tmp_list.push_back(a8::Vec2(i->x6(), i->y6()));
|
|
tmp_list.push_back(a8::Vec2(i->x7(), i->y7()));
|
|
tmp_list.push_back(a8::Vec2(i->x8(), i->y8()));
|
|
tmp_list.push_back(a8::Vec2(i->x9(), i->y9()));
|
|
tmp_list.push_back(a8::Vec2(i->x10(), i->y10()));
|
|
}
|
|
for (auto& pos : tmp_list) {
|
|
if (pos.x < 1.0f || pos.y < 1.0f) {
|
|
break;
|
|
}
|
|
poses.push_back(pos);
|
|
}
|
|
}
|
|
|
|
void SafeAreaPos::Init2()
|
|
{
|
|
|
|
}
|
|
|
|
}
|