mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
- Fixed Zur's Weirdling.
This commit is contained in:
parent
66362aa797
commit
15a2b3444e
1 changed files with 38 additions and 31 deletions
|
|
@ -31,6 +31,7 @@ import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.costs.common.PayLifeCost;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.abilities.effects.common.continuous.PlayWithHandRevealedEffect;
|
import mage.abilities.effects.common.continuous.PlayWithHandRevealedEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
|
@ -53,7 +54,7 @@ import mage.players.Player;
|
||||||
public class ZursWeirding extends CardImpl {
|
public class ZursWeirding extends CardImpl {
|
||||||
|
|
||||||
public ZursWeirding(UUID ownerId, CardSetInfo setInfo) {
|
public ZursWeirding(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
|
||||||
|
|
||||||
// Players play with their hands revealed.
|
// Players play with their hands revealed.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithHandRevealedEffect(TargetController.ANY)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithHandRevealedEffect(TargetController.ANY)));
|
||||||
|
|
@ -95,34 +96,7 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
Player player = game.getPlayer(event.getTargetId());
|
return true;
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
|
||||||
if (player != null && sourceObject != null) {
|
|
||||||
Card card = player.getLibrary().getFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
// reveals it instead
|
|
||||||
player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + '|' + game.getPhase().getType() + ')', new CardsImpl(card), game);
|
|
||||||
|
|
||||||
// Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard
|
|
||||||
String message = "Pay 2 life to put " + card.getLogName() + " into graveyard?";
|
|
||||||
for (UUID playerId : game.getState().getPlayersInRange(player.getId(), game)) {
|
|
||||||
if (playerId.equals(player.getId())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Player otherPlayer = game.getPlayer(playerId);
|
|
||||||
if (otherPlayer.canPayLifeCost()
|
|
||||||
&& otherPlayer.getLife() >= 2
|
|
||||||
&& otherPlayer.chooseUse(Outcome.Benefit, message, source, game)) {
|
|
||||||
otherPlayer.loseLife(2, game, false);
|
|
||||||
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -132,7 +106,40 @@ class ZursWeirdingReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
return true;
|
boolean paid = false;
|
||||||
}
|
Player player = game.getPlayer(event.getTargetId());
|
||||||
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
|
if (player != null
|
||||||
|
&& sourceObject != null) {
|
||||||
|
Card card = player.getLibrary().getFromTop(game);
|
||||||
|
if (card != null) {
|
||||||
|
// Reveals it instead
|
||||||
|
player.revealCards(sourceObject.getIdName() + " next draw of " + player.getName() + " (" + game.getTurnNum() + '|' + game.getPhase().getType() + ')', new CardsImpl(card), game);
|
||||||
|
|
||||||
|
// Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard
|
||||||
|
String message = "Pay 2 life to put " + card.getLogName() + " into " + player.getLogName() + " graveyard?";
|
||||||
|
|
||||||
|
for (UUID playerId : game.getState().getPlayersInRange(player.getId(), game)) {
|
||||||
|
if (playerId.equals(player.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Player otherPlayer = game.getPlayer(playerId);
|
||||||
|
if (otherPlayer.canPayLifeCost()
|
||||||
|
&& otherPlayer.getLife() >= 2) {
|
||||||
|
PayLifeCost lifeCost = new PayLifeCost(2);
|
||||||
|
while (otherPlayer.canRespond()
|
||||||
|
&& !paid
|
||||||
|
&& otherPlayer.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||||
|
paid = lifeCost.pay(source, game, source.getSourceId(), otherPlayer.getId(), false, null);
|
||||||
|
}
|
||||||
|
if (paid) {
|
||||||
|
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue