Fix Primal Wellspring trigger not working with Chun-Li (#6971)

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
This commit is contained in:
tool4ever
2025-02-06 07:40:29 +01:00
committed by GitHub
parent cfd1822198
commit 2443f1486d
4 changed files with 15 additions and 11 deletions

View File

@@ -322,16 +322,13 @@ public class AbilityManaPart implements java.io.Serializable {
return this.triggersWhenSpent != null;
}
public void addTriggersWhenSpent(SpellAbility saBeingPaid, Card card) {
if (this.triggersWhenSpent == null)
return;
TriggerHandler handler = card.getGame().getTriggerHandler();
public void addTriggersWhenSpent(SpellAbility saBeingPaid) {
Trigger trig = TriggerHandler.parseTrigger(sVarHolder.getSVar(this.triggersWhenSpent), sourceCard, false, sVarHolder);
if (sVarHolder instanceof SpellAbility) {
trig.setSpawningAbility((SpellAbility) sVarHolder);
trig.addRemembered(saBeingPaid);
if (getSourceSA() != null) {
trig.setSpawningAbility(getSourceSA());
}
handler.registerOneTrigger(trig);
saBeingPaid.getHostCard().getGame().getTriggerHandler().registerThisTurnDelayedTrigger(trig);
}
public SpellAbility getSourceSA() {

View File

@@ -838,7 +838,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
for (Mana mana : getPayingMana()) {
if (mana.triggersWhenSpent()) {
mana.getManaAbility().addTriggersWhenSpent(this, host);
mana.getManaAbility().addTriggersWhenSpent(this);
}
if (mana.addsCounters(this)) {

View File

@@ -251,6 +251,13 @@ public class TriggerSpellAbilityCastOrCopy extends Trigger {
return false;
}
}
if (getSpawningAbility() != null && getSpawningAbility().hasParam("TriggersWhenSpent")) {
if (!getTriggerRemembered().contains(spellAbility)) {
return false;
}
}
return true;
}

View File

@@ -1295,8 +1295,8 @@ lblFullControl=Full Control
lblFullControlDetails=This feature lets you skip different helpers that streamline gameplay by avoiding somewhat annoying GUI interactions and instead use AI logic to make reasonable decisions for beginners.\nUseful for certain corner cases or if you want to challenge yourself with the Comprehensive Rules:\ne.g. the opposite cost order is needed if activating an animated "Halo Fountain" that's also tapped.
lblChooseCostOrder=Choose cost order
lblChooseCostReductionOrder=Choose cost reduction order & amount
lblNoPaymentFromManaAbility=Don\'t attempt paying when generating mana
lblNoFreeCombatCostHandling=Don\'t accept attack/block costs of \{0\}
lblNoPaymentFromManaAbility=Don''t attempt paying when generating mana
lblNoFreeCombatCostHandling=Don''t accept attack/block costs of \{0\}
lblAllowPaymentStartWithMissingResources=Allow payment start when cost seems unaffordable
lblLayerTimestampOrder=Finetune layer timestamp order
lblOrderCosts=Order costs