implement [MH3] Kami of Jealous Thirst

This commit is contained in:
Susucre 2024-05-25 15:40:35 +02:00
parent 1bbb58f71f
commit 0e64a326c6
4 changed files with 133 additions and 6 deletions

View file

@ -317,14 +317,14 @@ public final class CardUtil {
/**
* Adjusts spell or ability cost to be paid by colored and generic mana.
*
* @param spellAbility
* @param manaCostsToReduce costs to reduce
* @param ability spell or ability to reduce the cost of
* @param manaCostsToReduce reduces the spell or ability cost by that much
* @param convertToGeneric colored mana does reduce generic mana if no
* appropriate colored mana is in the costs
* included
*/
public static void adjustCost(SpellAbility spellAbility, ManaCosts<ManaCost> manaCostsToReduce, boolean convertToGeneric) {
ManaCosts<ManaCost> previousCost = spellAbility.getManaCostsToPay();
public static void adjustCost(Ability ability, ManaCosts<ManaCost> manaCostsToReduce, boolean convertToGeneric) {
ManaCosts<ManaCost> previousCost = ability.getManaCostsToPay();
ManaCosts<ManaCost> adjustedCost = new ManaCostsImpl<>();
// save X value (e.g. convoke ability)
for (VariableCost vCost : previousCost.getVariableCosts()) {
@ -474,8 +474,8 @@ public final class CardUtil {
adjustedCost.add(new GenericManaCost(0)); // neede to check if cost was reduced to 0
}
adjustedCost.setSourceFilter(previousCost.getSourceFilter()); // keep mana source restrictions
spellAbility.clearManaCostsToPay();
spellAbility.addManaCostsToPay(adjustedCost);
ability.clearManaCostsToPay();
ability.addManaCostsToPay(adjustedCost);
}
/**