mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08: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
|
|
@ -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…
Add table
Add a link
Reference in a new issue