Minor formatting.

This commit is contained in:
LevelX2 2014-02-18 17:36:10 +01:00
parent 1f3687cc86
commit d48d44dd56
4 changed files with 104 additions and 67 deletions

View file

@ -28,11 +28,12 @@
package mage.deck; package mage.deck;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
import mage.cards.Sets; import mage.cards.Sets;
import mage.cards.decks.Constructed; import mage.cards.decks.Constructed;
import mage.constants.SetType; import mage.constants.SetType;
import mage.sets.EighthEdition;
/** /**
* *
@ -44,7 +45,7 @@ public class Modern extends Constructed {
public Modern() { public Modern() {
super("Constructed - Modern"); super("Constructed - Modern");
Date cutoff = EighthEdition.getInstance().getReleaseDate(); // 2003 / 07 / 28 Date cutoff = new GregorianCalendar(2003, 7, 28).getTime(); // Eight edition release date
for (ExpansionSet set: Sets.getInstance().values()) { for (ExpansionSet set: Sets.getInstance().values()) {
if ((set.getReleaseDate().after(cutoff) || set.getReleaseDate().equals(cutoff)) && set.getSetType() != SetType.REPRINT) { if ((set.getReleaseDate().after(cutoff) || set.getReleaseDate().equals(cutoff)) && set.getSetType() != SetType.REPRINT) {
setCodes.add(set.getCode()); setCodes.add(set.getCode());

View file

@ -30,8 +30,7 @@ package mage.sets.commander;
import java.util.UUID; import java.util.UUID;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.common.GainLiveOpponentCost; import mage.abilities.costs.common.GainLifeOpponentCost;
import mage.abilities.costs.common.GainLivePlayersCost;
import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
@ -60,7 +59,7 @@ public class Invigorate extends CardImpl<Invigorate> {
this.color.setGreen(true); this.color.setGreen(true);
// If you control a Forest, rather than pay Invigorate's mana cost, you may have an opponent gain 3 life. // If you control a Forest, rather than pay Invigorate's mana cost, you may have an opponent gain 3 life.
this.addAbility(new AlternativeCostSourceAbility(new GainLiveOpponentCost(3), new ControlsPermanentCondition(filter))); this.addAbility(new AlternativeCostSourceAbility(new GainLifeOpponentCost(3), new ControlsPermanentCondition(filter)));
// Target creature gets +4/+4 until end of turn. // Target creature gets +4/+4 until end of turn.
this.getSpellAbility().addEffect(new BoostTargetEffect(4,4,Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostTargetEffect(4,4,Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(true));

View file

@ -180,16 +180,23 @@ class UtopiaSprawlEffect extends ManaEffect<UtopiaSprawlEffect> {
Player player = game.getPlayer(land.getControllerId()); Player player = game.getPlayer(land.getControllerId());
if (player != null) { if (player != null) {
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
if (color.isBlack()) switch(color.toString()) {
player.getManaPool().addMana(Mana.BlackMana, game, source); case "W":
else if (color.isBlue()) player.getManaPool().addMana(Mana.WhiteMana, game, source);
player.getManaPool().addMana(Mana.BlueMana, game, source); break;
else if (color.isRed()) case "B":
player.getManaPool().addMana(Mana.RedMana, game, source); player.getManaPool().addMana(Mana.BlackMana, game, source);
else if (color.isGreen()) break;
player.getManaPool().addMana(Mana.GreenMana, game, source); case "U":
else if (color.isWhite()) player.getManaPool().addMana(Mana.BlueMana, game, source);
player.getManaPool().addMana(Mana.WhiteMana, game, source); break;
case "G":
player.getManaPool().addMana(Mana.GreenMana, game, source);
break;
case "R":
player.getManaPool().addMana(Mana.RedMana, game, source);
break;
}
return true; return true;
} }
} }

View file

@ -79,11 +79,21 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
public int getColorCount() { public int getColorCount() {
int count = 0; int count = 0;
if (white) count++; if (white) {
if (blue) count++; count++;
if (black) count++; }
if (green) count++; if (blue) {
if (red) count++; count++;
}
if (black) {
count++;
}
if (green) {
count++;
}
if (red) {
count++;
}
return count; return count;
} }
@ -104,17 +114,19 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
} }
public boolean isMulticolored() { public boolean isMulticolored() {
if (isColorless()) if (isColorless()) {
return false; return false;
if (white && (blue | black | red | green)) }
if (white && (blue | black | red | green)) {
return true; return true;
if (blue && (black | red | green)) }
if (blue && (black | red | green)) {
return true; return true;
if (black && (red | green)) }
if (black && (red | green)) {
return true; return true;
if (red && green) }
return true; return red && green;
return false;
} }
public boolean isWhite() { public boolean isWhite() {
@ -151,16 +163,21 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (white) if (white) {
sb.append("W"); sb.append("W");
if (blue) }
if (blue) {
sb.append("U"); sb.append("U");
if (black) }
if (black) {
sb.append("B"); sb.append("B");
if (red) }
if (red) {
sb.append("R"); sb.append("R");
if (green) }
if (green) {
sb.append("G"); sb.append("G");
}
return sb.toString(); return sb.toString();
} }
@ -169,38 +186,47 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
if (getColorCount() > 1) { if (getColorCount() > 1) {
return "multicolored"; return "multicolored";
} else { } else {
if (white) if (white) {
return "white"; return "white";
if (blue) }
return "blue"; if (blue) {
if (black) return "blue";
return "black"; }
if (red) if (black) {
return "red"; return "black";
if (green) }
return "green"; if (red) {
return "red";
}
if (green) {
return "green";
}
} }
return "colorless"; return "colorless";
} }
@Override @Override
public boolean equals(Object color) { public boolean equals(Object color) {
if (this == color) if (this == color) {
return true; return true;
if (!(color instanceof ObjectColor)) }
if (!(color instanceof ObjectColor)) {
return false; return false;
}
ObjectColor test = (ObjectColor) color; ObjectColor test = (ObjectColor) color;
if (test.white != this.white) if (test.white != this.white) {
return false; return false;
if (test.blue != this.blue) }
if (test.blue != this.blue) {
return false; return false;
if (test.black != this.black) }
if (test.black != this.black) {
return false; return false;
if (test.red != this.red) }
if (test.red != this.red) {
return false; return false;
if (test.green != this.green) }
return false; return test.green == this.green;
return true;
} }
@Override @Override
@ -231,10 +257,12 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
} }
public boolean shares(ObjectColor color) { public boolean shares(ObjectColor color) {
if (this == color) if (this == color) {
return true; return true;
if (!hasColor() && !color.hasColor()) }
if (!hasColor() && !color.hasColor()) {
return true; return true;
}
return color.white && white || color.blue && blue || color.black && black || return color.white && white || color.blue && blue || color.black && black ||
color.red && red || color.green && green; color.red && red || color.green && green;
} }
@ -269,34 +297,36 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
int o1 = 0; int o1 = 0;
int o2 = 0; int o2 = 0;
if (this.isMulticolored()) if (this.isMulticolored()) {
o1 = 6; o1 = 6;
else if(this.isColorless()) } else if(this.isColorless()) {
o1 = 0; o1 = 0;
else if(this.isBlack()) } else if(this.isBlack()) {
o1 = 1; o1 = 1;
else if(this.isBlue()) } else if(this.isBlue()) {
o1 = 2; o1 = 2;
else if(this.isGreen()) } else if(this.isGreen()) {
o1 = 3; o1 = 3;
else if(this.isRed()) } else if(this.isRed()) {
o1 = 4; o1 = 4;
else if(this.isWhite()) } else if(this.isWhite()) {
o1 = 5; o1 = 5;
if (o.isMulticolored()) }
if (o.isMulticolored()) {
o2 = 6; o2 = 6;
else if(o.isColorless()) } else if(o.isColorless()) {
o2 = 0; o2 = 0;
else if(o.isBlack()) } else if(o.isBlack()) {
o2 = 1; o2 = 1;
else if(o.isBlue()) } else if(o.isBlue()) {
o2 = 2; o2 = 2;
else if(o.isGreen()) } else if(o.isGreen()) {
o2 = 3; o2 = 3;
else if(o.isRed()) } else if(o.isRed()) {
o2 = 4; o2 = 4;
else if(o.isWhite()) } else if(o.isWhite()) {
o2 = 5; o2 = 5;
}
return o1 - o2; return o1 - o2;
} }