quisquous/cactbot

oopsyraidsy: Food Buff removal not being detected

valarnin opened this issue · 1 comments

Description

Oopsy's food buff removal trigger is not working.

Additional information

I'm not sure how long this has been an issue, probably for like 3 years now since #1610. Looks like some confusion between the hex ID 0x30 which shows up in the actual line vs the decimal equivalent 48?

{
id: 'General Food Buff',
comment: { cn: '食物消失' },
type: 'LosesEffect',
// Well Fed
netRegex: NetRegexes.losesEffect({ effectId: '48' }),
condition: (_data, matches) => {
// Prevent "Eos loses the effect of Well Fed from Critlo Mcgee"
return matches.target === matches.source;
},
mistake: (data, matches) => {
data.lostFood ??= {};
// Well Fed buff happens repeatedly when it falls off (WHY),
// so suppress multiple occurrences.
if (!data.inCombat || data.lostFood[matches.target])
return;
data.lostFood[matches.target] = true;
return {
type: 'warn',
blame: matches.target,
reportId: matches.targetId,
text: {
en: 'lost food buff',
de: 'Nahrungsbuff verloren',
fr: 'Buff nourriture perdue',
ja: '飯効果が失った',
cn: '失去食物BUFF',
ko: '음식 버프 해제',
},
};
},
},

Probably this makes more sense?

import EffectID from '../../../../resources/effect_id';
// ...
      netRegex: NetRegexes.losesEffect({ effectId: EffectID.WellFed }),
Added:
26|2023-08-03T17:25:57.4610000-04:00|30|Well Fed|942.05|10001234|Some One|10001234|Some One|294B|91425|91425|99cf04ee59e83f92
Removed:
30|2023-08-03T18:05:28.8230000-04:00|30|Well Fed|0.00|10001234|Some One|10001234|Some One|2964|94664|94664|5cec6eb3ad1d91d0

The gainsEffect trigger is obviously also suffering the same issue. Not sure if other triggers elsewhere are.

Unfortunately, the effect id file is not really consistent over time. If there's ever a new ability called well fed, then they'll both be removed as being conflicts, and then this will be an error. Maybe that could change, but I think for now it needs to be literal.