Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions resources/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ export default {
caresAboutAOE(): (data: Data) => boolean {
return (data: Data) =>
data.role === 'tank' || data.role === 'healer' || data.CanAddle() || data.CanFeint() ||
data.job === 'BLU';
data.party.isLimitedJob(data.me);
},
caresAboutMagical(): (data: Data) => boolean {
return (data: Data) =>
data.role === 'tank' || data.role === 'healer' || data.CanAddle() || data.job === 'BLU';
data.role === 'tank' || data.role === 'healer' || data.CanAddle() ||
data.party.isLimitedJob(data.me);
},
caresAboutPhysical(): (data: Data) => boolean {
return (data: Data) =>
data.role === 'tank' || data.role === 'healer' || data.CanFeint() || data.job === 'BLU';
data.role === 'tank' || data.role === 'healer' || data.CanFeint() ||
data.party.isLimitedJob(data.me);
},
};
17 changes: 10 additions & 7 deletions resources/party.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ export default class PartyTracker {
allianceNames_: string[] = [];
allianceIds_: string[] = [];
nameToRole_: { [name: string]: Role } = {};
nameToJob_: { [name: string]: Job } = {};
idToName_: { [id: string]: string } = {};
roleToPartyNames_: Record<Role, string[]> = emptyRoleToPartyNames();

Expand All @@ -877,6 +878,7 @@ export default class PartyTracker {
const role = Util.jobToRole(jobName);
this.idToName_[p.id] = p.name;
this.nameToRole_[p.name] = role;
this.nameToJob_[p.name] = jobName;
if (p.inParty) {
this.partyIds_.push(p.id);
this.partyNames_.push(p.name);
Expand All @@ -893,6 +895,7 @@ export default class PartyTracker {
this.allianceNames_ = [];
this.allianceIds_ = [];
this.nameToRole_ = {};
this.nameToJob_ = {};
this.idToName_ = {};

// role -> [names] but only for party
Expand Down Expand Up @@ -948,6 +951,12 @@ export default class PartyTracker {
return this.isRole(name, 'dps');
}

// returns true if the named player in your alliance is a limited job
isLimitedJob(name: string): boolean {
const job = this.jobName(name);
return job !== undefined && Util.isLimitedJob(job);
}

// returns true if the named player is in your immediate party
inParty(name: string): boolean {
return this.partyNames.includes(name);
Expand Down Expand Up @@ -984,13 +993,7 @@ export default class PartyTracker {

// returns the job name of the specified party member
jobName(name: string): Job | undefined {
const partyIndex = this.partyNames.indexOf(name);
if (partyIndex < 0)
return;
const job = this.details[partyIndex]?.job;
if (job === undefined)
return;
return Util.jobEnumToJob(job);
return this.nameToJob_[name];
}

nameFromId(id: string): string | undefined {
Expand Down
2 changes: 1 addition & 1 deletion resources/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export const Responses = {
const target = getTarget(matches);
if (target === data.me)
return output.cleaveOnYou?.();
if (data.role === 'tank' || data.job === 'BLU') {
if (data.role === 'tank' || data.party.isLimitedJob(data.me)) {
// targetless tank cleave
// BLU players should always get this generic cleave message.
// We have no robust way to determine whether they have tank Mimicry on,
Expand Down
2 changes: 1 addition & 1 deletion ui/oopsyraidsy/data/03-hw/trial/sephirot-ex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const triggerSet: OopsyTriggerSet<Data> = {
type: 'Ability',
netRegex: NetRegexes.ability({ id: '1576', source: 'Sephirot' }),
condition: (data, matches) => {
if (data.party.isTank(matches.target) || data.job === 'BLU')
if (data.party.isTank(matches.target) || data.party.isLimitedJob(data.me))
return false;
return data?.force?.[matches.target] === undefined;
},
Expand Down
2 changes: 1 addition & 1 deletion ui/oopsyraidsy/data/06-ew/trial/sephirot-un.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const triggerSet: OopsyTriggerSet<Data> = {
type: 'Ability',
netRegex: NetRegexes.ability({ id: '76A3', source: 'Sephirot' }),
condition: (data, matches) => {
if (data.party.isTank(matches.target) || data.job === 'BLU')
if (data.party.isTank(matches.target) || data.party.isLimitedJob(data.me))
return false;
return data?.force?.[matches.target] === undefined;
},
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/00-misc/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TriggerSet } from '../../../../types/trigger';
export type Data = RaidbossData;

const caresAboutTankStuff = (data: RaidbossData) => {
return data.role === 'tank' || data.role === 'healer' || data.job === 'BLU';
return data.role === 'tank' || data.role === 'healer' || data.party.isLimitedJob(data.me);
};

// Triggers for all occasions and zones.
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/02-arr/raid/t6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const triggerSet: TriggerSet<Data> = {
type: 'Ability',
netRegex: { id: '7A0', source: 'Rafflesia' },
condition: (data, matches) =>
data.me === matches.target || data.role === 'healer' || data.job === 'BLU',
data.me === matches.target || data.role === 'healer' || data.party.isLimitedJob(data.me),
alertText: (data, matches, output) => {
if (matches.target === data.me)
return output.swarmOnYou!();
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/02-arr/raid/t7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'T7 Tail Slap',
type: 'Ability',
netRegex: { id: '7A8', source: 'Melusine' },
condition: (data, matches) => data.me === matches.target && data.job === 'BLU',
condition: (data, matches) => data.me === matches.target && data.party.isLimitedJob(data.me),
delaySeconds: 6,
suppressSeconds: 5,
infoText: (_data, _matches, output) => output.text!(),
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/02-arr/trial/ultima-ex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'Ultima EX Viscous Aetheroplasm',
type: 'GainsEffect',
netRegex: { effectId: '171', count: '04', capture: false },
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
alertText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: Outputs.tankSwap,
Expand Down
3 changes: 2 additions & 1 deletion ui/raidboss/data/03-hw/alliance/weeping_city.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ const triggerSet: TriggerSet<Data> = {
id: 'Weeping City Flare Star Orbs',
type: 'AddedCombatant',
netRegex: { npcBaseId: '4889', capture: false },
condition: (data) => data.role === 'tank' || data.role === 'healer' || data.job === 'BLU',
condition: (data) =>
data.role === 'tank' || data.role === 'healer' || data.party.isLimitedJob(data.me),
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'LostCityHard Kuribu Regen',
type: 'StartsUsing',
netRegex: { id: '15DC', source: 'Kuribu', capture: false },
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/03-hw/raid/a10s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const triggerSet: TriggerSet<Data> = {
if (data.role === 'tank')
return output.tankSwap!();

if (data.role === 'healer' || data.job === 'BLU')
if (data.role === 'healer' || data.party.isLimitedJob(data.me))
return output.shieldPlayer!({ player: data.party.member(matches.target) });
},
outputStrings: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/03-hw/raid/a11s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ const triggerSet: TriggerSet<Data> = {
if (data.me === matches.target)
return output.sharedTankbusterOnYou!();

if (data.role === 'tank' || data.role === 'healer' || data.job === 'BLU')
if (data.role === 'tank' || data.role === 'healer' || data.party.isLimitedJob(data.me))
return output.sharedTankbusterOn!({ player: data.party.member(matches.target) });
},
outputStrings: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/03-hw/raid/a12s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const triggerSet: TriggerSet<Data> = {
if (data.scourge.length > 2)
return false;

return data.role === 'healer' || data.job === 'BLU';
return data.role === 'healer' || data.party.isLimitedJob(data.me);
},
delaySeconds: 0.5,
suppressSeconds: 1,
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/03-hw/raid/a2s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'A2S Prey',
type: 'Ability',
netRegex: { source: 'Magitek Gobwidow G-IX', id: '1413' },
condition: (data) => data.role === 'healer' || data.job === 'BLU',
condition: (data) => data.role === 'healer' || data.party.isLimitedJob(data.me),
suppressSeconds: 10,
infoText: (data, matches, output) =>
output.text!({ player: data.party.member(matches.target) }),
Expand Down
4 changes: 2 additions & 2 deletions ui/raidboss/data/03-hw/raid/a3s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'A3S Hand of Stuff',
regex: /Hand of Prayer\/Parting/,
beforeSeconds: 5,
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
suppressSeconds: 1,
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
Expand Down Expand Up @@ -300,7 +300,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'A3S Embolus',
type: 'Ability',
netRegex: { source: 'Living Liquid', id: 'F1B', capture: false },
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/03-hw/raid/a5s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const triggerSet: TriggerSet<Data> = {
condition: (data, matches) => {
if (data.me !== matches.target)
return false;
return data.role !== 'tank' && data.job === 'BLU';
return data.role !== 'tank' && data.party.isLimitedJob(data.me);
},
response: Responses.tankBusterSwap('info'),
},
Expand Down
6 changes: 4 additions & 2 deletions ui/raidboss/data/03-hw/raid/a6n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ const triggerSet: TriggerSet<Data> = {
id: 'A6N Brute Force',
regex: /Brute Force/,
beforeSeconds: 4,
condition: (data) => data.role === 'tank' || data.role === 'healer' || data.job === 'BLU',
condition: (data) =>
data.role === 'tank' || data.role === 'healer' || data.party.isLimitedJob(data.me),
response: Responses.miniBuster(),
},
{
id: 'A6N Magicked Mark',
regex: /Magicked Mark/,
beforeSeconds: 4,
condition: (data) => data.role === 'tank' || data.role === 'healer' || data.job === 'BLU',
condition: (data) =>
data.role === 'tank' || data.role === 'healer' || data.party.isLimitedJob(data.me),
response: Responses.miniBuster(),
},
],
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/03-hw/raid/a8n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'A8N Execution',
type: 'Ability',
netRegex: { source: 'Onslaughter', id: '1632', capture: false },
condition: (data) => data.role === 'dps' || data.job === 'BLU',
condition: (data) => data.role === 'dps' || data.party.isLimitedJob(data.me),
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
3 changes: 2 additions & 1 deletion ui/raidboss/data/03-hw/raid/a8s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'A8S Execution',
type: 'Ability',
netRegex: { source: 'Onslaughter', id: '1632', capture: false },
condition: (data) => data.role === 'dps' || data.job === 'BLU',
condition: (data) => data.role === 'dps' || data.party.isLimitedJob(data.me),
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down Expand Up @@ -652,6 +652,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'A8S Verdict Max HP Blu Devour',
type: 'GainsEffect',
netRegex: { effectId: '407' },
// This trigger is intended only for Blue Mage, so do not use `data.party.isLimitedJob` here.
condition: (data, matches) => data.me === matches.target && data.job === 'BLU',
Comment on lines +655 to 656
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a Blue Mage-specific trigger, I left it as it was and simply added a comment.

delaySeconds: 27,
alarmText: (_data, _matches, output) => output.text!(),
Expand Down
4 changes: 2 additions & 2 deletions ui/raidboss/data/04-sb/alliance/orbonne_monastery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'Orbonne Cid Cleansing Strike',
type: 'Ability',
netRegex: { id: '3751', source: 'The Thunder God', capture: false },
condition: (data) => data.role === 'healer' || data.job === 'BLU',
condition: (data) => data.role === 'healer' || data.party.isLimitedJob(data.me),
suppressSeconds: 10,
alertText: (_data, _matches, output) => output.text!(),
outputStrings: {
Expand Down Expand Up @@ -625,7 +625,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'Orbonne Ultima Ultimate Illusion Healer',
type: 'StartsUsing',
netRegex: { id: '3895', source: 'Ultima, The High Seraph', capture: false },
condition: (data) => data.role === 'healer' || data.job === 'BLU',
condition: (data) => data.role === 'healer' || data.party.isLimitedJob(data.me),
alertText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/04-sb/dungeon/temple_of_the_fist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'Temple Touch Of Slaughter',
type: 'StartsUsing',
netRegex: { id: '1FE6', source: 'Ivon Coeurlfist' },
condition: (data) => data.role === 'healer' || data.job === 'BLU',
condition: (data) => data.role === 'healer' || data.party.isLimitedJob(data.me),
infoText: (data, matches, output) =>
output.text!({ player: data.party.member(matches.target) }),
outputStrings: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/04-sb/raid/o11n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O11N Blaster',
regex: /Blaster/,
beforeSeconds: 3,
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
infoText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/04-sb/raid/o12n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O12N Local Resonance',
type: 'GainsEffect',
netRegex: { target: 'Omega', effectId: '67E', capture: false },
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
alertText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
10 changes: 5 additions & 5 deletions ui/raidboss/data/04-sb/raid/o12s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O12S Shield Blades Setup',
type: 'Ability',
netRegex: { id: ['3350', '3351'], source: ['Omega', 'Omega-M'], capture: false },
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
suppressSeconds: 1,
infoText: (_data, _matches, output) => output.text!(),
run: (data) => delete data.weaponPhase,
Expand Down Expand Up @@ -496,7 +496,7 @@ const triggerSet: TriggerSet<Data> = {
type: 'StartsUsing',
netRegex: { id: '3364', source: 'Omega', capture: false },
infoText: (data, _matches, output) => {
if (data.role === 'tank' || data.job === 'BLU')
if (data.role === 'tank' || data.party.isLimitedJob(data.me))
return output.monitorsLeft!();

return output.dodgeLeft!();
Expand Down Expand Up @@ -527,7 +527,7 @@ const triggerSet: TriggerSet<Data> = {
type: 'StartsUsing',
netRegex: { id: '3365', source: 'Omega', capture: false },
infoText: (data, _matches, output) => {
if (data.role === 'tank' || data.job === 'BLU')
if (data.role === 'tank' || data.party.isLimitedJob(data.me))
return output.monitorsRight!();

return output.dodgeRight!();
Expand Down Expand Up @@ -564,7 +564,7 @@ const triggerSet: TriggerSet<Data> = {
infoText: (data, matches, output) => {
if (data.me === matches.target)
return;
if (data.role !== 'tank' && data.job !== 'BLU')
if (data.role !== 'tank' && !data.party.isLimitedJob(data.me))
return;
return output.vulnOn!({ player: data.party.member(matches.target) });
},
Expand Down Expand Up @@ -713,7 +713,7 @@ const triggerSet: TriggerSet<Data> = {
// It can be useful to know who has the short stack because they
// might need an extra shield. However, common blu strats have
// folks diamondback this, so it's just noise.
if (data.job !== 'BLU')
if (!data.party.isLimitedJob(data.me))
return output.shortStackOn!({ player: data.party.member(matches.target) });
}
return;
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/04-sb/raid/o1n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O1N Charybdis',
type: 'StartsUsing',
netRegex: { id: '23DB', source: 'Alte Roite', capture: false },
condition: (data) => data.role === 'healer' || data.job === 'BLU',
condition: (data) => data.role === 'healer' || data.party.isLimitedJob(data.me),
// Alert rather than info, as any further raid damage is lethal if unhealed.
response: Responses.hpTo1Aoe('alert'),
},
Expand Down
4 changes: 2 additions & 2 deletions ui/raidboss/data/04-sb/raid/o2s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O2S Elevated',
type: 'GainsEffect',
netRegex: { effectId: '54E', capture: false },
condition: (data) => data.job !== 'BLU',
condition: (data) => !data.party.isLimitedJob(data.me),
alarmText: (data, _matches, output) => {
if (data.role.startsWith('dps') && !data.levitating)
return output.dpsLevitate!();
Expand Down Expand Up @@ -237,7 +237,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O2S Maniacal Probe',
type: 'StartsUsing',
netRegex: { id: '235A', source: 'Catastrophe', capture: false },
condition: (data) => data.job !== 'BLU',
condition: (data) => !data.party.isLimitedJob(data.me),
alertText: (data, _matches, output) => {
if (data.myProbe) {
if (!data.dpsProbe)
Expand Down
2 changes: 1 addition & 1 deletion ui/raidboss/data/04-sb/raid/o9n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const triggerSet: TriggerSet<Data> = {
id: 'O9N Orbs Fiend',
type: 'StartsUsing',
netRegex: { id: '315C', source: 'Chaos', capture: false },
condition: (data) => data.role === 'tank' || data.job === 'BLU',
condition: (data) => data.role === 'tank' || data.party.isLimitedJob(data.me),
alarmText: (_data, _matches, output) => output.text!(),
outputStrings: {
text: {
Expand Down
Loading
Loading