add Mystic Compass (from Alliances)

This commit is contained in:
slapshot5
2011-08-31 06:09:48 +00:00
parent 5ba1902263
commit ffbbcb2502
6 changed files with 112 additions and 66 deletions

1
.gitattributes vendored
View File

@@ -5022,6 +5022,7 @@ res/cardsfolder/m/myr_sire.txt svneol=native#text/plain
res/cardsfolder/m/myr_turbine.txt svneol=native#text/plain res/cardsfolder/m/myr_turbine.txt svneol=native#text/plain
res/cardsfolder/m/myrsmith.txt svneol=native#text/plain res/cardsfolder/m/myrsmith.txt svneol=native#text/plain
res/cardsfolder/m/mysteries_of_the_deep.txt svneol=native#text/plain res/cardsfolder/m/mysteries_of_the_deep.txt svneol=native#text/plain
res/cardsfolder/m/mystic_compass.txt -text
res/cardsfolder/m/mystic_crusader.txt svneol=native#text/plain res/cardsfolder/m/mystic_crusader.txt svneol=native#text/plain
res/cardsfolder/m/mystic_denial.txt svneol=native#text/plain res/cardsfolder/m/mystic_denial.txt svneol=native#text/plain
res/cardsfolder/m/mystic_enforcer.txt svneol=native#text/plain res/cardsfolder/m/mystic_enforcer.txt svneol=native#text/plain

View File

@@ -0,0 +1,13 @@
Name:Mystic Compass
ManaCost:2
Types:Artifact
Text:no text
A:AB$ ChooseType | Cost$ 1 T | Defined$ You | Type$ Basic Land | SubAbility$ SVar=DBAnimate | SpellDescription$ Target land becomes the basic land type of your choice until end of turn.
SVar:DBAnimate:DB$ Animate | ValidTgts$ Land | TgtPrompt$ Select target land | Types$ ChosenType | OverwriteTypes$ True | KeepSupertypes$ True | KeepCardTypes$ True
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/mystic_compass.jpg
SetInfo:6ED|Uncommon|http://magiccards.info/scans/en/6e/302.jpg
SetInfo:ALL|Uncommon|http://magiccards.info/scans/en/ai/166.jpg
Oracle:{1}, {T}: Target land becomes the basic land type of your choice until end of turn.
End

View File

