- Some fixes for when the Human tries to Activate cards the AI controls but shouldn't be able to Activate.

This commit is contained in:
jendave
2011-08-06 13:02:53 +00:00
parent 79293095d5
commit 74063f5895
4 changed files with 6 additions and 4 deletions

View File

@@ -1237,9 +1237,8 @@ public class CardFactoryUtil {
@Override
public boolean canPlay() {
// unMorphing a card is a Special Action, and not effected by Linvala
//CardList Silence = AllZoneUtil.getPlayerCardsInPlay(AllZone.GameAction.getOpponent(getSourceCard().getController()));
//Silence = Silence.getName("Linvala, Keeper of Silence");
return sourceCard.isFaceDown() && AllZone.GameAction.isCardInPlay(sourceCard); // && Silence.size() == 0;
return sourceCard.getController().equals(this.getActivatingPlayer()) && sourceCard.isFaceDown()
&& AllZone.GameAction.isCardInPlay(sourceCard);
}
};//morph_up

View File

@@ -2739,6 +2739,7 @@ public class GameAction {
}//isAttached(Card c)
public boolean playCard(Card c) {
// this can only be called by the Human
HashMap<String, SpellAbility> map = new HashMap<String, SpellAbility>();
SpellAbility[] abilities = canPlaySpellAbility(c.getSpellAbility());
ArrayList<String> choices = new ArrayList<String>();
@@ -2748,8 +2749,8 @@ public class GameAction {
for(SpellAbility sa:abilities) {
// for uncastables like lotus bloom, check if manaCost is blank
sa.setActivatingPlayer(AllZone.HumanPlayer);
if(sa.canPlay() && (!sa.isSpell() || !sa.getManaCost().equals(""))) {
sa.setActivatingPlayer(c.getController());
choices.add(sa.toString());
map.put(sa.toString(), sa);
}

View File

@@ -154,6 +154,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo
if(!c.isLand())
{
SpellAbility[] sa = c.getSpellAbility();
sa[1].setActivatingPlayer(AllZone.HumanPlayer);
if(sa[1].canPlay() && !c.isUnCastable()) AllZone.GameAction.playSpellAbility(sa[1]);
}
else if (CardFactoryUtil.canHumanPlayLand())

View File

@@ -159,6 +159,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
if(!c.isLand())
{
SpellAbility[] sa = c.getSpellAbility();
sa[1].setActivatingPlayer(AllZone.HumanPlayer);
if(sa[1].canPlay() && !c.isUnCastable()) AllZone.GameAction.playSpellAbility(sa[1]);
}
else if (CardFactoryUtil.canHumanPlayLand())