mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Merge pull request #3769 from Eleros/feature/HASCON2017Promos
Feature/hascon2017 promos
This commit is contained in:
commit
9a1ce3f449
11 changed files with 387 additions and 13 deletions
|
|
@ -42,12 +42,16 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
public static final ObjectColor BLACK = new ObjectColor("B");
|
||||
public static final ObjectColor RED = new ObjectColor("R");
|
||||
public static final ObjectColor GREEN = new ObjectColor("G");
|
||||
|
||||
public static final ObjectColor GOLD = new ObjectColor("O");
|
||||
|
||||
private boolean white;
|
||||
private boolean blue;
|
||||
private boolean black;
|
||||
private boolean red;
|
||||
private boolean green;
|
||||
|
||||
private boolean gold;
|
||||
|
||||
public ObjectColor() {
|
||||
}
|
||||
|
|
@ -70,6 +74,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
case 'G':
|
||||
green = true;
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
gold = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -80,6 +88,8 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
black = color.black;
|
||||
red = color.red;
|
||||
green = color.green;
|
||||
|
||||
gold = color.gold;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,6 +106,8 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
newColor.black = black || other.black;
|
||||
newColor.red = red || other.red;
|
||||
newColor.green = green || other.green;
|
||||
|
||||
newColor.gold = gold || other.gold;
|
||||
return newColor;
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +145,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (red) {
|
||||
count++;
|
||||
}
|
||||
|
||||
if (gold) {
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
@ -153,6 +169,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (this.isGreen()) {
|
||||
colors.add(ObjectColor.GREEN);
|
||||
}
|
||||
|
||||
if (this.isGold()) {
|
||||
colors.add(ObjectColor.GOLD);
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
||||
|
|
@ -162,6 +182,8 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
this.setGreen(color.isGreen());
|
||||
this.setRed(color.isRed());
|
||||
this.setWhite(color.isWhite());
|
||||
|
||||
this.setGold(color.isGold());
|
||||
}
|
||||
|
||||
public void addColor(ObjectColor color) {
|
||||
|
|
@ -180,6 +202,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (color.isGreen()) {
|
||||
setGreen(true);
|
||||
}
|
||||
|
||||
if (color.isGold()) {
|
||||
setGold(true);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isColorless() {
|
||||
|
|
@ -187,23 +213,32 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
}
|
||||
|
||||
public boolean hasColor() {
|
||||
return white || blue || black || red || green;
|
||||
return white || blue || black || red || green
|
||||
|| gold;
|
||||
}
|
||||
|
||||
public boolean isMulticolored() {
|
||||
if (isColorless()) {
|
||||
return false;
|
||||
}
|
||||
if (white && (blue || black || red || green)) {
|
||||
if (white && (blue || black || red || green
|
||||
|| gold)) {
|
||||
return true;
|
||||
}
|
||||
if (blue && (black || red || green)) {
|
||||
if (blue && (black || red || green
|
||||
|| gold)) {
|
||||
return true;
|
||||
}
|
||||
if (black && (red || green)) {
|
||||
if (black && (red || green
|
||||
|| gold)) {
|
||||
return true;
|
||||
}
|
||||
return red && green;
|
||||
if (red && (green
|
||||
|| gold)) {
|
||||
return true;
|
||||
}
|
||||
return green
|
||||
&& gold;
|
||||
}
|
||||
|
||||
public boolean isWhite() {
|
||||
|
|
@ -245,6 +280,15 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
public void setGreen(boolean green) {
|
||||
this.green = green;
|
||||
}
|
||||
|
||||
|
||||
public boolean isGold() {
|
||||
return gold;
|
||||
}
|
||||
|
||||
public void setGold(boolean gold) {
|
||||
this.gold = gold;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
@ -264,6 +308,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (green) {
|
||||
sb.append('G');
|
||||
}
|
||||
|
||||
if (gold) {
|
||||
sb.append('O');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
@ -286,6 +334,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (green) {
|
||||
return "green";
|
||||
}
|
||||
|
||||
if (gold) {
|
||||
return "gold";
|
||||
}
|
||||
}
|
||||
return "colorless";
|
||||
}
|
||||
|
|
@ -311,7 +363,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (test.red != this.red) {
|
||||
return false;
|
||||
}
|
||||
return test.green == this.green;
|
||||
if (test.green != this.green) {
|
||||
return false;
|
||||
}
|
||||
return test.gold == this.gold;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -322,6 +377,8 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
hash = 23 * hash + (this.black ? 1 : 0);
|
||||
hash = 23 * hash + (this.red ? 1 : 0);
|
||||
hash = 23 * hash + (this.green ? 1 : 0);
|
||||
|
||||
hash = 23 * hash + (this.gold ? 1 : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
|
@ -344,6 +401,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (color.green && this.green) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (color.gold && this.gold) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +412,8 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
// 105.4. [...] “Multicolored” is not a color. Neither is “colorless.”
|
||||
return !color.isColorless()
|
||||
&& (color.white && white || color.blue && blue || color.black && black
|
||||
|| color.red && red || color.green && green);
|
||||
|| color.red && red || color.green && green
|
||||
|| color.gold && gold);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -365,7 +427,7 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
int o2 = 0;
|
||||
|
||||
if (this.isMulticolored()) {
|
||||
o1 = 6;
|
||||
o1 = 7;
|
||||
} else if (this.isColorless()) {
|
||||
o1 = 0;
|
||||
} else if (this.isBlack()) {
|
||||
|
|
@ -378,9 +440,12 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
o1 = 4;
|
||||
} else if (this.isWhite()) {
|
||||
o1 = 5;
|
||||
|
||||
} else if (this.isGold()) {
|
||||
o1 = 6;
|
||||
}
|
||||
if (o.isMulticolored()) {
|
||||
o2 = 6;
|
||||
o2 = 7;
|
||||
} else if (o.isColorless()) {
|
||||
o2 = 0;
|
||||
} else if (o.isBlack()) {
|
||||
|
|
@ -393,6 +458,9 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
o2 = 4;
|
||||
} else if (o.isWhite()) {
|
||||
o2 = 5;
|
||||
|
||||
} else if (o.isGold()) {
|
||||
o2 = 6;
|
||||
}
|
||||
return o1 - o2;
|
||||
}
|
||||
|
|
@ -419,6 +487,10 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
if (isWhite()) {
|
||||
return ColoredManaSymbol.W;
|
||||
}
|
||||
|
||||
if (isGold()) {
|
||||
return ColoredManaSymbol.O;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -429,6 +501,8 @@ public class ObjectColor implements Serializable, Copyable<ObjectColor>, Compara
|
|||
colors.add(ObjectColor.BLACK);
|
||||
colors.add(ObjectColor.RED);
|
||||
colors.add(ObjectColor.GREEN);
|
||||
|
||||
colors.add(ObjectColor.GOLD);
|
||||
return colors;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ package mage.constants;
|
|||
* @author North
|
||||
*/
|
||||
public enum ColoredManaSymbol {
|
||||
W("W","white"), U("U","blue"), B("B","black"), R("R","red"), G("G","green");
|
||||
W("W","white"), U("U","blue"), B("B","black"), R("R","red"), G("G","green"),
|
||||
O("O","gold");
|
||||
|
||||
|
||||
private final String text;
|
||||
private final String colorName;
|
||||
|
|
@ -38,6 +40,9 @@ public enum ColoredManaSymbol {
|
|||
return B;
|
||||
case 'U':
|
||||
return U;
|
||||
|
||||
case 'O':
|
||||
return O;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Saga
|
||||
*/
|
||||
public class DragonTokenGold extends Token {
|
||||
|
||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("UST","H17"));
|
||||
}
|
||||
|
||||
public DragonTokenGold() {
|
||||
this(null, 0);
|
||||
}
|
||||
|
||||
public DragonTokenGold(String setCode) {
|
||||
this(setCode, 0);
|
||||
}
|
||||
|
||||
public DragonTokenGold(String setCode, int tokenType) {
|
||||
super("Dragon", "4/4 gold Dragon creature token with flying");
|
||||
availableImageSetCodes = tokenImageSets;
|
||||
setOriginalExpansionSetCode(setCode);
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setGold(true);
|
||||
subtype.add("Dragon");
|
||||
power = new MageInt(4);
|
||||
toughness = new MageInt(4);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue