Updated RemoveFromCombatTest.

This commit is contained in:
LevelX2 2015-07-08 17:15:56 +02:00
parent bf16a40564
commit 072987b96d
2 changed files with 22 additions and 16 deletions

View file

@ -33,6 +33,7 @@ import mage.abilities.Mode;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
@ -64,7 +65,8 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
* @param power
* @param toughness
* @param duration
* @param lockedIn if true, power and toughness will be calculated only once, when the ability resolves
* @param lockedIn if true, power and toughness will be calculated only
* once, when the ability resolves
*/
public BoostTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration, boolean lockedIn) {
super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, isCanKill(toughness) ? Outcome.UnboostCreature : Outcome.BoostCreature);
@ -99,7 +101,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
int affectedTargets = 0;
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent target = game.getPermanent(permanentId);
if (target != null) {
if (target != null && target.getCardType().contains(CardType.CREATURE)) {
target.addPower(power.calculate(game, source, this));
target.addToughness(toughness.calculate(game, source, this));
affectedTargets++;
@ -115,7 +117,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
}
StringBuilder sb = new StringBuilder();
Target target = mode.getTargets().get(0);
if(target.getMaxNumberOfTargets() > 1){
if (target.getMaxNumberOfTargets() > 1) {
if (target.getNumberOfTargets() < target.getNumberOfTargets()) {
sb.append("up to ");
}
@ -127,16 +129,15 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
sb.append(target.getTargetName()).append(" gets ");
}
String p = power.toString();
if(!p.startsWith("-")) {
if (!p.startsWith("-")) {
sb.append("+");
}
sb.append(p).append("/");
String t = toughness.toString();
if(!t.startsWith("-")){
if(t.equals("0") && p.startsWith("-")) {
if (!t.startsWith("-")) {
if (t.equals("0") && p.startsWith("-")) {
sb.append("-");
}
else {
} else {
sb.append("+");
}
}