- Added Harsh Mercy and Kamahl's Summons

- Vanguard: Karona, False God Avatar
This commit is contained in:
swordshine
2013-04-04 10:41:09 +00:00
parent 4ab1ace4d3
commit 90e3a9cefc
8 changed files with 61 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ public class ChooseColorEffect extends SpellAbilityEffect {
for (final Player p : tgtPlayers) {
if ((tgt == null) || p.canBeTargetedBy(sa)) {
if (sa.getActivatingPlayer().isHuman()) {
if (p.isHuman()) {
if (sa.hasParam("OrColors")) {
ImmutableList<String> choices = Constant.Color.ONLY_COLORS;
final List<String> o = GuiChoose.getChoices("Choose a color or colors", 1, choices.size(), choices);

View File

@@ -68,7 +68,7 @@ public class ChooseNumberEffect extends SpellAbilityEffect {
for (final Player p : tgtPlayers) {
if ((tgt == null) || p.canBeTargetedBy(sa)) {
if (sa.getActivatingPlayer().isHuman()) {
if (p.isHuman()) {
int chosen;
if (random) {
final Random randomGen = new Random();

View File

@@ -60,7 +60,7 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
}
boolean valid = false;
while (!valid) {
if (sa.getActivatingPlayer().isHuman()) {
if (p.isHuman()) {
final Object o = GuiChoose.one("Choose a card type", validTypes);
if (null == o) {
return;
@@ -82,14 +82,14 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
String chosenType = "";
boolean valid = false;
while (!valid) {
if (sa.getActivatingPlayer().isHuman()) {
if (p.isHuman()) {
final ArrayList<String> validChoices = CardType.getCreatureTypes();
for (final String s : invalidTypes) {
validChoices.remove(s);
}
chosenType = GuiChoose.one("Choose a creature type", validChoices);
} else {
Player ai = sa.getActivatingPlayer();
Player ai = p;
Player opp = ai.getOpponent();
String chosen = "";
if (sa.hasParam("AILogic")) {
@@ -128,7 +128,7 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
} else if (type.equals("Basic Land")) {
boolean valid = false;
while (!valid) {
if (sa.getActivatingPlayer().isHuman()) {
if (p.isHuman()) {
final String choice = GuiChoose.one("Choose a basic land type", CardType.getBasicTypes());
if (null == choice) {
return;
@@ -138,7 +138,7 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
card.setChosenType(choice);
}
} else {
Player ai = sa.getActivatingPlayer();
Player ai = p;
String chosen = "";
if (sa.hasParam("AILogic")) {
final String logic = sa.getParam("AILogic");
@@ -176,7 +176,7 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
} else if (type.equals("Land")) {
boolean valid = false;
while (!valid) {
if (sa.getActivatingPlayer().isHuman()) {
if (p.isHuman()) {
final String choice = GuiChoose
.one("Choose a land type", CardType.getLandTypes());
if (null == choice) {

View File

@@ -1,5 +1,6 @@
package forge.card.ability.effects;
import java.util.ArrayList;
import java.util.List;
import forge.Card;
@@ -21,12 +22,16 @@ public class ControlExchangeEffect extends SpellAbilityEffect {
Card object1 = null;
Card object2 = null;
final Target tgt = sa.getTarget();
List<Card> tgts = tgt.getTargetCards();
List<Card> tgts = tgt == null ? new ArrayList<Card>() : tgt.getTargetCards();
if (tgts.size() > 0) {
object1 = tgts.get(0);
}
if (sa.hasParam("Defined")) {
object2 = AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa).get(0);
List<Card> cards = AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa);
object2 = cards.isEmpty() ? null : cards.get(0);
if (cards.size() > 1 && sa.hasParam("BothDefined")) {
object1 = cards.get(1);
}
} else if (tgts.size() > 1) {
object2 = tgts.get(1);
}
@@ -42,12 +47,16 @@ public class ControlExchangeEffect extends SpellAbilityEffect {
Card object1 = null;
Card object2 = null;
final Target tgt = sa.getTarget();
List<Card> tgts = tgt.getTargetCards();
List<Card> tgts = tgt == null ? new ArrayList<Card>() : tgt.getTargetCards();
if (tgts.size() > 0) {
object1 = tgts.get(0);
}
if (sa.hasParam("Defined")) {
object2 = AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa).get(0);
final List<Card> cards = AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa);
object2 = cards.isEmpty() ? null : cards.get(0);
if (cards.size() > 1 && sa.hasParam("BothDefined")) {
object1 = cards.get(1);
}
} else if (tgts.size() > 1) {
object2 = tgts.get(1);
}