Skip to content

Commit

Permalink
jobs: 6.3 changes (#5196)
Browse files Browse the repository at this point in the history
WHM: 
- Assize cooldown 45s -> 40s

SGE: 
- Phlegma cooldown 45s -> 40s

MCH:
- Overheated box show buff stacks instead of duration

PLD: 
- Goring Blade change to show cooldown
- Fight or Flight duration 25s -> 20s
- Requiescat reduced to 4 stack
- Remove magic combo trace (Requiescat stacks can represent)

etc: 
- showDuration func to replace lengthy duration-cooldown structure, will
replace other jobs module in later PR.
  • Loading branch information
Echoring authored Jan 14, 2023
1 parent 4ab4654 commit 75ad0d7
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 34 deletions.
1 change: 1 addition & 0 deletions resources/effect_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ const data = {
'OutOfControl': '965',
'Overcure': '9C',
'OverflowDebugger': '684',
'Overheated': 'A80',
'PacketFilterF': '67D',
'PacketFilterM': '67C',
'Pain': '955',
Expand Down
12 changes: 10 additions & 2 deletions ui/jobs/components/mch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class MCHComponent extends BaseComponent {
wildFireStacks: HTMLElement[] = [];
wildFireCounts = 0;
wildFireActive = false;
overheatstack = 0;

constructor(o: ComponentInterface) {
super(o);
Expand Down Expand Up @@ -89,9 +90,12 @@ export class MCHComponent extends BaseComponent {
this.heatGauge.innerText = jobDetail.heat.toString();
this.batteryGauge.innerText = jobDetail.battery.toString();
// These two seconds are shown by half adjust, not like others' ceil.
if (jobDetail.overheatMilliseconds > 0) {
if (jobDetail.overheatActive === true) {
this.heatGauge.parentNode.classList.add('overheat');
this.heatGauge.innerText = Math.round(jobDetail.overheatMilliseconds / 1000).toString();
if (this.ffxivRegion === 'intl')
this.heatGauge.innerText = this.overheatstack.toString();
else
this.heatGauge.innerText = Math.round(jobDetail.overheatMilliseconds / 1000).toString();
} else {
this.heatGauge.parentNode.classList.remove('overheat');
this.heatGauge.innerText = jobDetail.heat.toString();
Expand Down Expand Up @@ -120,6 +124,10 @@ export class MCHComponent extends BaseComponent {
}
}

override onYouGainEffect(id: string, matches: PartialFieldMatches<'GainsEffect'>): void {
if (id === EffectId.Overheated && this.ffxivRegion === 'intl')
this.overheatstack = parseInt(matches.count ?? '0');
}
override onMobGainsEffectFromYou(id: string, matches: PartialFieldMatches<'GainsEffect'>): void {
if (id === EffectId.Wildfire) {
this.wildFireActive = true;
Expand Down
54 changes: 31 additions & 23 deletions ui/jobs/components/pld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ResourceBox } from '../bars';
import { ComboTracker } from '../combo_tracker';
import { kAbility } from '../constants';
import { PartialFieldMatches } from '../event_emitter';
import { computeBackgroundColorFrom } from '../utils';
import { computeBackgroundColorFrom, showDuration } from '../utils';

import { BaseComponent, ComponentInterface } from './base';

Expand Down Expand Up @@ -55,11 +55,18 @@ export class PLDComponent extends BaseComponent {
const requiescatContainer = document.createElement('div');
requiescatContainer.id = 'pld-stacks-requiescat';
this.stacksContainer.appendChild(requiescatContainer);

for (let i = 0; i < 5; ++i) {
const d = document.createElement('div');
requiescatContainer.appendChild(d);
this.requiescat.push(d);
if (this.ffxivRegion === 'intl') {
for (let i = 0; i < 4; ++i) {
const d = document.createElement('div');
requiescatContainer.appendChild(d);
this.requiescat.push(d);
}
} else {
for (let i = 0; i < 5; ++i) {
const d = document.createElement('div');
requiescatContainer.appendChild(d);
this.requiescat.push(d);
}
}

this.reset();
Expand Down Expand Up @@ -98,38 +105,39 @@ export class PLDComponent extends BaseComponent {

override onCombo(skill: string, combo: ComboTracker): void {
this.comboTimer.duration = 0;
if (skill === kAbility.GoringBlade)
if (skill === kAbility.GoringBlade && this.ffxivRegion !== 'intl')
this.goreBox.duration = 21;
if (combo.isFinalSkill)
return;
if (skill !== kAbility.GoringBlade || this.ffxivRegion !== 'intl')
return;
if (skill)
this.comboTimer.duration = this.comboDuration;
}

override onUseAbility(skill: string): void {
switch (skill) {
case kAbility.BladeOfValor:
this.goreBox.duration = 21;
if (this.ffxivRegion !== 'intl')
this.goreBox.duration = 21;
break;
case kAbility.GoringBlade:
if (this.ffxivRegion === 'intl')
this.goreBox.duration = this.bars.player.getActionCooldown(60000, 'skill');
break;
case kAbility.Expiacion:
case kAbility.SpiritsWithin:
this.expiacionBox.duration = 30;
break;
case kAbility.FightOrFlight:
this.fightOrFlightBox.duration = 25;
this.fightOrFlightBox.threshold = 1000;
this.fightOrFlightBox.fg = computeBackgroundColorFrom(
this.fightOrFlightBox,
'pld-color-fightorflight.active',
);
this.tid1 = window.setTimeout(() => {
this.fightOrFlightBox.duration = 35;
this.fightOrFlightBox.threshold = this.player.gcdSkill * 2 + 1;
this.fightOrFlightBox.fg = computeBackgroundColorFrom(
this.fightOrFlightBox,
'pld-color-fightorflight',
);
}, 25000);
this.tid1 = showDuration({
tid: this.tid1,
timerbox: this.fightOrFlightBox,
duration: this.ffxivRegion === 'intl' ? 20 : 25,
cooldown: 60,
threshold: this.player.gcdSkill * 2 + 1,
activecolor: 'pld-color-fightorflight.active',
deactivecolor: 'pld-color-fightorflight',
});
break;
}
}
Expand Down
5 changes: 4 additions & 1 deletion ui/jobs/components/sge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export class SGEComponent extends BaseComponent {
case kAbility.Phlegma2:
case kAbility.Phlegma3:
if (matches.targetIndex === '0') { // Avoid multiple call in AOE
this.phlegma.duration = 45 + this.phlegma.value;
if (this.ffxivRegion === 'intl')
this.phlegma.duration = 40 + this.phlegma.value;
else
this.phlegma.duration = 45 + this.phlegma.value;
}
break;
case kAbility.Rhizomata:
Expand Down
5 changes: 4 additions & 1 deletion ui/jobs/components/whm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ export class WHMComponent extends BaseComponent {
this.diaBox.duration = 30;
break;
case kAbility.Assize:
this.assizeBox.duration = 45;
if (this.ffxivRegion === 'intl')
this.assizeBox.duration = 40;
else
this.assizeBox.duration = 45;
break;
case kAbility.LucidDreaming:
this.lucidBox.duration = 60;
Expand Down
9 changes: 2 additions & 7 deletions ui/jobs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,6 @@ export const kComboActions: string[][] = [
kAbility.TotalEclipse,
kAbility.Prominence,
],
[
kAbility.BladeofFaith,
kAbility.BladeofTruth,
kAbility.BladeOfValor,
],
// WAR
[
kAbility.HeavySwing,
Expand Down Expand Up @@ -470,10 +465,8 @@ export const kComboBreakers = [
kAbility.RiotBlade,
kAbility.RageOfHalone,
kAbility.RoyalAuthority,
kAbility.GoringBlade,
kAbility.TotalEclipse,
kAbility.Prominence,
kAbility.Confiteor,
kAbility.ShieldBash,
// WAR
kAbility.HeavySwing,
Expand Down Expand Up @@ -546,6 +539,8 @@ export const kComboBreakers = [

export const kComboBreakersCn = [
...kComboBreakers,
kAbility.GoringBlade,
kAbility.Confiteor,
];

export const kComboBreakersKo = [
Expand Down
21 changes: 21 additions & 0 deletions ui/jobs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Lang } from '../../resources/languages';
import NetRegexes from '../../resources/netregexes';
import { UnreachableCode } from '../../resources/not_reached';
import TimerBar from '../../resources/timerbar';
import TimerBox from '../../resources/timerbox';
import TimerIcon from '../../resources/timericon';
import { LocaleNetRegex } from '../../resources/translations';
import Util from '../../resources/util';
Expand Down Expand Up @@ -250,3 +251,23 @@ export const isPvPZone = (zoneId: number): boolean => {
return true;
return false;
};

export const showDuration = (o: {
tid: number;
timerbox: TimerBox;
duration: number;
cooldown: number;
threshold: number;
activecolor: string;
deactivecolor: string;
}): number => {
o.timerbox.duration = o.duration;
o.timerbox.threshold = o.duration;
o.timerbox.fg = computeBackgroundColorFrom(o.timerbox, o.activecolor);
o.tid = window.setTimeout(() => {
o.timerbox.duration = o.cooldown - o.duration;
o.timerbox.threshold = o.threshold;
o.timerbox.fg = computeBackgroundColorFrom(o.timerbox, o.deactivecolor);
}, o.duration * 1000);
return o.tid;
};
1 change: 1 addition & 0 deletions util/gen_effect_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const knownMapping = {
'Eukrasian Dosis III': '2616',
'Radiant Finale': '2964',
'Requiescat': '1368',
'Overheated': '2688',
} as const;

// These custom name of effect will not be checked, but you'd better make it clean.
Expand Down

0 comments on commit 75ad0d7

Please sign in to comment.