Fix Pure Intentions (#4845)

* Fix Pure Intentions

* Remove obsolete stuff

---------

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
This commit is contained in:
tool4ever
2024-03-20 17:46:14 +01:00
committed by GitHub
parent 93a52a4263
commit 7f7bc711f3
19 changed files with 29 additions and 34 deletions

View File

@@ -1911,8 +1911,6 @@ public class GameAction {
runParams.putAll(params);
}
game.getTriggerHandler().runTrigger(TriggerType.Destroyed, runParams, false);
// in case the destroyed card has such a trigger
game.getTriggerHandler().registerActiveLTBTrigger(c);
final Card sacrificed = sacrificeDestroy(c, sa, params);
return sacrificed != null;

View File

@@ -804,8 +804,9 @@ public abstract class SpellAbilityEffect {
final CardCollection discardedByPlayer = new CardCollection();
for (Card card : Lists.newArrayList(discardedMap.get(p))) { // without copying will get concurrent modification exception
if (card == null) { continue; }
if (p.discard(card, sa, effect, params) != null) {
discardedByPlayer.add(card);
Card moved = p.discard(card, sa, effect, params);
if (moved != null) {
discardedByPlayer.add(moved);
}
}
discardedMap.put(p, discardedByPlayer);

View File

@@ -375,8 +375,9 @@ public class PhaseHandler implements java.io.Serializable {
final CardCollection discarded = new CardCollection();
List<Card> discardedBefore = Lists.newArrayList(playerTurn.getDiscardedThisTurn());
for (Card c : playerTurn.getController().chooseCardsToDiscardToMaximumHandSize(numDiscard)) {
if (playerTurn.discard(c, null, false, moveParams) != null) {
discarded.add(c);
Card moved = playerTurn.discard(c, null, false, moveParams);
if (moved != null) {
discarded.add(moved);
}
}
table.triggerChangesZoneAll(game, null);

View File

@@ -3776,12 +3776,13 @@ public class Player extends GameEntity implements Comparable<Player> {
game.getAction().moveTo(ZoneType.Hand, c, sa, params);
} else if (c.isInZone(ZoneType.Hand)) { // Discard and Draw
List<Card> discardedBefore = Lists.newArrayList(getDiscardedThisTurn());
if (discard(c, sa, true, params) != null) {
Card moved = discard(c, sa, true, params);
if (moved != null) {
// Change this if something would make multiple player learn at the same time
// Discard Trigger outside Effect
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(this);
runParams.put(AbilityKey.Cards, new CardCollection(c));
runParams.put(AbilityKey.Cards, new CardCollection(moved));
runParams.put(AbilityKey.Cause, sa);
runParams.put(AbilityKey.DiscardedBefore, discardedBefore);
if (params != null) {

View File

@@ -1244,6 +1244,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
return null; // the ability was not copyable, e.g. a Suspend SA may get here
}
newSA.setPayCosts(newSA.getPayCosts().copyWithNoMana());
// currently needed by AI
if (!newSA.hasParam("WithoutManaCost")) {
newSA.mapParams.put("WithoutManaCost", "True");
}

View File

@@ -152,16 +152,9 @@ public class TriggerChangesZone extends Trigger {
return false;
}
final Card card = (Card) runParams.get(AbilityKey.Card);
if (card == null) {
return false;
}
final Card card = (Card) runParams.get(AbilityKey.CardLKI);
final int rightSide = AbilityUtils.calculateAmount(getHostCard(), cond.substring(2), this);
// need to check the ChangeZone LKI copy for damage, otherwise it'll return 0 for a new object in the new zone
Card lkiCard = card.getGame().getChangeZoneLKIInfo(card);
final boolean expr = Expressions.compare(lkiCard.getAssignedDamage(), cond, rightSide);
final boolean expr = Expressions.compare(card.getAssignedDamage(), cond, rightSide);
if (!expr) {
return false;
}

View File

@@ -67,6 +67,8 @@ public class WrappedAbility extends Ability {
ApiType.SacrificeAll,
ApiType.Pump,
ApiType.DealDamage, // checked
ApiType.Regenerate, // Updated
ApiType.RegenerateAll, // No Triggered
ApiType.Regeneration, // Replacement Effect only
@@ -490,9 +492,7 @@ public class WrappedAbility extends Ability {
}
}
if (!regtrig.hasParam("NoTimestampCheck")) {
timestampCheck();
}
timestampCheck();
getActivatingPlayer().getController().playSpellAbilityNoStack(sa, false);
}