forked from External/mage
Minor formatting.
This commit is contained in:
parent
5785c23b4d
commit
8090522e3c
7 changed files with 36 additions and 18 deletions
|
|
@ -28,20 +28,16 @@
|
|||
package mage.sets.magic2014;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.FightTargetsEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@ public class GrislySalvage extends CardImpl<GrislySalvage> {
|
|||
}
|
||||
class GrislySalvageEffect extends OneShotEffect<GrislySalvageEffect> {
|
||||
|
||||
private static final FilterCard filterPutInHand = new FilterCard("creature or land card to put in hand");
|
||||
static {
|
||||
filterPutInHand.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
||||
}
|
||||
|
||||
public GrislySalvageEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
this.staticText = "Reveal the top five cards of your library. You may put a creature or land card from among them into your hand. Put the rest into your graveyard";
|
||||
|
|
@ -100,7 +105,7 @@ class GrislySalvageEffect extends OneShotEffect<GrislySalvageEffect> {
|
|||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.CREATURE) || card.getCardType().contains(CardType.LAND)) {
|
||||
if (filterPutInHand.match(card, source.getSourceId(), source.getControllerId(), game)) {
|
||||
properCardFound = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -108,9 +113,7 @@ class GrislySalvageEffect extends OneShotEffect<GrislySalvageEffect> {
|
|||
|
||||
if (!cards.isEmpty()) {
|
||||
player.revealCards("Grisly Salvage", cards, game);
|
||||
FilterCard filter = new FilterCard("creature or land card to put in hand");
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
|
||||
TargetCard target = new TargetCard(Zone.PICK, filter);
|
||||
TargetCard target = new TargetCard(Zone.PICK, filterPutInHand);
|
||||
if (properCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
|
|
@ -131,4 +134,4 @@ class GrislySalvageEffect extends OneShotEffect<GrislySalvageEffect> {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class LookLibraryControllerEffect extends OneShotEffect<LookLibraryContro
|
|||
}
|
||||
if (cards.size() == 1) {
|
||||
Card card = cards.get(cards.iterator().next(), game);
|
||||
card.moveToZone(targetZoneLookedCards, source.getId(), game, true);
|
||||
card.moveToZone(targetZoneLookedCards, source.getId(), game, putOnTop);
|
||||
}
|
||||
break;
|
||||
case GRAVEYARD:
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ import mage.abilities.effects.ContinuousEffectImpl;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -98,8 +100,9 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
|
|||
break;
|
||||
case ColorChangingEffects_5:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (token.getColor().hasColor())
|
||||
if (token.getColor().hasColor()) {
|
||||
permanent.getColor().setColor(token.getColor());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
|
|
@ -136,10 +139,24 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
|
|||
@Override
|
||||
public String getText(Mode mode) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Target ").append(mode.getTargets().get(0).getTargetName()).append(" becomes a ").append(token.getDescription());
|
||||
Target target = mode.getTargets().get(0);
|
||||
if(target.getMaxNumberOfTargets() > 1){
|
||||
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
|
||||
sb.append("Up to ");
|
||||
}
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append(" each become ");
|
||||
} else {
|
||||
sb.append("Target ").append(target.getTargetName()).append(" becomes a ");
|
||||
}
|
||||
sb.append(token.getDescription());
|
||||
sb.append(" ").append(duration.toString());
|
||||
if (type != null && type.length() > 0)
|
||||
sb.append(". It's still a ").append(type);
|
||||
if (type != null && type.length() > 0) {
|
||||
if (target.getMaxNumberOfTargets() > 1) {
|
||||
sb.append(". They're still ").append(type);
|
||||
} else {
|
||||
sb.append(". It's still a ").append(type);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public class LoseCreatureTypeSourceEffect extends ContinuousEffectImpl<LoseCreat
|
|||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4;
|
||||
return layer == Layer.TypeChangingEffects_4;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import mage.target.common.TargetAttackingCreature;
|
|||
* of creature cards you can discard to give an attacking creature a bonus.
|
||||
* (An ability word has no rules meaning.)
|
||||
*
|
||||
* @author Ludwig
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,9 @@ public abstract class ManaAbility<T extends ManaAbility<T>> extends ActivatedAbi
|
|||
if (effect != null) {
|
||||
this.addEffect(effect);
|
||||
}
|
||||
if (cost != null)
|
||||
if (cost != null) {
|
||||
this.addCost(cost);
|
||||
}
|
||||
}
|
||||
|
||||
public ManaAbility(ManaAbility ability) {
|
||||
|
|
@ -63,8 +64,9 @@ public abstract class ManaAbility<T extends ManaAbility<T>> extends ActivatedAbi
|
|||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (!controlsAbility(playerId, game))
|
||||
if (!controlsAbility(playerId, game)) {
|
||||
return false;
|
||||
}
|
||||
//20091005 - 605.3a
|
||||
return costs.canPay(sourceId, controllerId, game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue