Skip to content

Commit

Permalink
Fixes for m1s and m2s
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Aug 4, 2024
1 parent deee372 commit 2b5462f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,22 @@ else if (pos2.isCardinal()) {
if (delta == 3) {
// e.g. S + NW
// If hitting left first, start on cardinal side. S cleaves W, NW cleaves NE, so only S-SE is safe
s.updateCall(soulshadeCardinalFirst, e1);
if (e1.abilityIdMatches(0x9467)) {
s.updateCall(soulshadeCardinalFirst, e1);
}
else {
s.updateCall(soulshadeIntercardFirst, e1);
}
}
else if (delta == -3) {
// e.g. S + NE
s.updateCall(soulshadeIntercardFirst, e1);
// If hitting left first, start on intercardinal side. S cleaves W, NE cleaves SE, so only N-NW is afe.
if (e1.abilityIdMatches(0x9467)) {
s.updateCall(soulshadeIntercardFirst, e1);
}
else {
s.updateCall(soulshadeCardinalFirst, e1);
}
}
else {
throw new RuntimeException("Could not determine delta! %s %s".formatted(e1.getSource().getPos(), e2.getSource().getPos()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ private static int nisiBuffGroup(BuffApplied buff) {
s.updateCall(rottenInitialPartner, playerBuff);
s.waitMs(2500);
for (int i = 1; i <= 4; i++) {
int currentGroup = i;
final int currentGroup = i;
s.setParam("currentGroup", currentGroup);
// Iterate through groups
if (playerGroup == 1) {
if (playerGroup == currentGroup) {
s.updateCall(rottenPopNow, playerBuff);
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ModifiableCalloutTraceInfo implements CalloutTraceInfo {
Expand All @@ -32,22 +34,26 @@ public ModifiableCalloutTraceInfo(RawModifiedCallout<?> raw) {
this.args = Collections.unmodifiableMap(new HashMap<>(raw.getArguments()));
}


@Override
public String getOriginDescription() {
private String getOriginDescriptionInt(boolean multiline) {
if (calloutDesc == null && calloutField == null) {
return "Unknown";
}
else {
StringBuilder out = new StringBuilder();
List<String> items = new ArrayList<>();
if (calloutField != null) {
out.append(calloutField.getDeclaringClass().getSimpleName()).append('.').append(calloutField.getName()).append('\n');
items.add("%s.%s".formatted(calloutField.getDeclaringClass().getSimpleName(), calloutField.getName()));
}
if (calloutDesc != null) {
out.append(calloutDesc).append('\n');
items.add(calloutDesc);
}
return out.toString();
return String.join(multiline ? "\n" : ": ", items);
}

}

@Override
public String getOriginDescription() {
return getOriginDescriptionInt(true);
}

@Override
Expand All @@ -71,6 +77,6 @@ public Field getCalloutField() {

@Override
public String toString() {
return "ModifiableCalloutTraceInfo(%s)".formatted(this.getOriginDescription());
return "ModifiableCalloutTraceInfo(%s)".formatted(this.getOriginDescriptionInt(false));
}
}

0 comments on commit 2b5462f

Please sign in to comment.