mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
* Marionette Master and Mortis Dogs, fixed that power below 0 caused life gain.
This commit is contained in:
parent
68a6920b63
commit
df0cd60fbc
3 changed files with 24 additions and 7 deletions
|
|
@ -11,10 +11,27 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class SourcePermanentPowerCount implements DynamicValue {
|
||||
|
||||
boolean allowNegativeValues;
|
||||
|
||||
public SourcePermanentPowerCount() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public SourcePermanentPowerCount(boolean allowNegativeValues) {
|
||||
super();
|
||||
this.allowNegativeValues = allowNegativeValues;
|
||||
}
|
||||
|
||||
public SourcePermanentPowerCount(final SourcePermanentPowerCount dynamicValue) {
|
||||
super();
|
||||
this.allowNegativeValues = dynamicValue.allowNegativeValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(sourceAbility.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
if (sourcePermanent != null
|
||||
&& (allowNegativeValues || sourcePermanent.getPower().getValue() >= 0)) {
|
||||
return sourcePermanent.getPower().getValue();
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -22,7 +39,7 @@ public class SourcePermanentPowerCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public SourcePermanentPowerCount copy() {
|
||||
return new SourcePermanentPowerCount();
|
||||
return new SourcePermanentPowerCount(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue