Skip to content

Commit

Permalink
raidboss: TOP p2/p3 triggers (#5250)
Browse files Browse the repository at this point in the history
  • Loading branch information
quisquous authored Jan 27, 2023
1 parent 9525b35 commit cac9676
Showing 1 changed file with 182 additions and 12 deletions.
194 changes: 182 additions & 12 deletions ui/raidboss/data/06-ew/ultimate/the_omega_protocol.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Conditions from '../../../../../resources/conditions';
import Outputs from '../../../../../resources/outputs';
import { Responses } from '../../../../../resources/responses';
import ZoneId from '../../../../../resources/zone_id';
import { RaidbossData } from '../../../../../types/data';
import { PluginCombatantState } from '../../../../../types/event';
Expand All @@ -10,6 +11,8 @@ export const playstationMarkers = ['circle', 'cross', 'triangle', 'square'] as c
export type PlaystationMarker = typeof playstationMarkers[number];

export type Glitch = 'mid' | 'remote';
export type Cannon = 'spread' | 'stack';
export type RotColor = 'blue' | 'red';

export interface Data extends RaidbossData {
combatantData: PluginCombatantState[];
Expand All @@ -21,6 +24,11 @@ export interface Data extends RaidbossData {
glitch?: Glitch;
synergyMarker: { [name: string]: PlaystationMarker };
spotlightStacks: string[];
meteorTargets: string[];
cannonFodder: { [name: string]: Cannon };
smellDefamation: string[];
smellRot: { [name: string]: RotColor };
defamationColor?: RotColor;
}

// Due to changes introduced in patch 5.2, overhead markers now have a random offset
Expand Down Expand Up @@ -82,6 +90,10 @@ const triggerSet: TriggerSet<Data> = {
solarRayTargets: [],
synergyMarker: {},
spotlightStacks: [],
meteorTargets: [],
cannonFodder: {},
smellDefamation: [],
smellRot: {},
};
},
triggers: [
Expand Down Expand Up @@ -464,10 +476,10 @@ const triggerSet: TriggerSet<Data> = {
id: 'TOP Optimized Meteor',
type: 'HeadMarker',
netRegex: {},
condition: Conditions.targetIsYou(),
condition: (data, matches) => getHeadmarkerId(data, matches) === headmarkers.meteor,
alertText: (data, matches, output) => {
const id = getHeadmarkerId(data, matches);
if (id === headmarkers.meteor)
data.meteorTargets.push(matches.target);
if (data.me === matches.target)
return output.meteorOnYou!();
},
outputStrings: {
Expand All @@ -478,16 +490,174 @@ const triggerSet: TriggerSet<Data> = {
id: 'TOP Beyond Defense',
type: 'Ability',
netRegex: { id: '7B28' },
condition: Conditions.targetIsYou(),
alarmText: (_data, _matches, output) => output.text!(),
response: (data, matches, output) => {
// cactbot-builtin-response
output.responseOutputStrings = {
dontStack: {
en: 'Don\'t Stack!',
de: 'Nicht stacken!',
fr: 'Ne vous packez pas !',
ja: 'スタックするな!',
cn: '分散站位!',
ko: '쉐어 맞지 말것',
},
stack: Outputs.stackMarker,
};

if (matches.target === data.me)
return { alarmText: output.dontStack!() };
if (!data.meteorTargets.includes(data.me))
return { infoText: output.stack!() };
},
},
{
id: 'TOP Cosmo Memory',
type: 'StartsUsing',
netRegex: { id: '7B22', source: 'Omega-M', capture: false },
response: Responses.aoe(),
},
{
id: 'TOP Sniper Cannon Fodder',
type: 'GainsEffect',
netRegex: { effectId: 'D61' },
preRun: (data, matches) => data.cannonFodder[matches.target] = 'spread',
durationSeconds: 15,
infoText: (data, matches, output) => {
if (data.me === matches.target)
return output.spread!();
},
outputStrings: {
text: {
en: 'Don\'t Stack!',
de: 'Nicht stacken!',
fr: 'Ne vous packez pas !',
ja: 'スタックするな!',
cn: '分散站位!',
ko: '쉐어 맞지 말것',
spread: Outputs.spread,
},
},
{
id: 'TOP High-Powered Sniper Cannon Fodder Collect',
type: 'GainsEffect',
netRegex: { effectId: 'D62' },
run: (data, matches) => data.cannonFodder[matches.target] = 'stack',
},
{
id: 'TOP High-Powered Sniper Cannon Fodder',
type: 'GainsEffect',
netRegex: { effectId: 'D62', capture: false },
delaySeconds: 0.5,
durationSeconds: 15,
suppressSeconds: 1,
alertText: (data, _matches, output) => {
const myBuff = data.cannonFodder[data.me];
if (myBuff === 'spread')
return;

const partnerBuff: Cannon | undefined = myBuff === 'stack' ? undefined : 'stack';
const partners = [];
for (const name of data.party.partyNames) {
if (name === data.me)
continue;
if (data.cannonFodder[name] === partnerBuff)
partners.push(name);
}

const [p1, p2] = partners.sort().map((x) => data.ShortName(x));
if (myBuff === 'stack')
return output.stack!({ player1: p1, player2: p2 });
return output.unmarkedStack!({ player1: p1, player2: p2 });
},
outputStrings: {
stack: {
en: 'Stack (w/ ${player1} or ${player2})',
},
unmarkedStack: {
en: 'Unmarked Stack (w/ ${player1} or ${player2})',
},
},
},
{
id: 'TOP Code Smell Collector',
type: 'GainsEffect',
// D6C Synchronization Code Smell (stack)
// D6D Overflow Code Smell (defamation)
// D6E Underflow Code Smell (red)
// D6F Performance Code Smell (blue)
// D71 Remote Code Smell (far tethers)
// DAF Local Code Smell (near tethers)
// DC9 Local Regression (near tethers)
// DCA Remote Regression (far tethers)
// DC4 Critical Synchronization Bug (stack)
// DC5 Critical Overflow Bug (defamation)
// DC6 Critical Underflow Bug (red)
// D65 Critical Performance Bug (blue)
netRegex: { effectId: ['D6D', 'D6E', 'D6F'] },
run: (data, matches) => {
const isDefamation = matches.effectId === 'D6D';
const isRed = matches.effectId === 'D6E';
const isBlue = matches.effectId === 'D6F';
if (isDefamation)
data.smellDefamation.push(matches.target);
else if (isRed)
data.smellRot[matches.target] = 'red';
else if (isBlue)
data.smellRot[matches.target] = 'blue';
},
},
{
id: 'TOP Code Smell Defamation Color',
type: 'GainsEffect',
netRegex: { effectId: 'D6D', capture: false },
delaySeconds: 0.5,
suppressSeconds: 1,
alertText: (data, _matches, output) => {
let rotColor: RotColor | undefined;

if (data.smellDefamation.length !== 2) {
console.error(
`Defamation: missing person: ${JSON.stringify(data.smellDefamation)}, ${
JSON.stringify(data.smellRot)
}`,
);
}

for (const target of data.smellDefamation) {
const color = data.smellRot[target];
if (color === undefined) {
console.error(
`Defamation: missing color: ${JSON.stringify(data.smellDefamation)}, ${
JSON.stringify(data.smellRot)
}`,
);
continue;
}
if (rotColor === undefined) {
rotColor = color;
continue;
}
if (rotColor !== color) {
console.error(
`Defamation: conflicting color: ${JSON.stringify(data.smellDefamation)}, ${
JSON.stringify(data.smellRot)
}`,
);
rotColor = undefined;
break;
}
}

data.defamationColor = rotColor;

if (rotColor === 'red')
return output.red!();
else if (rotColor === 'blue')
return output.blue!();
return output.unknown!();
},
outputStrings: {
red: {
en: 'Red Defamation',
},
blue: {
en: 'Blue Defamation',
},
unknown: {
en: '??? Defamation',
},
},
},
Expand Down

0 comments on commit cac9676

Please sign in to comment.