mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Fix game copy error with manifested non-creatures.
This commit is contained in:
@@ -211,11 +211,14 @@ public class GameCopier {
|
||||
newCard.setTapped(true);
|
||||
}
|
||||
if (c.isFaceDown()) {
|
||||
boolean isCreature = newCard.isCreature();
|
||||
newCard.setState(CardStateName.FaceDown, true);
|
||||
if (c.isManifested()) {
|
||||
newCard.setManifested(true);
|
||||
// TODO: Should be able to copy other abilities...
|
||||
newCard.addSpellAbility(CardFactoryUtil.abilityManifestFaceUp(newCard, newCard.getManaCost()));
|
||||
if (isCreature) {
|
||||
newCard.addSpellAbility(CardFactoryUtil.abilityManifestFaceUp(newCard, newCard.getManaCost()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c.isMonstrous()) {
|
||||
|
||||
@@ -18,7 +18,6 @@ import forge.game.player.Player;
|
||||
import forge.game.spellability.Ability;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.TargetChoices;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
public class GameSimulator {
|
||||
private static int MAX_DEPTH = 5;
|
||||
@@ -120,17 +119,12 @@ public class GameSimulator {
|
||||
|
||||
private SpellAbility findSaInSimGame(SpellAbility sa) {
|
||||
Card origHostCard = sa.getHostCard();
|
||||
ZoneType zone = origHostCard.getZone().getZoneType();
|
||||
for (Card c : simGame.getCardsIn(zone)) {
|
||||
if (c.getController() != aiPlayer) {
|
||||
continue;
|
||||
}
|
||||
if (c.getName().equals(origHostCard.getName())) {
|
||||
for (SpellAbility cSa : c.getSpellAbilities()) {
|
||||
if (cSa.getDescription().equals(sa.getDescription())) {
|
||||
return cSa;
|
||||
}
|
||||
}
|
||||
Card hostCard = (Card) copier.find(origHostCard);
|
||||
// FIXME: This is a hack that makes testManifest pass - figure out why it's needed.
|
||||
String desc = sa.getDescription().replace("Unmanifest {0}", "Unmanifest no cost");
|
||||
for (SpellAbility cSa : hostCard.getSpellAbilities()) {
|
||||
if (desc.equals(cSa.getDescription())) {
|
||||
return cSa;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user