This commit is contained in:
aozhiwei 2023-03-09 07:14:42 +08:00
parent 6c61266f4f
commit 1bc942d86d
6 changed files with 75 additions and 49 deletions

View File

@ -17,11 +17,13 @@ namespace mt
_buff_param3 = a8::XValue(buff_param3()).GetDouble();
_buff_param4 = a8::XValue(buff_param4()).GetDouble();
_buff_param5 = a8::XValue(buff_param5()).GetDouble();
_buff_param6 = a8::XValue(buff_param6()).GetDouble();
_int_buff_param1 = a8::XValue(buff_param1());
_int_buff_param2 = a8::XValue(buff_param2());
_int_buff_param3 = a8::XValue(buff_param3());
_int_buff_param4 = a8::XValue(buff_param4());
_int_buff_param5 = a8::XValue(buff_param5());
_int_buff_param6 = a8::XValue(buff_param6());
{
std::vector<std::string> strings;
a8::Split(child_buff(), strings, '|');
@ -128,6 +130,9 @@ namespace mt
if (a8::lisp::Expr::MaybeExpr(buff_param5())) {
_buff_param5_expr = LispEnv::Instance()->CompileSkillNumberExpr(buff_param5());
}
if (a8::lisp::Expr::MaybeExpr(buff_param6())) {
_buff_param6_expr = LispEnv::Instance()->CompileSkillNumberExpr(buff_param6());
}
}
{
std::vector<std::string> strings;
@ -417,6 +422,18 @@ namespace mt
return _buff_param5;
}
float Buff::GetBuffParam6(::Buff* buff) const
{
if (_buff_param6_expr) {
return LispEnv::Instance()->EvalSkillNumberExpr
(
_buff_param6_expr,
buff
);
}
return _buff_param6;
}
std::string Buff::duration_time() const
{
return mtb::Buff::duration_time();

View File

@ -33,11 +33,13 @@ namespace mt
float _buff_param3 = 0.0f;
float _buff_param4 = 0.0f;
float _buff_param5 = 0.0f;
float _buff_param6 = 0.0f;
int _int_buff_param1 = 0;
int _int_buff_param2 = 0;
int _int_buff_param3 = 0;
int _int_buff_param4 = 0;
int _int_buff_param5 = 0;
int _int_buff_param6 = 0;
std::vector<int> _buff_param1_int_list;
std::vector<int> _buff_param2_int_list;
std::set<int> _buff_param1_int_set;
@ -61,6 +63,7 @@ namespace mt
float GetBuffParam3(::Buff* buff) const;
float GetBuffParam4(::Buff* buff) const;
float GetBuffParam5(::Buff* buff) const;
float GetBuffParam6(::Buff* buff) const;
private:
float _duration_time = 0.0f;
@ -70,6 +73,7 @@ namespace mt
std::shared_ptr<a8::lisp::Value> _buff_param3_expr;
std::shared_ptr<a8::lisp::Value> _buff_param4_expr;
std::shared_ptr<a8::lisp::Value> _buff_param5_expr;
std::shared_ptr<a8::lisp::Value> _buff_param6_expr;
std::string duration_time() const;

View File

@ -20,6 +20,7 @@ namespace mtb
const std::string buff_param3() const { return buff_param3_; };
const std::string buff_param4() const { return buff_param4_; };
const std::string buff_param5() const { return buff_param5_; };
const std::string buff_param6() const { return buff_param6_; };
const std::string duration_time() const { return duration_time_; };
float buff_valueup() const { return buff_valueup_; };
const std::string immune_buffeffect_list() const { return immune_buffeffect_list_; };
@ -54,29 +55,30 @@ namespace mtb
bool has_buff_param3() const { return __flags__.test(7);};
bool has_buff_param4() const { return __flags__.test(8);};
bool has_buff_param5() const { return __flags__.test(9);};
bool has_duration_time() const { return __flags__.test(10);};
bool has_buff_valueup() const { return __flags__.test(11);};
bool has_immune_buffeffect_list() const { return __flags__.test(12);};
bool has_post_remove_action() const { return __flags__.test(13);};
bool has_only_server() const { return __flags__.test(14);};
bool has_only_self() const { return __flags__.test(15);};
bool has_depend_effect() const { return __flags__.test(16);};
bool has_child_buff() const { return __flags__.test(17);};
bool has_coexist_num() const { return __flags__.test(18);};
bool has_dead_valid() const { return __flags__.test(19);};
bool has_buff_interval() const { return __flags__.test(20);};
bool has_tag() const { return __flags__.test(21);};
bool has_post_battle_valid() const { return __flags__.test(22);};
bool has_only_spec_race() const { return __flags__.test(23);};
bool has_exclude_spec_race() const { return __flags__.test(24);};
bool has_dead_remove() const { return __flags__.test(25);};
bool has_no_immune() const { return __flags__.test(26);};
bool has_lock_move() const { return __flags__.test(27);};
bool has_lock_dir() const { return __flags__.test(28);};
bool has_lock_move_dir() const { return __flags__.test(29);};
bool has_disable_shot() const { return __flags__.test(30);};
bool has_disable_useskill() const { return __flags__.test(31);};
bool has_effect_list() const { return __flags__.test(32);};
bool has_buff_param6() const { return __flags__.test(10);};
bool has_duration_time() const { return __flags__.test(11);};
bool has_buff_valueup() const { return __flags__.test(12);};
bool has_immune_buffeffect_list() const { return __flags__.test(13);};
bool has_post_remove_action() const { return __flags__.test(14);};
bool has_only_server() const { return __flags__.test(15);};
bool has_only_self() const { return __flags__.test(16);};
bool has_depend_effect() const { return __flags__.test(17);};
bool has_child_buff() const { return __flags__.test(18);};
bool has_coexist_num() const { return __flags__.test(19);};
bool has_dead_valid() const { return __flags__.test(20);};
bool has_buff_interval() const { return __flags__.test(21);};
bool has_tag() const { return __flags__.test(22);};
bool has_post_battle_valid() const { return __flags__.test(23);};
bool has_only_spec_race() const { return __flags__.test(24);};
bool has_exclude_spec_race() const { return __flags__.test(25);};
bool has_dead_remove() const { return __flags__.test(26);};
bool has_no_immune() const { return __flags__.test(27);};
bool has_lock_move() const { return __flags__.test(28);};
bool has_lock_dir() const { return __flags__.test(29);};
bool has_lock_move_dir() const { return __flags__.test(30);};
bool has_disable_shot() const { return __flags__.test(31);};
bool has_disable_useskill() const { return __flags__.test(32);};
bool has_effect_list() const { return __flags__.test(33);};
protected:
@ -90,6 +92,7 @@ namespace mtb
std::string buff_param3_;
std::string buff_param4_;
std::string buff_param5_;
std::string buff_param6_;
std::string duration_time_;
float buff_valueup_ = 0.0f;
std::string immune_buffeffect_list_;
@ -115,7 +118,7 @@ namespace mtb
std::string effect_list_;
public:
std::bitset<33> __flags__;
std::bitset<34> __flags__;
};
};

