mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Some minor rework.
This commit is contained in:
parent
09531d938c
commit
a766cafac6
2 changed files with 29 additions and 31 deletions
|
@ -51,11 +51,10 @@ import mage.players.Player;
|
||||||
public class WarCadence extends CardImpl {
|
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}")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,12 +72,12 @@ class WarCadenceReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
DynamicValue xCosts = new ManacostVariableValue();
|
DynamicValue xCosts = new ManacostVariableValue();
|
||||||
|
|
||||||
WarCadenceReplacementEffect ( ) {
|
WarCadenceReplacementEffect() {
|
||||||
super(Duration.EndOfTurn, Outcome.Neutral);
|
super(Duration.EndOfTurn, Outcome.Neutral);
|
||||||
staticText = "This turn, creatures can't block unless their controller pays {X} for each blocking creature he or she controls";
|
staticText = "This turn, creatures can't block unless their controller pays {X} for each blocking creature he or she controls";
|
||||||
}
|
}
|
||||||
|
|
||||||
WarCadenceReplacementEffect ( WarCadenceReplacementEffect effect ) {
|
WarCadenceReplacementEffect(WarCadenceReplacementEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
||||||
|
@ -56,7 +55,7 @@ public class WarTax extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||||
|
|
||||||
// {X}{U}: This turn, creatures can't attack unless their controller pays {X} for each attacking creature he or she controls.
|
// {X}{U}: This turn, creatures can't attack unless their controller pays {X} for each attacking creature he or she controls.
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WarTaxReplacementEffect(), new ManaCostsImpl("{X}{U}") ));
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WarTaxReplacementEffect(), new ManaCostsImpl("{X}{U}")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public WarTax(final WarTax card) {
|
public WarTax(final WarTax card) {
|
||||||
|
@ -73,12 +72,12 @@ class WarTaxReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
DynamicValue xCosts = new ManacostVariableValue();
|
DynamicValue xCosts = new ManacostVariableValue();
|
||||||
|
|
||||||
WarTaxReplacementEffect ( ) {
|
WarTaxReplacementEffect() {
|
||||||
super(Duration.EndOfTurn, Outcome.Neutral);
|
super(Duration.EndOfTurn, Outcome.Neutral);
|
||||||
staticText = "This turn, creatures can't attack unless their controller pays {X} for each attacking creature he or she controls";
|
staticText = "This turn, creatures can't attack unless their controller pays {X} for each attacking creature he or she controls";
|
||||||
}
|
}
|
||||||
|
|
||||||
WarTaxReplacementEffect ( WarTaxReplacementEffect effect ) {
|
WarTaxReplacementEffect(WarTaxReplacementEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue