This commit is contained in:
aozhiwei 2022-12-26 16:34:48 +08:00
parent 79cace8b7b
commit 87fa593a36
18 changed files with 62 additions and 52 deletions

View File

@ -94,8 +94,8 @@ namespace mt
shot_speed_ /= 20.0f; shot_speed_ /= 20.0f;
aiming_speed_ /= 20.0f; aiming_speed_ /= 20.0f;
move_speed4_ /= 20.0f; move_speed4_ /= 20.0f;
reload_speed_ / 20.0f; reload_speed_ /= 20.0f;
useitem_speed_ / 20.0f; useitem_speed_ /= 20.0f;
} }
} }
} }

View File

@ -1,6 +1,7 @@
#include "precompile.h" #include "precompile.h"
#include "mt/Map.h" #include "mt/Map.h"
#include "mt/SafeArea.h"
IMPL_TABLE(mt::Map) IMPL_TABLE(mt::Map)
@ -124,12 +125,10 @@ namespace mt
if (!IsPveMap() && safearea_list.empty()) { if (!IsPveMap() && safearea_list.empty()) {
A8_ABORT(); A8_ABORT();
} }
for (int area_type : safearea_list) { for (const int area_type : safearea_list) {
#if 0 if (!mt::SafeArea::GetByType(area_type)) {
if (!MetaMgr::Instance()->GetSafeAreaByType(area_type)) {
A8_ABORT(); A8_ABORT();
} }
#endif
} }
} }
} }

View File

