Fixes from LevelX's review

This commit is contained in:
LoneFox 2015-06-20 21:21:32 +03:00
parent 79fe0d98f3
commit fd6d89ae0b
3 changed files with 13 additions and 22 deletions

View file

@ -82,8 +82,8 @@ class IvoryTowerEffect extends OneShotEffect {
int amount = player.getHand().size() - 4; int amount = player.getHand().size() - 4;
if(amount > 0) { if(amount > 0) {
player.gainLife(amount, game); player.gainLife(amount, game);
return true;
} }
return true;
} }
return false; return false;
} }

View file

@ -53,6 +53,8 @@ import mage.target.common.TargetOpponent;
*/ */
public class CuombajjWitches extends CardImpl { public class CuombajjWitches extends CardImpl {
private final UUID originalId;
public CuombajjWitches(UUID ownerId) { public CuombajjWitches(UUID ownerId) {
super(ownerId, 65, "Cuombajj Witches", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); super(ownerId, 65, "Cuombajj Witches", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}");
this.expansionSetCode = "MED"; this.expansionSetCode = "MED";
@ -64,15 +66,16 @@ public class CuombajjWitches extends CardImpl {
// {T}: Cuombajj Witches deals 1 damage to target creature or player and 1 damage to target creature or player of an opponent's choice. // {T}: Cuombajj Witches deals 1 damage to target creature or player and 1 damage to target creature or player of an opponent's choice.
Effect effect = new DamageTargetEffect(1); Effect effect = new DamageTargetEffect(1);
effect.setText("{this} deals 1 damage to target creature or player and 1 damage to target creature or player of an opponent's choice"); effect.setText("{this} deals 1 damage to target creature or player and 1 damage to target creature or player of an opponent's choice");
Ability ability = new CuombajjWitchesAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetCreatureOrPlayer()); ability.addTarget(new TargetCreatureOrPlayer());
ability.addTarget(new TargetCreatureOrPlayer()); ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability); this.addAbility(ability);
originalId = ability.getOriginalId();
} }
@Override @Override
public void adjustTargets(Ability ability, Game game) { public void adjustTargets(Ability ability, Game game) {
if(ability instanceof CuombajjWitchesAbility) { if(ability.getOriginalId().equals(originalId)) {
Player controller = game.getPlayer(ability.getControllerId()); Player controller = game.getPlayer(ability.getControllerId());
if(controller != null) { if(controller != null) {
UUID opponentId = null; UUID opponentId = null;
@ -95,6 +98,7 @@ public class CuombajjWitches extends CardImpl {
public CuombajjWitches(final CuombajjWitches card) { public CuombajjWitches(final CuombajjWitches card) {
super(card); super(card);
this.originalId = card.originalId;
} }
@Override @Override
@ -102,19 +106,3 @@ public class CuombajjWitches extends CardImpl {
return new CuombajjWitches(this); return new CuombajjWitches(this);
} }
} }
// This is for identification in case something grants a second SimpleActivatedAbility to the Witches.
class CuombajjWitchesAbility extends SimpleActivatedAbility {
public CuombajjWitchesAbility(Zone zone, Effect effect, Cost cost) {
super(zone, effect, cost);
}
public CuombajjWitchesAbility(final CuombajjWitchesAbility ability) {
super(ability);
}
@Override
public CuombajjWitchesAbility copy() {
return new CuombajjWitchesAbility(this);
}
}

View file

@ -31,7 +31,9 @@ package mage.abilities.costs.common;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.CostImpl; import mage.abilities.costs.CostImpl;
import mage.cards.Card; import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Library; import mage.players.Library;
import mage.players.Player; import mage.players.Player;
@ -70,10 +72,11 @@ public class ExileFromTopOfLibraryCost extends CostImpl {
Player controller = game.getPlayer(controllerId); Player controller = game.getPlayer(controllerId);
if(controller != null) { if(controller != null) {
Library library = controller.getLibrary(); Library library = controller.getLibrary();
Cards cards = new CardsImpl();
for(int i = 0; i < amount; i++) { for(int i = 0; i < amount; i++) {
Card card = library.removeFromTop(game); cards.add(library.removeFromTop(game));
card.moveToExile(null, null, sourceId, game);
} }
controller.moveCards(cards, Zone.LIBRARY, Zone.EXILED, ability, game);
paid = true; paid = true;
} }
return paid; return paid;