mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
removed an unneeded parameter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user