Skip to content

Commit

Permalink
M1S improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Aug 7, 2024
1 parent 2c946a4 commit 7d2baf7
Show file tree
Hide file tree
Showing 3 changed files with 41,935 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,71 @@ public boolean enabled(EventContext context) {

private static final Predicate<AbilityUsedEvent> isQuadCrossingHit = aue -> aue.abilityIdMatches(0x943F, 0x9440, 0x945B, 0x945C, 0x947D, 0x947E);
private final ModifiableCallout<AbilityCastStart> quadrupleCrossingInitial = ModifiableCallout.durationBasedCall("Quadruple Crossing - Initial", "Quadruple Crossing");
private final ModifiableCallout<AbilityCastStart> quadrupleCrossingInitialLeaping = ModifiableCallout.durationBasedCall("Quadruple Crossing - Initial (Leaping)", "Quadruple Crossing on Clone");
private final ModifiableCallout<AbilityCastStart> quadrupleCrossingInitialLeapingLeft = ModifiableCallout.durationBasedCall("Quadruple Crossing - Leaping Left", "Quadruple Crossing - Leaping Left");
private final ModifiableCallout<AbilityCastStart> quadrupleCrossingInitialLeapingRight = ModifiableCallout.durationBasedCall("Quadruple Crossing - Leaping Right", "Quadruple Crossing - Leaping Right");
private final ModifiableCallout<?> quadrupleCrossingBaitSecond = new ModifiableCallout<>("Quadruple Crossing - Bait Second Wave", "Bait - In");
private final ModifiableCallout<?> quadrupleCrossingDontBaitSecond = new ModifiableCallout<>("Quadruple Crossing - Avoid Second Wave", "Don't Bait - Out");
private final ModifiableCallout<?> quadrupleCrossingThird = new ModifiableCallout<>("Quadruple Crossing - Dodge First", "Dodge 1");
private final ModifiableCallout<?> quadrupleCrossingFourth = new ModifiableCallout<>("Quadruple Crossing - Dodge Second", "Dodge 2");

@AutoFeed
private final SequentialTrigger<BaseEvent> quadrupleCrossing = SqtTemplates.sq(30_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x943C, 0x982F),
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x943C, 0x982F, 0x9457, 0x982F),
(e1, s) -> {
s.updateCall(e1.abilityIdMatches(0x943C) ? quadrupleCrossingInitial : quadrupleCrossingInitialLeaping, e1);
s.waitMs(50);
s.waitEvent(AbilityUsedEvent.class, isQuadCrossingHit);
if (buffs.isStatusOnTarget(state.getPlayer(), 0xC3A)) {
switch ((int) e1.getAbility().getId()){
case 0x943C -> s.updateCall(quadrupleCrossingInitial, e1);
// There are two other IDs, 9479 and 9853, which are left/right, but those are paired with
// Nailchipper
case 0x9457 -> s.updateCall(quadrupleCrossingInitialLeapingLeft, e1);
case 0x982F -> s.updateCall(quadrupleCrossingInitialLeapingRight, e1);
}
var hits = s.waitEventsQuickSuccession(99, AbilityUsedEvent.class, isQuadCrossingHit);
if (hits.stream().anyMatch(hit -> hit.getTarget().isThePlayer())) {
s.updateCall(quadrupleCrossingDontBaitSecond);
}
else {
s.updateCall(quadrupleCrossingBaitSecond);
}
s.waitMs(50);
s.waitEvent(AbilityUsedEvent.class, isQuadCrossingHit);
s.waitMs(250);
s.waitEventsQuickSuccession(4, AbilityUsedEvent.class, isQuadCrossingHit);
s.updateCall(quadrupleCrossingThird);
s.waitMs(50);
s.waitEvent(AbilityUsedEvent.class, isQuadCrossingHit);
s.waitMs(250);
s.waitEventsQuickSuccession(4, AbilityUsedEvent.class, isQuadCrossingHit);
s.updateCall(quadrupleCrossingFourth);
});

private final ModifiableCallout<AbilityCastStart> oneTwoLeftFirst = ModifiableCallout.durationBasedCall("One Two - Left First", "Left then Right");
private final ModifiableCallout<AbilityCastStart> oneTwoRightFirst = ModifiableCallout.durationBasedCall("One Two - Right First", "Right then Left");
private final ModifiableCallout<AbilityCastStart> oneTwoLeapingLeftFirst = ModifiableCallout.durationBasedCall("One Two (Leaping) - Left First", "Left then Right ({whereClone})");
private final ModifiableCallout<AbilityCastStart> oneTwoLeapingRightFirst = ModifiableCallout.durationBasedCall("One Two (Leaping) - Right First", "Right then Left ({whereClone})");
private static final Duration oneTwoDelay = Duration.ofSeconds(1);
private static final Duration oneTwoLeapingDelay = Duration.ofMillis(1_700);
private final ModifiableCallout<AbilityCastStart> oneTwoLeftFirst = ModifiableCallout.durationBasedCallWithOffset("One Two - Left First", "Left then Right", oneTwoDelay);
private final ModifiableCallout<AbilityCastStart> oneTwoRightFirst = ModifiableCallout.durationBasedCallWithOffset("One Two - Right First", "Right then Left", oneTwoDelay);
private final ModifiableCallout<AbilityCastStart> oneTwoLeapingLeftFirst = ModifiableCallout.durationBasedCallWithOffset("One Two (Leaping) - Left First", "Left then Right ({whereClone})", oneTwoLeapingDelay);
private final ModifiableCallout<AbilityCastStart> oneTwoLeapingRightFirst = ModifiableCallout.durationBasedCallWithOffset("One Two (Leaping) - Right First", "Right then Left ({whereClone})", oneTwoLeapingDelay);
private final ModifiableCallout<AbilityUsedEvent> oneTwoLeft = new ModifiableCallout<>("One Two - Left Second", "Left");
private final ModifiableCallout<AbilityUsedEvent> oneTwoRight = new ModifiableCallout<>("One Two - Right Second", "Right");

