mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
* Some minor chnages.
This commit is contained in:
parent
00dd941260
commit
d10d6361ac
5 changed files with 58 additions and 18 deletions
|
|
@ -55,7 +55,7 @@ public class ContestedWarZone extends CardImpl {
|
|||
private static final FilterAttackingCreature filter = new FilterAttackingCreature("Attacking creatures");
|
||||
|
||||
public ContestedWarZone(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
|
||||
|
||||
// Whenever a creature deals combat damage to you, that creature's controller gains control of Contested War Zone.
|
||||
this.addAbility(new ContestedWarZoneAbility());
|
||||
|
|
@ -84,7 +84,7 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl {
|
|||
|
||||
public ContestedWarZoneAbility() {
|
||||
super(Zone.BATTLEFIELD, new ContestedWarZoneEffect());
|
||||
}
|
||||
}
|
||||
|
||||
public ContestedWarZoneAbility(final ContestedWarZoneAbility ability) {
|
||||
super(ability);
|
||||
|
|
@ -102,7 +102,7 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
||||
if (damageEvent.isCombatDamage()) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (damageEvent.getPlayerId().equals(getControllerId()) && permanent != null && permanent.isCreature()) {
|
||||
|
|
@ -137,7 +137,7 @@ class ContestedWarZoneEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString());
|
||||
if (permanent != null && controllerId != null) {
|
||||
return permanent.changeControllerId(controllerId, game);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.abilities.keywords;
|
|||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
|
@ -512,4 +513,45 @@ public class FlashbackTest extends CardTestPlayerBase {
|
|||
assertExileCount(playerA, dReturn, 1);
|
||||
assertPermanentCount(playerA, bSable, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* I can play Force of Will with flashback paying his alternative mana cost.
|
||||
* The ruling say no to it, because we only can choose one alternative cost
|
||||
* to a spell, and the flashback cost is already an alternative cost.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testSnapcasterMageSpellWithAlternateCost() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
// When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn.
|
||||
// The flashback cost is equal to its mana cost.
|
||||
addCard(Zone.HAND, playerA, "Snapcaster Mage", 2); // Creature{1}{U}
|
||||
|
||||
// You may pay 1 life and exile a blue card from your hand rather than pay Force of Will's mana cost.
|
||||
// Counter target spell.
|
||||
addCard(Zone.GRAVEYARD, playerA, "Force of Will");
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage");
|
||||
setChoice(playerA, "Force of Will");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Snapcaster Mage");
|
||||
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback", null, "Lightning Bolt");
|
||||
addTarget(playerA, "Lightning Bolt");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Snapcaster Mage", 0);
|
||||
assertGraveyardCount(playerA, "Snapcaster Mage", 1);
|
||||
|
||||
assertGraveyardCount(playerA, "Force of Will", 1);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
|
|||
String mes = String.format("Select color of %d mana to add it to your mana pool", this.amount);
|
||||
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
if (choice.getColor() == null) {
|
||||
return false;
|
||||
}
|
||||
Mana createdMana = choice.getMana(amount);
|
||||
if (createdMana != null) {
|
||||
checkToFirePossibleEvents(createdMana, game, source);
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ import mage.constants.SubLayer;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlayLandsFromGraveyardEffect extends ContinuousEffectImpl {
|
||||
|
||||
public PlayLandsFromGraveyardEffect() {
|
||||
|
|
@ -33,11 +31,10 @@ public class PlayLandsFromGraveyardEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for (UUID cardId: player.getGraveyard()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if(card != null && card.isLand()){
|
||||
for (Card card : player.getGraveyard().getCards(game)) {
|
||||
if (card != null && card.isLand()) {
|
||||
PlayLandFromGraveyardAbility ability = new PlayLandFromGraveyardAbility(card.getName());
|
||||
ability.setSourceId(cardId);
|
||||
ability.setSourceId(card.getId());
|
||||
ability.setControllerId(card.getOwnerId());
|
||||
game.getState().addOtherAbility(card, ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ package mage.game.draft;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.util.RandomUtil;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue