mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
[MID] Implemented Geistflame Reservoir
This commit is contained in:
parent
eef6160a4c
commit
03dfa50f23
4 changed files with 72 additions and 12 deletions
|
|
@ -62,12 +62,7 @@ public class RemoveVariableCountersSourceCost extends VariableCostImpl {
|
|||
|
||||
@Override
|
||||
public int getMaxValue(Ability source, Game game) {
|
||||
int maxValue = 0;
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
maxValue = permanent.getCounters(game).getCount(counterName);
|
||||
}
|
||||
return maxValue;
|
||||
return permanent != null ? permanent.getCounters(game).getCount(counterName) : 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -15,11 +14,12 @@ public enum GetXValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
for (VariableCost cost : sourceAbility.getCosts().getVariableCosts()) {
|
||||
amount += cost.getAmount();
|
||||
}
|
||||
return amount;
|
||||
return sourceAbility
|
||||
.getCosts()
|
||||
.getVariableCosts()
|
||||
.stream()
|
||||
.mapToInt(VariableCost::getAmount)
|
||||
.sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue