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