mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 01:38:13 +00:00
ManaCostShard: add Hybrid Colorless (#5199)
* ManaCostShard: add Hybrid Colorless * Add Hybrid Colorless Sprite * fix CostReduction for ColorlessHybrid --------- Co-authored-by: tool4ever <therealtoolkit@hotmail.com>
This commit is contained in:
@@ -319,9 +319,9 @@ public final class ManaCost implements Comparable<ManaCost>, Iterable<ManaCostSh
|
||||
return i;
|
||||
}
|
||||
|
||||
public boolean hasHybrid() {
|
||||
public boolean hasMultiColor() {
|
||||
for (ManaCostShard shard : shards) {
|
||||
if (shard.isHybrid()) {
|
||||
if (shard.isMultiColor()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,13 @@ public enum ManaCostShard {
|
||||
R2(ManaAtom.RED | ManaAtom.OR_2_GENERIC, "2/R", "2R"),
|
||||
G2(ManaAtom.GREEN | ManaAtom.OR_2_GENERIC, "2/G", "2G"),
|
||||
|
||||
/* Or Colorless */
|
||||
CW(ManaAtom.WHITE | ManaAtom.COLORLESS, "C/W", "CW"),
|
||||
CU(ManaAtom.BLUE | ManaAtom.COLORLESS, "C/U", "CU"),
|
||||
CB(ManaAtom.BLACK | ManaAtom.COLORLESS, "C/B", "CB"),
|
||||
CR(ManaAtom.RED | ManaAtom.COLORLESS, "C/R", "CR"),
|
||||
CG(ManaAtom.GREEN | ManaAtom.COLORLESS, "C/G", "CG"),
|
||||
|
||||
// Snow and colorless
|
||||
S(ManaAtom.IS_SNOW, "S"),
|
||||
GENERIC(ManaAtom.GENERIC, "1"),
|
||||
@@ -298,10 +305,14 @@ public enum ManaCostShard {
|
||||
return BinaryUtil.bitCount(this.shard & COLORS_SUPERPOSITION) == 1;
|
||||
}
|
||||
|
||||
public boolean isHybrid() {
|
||||
public boolean isMultiColor() {
|
||||
return BinaryUtil.bitCount(this.shard & COLORS_SUPERPOSITION) == 2;
|
||||
}
|
||||
|
||||
public boolean isColorless() {
|
||||
return isOfKind(ManaAtom.COLORLESS);
|
||||
}
|
||||
|
||||
public boolean isGeneric() {
|
||||
return isOfKind(ManaAtom.GENERIC)|| isOfKind(ManaAtom.IS_X) || this.isSnow() || this.isOr2Generic();
|
||||
}
|
||||
|
||||
@@ -398,8 +398,17 @@ public class ForgeScript {
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
else if (property.equals("CouldCastTiming")) {
|
||||
} else if (property.equals("otherAbility")) {
|
||||
if (sa.equals(spellAbility)) {
|
||||
return false;
|
||||
}
|
||||
if (spellAbility instanceof SpellAbility) {
|
||||
SpellAbility sourceSpell = (SpellAbility) spellAbility;
|
||||
if (sa.getRootAbility().equals(sourceSpell.getRootAbility())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (property.equals("CouldCastTiming")) {
|
||||
Card host = sa.getHostCard();
|
||||
Game game = host.getGame();
|
||||
if (game.getStack().isSplitSecondOnStack()) {
|
||||
|
||||
@@ -300,7 +300,7 @@ public class ManaCostBeingPaid {
|
||||
for (Entry<ManaCostShard, ShardCount> e : unpaidShards.entrySet()) {
|
||||
final ManaCostShard eShard = e.getKey();
|
||||
sc = e.getValue();
|
||||
if (eShard != ManaCostShard.COLORED_X && eShard.isOfKind(shard.getShard()) && !eShard.isMonoColor()) {
|
||||
if (eShard != ManaCostShard.COLORED_X && eShard.isOfKind(shard.getShard()) && eShard.isMultiColor()) {
|
||||
if (otherSubtract >= sc.totalCount) {
|
||||
otherSubtract -= sc.totalCount;
|
||||
sc.xCount = sc.totalCount = 0;
|
||||
@@ -336,6 +336,26 @@ public class ManaCostBeingPaid {
|
||||
}
|
||||
}
|
||||
|
||||
// try to remove colorless hybrid shards with colored shard
|
||||
for (Entry<ManaCostShard, ShardCount> e : unpaidShards.entrySet()) {
|
||||
final ManaCostShard eShard = e.getKey();
|
||||
sc = e.getValue();
|
||||
if (eShard.isOfKind(shard.getShard()) && eShard.isColorless()) {
|
||||
if (otherSubtract >= sc.totalCount) {
|
||||
otherSubtract -= sc.totalCount;
|
||||
sc.xCount = sc.totalCount = 0;
|
||||
toRemove.add(eShard);
|
||||
} else {
|
||||
sc.totalCount -= otherSubtract;
|
||||
if (sc.xCount > sc.totalCount) {
|
||||
sc.xCount = sc.totalCount;
|
||||
}
|
||||
// nothing more left in otherSubtract
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try to remove phyrexian shards with colored shard
|
||||
for (Entry<ManaCostShard, ShardCount> e : unpaidShards.entrySet()) {
|
||||
final ManaCostShard eShard = e.getKey();
|
||||
|
||||
@@ -109,6 +109,11 @@ public class CardFaceSymbols {
|
||||
MANA_IMAGES.put("2R", FSkin.getImage(FSkinProp.IMG_MANA_2R));
|
||||
MANA_IMAGES.put("2G", FSkin.getImage(FSkinProp.IMG_MANA_2G));
|
||||
MANA_IMAGES.put("2B", FSkin.getImage(FSkinProp.IMG_MANA_2B));
|
||||
MANA_IMAGES.put("CW", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_CW));
|
||||
MANA_IMAGES.put("CU", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_CU));
|
||||
MANA_IMAGES.put("CR", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_CR));
|
||||
MANA_IMAGES.put("CG", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_CG));
|
||||
MANA_IMAGES.put("CB", FSkin.getImage(FSkinProp.IMG_MANA_HYBRID_CB));
|
||||
|
||||
MANA_IMAGES.put("S", FSkin.getImage(FSkinProp.IMG_MANA_SNOW));
|
||||
MANA_IMAGES.put("T", FSkin.getImage(FSkinProp.IMG_TAP));
|
||||
|
||||
@@ -1098,7 +1098,7 @@ public class FSkin {
|
||||
private static String preferredDir;
|
||||
private static String preferredName;
|
||||
private static BufferedImage bimDefaultSprite, bimFavIcon, bimPreferredSprite, bimFoils, bimQuestDraftDeck, bimOldFoils,
|
||||
bimDefaultAvatars, bimPreferredAvatars, bimTrophies, bimAbilities, bimManaIcons, bimPhyrexian, bimDefaultSleeve,
|
||||
bimDefaultAvatars, bimPreferredAvatars, bimTrophies, bimAbilities, bimManaIcons, bimPhyrexian, bimColorlessHybrid, bimDefaultSleeve,
|
||||
bimDefaultSleeve2, bimDefaultDeckbox, bimPrefferedSetLogo, bimDefaultWatermark, bimDefaultDraftRank;
|
||||
private static int x0, y0, w0, h0, newW, newH, preferredW, preferredH;
|
||||
private static int defaultFontSize = 12;
|
||||
@@ -1239,8 +1239,9 @@ public class FSkin {
|
||||
final File f15 = new File(defaultDir + ForgeConstants.SPRITE_SETLOGO_FILE);
|
||||
final File f16 = new File(preferredDir + ForgeConstants.SPRITE_SETLOGO_FILE);
|
||||
final File f17 = new File(defaultDir + ForgeConstants.SPRITE_WATERMARK_FILE);
|
||||
final File f18 = new File(defaultDir +ForgeConstants.SPRITE_PHYREXIAN_FILE);
|
||||
final File f19 = new File(defaultDir + ForgeConstants.SPRITE_DRAFTRANKS_FILE);
|
||||
final File f18 = new File(defaultDir + ForgeConstants.SPRITE_PHYREXIAN_FILE);
|
||||
final File f19 = new File(defaultDir + ForgeConstants.SPRITE_COLORLESS_HYBRID_FILE);
|
||||
final File f20 = new File(defaultDir + ForgeConstants.SPRITE_DRAFTRANKS_FILE);
|
||||
|
||||
try {
|
||||
int p = 0;
|
||||
@@ -1252,6 +1253,8 @@ public class FSkin {
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimPhyrexian = ImageIO.read(f18);
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimColorlessHybrid = ImageIO.read(f19);
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimPreferredSprite = ImageIO.read(f2);
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimFoils = ImageIO.read(f3);
|
||||
@@ -1266,7 +1269,7 @@ public class FSkin {
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimDefaultDeckbox = ImageIO.read(f14);
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimDefaultDraftRank = ImageIO.read(f19);
|
||||
bimDefaultDraftRank = ImageIO.read(f20);
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
bimPrefferedSetLogo = f16.exists() ? ImageIO.read(f16) : ImageIO.read(f15);
|
||||
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
|
||||
@@ -1336,6 +1339,9 @@ public class FSkin {
|
||||
case PHYREXIAN:
|
||||
setImage(prop, bimPhyrexian);
|
||||
break;
|
||||
case COLORLESS_HYBRID:
|
||||
setImage(prop, bimColorlessHybrid);
|
||||
break;
|
||||
case DECKBOX:
|
||||
setImage(prop, bimDefaultDeckbox);
|
||||
break;
|
||||
@@ -1378,6 +1384,7 @@ public class FSkin {
|
||||
bimTrophies.flush();
|
||||
bimAbilities.flush();
|
||||
bimPhyrexian.flush();
|
||||
bimColorlessHybrid.flush();
|
||||
bimManaIcons.flush();
|
||||
|
||||
if (bimPreferredAvatars != null) { bimPreferredAvatars.flush(); }
|
||||
@@ -1398,6 +1405,7 @@ public class FSkin {
|
||||
bimTrophies = null;
|
||||
bimAbilities = null;
|
||||
bimPhyrexian = null;
|
||||
bimColorlessHybrid = null;
|
||||
bimManaIcons = null;
|
||||
|
||||
//establish encoding symbols
|
||||
@@ -1431,6 +1439,11 @@ public class FSkin {
|
||||
addEncodingSymbol("2/B", FSkinProp.IMG_MANA_2B);
|
||||
addEncodingSymbol("2/R", FSkinProp.IMG_MANA_2R);
|
||||
addEncodingSymbol("2/G", FSkinProp.IMG_MANA_2G);
|
||||
addEncodingSymbol("C/W", FSkinProp.IMG_MANA_HYBRID_CW);
|
||||
addEncodingSymbol("C/U", FSkinProp.IMG_MANA_HYBRID_CU);
|
||||
addEncodingSymbol("C/B", FSkinProp.IMG_MANA_HYBRID_CB);
|
||||
addEncodingSymbol("C/R", FSkinProp.IMG_MANA_HYBRID_CR);
|
||||
addEncodingSymbol("C/G", FSkinProp.IMG_MANA_HYBRID_CG);
|
||||
addEncodingSymbol("P", FSkinProp.IMG_MANA_PHRYX);
|
||||
addEncodingSymbol("P/W", FSkinProp.IMG_MANA_PHRYX_W);
|
||||
addEncodingSymbol("P/U", FSkinProp.IMG_MANA_PHRYX_U);
|
||||
|
||||
@@ -239,6 +239,8 @@ public class FSkin {
|
||||
final FileHandle f5 = getSkinFile(ForgeConstants.SPRITE_AVATARS_FILE);
|
||||
final FileHandle f6 = getDefaultSkinFile(SourceFile.OLD_FOILS.getFilename());
|
||||
final FileHandle f7 = getDefaultSkinFile(ForgeConstants.SPRITE_MANAICONS_FILE);
|
||||
//final FileHandle f7b = getDefaultSkinFile(ForgeConstants.SPRITE_PHYREXIAN_FILE);
|
||||
//final FileHandle f7c = getDefaultSkinFile(ForgeConstants.SPRITE_COLORLESS_HYBRID_FILE);
|
||||
final FileHandle f8 = getDefaultSkinFile(ForgeConstants.SPRITE_SLEEVES_FILE);
|
||||
final FileHandle f9 = getDefaultSkinFile(ForgeConstants.SPRITE_SLEEVES2_FILE);
|
||||
final FileHandle f10 = getDefaultSkinFile(ForgeConstants.SPRITE_BORDER_FILE);
|
||||
@@ -248,7 +250,6 @@ public class FSkin {
|
||||
final FileHandle f12b = getDefaultSkinFile(ForgeConstants.SPRITE_START_FILE);
|
||||
final FileHandle f13 = getDefaultSkinFile(ForgeConstants.SPRITE_DECKBOX_FILE);
|
||||
final FileHandle f17 = getDefaultSkinFile(ForgeConstants.SPRITE_CRACKS_FILE);
|
||||
final FileHandle f18 = getDefaultSkinFile(ForgeConstants.SPRITE_PHYREXIAN_FILE);
|
||||
final FileHandle f19 = getDefaultSkinFile(ForgeConstants.SPRITE_CURSOR_FILE);
|
||||
final FileHandle f20 = getSkinFile(ForgeConstants.SPRITE_SLEEVES_FILE);
|
||||
final FileHandle f21 = getSkinFile(ForgeConstants.SPRITE_SLEEVES2_FILE);
|
||||
|
||||
@@ -50,6 +50,11 @@ public enum FSkinImage implements FImage {
|
||||
MANA_2R (FSkinProp.IMG_MANA_2R, SourceFile.MANAICONS),
|
||||
MANA_2U (FSkinProp.IMG_MANA_2U, SourceFile.MANAICONS),
|
||||
MANA_2W (FSkinProp.IMG_MANA_2W, SourceFile.MANAICONS),
|
||||
MANA_HYBRID_CB (FSkinProp.IMG_MANA_HYBRID_CB, SourceFile.COLORLESS_HYBRID),
|
||||
MANA_HYBRID_CG (FSkinProp.IMG_MANA_HYBRID_CG, SourceFile.COLORLESS_HYBRID),
|
||||
MANA_HYBRID_CR (FSkinProp.IMG_MANA_HYBRID_CR, SourceFile.COLORLESS_HYBRID),
|
||||
MANA_HYBRID_CU (FSkinProp.IMG_MANA_HYBRID_CU, SourceFile.COLORLESS_HYBRID),
|
||||
MANA_HYBRID_CW (FSkinProp.IMG_MANA_HYBRID_CW, SourceFile.COLORLESS_HYBRID),
|
||||
MANA_HYBRID_BG (FSkinProp.IMG_MANA_HYBRID_BG, SourceFile.MANAICONS),
|
||||
MANA_HYBRID_BR (FSkinProp.IMG_MANA_HYBRID_BR, SourceFile.MANAICONS),
|
||||
MANA_HYBRID_GU (FSkinProp.IMG_MANA_HYBRID_GU, SourceFile.MANAICONS),
|
||||
@@ -491,6 +496,7 @@ public enum FSkinImage implements FImage {
|
||||
BTNSTART(ForgeConstants.SPRITE_START_FILE),
|
||||
MANAICONS(ForgeConstants.SPRITE_MANAICONS_FILE),
|
||||
PHYREXIAN(ForgeConstants.SPRITE_PHYREXIAN_FILE),
|
||||
COLORLESS_HYBRID(ForgeConstants.SPRITE_COLORLESS_HYBRID_FILE),
|
||||
SETLOGOS(ForgeConstants.SPRITE_SETLOGO_FILE),
|
||||
WATERMARKS(ForgeConstants.SPRITE_WATERMARK_FILE),
|
||||
DRAFTRANKS(ForgeConstants.SPRITE_DRAFTRANKS_FILE),
|
||||
|
||||
@@ -40,6 +40,11 @@ public class TextRenderer {
|
||||
Forge.getAssets().symbolLookup().put("2/B", FSkinImage.MANA_2B);
|
||||
Forge.getAssets().symbolLookup().put("2/R", FSkinImage.MANA_2R);
|
||||
Forge.getAssets().symbolLookup().put("2/G", FSkinImage.MANA_2G);
|
||||
Forge.getAssets().symbolLookup().put("C/W", FSkinImage.MANA_HYBRID_CW);
|
||||
Forge.getAssets().symbolLookup().put("C/U", FSkinImage.MANA_HYBRID_CU);
|
||||
Forge.getAssets().symbolLookup().put("C/B", FSkinImage.MANA_HYBRID_CB);
|
||||
Forge.getAssets().symbolLookup().put("C/R", FSkinImage.MANA_HYBRID_CR);
|
||||
Forge.getAssets().symbolLookup().put("C/G", FSkinImage.MANA_HYBRID_CG);
|
||||
Forge.getAssets().symbolLookup().put("P", FSkinImage.MANA_PHRYX);
|
||||
Forge.getAssets().symbolLookup().put("P/W", FSkinImage.MANA_PHRYX_W);
|
||||
Forge.getAssets().symbolLookup().put("P/U", FSkinImage.MANA_PHRYX_U);
|
||||
|
||||
@@ -90,6 +90,11 @@ public class CardFaceSymbols {
|
||||
Forge.getAssets().manaImages().put("2R", FSkinImage.MANA_2R);
|
||||
Forge.getAssets().manaImages().put("2G", FSkinImage.MANA_2G);
|
||||
Forge.getAssets().manaImages().put("2B", FSkinImage.MANA_2B);
|
||||
Forge.getAssets().manaImages().put("CW", FSkinImage.MANA_HYBRID_CW);
|
||||
Forge.getAssets().manaImages().put("CU", FSkinImage.MANA_HYBRID_CU);
|
||||
Forge.getAssets().manaImages().put("CR", FSkinImage.MANA_HYBRID_CR);
|
||||
Forge.getAssets().manaImages().put("CG", FSkinImage.MANA_HYBRID_CG);
|
||||
Forge.getAssets().manaImages().put("CB", FSkinImage.MANA_HYBRID_CB);
|
||||
|
||||
Forge.getAssets().manaImages().put("S", FSkinImage.MANA_SNOW);
|
||||
Forge.getAssets().manaImages().put("T", FSkinImage.TAP);
|
||||
|
||||
@@ -942,7 +942,7 @@ public class CardImageRenderer {
|
||||
}
|
||||
|
||||
public static Color[] drawCardBackgroundTexture(CardStateView state, Graphics g, List<DetailColors> backColors, float x, float y, float w, float h) {
|
||||
boolean isHybrid = state.getManaCost().hasHybrid();
|
||||
boolean isHybrid = state.getManaCost().hasMultiColor();
|
||||
boolean isPW = state.isPlaneswalker();
|
||||
boolean isNyx = state.isNyx();
|
||||
Color[] colors = new Color[backColors.size()];
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Name:Ulalek, Fused Atrocity
|
||||
ManaCost:CW CU CB CR CG
|
||||
Types:Legendary Creature Eldrazi
|
||||
PT:2/5
|
||||
K:Devoid
|
||||
T:Mode$ SpellCast | ValidCard$ Card.Eldrazi | ValidActivatingPlayer$ You | Execute$ TrigCopySpell | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast an Eldrazi spell, you may pay {C}{C}. If you do, copy all spells you control, then copy all other activated and triggered abilities you control. You may choose new targets for the copies. (Mana abilities can't be copied.)
|
||||
SVar:TrigCopySpell:AB$ CopySpellAbility | Cost$ C C | Defined$ ValidStack Spell.YouCtrl | MayChooseTarget$ True | IgnoreFreeze$ True | SubAbility$ TrigCopyAbilities
|
||||
SVar:TrigCopyAbilities:DB$ CopySpellAbility | Defined$ ValidStack Ability.YouCtrl+otherAbility | MayChooseTarget$ True | IgnoreFreeze$ True
|
||||
Oracle:Devoid\nWhenever you cast an Eldrazi spell, you may pay {C}{C}. If you do, copy all spells you control, then copy all other activated and triggered abilities you control. You may choose new targets for the copies. (Mana abilities can't be copied.)
|
||||
BIN
forge-gui/res/skins/default/sprite_hybrid_colorless.png
Normal file
BIN
forge-gui/res/skins/default/sprite_hybrid_colorless.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -125,6 +125,7 @@ public final class ForgeConstants {
|
||||
public static final String SPRITE_START_FILE = "sprite_start.png";
|
||||
public static final String SPRITE_MANAICONS_FILE = "sprite_manaicons.png";
|
||||
public static final String SPRITE_PHYREXIAN_FILE = "sprite_phyrexian.png";
|
||||
public static final String SPRITE_COLORLESS_HYBRID_FILE = "sprite_hybrid_colorless.png";
|
||||
public static final String SPRITE_CURSOR_FILE = "sprite_cursor.png";
|
||||
public static final String SPRITE_AVATARS_FILE = "sprite_avatars.png";
|
||||
public static final String SPRITE_CRACKS_FILE = "sprite_cracks.png";
|
||||
|
||||
@@ -104,6 +104,11 @@ public enum FSkinProp {
|
||||
IMG_MANA_2R (new int[] {330, 494, 80, 80}, PropType.MANAICONS),
|
||||
IMG_MANA_2U (new int[] {412, 494, 80, 80}, PropType.MANAICONS),
|
||||
IMG_MANA_2W (new int[] {166, 576, 80, 80}, PropType.MANAICONS),
|
||||
IMG_MANA_HYBRID_CB (new int[] {439, 2, 199, 199}, PropType.COLORLESS_HYBRID),
|
||||
IMG_MANA_HYBRID_CG (new int[] {878, 2, 199, 199}, PropType.COLORLESS_HYBRID),
|
||||
IMG_MANA_HYBRID_CR (new int[] {657, 2, 199, 199}, PropType.COLORLESS_HYBRID),
|
||||
IMG_MANA_HYBRID_CU (new int[] {219, 2, 199, 199}, PropType.COLORLESS_HYBRID),
|
||||
IMG_MANA_HYBRID_CW (new int[] {2, 2, 199, 199}, PropType.COLORLESS_HYBRID),
|
||||
IMG_MANA_HYBRID_BG (new int[] {166, 166, 80, 80}, PropType.MANAICONS),
|
||||
IMG_MANA_HYBRID_BR (new int[] {248, 166, 80, 80}, PropType.MANAICONS),
|
||||
IMG_MANA_HYBRID_GU (new int[] {166, 248, 80, 80}, PropType.MANAICONS),
|
||||
@@ -585,6 +590,7 @@ public enum FSkinProp {
|
||||
BTNSTART,
|
||||
MANAICONS,
|
||||
PHYREXIAN,
|
||||
COLORLESS_HYBRID,
|
||||
PLANAR_CONQUEST,
|
||||
ADVENTURE,
|
||||
DECKBOX,
|
||||
|
||||
Reference in New Issue
Block a user