Some fixes (#5230)

* Fix bad Discord change

* Fix Risen Executioner using X shard

* Fix Marshland Bloodcaster

* Clean up
This commit is contained in:
tool4ever
2024-05-12 14:11:06 +02:00
committed by GitHub
parent a20c0e8ccf
commit 9b54ecfe12
11 changed files with 17 additions and 17 deletions

View File

@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
import forge.card.MagicColor;
import forge.card.mana.ManaCost;
import forge.game.ability.AbilityFactory;
import forge.game.ability.AbilityUtils;
import forge.game.ability.ApiType;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.CardPlayOption.PayManaCost;
@@ -317,6 +318,9 @@ public final class GameActionUtil {
if (o.getAbility().hasParam("ValidAfterStack")) {
newSA.getMapParams().put("ValidAfterStack", o.getAbility().getParam("ValidAfterStack"));
}
if (o.getAbility().hasParam("RaiseCost")) {
newSA.getMapParams().put("RaiseCost", Integer.toString(AbilityUtils.calculateAmount(host, o.getAbility().getParam("RaiseCost"), o.getAbility())));
}
final SpellAbilityRestriction sar = newSA.getRestrictions();
if (o.isWithFlash()) {

View File

@@ -170,8 +170,6 @@ public class PlayEffect extends SpellAbilityEffect {
Card card = Card.fromPaperCard(StaticData.instance().getCommonCards().getUniqueByName(name), controller);
// so it gets added to stack
card.setCopiedPermanent(card);
// Keeps adventures from leaving the recast effect
card.setCopiedSpell(true);
card.setToken(true);
tgtCards = new CardCollection(card);
} else {
@@ -287,7 +285,6 @@ public class PlayEffect extends SpellAbilityEffect {
tgtCard.setZone(zone);
// to fix the CMC
tgtCard.setCopiedPermanent(original);
tgtCard.setCopiedSpell(true);
if (zone != null) {
zone.add(tgtCard);
}

View File

@@ -4012,7 +4012,7 @@ public class CardFactoryUtil {
SpellAbility saExile = AbilityFactory.getAbility(abExile, card);
String abEffect = "DB$ Effect | RememberObjects$ Self | StaticAbilities$ Play | ForgetOnMoved$ Exile | Duration$ Permanent | ConditionDefined$ Self | ConditionPresent$ Card.nonCopiedSpell";
String abEffect = "DB$ Effect | RememberObjects$ Self | StaticAbilities$ Play | ForgetOnMoved$ Exile | Duration$ Permanent | ConditionDefined$ Self | ConditionPresent$ Card.nonCopiedSpell+nonToken";
AbilitySub saEffect = (AbilitySub)AbilityFactory.getAbility(abEffect, card);
StringBuilder sbPlay = new StringBuilder();

View File

@@ -39,6 +39,7 @@ public class StaticAbilityAlternativeCost {
newSA.setBasicSpell(false);
if (cost.hasXInAnyCostPart()) {
// TODO this is problematic for Spells that already have (non-mana) X SVar
newSA.setSVar("X", stAb.getSVar("X"));
}
@@ -50,7 +51,9 @@ public class StaticAbilityAlternativeCost {
newSA.putParam("ManaRestriction", stAb.getParam("ManaRestriction"));
}
if (stAb.hasParam("EffectZone") && !"All".equals(stAb.getParam("EffectZone"))) {
if (stAb.hasParam("AffectedZone")) {
newSA.getRestrictions().setZone(ZoneType.smartValueOf(stAb.getParam("AffectedZone")));
} else if (!stAb.getHostCard().isImmutable() && stAb.hasParam("EffectZone") && !"All".equals(stAb.getParam("EffectZone"))) {
newSA.getRestrictions().setZone(ZoneType.smartValueOf(stAb.getParam("EffectZone")));
}

View File

@@ -32,7 +32,6 @@ import forge.game.keyword.Keyword;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.spellability.OptionalCost;
import forge.game.spellability.SpellAbility;
import forge.game.zone.CostPaymentStack;
import forge.game.zone.ZoneType;
@@ -398,11 +397,7 @@ public abstract class Trigger extends TriggerReplacementBase {
}
}
if ("AltCost".equals(condition)) {
final Card moved = (Card) runParams.get(AbilityKey.Card);
if (null != moved && !moved.isOptionalCostPaid(OptionalCost.AltCost))
return false;
} else if ("LifePaid".equals(condition)) {
if ("LifePaid".equals(condition)) {
final SpellAbility trigSA = (SpellAbility) runParams.get(AbilityKey.SpellAbility);
if (trigSA != null && trigSA.getAmountLifePaid() <= 0) {
return false;