Skip to content

Commit

Permalink
oopsy: better double raise call (quisquous#5809)
Browse files Browse the repository at this point in the history
  • Loading branch information
g0shu authored Sep 23, 2023
1 parent 0aadb11 commit 7278e76
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/oopsyraidsy/data/00-misc/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { OopsyTriggerSet } from '../../../../types/oopsy';

export interface Data extends OopsyData {
lostFood?: { [name: string]: boolean };
raiseTracker?: { [targetId: string]: boolean };
raiseTracker?: { [targetId: string]: string };
}

// General mistakes; these apply everywhere.
Expand Down Expand Up @@ -90,17 +90,18 @@ const triggerSet: OopsyTriggerSet<Data> = {
// 7D = Raise; AD = Resurrection; E13 = Ascend; 1D63 = Verraise; 5EDF = Egeiro; 478D = BLU; 7423, 7426 = Variant
mistake: (data, matches) => {
data.raiseTracker ??= {};
if (data.raiseTracker[matches.targetId] === true) {
const lastRaiser = data.raiseTracker[matches.targetId];
if (lastRaiser !== undefined) {
return {
type: 'warn',
blame: matches.source,
reportId: matches.sourceId,
text: {
en: 'double raise',
en: 'overwrote ' + lastRaiser + '\'s raise',
},
};
}
data.raiseTracker[matches.targetId] ??= true;
data.raiseTracker[matches.targetId] ??= data.ShortName(matches.source);
},
},
{
Expand Down

0 comments on commit 7278e76

Please sign in to comment.