Skip to content

Commit

Permalink
More m1s
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Jul 31, 2024
1 parent cade7b8 commit 2551dde
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
import gg.xp.xivsupport.events.triggers.seq.SequentialTrigger;
import gg.xp.xivsupport.events.triggers.seq.SqtTemplates;
import gg.xp.xivsupport.events.triggers.support.NpcCastCallout;
import gg.xp.xivsupport.models.ArenaSector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@CalloutRepo(name = "M1S", duty = KnownDuty.M1S)
public class M1S extends AutoChildEventHandler implements FilteredEventHandler {

private static final Logger log = LoggerFactory.getLogger(M1S.class);

public M1S(XivState state, StatusEffectRepository buffs) {
this.state = state;
this.buffs = buffs;
Expand All @@ -34,49 +39,73 @@ public boolean enabled(EventContext context) {
}

private final ModifiableCallout<AbilityCastStart> quadrupleCrossingInitial = ModifiableCallout.durationBasedCall("Quadruple Crossing - Initial", "Quadruple Crossing");
private final ModifiableCallout<?> quadrupleCrossingBaitSecond = new ModifiableCallout<>("Quadruple Crossing - Bait Second Wave", "Cardinals to Intercards");
private final ModifiableCallout<?> quadrupleCrossingDontBaitSecond = new ModifiableCallout<>("Quadruple Crossing - Avoid Second Wave", "Cardinals to Intercards");
private final ModifiableCallout<AbilityCastStart> quadrupleCrossingInitialLeaping = ModifiableCallout.durationBasedCall("Quadruple Crossing - Initial (Leaping)", "Quadruple Crossing on Clone");
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(0, 1),
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x943C, 0x982F),
(e1, s) -> {
s.updateCall(quadrupleCrossingInitial, e1);
s.updateCall(e1.abilityIdMatches(0x943C) ? quadrupleCrossingInitial : quadrupleCrossingInitialLeaping, e1);
s.waitMs(50);
s.waitEvent(AbilityUsedEvent.class, aue -> aue.abilityIdMatches(0x943F, 0x9440));
s.waitEvent(AbilityUsedEvent.class, aue -> aue.abilityIdMatches(0x943F, 0x9440, 0x945B, 0x945C));
if (buffs.isStatusOnTarget(state.getPlayer(), 0xC3A)) {
s.updateCall(quadrupleCrossingDontBaitSecond);
}
else {
s.updateCall(quadrupleCrossingBaitSecond);
}
s.waitMs(50);
s.waitEvent(AbilityUsedEvent.class, aue -> aue.abilityIdMatches(0x943F, 0x9440));
s.waitEvent(AbilityUsedEvent.class, aue -> aue.abilityIdMatches(0x943F, 0x9440, 0x945B, 0x945C));
s.updateCall(quadrupleCrossingThird);
s.waitMs(50);
s.waitEvent(AbilityUsedEvent.class, aue -> aue.abilityIdMatches(0x943F, 0x9440));
s.waitEvent(AbilityUsedEvent.class, aue -> aue.abilityIdMatches(0x943F, 0x9440, 0x945B, 0x945C));
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");
private final ModifiableCallout<AbilityCastStart> oneTwoLeapingRightFirst = ModifiableCallout.durationBasedCall("One Two (Leaping) - Right First", "Right then Left");
// TODO: these are not wired
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 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,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9438, 0x9439),
// TODO: 944F missing, 9471 (with party stacks)
/*
Leaping
944D left right (west)
944E right left (west)
944F left right (east)
9450 right left (east)
*/
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9438, 0x9439, 0x944E, 0x9450),
(e1, s) -> {
boolean leftFirst = e1.abilityIdMatches(0x9438);
if (leftFirst) {
s.updateCall(oneTwoLeftFirst, e1);
boolean leftFirst = e1.abilityIdMatches(0x9438, 0x944D, 0x944F);
boolean leaping = e1.getAbility().getId() > 0x9440;
if (leaping) {
s.setParam("whereClone", e1.abilityIdMatches(0x944F, 0x9450) ? ArenaSector.EAST : ArenaSector.WEST);
if (leftFirst) {
s.updateCall(leaping ? oneTwoLeapingLeftFirst : oneTwoLeftFirst, e1);
}
else {
s.updateCall(leaping ? oneTwoLeapingRightFirst : oneTwoRightFirst, e1);
}

}
else {
s.updateCall(oneTwoRightFirst, e1);
if (leftFirst) {
s.updateCall(leaping ? oneTwoLeapingLeftFirst : oneTwoLeftFirst, e1);
}
else {
s.updateCall(leaping ? oneTwoLeapingRightFirst : oneTwoRightFirst, e1);
}

}
var event = s.waitEvent(AbilityUsedEvent.class, aue -> aue.getPrecursor() == e1);
if (leftFirst) {
Expand All @@ -87,6 +116,8 @@ public boolean enabled(EventContext context) {
}
});

@NpcCastCallout(0x9494)
private final ModifiableCallout<AbilityCastStart> bloodyScratch = ModifiableCallout.durationBasedCall("Bloody Scratch", "Raidwide");
@NpcCastCallout(0x9495)
private final ModifiableCallout<AbilityCastStart> biscuitMaker = ModifiableCallout.durationBasedCall("Biscuit Maker", "Tankbuster on {event.target}");

Expand Down Expand Up @@ -115,11 +146,15 @@ public boolean enabled(EventContext context) {
// Initial Mouser cast
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9441),
(e1, s) -> {
log.info("mouser start");
// first invocation:
// just call out whether it's on supports or dps
// Call out each kick
for (int i = 0; i < 4; i++) {
var hm = s.waitEvent(HeadMarkerEvent.class, hme -> hme.getMarkerOffset() == 320);
log.info("mouser {}", i);
// var hm = s.waitEvent(HeadMarkerEvent.class, hme -> hme.getMarkerOffset() == 320);
// TODO: is offset even needed?
var hm = s.waitEvent(HeadMarkerEvent.class, hme -> true);
s.setParam("hm", hm);
var cast = s.waitEvent(AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9446, 0x9448));
if (cast.abilityIdMatches(0x9446)) {
Expand All @@ -129,6 +164,7 @@ public boolean enabled(EventContext context) {
s.updateCall(punch, cast);
}
}
log.info("mouser end");
});

