Some fixes (#6575)

This commit is contained in:
tool4ever
2024-11-14 10:34:05 +01:00
committed by GitHub
parent 919832cc06
commit ac96890f44
10 changed files with 29 additions and 24 deletions

View File

@@ -2456,7 +2456,7 @@ public class GameAction {
game.getAction().reveal(milledPlayer, destination, p, false, message, addSuffix);
}
game.getGameLog().add(GameLogEntryType.ZONE_CHANGE, p + " milled " +
Lang.joinHomogenous(milled) + toZoneStr + ".");
Lang.joinHomogenous(milledPlayer) + toZoneStr + ".");
}
}

View File

@@ -1640,9 +1640,15 @@ public class AbilityUtils {
return doXMath(calculateAmount(c, sq[v ? 1 : 2], ctb), expr, c, ctb);
}
SpellAbility sa = null;
if (ctb instanceof SpellAbility) {
final SpellAbility sa = (SpellAbility) ctb;
sa = (SpellAbility) ctb;
} else if (sq[0].contains("xPaid") && ctb instanceof TriggerReplacementBase) {
// try avoid fallback
sa = ((TriggerReplacementBase) ctb).getOverridingAbility();
}
if (sa != null) {
// special logic for xPaid in SpellAbility
if (sq[0].contains("xPaid")) {
SpellAbility root = sa.getRootAbility();
@@ -1672,7 +1678,8 @@ public class AbilityUtils {
// and the spell that became that object as it resolved had a value of X chosen for any of its costs,
// the value of X for that ability is the same as the value of X for that spell, although the value of X for that permanent is 0.
if (TriggerType.ChangesZone.equals(t.getMode()) && ZoneType.Battlefield.name().equals(t.getParam("Destination"))) {
return doXMath(c.getXManaCostPaid(), expr, c, ctb);
int x = isUnlinkedFromCastSA(ctb, c) ? 0 : c.getXManaCostPaid();
return doXMath(x, expr, c, ctb);
} else if (TriggerType.SpellCast.equals(t.getMode())) {
// Cast Trigger like Hydroid Krasis
SpellAbilityStackInstance castSI = (SpellAbilityStackInstance) root.getTriggeringObject(AbilityKey.StackInstance);
@@ -1696,7 +1703,8 @@ public class AbilityUtils {
}
if (root.isReplacementAbility() && sa.hasParam("ETB")) {
return doXMath(c.getXManaCostPaid(), expr, c, ctb);
int x = isUnlinkedFromCastSA(ctb, c) ? 0 : c.getXManaCostPaid();
return doXMath(x, expr, c, ctb);
}
return doXMath(0, expr, c, ctb);

View File

@@ -105,6 +105,7 @@ public interface ICostVisitor<T> {
public T visit(CostFlipCoin cost) {
return null;
}
@Override
public T visit(CostForage cost) {
return null;
@@ -146,7 +147,9 @@ public interface ICostVisitor<T> {
}
@Override
public T visit(CostPromiseGift cost) { return null; }
public T visit(CostPromiseGift cost) {
return null;
}
@Override
public T visit(CostPutCardToLib cost) {

View File

@@ -665,6 +665,7 @@ public class ReplacementHandler {
}
List<ReplacementEffect> possibleReplacers = new ArrayList<>(replaceCandidateMap.keySet());
// TODO should be able to choose different order for each entity
ReplacementEffect chosenRE = decider.getController().chooseSingleReplacementEffect(possibleReplacers);
List<Map<AbilityKey, Object>> runParamList = replaceCandidateMap.get(chosenRE);