Merge origin/master

This commit is contained in:
LevelX2 2015-11-26 01:31:03 +01:00
commit 623d3490b0
2 changed files with 5 additions and 18 deletions

View file

@ -123,7 +123,7 @@ class GoblinGoonCantBlockEffect extends RestrictionEffect {
GoblinGoonCantBlockEffect() { GoblinGoonCantBlockEffect() {
super(Duration.WhileOnBattlefield); super(Duration.WhileOnBattlefield);
staticText = "Goblin Goon can't block unless you control more creatures than attacking player"; staticText = "{this} can't block unless you control more creatures than attacking player";
} }
GoblinGoonCantBlockEffect(final GoblinGoonCantBlockEffect effect) { GoblinGoonCantBlockEffect(final GoblinGoonCantBlockEffect effect) {

View file

@ -31,17 +31,13 @@ import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
/** /**
* *
@ -86,19 +82,10 @@ class RitesOfInitiationEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
Target target = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterCard("cards to discard")); int numToDiscard = player.getAmount(0, player.getHand().size(), "Discard how many cards at random?", game);
while (player.canRespond() && !target.isChosen()) { player.discard(numToDiscard, true, source, game);
target.choose(Outcome.BoostCreature, player.getId(), source.getSourceId(), game); game.addEffect(new BoostControlledEffect(numToDiscard, 0, Duration.EndOfTurn), source);
}
int numDiscarded = 0;
for (UUID targetId : target.getTargets()) {
Card card = player.getHand().get(targetId, game);
if (player.discard(card, source, game)) {
numDiscarded++;
}
}
game.addEffect(new BoostControlledEffect(numDiscarded, 0, Duration.EndOfTurn), source);
return true; return true;
} }
return false; return false;