View File

@ -443,7 +443,7 @@ namespace mtb
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("Buff", 33, 0);
meta_class = new a8::reflect::Class("Buff", 34, 0);
meta_class->SetSimpleField(0, "buff_id", a8::reflect::ET_INT32, my_offsetof2(Buff, buff_id_));
meta_class->SetSimpleField(1, "name", a8::reflect::ET_STRING, my_offsetof2(Buff, name_));
meta_class->SetSimpleField(2, "buff_target", a8::reflect::ET_INT32, my_offsetof2(Buff, buff_target_));
@ -454,29 +454,30 @@ namespace mtb
meta_class->SetSimpleField(7, "buff_param3", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param3_));
meta_class->SetSimpleField(8, "buff_param4", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param4_));
meta_class->SetSimpleField(9, "buff_param5", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param5_));
meta_class->SetSimpleField(10, "duration_time", a8::reflect::ET_STRING, my_offsetof2(Buff, duration_time_));
meta_class->SetSimpleField(11, "buff_valueup", a8::reflect::ET_FLOAT, my_offsetof2(Buff, buff_valueup_));
meta_class->SetSimpleField(12, "immune_buffeffect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, immune_buffeffect_list_));
meta_class->SetSimpleField(13, "post_remove_action", a8::reflect::ET_STRING, my_offsetof2(Buff, post_remove_action_));
meta_class->SetSimpleField(14, "only_server", a8::reflect::ET_INT32, my_offsetof2(Buff, only_server_));
meta_class->SetSimpleField(15, "only_self", a8::reflect::ET_INT32, my_offsetof2(Buff, only_self_));
meta_class->SetSimpleField(16, "depend_effect", a8::reflect::ET_INT32, my_offsetof2(Buff, depend_effect_));
meta_class->SetSimpleField(17, "child_buff", a8::reflect::ET_STRING, my_offsetof2(Buff, child_buff_));
meta_class->SetSimpleField(18, "coexist_num", a8::reflect::ET_INT32, my_offsetof2(Buff, coexist_num_));
meta_class->SetSimpleField(19, "dead_valid", a8::reflect::ET_INT32, my_offsetof2(Buff, dead_valid_));
meta_class->SetSimpleField(20, "buff_interval", a8::reflect::ET_INT32, my_offsetof2(Buff, buff_interval_));
meta_class->SetSimpleField(21, "tag", a8::reflect::ET_STRING, my_offsetof2(Buff, tag_));
meta_class->SetSimpleField(22, "post_battle_valid", a8::reflect::ET_INT32, my_offsetof2(Buff, post_battle_valid_));
meta_class->SetSimpleField(23, "only_spec_race", a8::reflect::ET_STRING, my_offsetof2(Buff, only_spec_race_));
meta_class->SetSimpleField(24, "exclude_spec_race", a8::reflect::ET_STRING, my_offsetof2(Buff, exclude_spec_race_));
meta_class->SetSimpleField(25, "dead_remove", a8::reflect::ET_INT32, my_offsetof2(Buff, dead_remove_));
meta_class->SetSimpleField(26, "no_immune", a8::reflect::ET_INT32, my_offsetof2(Buff, no_immune_));
meta_class->SetSimpleField(27, "lock_move", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_move_));
meta_class->SetSimpleField(28, "lock_dir", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_dir_));
meta_class->SetSimpleField(29, "lock_move_dir", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_move_dir_));
meta_class->SetSimpleField(30, "disable_shot", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_shot_));
meta_class->SetSimpleField(31, "disable_useskill", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_useskill_));
meta_class->SetSimpleField(32, "effect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, effect_list_));
meta_class->SetSimpleField(10, "buff_param6", a8::reflect::ET_STRING, my_offsetof2(Buff, buff_param6_));
meta_class->SetSimpleField(11, "duration_time", a8::reflect::ET_STRING, my_offsetof2(Buff, duration_time_));
meta_class->SetSimpleField(12, "buff_valueup", a8::reflect::ET_FLOAT, my_offsetof2(Buff, buff_valueup_));
meta_class->SetSimpleField(13, "immune_buffeffect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, immune_buffeffect_list_));
meta_class->SetSimpleField(14, "post_remove_action", a8::reflect::ET_STRING, my_offsetof2(Buff, post_remove_action_));
meta_class->SetSimpleField(15, "only_server", a8::reflect::ET_INT32, my_offsetof2(Buff, only_server_));
meta_class->SetSimpleField(16, "only_self", a8::reflect::ET_INT32, my_offsetof2(Buff, only_self_));
meta_class->SetSimpleField(17, "depend_effect", a8::reflect::ET_INT32, my_offsetof2(Buff, depend_effect_));
meta_class->SetSimpleField(18, "child_buff", a8::reflect::ET_STRING, my_offsetof2(Buff, child_buff_));
meta_class->SetSimpleField(19, "coexist_num", a8::reflect::ET_INT32, my_offsetof2(Buff, coexist_num_));
meta_class->SetSimpleField(20, "dead_valid", a8::reflect::ET_INT32, my_offsetof2(Buff, dead_valid_));
meta_class->SetSimpleField(21, "buff_interval", a8::reflect::ET_INT32, my_offsetof2(Buff, buff_interval_));
meta_class->SetSimpleField(22, "tag", a8::reflect::ET_STRING, my_offsetof2(Buff, tag_));
meta_class->SetSimpleField(23, "post_battle_valid", a8::reflect::ET_INT32, my_offsetof2(Buff, post_battle_valid_));
meta_class->SetSimpleField(24, "only_spec_race", a8::reflect::ET_STRING, my_offsetof2(Buff, only_spec_race_));
meta_class->SetSimpleField(25, "exclude_spec_race", a8::reflect::ET_STRING, my_offsetof2(Buff, exclude_spec_race_));
meta_class->SetSimpleField(26, "dead_remove", a8::reflect::ET_INT32, my_offsetof2(Buff, dead_remove_));
meta_class->SetSimpleField(27, "no_immune", a8::reflect::ET_INT32, my_offsetof2(Buff, no_immune_));
meta_class->SetSimpleField(28, "lock_move", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_move_));
meta_class->SetSimpleField(29, "lock_dir", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_dir_));
meta_class->SetSimpleField(30, "lock_move_dir", a8::reflect::ET_INT32, my_offsetof2(Buff, lock_move_dir_));
meta_class->SetSimpleField(31, "disable_shot", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_shot_));
meta_class->SetSimpleField(32, "disable_useskill", a8::reflect::ET_INT32, my_offsetof2(Buff, disable_useskill_));
meta_class->SetSimpleField(33, "effect_list", a8::reflect::ET_STRING, my_offsetof2(Buff, effect_list_));
}
return meta_class;
}

View File

@ -356,6 +356,7 @@ message Buff
required string buff_param3 = 8;
required string buff_param4 = 9;
optional string buff_param5 = 19;
optional string buff_param6 = 37;
required string duration_time = 10;
optional float buff_valueup = 11;
required string immune_buffeffect_list = 12;

2
third_party/a8 vendored

@ -1 +1 @@
Subproject commit abee0bed17773019250dc4ed042fa8fd8763cf23
Subproject commit 50c04d6bc15bf633f4980039db8be6e61e5b6b55