mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user