Skip to content

Commit

Permalink
Fix Wrist Blade patch on main
Browse files Browse the repository at this point in the history
  • Loading branch information
dbjorge committed Nov 21, 2019
1 parent 6c77140 commit fbc3616
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
// This patch fixes an issue where Wrist Blade is supposed to only apply to attacks, but actually applies to any
// card which deals direct damage. This causes a mistaken interaction with Wanderer's Snake Oil.
public class WristBladeShouldOnlyApplyToAttacksPatch {
public static boolean shouldSuppressFor(String relicId, AbstractCard c) {
return relicId.equals(WristBlade.ID) && c.type != AbstractCard.CardType.ATTACK;
}

public static boolean shouldSuppressFor(AbstractRelic r, AbstractCard c) {
return r.relicId.equals(WristBlade.ID) && c.type != AbstractCard.CardType.ATTACK;
}
Expand Down Expand Up @@ -41,6 +45,7 @@ public void edit(MethodCall methodCall) throws CannotCompileException {
methodCall.replace(String.format(
"{ $_ = ($proceed($$) && !%1$s.shouldSuppressFor($1, this)); }",
WristBladeShouldOnlyApplyToAttacksPatch.class.getName()));
return;
}

// On the beta branch, Wrist Blade instead uses a new hook called atDamageGive.
Expand All @@ -54,6 +59,7 @@ public void edit(MethodCall methodCall) throws CannotCompileException {
methodCall.replace(String.format(
"{ $_ = (%1$s.shouldSuppressFor($0, this) ? $1 : $proceed($$)); }",
WristBladeShouldOnlyApplyToAttacksPatch.class.getName()));
return;
}
}
};
Expand Down

0 comments on commit fbc3616

Please sign in to comment.