mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
- Fixed #5468
This commit is contained in:
parent
fbca0f4fef
commit
2fca196f79
2 changed files with 18 additions and 8 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.filter.predicate.other;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -14,7 +13,6 @@ import mage.target.Target;
|
|||
* @author jeffwadsworth
|
||||
*/
|
||||
// Use this predicate if a aura card comes into play attached to a permanent without targeting
|
||||
|
||||
public class AuraCardCanAttachToPermanentId implements Predicate<Card> {
|
||||
|
||||
private final UUID toBeCheckedPermanentId;
|
||||
|
|
@ -27,10 +25,14 @@ public class AuraCardCanAttachToPermanentId implements Predicate<Card> {
|
|||
public boolean apply(Card input, Game game) {
|
||||
final Permanent permanent = game.getPermanent(toBeCheckedPermanentId);
|
||||
Filter filter;
|
||||
for (Target target : input.getSpellAbility().getTargets()) {
|
||||
filter = target.getFilter();
|
||||
if (filter.match(permanent, game)) {
|
||||
return true;
|
||||
if (permanent != null
|
||||
&& input != null
|
||||
&& input.isEnchantment()) {
|
||||
for (Target target : input.getSpellAbility().getTargets()) {
|
||||
filter = target.getFilter();
|
||||
if (filter.match(permanent, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -40,4 +42,4 @@ public class AuraCardCanAttachToPermanentId implements Predicate<Card> {
|
|||
public String toString() {
|
||||
return "AuraCardCanAttachToPermanentId(" + toBeCheckedPermanentId + ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue