Some minor rework.

This commit is contained in:
LevelX2 2016-10-14 08:43:31 +02:00
parent 09531d938c
commit a766cafac6
2 changed files with 29 additions and 31 deletions

View file

@ -53,7 +53,6 @@ public class WarCadence extends CardImpl {
public WarCadence(UUID ownerId, CardSetInfo setInfo) { public WarCadence(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
// {X}{R}: This turn, creatures can't block unless their controller pays {X} for each blocking creature he or she controls. // {X}{R}: This turn, creatures can't block unless their controller pays {X} for each blocking creature he or she controls.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WarCadenceReplacementEffect(), new ManaCostsImpl("{X}{R}"))); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WarCadenceReplacementEffect(), new ManaCostsImpl("{X}{R}")));
@ -88,10 +87,10 @@ class WarCadenceReplacementEffect extends ReplacementEffectImpl {
if (player != null) { if (player != null) {
int amount = xCosts.calculate(game, source, this); int amount = xCosts.calculate(game, source, this);
if (amount > 0) { if (amount > 0) {
String mana = new StringBuilder("{").append(amount).append("}").toString(); String mana = "{" + amount + "}";
ManaCostsImpl cost = new ManaCostsImpl(mana); ManaCostsImpl cost = new ManaCostsImpl(mana);
if ( cost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && if (cost.canPay(source, source.getSourceId(), event.getPlayerId(), game)
player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(mana).append(" to declare blocker?").toString(), source, game) ) { && player.chooseUse(Outcome.Benefit, "Pay " + mana + " to declare blocker?", source, game)) {
if (cost.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) { if (cost.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
return false; return false;
} }

View file

@ -34,9 +34,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.ReplacementEffectImpl;
import mage.constants.CardType;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
@ -47,8 +47,7 @@ import mage.players.Player;
/** /**
* *
* *
* @author HCrescent * @author HCrescent original code by LevelX2 edited from War Cadence
* original code by LevelX2 edited from War Cadence
*/ */
public class WarTax extends CardImpl { public class WarTax extends CardImpl {
@ -88,10 +87,10 @@ class WarTaxReplacementEffect extends ReplacementEffectImpl {
if (player != null) { if (player != null) {
int amount = xCosts.calculate(game, source, this); int amount = xCosts.calculate(game, source, this);
if (amount > 0) { if (amount > 0) {
String mana = new StringBuilder("{").append(amount).append("}").toString(); String mana = "{" + amount + "}";
ManaCostsImpl cost = new ManaCostsImpl(mana); ManaCostsImpl cost = new ManaCostsImpl(mana);
if ( cost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && if (cost.canPay(source, source.getSourceId(), event.getPlayerId(), game)
player.chooseUse(Outcome.Benefit, new StringBuilder("Pay").append(mana).append(" to declare attacker?").toString(), source, game) ) { && player.chooseUse(Outcome.Benefit, "Pay " + mana + " to declare attacker?", source, game)) {
if (cost.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) { if (cost.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) {
return false; return false;
} }