266 lines
5.2 KiB
C++
Executable File
266 lines
5.2 KiB
C++
Executable File
#pragma once
|
|
|
|
#include "metatable.pb.h"
|
|
|
|
namespace MetaData
|
|
{
|
|
|
|
struct Parameter
|
|
{
|
|
const metatable::Parameter* i = nullptr;
|
|
|
|
int int_val = 0;
|
|
std::string str_val;
|
|
double float_val = 0.0f;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct Map
|
|
{
|
|
const metatable::Map* i = nullptr;
|
|
|
|
std::vector<std::tuple<std::string, int>> template_list;
|
|
int rand_space = 0;
|
|
std::vector<int> airdrops;
|
|
|
|
void Init();
|
|
std::string RandTemplate();
|
|
};
|
|
|
|
struct Attr
|
|
{
|
|
const metatable::Attr* i = nullptr;
|
|
};
|
|
|
|
struct MapThing
|
|
{
|
|
const metatable::MapThing* i = nullptr;
|
|
};
|
|
|
|
struct SafeArea
|
|
{
|
|
const metatable::SafeArea* i = nullptr;
|
|
};
|
|
|
|
struct Item
|
|
{
|
|
const metatable::Item* i = nullptr;
|
|
};
|
|
|
|
struct Equip
|
|
{
|
|
const metatable::Equip* i = nullptr;
|
|
|
|
std::vector<std::tuple<float, float, float>> bullet_born_offset;
|
|
std::array<int, IS_END> volume = {};
|
|
int int_param1 = 0;
|
|
float float_param1 = 0;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct EquipUpgrade
|
|
{
|
|
const metatable::EquipUpgrade* i = nullptr;
|
|
|
|
void Init();
|
|
float GetAttrValue(int level, int attr_type);
|
|
|
|
private:
|
|
std::vector<std::array<float, kHAT_End>> level_attrs;
|
|
};
|
|
|
|
struct Player
|
|
{
|
|
const metatable::Player* i = nullptr;
|
|
|
|
std::array<int, IS_END> volume = {};
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct Robot
|
|
{
|
|
const metatable::Robot* i = nullptr;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct Building
|
|
{
|
|
struct Door
|
|
{
|
|
int door_id = 0;
|
|
a8::Vec2 state0_dir;
|
|
a8::Vec2 state1_dir;
|
|
const metatable::DoorObjJson* state0 = nullptr;
|
|
const metatable::DoorObjJson* state1 = nullptr;
|
|
};
|
|
|
|
const metatable::BuildingJson* i = nullptr;
|
|
|
|
std::vector<Door> doors;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct Drop
|
|
{
|
|
const metatable::Drop* i = nullptr;
|
|
|
|
void Init();
|
|
//0:item_id 1:item_num 2:weight
|
|
void RandItems(std::vector<std::tuple<int, int, int>>& drop_items);
|
|
|
|
private:
|
|
std::vector<std::tuple<std::vector<int>, std::vector<int>, std::vector<int>, int>> items;
|
|
int total_weight = 0;
|
|
};
|
|
|
|
struct MapTplThing
|
|
{
|
|
const metatable::MapTplThingJson* i = nullptr;
|
|
|
|
void Init();
|
|
int RandThing();
|
|
|
|
std::vector<std::tuple<int, int>> things;
|
|
int rand_space = 0;
|
|
};
|
|
|
|
struct AirDrop
|
|
{
|
|
const metatable::AirDrop* i = nullptr;
|
|
};
|
|
|
|
struct AirLine
|
|
{
|
|
const metatable::AirLine* i = nullptr;
|
|
|
|
float start_point_x = 0.0f;
|
|
float start_point_y = 0.0f;
|
|
|
|
float end_point_x = 0.0f;
|
|
float end_point_y = 0.0f;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct Buff
|
|
{
|
|
const metatable::Buff* i = nullptr;
|
|
|
|
void Init();
|
|
bool EffectCanStack();
|
|
bool IsImmuneBuffEffect(int buff_effect);
|
|
|
|
float param1 = 0.0f;
|
|
float param2 = 0.0f;
|
|
float param3 = 0.0f;
|
|
float param4 = 0.0f;
|
|
std::set<int> immune_buffeffect;
|
|
};
|
|
|
|
struct SkillPhase
|
|
{
|
|
int phase_idx = 0;
|
|
int time_offset = 0;
|
|
SkillFunc_e func_id = kSkill_FuncNone;
|
|
a8::XValue param1;
|
|
a8::XValue param2;
|
|
a8::XValue param3;
|
|
|
|
std::string param1_str;
|
|
std::string param2_str;
|
|
std::string param3_str;
|
|
};
|
|
|
|
struct Skill
|
|
{
|
|
const metatable::Skill* i = nullptr;
|
|
|
|
void Init();
|
|
|
|
float value_up = 0.0f;
|
|
std::set<int> buff_list;
|
|
std::map<int, std::set<MetaData::Buff*>> trigger_type_buffs;
|
|
std::vector<MetaData::SkillPhase> phases;
|
|
};
|
|
|
|
struct Dress
|
|
{
|
|
const metatable::Dress* i = nullptr;
|
|
|
|
void Init();
|
|
float GetAttrValue(int level, int attr_type);
|
|
|
|
private:
|
|
std::vector<std::array<float, kHAT_End>> level_attrs;
|
|
};
|
|
|
|
struct RankReward
|
|
{
|
|
const metatable::RankReward* i = nullptr;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct KillReward
|
|
{
|
|
const metatable::KillReward* i = nullptr;
|
|
};
|
|
|
|
struct RankPoint
|
|
{
|
|
const metatable::RankPoint* i = nullptr;
|
|
};
|
|
|
|
struct KillPoint
|
|
{
|
|
const metatable::KillPoint* i = nullptr;
|
|
};
|
|
|
|
struct AI
|
|
{
|
|
const metatable::AI* i = nullptr;
|
|
void Init();
|
|
int GetMoveIdleTime();
|
|
int GetMoveTime();
|
|
|
|
private:
|
|
std::tuple<int, int> random_move_idle_time_;
|
|
std::tuple<int, int> random_move_time_;
|
|
|
|
};
|
|
|
|
struct Talent
|
|
{
|
|
const metatable::Talent* i = nullptr;
|
|
void Init();
|
|
int GetId();
|
|
int GetEquipLabel();
|
|
int GetHpPlus();
|
|
int GetAtkPlus();
|
|
|
|
private:
|
|
int talentid = 0;
|
|
int equiplabel = 0;
|
|
int hpplus = 0;
|
|
int atkplus = 0;
|
|
};
|
|
|
|
struct Fashion
|
|
{
|
|
const metatable::Fashion* i = nullptr;
|
|
void Init();
|
|
bool CheckFashion(const std::map<int, int> &skins);
|
|
void GetAttr(std::array<float, kHAT_End> &attarr);
|
|
|
|
private:
|
|
int fashionid = 0;
|
|
std::array<float, kHAT_End> attr_abs = {};
|
|
std::vector<int> fashion_details = {};
|
|
};
|
|
}
|