mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
Fix reflected only checking activated mana abilities (#9058)
This commit is contained in:
@@ -1340,7 +1340,7 @@ public class AbilityUtils {
|
||||
resolvePreAbilities(sa, game);
|
||||
|
||||
// count times ability resolves this turn
|
||||
if (!sa.isWrapper()) {
|
||||
if (!sa.isWrapper() && sa.isAbility()) {
|
||||
final Card host = sa.getHostCard();
|
||||
if (host != null) {
|
||||
host.addAbilityResolved(sa);
|
||||
|
||||
@@ -34,6 +34,7 @@ import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityPredicates;
|
||||
import forge.game.spellability.TargetRestrictions;
|
||||
import forge.game.trigger.Trigger;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.collect.FCollection;
|
||||
@@ -304,20 +305,26 @@ public final class CardUtil {
|
||||
} else if (reflectProperty.equals("Produce")) {
|
||||
final FCollection<SpellAbility> abilities = new FCollection<>();
|
||||
for (final Card c : cards) {
|
||||
abilities.addAll(c.getManaAbilities());
|
||||
abilities.addAll(c.getSpellAbilities());
|
||||
for (Trigger trig : c.getTriggers()) {
|
||||
abilities.add(trig.ensureAbility());
|
||||
}
|
||||
}
|
||||
|
||||
final List<SpellAbility> reflectAbilities = Lists.newArrayList();
|
||||
|
||||
for (final SpellAbility ab : abilities) {
|
||||
if (ab.isSpell()) {
|
||||
continue;
|
||||
}
|
||||
if (maxChoices == colors.size()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (ab.getApi() == ApiType.ManaReflected) {
|
||||
// Recursion! Set Activator to controller for appropriate valid comparison
|
||||
ab.setActivatingPlayer(ab.getHostCard().getController());
|
||||
if (ab.getApi() == ApiType.ManaReflected && !"Produced".equals(ab.getParam("ReflectProperty"))) {
|
||||
if (!parents.contains(ab.getHostCard())) {
|
||||
// Recursion! Set Activator to controller for appropriate valid comparison
|
||||
ab.setActivatingPlayer(ab.getHostCard().getController());
|
||||
reflectAbilities.add(ab);
|
||||
parents.add(ab.getHostCard());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user