forked from External/mage
Some changes to rule text generation and some minor formating changes.
This commit is contained in:
parent
aef4a61779
commit
57ed19c346
12 changed files with 77 additions and 27 deletions
|
|
@ -70,8 +70,8 @@ public class CraterhoofBehemoth extends CardImpl<CraterhoofBehemoth> {
|
|||
|
||||
// When Craterhoof Behemoth enters the battlefield, creatures you control gain trample and get +X/+X until end of turn, where X is the number of creatures you control.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filter));
|
||||
PermanentsOnBattlefieldCount x = new PermanentsOnBattlefieldCount(filter);
|
||||
ability.addEffect(new BoostControlledEffect(x, x, Duration.EndOfTurn, filter, false, true));
|
||||
PermanentsOnBattlefieldCount controlledCreatures = new PermanentsOnBattlefieldCount(filter);
|
||||
ability.addEffect(new BoostControlledEffect(controlledCreatures, controlledCreatures, Duration.EndOfTurn, filter, false, true));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class WorldlyCounselEffect extends OneShotEffect<WorldlyCounselEffect> {
|
|||
|
||||
public WorldlyCounselEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
this.staticText = "// Domain - Look at the top X cards of your library, where X is the number of basic land types among lands you control. Put one of those cards into your hand and the rest on the bottom of your library in any order";
|
||||
this.staticText = "<i>Domain</i> - Look at the top X cards of your library, where X is the number of basic land types among lands you control. Put one of those cards into your hand and the rest on the bottom of your library in any order";
|
||||
}
|
||||
|
||||
public WorldlyCounselEffect(final WorldlyCounselEffect effect) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ public class UrzasMine extends CardImpl<UrzasMine> {
|
|||
public UrzasMine(UUID ownerId) {
|
||||
super(ownerId, 447, "Urza's Mine", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
|
||||
this.expansionSetCode = "5ED";
|
||||
Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2));
|
||||
|
||||
// {T}: Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead.
|
||||
Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2),
|
||||
"Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead");
|
||||
this.addAbility(urzaManaAbility);
|
||||
}
|
||||
|
||||
|
|
@ -56,4 +59,4 @@ public class UrzasMine extends CardImpl<UrzasMine> {
|
|||
public UrzasMine copy() {
|
||||
return new UrzasMine(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ public class UrzasPowerPlant extends CardImpl<UrzasPowerPlant> {
|
|||
public UrzasPowerPlant(UUID ownerId) {
|
||||
super(ownerId, 448, "Urza's Power Plant", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
|
||||
this.expansionSetCode = "5ED";
|
||||
Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2));
|
||||
|
||||
// {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead.
|
||||
Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2),
|
||||
"Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead");
|
||||
this.addAbility(urzaManaAbility);
|
||||
}
|
||||
|
||||
|
|
@ -56,4 +59,4 @@ public class UrzasPowerPlant extends CardImpl<UrzasPowerPlant> {
|
|||
public UrzasPowerPlant copy() {
|
||||
return new UrzasPowerPlant(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ public class UrzasTower extends CardImpl<UrzasTower> {
|
|||
public UrzasTower(UUID ownerId) {
|
||||
super(ownerId, 449, "Urza's Tower", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
|
||||
this.expansionSetCode = "5ED";
|
||||
Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(3));
|
||||
|
||||
// {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead.
|
||||
Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(3),
|
||||
"Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead");
|
||||
this.addAbility(urzaManaAbility);
|
||||
}
|
||||
|
||||
|
|
@ -56,4 +59,4 @@ public class UrzasTower extends CardImpl<UrzasTower> {
|
|||
public UrzasTower copy() {
|
||||
return new UrzasTower(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@
|
|||
package mage.sets.guildpact;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
|
|
@ -64,6 +63,8 @@ public class WitchMawNephilim extends CardImpl<WitchMawNephilim> {
|
|||
|
||||
// Whenever you cast a spell, you may put two +1/+1 counters on Witch-Maw Nephilim.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), true));
|
||||
|
||||
// Whenever Witch-Maw Nephilim attacks, it gains trample until end of turn if its power is 10 or greater.
|
||||
this.addAbility(new WitchMawNephilimTriggeredAbility());
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +80,7 @@ public class WitchMawNephilim extends CardImpl<WitchMawNephilim> {
|
|||
|
||||
class WitchMawNephilimTriggeredAbility extends AttacksTriggeredAbility {
|
||||
WitchMawNephilimTriggeredAbility() {
|
||||
super(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn), false);
|
||||
super(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), false);
|
||||
}
|
||||
|
||||
WitchMawNephilimTriggeredAbility(final WitchMawNephilimTriggeredAbility ability) {
|
||||
|
|
@ -90,8 +91,9 @@ class WitchMawNephilimTriggeredAbility extends AttacksTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (super.checkTrigger(event, game)) {
|
||||
Permanent source = game.getPermanent(event.getSourceId());
|
||||
if (source.getPower().getValue() >= 10)
|
||||
if (source.getPower().getValue() >= 10) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
*/
|
||||
public class Cloudpost extends CardImpl<Cloudpost> {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Locus");
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Locus in play");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Locus"));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
*/
|
||||
public class PriestOfTitania extends CardImpl<PriestOfTitania> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures");
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf on the battlefield");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Elf"));
|
||||
|
|
@ -60,7 +60,8 @@ public class PriestOfTitania extends CardImpl<PriestOfTitania> {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(new DynamicManaAbility(Mana.GreenMana, new PermanentsOnBattlefieldCount(filter)));
|
||||
// {T}: Add {G} to your mana pool for each Elf on the battlefield.
|
||||
this.addAbility(new DynamicManaAbility(Mana.GreenMana, new PermanentsOnBattlefieldCount(filter)));
|
||||
}
|
||||
|
||||
public PriestOfTitania(final PriestOfTitania card) {
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import mage.filter.predicate.mageobject.NamePredicate;
|
|||
import mage.game.Game;
|
||||
|
||||
public class UrzaTerrainValue implements DynamicValue {
|
||||
private final int v;
|
||||
private final int value;
|
||||
|
||||
public UrzaTerrainValue(int val) {
|
||||
v = val;
|
||||
public UrzaTerrainValue(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -19,31 +19,37 @@ public class UrzaTerrainValue implements DynamicValue {
|
|||
pp.add(new NamePredicate("Urza's Power Plant"));
|
||||
PermanentsOnBattlefieldCount ppP = new PermanentsOnBattlefieldCount(pp);
|
||||
if (ppP.calculate(game, sourceAbility) < 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
FilterControlledPermanent to = new FilterControlledPermanent("Urza's Tower");
|
||||
to.add(new NamePredicate("Urza's Tower"));
|
||||
PermanentsOnBattlefieldCount toP = new PermanentsOnBattlefieldCount(to);
|
||||
if (toP.calculate(game, sourceAbility) < 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
FilterControlledPermanent mi = new FilterControlledPermanent("Urza's Mine");
|
||||
mi.add(new NamePredicate("Urza's Mine"));
|
||||
PermanentsOnBattlefieldCount miP = new PermanentsOnBattlefieldCount(mi);
|
||||
if (miP.calculate(game, sourceAbility) < 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return v;
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new UrzaTerrainValue(v);
|
||||
return new UrzaTerrainValue(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1 or " + v;
|
||||
return "1 or " + value;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ public class DynamicManaEffect extends BasicManaEffect {
|
|||
|
||||
private Mana computedMana;
|
||||
private DynamicValue amount;
|
||||
private String text = null;
|
||||
|
||||
public DynamicManaEffect(Mana mana, DynamicValue amount) {
|
||||
super(mana);
|
||||
|
|
@ -48,10 +49,18 @@ public class DynamicManaEffect extends BasicManaEffect {
|
|||
computedMana = new Mana();
|
||||
}
|
||||
|
||||
public DynamicManaEffect(Mana mana, DynamicValue amount, String text) {
|
||||
super(mana);
|
||||
this.amount = amount;
|
||||
computedMana = new Mana();
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public DynamicManaEffect(final DynamicManaEffect effect) {
|
||||
super(effect);
|
||||
this.computedMana = effect.computedMana.copy();
|
||||
this.amount = effect.amount.copy();
|
||||
this.text = effect.text;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -68,6 +77,9 @@ public class DynamicManaEffect extends BasicManaEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (text != null && !text.isEmpty()) {
|
||||
return text;
|
||||
}
|
||||
return super.getText(mode) + " for each " + amount.getMessage();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,19 +116,23 @@ public class BoostTargetEffect extends ContinuousEffectImpl<BoostTargetEffect> {
|
|||
sb.append("Target ").append(target.getTargetName()).append(" gets ");
|
||||
}
|
||||
String p = power.toString();
|
||||
if(!p.startsWith("-"))
|
||||
if(!p.startsWith("-")) {
|
||||
sb.append("+");
|
||||
}
|
||||
sb.append(p).append("/");
|
||||
String t = toughness.toString();
|
||||
if(!t.startsWith("-")){
|
||||
if(p.startsWith("-"))
|
||||
if(p.startsWith("-")) {
|
||||
sb.append("-");
|
||||
else
|
||||
}
|
||||
else {
|
||||
sb.append("+");
|
||||
}
|
||||
}
|
||||
sb.append(t);
|
||||
if (duration != Duration.WhileOnBattlefield)
|
||||
if (duration != Duration.WhileOnBattlefield) {
|
||||
sb.append(" ").append(duration.toString());
|
||||
}
|
||||
String message = power.getMessage();
|
||||
if (message.length() > 0) {
|
||||
sb.append(" for each ");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import mage.game.Game;
|
|||
public class DynamicManaAbility extends ManaAbility<DynamicManaAbility> {
|
||||
|
||||
private DynamicManaEffect manaEffect;
|
||||
private String rule;
|
||||
|
||||
/**
|
||||
* TapSourceCost added by default
|
||||
|
|
@ -50,14 +51,29 @@ public class DynamicManaAbility extends ManaAbility<DynamicManaAbility> {
|
|||
this(mana, amount, new TapSourceCost());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mana - kind of mana
|
||||
* @param amount - value for the numbe rof numer
|
||||
* @param text - rule text for the DynamicManaEffect
|
||||
*/
|
||||
public DynamicManaAbility(Mana mana, DynamicValue amount, String text) {
|
||||
this(mana, amount, new TapSourceCost(), text);
|
||||
}
|
||||
|
||||
public DynamicManaAbility(Mana mana, DynamicValue amount, Cost cost) {
|
||||
super(Zone.BATTLEFIELD, new DynamicManaEffect(mana, amount), cost);
|
||||
this(mana, amount, cost, null);
|
||||
}
|
||||
|
||||
public DynamicManaAbility(Mana mana, DynamicValue amount, Cost cost, String text) {
|
||||
super(Zone.BATTLEFIELD, new DynamicManaEffect(mana, amount, text), cost);
|
||||
manaEffect = (DynamicManaEffect) this.getEffects().get(0);
|
||||
}
|
||||
|
||||
public DynamicManaAbility(final DynamicManaAbility ability) {
|
||||
super(ability);
|
||||
manaEffect = ability.manaEffect;
|
||||
rule = ability.rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue