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;
if(amount > 0) {
player.gainLife(amount, game);
return true;
}
return true;
}
return false;
}

View file

@ -53,6 +53,8 @@ import mage.target.common.TargetOpponent;
*/
public class CuombajjWitches extends CardImpl {
private final UUID originalId;
public CuombajjWitches(UUID ownerId) {
super(ownerId, 65, "Cuombajj Witches", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}");
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.
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");
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());
this.addAbility(ability);
originalId = ability.getOriginalId();
}
@Override
public void adjustTargets(Ability ability, Game game) {
if(ability instanceof CuombajjWitchesAbility) {
if(ability.getOriginalId().equals(originalId)) {
Player controller = game.getPlayer(ability.getControllerId());
if(controller != null) {
UUID opponentId = null;
@ -95,6 +98,7 @@ public class CuombajjWitches extends CardImpl {
public CuombajjWitches(final CuombajjWitches card) {
super(card);
this.originalId = card.originalId;
}
@Override
@ -102,19 +106,3 @@ public class CuombajjWitches extends CardImpl {
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 mage.abilities.Ability;
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.players.Library;
import mage.players.Player;
@ -70,10 +72,11 @@ public class ExileFromTopOfLibraryCost extends CostImpl {
Player controller = game.getPlayer(controllerId);
if(controller != null) {
Library library = controller.getLibrary();
Cards cards = new CardsImpl();
for(int i = 0; i < amount; i++) {
Card card = library.removeFromTop(game);
card.moveToExile(null, null, sourceId, game);
cards.add(library.removeFromTop(game));
}
controller.moveCards(cards, Zone.LIBRARY, Zone.EXILED, ability, game);
paid = true;
}
return paid;