This commit is contained in:
aozhiwei 2021-07-06 12:56:06 +08:00
parent 376ea6990c
commit 2561d1ecf5
4 changed files with 19 additions and 7 deletions

View File

@ -339,7 +339,7 @@ namespace MetaData
return weapon_idx;
}
bool Equip::Match(CondAddBuff_e cond, int val)
bool Equip::Match(CondAddBuff_e cond, int val, int val2)
{
switch (cond) {
case kCondBuffUpdateWeaponId:
@ -357,7 +357,8 @@ namespace MetaData
case kCondBuffUpdateWeaponType:
case kCondBuffShotWeaponType:
{
return val == i->equip_subtype();
return val == i->equip_type() &&
(val2 == 0 || val2 == i->equip_subtype());
}
break;
default:
@ -779,10 +780,12 @@ namespace MetaData
param2 = a8::XValue(i->buff_param2()).GetDouble();
param3 = a8::XValue(i->buff_param3()).GetDouble();
param4 = a8::XValue(i->buff_param4()).GetDouble();
param5 = a8::XValue(i->buff_param5()).GetDouble();
int_param1 = a8::XValue(i->buff_param1());
int_param2 = a8::XValue(i->buff_param2());
int_param3 = a8::XValue(i->buff_param3());
int_param4 = a8::XValue(i->buff_param4());
int_param5 = a8::XValue(i->buff_param5());
{
std::vector<std::string> strings;
a8::Split(i->child_buff(), strings, '|');
@ -820,7 +823,7 @@ namespace MetaData
}
{
std::vector<std::string> strings;
a8::Split(i->buff_param4(), strings, ':');
a8::Split(i->buff_param4(), strings, '|');
for (auto& str : strings) {
param4_int_list.push_back(a8::XValue(str).GetInt());
}

View File

@ -88,7 +88,7 @@ namespace MetaData
void Init();
int GetWeaponIdx();
bool Match(CondAddBuff_e cond, int val);
bool Match(CondAddBuff_e cond, int val, int val2);
};
struct EquipUpgrade
@ -203,10 +203,12 @@ namespace MetaData
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::vector<int> param3_int_list;

View File

@ -27,7 +27,9 @@ void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon)
(cond,
[this, cond, weapon_meta] (Buff* buff, bool& stop)
{
if (weapon_meta->Match((CondAddBuff_e)cond, buff->meta->int_param3)) {
if (weapon_meta->Match((CondAddBuff_e)cond,
buff->meta->int_param3,
buff->meta->int_param5)) {
switch (buff->meta->int_param2) {
case kWeaponOptTakeoff:
case kWeaponOptKeep:
@ -53,7 +55,9 @@ void Trigger::TakeonWeapon(Weapon* old_weapon, Weapon* new_weapon)
(cond,
[this, cond, weapon_meta] (Buff* buff, bool& stop)
{
if (weapon_meta->Match((CondAddBuff_e)cond, buff->meta->int_param3)) {
if (weapon_meta->Match((CondAddBuff_e)cond,
buff->meta->int_param3,
buff->meta->int_param5)) {
switch (buff->meta->int_param2) {
case kWeaponOptTakeon:
{
@ -84,7 +88,9 @@ void Trigger::Shot(MetaData::Equip* weapon_meta)
(cond,
[this, cond, weapon_meta] (Buff* buff, bool& stop)
{
if (weapon_meta->Match((CondAddBuff_e)cond, buff->meta->int_param2)) {
if (weapon_meta->Match((CondAddBuff_e)cond,
buff->meta->int_param2,
buff->meta->int_param5)) {
AddBuffs(buff->meta->int_param1, buff->meta->param4_int_list);
}
});

View File

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