mirror of
https://github.com/correl/mage.git
synced 2024-12-30 19:10:36 +00:00
[AFC] Fixed Belt of Giant Strength cost reduction (fixes #8347)
This commit is contained in:
parent
4094580a6c
commit
b63623b40f
2 changed files with 23 additions and 6 deletions
|
@ -51,10 +51,28 @@ enum BeltOfGiantStrengthAdjuster implements CostAdjuster {
|
|||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
Permanent permanent = game.getPermanent(ability.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
return;
|
||||
if (game.inCheckPlayableState()) {
|
||||
int maxPower = 0;
|
||||
for (UUID permId : CardUtil.getAllPossibleTargets(ability, game)) {
|
||||
Permanent permanent = game.getPermanent(permId);
|
||||
if (permanent != null) {
|
||||
int power = permanent.getPower().getValue();
|
||||
if (power > maxPower) {
|
||||
maxPower = power;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (maxPower > 0) {
|
||||
CardUtil.reduceCost(ability, maxPower);
|
||||
}
|
||||
} else {
|
||||
Permanent permanent = game.getPermanent(ability.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
int power = permanent.getPower().getValue();
|
||||
if (power > 0) {
|
||||
CardUtil.reduceCost(ability, power);
|
||||
}
|
||||
}
|
||||
}
|
||||
CardUtil.reduceCost(ability, Integer.max(permanent.getPower().getValue(), 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ public class BeltOfGiantStrengthTest extends CardTestPlayerBase {
|
|||
);
|
||||
}
|
||||
|
||||
@Ignore // currently failing, need to fix
|
||||
@Test
|
||||
public void testWithoutManaAvailable() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, belt);
|
||||
|
|
Loading…
Reference in a new issue