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:
Hans Mackowiak
2024-05-06 07:21:01 +02:00
committed by GitHub
parent e49d57851f
commit 31ab875d6e
15 changed files with 103 additions and 12 deletions

View File

@@ -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()) {

View File

@@ -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();