mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Fixed double faced cards changing zones getting transformed before triggers are called (fixed Loyal Cathar).
This commit is contained in:
@@ -912,16 +912,19 @@ public final class CardUtil {
|
||||
*
|
||||
* @param c
|
||||
* a Card.
|
||||
* @param state
|
||||
* a String object
|
||||
* @return a copy of C with LastKnownInfo stuff retained.
|
||||
*/
|
||||
public static Card getLKICopy(final Card c, final String state) {
|
||||
public static Card getLKICopy(final Card c) {
|
||||
if (c.isToken()) {
|
||||
return c;
|
||||
}
|
||||
final Card res = AllZone.getCardFactory().copyCard(c);
|
||||
final String state = c.getCurState();
|
||||
AllZone.getTriggerHandler().suppressMode("Transformed");
|
||||
if (c.isInAlternateState()) {
|
||||
c.setState("Original");
|
||||
}
|
||||
final Card res = AllZone.getCardFactory().copyCard(c);
|
||||
c.setState(state);
|
||||
res.setState(state);
|
||||
AllZone.getTriggerHandler().clearSuppression("Transformed");
|
||||
res.setControllerObjects(c.getControllerObjects());
|
||||
|
||||
@@ -149,18 +149,14 @@ public class GameAction {
|
||||
lastKnownInfo = c;
|
||||
copied = c;
|
||||
} else {
|
||||
final String state = c.getCurState();
|
||||
AllZone.getTriggerHandler().suppressMode("Transformed");
|
||||
if (c.isInAlternateState()) {
|
||||
c.setState("Original");
|
||||
}
|
||||
if (c.isCloned()) {
|
||||
c.switchStates("Cloner", "Original");
|
||||
c.setState("Original");
|
||||
}
|
||||
AllZone.getTriggerHandler().clearSuppression("Transformed");
|
||||
|
||||
lastKnownInfo = CardUtil.getLKICopy(c, state);
|
||||
lastKnownInfo = CardUtil.getLKICopy(c);
|
||||
copied = AllZone.getCardFactory().copyCard(c);
|
||||
|
||||
copied.setUnearthed(c.isUnearthed());
|
||||
@@ -218,10 +214,12 @@ public class GameAction {
|
||||
// remove all counters from the card if destination is not the
|
||||
// battlefield
|
||||
// UNLESS we're dealing with Skullbriar, the Walking Grave
|
||||
if (!zone.is(Constant.Zone.Battlefield)
|
||||
&& !(c.getName().equals("Skullbriar, the Walking Grave") && !zone.is(Constant.Zone.Hand) && !zone
|
||||
.is(Constant.Zone.Library))) {
|
||||
copied.clearCounters();
|
||||
if (!zone.is(Constant.Zone.Battlefield)) {
|
||||
if (!(c.getName().equals("Skullbriar, the Walking Grave") && !zone.is(Constant.Zone.Hand) && !zone
|
||||
.is(Constant.Zone.Library))) {
|
||||
copied.clearCounters();
|
||||
}
|
||||
copied.setState("Original");
|
||||
}
|
||||
|
||||
copied.setTimestamp(AllZone.getNextTimestamp());
|
||||
|
||||
@@ -181,14 +181,17 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
|
||||
*/
|
||||
@Override
|
||||
public final Card copyCard(final Card in) {
|
||||
final String curState = in.getCurState();
|
||||
AllZone.getTriggerHandler().suppressMode("Transformed");
|
||||
if (in.isInAlternateState()) {
|
||||
in.setState("Original");
|
||||
}
|
||||
final Card out = this.getCard(in.getName(), in.getOwner());
|
||||
out.setUniqueNumber(in.getUniqueNumber());
|
||||
out.setCurSetCode(in.getCurSetCode());
|
||||
|
||||
CardFactoryUtil.copyCharacteristics(in, out);
|
||||
if (in.hasAlternateState()) {
|
||||
AllZone.getTriggerHandler().suppressMode("Transformed");
|
||||
final String curState = in.getCurState();
|
||||
for (final String state : in.getStates()) {
|
||||
in.setState(state);
|
||||
out.setState(state);
|
||||
@@ -196,9 +199,8 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
|
||||
}
|
||||
in.setState(curState);
|
||||
out.setState(curState);
|
||||
|
||||
AllZone.getTriggerHandler().clearSuppression("Transformed");
|
||||
}
|
||||
AllZone.getTriggerHandler().clearSuppression("Transformed");
|
||||
|
||||
// I'm not sure if we really should be copying enchant/equip stuff over.
|
||||
out.setEquipping(in.getEquipping());
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class CostPartWithList extends CostPart {
|
||||
*/
|
||||
public final void addListToHash(final SpellAbility sa, final String hash) {
|
||||
for (final Card card : this.getList()) {
|
||||
Card copy = CardUtil.getLKICopy(card, card.getCurState());
|
||||
Card copy = CardUtil.getLKICopy(card);
|
||||
sa.addCostToHashList(copy, hash);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user