Merge origin/master

This commit is contained in:
LevelX2 2019-12-28 00:45:39 +01:00
commit 1fe0485694
4 changed files with 50 additions and 21 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.d;
import java.util.UUID;
@ -29,7 +28,9 @@ public final class DescendantsPath extends CardImpl {
public DescendantsPath(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
// At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.
// At the beginning of your upkeep, reveal the top card of your library.
// If it's a creature card that shares a creature type with a creature you control,
// you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DescendantsPathEffect(), TargetController.YOU, false);
this.addAbility(ability);
}
@ -48,7 +49,10 @@ class DescendantsPathEffect extends OneShotEffect {
public DescendantsPathEffect() {
super(Outcome.Discard);
this.staticText = "reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library";
this.staticText = "reveal the top card of your library. If it's a creature "
+ "card that shares a creature type with a creature you control, "
+ "you may cast that card without paying its mana cost. Otherwise, "
+ "put that card on the bottom of your library";
}
public DescendantsPathEffect(final DescendantsPathEffect effect) {
@ -83,7 +87,10 @@ class DescendantsPathEffect extends OneShotEffect {
if (found) {
game.informPlayers(sourceObject.getLogName() + ": Found a creature that shares a creature type with the revealed card.");
if (controller.chooseUse(Outcome.Benefit, "Cast the card?", source, game)) {
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
controller.cast(controller.chooseAbilityForCast(card, game, true),
game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
} else {
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " canceled casting the card.");
controller.getLibrary().putOnBottom(card, game);

View file

@ -1,4 +1,3 @@
package mage.cards.g;
import java.util.UUID;
@ -27,7 +26,8 @@ public final class Galvanoth extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of your upkeep, you may look at the top card of your library. If it's an instant or sorcery card, you may cast it without paying its mana cost.
// At the beginning of your upkeep, you may look at the top card of your library.
// If it's an instant or sorcery card, you may cast it without paying its mana cost.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GalvanothEffect(), TargetController.YOU, true));
}
@ -45,7 +45,8 @@ class GalvanothEffect extends OneShotEffect {
public GalvanothEffect() {
super(Outcome.PlayForFree);
staticText = "look at the top card of your library. If it's an instant or sorcery card, you may cast it without paying its mana cost";
staticText = "look at the top card of your library. If it's an instant or "
+ "sorcery card, you may cast it without paying its mana cost";
}
public GalvanothEffect(final GalvanothEffect effect) {
@ -61,7 +62,10 @@ class GalvanothEffect extends OneShotEffect {
controller.lookAtCards(source, null, new CardsImpl(card), game);
if (card.isInstant() || card.isSorcery()) {
if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName() + " without paying its mana cost?", source, game)) {
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
controller.cast(controller.chooseAbilityForCast(card, game, true),
game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
}
}
}

View file

@ -35,7 +35,10 @@ public final class SunbirdsInvocation extends CardImpl {
public SunbirdsInvocation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}");
// Whenever you cast a spell from your hand, reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a card revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order.
// Whenever you cast a spell from your hand, reveal the top X cards of your library,
// where X is that spell's converted mana cost. You may cast a card revealed this
// way with converted mana cost X or less without paying its mana cost. Put the
// rest on the bottom of your library in a random order.
this.addAbility(new SunbirdsInvocationTriggeredAbility());
}
@ -97,7 +100,10 @@ class SunbirdsInvocationEffect extends OneShotEffect {
public SunbirdsInvocationEffect() {
super(Outcome.PutCardInPlay);
staticText = "reveal the top X cards of your library, where X is that spell's converted mana cost. You may cast a card revealed this way with converted mana cost X or less without paying its mana cost. Put the rest on the bottom of your library in a random order";
staticText = "reveal the top X cards of your library, where X is that "
+ "spell's converted mana cost. You may cast a card revealed this "
+ "way with converted mana cost X or less without paying its mana cost. "
+ "Put the rest on the bottom of your library in a random order";
}
public SunbirdsInvocationEffect(final SunbirdsInvocationEffect effect) {
@ -129,8 +135,13 @@ class SunbirdsInvocationEffect extends OneShotEffect {
Card card = cards.get(target.getFirstTarget(), game);
if (card != null) {
if (controller.chooseUse(Outcome.Benefit, "Cast " + card.getLogName() + " without paying its mana cost?", source, game)) {
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
cards.remove(card);
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
Boolean cardWasCast = controller.cast(controller.chooseAbilityForCast(card, game, true),
game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
if (cardWasCast) {
cards.remove(card);
}
}
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.s;
import java.util.UUID;
@ -46,10 +45,14 @@ public final class Sunforger extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +4/+0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(4, 0, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BoostEquippedEffect(4, 0, Duration.WhileOnBattlefield)));
// {R}{W}, Unattach Sunforger: Search your library for a red or white instant card with converted mana cost 4 or less and cast that card without paying its mana cost. Then shuffle your library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SunforgerEffect(), new ManaCostsImpl("{R}{W}"));
// {R}{W}, Unattach Sunforger: Search your library for a red or white
// instant card with converted mana cost 4 or less and cast that card
// without paying its mana cost. Then shuffle your library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SunforgerEffect(), new ManaCostsImpl("{R}{W}"));
ability.addCost(new SunforgerUnattachCost(this.getName()));
this.addAbility(ability);
@ -72,7 +75,9 @@ class SunforgerEffect extends OneShotEffect {
public SunforgerEffect() {
super(Outcome.PlayForFree);
staticText = "Search your library for a red or white instant card with converted mana cost 4 or less and cast that card without paying its mana cost. Then shuffle your library";
staticText = "Search your library for a red or white instant "
+ "card with converted mana cost 4 or less and cast that "
+ "card without paying its mana cost. Then shuffle your library";
}
public SunforgerEffect(final SunforgerEffect effect) {
@ -90,12 +95,11 @@ class SunforgerEffect extends OneShotEffect {
if (controller != null) {
if (controller.getLibrary().hasCards()) {
/**
* 10/1/2005 Any card you find must be legally castable (for
* 10/1/2005 Any card you find must be legally cast-able (for
* example, you have to be able to choose a legal target for
* it). If you can't find a castable card (or choose not to),
* it). If you can't find a cast-able card (or choose not to),
* nothing happens and you shuffle your library.
*/
FilterCard filter = new FilterCard("red or white instant card with converted mana cost 4 or less");
TargetCardInLibrary target = new TargetCardInLibrary(filter);
filter.add(Predicates.or(
@ -108,7 +112,10 @@ class SunforgerEffect extends OneShotEffect {
UUID targetId = target.getFirstTarget();
Card card = game.getCard(targetId);
if (card != null) {
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
controller.cast(controller.chooseAbilityForCast(card, game, true),
game, true, new MageObjectReference(source.getSourceObject(game), game));
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
}
}
}