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() {
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) {

View file

@ -31,17 +31,13 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
/**
*
@ -87,18 +83,9 @@ class RitesOfInitiationEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Target target = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterCard("cards to discard"));
while (player.canRespond() && !target.isChosen()) {
target.choose(Outcome.BoostCreature, player.getId(), source.getSourceId(), game);
}
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);
int numToDiscard = player.getAmount(0, player.getHand().size(), "Discard how many cards at random?", game);
player.discard(numToDiscard, true, source, game);
game.addEffect(new BoostControlledEffect(numToDiscard, 0, Duration.EndOfTurn), source);
return true;
}
return false;