private void setChosenSubtype(SubTypeList subtype, SubType choice) { if (subtype.size() != 1 || !subtype.contains(choice)) { subtype.removeAll(SubType.getCreatureTypes(false)); subtype.add(choice); } }
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { for (UUID targetId : targetPointer.getTargets(game, source)) { if (targetId != null) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { permanent.getCardType().remove(CardType.ARTIFACT); permanent.getSubtype(game).removeAll(SubType.getArtifactTypes(false)); } break; } return true; } } } return false; }
@Override public boolean apply(Game game, Ability source) { List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { if (permanent != null) { SubTypeList subtype = permanent.getSubtype(game); if (subtype != null && (subtype.size() != 1 || !subtype.contains(SubType.SHADE))) { subtype.removeAll(SubType.getCreatureTypes(false)); subtype.add(SubType.SHADE); } } } return true; }
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (cardName == null) { return false; } FilterPermanent filter2 = filter.copy(); filter2.add(new NamePredicate(cardName)); for (Permanent land : game.getBattlefield().getActivePermanents(filter2, source.getControllerId(), game)) { switch (layer) { case TypeChangingEffects_4: // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects // So the ability removing has to be done before Layer 6 land.removeAllAbilities(source.getSourceId(), game); land.getSubtype(game).removeAll(SubType.getLandTypes(false)); break; case AbilityAddingRemovingEffects_6: land.addAbility(new AnyColorManaAbility(), source.getSourceId(), game); break; } } return true; }
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { switch (layer) { case TypeChangingEffects_4: // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects // So the ability removing has to be done before Layer 6 land.removeAllAbilities(source.getSourceId(), game); land.getSubtype(game).removeAll(SubType.getLandTypes(false)); land.getSubtype(game).add(SubType.MOUNTAIN); break; case AbilityAddingRemovingEffects_6: land.addAbility(new RedManaAbility(), source.getSourceId(), game); break; } } return true; }
land.getSubtype(game).removeAll(SubType.getLandTypes(false)); land.getSubtype(game).addAll(landTypes); } else {
case TypeChangingEffects_4: permanent.getSubtype(game).removeAll(SubType.getLandTypes(false)); permanent.getSubtype(game).addAll(landTypes); break;