mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Ward only works on Permanents
This commit is contained in:
@@ -36,7 +36,7 @@ public final class GameObjectPredicates {
|
||||
return new Predicate<GameObject>() {
|
||||
@Override
|
||||
public boolean apply(final GameObject c) {
|
||||
return (c != null) && c.isValid(restrictions, sourceController, source, spellAbility);
|
||||
return c != null && c.isValid(restrictions, sourceController, source, spellAbility);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge.game.cost;
|
||||
|
||||
import forge.game.player.Player;
|
||||
|
||||
public abstract class CostDecisionMakerBase implements ICostVisitor<PaymentDecision> {
|
||||
public abstract class CostDecisionMakerBase implements ICostVisitor<PaymentDecision> {
|
||||
|
||||
protected final Player player;
|
||||
public CostDecisionMakerBase(Player player0) {
|
||||
|
||||
@@ -226,8 +226,7 @@ public class CostDiscard extends CostPartWithList {
|
||||
protected void handleChangeZoneTrigger(Player payer, SpellAbility ability, CardCollectionView targetCards) {
|
||||
super.handleChangeZoneTrigger(payer, ability, targetCards);
|
||||
|
||||
if (!targetCards.isEmpty())
|
||||
{
|
||||
if (!targetCards.isEmpty()) {
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
||||
runParams.put(AbilityKey.Player, payer);
|
||||
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) {
|
||||
final Card source = ability.getHostCard();
|
||||
|
||||
|
||||
if (!this.payCostFromSource()) {
|
||||
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 true;
|
||||
|
||||
@@ -120,5 +120,5 @@ public class CostExileFromStack extends CostPart {
|
||||
public <T> T accept(ICostVisitor<T> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CostGainLife extends CostPart {
|
||||
sb.append("Have an opponent gain ").append(this.getAmount()).append(" life");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public List<Player> getPotentialTargets(final Player payer, final Card source) {
|
||||
List<Player> res = new ArrayList<>();
|
||||
for (Player p : payer.getGame().getPlayers()) {
|
||||
@@ -121,7 +121,6 @@ public class CostGainLife extends CostPart {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public <T> T accept(ICostVisitor<T> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class CostPayment extends ManaConversionMatrix {
|
||||
public final SpellAbility getAbility() {
|
||||
return this.ability;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Constructor for Cost_Payment.
|
||||
|
||||
@@ -151,7 +151,6 @@ public class CostPutCounter extends CostPartWithList {
|
||||
|
||||
return !typeList.isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -204,7 +203,6 @@ public class CostPutCounter extends CostPartWithList {
|
||||
tempTable.triggerCountersPutAll(ability.getHostCard().getGame());
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.game.cost.CostPartWithList#resetLists()
|
||||
*/
|
||||
|
||||
@@ -38,17 +38,16 @@ public class CostTap extends CostPart {
|
||||
}
|
||||
|
||||
public int paymentOrder() { return -1; }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isUndoable() { return true; }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isReusable() { return true; }
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return "{T}";
|
||||
@@ -70,7 +69,7 @@ public class CostTap extends CostPart {
|
||||
ability.getHostCard().tap(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public <T> T accept(ICostVisitor<T> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class CostTapType extends CostPartWithList {
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -131,7 +131,7 @@ public class CostTapType extends CostPartWithList {
|
||||
|
||||
String type = this.getType();
|
||||
boolean sameType = false;
|
||||
|
||||
|
||||
if (type.contains(".sharesCreatureTypeWith")) {
|
||||
sameType = true;
|
||||
type = TextUtil.fastReplace(type, ".sharesCreatureTypeWith", "");
|
||||
|
||||
@@ -45,11 +45,10 @@ public class CostUntap extends CostPart {
|
||||
|
||||
@Override
|
||||
public boolean isUndoable() { return true; }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isRenewable() { return true; }
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -88,7 +87,7 @@ public class CostUntap extends CostPart {
|
||||
ability.getHostCard().untap(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public <T> T accept(ICostVisitor<T> visitor) {
|
||||
return visitor.visit(this);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PaymentDecision {
|
||||
this.counterTable = counterTable;
|
||||
}
|
||||
|
||||
private PaymentDecision(Card chosen) {
|
||||
private PaymentDecision(Card chosen) {
|
||||
this(null, null, null, null, null);
|
||||
cards.add(chosen);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class PaymentDecision {
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return TextUtil.concatWithSpace("Payment Decision:", TextUtil.addSuffix(String.valueOf(c),","), cards.toString());
|
||||
return TextUtil.concatWithSpace("Payment Decision:", TextUtil.addSuffix(String.valueOf(c),","), cards.toString());
|
||||
}
|
||||
|
||||
public static PaymentDecision type(String choice) {
|
||||
|
||||
@@ -45,7 +45,6 @@ public class Mana {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (!(other instanceof Mana)) {
|
||||
@@ -89,12 +88,10 @@ public class Mana {
|
||||
return this.manaAbility != null && (!manaAbility.getManaRestrictions().isEmpty() || !manaAbility.getExtraManaRestriction().isEmpty());
|
||||
}
|
||||
|
||||
|
||||
public final boolean addsNoCounterMagic(SpellAbility saBeingPaid) {
|
||||
return this.manaAbility != null && manaAbility.cannotCounterPaidWith(saBeingPaid);
|
||||
}
|
||||
|
||||
|
||||
public final boolean addsCounters(SpellAbility saBeingPaid) {
|
||||
return this.manaAbility != null && manaAbility.addsCounters(saBeingPaid);
|
||||
}
|
||||
|
||||
@@ -154,8 +154,7 @@ public class ManaCostBeingPaid {
|
||||
for (ManaCostShard shard : manaCost) {
|
||||
if (shard == ManaCostShard.X) {
|
||||
cntX++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
increaseShard(shard, 1, false);
|
||||
}
|
||||
}
|
||||
@@ -588,8 +587,7 @@ public class ManaCostBeingPaid {
|
||||
for (ManaCostShard shard : extra) {
|
||||
if (shard == ManaCostShard.X) {
|
||||
cntX++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
increaseShard(shard, 1, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +119,4 @@ public class ExtraTurn {
|
||||
this.cantSetSchemesInMotion = noSchemes;
|
||||
}
|
||||
|
||||
} //end class Untap
|
||||
}
|
||||
|
||||
@@ -226,8 +226,7 @@ public class Untap extends Phase {
|
||||
// even if they are not creatures
|
||||
for (final Card c : game.getCardsInGame()) {
|
||||
c.removeExertedBy(player);
|
||||
}
|
||||
|
||||
}
|
||||
} // end doUntap
|
||||
|
||||
private static void optionalUntap(final Card c) {
|
||||
@@ -261,7 +260,7 @@ public class Untap extends Phase {
|
||||
|
||||
@Override
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
public static final Predicate<Player> hasCounters() {
|
||||
return new Predicate<Player>() {
|
||||
@Override
|
||||
|
||||
@@ -350,7 +350,6 @@ public class AbilityManaPart implements java.io.Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sa.getHostCard() != null) {
|
||||
if (sa.getHostCard().isValid(restriction, this.getSourceCard().getController(), this.getSourceCard(), null)) {
|
||||
return true;
|
||||
@@ -583,7 +582,6 @@ public class AbilityManaPart implements java.io.Serializable {
|
||||
public Card getSourceCard() {
|
||||
return sourceCard;
|
||||
}
|
||||
|
||||
public void setSourceCard(final Card host) {
|
||||
sourceCard = host;
|
||||
}
|
||||
|
||||
@@ -682,7 +682,7 @@ public final class StaticAbilityContinuous {
|
||||
|
||||
// set P/T
|
||||
if (layer == StaticAbilityLayer.SETPT) {
|
||||
if ((setPower != null) || (setToughness != null)) {
|
||||
if (setPower != null || setToughness != null) {
|
||||
// non CharacteristicDefining
|
||||
if (setP.startsWith("Affected")) {
|
||||
setPower = AbilityUtils.calculateAmount(affectedCard, setP, stAb, true);
|
||||
@@ -709,7 +709,7 @@ public final class StaticAbilityContinuous {
|
||||
// add keywords
|
||||
// TODO regular keywords currently don't try to use keyword multiplier
|
||||
// (Although nothing uses it at this time)
|
||||
if ((addKeywords != null) || (removeKeywords != null) || removeAllAbilities) {
|
||||
if (addKeywords != null || removeKeywords != null || removeAllAbilities) {
|
||||
List<String> newKeywords = null;
|
||||
if (addKeywords != null) {
|
||||
newKeywords = Lists.newArrayList(addKeywords);
|
||||
|
||||
@@ -84,6 +84,5 @@ public abstract class Expressions {
|
||||
}
|
||||
return " ? ";
|
||||
}
|
||||
|
||||
|
||||
} // end class AllZoneUtil
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user