mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fix game copy error with equipment.
This commit is contained in:
@@ -107,7 +107,7 @@ public class GameCopier {
|
|||||||
otherCard.setEnchanting(cardMap.get(card.getEnchanting()));
|
otherCard.setEnchanting(cardMap.get(card.getEnchanting()));
|
||||||
}
|
}
|
||||||
if (card.isEquipping()) {
|
if (card.isEquipping()) {
|
||||||
otherCard.setEquipping(cardMap.get(card.getEquipping()));
|
otherCard.equipCard(cardMap.get(card.getEquipping()));
|
||||||
}
|
}
|
||||||
if (card.isFortifying()) {
|
if (card.isFortifying()) {
|
||||||
otherCard.setFortifying(cardMap.get(card.getFortifying()));
|
otherCard.setFortifying(cardMap.get(card.getFortifying()));
|
||||||
|
|||||||
@@ -136,4 +136,40 @@ public class GameSimulatorTest extends TestCase {
|
|||||||
assertEquals(2, sliver.getNetPower());
|
assertEquals(2, sliver.getNetPower());
|
||||||
assertEquals(2, sliver.getNetToughness());
|
assertEquals(2, sliver.getNetToughness());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testEquippedAbilities() {
|
||||||
|
String bearCardName = "Runeclaw Bear";
|
||||||
|
Game game = initAndCreateGame();
|
||||||
|
Player p = game.getPlayers().get(1);
|
||||||
|
Card bear = addCard(bearCardName, p);
|
||||||
|
bear.setSickness(false);
|
||||||
|
Card cloak = addCard("Whispersilk Cloak", p);
|
||||||
|
cloak.equipCard(bear);
|
||||||
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
|
game.getAction().checkStateEffects(true);
|
||||||
|
assertEquals(1, bear.getAmountOfKeyword("Unblockable"));
|
||||||
|
|
||||||
|
GameSimulator sim = new GameSimulator(game);
|
||||||
|
Game simGame = sim.getSimulatedGameState();
|
||||||
|
Card bearCopy = findCardWithName(simGame, bearCardName);
|
||||||
|
assertEquals(1, bearCopy.getAmountOfKeyword("Unblockable"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testEnchantedAbilities() {
|
||||||
|
String bearCardName = "Runeclaw Bear";
|
||||||
|
Game game = initAndCreateGame();
|
||||||
|
Player p = game.getPlayers().get(1);
|
||||||
|
Card bear = addCard(bearCardName, p);
|
||||||
|
bear.setSickness(false);
|
||||||
|
Card lifelink = addCard("Lifelink", p);
|
||||||
|
lifelink.enchantEntity(bear);
|
||||||
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
|
game.getAction().checkStateEffects(true);
|
||||||
|
assertEquals(1, bear.getAmountOfKeyword("Lifelink"));
|
||||||
|
|
||||||
|
GameSimulator sim = new GameSimulator(game);
|
||||||
|
Game simGame = sim.getSimulatedGameState();
|
||||||
|
Card bearCopy = findCardWithName(simGame, bearCardName);
|
||||||
|
assertEquals(1, bearCopy.getAmountOfKeyword("Lifelink"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user