2019-11-20 15:49:25 +08:00

184 lines
3.4 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;
void Init();
std::string RandTemplate();
};
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 = {};
void Init();
};
struct EquipUpgrade
{
const metatable::EquipUpgrade* i = nullptr;
void Init();
float GetAttrValue(int level, int attr_type);
private:
std::vector<std::array<float, EA_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();
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 Skill
{
const metatable::Skill* i = nullptr;
void Init();
float value1 = 0.0f;
float value2 = 0.0f;
float area = 0.0f;
int last_time = 0;
};
struct Dress
{
const metatable::Dress* i = nullptr;
void Init();
float GetAttrValue(int level, int attr_type);
private:
std::vector<std::array<float, EA_End>> level_attrs;
};
struct RankReward
{
const metatable::RankReward* i = nullptr;
};
struct KillReward
{
const metatable::KillReward* i = nullptr;
};
struct RankPoint
{
const metatable::RankPoint* i = nullptr;
};
struct KillPoint
{
const metatable::KillPoint* i = nullptr;
};
}