From d42dffda1923985958e6ef698a2d93142e8512af Mon Sep 17 00:00:00 2001 From: Sloth Date: Sun, 21 Apr 2013 21:24:27 +0000 Subject: [PATCH] - Fixed incorrect P/T storing of LKI copies (counters where counted twice). --- src/main/java/forge/Card.java | 4 ++-- src/main/java/forge/CardUtil.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 301718822a6..546972a7e0a 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -3822,7 +3822,7 @@ public class Card extends GameEntity implements Comparable { * @return a int. */ public final int getNetAttack() { - if ((this.getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2) != 0) { + if (this.getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2 != 0) { return this.getUnswitchedToughness(); } return this.getUnswitchedPower(); @@ -3876,7 +3876,7 @@ public class Card extends GameEntity implements Comparable { * @return a int. */ public final int getNetDefense() { - if ((this.getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2) != 0) { + if (this.getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2 != 0) { return this.getUnswitchedPower(); } return this.getUnswitchedToughness(); diff --git a/src/main/java/forge/CardUtil.java b/src/main/java/forge/CardUtil.java index e30b56bfd5e..17b569b11dc 100644 --- a/src/main/java/forge/CardUtil.java +++ b/src/main/java/forge/CardUtil.java @@ -139,18 +139,20 @@ public final class CardUtil { newCopy.setOwner(in.getOwner()); newCopy.setController(in.getController(), 0); newCopy.getCharacteristics().copyFrom(in.getState(in.getCurState())); - newCopy.setBaseAttack(in.getNetAttack()); - newCopy.setBaseDefense(in.getNetDefense()); newCopy.setType(new ArrayList(in.getType())); newCopy.setTriggers(in.getTriggers()); for (SpellAbility sa : in.getManaAbility()) { newCopy.addSpellAbility(sa); sa.setSourceCard(in); } + + // lock in the current P/T without boni from counters + newCopy.setBaseAttack(in.getCurrentPower() + in.getTempAttackBoost() + in.getSemiPermanentAttackBoost()); + newCopy.setBaseDefense(in.getCurrentToughness() + in.getTempDefenseBoost() + in.getSemiPermanentDefenseBoost()); newCopy.setCounters(in.getCounters()); newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword()); - //newCopy.setColor(in.getColor()); + // Determine the color for LKI copy, not just getColor ArrayList currentColor = new ArrayList(); currentColor.add(in.determineColor());