This commit is contained in:
aozhiwei 2023-02-15 10:46:32 +08:00
parent 2dd5c54825
commit 8b942f050f
4 changed files with 73 additions and 41 deletions

View File

@ -10,6 +10,7 @@ namespace mt
void SkillNumber::Init1() void SkillNumber::Init1()
{ {
#if 0
_int_ratio = a8::XValue(ratio()); _int_ratio = a8::XValue(ratio());
_float_ratio = a8::XValue(ratio()).GetDouble(); _float_ratio = a8::XValue(ratio()).GetDouble();
if (ratio().find('%') != std::string::npos) { if (ratio().find('%') != std::string::npos) {
@ -25,6 +26,7 @@ namespace mt
a8::ReplaceString(tmp_str, "%", ""); a8::ReplaceString(tmp_str, "%", "");
_float_ratio2 = a8::XValue(tmp_str).GetDouble() / 100; _float_ratio2 = a8::XValue(tmp_str).GetDouble() / 100;
} }
#endif
_int_speed = a8::XValue(speed()); _int_speed = a8::XValue(speed());
_float_speed = a8::XValue(speed()).GetDouble(); _float_speed = a8::XValue(speed()).GetDouble();

View File

@ -12,50 +12,68 @@ namespace mtb
a8::reflect::Class* GetClass() const; a8::reflect::Class* GetClass() const;
int skill_id() const { return skill_id_; }; int skill_id() const { return skill_id_; };
int skill_type() const { return skill_type_; }; int skill_type() const { return skill_type_; };
const std::string ratio() const { return ratio_; }; int number() const { return number_; };
const std::string ratio2() const { return ratio2_; }; float damage() const { return damage_; };
float damage_addition() const { return damage_addition_; };
float damage_change() const { return damage_change_; };
float shield() const { return shield_; };
float shield_addition() const { return shield_addition_; };
float resume() const { return resume_; };
float resume_addition() const { return resume_addition_; };
const std::string speed() const { return speed_; }; const std::string speed() const { return speed_; };
const std::string range() const { return range_; }; const std::string range() const { return range_; };
const std::string range2() const { return range2_; }; const std::string range2() const { return range2_; };
const std::string probability() const { return probability_; };
const std::string time() const { return time_; }; const std::string time() const { return time_; };
const std::string cd() const { return cd_; }; const std::string cd() const { return cd_; };
int buff_id() const { return buff_id_; }; int buff_id() const { return buff_id_; };
float buff_time() const { return buff_time_; }; float buff_time() const { return buff_time_; };
const std::string probability() const { return probability_; };
int explosion_effect() const { return explosion_effect_; }; int explosion_effect() const { return explosion_effect_; };
bool has_skill_id() const { return __flags__.test(0);}; bool has_skill_id() const { return __flags__.test(0);};
bool has_skill_type() const { return __flags__.test(1);}; bool has_skill_type() const { return __flags__.test(1);};
bool has_ratio() const { return __flags__.test(2);}; bool has_number() const { return __flags__.test(2);};
bool has_ratio2() const { return __flags__.test(3);}; bool has_damage() const { return __flags__.test(3);};
bool has_speed() const { return __flags__.test(4);}; bool has_damage_addition() const { return __flags__.test(4);};
bool has_range() const { return __flags__.test(5);}; bool has_damage_change() const { return __flags__.test(5);};
bool has_range2() const { return __flags__.test(6);}; bool has_shield() const { return __flags__.test(6);};
bool has_probability() const { return __flags__.test(7);}; bool has_shield_addition() const { return __flags__.test(7);};
bool has_time() const { return __flags__.test(8);}; bool has_resume() const { return __flags__.test(8);};
bool has_cd() const { return __flags__.test(9);}; bool has_resume_addition() const { return __flags__.test(9);};
bool has_buff_id() const { return __flags__.test(10);}; bool has_speed() const { return __flags__.test(10);};
bool has_buff_time() const { return __flags__.test(11);}; bool has_range() const { return __flags__.test(11);};
bool has_explosion_effect() const { return __flags__.test(12);}; bool has_range2() const { return __flags__.test(12);};
bool has_time() const { return __flags__.test(13);};
bool has_cd() const { return __flags__.test(14);};
bool has_buff_id() const { return __flags__.test(15);};
bool has_buff_time() const { return __flags__.test(16);};
bool has_probability() const { return __flags__.test(17);};
bool has_explosion_effect() const { return __flags__.test(18);};
protected: protected:
int skill_id_ = 0; int skill_id_ = 0;
int skill_type_ = 0; int skill_type_ = 0;
std::string ratio_; int number_ = 0;
std::string ratio2_; float damage_ = 0.0f;
float damage_addition_ = 0.0f;
float damage_change_ = 0.0f;
float shield_ = 0.0f;
float shield_addition_ = 0.0f;
float resume_ = 0.0f;
float resume_addition_ = 0.0f;
std::string speed_; std::string speed_;
std::string range_; std::string range_;
std::string range2_; std::string range2_;
std::string probability_;
std::string time_; std::string time_;
std::string cd_; std::string cd_;
int buff_id_ = 0; int buff_id_ = 0;
float buff_time_ = 0.0f; float buff_time_ = 0.0f;
std::string probability_;
int explosion_effect_ = 0; int explosion_effect_ = 0;
public: public:
std::bitset<13> __flags__; std::bitset<19> __flags__;
}; };
}; };

