mirror of
https://github.com/correl/mage.git
synced 2025-01-13 03:00:10 +00:00
Some changes to rule text generation.
This commit is contained in:
parent
fb3a9e3166
commit
6e25defa26
5 changed files with 17 additions and 11 deletions
|
@ -29,10 +29,9 @@
|
|||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
@ -77,7 +76,7 @@ public class MentorOfTheMeek extends CardImpl<MentorOfTheMeek> {
|
|||
class MentorOfTheMeekAbility extends TriggeredAbilityImpl<MentorOfTheMeekAbility> {
|
||||
|
||||
public MentorOfTheMeekAbility() {
|
||||
super(Constants.Zone.BATTLEFIELD, new DoIfCostPaid(new DrawCardControllerEffect(1), new ManaCostsImpl("{1}")), true);
|
||||
super(Zone.BATTLEFIELD, new DoIfCostPaid(new DrawCardControllerEffect(1), new ManaCostsImpl("{1}")), true);
|
||||
}
|
||||
|
||||
public MentorOfTheMeekAbility(final MentorOfTheMeekAbility ability) {
|
||||
|
@ -93,9 +92,11 @@ class MentorOfTheMeekAbility extends TriggeredAbilityImpl<MentorOfTheMeekAbility
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getToZone() == Constants.Zone.BATTLEFIELD) {
|
||||
if (zEvent.getToZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId()) && permanent.getPower().getValue() <= 2) {
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
|
||||
&& permanent.getControllerId().equals(this.getControllerId())
|
||||
&& permanent.getPower().getValue() <= 2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +106,7 @@ class MentorOfTheMeekAbility extends TriggeredAbilityImpl<MentorOfTheMeekAbility
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever another creature with power 2 or less enters the battlefield under your control, you may pay {1}. If you do, draw a card.";
|
||||
return new StringBuilder("Whenever another creature with power 2 or less enters the battlefield under your control, ").append(super.getRule()).toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,11 +37,11 @@ import mage.target.common.TargetCardInHand;
|
|||
public class DiscardCardCost extends DiscardTargetCost {
|
||||
|
||||
public DiscardCardCost() {
|
||||
super(new TargetCardInHand(new FilterCard()), false);
|
||||
this(false);
|
||||
}
|
||||
|
||||
public DiscardCardCost(boolean randomDiscard) {
|
||||
super(new TargetCardInHand(new FilterCard("a Card at random")), randomDiscard);
|
||||
super(new TargetCardInHand(new FilterCard(randomDiscard ?"a card at random":"a card")), randomDiscard);
|
||||
}
|
||||
|
||||
public DiscardCardCost(DiscardCardCost cost) {
|
||||
|
|
|
@ -42,7 +42,12 @@ public class DoIfCostPaid extends OneShotEffect<DoIfCostPaid> {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "you may pay " + cost.getText() + ". If you do, " + executingEffect.getText(mode);
|
||||
StringBuilder sb = new StringBuilder("you may ");
|
||||
String costText = cost.getText();
|
||||
if (costText.length() <7 || !costText.substring(0, 7).toLowerCase().equals("discard")) {
|
||||
sb.append("pay ");
|
||||
}
|
||||
return sb.append(costText).append(". If you do, ").append(executingEffect.getText(mode)).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,7 @@ public class ReturnToHandSpellEffect extends PostResolveEffect<ReturnToHandSpell
|
|||
}
|
||||
|
||||
private ReturnToHandSpellEffect() {
|
||||
staticText = "Return {this} into its owner's hand";
|
||||
staticText = "Return {this} to its owner's hand";
|
||||
}
|
||||
|
||||
public static ReturnToHandSpellEffect getInstance() {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SwitchPowerToughnessSourceEffect extends ContinuousEffectImpl<Switc
|
|||
|
||||
public SwitchPowerToughnessSourceEffect(Duration duration) {
|
||||
super(duration, Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, Outcome.BoostCreature);
|
||||
staticText = "switch its power and toughness " + duration.toString();
|
||||
staticText = "switch {this}'s power and toughness " + duration.toString();
|
||||
}
|
||||
|
||||
public SwitchPowerToughnessSourceEffect(final SwitchPowerToughnessSourceEffect effect) {
|
||||
|
|
Loading…
Reference in a new issue