aozhiwei d9cd3f00be 1
2019-07-19 20:44:38 +08:00

203 lines
3.8 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;
void Init();
};
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 BulletBornPoint
{
a8::Vec2 born_offset;
float angle = 0.0f;
};
struct Equip
{
const metatable::Equip* i = nullptr;
std::vector<std::tuple<int, std::vector<BulletBornPoint>>> bullet_born_offset;
std::array<int, IS_END> volume = {};
void Init();
bool CanDrop();
bool NeedTrace();
};
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;
std::vector<float> born_angle;
int rand_space = 0;
};
struct Buff
{
const metatable::Buff* i = nullptr;
void Init();
bool EffectCanStack();
float param1 = 0.0f;
float param2 = 0.0f;
float param3 = 0.0f;
float param4 = 0.0f;
};
struct SkillPhase
{
int phase_idx = 0;
int time_offset = 0;
SkillFunc_e func_id = Skill_FuncNone;
a8::XValue param1;
a8::XValue param2;
std::string param1_str;
std::string param2_str;
};
struct Skill
{
const metatable::Skill* i = nullptr;
void Init();
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, EA_End>> level_attrs;
};
struct RankReward
{
const metatable::RankReward* i = nullptr;
};
struct KillReward
{
const metatable::KillReward* i = nullptr;
};
struct Driver
{
const metatable::Driver* i = nullptr;
void Init();
std::map<int, std::tuple<float, int>> attr_up;
std::map<int, std::tuple<float, int>> passive_skill_attr;
};
struct Tank
{
const metatable::Tank* i = nullptr;
void Init();
std::map<int, float> attr_init;
std::map<int, std::tuple<float, int>> attr_up;
};
struct TankSkin
{
const metatable::TankSkin* i = nullptr;
};
}