1
This commit is contained in:
parent
93f4137ae1
commit
1d01fc048b
@ -503,7 +503,7 @@ AttrRateHandle Ability::AddAttrRate(int attr_id, float value)
|
|||||||
return AttrRateHandle();
|
return AttrRateHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ability::RemoveAttrRate(AttrAbsHandle handle)
|
void Ability::RemoveAttrRate(AttrRateHandle handle)
|
||||||
{
|
{
|
||||||
if (!handle.expired()) {
|
if (!handle.expired()) {
|
||||||
auto p = handle.lock();
|
auto p = handle.lock();
|
||||||
|
@ -66,7 +66,7 @@ class Ability
|
|||||||
AttrAbsHandle AddAttrAbs(int attr_id, float value);
|
AttrAbsHandle AddAttrAbs(int attr_id, float value);
|
||||||
void RemoveAttrAbs(AttrAbsHandle handle);
|
void RemoveAttrAbs(AttrAbsHandle handle);
|
||||||
AttrRateHandle AddAttrRate(int attr_id, float value);
|
AttrRateHandle AddAttrRate(int attr_id, float value);
|
||||||
void RemoveAttrRate(AttrAbsHandle handle);
|
void RemoveAttrRate(AttrRateHandle handle);
|
||||||
void RecalcAttrAbs(int attr_id);
|
void RecalcAttrAbs(int attr_id);
|
||||||
void RecalcAttrRate(int attr_id);
|
void RecalcAttrRate(int attr_id);
|
||||||
float GetAttrAbs(int attr_id);
|
float GetAttrAbs(int attr_id);
|
||||||
|
@ -10,9 +10,34 @@
|
|||||||
|
|
||||||
void ModifyBaseAttrBuff::Activate()
|
void ModifyBaseAttrBuff::Activate()
|
||||||
{
|
{
|
||||||
|
int attr_id = meta->_int_buff_param1;
|
||||||
|
if (IsValidHumanAttr(attr_id)) {
|
||||||
|
float value = meta->GetBuffParam2(this);
|
||||||
|
switch (meta->_int_buff_param4) {
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
owner->GetAbility()->AddAttrAbs(attr_id, value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
owner->GetAbility()->AddAttrRate(attr_id, value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModifyBaseAttrBuff::Deactivate()
|
void ModifyBaseAttrBuff::Deactivate()
|
||||||
{
|
{
|
||||||
|
if (!abs_handle_.expired()) {
|
||||||
|
owner->GetAbility()->RemoveAttrAbs(abs_handle_);
|
||||||
|
}
|
||||||
|
if (!rate_handle_.expired()) {
|
||||||
|
owner->GetAbility()->RemoveAttrRate(rate_handle_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,6 @@ class ModifyBaseAttrBuff : public Buff
|
|||||||
virtual void Deactivate() override;
|
virtual void Deactivate() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AttrAdditionHandle add_handle_;
|
AttrAbsHandle abs_handle_;
|
||||||
AttrRuduceHandle ruduce_handle_;
|
AttrRateHandle rate_handle_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user