This commit is contained in:
aozhiwei 2023-03-28 16:14:42 +08:00
parent 1d01fc048b
commit e626d40b0b

View File

@ -10,9 +10,34 @@
void ModifyGrowAttrBuff::Activate()
{
int attr_id = meta->_int_buff_param1;
if (IsValidHumanAttr(attr_id)) {
float value = meta->GetBuffParam2(this);
switch (meta->_int_buff_param3) {
case 1:
{
owner->GetAbility()->AddAttrAddition(attr_id, value);
}
break;
case 2:
{
owner->GetAbility()->AddAttrRuduce(attr_id, value);
}
break;
default:
{
}
break;
}
}
}
void ModifyGrowAttrBuff::Deactivate()
{
if (!add_handle_.expired()) {
owner->GetAbility()->RemoveAttrAddition(add_handle_);
}
if (!ruduce_handle_.expired()) {
owner->GetAbility()->RemoveAttrRuduce(ruduce_handle_);
}
}