1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-13 01:01:11 -09:00

[AER] Inspiring Statuary display fix ()

This commit is contained in:
Alex Vasile 2022-07-08 21:37:31 -04:00 committed by GitHub
parent ea6cbcc962
commit f6ff32e38b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 62 deletions
Mage.Sets/src/mage/cards/i
Mage/src/main/java/mage/abilities

View file

@ -9,6 +9,7 @@ import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate;
import java.util.UUID;
@ -21,13 +22,17 @@ public final class InspiringStatuary extends CardImpl {
static {
filter.add(Predicates.not(CardType.ARTIFACT.getPredicate()));
filter.add(Predicates.not(CardType.LAND.getPredicate()));
filter.add(Predicates.not(new AbilityPredicate(ImproviseAbility.class))); // So there are not redundant copies being added to each card
}
public InspiringStatuary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Non-artifact spells you cast have improvise.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledSpellsEffect(new ImproviseAbility(), filter)));
ImproviseAbility improviseAbility = new ImproviseAbility();
improviseAbility.setRuleAtTheTop(false);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledSpellsEffect(improviseAbility, filter)));
}

View file

@ -41,7 +41,10 @@ public class GainAbilityControlledSpellsEffect extends ContinuousEffectImpl {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
if (player == null || permanent == null) {
return false;
}
for (Card card : game.getExile().getAllCards(game)) {
if (card.isOwnedBy(source.getControllerId())
&& filter.match(card, game)) {
@ -84,7 +87,6 @@ public class GainAbilityControlledSpellsEffect extends ContinuousEffectImpl {
}
}
}
}
return false;
return false; // TODO: Why is this returning false?
}
}

View file

@ -153,7 +153,9 @@ class ImproviseEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Spell spell = game.getStack().getSpell(source.getSourceId());
if (controller != null && spell != null) {
if (controller == null || spell == null) {
return false;
}
for (UUID artifactId : this.getTargetPointer().getTargets(game, source)) {
Permanent perm = game.getPermanent(artifactId);
if (perm == null) {
@ -174,7 +176,5 @@ class ImproviseEffect extends OneShotEffect {
}
return true;
}
return false;
}
}