Minor updates to Gerrard Capashen and Darigaaz, the Igniter.

This commit is contained in:
LevelX2 2015-03-25 21:46:55 +01:00
parent 9b29e72e82
commit b4ac21f1c7
2 changed files with 28 additions and 26 deletions

View file

@ -37,7 +37,6 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
@ -68,7 +67,7 @@ public class GerrardCapashen extends CardImpl {
TargetController.YOU, false, true); TargetController.YOU, false, true);
ability1.addTarget(new TargetOpponent()); ability1.addTarget(new TargetOpponent());
this.addAbility(ability1); this.addAbility(ability1);
// {3}{W}: Tap target creature. Activate this ability only if {this} is attacking. // {3}{W}: Tap target creature. Activate this ability only if {this} is attacking.
Ability ability2 = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), Ability ability2 = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(),
new ManaCostsImpl("{3}{W}"), new SourceAttackingCondition()); new ManaCostsImpl("{3}{W}"), new SourceAttackingCondition());
@ -106,11 +105,12 @@ class GerrardCapashenEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if(controller != null && targetOpponent != null) { if (controller != null && targetOpponent != null) {
Cards cardsInHand = targetOpponent.getHand(); int cardsInHand = targetOpponent.getHand().size();
if(cardsInHand.size() > 0) { if (cardsInHand > 0) {
controller.gainLife(cardsInHand.size(), game); controller.gainLife(cardsInHand, game);
} }
return true;
} }
return false; return false;
} }

View file

@ -27,7 +27,6 @@
*/ */
package mage.sets.phyrexiavsthecoalition; package mage.sets.phyrexiavsthecoalition;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -36,9 +35,7 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.choices.ChoiceColor; import mage.choices.ChoiceColor;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
@ -64,7 +61,8 @@ public class DarigaazTheIgniter extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever {this} deals combat damage to a player, you may pay {2}{R}. If you do, choose a color, then that player reveals his or her hand and Darigaaz deals damage to the player equal to the number of cards of that color revealed this way.
// Whenever Darigaaz, the Igniter deals combat damage to a player, you may pay {2}{R}. If you do, choose a color, then that player reveals his or her hand and Darigaaz deals damage to the player equal to the number of cards of that color revealed this way.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DoIfCostPaid( this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DoIfCostPaid(
new DarigaazTheIgniterEffect(), new ManaCostsImpl("{2}{R}")), false, true)); new DarigaazTheIgniterEffect(), new ManaCostsImpl("{2}{R}")), false, true));
} }
@ -99,27 +97,31 @@ class DarigaazTheIgniterEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if(controller != null) { if (controller != null) {
ChoiceColor choice = new ChoiceColor(); ChoiceColor choice = new ChoiceColor(true);
controller.choose(outcome, choice, game); while (!choice.isChosen()) {
if(choice.getColor() != null) { controller.choose(outcome, choice, game);
game.informPlayers(new StringBuilder(controller.getName()).append(" chooses ").append(choice.getColor()).toString()); if (!controller.isInGame()) {
return false;
}
}
if (choice.getColor() != null) {
game.informPlayers(controller.getName() + " chooses " + choice.getColor());
Player damagedPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); Player damagedPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if(damagedPlayer != null) { if (damagedPlayer != null) {
damagedPlayer.revealCards("hand of " + damagedPlayer.getName(), damagedPlayer.getHand(), game); damagedPlayer.revealCards("hand of " + damagedPlayer.getName(), damagedPlayer.getHand(), game);
Cards cardsInHand = damagedPlayer.getHand(); FilterCard filter = new FilterCard();
if(cardsInHand.size() > 0) { filter.add(new ColorPredicate(choice.getColor()));
FilterCard filter = new FilterCard(); int damage = damagedPlayer.getHand().count(filter, source.getSourceId(), source.getControllerId(), game);
filter.add(new ColorPredicate(choice.getColor())); if (damage > 0) {
Set<Card> damage = cardsInHand.getCards(filter, game); damagedPlayer.damage(damage, source.getSourceId(), game, false, true);
if(damage.size() > 0) {
damagedPlayer.damage(damage.size(), source.getSourceId(), game, false, true);
return true;
}
} }
} }
} }
return true;
} }
return false; return false;
} }
} }