365 lines
8.6 KiB
C++
365 lines
8.6 KiB
C++
#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;
|
|
std::vector<int> airraids;
|
|
int refresh_robot_min_num = 0;
|
|
int refresh_robot_max_num = 0;
|
|
int refresh_robot_min_time = 0;
|
|
int refresh_robot_max_time = 0;
|
|
std::vector<int> buff_list;
|
|
a8::Vec2 first_safearea_center;
|
|
std::map<int, int> car_num_limit;
|
|
std::vector<int> safearea_list;
|
|
|
|
void Init();
|
|
void Init2();
|
|
std::string RandTemplate();
|
|
int GetCarLimit(int car_id);
|
|
a8::Vec2 GetCenter() const;
|
|
int RandSafeArea() const;
|
|
};
|
|
|
|
struct Attr
|
|
{
|
|
const metatable::Attr* i = nullptr;
|
|
};
|
|
|
|
struct MapThing
|
|
{
|
|
const metatable::MapThing* i = nullptr;
|
|
std::vector<int> buff_list;
|
|
std::vector<int> airdrop_mon_list;
|
|
long long special_damage_type = 0;
|
|
long long receive_special_damage_type = 0;
|
|
int int_param1 = 0;
|
|
float float_param1 = 0;
|
|
int int_param2 = 0;
|
|
float float_param2 = 0;
|
|
long long sweep_tags = 0;
|
|
std::vector<int> param2_list;
|
|
std::vector<std::tuple<int, int>> preexplosion_summon;
|
|
std::vector<std::tuple<int, int>> drop;
|
|
bool HasDrop() { return !drop.empty();};
|
|
|
|
void Init();
|
|
int RandDrop();
|
|
};
|
|
|
|
struct SafeArea
|
|
{
|
|
const metatable::SafeArea* i = nullptr;
|
|
};
|
|
|
|
struct SafeAreaPos
|
|
{
|
|
const metatable::SafeAreaPos* i = nullptr;
|
|
std::vector<a8::Vec2> poses;
|
|
|
|
void Init();
|
|
void Init2();
|
|
};
|
|
|
|
struct Item
|
|
{
|
|
const metatable::Item* i = nullptr;
|
|
};
|
|
|
|
struct Buff;
|
|
struct Equip
|
|
{
|
|
const metatable::Equip* i = nullptr;
|
|
|
|
int lock_time = 0;
|
|
//0,0,0,0,后座力
|
|
std::vector<std::tuple<float, float, float, int, int>> bullet_born_offset;
|
|
std::vector<std::tuple<int, a8::Vec2>> shoot_offsets;
|
|
std::array<int, IS_END> volume = {};
|
|
int int_param1 = 0;
|
|
float float_param1 = 0;
|
|
int int_param2 = 0;
|
|
float float_param2 = 0;
|
|
std::vector<std::tuple<int, int, int>> power_charge;
|
|
MetaData::Buff* buff_meta = nullptr;
|
|
std::vector<std::tuple<float, int>> car_buff_list;
|
|
int car_active_buff_id = 0;
|
|
int car_deactive_buff_id = 0;
|
|
long long special_damage_type = 0;
|
|
int group_id = 0;
|
|
|
|
void Init();
|
|
void Init2();
|
|
int GetWeaponIdx();
|
|
bool Match(CondAddBuff_e cond, int val, int val2);
|
|
};
|
|
|
|
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 = {};
|
|
std::vector<int> init_buffs;
|
|
std::vector<std::tuple<int, int>> dead_drop;
|
|
bool HasDrop() { return !dead_drop.empty();};
|
|
|
|
void Init();
|
|
int RandDrop();
|
|
};
|
|
|
|
struct PlayerSkin
|
|
{
|
|
const metatable::PlayerSkin* i = nullptr;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct Robot
|
|
{
|
|
const metatable::Robot* i = nullptr;
|
|
|
|
void Init();
|
|
std::vector<int> skin_id;
|
|
};
|
|
|
|
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(int& num);
|
|
|
|
std::vector<std::tuple<int, int, int>> things;
|
|
std::vector<int> heros;
|
|
int param1_int = 0;
|
|
int rand_space = 0;
|
|
};
|
|
|
|
struct AirDrop
|
|
{
|
|
const metatable::AirDrop* i = nullptr;
|
|
|
|
void Init();
|
|
};
|
|
|
|
struct AirRaid
|
|
{
|
|
const metatable::AirRaid* i = nullptr;
|
|
std::vector<std::tuple<int, int>> raid_waves;
|
|
std::vector<int> bomb_ids;
|
|
|
|
void Init();
|
|
};
|
|
|
|
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();
|
|
void Init2();
|
|
bool EffectCanStack();
|
|
bool IsImmuneBuffEffect(int buff_effect);
|
|
bool Match(CondAddBuff_e cond, int val);
|
|
|
|
float param1 = 0.0f;
|
|
float param2 = 0.0f;
|
|
float param3 = 0.0f;
|
|
float param4 = 0.0f;
|
|
float param5 = 0.0f;
|
|
int int_param1 = 0;
|
|
int int_param2 = 0;
|
|
int int_param3 = 0;
|
|
int int_param4 = 0;
|
|
int int_param5 = 0;
|
|
std::vector<int> param1_int_list;
|
|
std::vector<int> param2_int_list;
|
|
std::set<int> param1_int_set;
|
|
std::set<int> param2_int_set;
|
|
std::vector<int> param3_int_list;
|
|
std::vector<int> param4_int_list;
|
|
std::vector<std::tuple<int, std::vector<std::tuple<int, int>>>> batch_add_list;
|
|
std::vector<std::tuple<int, std::vector<int>>> post_remove_action;
|
|
std::set<int> immune_buffeffect;
|
|
std::vector<std::tuple<int, float, float, int, int, int>> hero_infos;
|
|
std::set<int> tags;
|
|
long long only_spec_race = 0;
|
|
long long exclude_spec_race = 0;
|
|
|
|
std::vector<int> child_buff_list;
|
|
};
|
|
|
|
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();
|
|
void Init2();
|
|
|
|
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;
|
|
bool IsTurnOverSkill();
|
|
};
|
|
|
|
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();
|
|
void Init2();
|
|
int GetMoveIdleTime();
|
|
int GetMoveTime();
|
|
|
|
float param1 = 0.0f;
|
|
float param2 = 0.0f;
|
|
float param3 = 0.0f;
|
|
float param4 = 0.0f;
|
|
float param5 = 0.0f;
|
|
int int_param1 = 0;
|
|
int int_param2 = 0;
|
|
int int_param3 = 0;
|
|
int int_param4 = 0;
|
|
int int_param5 = 0;
|
|
std::vector<int> int_list_param1;
|
|
std::vector<int> int_list_param2;
|
|
std::vector<int> int_list_param3;
|
|
std::vector<int> int_list_param4;
|
|
std::vector<int> int_list_param5;
|
|
std::set<int> int_set_param1;
|
|
std::set<int> int_set_param2;
|
|
std::set<int> int_set_param3;
|
|
std::set<int> int_set_param4;
|
|
std::set<int> int_set_param5;
|
|
|
|
long long bits_param2 = 0;
|
|
|
|
private:
|
|
std::tuple<int, int> random_move_idle_time_;
|
|
std::tuple<int, int> random_move_time_;
|
|
|
|
};
|
|
|
|
}
|