2020-12-08 11:15:16 +08:00

181 lines
3.8 KiB
C++
Executable File

#pragma once
namespace MetaData
{
struct Map;
struct SafeArea;
struct Equip;
struct EquipUpgrade;
struct MapTplThing;
}
namespace cs
{
class MFWeapon;
class MFSkin;
}
struct GasData
{
GasMode_e gas_mode = GasInactive;
a8::Vec2 pos_old;
a8::Vec2 pos_old_bk;
a8::Vec2 pre_pos_old;
a8::Vec2 pos_new;
float rad_old = 0.0f;
float rad_new = 0.0f;
float gas_progress = 0.0f;
long long gas_start_frameno = 0;
MetaData::SafeArea* old_area_meta = nullptr;
MetaData::SafeArea* new_area_meta = nullptr;
bool is_last_gas = false;
};
struct Weapon
{
int weapon_idx = 0;
int weapon_id = 0;
int weapon_lv = 0;
int ammo = 0;
MetaData::Equip* meta = nullptr;
MetaData::Equip* bullet_meta = nullptr;
void ToPB(cs::MFWeapon* pb_obj);
void Recalc();
int GetClipVolume();
float GetAttrValue(HumanAttrType_e attr_type);
MetaData::EquipUpgrade* GetUpgradeMeta() { return upgrade_meta;}
private:
MetaData::EquipUpgrade* upgrade_meta = nullptr;
};
struct Skin
{
int tank_uniid = 0;
int skin_id = 0;
int skin_lv = 0;
void ToPB(cs::MFSkin* pb_obj);
};
struct PlayerStats
{
int kills = 0;
long long last_kill_frameno = 0;
int damage_amount_in = 0;
int damage_amount_out = 0;
int heal_amount = 0;
int rescue_member = 0;
int rescue_guild_member = 0;
int history_time_alive = 0;
int history_kills = 0;
int history_damage_amount = 0;
int history_heal_amount = 0;
int gold = 0;
int score = 0;
std::vector<std::pair<int, int>> items;
int pass_score = 0;
int rank_score = 0;
std::vector<std::pair<int, int>> extra_drop;
int killer_id = 0;
std::string killer_name;
int weapon_id = 0;
int rank = 0;
int use_skill_times = 0;
int dead_times = 0;
};
struct CarObject
{
int car_id = 0;
a8::Vec2 pos;
bool taken = false;
};
struct HumanCar
{
int car_id = 0;
int car_uniid = 0;
MetaData::Equip* meta = nullptr;
};
struct BornPoint
{
MetaData::MapTplThing* thing_tpl = nullptr;
int player_num = 0;
int android_num = 0;
a8::Vec2 RandPoint() const;
};
struct HumanAbility
{
float hp = 0.0f;
float max_hp = 0.0f;
float hp_recover = 0.0f;
float atk = 0.0f;
float def = 0.0f;
float speed = 0.0f;
float shot_range = 0.0f;
float shot_speed = 0.0f;
float reload_speed = 0.0f;
float fire_rate = 0.0f;
};
struct ObstacleData
{
int flags = 0;
float health = 0.0f;
bool dead = false;
long long dead_frameno = 0;
int door_open_times = 0;
DoorState_e door_state = DoorStateClose;
};
#pragma pack(1)
struct ObjectSyncFlags
{
unsigned char flags = 0;
unsigned char last_sync_frameno = 0;
};
#pragma pack()
class GridService;
class MapService;
class Building;
struct RoomInitInfo
{
int room_idx = 0;
RoomMode_e room_mode = kChiJiMode;
long long room_uuid = 0;
RoomType_e room_type = RT_NewBrid;
int creator_game_times = 0;
int creator_register_time = 0;
int creator_proto_version = 0;
int creator_channel = 0;
bool force_entry_newbie_room = false;
int init_map_id = 0;
const MetaData::Map* map_meta = nullptr;
std::string map_tpl_name;
GridService* grid_service = nullptr;
MapService* map_service = nullptr;
const std::vector<MetaData::MapTplThing*>* mini_room_spawn_points = nullptr;
const std::vector<MetaData::MapTplThing*>* normal_room_spawn_points = nullptr;
const MetaData::MapTplThing* level0room_born_point_meta = nullptr;
const MetaData::MapTplThing* level1room_born_point_meta = nullptr;
const std::vector<MetaData::MapTplThing*>* loots = nullptr;
const std::vector<Building*>* buildings = nullptr;
const std::vector<MetaData::MapTplThing*>* level0room_spec_things = nullptr;
};