@ -91,6 +91,9 @@ namespace mt
[dir] () [dir] ()
{ {
f8::ReadCsvMetaFile(dir + T::table_name, T::raw_list); f8::ReadCsvMetaFile(dir + T::table_name, T::raw_list);
T dummy;
a8::reflect::Class* cls = dummy.GetClass();
a8::reflect::Field* pk_field = cls->GetFieldByName(T::prim_key);
int id = 0; int id = 0;
for (auto item : T::raw_list) { for (auto item : T::raw_list) {
switch (T::table_type) { switch (T::table_type) {
@ -101,13 +104,21 @@ namespace mt
break; break;
case 1: case 1:
{ {
long long key = 0.0f; long long key = cls->GetFieldValueAsInt64
(
pk_field,
(((char*)item)) + pk_field->offset
);
T::id_hash[key] = item; T::id_hash[key] = item;
} }
break; break;
case 2: case 2:
{ {
std::string key = ""; std::string key = cls->GetFieldValueAsString
(
pk_field,
(((char*)item)) + pk_field->offset
);
T::name_hash[key] = item; T::name_hash[key] = item;
} }
break; break;

View File

@ -59,7 +59,7 @@ namespace mtb
std::string random_move_idle_time_; std::string random_move_idle_time_;
std::string random_move_time_; std::string random_move_time_;
int attack_range_ = 0; int attack_range_ = 0;
int attack_rate_ = 0.0f; float attack_rate_ = 0.0f;
int ai_mode_ = 0; int ai_mode_ = 0;
int ai_kind_ = 0; int ai_kind_ = 0;
std::string param1_; std::string param1_;

View File

@ -29,7 +29,7 @@ namespace mtb
int id_ = 0; int id_ = 0;
std::string start_point_; std::string start_point_;
std::string end_point_; std::string end_point_;
int plane_speed_ = 0.0f; float plane_speed_ = 0.0f;
int weight_ = 0; int weight_ = 0;
int map_id_ = 0; int map_id_ = 0;

View File

@ -31,7 +31,7 @@ namespace mtb
int appear_time_ = 0; int appear_time_ = 0;
std::string bomb_id_; std::string bomb_id_;
std::string raid_wave_; std::string raid_wave_;
int rad_ = 0.0f; float rad_ = 0.0f;
public: public:
std::bitset<6> __flags__; std::bitset<6> __flags__;

View File

@ -86,8 +86,8 @@ namespace mtb
std::string buff_param3_; std::string buff_param3_;
std::string buff_param4_; std::string buff_param4_;
std::string buff_param5_; std::string buff_param5_;
int duration_time_ = 0.0f; float duration_time_ = 0.0f;
int buff_valueup_ = 0.0f; float buff_valueup_ = 0.0f;
std::string immune_buffeffect_list_; std::string immune_buffeffect_list_;
std::string post_remove_action_; std::string post_remove_action_;
int only_server_ = 0; int only_server_ = 0;

View File

@ -167,17 +167,17 @@ namespace mtb
int group_num_ = 0; int group_num_ = 0;
int is_luck_ = 0; int is_luck_ = 0;
std::string bullet_born_offset_; std::string bullet_born_offset_;
int bullet_angle_ = 0.0f; float bullet_angle_ = 0.0f;
std::string name_; std::string name_;
int rad_ = 0.0f; float rad_ = 0.0f;
int rad2_ = 0.0f; float rad2_ = 0.0f;
int buffid_ = 0; int buffid_ = 0;
int drop_id_ = 0; int drop_id_ = 0;
int explosion_effect_ = 0; int explosion_effect_ = 0;
std::string param1_; std::string param1_;
std::string param2_; std::string param2_;
int reloadtype_ = 0; int reloadtype_ = 0;
int recoil_force_ = 0.0f; float recoil_force_ = 0.0f;
int missiles_time_ = 0; int missiles_time_ = 0;
int heroid_ = 0; int heroid_ = 0;
std::string launch_dev_; std::string launch_dev_;
@ -187,9 +187,9 @@ namespace mtb
int through_teammate_ = 0; int through_teammate_ = 0;
std::string text_icon_; std::string text_icon_;
std::string special_damage_type_; std::string special_damage_type_;
int max_oil_ = 0.0f; float max_oil_ = 0.0f;
int average_oil_ = 0.0f; float average_oil_ = 0.0f;
int atk_mech_ = 0.0f; float atk_mech_ = 0.0f;
int use_scene_ = 0; int use_scene_ = 0;
int ispenetrate_ = 0; int ispenetrate_ = 0;
int is_penetrate_thing_ = 0; int is_penetrate_thing_ = 0;
@ -202,8 +202,8 @@ namespace mtb
int bullet_consume_type_ = 0; int bullet_consume_type_ = 0;
std::string inventory_slot_; std::string inventory_slot_;
int _inventory_slot_ = 0; int _inventory_slot_ = 0;
int critical_ = 0.0f; float critical_ = 0.0f;
int cri_damage_ = 0.0f; float cri_damage_ = 0.0f;
int shootfire_ = 0; int shootfire_ = 0;
std::string hit_buff_; std::string hit_buff_;
int auto_trace_ = 0; int auto_trace_ = 0;

View File

@ -26,12 +26,12 @@ namespace mtb
protected: protected:
int top_ = 0.0f; float top_ = 0.0f;
int ranked_topx_ = 0.0f; float ranked_topx_ = 0.0f;
int kills_topx_ = 0.0f; float kills_topx_ = 0.0f;
int hero_topx_ = 0.0f; float hero_topx_ = 0.0f;
int weapon_topx_ = 0.0f; float weapon_topx_ = 0.0f;
int survival_topx_ = 0.0f; float survival_topx_ = 0.0f;
public: public:
std::bitset<6> __flags__; std::bitset<6> __flags__;

View File

@ -19,7 +19,7 @@ namespace mtb
protected: protected:
int kill_num_ = 0; int kill_num_ = 0;
int parameter_ = 0.0f; float parameter_ = 0.0f;
public: public:
std::bitset<2> __flags__; std::bitset<2> __flags__;

View File

@ -53,8 +53,8 @@ namespace mtb
int map_id_ = 0; int map_id_ = 0;
std::string template_list_; std::string template_list_;
std::string map_name_; std::string map_name_;
int map_width_ = 0.0f; float map_width_ = 0.0f;
int map_height_ = 0.0f; float map_height_ = 0.0f;
std::string airdrops_; std::string airdrops_;
int terminator_airdrop_ = 0; int terminator_airdrop_ = 0;
int player_ = 0; int player_ = 0;
@ -67,7 +67,7 @@ namespace mtb
int init_gas_ring_ = 0; int init_gas_ring_ = 0;
std::string airraids_; std::string airraids_;
std::string car_num_limit_; std::string car_num_limit_;
int scale_ = 0.0f; float scale_ = 0.0f;
public: public:
std::bitset<18> __flags__; std::bitset<18> __flags__;

View File

@ -93,8 +93,8 @@ namespace mtb
int height_ = 0; int height_ = 0;
int width_ = 0; int width_ = 0;
int hp_ = 0; int hp_ = 0;
int damage_ = 0.0f; float damage_ = 0.0f;
int damage_dia_ = 0.0f; float damage_dia_ = 0.0f;
std::string drop_; std::string drop_;
int is_door_ = 0; int is_door_ = 0;
int is_house_ = 0; int is_house_ = 0;

View File

@ -113,9 +113,9 @@ namespace mtb
protected: protected:
int id_ = 0; int id_ = 0;
int move_offset_x_ = 0.0f; float move_offset_x_ = 0.0f;
int move_offset_y_ = 0.0f; float move_offset_y_ = 0.0f;
int radius_ = 0.0f; float radius_ = 0.0f;
int move_speed_ = 0; int move_speed_ = 0;
int jump_speed_ = 0; int jump_speed_ = 0;
int move_speed3_ = 0; int move_speed3_ = 0;
@ -135,9 +135,9 @@ namespace mtb
int revive_time_ = 0; int revive_time_ = 0;
std::string name_; std::string name_;
int normal_skill_ = 0; int normal_skill_ = 0;
int hit_offset_x_ = 0.0f; float hit_offset_x_ = 0.0f;
int hit_offset_y_ = 0.0f; float hit_offset_y_ = 0.0f;
int hit_radius_ = 0.0f; float hit_radius_ = 0.0f;
std::string ai_script_; std::string ai_script_;
std::string init_buffs_; std::string init_buffs_;
int default_weapon_ = 0; int default_weapon_ = 0;
@ -151,16 +151,16 @@ namespace mtb
int hp_ = 0; int hp_ = 0;
int damage_ = 0; int damage_ = 0;
int defence_ = 0; int defence_ = 0;
int crit_atk_ = 0.0f; float crit_atk_ = 0.0f;
int crit_atk_ratio_ = 0.0f; float crit_atk_ratio_ = 0.0f;
int miss_ = 0.0f; float miss_ = 0.0f;
int miss_damage_ruduce_ = 0.0f; float miss_damage_ruduce_ = 0.0f;
int skill1list_ = 0; int skill1list_ = 0;
int skill2list_ = 0; int skill2list_ = 0;
int skill3list_ = 0; int skill3list_ = 0;
int hp_ratio_ = 0.0f; float hp_ratio_ = 0.0f;
int damage_ratio_ = 0.0f; float damage_ratio_ = 0.0f;
int defence_ratio_ = 0.0f; float defence_ratio_ = 0.0f;
public: public:
std::bitset<49> __flags__; std::bitset<49> __flags__;

View File

@ -21,7 +21,7 @@ namespace mtb
protected: protected:
int rank_ = 0; int rank_ = 0;
int parameter_ = 0.0f; float parameter_ = 0.0f;
int drop_ = 0; int drop_ = 0;
public: public:

View File

@ -37,7 +37,7 @@ namespace mtb
int rad_ = 0; int rad_ = 0;
int wait_time_ = 0; int wait_time_ = 0;
int shrink_speed_ = 0; int shrink_speed_ = 0;
int hurt_ = 0.0f; float hurt_ = 0.0f;
int type_ = 0; int type_ = 0;
int x1_ = 0; int x1_ = 0;
int y1_ = 0; int y1_ = 0;

View File

@ -76,7 +76,7 @@ namespace mtb
int skill_cd_ = 0; int skill_cd_ = 0;
int skill_target_ = 0; int skill_target_ = 0;
std::string buff_list_; std::string buff_list_;
int skill_distance_ = 0.0f; float skill_distance_ = 0.0f;
int cold_time_up_ = 0; int cold_time_up_ = 0;
int max_times_ = 0; int max_times_ = 0;
int phase1_time_offset_ = 0; int phase1_time_offset_ = 0;

View File

@ -51,7 +51,7 @@ namespace mtb
std::string time_; std::string time_;
std::string cd_; std::string cd_;
int buff_id_ = 0; int buff_id_ = 0;
int buff_time_ = 0.0f; float buff_time_ = 0.0f;
int explosion_effect_ = 0; int explosion_effect_ = 0;
public: public:

2
third_party/a8 vendored

@ -1 +1 @@
Subproject commit 36d83c3303f5b4a9c1c389c1a5b7f95ac8d858dd Subproject commit 11f2866aded2d25354dc35d2cf091b0da01ae724