mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Ward only works on Permanents
This commit is contained in:
@@ -746,7 +746,7 @@ public class AiController {
|
|||||||
// one is warded and can't be paid for.
|
// one is warded and can't be paid for.
|
||||||
if (sa.usesTargeting()) {
|
if (sa.usesTargeting()) {
|
||||||
for (Card tgt : sa.getTargets().getTargetCards()) {
|
for (Card tgt : sa.getTargets().getTargetCards()) {
|
||||||
if (tgt.hasKeyword(Keyword.WARD) && tgt.getController().isOpponentOf(sa.getHostCard().getController())) {
|
if (tgt.hasKeyword(Keyword.WARD) && tgt.isInPlay() && tgt.getController().isOpponentOf(sa.getHostCard().getController())) {
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
Cost wardCost = ComputerUtilCard.getTotalWardCost(tgt);
|
Cost wardCost = ComputerUtilCard.getTotalWardCost(tgt);
|
||||||
if (wardCost.hasManaCost()) {
|
if (wardCost.hasManaCost()) {
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ public class ComputerUtilCost {
|
|||||||
// Ward - will be accounted for when rechecking a targeted ability
|
// Ward - will be accounted for when rechecking a targeted ability
|
||||||
if (sa.usesTargeting()) {
|
if (sa.usesTargeting()) {
|
||||||
for (Card tgt : sa.getTargets().getTargetCards()) {
|
for (Card tgt : sa.getTargets().getTargetCards()) {
|
||||||
if (tgt.hasKeyword(Keyword.WARD) && tgt.getController().isOpponentOf(sa.getHostCard().getController())) {
|
if (tgt.hasKeyword(Keyword.WARD) && tgt.isInPlay() && tgt.getController().isOpponentOf(sa.getHostCard().getController())) {
|
||||||
Cost wardCost = ComputerUtilCard.getTotalWardCost(tgt);
|
Cost wardCost = ComputerUtilCard.getTotalWardCost(tgt);
|
||||||
if (wardCost.hasManaCost()) {
|
if (wardCost.hasManaCost()) {
|
||||||
extraManaNeeded += wardCost.getTotalMana().getCMC();
|
extraManaNeeded += wardCost.getTotalMana().getCMC();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public final class GameObjectPredicates {
|
|||||||
return new Predicate<GameObject>() {
|
return new Predicate<GameObject>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final GameObject c) {
|
public boolean apply(final GameObject c) {
|
||||||
return (c != null) && c.isValid(restrictions, sourceController, source, spellAbility);
|
return c != null && c.isValid(restrictions, sourceController, source, spellAbility);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,8 +226,7 @@ public class CostDiscard extends CostPartWithList {
|
|||||||
protected void handleChangeZoneTrigger(Player payer, SpellAbility ability, CardCollectionView targetCards) {
|
protected void handleChangeZoneTrigger(Player payer, SpellAbility ability, CardCollectionView targetCards) {
|
||||||
super.handleChangeZoneTrigger(payer, ability, targetCards);
|
super.handleChangeZoneTrigger(payer, ability, targetCards);
|
||||||
|
|
||||||
if (!targetCards.isEmpty())
|
if (!targetCards.isEmpty()) {
|
||||||
{
|
|
||||||
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
||||||
runParams.put(AbilityKey.Player, payer);
|
runParams.put(AbilityKey.Player, payer);
|
||||||
runParams.put(AbilityKey.Cards, new CardCollection(targetCards));
|
runParams.put(AbilityKey.Cards, new CardCollection(targetCards));
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ public class CostExert extends CostPartWithList {
|
|||||||
public final boolean canPay(final SpellAbility ability, final Player payer) {
|
public final boolean canPay(final SpellAbility ability, final Player payer) {
|
||||||
final Card source = ability.getHostCard();
|
final Card source = ability.getHostCard();
|
||||||
|
|
||||||
|
|
||||||
if (!this.payCostFromSource()) {
|
if (!this.payCostFromSource()) {
|
||||||
boolean needsAnnoucement = ability.hasParam("Announce") && this.getType().contains(ability.getParam("Announce"));
|
boolean needsAnnoucement = ability.hasParam("Announce") && this.getType().contains(ability.getParam("Announce"));
|
||||||
|
|
||||||
@@ -94,7 +93,6 @@ public class CostExert extends CostPartWithList {
|
|||||||
|
|
||||||
|
|
||||||
return needsAnnoucement || (amount == null) || (typeList.size() >= amount);
|
return needsAnnoucement || (amount == null) || (typeList.size() >= amount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ public class CostGainLife extends CostPart {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public <T> T accept(ICostVisitor<T> visitor) {
|
public <T> T accept(ICostVisitor<T> visitor) {
|
||||||
return visitor.visit(this);
|
return visitor.visit(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ public class CostPutCounter extends CostPartWithList {
|
|||||||
|
|
||||||
return !typeList.isEmpty();
|
return !typeList.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -204,7 +203,6 @@ public class CostPutCounter extends CostPartWithList {
|
|||||||
tempTable.triggerCountersPutAll(ability.getHostCard().getGame());
|
tempTable.triggerCountersPutAll(ability.getHostCard().getGame());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see forge.game.cost.CostPartWithList#resetLists()
|
* @see forge.game.cost.CostPartWithList#resetLists()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public class CostTap extends CostPart {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isUndoable() { return true; }
|
public boolean isUndoable() { return true; }
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isReusable() { return true; }
|
public boolean isReusable() { return true; }
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ public class CostUntap extends CostPart {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isRenewable() { return true; }
|
public boolean isRenewable() { return true; }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class Mana {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
if (!(other instanceof Mana)) {
|
if (!(other instanceof Mana)) {
|
||||||
@@ -89,12 +88,10 @@ public class Mana {
|
|||||||
return this.manaAbility != null && (!manaAbility.getManaRestrictions().isEmpty() || !manaAbility.getExtraManaRestriction().isEmpty());
|
return this.manaAbility != null && (!manaAbility.getManaRestrictions().isEmpty() || !manaAbility.getExtraManaRestriction().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public final boolean addsNoCounterMagic(SpellAbility saBeingPaid) {
|
public final boolean addsNoCounterMagic(SpellAbility saBeingPaid) {
|
||||||
return this.manaAbility != null && manaAbility.cannotCounterPaidWith(saBeingPaid);
|
return this.manaAbility != null && manaAbility.cannotCounterPaidWith(saBeingPaid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public final boolean addsCounters(SpellAbility saBeingPaid) {
|
public final boolean addsCounters(SpellAbility saBeingPaid) {
|
||||||
return this.manaAbility != null && manaAbility.addsCounters(saBeingPaid);
|
return this.manaAbility != null && manaAbility.addsCounters(saBeingPaid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,8 +154,7 @@ public class ManaCostBeingPaid {
|
|||||||
for (ManaCostShard shard : manaCost) {
|
for (ManaCostShard shard : manaCost) {
|
||||||
if (shard == ManaCostShard.X) {
|
if (shard == ManaCostShard.X) {
|
||||||
cntX++;
|
cntX++;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
increaseShard(shard, 1, false);
|
increaseShard(shard, 1, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -588,8 +587,7 @@ public class ManaCostBeingPaid {
|
|||||||
for (ManaCostShard shard : extra) {
|
for (ManaCostShard shard : extra) {
|
||||||
if (shard == ManaCostShard.X) {
|
if (shard == ManaCostShard.X) {
|
||||||
cntX++;
|
cntX++;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
increaseShard(shard, 1, false);
|
increaseShard(shard, 1, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,4 +119,4 @@ public class ExtraTurn {
|
|||||||
this.cantSetSchemesInMotion = noSchemes;
|
this.cantSetSchemesInMotion = noSchemes;
|
||||||
}
|
}
|
||||||
|
|
||||||
} //end class Untap
|
}
|
||||||
|
|||||||
@@ -227,7 +227,6 @@ public class Untap extends Phase {
|
|||||||
for (final Card c : game.getCardsInGame()) {
|
for (final Card c : game.getCardsInGame()) {
|
||||||
c.removeExertedBy(player);
|
c.removeExertedBy(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end doUntap
|
} // end doUntap
|
||||||
|
|
||||||
private static void optionalUntap(final Card c) {
|
private static void optionalUntap(final Card c) {
|
||||||
@@ -261,7 +260,7 @@ public class Untap extends Phase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return ((c.isPhasedOut() && c.isDirectlyPhasedOut()) || c.hasKeyword(Keyword.PHASING));
|
return (c.isPhasedOut() && c.isDirectlyPhasedOut()) || c.hasKeyword(Keyword.PHASING);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ public final class PlayerPredicates {
|
|||||||
return Predicates.not(isCardInPlay(cardName));
|
return Predicates.not(isCardInPlay(cardName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static final Predicate<Player> hasCounters() {
|
public static final Predicate<Player> hasCounters() {
|
||||||
return new Predicate<Player>() {
|
return new Predicate<Player>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -350,7 +350,6 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sa.getHostCard() != null) {
|
if (sa.getHostCard() != null) {
|
||||||
if (sa.getHostCard().isValid(restriction, this.getSourceCard().getController(), this.getSourceCard(), null)) {
|
if (sa.getHostCard().isValid(restriction, this.getSourceCard().getController(), this.getSourceCard(), null)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -583,7 +582,6 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
public Card getSourceCard() {
|
public Card getSourceCard() {
|
||||||
return sourceCard;
|
return sourceCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSourceCard(final Card host) {
|
public void setSourceCard(final Card host) {
|
||||||
sourceCard = host;
|
sourceCard = host;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -682,7 +682,7 @@ public final class StaticAbilityContinuous {
|
|||||||
|
|
||||||
// set P/T
|
// set P/T
|
||||||
if (layer == StaticAbilityLayer.SETPT) {
|
if (layer == StaticAbilityLayer.SETPT) {
|
||||||
if ((setPower != null) || (setToughness != null)) {
|
if (setPower != null || setToughness != null) {
|
||||||
// non CharacteristicDefining
|
// non CharacteristicDefining
|
||||||
if (setP.startsWith("Affected")) {
|
if (setP.startsWith("Affected")) {
|
||||||
setPower = AbilityUtils.calculateAmount(affectedCard, setP, stAb, true);
|
setPower = AbilityUtils.calculateAmount(affectedCard, setP, stAb, true);
|
||||||
@@ -709,7 +709,7 @@ public final class StaticAbilityContinuous {
|
|||||||
// add keywords
|
// add keywords
|
||||||
// TODO regular keywords currently don't try to use keyword multiplier
|
// TODO regular keywords currently don't try to use keyword multiplier
|
||||||
// (Although nothing uses it at this time)
|
// (Although nothing uses it at this time)
|
||||||
if ((addKeywords != null) || (removeKeywords != null) || removeAllAbilities) {
|
if (addKeywords != null || removeKeywords != null || removeAllAbilities) {
|
||||||
List<String> newKeywords = null;
|
List<String> newKeywords = null;
|
||||||
if (addKeywords != null) {
|
if (addKeywords != null) {
|
||||||
newKeywords = Lists.newArrayList(addKeywords);
|
newKeywords = Lists.newArrayList(addKeywords);
|
||||||
|
|||||||
@@ -85,5 +85,4 @@ public abstract class Expressions {
|
|||||||
return " ? ";
|
return " ? ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} // end class AllZoneUtil
|
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ public class FCheckBoxTree extends JTree {
|
|||||||
this.selectedChildrenCount = selectedChildrenCount;
|
this.selectedChildrenCount = selectedChildrenCount;
|
||||||
this.enabledChildrenCount = enabledChildrenCount;
|
this.enabledChildrenCount = enabledChildrenCount;
|
||||||
}
|
}
|
||||||
public boolean hasChildren() { return this.numberOfChildren > 0;}
|
public boolean hasChildren() { return this.numberOfChildren > 0; }
|
||||||
public boolean allChildrenSelected(){ return this.numberOfChildren == this.selectedChildrenCount; };
|
public boolean allChildrenSelected() { return this.numberOfChildren == this.selectedChildrenCount; }
|
||||||
public boolean allChildrenEnabled(){ return this.enabledChildrenCount == this.numberOfChildren; };
|
public boolean allChildrenEnabled() { return this.enabledChildrenCount == this.numberOfChildren; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// == Fields of the FCheckboxTree class ==
|
// == Fields of the FCheckboxTree class ==
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Name:Awe for the Guilds
|
|||||||
ManaCost:2 R
|
ManaCost:2 R
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ Effect | Cost$ 2 R | Name$ Awe for the Guilds Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Monocolored creatures can't block this turn.
|
A:SP$ Effect | Cost$ 2 R | Name$ Awe for the Guilds Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Monocolored creatures can't block this turn.
|
||||||
SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.MonoColor| AddHiddenKeyword$ CARDNAME can't block. | Description$ Monocolored creatures can't block this turn.
|
SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.MonoColor | AddHiddenKeyword$ CARDNAME can't block. | Description$ Monocolored creatures can't block this turn.
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
AI:RemoveDeck:All
|
AI:RemoveDeck:All
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/awe_for_the_guilds.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/awe_for_the_guilds.jpg
|
||||||
|
|||||||
Reference in New Issue
Block a user