mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Fix missing ChangesZoneAll
This commit is contained in:
@@ -9,6 +9,7 @@ import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardZoneTable;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
@@ -90,11 +91,17 @@ public class ZoneExchangeEffect extends SpellAbilityEffect {
|
||||
object1.unattachFromEntity(c);
|
||||
object2.attachToEntity(c, sa);
|
||||
}
|
||||
|
||||
Map<AbilityKey, Object> moveParams = AbilityKey.newMap();
|
||||
moveParams.put(AbilityKey.LastStateBattlefield, sa.getLastStateBattlefield());
|
||||
moveParams.put(AbilityKey.LastStateGraveyard, sa.getLastStateGraveyard());
|
||||
// Exchange Zone
|
||||
game.getAction().moveTo(zone2, object1, sa, moveParams);
|
||||
game.getAction().moveTo(zone1, object2, sa, moveParams);
|
||||
Card newObj1 = game.getAction().moveTo(zone2, object1, sa, moveParams);
|
||||
Card newObj2 = game.getAction().moveTo(zone1, object2, sa, moveParams);
|
||||
|
||||
final CardZoneTable table = new CardZoneTable();
|
||||
table.put(zone1, newObj1.getZone().getZoneType(), newObj1);
|
||||
table.put(zone2, newObj2.getZone().getZoneType(), newObj2);
|
||||
table.triggerChangesZoneAll(game, sa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import forge.card.MagicColor;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.game.Game;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardZoneTable;
|
||||
import forge.game.mana.Mana;
|
||||
import forge.game.mana.ManaConversionMatrix;
|
||||
import forge.game.mana.ManaCostBeingPaid;
|
||||
@@ -329,11 +330,12 @@ public class CostPayment extends ManaConversionMatrix {
|
||||
}
|
||||
|
||||
public static void handleOfferings(final SpellAbility sa, boolean test, boolean costIsPaid) {
|
||||
final CardZoneTable table = new CardZoneTable();
|
||||
if (sa.isOffering() && sa.getSacrificedAsOffering() != null) {
|
||||
final Card offering = sa.getSacrificedAsOffering();
|
||||
offering.setUsedToPay(false);
|
||||
if (costIsPaid && !test) {
|
||||
sa.getHostCard().getGame().getAction().sacrifice(offering, sa, false, null, null);
|
||||
sa.getHostCard().getGame().getAction().sacrifice(offering, sa, false, table, null);
|
||||
}
|
||||
sa.resetSacrificedAsOffering();
|
||||
}
|
||||
@@ -341,9 +343,12 @@ public class CostPayment extends ManaConversionMatrix {
|
||||
final Card emerge = sa.getSacrificedAsEmerge();
|
||||
emerge.setUsedToPay(false);
|
||||
if (costIsPaid && !test) {
|
||||
sa.getHostCard().getGame().getAction().sacrifice(emerge, sa, false, null, null);
|
||||
sa.getHostCard().getGame().getAction().sacrifice(emerge, sa, false, table, null);
|
||||
}
|
||||
sa.resetSacrificedAsEmerge();
|
||||
}
|
||||
if (!table.isEmpty()) {
|
||||
table.triggerChangesZoneAll(sa.getHostCard().getGame(), sa);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,7 +558,9 @@ public class HumanPlay {
|
||||
c.tap(true, ability, ability.getActivatingPlayer());
|
||||
}
|
||||
}
|
||||
ability.clearTappedForConvoke();
|
||||
if (manaInputCancelled) {
|
||||
ability.clearTappedForConvoke();
|
||||
}
|
||||
}
|
||||
if (!table.isEmpty() && !manaInputCancelled) {
|
||||
table.triggerChangesZoneAll(game, ability);
|
||||
@@ -648,23 +650,11 @@ public class HumanPlay {
|
||||
if (ability.getSacrificedAsOffering() == null && offering != null) {
|
||||
ability.setSacrificedAsOffering(offering);
|
||||
}
|
||||
if (ability.getSacrificedAsOffering() != null) {
|
||||
System.out.println("Finishing up Offering");
|
||||
offering.setUsedToPay(false);
|
||||
activator.getGame().getAction().sacrifice(offering, ability, false, null, null);
|
||||
ability.resetSacrificedAsOffering();
|
||||
}
|
||||
}
|
||||
if (ability.isEmerge()) {
|
||||
if (ability.getSacrificedAsEmerge() == null && emerge != null) {
|
||||
ability.setSacrificedAsEmerge(emerge);
|
||||
}
|
||||
if (ability.getSacrificedAsEmerge() != null) {
|
||||
System.out.println("Finishing up Emerge");
|
||||
emerge.setUsedToPay(false);
|
||||
activator.getGame().getAction().sacrifice(emerge, ability, false, null, null);
|
||||
ability.resetSacrificedAsEmerge();
|
||||
}
|
||||
}
|
||||
if (ability.getTappedForConvoke() != null) {
|
||||
activator.getGame().getTriggerHandler().suppressMode(TriggerType.Taps);
|
||||
@@ -673,7 +663,6 @@ public class HumanPlay {
|
||||
c.tap(true, ability, activator);
|
||||
}
|
||||
activator.getGame().getTriggerHandler().clearSuppression(TriggerType.Taps);
|
||||
ability.clearTappedForConvoke();
|
||||
}
|
||||
return handleOfferingConvokeAndDelve(ability, cardsToDelve, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user