- Added Legerdemain and Gauntlets of Chaos

- Fixed isManaAbility
This commit is contained in:
swordshine
2014-03-16 03:48:38 +00:00
parent f123611655
commit 30cd3954c3
6 changed files with 47 additions and 1 deletions

View File

@@ -70,6 +70,10 @@ public class ControlExchangeEffect extends SpellAbilityEffect {
final long tStamp = sa.getActivatingPlayer().getGame().getNextTimestamp();
object2.setController(object1.getController(), tStamp);
object1.setController(player2, tStamp);
if (sa.hasParam("RememberExchanged")) {
sa.getHostCard().addRemembered(object1);
sa.getHostCard().addRemembered(object2);
}
}
}

View File

@@ -497,7 +497,7 @@ public class CardFactoryUtil {
}
// Make sure it's still targetable as well
return target.canBeTargetedBy(ability);
return ability.canTarget(target);
}
// does "target" have protection from "card"?

View File

@@ -33,6 +33,8 @@ import forge.game.cost.Cost;
import forge.game.cost.CostPartMana;
import forge.game.mana.Mana;
import forge.game.player.Player;
import forge.game.trigger.TriggerType;
import forge.game.trigger.WrappedAbility;
import forge.util.TextUtil;
import org.apache.commons.lang3.StringUtils;
@@ -138,6 +140,8 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
if (this.usesTargeting()) return false;
if (getRestrictions() != null && getRestrictions().getPlaneswalker())
return false; //Loyalty ability, not a mana ability.
if (this.isWrapper() && ((WrappedAbility) this).getTrigger().getMode() != TriggerType.TapsForMana)
return false;
return getManaPartRecursive() != null;
}
@@ -1046,6 +1050,24 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
}
}
}
if (hasParam("TargetsWithSharedTypes") && entity instanceof Card) {
final Card c = (Card) entity;
final SpellAbility parent = this.getParentTargetingCard();
final Card parentTargeted = parent != null ? parent.getTargetCard() : null;
if (parentTargeted == null) {
return false;
}
boolean flag = false;
for (final String type : getParam("TargetsWithSharedTypes").split(",")) {
if (c.isType(type) && parentTargeted.isType(type)) {
flag = true;
break;
}
}
if (!flag) {
return false;
}
}
if (hasParam("TargetsWithRelatedProperty") && entity instanceof Card) {
final String related = getParam("TargetsWithRelatedProperty");
final Card c = (Card) entity;