fix text for enchantments that turn into creatures permanently

This commit is contained in:
theelk801 2025-06-14 10:14:29 -04:00
parent bcac563272
commit 96cc1e40ee
24 changed files with 256 additions and 656 deletions

View file

@ -12,7 +12,11 @@ import mage.game.permanent.Permanent;
*/
public class OpponentPlaysLandTriggeredAbility extends TriggeredAbilityImpl {
public OpponentPlaysLandTriggeredAbility(Zone zone, Effect effect, Boolean optional) {
public OpponentPlaysLandTriggeredAbility(Effect effect, boolean optional) {
this(Zone.BATTLEFIELD, effect, optional);
}
public OpponentPlaysLandTriggeredAbility(Zone zone, Effect effect, boolean optional) {
super(zone, effect, optional);
setTriggerPhrase("Whenever an opponent plays a land, ");
}

View file

@ -0,0 +1,27 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import java.util.Optional;
/**
* @author TheElk801
*/
public enum SourceIsEnchantmentCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return Optional
.ofNullable(source.getSourcePermanentOrLKI(game))
.filter(permanent -> permanent.isEnchantment(game))
.isPresent();
}
@Override
public String toString() {
return "this permanent is an enchantment";
}
}