Merge branch 'master' into subTypeSwitch

This commit is contained in:
theelk801 2017-09-09 11:16:47 -04:00 committed by GitHub
commit 31acee7624
80 changed files with 2613 additions and 176 deletions

View file

@ -97,7 +97,7 @@ public class AttacksCreatureYouControlTriggeredAbility extends TriggeredAbilityI
@Override
public String getRule() {
return "Whenever a " + filter.getMessage() + " attacks, " + super.getRule();
return "Whenever a" + (filter.getMessage().startsWith("a") ? "n " : " ") + " attacks, " + super.getRule();
}
}

View file

@ -95,7 +95,7 @@ public class EntersBattlefieldAbility extends StaticAbility {
return;
}
}
super.addEffect(effect); //To change body of generated methods, choose Tools | Templates.
super.addEffect(effect);
}
@Override
@ -108,6 +108,7 @@ public class EntersBattlefieldAbility extends StaticAbility {
if (abilityRule != null && !abilityRule.isEmpty()) {
return abilityRule;
}
return (optional ? "you may have " : "") + "{this} enter" + (optional ? "" : "s") + " the battlefield " + super.getRule();
String superRule = super.getRule();
return (optional ? "you may have " : "") + "{this} enter" + (optional ? "" : "s") + " the battlefield" + (superRule.charAt(0) == ' ' ? "" : " ") + superRule;
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.abilities.effects.common;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
@ -43,6 +41,9 @@ import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -151,7 +152,7 @@ public class CreateTokenEffect extends OneShotEffect {
}
sb.append(token.getDescription());
if (token.getDescription().endsWith("token")) {
sb.append("s ");
sb.append("s");
}
int tokenLocation = sb.indexOf("token ");
if (tokenLocation != -1) {

View file

@ -66,7 +66,12 @@ public class ReturnToHandChosenControlledPermanentEffect extends ReturnToHandCho
protected String getText() {
StringBuilder sb = new StringBuilder("return ");
if (!filter.getMessage().startsWith("another")) {
sb.append(CardUtil.numberToText(number, "a"));
if(filter.getMessage().startsWith("a")){
sb.append("an");
}
else {
sb.append(CardUtil.numberToText(number, "a"));
}
}
sb.append(' ').append(filter.getMessage());
if (number > 1) {

View file

@ -5,42 +5,43 @@
*/
package mage.game;
import java.io.Serializable;
import mage.ObjectColor;
import mage.cards.Card;
import mage.util.SubTypeList;
import java.io.Serializable;
/**
* This class saves changed attributes of cards (e.g. in graveyard, exile or player hands or libraries).
*
* This class saves changed attributes of cards (e.g. in graveyard, exile or
* player hands or libraries).
*
* @author LevelX2
*/
public class CardAttribute implements Serializable {
public class CardAttribute implements Serializable {
protected ObjectColor color;
protected SubTypeList subtype;
public CardAttribute(Card card) {
color = card.getColor(null).copy();
subtype = card.getSubtype(null);
subtype = new SubTypeList();
subtype.addAll(subtype);
}
public CardAttribute(CardAttribute cardAttribute) {
this.color = cardAttribute.color;
this.subtype = cardAttribute.subtype;
}
public CardAttribute copy() {
return new CardAttribute(this);
}
public ObjectColor getColor() {
return color;
return color;
}
public SubTypeList getSubtype() {
return subtype;
}
}