Skip to content

Commit 936f431

Browse files
tool4EvErtool4EvEr
authored andcommitted
Fix Primal Wellspring trigger not working with Chun-Li
1 parent f562ae6 commit 936f431

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

forge-game/src/main/java/forge/game/spellability/AbilityManaPart.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,16 +322,13 @@ public boolean getTriggersWhenSpent() {
322322
return this.triggersWhenSpent != null;
323323
}
324324

325-
public void addTriggersWhenSpent(SpellAbility saBeingPaid, Card card) {
326-
if (this.triggersWhenSpent == null)
327-
return;
328-
329-
TriggerHandler handler = card.getGame().getTriggerHandler();
325+
public void addTriggersWhenSpent(SpellAbility saBeingPaid) {
330326
Trigger trig = TriggerHandler.parseTrigger(sVarHolder.getSVar(this.triggersWhenSpent), sourceCard, false, sVarHolder);
331-
if (sVarHolder instanceof SpellAbility) {
332-
trig.setSpawningAbility((SpellAbility) sVarHolder);
327+
trig.addRemembered(saBeingPaid);
328+
if (getSourceSA() != null) {
329+
trig.setSpawningAbility(getSourceSA());
333330
}
334-
handler.registerOneTrigger(trig);
331+
saBeingPaid.getHostCard().getGame().getTriggerHandler().registerThisTurnDelayedTrigger(trig);
335332
}
336333

337334
public SpellAbility getSourceSA() {

forge-game/src/main/java/forge/game/spellability/SpellAbility.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ public final void applyPayingManaEffects() {
837837

838838
for (Mana mana : getPayingMana()) {
839839
if (mana.triggersWhenSpent()) {
840-
mana.getManaAbility().addTriggersWhenSpent(this, host);
840+
mana.getManaAbility().addTriggersWhenSpent(this);
841841
}
842842

843843
if (mana.addsCounters(this)) {

forge-game/src/main/java/forge/game/trigger/TriggerSpellAbilityCastOrCopy.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ public final boolean performTest(final Map<AbilityKey, Object> runParams) {
236236
}
237237
}
238238

239+
if (getSpawningAbility() != null && getSpawningAbility().hasParam("TriggersWhenSpent")) {
240+
if (!getTriggerRemembered().contains(spellAbility)) {
241+
return false;
242+
}
243+
}
244+
239245
if (hasParam("SnowSpentForCardsColor")) {
240246
boolean found = false;
241247
for (Mana m : spellAbility.getPayingMana()) {

forge-gui/res/languages/en-US.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,8 @@ lblFullControl=Full Control
12951295
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.
12961296
lblChooseCostOrder=Choose cost order
12971297
lblChooseCostReductionOrder=Choose cost reduction order & amount
1298-
lblNoPaymentFromManaAbility=Don\'t attempt paying when generating mana
1299-
lblNoFreeCombatCostHandling=Don\'t accept attack/block costs of \{0\}
1298+
lblNoPaymentFromManaAbility=Don''t attempt paying when generating mana
1299+
lblNoFreeCombatCostHandling=Don''t accept attack/block costs of \{0\}
13001300
lblAllowPaymentStartWithMissingResources=Allow payment start when cost seems unaffordable
13011301
lblLayerTimestampOrder=Finetune layer timestamp order
13021302
lblOrderCosts=Order costs

0 commit comments

Comments
 (0)