mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Make LKI have Original State even in Facedown
This commit is contained in:
@@ -3134,14 +3134,20 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
private final void updateCloneState(final boolean updateView) {
|
private final void updateCloneState(final boolean updateView) {
|
||||||
if (isFaceDown()) {
|
if (isFaceDown()) {
|
||||||
setState(CardStateName.FaceDown, updateView, true);
|
setState(CardStateName.FaceDown, updateView, true);
|
||||||
} else if (isFlipped() && hasState(CardStateName.Flipped)) {
|
|
||||||
setState(CardStateName.Flipped, updateView, true);
|
|
||||||
} else if (backside && isDoubleFaced()) {
|
|
||||||
setState(CardStateName.Transformed, updateView, true);
|
|
||||||
} else if (backside && isMeldable()) {
|
|
||||||
setState(CardStateName.Meld, updateView, true);
|
|
||||||
} else {
|
} else {
|
||||||
setState(CardStateName.Original, updateView, true);
|
setState(getFaceupCardStateName(), updateView, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final CardStateName getFaceupCardStateName() {
|
||||||
|
if (isFlipped() && hasState(CardStateName.Flipped)) {
|
||||||
|
return CardStateName.Flipped;
|
||||||
|
} else if (backside && isDoubleFaced()) {
|
||||||
|
return CardStateName.Transformed;
|
||||||
|
} else if (backside && isMeldable()) {
|
||||||
|
return CardStateName.Meld;
|
||||||
|
} else {
|
||||||
|
return CardStateName.Original;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5776,10 +5782,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
if (isFaceDown()) {
|
if (isFaceDown()) {
|
||||||
lkicheck = true;
|
lkicheck = true;
|
||||||
source = CardUtil.getLKICopy(source);
|
source = CardUtil.getLKICopy(source);
|
||||||
|
|
||||||
// TODO need to be changed with CloneRewrite and FaceDownState?
|
|
||||||
source.turnFaceUp(false, false);
|
source.turnFaceUp(false, false);
|
||||||
source.getCurrentState().copyFrom(getState(CardStateName.Original), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lkicheck) {
|
if (lkicheck) {
|
||||||
|
|||||||
@@ -227,7 +227,10 @@ public final class CardUtil {
|
|||||||
// used for the purpose of cards that care about the zone the card was known to be in last
|
// used for the purpose of cards that care about the zone the card was known to be in last
|
||||||
newCopy.setLastKnownZone(in.getLastKnownZone());
|
newCopy.setLastKnownZone(in.getLastKnownZone());
|
||||||
|
|
||||||
newCopy.getCurrentState().copyFrom(in.getState(in.getCurrentStateName()), true);
|
newCopy.getCurrentState().copyFrom(in.getState(in.getFaceupCardStateName()), true);
|
||||||
|
if (in.isFaceDown()) {
|
||||||
|
newCopy.turnFaceDownNoUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (in.isCloned()) {
|
if (in.isCloned()) {
|
||||||
|
|||||||
@@ -1771,7 +1771,7 @@ public class GameSimulatorTest extends SimulationTestCase {
|
|||||||
|
|
||||||
assertTrue(transformOutLaw.isCloned());
|
assertTrue(transformOutLaw.isCloned());
|
||||||
assertTrue(transformOutLaw.isDoubleFaced());
|
assertTrue(transformOutLaw.isDoubleFaced());
|
||||||
assertFalse(transformOutLaw.hasState(CardStateName.Transformed));
|
assertTrue(transformOutLaw.hasState(CardStateName.Transformed));
|
||||||
assertTrue(transformOutLaw.canTransform());
|
assertTrue(transformOutLaw.canTransform());
|
||||||
assertTrue(transformOutLaw.isBackSide());
|
assertTrue(transformOutLaw.isBackSide());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user