@@ -411,7 +411,19 @@ public final class CardUtil {
return types; return types;
} }
/**
* <p>getCardTypes.</p>
*
* @return a {@link java.util.ArrayList} object.
* @since 1.1.3
*/
public static ArrayList<String> getBasicTypes() {
ArrayList<String> types = new ArrayList<String>();
types.addAll(Constant.CardTypes.basicTypes[0].list);
return types;
}
/** /**
* <p>isASuperType.</p> * <p>isASuperType.</p>

View File

@@ -63,8 +63,8 @@ public interface Constant {
//} //}
public interface Ability { public interface Ability {
public static final String Triggered = "Triggered"; String Triggered = "Triggered";
public static final String Activated = "Activated"; String Activated = "Activated";
} }
public interface Phase { public interface Phase {
@@ -90,81 +90,76 @@ public interface Constant {
} }
public interface Zone { public interface Zone {
public static final String Hand = "Hand"; String Hand = "Hand";
public static final String Library = "Library"; String Library = "Library";
public static final String Graveyard = "Graveyard"; String Graveyard = "Graveyard";
public static final String Battlefield = "Battlefield"; String Battlefield = "Battlefield";
public static final String Exile = "Exile"; String Exile = "Exile";
public static final String Command = "Command"; String Command = "Command";
public static final String Stack = "Stack"; String Stack = "Stack";
} }
public interface Color { public interface Color {
public static final String Black = "black"; String Black = "black";
public static final String Blue = "blue"; String Blue = "blue";
public static final String Green = "green"; String Green = "green";
public static final String Red = "red"; String Red = "red";
public static final String White = "white"; String White = "white";
public static final String Colorless = "colorless"; String Colorless = "colorless";
//color order "wubrg" //color order "wubrg"
public static final String Colors[] = {White, Blue, Black, Red, Green, Colorless}; String[] Colors = {White, Blue, Black, Red, Green, Colorless};
public static final String onlyColors[] = {White, Blue, Black, Red, Green}; String[] onlyColors = {White, Blue, Black, Red, Green};
public static final String Snow = "snow"; String Snow = "snow";
public static final String ManaColors[] = {White, Blue, Black, Red, Green, Colorless, Snow}; String[] ManaColors = {White, Blue, Black, Red, Green, Colorless, Snow};
public static final boolean loaded[] = {false}; boolean[] loaded = {false};
//public static final Constant_StringHashMap[] LandColor = new Constant_StringHashMap[1]; //public static final Constant_StringHashMap[] LandColor = new Constant_StringHashMap[1];
public static final String BasicLands[] = {"Plains", "Island", "Swamp", "Mountain", "Forest"}; String[] BasicLands = {"Plains", "Island", "Swamp", "Mountain", "Forest"};
} }
public interface Rarity { public interface Rarity {
public static final String Common = "Common"; String Common = "Common";
public static final String Uncommon = "Uncommon"; String Uncommon = "Uncommon";
public static final String Rare = "Rare"; String Rare = "Rare";
public static final String Mythic = "Mythic"; String Mythic = "Mythic";
public static final String Land = "Land"; String Land = "Land";
} }
public interface Quest { public interface Quest {
public static final boolean[] fantasyQuest = new boolean[1]; boolean[] fantasyQuest = new boolean[1];
//public static final Quest_Assignment[] qa = new Quest_Assignment[1]; //public static final Quest_Assignment[] qa = new Quest_Assignment[1];
public static final CardList[] humanList = new CardList[1]; CardList[] humanList = new CardList[1];
public static final CardList[] computerList = new CardList[1]; CardList[] computerList = new CardList[1];
public static final int[] humanLife = new int[1]; int[] humanLife = new int[1];
public static final int[] computerLife = new int[1]; int[] computerLife = new int[1];
public static final String[] oppIconName = new String[1]; String[] oppIconName = new String[1];
} }
public interface CardTypes { public interface CardTypes {
public static final boolean loaded[] = {false}; boolean[] loaded = {false};
public static final Constant_StringArrayList cardTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] cardTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList superTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] superTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList basicTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] basicTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList landTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] landTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList creatureTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] creatureTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList instantTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] instantTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList sorceryTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] sorceryTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList enchantmentTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] enchantmentTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList artifactTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] artifactTypes = new Constant_StringArrayList[1];
public static final Constant_StringArrayList walkerTypes[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] walkerTypes = new Constant_StringArrayList[1];
} }
public interface Keywords { public interface Keywords {
public static final boolean loaded[] = {false}; boolean[] loaded = {false};
public static final Constant_StringArrayList NonStackingList[] = new Constant_StringArrayList[1]; Constant_StringArrayList[] NonStackingList = new Constant_StringArrayList[1];
} }
} //Constant
}//Constant

View File

@@ -138,7 +138,7 @@ public class AbilityFactory_Animate {
toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa);
} }
boolean permanent = params.containsKey("Permanent") ? true : false; boolean permanent = params.containsKey("Permanent");
final ArrayList<String> types = new ArrayList<String>(); final ArrayList<String> types = new ArrayList<String>();
if (params.containsKey("Types")) { if (params.containsKey("Types")) {
types.addAll(Arrays.asList(params.get("Types").split(","))); types.addAll(Arrays.asList(params.get("Types").split(",")));
@@ -197,17 +197,22 @@ public class AbilityFactory_Animate {
sb.append("color of that player's choice"); sb.append("color of that player's choice");
} }
else { else {
for (int i = 0; i < colors.size(); i++) { for (int i = 0; i < colors.size(); i++) {
sb.append(colors.get(i)); sb.append(colors.get(i));
if (i < (colors.size() - 1)) { if (i < (colors.size() - 1)) {
sb.append(" and "); sb.append(" and ");
} }
} }
} }
sb.append(" "); sb.append(" ");
for (int i = types.size() - 1; i >= 0; i--) { if (types.contains("ChosenType")) {
sb.append(types.get(i)); sb.append("type of player's choice ");
sb.append(" "); }
else {
for (int i = types.size() - 1; i >= 0; i--) {
sb.append(types.get(i));
sb.append(" ");
}
} }
if (keywords.size() > 0) { if (keywords.size() > 0) {
sb.append("with "); sb.append("with ");
@@ -272,8 +277,8 @@ public class AbilityFactory_Animate {
//don't use instant speed animate abilities outside humans Combat_Declare_Attackers_InstantAbility step //don't use instant speed animate abilities outside humans Combat_Declare_Attackers_InstantAbility step
if ((!AllZone.getPhase().is(Constant.Phase.Combat_Declare_Attackers_InstantAbility) if ((!AllZone.getPhase().is(Constant.Phase.Combat_Declare_Attackers_InstantAbility)
|| AllZone.getCombat().getAttackers().length == 0) || AllZone.getCombat().getAttackers().length == 0)
&& AllZone.getPhase().isPlayerTurn(AllZone.getHumanPlayer())) && AllZone.getPhase().isPlayerTurn(AllZone.getHumanPlayer()))
{ {
return false; return false;
} }
@@ -300,7 +305,7 @@ public class AbilityFactory_Animate {
toughness = AbilityFactory.calculateAmount(source, params.get("Toughness"), sa); toughness = AbilityFactory.calculateAmount(source, params.get("Toughness"), sa);
} }
if (power + toughness > c.getCurrentPower() + c.getCurrentToughness()) { if (power + toughness > c.getCurrentPower() + c.getCurrentToughness()) {
bFlag = true; bFlag = true;
} }
} }

View File

@@ -306,6 +306,26 @@ public class AbilityFactory_Choose {
} }
} }
} }
else if (type.equals("Basic Land")) {
boolean valid = false;
while (!valid) {
if (sa.getActivatingPlayer().isHuman()) {
Object o = GuiUtils.getChoice("Choose a basic land type",
CardUtil.getBasicTypes().toArray());
if (null == o) {
return;
}
String choice = (String) o;
if (CardUtil.isABasicLandType(choice) && !invalidTypes.contains(choice)) {
valid = true;
card.setChosenType(choice);
}
} else {
//TODO
//computer will need to choose a type
}
}
} //end if-else if
} }
} }
} }