Solve issue 1472 (#1528)

* ManaEffect.resolve add runTriggers boolean

* AbilityManaPart.produceMana incorporate runTriggers boolean

* caged_sun.txt refactor

* AbilityManaPart.produceMana split to add TriggerManaAdded

* TriggerManaAdded.java

* TriggerTapsForMana.java refactor out unneeded

* TriggerType.ManaAdded

* Adjust checks for new Trigger

* Caged Sun fix

* Fix False Dawn only affecting mana abilities

* Rework tapsForMana call

* Clean up

* Support default rules value

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
Co-authored-by: tool4ever <therealtoolkit@hotmail.com>
This commit is contained in:
Northmoc
2022-11-21 15:37:01 -05:00
committed by GitHub
parent d57794b31d
commit 35365c0893
29 changed files with 181 additions and 68 deletions

View File

@@ -514,10 +514,9 @@ public class ComputerUtilMana {
// Run triggers like Nissa
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(hostCard);
runParams.put(AbilityKey.Player, ai); // assuming AI would only ever gives itself mana
runParams.put(AbilityKey.Activator, ai); // assuming AI would only ever gives itself mana
runParams.put(AbilityKey.AbilityMana, saPayment);
runParams.put(AbilityKey.Produced, manaProduced);
runParams.put(AbilityKey.Activator, ai);
for (Trigger tr : ai.getGame().getTriggerHandler().getActiveTrigger(TriggerType.TapsForMana, runParams)) {
SpellAbility trSA = tr.ensureAbility();
if (trSA == null) {
@@ -529,7 +528,7 @@ public class ComputerUtilMana {
if (produced.equals("Chosen")) {
produced = MagicColor.toShortString(trSA.getHostCard().getChosenColor());
}
manaProduced += " " + StringUtils.repeat(produced, pAmount);
manaProduced += " " + StringUtils.repeat(produced, " ", pAmount);
} else if (ApiType.ManaReflected.equals(trSA.getApi())) {
final String colorOrType = trSA.getParamOrDefault("ColorOrType", "Color");
// currently Color or Type, Type is colors + colorless