mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fix to make behavior appropriate to errata.
This commit is contained in:
parent
01ef894fa2
commit
47093d92a3
1 changed files with 6 additions and 3 deletions
|
@ -91,6 +91,7 @@ class TrainingGroundsCostReductionEffect extends ContinuousEffectImpl<TrainingGr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
|
boolean applied = false;
|
||||||
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter);
|
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter);
|
||||||
|
|
||||||
if ( permanents != null && !permanents.isEmpty() ) {
|
if ( permanents != null && !permanents.isEmpty() ) {
|
||||||
|
@ -106,10 +107,12 @@ class TrainingGroundsCostReductionEffect extends ContinuousEffectImpl<TrainingGr
|
||||||
if ( costCount == 1 && (amount - 2) <= 0 ) {
|
if ( costCount == 1 && (amount - 2) <= 0 ) {
|
||||||
adjustedAmount = 1;
|
adjustedAmount = 1;
|
||||||
}
|
}
|
||||||
else if ( !((amount - 2) < 0) ) {
|
else {
|
||||||
adjustedAmount = amount - 2;
|
//In case the adjusted amount goes below 0.
|
||||||
|
adjustedAmount = Math.max(0, amount - 2);
|
||||||
}
|
}
|
||||||
costCasted.setMana(adjustedAmount);
|
costCasted.setMana(adjustedAmount);
|
||||||
|
applied = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +120,7 @@ class TrainingGroundsCostReductionEffect extends ContinuousEffectImpl<TrainingGr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return applied;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue