This commit is contained in:
aozhiwei 2023-03-14 15:29:51 +08:00
parent 052ba3bd57
commit 91cdf7cf50
2 changed files with 8 additions and 6 deletions

View File

@ -23,9 +23,9 @@ void HoldShieldBuff::Activate()
kPropShieldHp,
owner->shield_max_hp_,
owner->shield_hp_);
hold_param2_ = meta->GetBuffParam2(this);
check_interval_time_ = meta->GetBuffParam3(this);
if (meta->_int_buff_param1) {
hold_param3_ = meta->GetBuffParam3(this);
check_interval_time_ = meta->GetBuffParam5(this);
if (meta->_buff_param1_int_list.size() > 1) {
std::map<int, long long> hited_objects = std::map<int, long long>();
owner->room->xtimer.SetIntervalEx
(
@ -34,7 +34,7 @@ void HoldShieldBuff::Activate()
{
if (a8::TIMER_EXEC_EVENT == event) {
std::set<Creature*> enemys;
owner->GetHitEnemys(enemys, owner->GetPos().ToGlmVec3(), hold_param2_);
owner->GetHitEnemys(enemys, owner->GetPos().ToGlmVec3(), hold_param3_);
for (auto& enemy : enemys) {
auto itr = hited_objects.find(enemy->GetUniId());
if (itr != hited_objects.end()) {
@ -63,5 +63,7 @@ void HoldShieldBuff::Deactivate()
void HoldShieldBuff::OnEnemyHit(Creature* enemy)
{
enemy->TryAddBuff(GetCaster().Get(), meta->_int_buff_param1, skill_meta);
if (meta->_buff_param1_int_list.size() > 1) {
enemy->TryAddBuff(GetCaster().Get(), meta->_buff_param1_int_list[1], skill_meta);
}
}

View File

@ -13,6 +13,6 @@ class HoldShieldBuff : public Buff
void OnEnemyHit(Creature* enemy);
private:
float hold_param2_ = 0.0f;
float hold_param3_ = 0.0f;
float check_interval_time_ = 0.0f;
};