mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- 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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user