1
This commit is contained in:
parent
0b36ea969c
commit
1cbc1b2d74
@ -1386,5 +1386,34 @@ void Buff::ProcSputteringFunc(Bullet* bullet)
|
||||
|
||||
void Buff::ProcIntervalRangeAddBuffFunc()
|
||||
{
|
||||
|
||||
owner->room->xtimer.AddRepeatTimerAndAttach
|
||||
(
|
||||
meta->param4 / FRAME_RATE_MS,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Buff* buff = (Buff*)param.sender.GetUserData();
|
||||
buff->owner->TraverseCreatures
|
||||
(
|
||||
[buff] (Creature* c, bool& stop)
|
||||
{
|
||||
if (c->dead) {
|
||||
return;
|
||||
}
|
||||
if (buff->owner->GetUniId() == c->GetUniId()) {
|
||||
return;
|
||||
}
|
||||
if (!buff->GetCaster().Get()) {
|
||||
return;
|
||||
}
|
||||
if (buff->GetCaster().Get()->team_id != c->team_id) {
|
||||
if (buff->owner->GetPos().Distance(c->GetPos()) < buff->meta->param2) {
|
||||
c->TryAddBuff(buff->GetCaster().Get(), buff->meta->int_param3, buff->skill_meta);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user