View File

@ -395,20 +395,26 @@ namespace mtb
{ {
a8::reflect::Class* meta_class = nullptr; a8::reflect::Class* meta_class = nullptr;
if (!meta_class) { if (!meta_class) {
meta_class = new a8::reflect::Class("SkillNumber", 13, 0); meta_class = new a8::reflect::Class("SkillNumber", 19, 0);
meta_class->SetSimpleField(0, "skill_id", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, skill_id_)); meta_class->SetSimpleField(0, "skill_id", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, skill_id_));
meta_class->SetSimpleField(1, "skill_type", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, skill_type_)); meta_class->SetSimpleField(1, "skill_type", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, skill_type_));
meta_class->SetSimpleField(2, "ratio", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, ratio_)); meta_class->SetSimpleField(2, "number", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, number_));
meta_class->SetSimpleField(3, "ratio2", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, ratio2_)); meta_class->SetSimpleField(3, "damage", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, damage_));
meta_class->SetSimpleField(4, "speed", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, speed_)); meta_class->SetSimpleField(4, "damage_addition", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, damage_addition_));
meta_class->SetSimpleField(5, "range", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, range_)); meta_class->SetSimpleField(5, "damage_change", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, damage_change_));
meta_class->SetSimpleField(6, "range2", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, range2_)); meta_class->SetSimpleField(6, "shield", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, shield_));
meta_class->SetSimpleField(7, "probability", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, probability_)); meta_class->SetSimpleField(7, "shield_addition", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, shield_addition_));
meta_class->SetSimpleField(8, "time", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, time_)); meta_class->SetSimpleField(8, "resume", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, resume_));
meta_class->SetSimpleField(9, "cd", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, cd_)); meta_class->SetSimpleField(9, "resume_addition", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, resume_addition_));
meta_class->SetSimpleField(10, "buff_id", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, buff_id_)); meta_class->SetSimpleField(10, "speed", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, speed_));
meta_class->SetSimpleField(11, "buff_time", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, buff_time_)); meta_class->SetSimpleField(11, "range", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, range_));
meta_class->SetSimpleField(12, "explosion_effect", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, explosion_effect_)); meta_class->SetSimpleField(12, "range2", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, range2_));
meta_class->SetSimpleField(13, "time", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, time_));
meta_class->SetSimpleField(14, "cd", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, cd_));
meta_class->SetSimpleField(15, "buff_id", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, buff_id_));
meta_class->SetSimpleField(16, "buff_time", a8::reflect::ET_FLOAT, my_offsetof2(SkillNumber, buff_time_));
meta_class->SetSimpleField(17, "probability", a8::reflect::ET_STRING, my_offsetof2(SkillNumber, probability_));
meta_class->SetSimpleField(18, "explosion_effect", a8::reflect::ET_INT32, my_offsetof2(SkillNumber, explosion_effect_));
} }
return meta_class; return meta_class;
} }

View File

@ -313,17 +313,23 @@ message SkillNumber
{ {
required int32 skill_id = 1; required int32 skill_id = 1;
optional int32 skill_type = 2; optional int32 skill_type = 2;
optional string ratio = 3; optional int32 number = 3;
optional string ratio2 = 4; optional float damage = 4;
optional string speed = 5; optional float damage_addition = 5;
optional string range = 6; optional float damage_change = 6;
optional string range2 = 7; optional float shield = 7;
optional string probability = 8; optional float shield_addition = 8;
optional string time = 9; optional float resume = 9;
optional string cd = 10; optional float resume_addition = 10;
optional int32 buff_id = 11; optional string speed = 11;
optional float buff_time = 12; optional string range = 12;
optional int32 explosion_effect = 13; optional string range2 = 13;
optional string time = 14;
optional string cd = 15;
optional int32 buff_id = 16;
optional float buff_time = 17;
optional string probability = 18;
optional int32 explosion_effect = 19;
} }
message NpcStandard message NpcStandard