- Converted the Changeling keyword to a stat defining ability.

This commit is contained in:
Sloth
2011-09-04 18:42:10 +00:00
parent 3cf823cab9
commit 460701d4f1
32 changed files with 62 additions and 56 deletions

View File

@@ -1631,8 +1631,7 @@ public class Card extends GameEntity implements Comparable<Card> {
// Changeling + CARDNAME can't be countered. + Cascade + Multikicker
for (int i = 0; i < kw.size(); i++) {
if ((kw.get(i).contains("Changeling") && !sb.toString().contains("Changeling"))
|| (kw.get(i).contains("CARDNAME can't be countered.") && !sb.toString().contains("CARDNAME can't be countered."))
if ((kw.get(i).contains("CARDNAME can't be countered.") && !sb.toString().contains("CARDNAME can't be countered."))
|| (kw.get(i).contains("Cascade") && !sb.toString().contains("Cascade"))
|| (kw.get(i).contains("Multikicker") && !sb.toString().contains("Multikicker"))) {
sb.append(kw.get(i)).append("\r\n");
@@ -3133,7 +3132,9 @@ public class Card extends GameEntity implements Comparable<Card> {
for (Card_Type ct : types) {
ArrayList<String> removeTypes = new ArrayList<String>();
removeTypes.addAll(ct.getRemoveType());
if(ct.getRemoveType() != null) {
removeTypes.addAll(ct.getRemoveType());
}
//remove old types
for (int i = 0; i < newType.size(); i++) {
String t = newType.get(i);
@@ -3143,7 +3144,7 @@ public class Card extends GameEntity implements Comparable<Card> {
removeTypes.add(t);
if (ct.isRemoveSubTypes() && CardUtil.isASubType(t))
removeTypes.add(t);
if (ct.isRemoveCreatureTypes() && CardUtil.isACreatureType(t))
if (ct.isRemoveCreatureTypes() && (CardUtil.isACreatureType(t) || t.equals("AllCreatureTypes")))
removeTypes.add(t);
}
newType.removeAll(removeTypes);
@@ -4648,7 +4649,7 @@ public class Card extends GameEntity implements Comparable<Card> {
if (typeContains(cardType)
|| ((isCreature() || isTribal())
&& CardUtil.isACreatureType(cardType) && hasKeyword("Changeling"))) return true;
&& CardUtil.isACreatureType(cardType) && typeContains("AllCreatureTypes"))) return true;
return false;
}

View File

@@ -2052,9 +2052,7 @@ public class GameActionUtil {
&& !type.get(x).getType().get(x2).equals("Legendary")
&& !type.get(x).getType().get(x2).equals("Artifact"))
{
if (crd.isType(type.get(x).getType().get(x2))
|| crd.hasKeyword("Changeling")
|| type.get(x).hasKeyword("Changeling"))
if (crd.isType(type.get(x).getType().get(x2)))
{
alreadyAdded.add(type.get(x));
crd.addSemiPermanentAttackBoost(1);

View File

@@ -149,17 +149,22 @@ public final class GuiDisplayUtil implements NewConstants {
ArrayList<String> superTypes = new ArrayList<String>();
ArrayList<String> cardTypes = new ArrayList<String>();
ArrayList<String> subTypes = new ArrayList<String>();
boolean allCreatureTypes = list.contains("AllCreatureTypes");
for (String t : list) {
if(allCreatureTypes && t.equals("AllCreatureTypes")) {
continue;
}
if (CardUtil.isASuperType(t) && !superTypes.contains(t)) {
superTypes.add(t);
}
if (CardUtil.isACardType(t) && !cardTypes.contains(t)) {
cardTypes.add(t);
}
if (CardUtil.isASubType(t) && !subTypes.contains(t)) {
if (CardUtil.isASubType(t) && !subTypes.contains(t)
&& (!allCreatureTypes || !CardUtil.isACreatureType(t))) {
subTypes.add(t);
}
}
for (String type : superTypes) {
@@ -168,9 +173,12 @@ public final class GuiDisplayUtil implements NewConstants {
for (String type : cardTypes) {
sb.append(type).append(" ");
}
if (!subTypes.isEmpty()) {
if (!subTypes.isEmpty() || allCreatureTypes) {
sb.append("- ");
}
if (allCreatureTypes) {
sb.append("All creature types ");
}
for (String type : subTypes) {
sb.append(type).append(" ");
}

View File

@@ -453,9 +453,6 @@ public class CardFactoryUtil {
}
value += c.getKeywordMagnitude("Rampage");
value += c.getKeywordMagnitude("Annihilator") * 50;
if (c.hasKeyword("Changeling")) {
value += 5;
}
if (c.hasKeyword("Whenever a creature dealt damage by CARDNAME this turn is put into a graveyard, put a +1/+1 counter on CARDNAME.")
&& power > 0)
value += 2;

View File

@@ -1958,7 +1958,7 @@ public class CardFactory_Creatures {
kithkin = kithkin.filter(new CardListFilter() {
public boolean addCard(Card c) {
return (c.isType("Kithkin") || c.hasKeyword("Changeling"))
return (c.isType("Kithkin"))
&& !c.equals(card);
}

View File

@@ -73,24 +73,25 @@ public class StaticAbility {
// In which layer should the ability be applied (for continuous effects only)
public int getLayer() {
if(mapParams.containsKey("AddType") || mapParams.containsKey("RemoveType") || mapParams.containsKey("RemoveCardType")
|| mapParams.containsKey("RemoveSubType") || mapParams.containsKey("RemoveSuperType"))
return 4;
if(mapParams.containsKey("AddColor") || mapParams.containsKey("RemoveColor") || mapParams.containsKey("SetColor"))
return 5;
if(mapParams.containsKey("AddKeyword") || mapParams.containsKey("AddAbility")
|| mapParams.containsKey("AddTrigger"))
return 6;
if(mapParams.containsKey("CharacteristicDefining"))
return 7;
if(mapParams.containsKey("AddPower") || mapParams.containsKey("AddToughness")
|| mapParams.containsKey("SetPower") || mapParams.containsKey("SetToughness"))
return 8; // This is the collection of 7b and 7c
if(mapParams.containsKey("AddKeyword") || mapParams.containsKey("AddAbility")
|| mapParams.containsKey("AddTrigger"))
return 6;
if(mapParams.containsKey("AddColor") || mapParams.containsKey("RemoveColor") || mapParams.containsKey("SetColor"))
return 5;
if(mapParams.containsKey("AddType") || mapParams.containsKey("RemoveType") || mapParams.containsKey("RemoveCardType")
|| mapParams.containsKey("RemoveSubType") || mapParams.containsKey("RemoveSuperType"))
return 4;
// Layer 1, 2 & 3 are not supported
return 0;