Merge branch 'playfix' into 'master'

Small PlayEffect fix

See merge request core-developers/forge!4952
This commit is contained in:
Bug Hunter
2021-07-05 21:55:04 +00:00
4 changed files with 15 additions and 16 deletions

View File

@@ -472,7 +472,6 @@ public class ComputerUtilCombat {
* @return a boolean.
*/
public static boolean wouldLoseLife(final Player ai, final Combat combat) {
return (ComputerUtilCombat.lifeThatWouldRemain(ai, combat) < ai.getLife());
}

View File

@@ -346,6 +346,19 @@ public class ComputerUtilCost {
return true;
}
/**
* Check sacrifice cost.
*
* @param cost
* the cost
* @param source
* the source
* @return true, if successful
*/
public static boolean checkSacrificeCost(final Player ai, final Cost cost, final Card source, final SpellAbility sourceAbility) {
return checkSacrificeCost(ai, cost, source, sourceAbility, true);
}
public static boolean isSacrificeSelfCost(final Cost cost) {
if (cost == null) {
return false;
@@ -406,19 +419,6 @@ public class ComputerUtilCost {
return true;
}
/**
* Check sacrifice cost.
*
* @param cost
* the cost
* @param source
* the source
* @return true, if successful
*/
public static boolean checkSacrificeCost(final Player ai, final Cost cost, final Card source, final SpellAbility sourceAbility) {
return checkSacrificeCost(ai, cost, source, sourceAbility, true);
}
/**
* <p>
* shouldPayCost.

View File

@@ -187,7 +187,7 @@ public class PlayEffect extends SpellAbilityEffect {
while (!tgtCards.isEmpty() && amount > 0) {
activator.getController().tempShowCards(showCards);
Card tgtCard = controller.getController().chooseSingleEntityForEffect(tgtCards, sa, Localizer.getInstance().getMessage("lblSelectCardToPlay"), !singleOption, null);
Card tgtCard = controller.getController().chooseSingleEntityForEffect(tgtCards, sa, Localizer.getInstance().getMessage("lblSelectCardToPlay"), !singleOption && optional, null);
activator.getController().endTempShowCards();
if (tgtCard == null) {
break;

View File

@@ -143,7 +143,7 @@ public class RollDiceEffect extends SpellAbilityEffect {
final PlayerCollection playersToRoll = getTargetPlayers(sa);
for(Player player : playersToRoll) {
for (Player player : playersToRoll) {
rollDice(sa, player, amount, sides);
}
}