* Iona, Shiel of Emeria - Added choice information to card tooltip.

This commit is contained in:
LevelX2 2014-04-04 08:39:19 +02:00
parent 253bdd5d5d
commit 73885ab01d
4 changed files with 26 additions and 18 deletions

View file

@ -1307,6 +1307,9 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
@Override
public int getAmount(int min, int max, String message, Game game) {
log.debug("getAmount");
if (message.startsWith("Assign damage to ")) {
return min;
}
//TODO: improve this
if (min < max && min == 0) {
return new Random().nextInt(max+1);

View file

@ -96,13 +96,15 @@ class IonaShieldOfEmeriaChooseColorEffect extends OneShotEffect<IonaShieldOfEmer
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent perm = game.getPermanent(source.getSourceId());
if (player != null && perm != null) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
ChoiceColor colorChoice = new ChoiceColor();
if (player.choose(Outcome.Detriment, colorChoice, game)) {
game.informPlayers(perm.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
game.getState().setValue(perm.getId() + "_color", colorChoice.getColor());
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor());
permanent.addInfo("chosen color", new StringBuilder("<font color='blue'>Chosen color: ").append(colorChoice.getChoice()).append("</font>").toString());
}
return true;
}
return false;
}

View file

@ -35,6 +35,7 @@ import mage.abilities.effects.Effect;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <T>
*/
public abstract class StaticAbility<T extends StaticAbility<T>> extends AbilityImpl<T> {

View file

@ -57,20 +57,22 @@ public class ChoiceColor extends ChoiceImpl<ChoiceColor> {
public ObjectColor getColor() {
ObjectColor color = new ObjectColor();
if (choice.equals("Black")) {
switch (choice) {
case "Black":
color.setBlack(true);
}
else if (choice.equals("Blue")) {
break;
case "Blue":
color.setBlue(true);
}
else if (choice.equals("Green")) {
break;
case "Green":
color.setGreen(true);
}
else if (choice.equals("Red")) {
break;
case "Red":
color.setRed(true);
}
else if (choice.equals("White")) {
break;
case "White":
color.setWhite(true);
break;
}
return color;
}