mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Iona, Shiel of Emeria - Added choice information to card tooltip.
This commit is contained in:
parent
253bdd5d5d
commit
73885ab01d
4 changed files with 26 additions and 18 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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> {
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue