Sacrifice effect will try to include SacValid$ into message for easier understanding of what input wants you to do

This commit is contained in:
Maxmtg
2013-04-04 04:25:30 +00:00
parent 609f99a2b6
commit 43553e7b3b
5 changed files with 6 additions and 7 deletions

View File

@@ -61,7 +61,7 @@ public class SacrificeEffect extends SpellAbilityEffect {
choosenToSacrifice = Aggregates.random(validTargets, Math.min(amount, validTargets.size()));
} else {
boolean isOptional = sa.hasParam("Optional");
choosenToSacrifice = p.getController().choosePermanentsToSacrifice(validTargets, amount, sa, destroy, isOptional);
choosenToSacrifice = p.getController().choosePermanentsToSacrifice(validTargets, valid, amount, sa, destroy, isOptional);
}
for(Card sac : choosenToSacrifice) {

View File

@@ -1207,7 +1207,7 @@ public class CombatUtil {
final Player opponent = Singletons.getModel().getGame().getCombat().getDefendingPlayerRelatedTo(c).get(0);
//List<Card> list = AbilityUtils.filterListByType(opponent.getCardsIn(ZoneType.Battlefield), "Permanent", this);
final List<Card> list = opponent.getCardsIn(ZoneType.Battlefield);
List<Card> toSac = opponent.getController().choosePermanentsToSacrifice(list, a, this, false, false);
List<Card> toSac = opponent.getController().choosePermanentsToSacrifice(list, "Card", a, this, false, false);
for(Card sacd : toSac) {
final GameState game = Singletons.getModel().getGame();

View File

@@ -95,8 +95,7 @@ public abstract class PlayerController {
public abstract Map<Card, Integer> assignCombatDamage(Card attacker, List<Card> blockers, int damageDealt, GameEntity defender);
public abstract Integer announceRequirements(SpellAbility ability, String announce, boolean allowZero);
public abstract List<Card> choosePermanentsToSacrifice(List<Card> validTargets, int amount, SpellAbility sa, boolean destroy, boolean isOptional);
public abstract List<Card> choosePermanentsToSacrifice(List<Card> validTargets, String validMessage, int amount, SpellAbility sa, boolean destroy, boolean isOptional);
public Card chooseSingleCardForEffect(List<Card> sourceList, SpellAbility sa, String title) { return chooseSingleCardForEffect(sourceList, sa, title, false); }
public abstract Card chooseSingleCardForEffect(List<Card> sourceList, SpellAbility sa, String title, boolean isOptional);

View File

@@ -155,7 +155,7 @@ public class PlayerControllerAi extends PlayerController {
}
@Override
public List<Card> choosePermanentsToSacrifice(List<Card> validTargets, int amount, SpellAbility sa, boolean destroy, boolean isOptional) {
public List<Card> choosePermanentsToSacrifice(List<Card> validTargets, String validMessage, int amount, SpellAbility sa, boolean destroy, boolean isOptional) {
return ComputerUtil.choosePermanentsToSacrifice(player, validTargets, amount, sa, destroy, isOptional);
}

View File

@@ -240,14 +240,14 @@ public class PlayerControllerHuman extends PlayerController {
* @see forge.game.player.PlayerController#choosePermanentsToSacrifice(java.util.List, int, forge.card.spellability.SpellAbility, boolean, boolean)
*/
@Override
public List<Card> choosePermanentsToSacrifice(List<Card> validTargets, int amount, SpellAbility sa, boolean destroy, boolean isOptional) {
public List<Card> choosePermanentsToSacrifice(List<Card> validTargets, String validMessage, int amount, SpellAbility sa, boolean destroy, boolean isOptional) {
int max = Math.min(amount, validTargets.size());
if (max == 0)
return new ArrayList<Card>();
InputSelectCards inp = new InputSelectCardsFromList(isOptional ? 0 : amount, max, validTargets);
// TODO: Either compose a message here, or pass it as parameter from caller.
inp.setMessage("Select %d card(s) to sacrifice");
inp.setMessage("Select %d " + validMessage + "(s) to sacrifice");
FThreads.setInputAndWait(inp);
if( inp.hasCancelled() )