diff --git a/androminion/res/values/strings-server.xml b/androminion/res/values/strings-server.xml index ac96d179d..1d919668b 100644 --- a/androminion/res/values/strings-server.xml +++ b/androminion/res/values/strings-server.xml @@ -482,6 +482,7 @@ Trash it for Mercenary Return Madman Select a card to gain from the trash + Select a card to trash gain Trash Discard diff --git a/androminion/src/com/mehtank/androminion/ui/Strings.java b/androminion/src/com/mehtank/androminion/ui/Strings.java index 5418e9a41..28fb4ba8b 100644 --- a/androminion/src/com/mehtank/androminion/ui/Strings.java +++ b/androminion/src/com/mehtank/androminion/ui/Strings.java @@ -840,8 +840,11 @@ public static String getSelectOptionHeader(Card card, Object[] extras) { } else if (cardName.equals(getCardName(Cards.raze))) { return getString(R.string.raze_query); } else if(cardName.equals(getCardName(Cards.rogue))) { - return getString(R.string.rogue_query); - } else if (cardName.equals(getCardName(Cards.scheme))) { + if (extras[0] == ActionType.GAIN) + return getString(R.string.rogue_query); + else if (extras[0] == ActionType.TRASH) + return getString(R.string.rogue_trash_query); + } else if (cardName.equals(getCardName(Cards.scheme))) { return getString(R.string.scheme_query); } else if (cardName.equals(getCardName(Cards.sentry))) { Card currentCard = (Card)extras[0]; diff --git a/vdom/src/com/vdom/core/IndirectPlayer.java b/vdom/src/com/vdom/core/IndirectPlayer.java index 10bed5b7e..a86a83015 100644 --- a/vdom/src/com/vdom/core/IndirectPlayer.java +++ b/vdom/src/com/vdom/core/IndirectPlayer.java @@ -2503,22 +2503,35 @@ public Card rebuild_cardToGain(MoveContext context, int maxCost, int maxDebt, bo public Card rogue_cardToGain(MoveContext context) { ArrayList options = new ArrayList(); Set inTrashPile = new HashSet(); + for (Card c : game.trashPile) { if (!c.costPotion() && c.getCost(context) >= 3 && c.getCost(context) <= 6) inTrashPile.add(c); } options.addAll(inTrashPile); Collections.sort(options, new Util.CardNameComparator()); - + if (options.isEmpty()) { return null; } - return options.get(selectOption(context, Cards.rogue, options.toArray())); + + Object[] optionsAction = new Object[1 + options.size()]; + + optionsAction[0] = ActionType.GAIN; + for (int i = 0; i < options.size(); i++) { + optionsAction[i + 1] = options.get(i); + } + return options.get(selectOption(context, Cards.rogue, optionsAction, null)); } @Override public Card rogue_cardToTrash(MoveContext context, ArrayList canTrash) { - return canTrash.get(selectOption(context, Cards.rogue, canTrash.toArray())); + Object[] options = new Object[1 + canTrash.size()]; + options[0] = ActionType.TRASH; + for (int i = 0; i < canTrash.size(); i++) { + options[i + 1] = canTrash.get(i); + } + return canTrash.get(selectOption(context, Cards.rogue, options, null)); } @Override