removed an unneeded parameter

This commit is contained in:
Maxmtg
2013-05-31 23:31:37 +00:00
parent e612c7f01a
commit ef6d584f0a
6 changed files with 27 additions and 23 deletions

View File

@@ -1115,7 +1115,7 @@ public class AbilityUtils {
}
} else {
// if it's paid by the AI already the human can pay, but it won't change anything
paid |= HumanPlay.payCostDuringAbilityResolve(ability, cost, sa, game);
paid |= HumanPlay.payCostDuringAbilityResolve(ability, cost, sa);
}
}

View File

@@ -507,7 +507,7 @@ public class GameAction {
@Override
public void resolve() {
GameAction.this.moveToHand(recoverable);
}
@Override
@@ -531,19 +531,21 @@ public class GameAction {
@Override
public void resolve() {
Player p = recoverable.getController();
boolean hasPaid = false;
if (p.isHuman()) {
if ( HumanPlay.payCostDuringAbilityResolve(abRecover, abRecover.getPayCosts(), null, game) )
moveToHand(recoverable);
else
exile(recoverable);
hasPaid = HumanPlay.payCostDuringAbilityResolve(abRecover, abRecover.getPayCosts(), null);
} else { // computer
if (ComputerUtilCost.canPayCost(abRecover, p)) {
ComputerUtil.playNoStack(p, abRecover, game);
} else {
GameAction.this.exile(recoverable);
hasPaid = true;
}
}
if (hasPaid)
moveToHand(recoverable);
else
exile(recoverable);
}
};
recoverAbility.setStackDescription(sb.toString());

View File

@@ -997,21 +997,23 @@ public class CombatUtil {
}
}
boolean hasPaid = attackCost.getTotalMana().isZero() && attackCost.isOnlyManaCost(); // true if needless to pay
if (!hasPaid) {
boolean needsToPay = !attackCost.getTotalMana().isZero() || !attackCost.isOnlyManaCost(); // true if needless to pay
boolean isPaid = !needsToPay;
if (needsToPay) {
final Ability ability = new AbilityStatic(c, attackCost, null) { @Override public void resolve() {} };
ability.setActivatingPlayer(c.getController());
if (c.getController().isHuman()) {
hasPaid = HumanPlay.payCostDuringAbilityResolve(ability, attackCost, null, game);
isPaid = HumanPlay.payCostDuringAbilityResolve(ability, attackCost, null);
} else { // computer
if (ComputerUtilCost.canPayCost(ability, c.getController())) {
ComputerUtil.playNoStack(c.getController(), ability, game);
hasPaid = true;
isPaid = true;
}
}
}
return hasPaid;
return isPaid;
}
/**

View File

@@ -181,7 +181,7 @@ public class PhaseUtil {
ability.setActivatingPlayer(blocker.getController());
if (blocker.getController().isHuman()) {
hasPaid = HumanPlay.payCostDuringAbilityResolve(ability, blockCost, null, game);
hasPaid = HumanPlay.payCostDuringAbilityResolve(ability, blockCost, null);
} else { // computer
if (ComputerUtilCost.canPayCost(ability, blocker.getController())) {
ComputerUtil.playNoStack(blocker.getController(), ability, game);

View File

@@ -174,20 +174,20 @@ public class Upkeep extends Phase {
final Ability sacAbility = new Ability(c, ManaCost.ZERO) {
@Override
public void resolve() {
boolean hasPaid = false;
Player controller = c.getController();
if (controller.isHuman()) {
Cost cost = new Cost(c.getEchoCost().trim(), true);
if ( !HumanPlay.payCostDuringAbilityResolve(blankAbility, cost, null, game) )
game.getAction().sacrifice(c, null);;
hasPaid = HumanPlay.payCostDuringAbilityResolve(blankAbility, cost, null);
} else { // computer
if (ComputerUtilCost.canPayCost(blankAbility, controller)) {
ComputerUtil.playNoStack(controller, blankAbility, game);
} else {
game.getAction().sacrifice(c, null);
hasPaid = true;
}
}
if (!hasPaid)
game.getAction().sacrifice(c, null);;
}
};
sacAbility.setActivatingPlayer(c.getController());
@@ -279,7 +279,7 @@ public class Upkeep extends Phase {
@Override
public void resolve() {
if (controller.isHuman()) {
if ( !HumanPlay.payCostDuringAbilityResolve(blankAbility, blankAbility.getPayCosts(), this, game))
if ( !HumanPlay.payCostDuringAbilityResolve(blankAbility, blankAbility.getPayCosts(), this))
game.getAction().sacrifice(c, null);
} else { // computer
if (ComputerUtilCost.shouldPayCost(controller, c, upkeepCost) && ComputerUtilCost.canPayCost(blankAbility, controller)) {

View File

@@ -280,7 +280,7 @@ public class HumanPlay {
* a {@link forge.Command} object.
* @param sourceAbility TODO
*/
public static boolean payCostDuringAbilityResolve(final SpellAbility ability, final Cost cost, SpellAbility sourceAbility, final Game game) {
public static boolean payCostDuringAbilityResolve(final SpellAbility ability, final Cost cost, SpellAbility sourceAbility) {
// Only human player pays this way
final Player p = ability.getActivatingPlayer();