Fix Leonardo (#8949)

This commit is contained in:
tool4ever
2025-10-19 10:15:36 +02:00
committed by GitHub
parent 472f94af66
commit 24ef895cb7
4 changed files with 9 additions and 24 deletions

View File

@@ -275,27 +275,6 @@ public class AiAttackController {
return false;
}
// the attacker will die to a triggered ability (e.g. Sarkhan the Masterless)
for (Card c : ai.getOpponents().getCardsIn(ZoneType.Battlefield)) {
for (Trigger t : c.getTriggers()) {
if (t.getMode() == TriggerType.Attacks) {
SpellAbility sa = t.ensureAbility();
if (sa == null) {
continue;
}
if (sa.getApi() == ApiType.EachDamage && "TriggeredAttacker".equals(sa.getParam("Defined"))) {
List<Card> valid = CardLists.getValidCards(c.getController().getCreaturesInPlay(), sa.getParam("ValidCards"), c.getController(), c, sa);
// TODO: this assumes that 1 damage is dealt per creature. Improve this to check the parameter/X to determine
// how much damage is dealt by each of the creatures in the valid list.
if (attacker.getNetToughness() <= valid.size()) {
return false;
}
}
}
}
}
if ("TRUE".equals(attacker.getSVar("HasAttackEffect"))) {
return true;
}
@@ -1005,7 +984,7 @@ public class AiAttackController {
if (attackMax != -1 && combat.getAttackers().size() >= attackMax)
return aiAggression;
// TODO if lifeInDanger use chance to hold back some
// TODO if lifeInDanger use chance to hold back some (especially in multiplayer)
if (canAttackWrapper(attacker, defender) && isEffectiveAttacker(ai, attacker, combat, defender)) {
combat.addAttacker(attacker, defender);
}

View File

@@ -1433,7 +1433,11 @@ public class ComputerUtilCombat {
int damage = AbilityUtils.calculateAmount(source, sa.getParam("NumDmg"), sa);
toughness -= predictDamageTo(attacker, damage, source, false);
continue;
} else if (sa.getApi() == ApiType.EachDamage && "TriggeredAttackerLKICopy".equals(sa.getParam("Defined"))) {
List<Card> valid = CardLists.getValidCards(source.getController().getCreaturesInPlay(), sa.getParam("ValidCards"), source.getController(), source, sa);
// TODO: this assumes that 1 damage is dealt per creature. Improve this to check the parameter/X to determine
// how much damage is dealt by each of the creatures in the valid list.
toughness -= valid.size();
} else if (ApiType.Pump.equals(sa.getApi())) {
if (!sa.hasParam("NumDef")) {
continue;

View File

@@ -2469,7 +2469,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
|| keyword.startsWith("Reconfigure") || keyword.startsWith("Squad")
|| keyword.startsWith("Miracle") || keyword.startsWith("More Than Meets the Eye")
|| keyword.startsWith("Level up") || keyword.startsWith("Plot")
|| keyword.startsWith("Offspring") || keyword.startsWith("Mayhem")) {
|| keyword.startsWith("Offspring") || keyword.startsWith("Mayhem")
|| keyword.startsWith("Sneak")) {
String[] k = keyword.split(":");
sbLong.append(k[0]);
if (k.length > 1) {

View File

@@ -3645,6 +3645,7 @@ public class CardFactoryUtil {
newSA.putParam("Secondary", "True");
newSA.setAlternativeCost(AlternativeCost.Sneak);
newSA.setIntrinsic(intrinsic);
newSA.getRestrictions().setInstantSpeed(true);
inst.addSpellAbility(newSA);
} else if (keyword.startsWith("Station")) {
String effect = "AB$ PutCounter | Cost$ tapXType<1/Creature.Other> | Defined$ Self " +