private final ModifiableCallout<AbilityCastStart> splintering = ModifiableCallout.durationBasedCall("Splintering Nails", "Role Groups");
Expand All @@ -138,18 +174,20 @@ public boolean enabled(EventContext context) {
@AutoFeed
private final SequentialTrigger<BaseEvent> mouserExtra = SqtTemplates.multiInvocation(120_000,
AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9441),
(e1, s) -> log.info("mouserExtra: ignoring first"),
(e1, s) -> {
},
(e1, s) -> {
log.info("mouserExtra: second start");
for (int i = 0; i < 4; i++) {
log.info("mouserExtra: {}", i);
var cast = s.waitEvent(AbilityCastStart.class, acs -> acs.abilityIdMatches(0x9497, 0x9499));
if (cast.abilityIdMatches(0x9499)) {
s.updateCall(splintering, e1);
s.updateCall(splintering, cast);
}
else {
s.updateCall(stack, e1);
s.updateCall(stack, cast);
}
}
log.info("mouserExtra: second end");
});

private final ModifiableCallout<AbilityCastStart> shockwave = ModifiableCallout.durationBasedCall("Shockwave", "Knockback into Spread");
Expand All @@ -166,7 +204,16 @@ public boolean enabled(EventContext context) {

// For leaping one-two
//Tempestuous tear 0x9483 is the light party stacks
@NpcCastCallout(0x9483)
private final ModifiableCallout<AbilityCastStart> lightParties = ModifiableCallout.durationBasedCall("Tempestuous Tear", "Light Parties");

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

/*
TODO:
Nailchipper is the proteans + head markers
Soulshade one-two paw - like e9s cleaves
It also uses this during the light parties mechanic
*/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package gg.xp.xivsupport.triggers.Arcadion;

import gg.xp.reevent.events.BaseEvent;
import gg.xp.reevent.events.EventContext;
import gg.xp.reevent.scan.AutoChildEventHandler;
import gg.xp.reevent.scan.FilteredEventHandler;
import gg.xp.xivdata.data.duties.*;
import gg.xp.xivsupport.callouts.CalloutRepo;
import gg.xp.xivsupport.callouts.ModifiableCallout;
import gg.xp.xivsupport.events.actlines.events.AbilityCastStart;
import gg.xp.xivsupport.events.state.XivState;
import gg.xp.xivsupport.events.state.combatstate.StatusEffectRepository;
import gg.xp.xivsupport.events.triggers.seq.SequentialTrigger;
import gg.xp.xivsupport.events.triggers.support.NpcCastCallout;

@CalloutRepo(name = "M2S", duty = KnownDuty.M2S)
public class M2S extends AutoChildEventHandler implements FilteredEventHandler {
public M2S(XivState state, StatusEffectRepository buffs) {
this.state = state;
this.buffs = buffs;
}

private XivState state;
private StatusEffectRepository buffs;

@Override
public boolean enabled(EventContext context) {
return state.dutyIs(KnownDuty.M2S);
}
//
// @NpcCastCallout()
// private final ModifiableCallout<AbilityCastStart> raidwide = ModifiableCallout.durationBasedCall("Something", "Raidwide");
// @NpcCastCallout()
// private final ModifiableCallout<AbilityCastStart> tankstack = ModifiableCallout.durationBasedCall("Something", "Tank Stack");
// @NpcCastCallout(value = 0xTODO, suppressMs = 100)
// private final ModifiableCallout<AbilityCastStart> killerSting = ModifiableCallout.durationBasedCall("Killer Sting", "Tank Cleaves");
//
// private final SequentialTrigger<BaseEvent>
}

0 comments on commit 2551dde

Please sign in to comment.