This commit is contained in:
aozhiwei 2024-05-15 17:28:15 +08:00
parent 9f8271f74b
commit 768bcf81cc
4 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,7 @@
#include "trigger.h"
#include "collision.h"
#include "human.h"
#include "ability.h"
#include "mt/Buff.h"
#include "mt/Skill.h"
@ -44,6 +45,9 @@ void HideBuff::Activate()
&xtimer_attacher
);
}
if (meta->_int_buff_param1 > 0) {
owner->GetAbility()->IncSwitch(kHideBuffMoveShow);
}
}
void HideBuff::Deactivate()
@ -55,6 +59,9 @@ void HideBuff::Deactivate()
}
}
alert_buff_hash_.clear();
if (meta->_int_buff_param1 > 0) {
owner->GetAbility()->DecSwitch(kHideBuffMoveShow);
}
}
void HideBuff::AddInRangeObject(Creature* target)

View File

@ -521,6 +521,7 @@ enum SwitchTimesType_e
kAccumulatePowerTimes,
kForceClientReportBullet,
kIgnoreOriginalDmg,
kHideBuffMoveShow,
kSwitchTimeEnd,
};

View File

@ -2649,7 +2649,7 @@ void Creature::UpdateMove()
}
{
Buff* hide_buff = GetBuffByEffectId(kBET_Hide);
if (hide_buff && hide_buff->meta->_int_buff_param1 > 0) {
if (hide_buff && GetAbility()->GetSwitchTimes(kHideBuffMoveShow)) {
RemoveHideEffect(kMoveReason);
}
}

View File

@ -679,7 +679,7 @@ void Trigger::EnterBattleMode()
{
for (int buff_id : buff->meta->_buff_param4_int_list) {
if (buff_id > 0) {
owner_->TryAddBuff(owner_, buff_id);
owner_->TryAddBuff(owner_, buff_id, buff->skill_meta);
} else {
owner_->ClearBuffById(buff_id);
}
@ -695,7 +695,7 @@ void Trigger::LeaveBattleMode()
{
for (int buff_id : buff->meta->_buff_param4_int_list) {
if (buff_id > 0) {
owner_->TryAddBuff(owner_, buff_id);
owner_->TryAddBuff(owner_, buff_id, buff->skill_meta);
} else {
owner_->ClearBuffById(buff_id);
}