Fix AI not targeting triggered Random Charm (#8955)

This commit is contained in:
tool4ever
2025-10-19 20:57:11 +02:00
committed by GitHub
parent 80a4a42575
commit 6f38479190
10 changed files with 33 additions and 24 deletions

View File

@@ -982,6 +982,9 @@ public class AbilityUtils {
for (final Card c : getDefinedCards(card, "Targeted", sa)) {
players.add(c.getOwner());
}
for (final SpellAbility s : getDefinedSpellAbilities(card, "Targeted", sa)) {
players.add(s.getHostCard().getOwner());
}
} else if (defined.equals("TargetedAndYou") && sa instanceof SpellAbility) {
final SpellAbility saTargeting = ((SpellAbility)sa).getSATargetingPlayer();
if (saTargeting != null) {
@@ -1118,10 +1121,8 @@ public class AbilityUtils {
final String replacingType = defined.substring(8);
o = root.getReplacingObject(AbilityKey.fromString(replacingType));
}
if (o != null) {
if (o instanceof Player) {
players.add((Player) o);
}
if (o instanceof Player) {
players.add((Player) o);
}
} else if (defined.startsWith("Non")) {
players.addAll(game.getPlayersInTurnOrder());

View File

@@ -2496,7 +2496,7 @@ public class CardFactoryUtil {
inst.addReplacement(re);
} else if (keyword.equals("Read ahead")) {
String repeffstr = "Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield | Secondary$ True | ReplacementResult$ Updated | Description$ Choose a chapter and start with that many lore counters.";
String effStr = "DB$ PutCounter | Defined$ Self | CounterType$ LORE | ETB$ True | UpTo$ True | UpToMin$ 1 | ReadAhead$ True | CounterNum$ FinalChapterNr";
String effStr = "DB$ PutCounter | Defined$ Self | CounterType$ LORE | ETB$ True | UpTo$ True | UpToMin$ 1 | CounterNum$ FinalChapterNr";
SpellAbility saCounter = AbilityFactory.getAbility(effStr, card);
saCounter.setSVar("FinalChapterNr", "Count$FinalChapterNr");