@AutoFeed
private final SequentialTrigger<BaseEvent> oneTwoPaw = SqtTemplates.sq(30_000,
/*
Normal one-two:
Left->Right:
9436 Boss
9437 First hit
9438 Second hit
Right->Left:
9439 boss
943B first hit
943A second hit
*/
/*
Leaping
944D left right (west)
944E right left (west)
944F left right (east)
9450 right left (east)
*/
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9438, 0x9439, 0x944D, 0x944E, 0x944F, 0x9450),
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9436, 0x9439, 0x944D, 0x944E, 0x944F, 0x9450),
(e1, s) -> {
boolean leftFirst = e1.abilityIdMatches(0x9438, 0x944D, 0x944F);
boolean leftFirst = e1.abilityIdMatches(0x9436, 0x944D, 0x944F);
boolean leaping = e1.getAbility().getId() > 0x9440;
if (leaping) {
s.setParam("whereClone", e1.abilityIdMatches(0x944F, 0x9450) ? ArenaSector.EAST : ArenaSector.WEST);
Expand All @@ -111,6 +130,10 @@ public boolean enabled(EventContext context) {

}
var event = s.waitEvent(AbilityUsedEvent.class, aue -> aue.getPrecursor() == e1);
// The boss cast is 1 second shorter
Duration delay = leaping ? oneTwoLeapingDelay : oneTwoDelay;
log.info("Delay: {}", delay);
s.waitDuration(delay);
if (leftFirst) {
s.updateCall(oneTwoRight, event);
}
Expand All @@ -126,6 +149,7 @@ public boolean enabled(EventContext context) {

private final ModifiableCallout<AbilityCastStart> doubleSwipe = ModifiableCallout.durationBasedCall("Double Swipe", "Light Parties");
private final ModifiableCallout<AbilityCastStart> quadSwipe = ModifiableCallout.durationBasedCall("Quad Swipe", "Partners");

@AutoFeed
private final SequentialTrigger<BaseEvent> doubleQuadSwipeSq = SqtTemplates.sq(60_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x945f, 0x9481, 0x945d, 0x947f),
Expand Down Expand Up @@ -194,6 +218,7 @@ public boolean enabled(EventContext context) {

private final ModifiableCallout<AbilityCastStart> shockwave = ModifiableCallout.durationBasedCall("Shockwave", "Knockback into Spread");
private final ModifiableCallout<AbilityCastStart> shockwaveAfter = ModifiableCallout.durationBasedCall("Shockwave Spread", "Spread");

@AutoFeed
private final SequentialTrigger<BaseEvent> shockWave = SqtTemplates.sq(60_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x944C),
Expand Down Expand Up @@ -236,7 +261,7 @@ public boolean enabled(EventContext context) {
});

@NpcCastCallout({0x9ABB, 0x9ABC})
private final ModifiableCallout<AbilityCastStart> rainingCats = ModifiableCallout.durationBasedCall("Raining Cats", "Tethers");
private final ModifiableCallout<AbilityCastStart> rainingCats = ModifiableCallout.durationBasedCall("Raining Cats", "Tethers and Stacks");

private final ModifiableCallout<AbilityCastStart> nailchipperBaitFirst = ModifiableCallout.durationBasedCall("Nailchipper - Bait First Wave", "Bait Protean");
private final ModifiableCallout<AbilityCastStart> nailchipperDontBaitFirst = ModifiableCallout.durationBasedCall("Nailchipper - Avoid First Wave", "Out");
Expand Down Expand Up @@ -293,7 +318,7 @@ public boolean enabled(EventContext context) {
// 9467 = hitting left first
// can ignore the actual damaging casts
@AutoFeed
private final SequentialTrigger<BaseEvent> soulshadeOneTwo = SqtTemplates.sq(30_000,
private final SequentialTrigger<BaseEvent> soulshadeOneTwo = SqtTemplates.multiInvocation(30_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9464, 0x9467),
(e1, s) -> {
log.info("Soulshade one-two: start");
Expand Down Expand Up @@ -349,4 +374,7 @@ else if (delta == -3) {
TODO:
Trigger for boss destroying tiles?
*/

@NpcCastCallout(value = 0x9AD3, suppressMs = 5_000)
private final ModifiableCallout<AbilityCastStart> predaceousPounce = ModifiableCallout.durationBasedCall("Predaceous Pounce", "Watch Pounces");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package gg.xp.xivsupport.triggers.Arcadion;

import gg.xp.xivsupport.events.triggers.util.CalloutInitialValues;
import gg.xp.xivsupport.events.triggers.util.CalloutVerificationTest;

import java.util.List;

public class M1sTest
extends CalloutVerificationTest {
@Override
protected String getFileName() {
return "/m1s_anon.log";
}

@Override
protected List<CalloutInitialValues> getExpectedCalls() {
return List.of(
call(8270, "Quadruple Crossing", "Quadruple Crossing (4.7)"),
call(14229, "Don't Bait - Out", "Don't Bait - Out"),
call(16988, "Dodge 1", "Dodge 1"),
call(19833, "Dodge 2", "Dodge 2"),
call(27300, "Tankbuster on Liliwure Ririwure", "Tankbuster on Liliwure Ririwure (4.7)"),
call(51444, "Left then Right", "Left then Right (5.7)"),
call(57449, "Right", "Right"),
// TODO: this can call out a lot earlier
call(75858, "Start Northwest-North", "Start Northwest-North (5.7)"),
call(81869, "Move", "Move"),
call(82894, "Partners", "Partners (3.7)"),
call(94990, "Quadruple Crossing - Leaping Left", "Quadruple Crossing - Leaping Left (4.7)"),
call(101970, "Don't Bait - Out", "Don't Bait - Out"),
call(104682, "Dodge 1", "Dodge 1"),
call(106370, "Partners", "Partners (3.7)"),
call(107527, "Dodge 2", "Dodge 2"),
call(116951, "Raidwide", "Raidwide (4.7)"),
// TODO: watch positions for this and call out safe spot?
call(170497, "Kick on Pupuqeto Fufuqeto - Knock", "Kick on Pupuqeto Fufuqeto - Knock (5.3)"),
call(181677, "Punch on Liliwure Ririwure", "Punch on Liliwure Ririwure (5.3)"),
call(192824, "Kick on YOU - Knock", "Kick on YOU - Knock (5.3)"),
call(203971, "Punch on Boboze Boze", "Punch on Boboze Boze (5.3)"),
call(218273, "Tankbuster on Boboze Boze", "Tankbuster on Boboze Boze (4.7)"),
call(229305, "Knockback into Spread", "Knockback into Spread (6.7)"),
call(236293, "Spread", "Spread (3.5)"),
call(257790, "Right then Left (West)", "Right then Left (West) (6.4)"),
call(264523, "Left", "Left"),
call(279083, "Quadruple Crossing - Leaping Right", "Quadruple Crossing - Leaping Right (4.7)"),
call(286073, "Don't Bait - Out", "Don't Bait - Out"),
call(288791, "Dodge 1", "Dodge 1"),
call(291642, "Dodge 2", "Dodge 2"),
call(318257, "Party Stacks - West, In First", "Party Stacks - West, In First (4.7)"),
// TODO: this is a tiny fraction of a second too early
call(324990, "Out", "Out"),
call(342432, "Bait Protean", "Bait Protean (7.7)"),
call(351045, "Out", "Out (7.7)"),
call(353191, "Dodge 1", "Dodge 1"),
call(356042, "Dodge 2", "Dodge 2"),
call(365501, "Raidwide", "Raidwide (4.7)"),
call(419134, "Kick on Jujuqaju Guguqaju - Knock", "Kick on Jujuqaju Guguqaju - Knock (5.3)"),
call(423195, "Role Groups", "Role Groups (4.7)"),
call(431367, "Kick on Fifilu Filu - Knock", "Kick on Fifilu Filu - Knock (5.3)"),
call(435604, "Stack", "Stack (4.7)"),
call(443987, "Punch on Niqo Moqo", "Punch on Niqo Moqo (5.3)"),
call(448129, "Stack", "Stack (4.7)"),
call(456504, "Punch on Rorasu Qorasu", "Punch on Rorasu Qorasu (5.3)"),
call(460560, "Role Groups", "Role Groups (4.7)"),
call(470678, "Tankbuster on Boboze Boze", "Tankbuster on Boboze Boze (4.7)"),
call(482756, "Knockback into Spread", "Knockback into Spread (6.7)"),
call(489754, "Spread", "Spread (3.5)"),
call(507274, "Tethers and Stacks", "Tethers and Stacks (5.7)"),
call(514270, "Tethers and Stacks", "Tethers and Stacks (4.7)"),
call(520289, "Tethers and Stacks", "Tethers and Stacks (4.7)"),
call(548174, "Watch Pounces", "Watch Pounces (12.7)"),
call(561392, "Left then Right", "Left then Right (5.7)"),
call(567869, "Right", "Right")
);
}
}
Loading

0 comments on commit 7d2baf7

Please sign in to comment.