Fix Offering being an AltCost (#8190)

This commit is contained in:
tool4ever
2025-07-24 16:33:51 +02:00
committed by GitHub
parent b1afd28556
commit a78c648e77
6 changed files with 16 additions and 27 deletions

View File

@@ -495,9 +495,11 @@ public final class GameActionUtil {
String[] k = keyword.split(":");
final Cost cost = new Cost(k[1], false);
costs.add(new OptionalCostValue(OptionalCost.Flash, cost));
} else if (keyword.endsWith(" offering")) {
final String type = keyword.split(" ")[0];
final Cost cost = new Cost("Sac<1/" + type + ">", false);
costs.add(new OptionalCostValue(OptionalCost.Offering, cost));
}
// Surge while having OptionalCost is none of them
}
// reset static abilities
@@ -524,7 +526,9 @@ public final class GameActionUtil {
result.putParam("RaiseCost", sa.getParam("RaiseCost"));
}
for (OptionalCostValue v : list) {
if (v.getType() != OptionalCost.Offering) {
result.getPayCosts().add(v.getCost());
}
result.addOptionalCost(v.getType());
// add some extra logic, try to move it to other parts
@@ -534,6 +538,7 @@ public final class GameActionUtil {
result.getRestrictions().setZone(ZoneType.Graveyard);
break;
case Flash:
case Offering:
result.getRestrictions().setInstantSpeed(true);
break;
default:

View File

@@ -31,20 +31,20 @@ public class PermanentEffect extends SpellAbilityEffect {
final Card c = game.getAction().moveToPlay(host, sa, moveParams);
sa.setHostCard(c);
// CR 608.3g
if (sa.isIntrinsic() || c.wasCast()) {
// some extra for Dashing
if (sa.isDash() && c.isInPlay()) {
c.addChangedSVars(Collections.singletonMap("EndOfTurnLeavePlay", "Dash"), c.getGame().getNextTimestamp(), 0);
registerDelayedTrigger(sa, "Hand", Lists.newArrayList(c));
// add AI hint
c.addChangedSVars(Collections.singletonMap("EndOfTurnLeavePlay", "Dash"), c.getGame().getNextTimestamp(), 0);
}
// similar for Blitz keyword
if (sa.isBlitz() && c.isInPlay()) {
c.addChangedSVars(Collections.singletonMap("EndOfTurnLeavePlay", "Blitz"), c.getGame().getNextTimestamp(), 0);
registerDelayedTrigger(sa, "Sacrifice", Lists.newArrayList(c));
c.addChangedSVars(Collections.singletonMap("EndOfTurnLeavePlay", "Blitz"), c.getGame().getNextTimestamp(), 0);
}
if (sa.isWarp() && c.isInPlay()) {
c.addChangedSVars(Collections.singletonMap("EndOfTurnLeavePlay", "Warp"), c.getGame().getNextTimestamp(), 0);
registerDelayedTrigger(sa, "Exile", Lists.newArrayList(c));
c.addChangedSVars(Collections.singletonMap("EndOfTurnLeavePlay", "Warp"), c.getGame().getNextTimestamp(), 0);
}
}

View File

@@ -3810,22 +3810,6 @@ public class CardFactoryUtil {
newSA.setAlternativeCost(AlternativeCost.Warp);
newSA.setIntrinsic(intrinsic);
inst.addSpellAbility(newSA);
} else if (keyword.endsWith(" offering")) {
final String offeringType = keyword.split(" ")[0];
final SpellAbility sa = card.getFirstSpellAbility();
final SpellAbility newSA = sa.copy();
SpellAbilityRestriction sar = newSA.getRestrictions();
sar.setIsPresent(offeringType + ".YouCtrl+CanBeSacrificedBy");
sar.setInstantSpeed(true);
newSA.putParam("Secondary", "True");
newSA.setAlternativeCost(AlternativeCost.Offering);
newSA.setPayCosts(sa.getPayCosts());
newSA.setDescription(sa.getDescription() + " (" + offeringType + " offering)");
newSA.setIntrinsic(intrinsic);
inst.addSpellAbility(newSA);
} else if (keyword.startsWith("Crew")) {
final String[] k = keyword.split(":");
final String power = k[1];

View File

@@ -17,7 +17,6 @@ public enum AlternativeCost {
Madness,
MTMtE, // More Than Meets the Eye (Transformers Universes Beyond)
Mutate,
Offering,
Overload,
Prowl,
Plotted,

View File

@@ -13,6 +13,7 @@ public enum OptionalCost {
PromiseGift("Promise Gift", ""),
Retrace("Retrace", ""),
Jumpstart("Jump-start", ""),
Offering("Offering", ""),
ReduceW("(to reduce white mana)", "W"),
ReduceU("(to reduce blue mana)", "U"),
ReduceB("(to reduce black mana)", "B"),

View File

@@ -1609,10 +1609,10 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
}
public boolean isOffering() {
return isAlternativeCost(AlternativeCost.Offering);
return isOptionalCostPaid(OptionalCost.Offering);
}
public Card getSacrificedAsOffering() { //for Patron offering
public Card getSacrificedAsOffering() {
return sacrificedAsOffering;
}
public void setSacrificedAsOffering(final Card c) {