mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Improve payment test on hybrid shards (#2562)
* Improve payment test on hybrid shards * Clean up --------- Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
This commit is contained in:
@@ -688,10 +688,6 @@ public class ComputerUtilMana {
|
||||
ListMultimap<ManaCostShard, SpellAbility> sourcesForShards = getSourcesForShards(cost, sa, ai, test,
|
||||
checkPlayable, manaSpentToPay, hasConverge, ignoreColor, ignoreType);
|
||||
|
||||
if (sourcesForShards == null && !purePhyrexian) {
|
||||
return false; // no mana abilities to use for paying
|
||||
}
|
||||
|
||||
int testEnergyPool = ai.getCounters(CounterEnumType.ENERGY);
|
||||
final ManaPool manapool = ai.getManaPool();
|
||||
ManaCostShard toPay = null;
|
||||
@@ -712,7 +708,7 @@ public class ComputerUtilMana {
|
||||
manapool.applyCardMatrix(pay);
|
||||
|
||||
for (byte color : ManaAtom.MANATYPES) {
|
||||
if (manapool.tryPayCostWithColor(color, sa, cost)) {
|
||||
if (manapool.tryPayCostWithColor(color, sa, cost, manaSpentToPay)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -724,6 +720,11 @@ public class ComputerUtilMana {
|
||||
if (cost.isPaid()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (sourcesForShards == null && !purePhyrexian) {
|
||||
return false; // no mana abilities to use for paying
|
||||
}
|
||||
|
||||
toPay = getNextShardToPay(cost);
|
||||
|
||||
boolean lifeInsteadOfBlack = toPay.isBlack() && ai.hasKeyword("PayLifeInsteadOf:B");
|
||||
|
||||
@@ -212,7 +212,7 @@ public class ManaPool extends ManaConversionMatrix implements Iterable<Mana> {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean tryPayCostWithColor(byte colorCode, SpellAbility saPaidFor, ManaCostBeingPaid manaCost) {
|
||||
public boolean tryPayCostWithColor(byte colorCode, SpellAbility saPaidFor, ManaCostBeingPaid manaCost, List<Mana> manaSpentToPay) {
|
||||
Mana manaFound = null;
|
||||
String restriction = manaCost.getSourceRestriction();
|
||||
Collection<Mana> cm = floatingMana.get(colorCode);
|
||||
@@ -231,7 +231,7 @@ public class ManaPool extends ManaConversionMatrix implements Iterable<Mana> {
|
||||
}
|
||||
|
||||
if (manaFound != null && tryPayCostWithMana(saPaidFor, manaCost, manaFound, false)) {
|
||||
saPaidFor.getPayingMana().add(0, manaFound);
|
||||
manaSpentToPay.add(0, manaFound);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -5,10 +5,8 @@ PT:3/4
|
||||
K:Vigilance
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield or attacks, exile a card from a graveyard.
|
||||
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigExile | Secondary$ True | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, exile a card from a graveyard.
|
||||
SVar:TrigExile:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card | ChangeNum$ 1 | SelectPrompt$ Select a card from a graveyard | Mandatory$ True | Hidden$ True | Imprint$ True | AILogic$ ExilePreference:MostProminentNonLandNonExiledOwnType
|
||||
SVar:TrigExile:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card | ChangeNum$ 1 | SelectPrompt$ Select a card from a graveyard | Mandatory$ True | Hidden$ True | AILogic$ ExilePreference:MostProminentNonLandNonExiledOwnType
|
||||
S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Amount$ AffectedX | Activator$ You | Description$ Spells you cast cost {1} less to cast for each card type they share with cards exiled with CARDNAME.
|
||||
SVar:AffectedX:Count$TypesSharedWith Imprinted.ExiledWithSource
|
||||
T:Mode$ ChangesZone | Origin$ Battlefield | ValidCard$ Card.Self | Destination$ Any | Execute$ DBCleanup | Static$ True
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True
|
||||
SVar:AffectedX:Count$TypesSharedWith Card.ExiledWithSource
|
||||
DeckHints:Ability$Graveyard|Discard
|
||||
Oracle:Vigilance\nWhenever Cemetery Prowler enters the battlefield or attacks, exile a card from a graveyard.\nSpells you cast cost {1} less to cast for each card type they share with cards exiled with Cemetery Prowler.
|
||||
|
||||
@@ -201,7 +201,7 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
||||
|
||||
public void useManaFromPool(byte colorCode) {
|
||||
// find the matching mana in pool.
|
||||
if (player.getManaPool().tryPayCostWithColor(colorCode, saPaidFor, manaCost)) {
|
||||
if (player.getManaPool().tryPayCostWithColor(colorCode, saPaidFor, manaCost, saPaidFor.getPayingMana())) {
|
||||
onManaAbilityPaid();
|
||||
showMessage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user