mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
fixed Death's Shadow getting bigger from negative life totals (no longer how the rules work)
This commit is contained in:
parent
9a66f1713b
commit
40ff146764
2 changed files with 15 additions and 3 deletions
|
@ -47,14 +47,14 @@ import mage.constants.Zone;
|
|||
public class DeathsShadow extends CardImpl {
|
||||
|
||||
public DeathsShadow(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}");
|
||||
this.subtype.add(SubType.AVATAR);
|
||||
|
||||
this.power = new MageInt(13);
|
||||
this.toughness = new MageInt(13);
|
||||
|
||||
// Death's Shadow gets -X/-X, where X is your life total.
|
||||
SignInversionDynamicValue x = new SignInversionDynamicValue(new ControllerLifeCount());
|
||||
SignInversionDynamicValue x = new SignInversionDynamicValue(new ControllerLifeCount(), false);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
|
|
|
@ -8,18 +8,30 @@ import mage.game.Game;
|
|||
public class SignInversionDynamicValue implements DynamicValue {
|
||||
|
||||
private final DynamicValue value;
|
||||
private final boolean canBePositive;
|
||||
|
||||
public SignInversionDynamicValue(DynamicValue value) {
|
||||
this(value, true);
|
||||
}
|
||||
|
||||
public SignInversionDynamicValue(DynamicValue value, boolean canBePositive) {
|
||||
this.value = value.copy();
|
||||
this.canBePositive = canBePositive;
|
||||
}
|
||||
|
||||
SignInversionDynamicValue(final SignInversionDynamicValue dynamicValue) {
|
||||
this.value = dynamicValue.value.copy();
|
||||
this.canBePositive = dynamicValue.canBePositive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return -1 * value.calculate(game, sourceAbility, effect);
|
||||
int amount = value.calculate(game, sourceAbility, effect);
|
||||
if (amount >= 0 || canBePositive) {
|
||||
return -1 * amount;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue