This commit is contained in:
aozhiwei 2024-03-06 16:19:18 +08:00
parent 1a1000c482
commit 892da19824
2 changed files with 73 additions and 0 deletions

View File

@ -245,6 +245,21 @@ void CallFuncBuff::Activate()
BatchRandomPosSummonObstacle();
}
break;
case BuffCallFunc_e::kOnBreakSkill:
{
OnBreakSkill();
}
break;
case BuffCallFunc_e::kBreakSkill:
{
BreakSkill();
}
break;
case BuffCallFunc_e::kBuffEffectCondAdd:
{
BuffEffectCondAdd();
}
break;
default:
{
}
@ -1580,3 +1595,55 @@ void CallFuncBuff::BatchRandomPosSummonObstacle()
}
}
}
void CallFuncBuff::OnBreakSkill()
{
}
void CallFuncBuff::BreakSkill()
{
Buff* on_break_buff = nullptr;
for (auto buff_id : meta->_buff_param2_int_list) {
on_break_buff = owner->GetBuffById(buff_id);
if (on_break_buff) {
break;
}
}
if (on_break_buff) {
int buff_uniid = on_break_buff->buff_uniid;
for (auto buff_id : meta->_buff_param3_int_list) {
if (buff_id > 0) {
owner->TryAddBuff(
GetCaster().Get(),
buff_id,
skill_meta,
init_args,
buff_vars
);
} else {
owner->RemoveBuffById(-buff_id);
}
}
owner->RemoveBuffByUniId(buff_uniid);
} else {
for (auto buff_id : meta->_buff_param4_int_list) {
if (buff_id > 0) {
owner->TryAddBuff(
GetCaster().Get(),
buff_id,
skill_meta,
init_args,
buff_vars
);
} else {
owner->RemoveBuffById(-buff_id);
}
}
}
}
void CallFuncBuff::BuffEffectCondAdd()
{
}

View File

@ -40,6 +40,9 @@ A8_DECLARE_CLASS_ENUM(BuffCallFunc_e, int,
kAccumulatePower = 40,
kCallShot = 41,
kBatchRandomPosSummonObstacle = 42,
kOnBreakSkill = 43,
kBreakSkill = 44,
kBuffEffectCondAdd = 45
);
@ -78,6 +81,9 @@ class CallFuncBuff : public Buff
void AccumulatePower();
void Shot();
void BatchRandomPosSummonObstacle();
void OnBreakSkill();
void BreakSkill();
void BuffEffectCondAdd();
void InternalRangeHoldBuff(std::function<bool(glm::vec3&)> get_center_func);