Skip to content

Commit

Permalink
FRU additions
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Jan 4, 2025
1 parent a7efdea commit 5796527
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import gg.xp.xivsupport.events.state.combatstate.CastResult;
import gg.xp.xivsupport.events.state.combatstate.CastTracker;
import gg.xp.xivsupport.events.state.combatstate.StatusEffectRepository;
import gg.xp.xivsupport.speech.BaseCalloutEvent;
import gg.xp.xivsupport.speech.CalloutEvent;
import gg.xp.xivsupport.speech.HasCalloutTrackingKey;
import org.jetbrains.annotations.Contract;
Expand Down Expand Up @@ -182,6 +183,15 @@ public void waitMs(long ms) {
return lastCall;
}

public void expireLastCall() {
if (lastCall instanceof RawModifiedCallout<?> rmc) {
rmc.forceExpire();
}
else if (lastCall instanceof BaseCalloutEvent bce) {
bce.forceExpire();
}
}

/**
* Accept a new callout event, BUT mark it as "replacing" any previous call
* i.e. update callout text + emit a new TTS
Expand Down Expand Up @@ -528,9 +538,8 @@ public BaseEvent waitCastFinished(ActiveCastRepository repo, AbilityCastStart ca
return end;
}
}
// TODO: not correct - should also check for AbilityCastCancel
return waitEvent(AbilityUsedEvent.class, aue -> aue.getPrecursor() == cast);


}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import gg.xp.xivsupport.events.actlines.events.ActorControlExtraEvent;
import gg.xp.xivsupport.events.actlines.events.BuffApplied;
import gg.xp.xivsupport.events.actlines.events.HasAbility;
import gg.xp.xivsupport.events.actlines.events.HasCastPrecursor;
import gg.xp.xivsupport.events.actlines.events.HasDuration;
import gg.xp.xivsupport.events.actlines.events.HasSourceEntity;
import gg.xp.xivsupport.events.actlines.events.HasTargetEntity;
Expand Down Expand Up @@ -704,19 +705,57 @@ else if (playerHasMarker) {
@NpcCastCallout(0x9D20)
private final ModifiableCallout<AbilityCastStart> p2enrage = ModifiableCallout.durationBasedCall("P2 Enrage", "Enrage, Knockback");

// TODO: add callout for when main crystal becomes vulnerable
@NpcCastCallout(value = 0x9D43, cancellable = true)
private final ModifiableCallout<AbilityCastStart> intermissionEnrage = ModifiableCallout.durationBasedCall("Endless Ice Age (Intermission)", "Kill Crystals, Bait AoEs");
// TODO: add callout for if you get tethered in adds
private final ModifiableCallout<TetherEvent> intermissionTether = new ModifiableCallout<>("Endless Ice Age: Tether on You", "Tether");
private final ModifiableCallout<AbilityCastStart> intermissionKillMain = ModifiableCallout.durationBasedCall("Endless Ice Age: Kill Main Crystal", "Kill Main Crystal");
private final ModifiableCallout<AbilityCastStart> intermissionVulnDown = ModifiableCallout.durationBasedCall("Endless Ice Age: Main Crystal Vuln Down", "Vuln Down");

@AutoFeed
private final SequentialTrigger<BaseEvent> intermissionCrystal = SqtTemplates.sq(60_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9D43),
(e1, s) -> {
s.updateCall(intermissionEnrage, e1);
int goodId = 0x896;
int badId = 0x1154;
while (true) {
var buff = s.waitEventUntil(
BuffApplied.class,
ba -> ba.getTarget().equals(e1.getSource()) && ba.buffIdMatches(goodId, badId),
HasCastPrecursor.class, ha -> {
return ha.getPrecursor() == e1 && (ha instanceof AbilityUsedEvent || ha instanceof AbilityCastCancel);
});
if (buff == null) {
s.expireLastCall();
return;
}
else if (buff.buffIdMatches(0x896)) {
s.updateCall(intermissionKillMain, e1);
}
else if (buff.buffIdMatches(0x1154)) {
s.updateCall(intermissionVulnDown, e1);
}
}

});

@AutoFeed
private final SequentialTrigger<BaseEvent> intermissionTethers = SqtTemplates.sq(60_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9D43),
(e1, s) -> {
var tethers = s.waitEventsQuickSuccession(4, TetherEvent.class, te -> te.eitherTargetMatches(XivCombatant::isPc));
tethers.stream().filter(tether -> tether.eitherTargetMatches(XivCombatant::isThePlayer)).findAny().ifPresent(tether -> {
s.updateCall(intermissionTether, tether);
});
});

private final ModifiableCallout<?> junction = new ModifiableCallout<>("Junction", "Raidwide");

@AutoFeed
private final SequentialTrigger<BaseEvent> intermissionRaidwideSq = SqtTemplates.sq(30_000,
AbilityCastCancel.class, acc -> acc.abilityIdMatches(0x9D43),
(e1, s) -> {
s.waitMs(7_000);
s.updateCall(junction);
s.waitMs(7_000);
s.updateCall(junction);
});

@NpcCastCallout(0x9D49)
Expand Down Expand Up @@ -770,7 +809,6 @@ private static Predicate<HasDuration> initDurBetween(int secondsMin, int seconds

private final ModifiableCallout<?> relShortRewindBait = new ModifiableCallout<>("Relativity: Short Rewind Part 2", "Bait Spinny")
.extendedDescription("This call happens after the second fire/stack pop, if you have short rewind and do not have medium fire.");
// TODO icons
private final ModifiableCallout<?> relShortRewindMedFire = new ModifiableCallout<>("Relativity: Short Rewind Part 2 (Med Fire)", "AFK")
.extendedDescription("This call happens after the second fire/stack pop, if you have short rewind and had medium fire.");
private final ModifiableCallout<BuffApplied> relLongRewind2 = ModifiableCallout.<BuffApplied>durationBasedCall("Relativity: Long Rewind Part 2", "Drop Rewind Middle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ protected List<CalloutInitialValues> getExpectedCalls() {
call(320715, "Proteans", "Proteans (4.7)"),
call(334989, "Enrage, Knockback", "Enrage, Knockback (9.7)"),
call(371856, "Kill Crystals, Bait AoEs", "Kill Crystals, Bait AoEs (39.7)"),
call(387627, "Kill Main Crystal", "Kill Main Crystal (23.9)"),
call(417128, "Raidwide", "Raidwide"),
call(437660, "1 HP", "1 HP (3.7)"),
call(445922, "Raidwide", "Raidwide (9.7)"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class NpcYellEvent extends BaseEvent implements HasSourceEntity, HasPrima
private final XivCombatant source;
private final NpcYellInfo yell;

// TODO: integrate RSV here
public NpcYellEvent(XivCombatant source, NpcYellInfo yell) {
this.source = source;
this.yell = yell;
Expand Down

0 comments on commit 5796527

Please sign in to comment.