diff --git a/.gitattributes b/.gitattributes index 17c350bde31..0890b0db42d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -538,6 +538,7 @@ res/cardsfolder/a/ashes_of_the_fallen.txt svneol=native#text/plain res/cardsfolder/a/ashes_to_ashes.txt svneol=native#text/plain res/cardsfolder/a/ashling_the_extinguisher.txt -text res/cardsfolder/a/ashling_the_extinguisher_avatar.txt -text +res/cardsfolder/a/ashling_the_pilgrim.txt -text res/cardsfolder/a/ashling_the_pilgrim_avatar.txt -text res/cardsfolder/a/ashlings_prerogative.txt -text res/cardsfolder/a/ashmouth_hound.txt -text @@ -9549,6 +9550,7 @@ res/cardsfolder/s/simic_guildgate.txt -text res/cardsfolder/s/simic_guildmage.txt -text res/cardsfolder/s/simic_initiate.txt -text res/cardsfolder/s/simic_keyrune.txt -text +res/cardsfolder/s/simic_manipulator.txt -text res/cardsfolder/s/simic_ragworm.txt svneol=native#text/plain res/cardsfolder/s/simic_signet.txt svneol=native#text/plain res/cardsfolder/s/simic_sky_swallower.txt svneol=native#text/plain diff --git a/res/cardsfolder/a/ashling_the_pilgrim.txt b/res/cardsfolder/a/ashling_the_pilgrim.txt new file mode 100644 index 00000000000..ca929a6a734 --- /dev/null +++ b/res/cardsfolder/a/ashling_the_pilgrim.txt @@ -0,0 +1,18 @@ +Name:Ashling the Pilgrim +ManaCost:1 R +Types:Legendary Creature Elemental Shaman +PT:1/1 +A:AB$ PutCounter | Cost$ 1 R | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ StoreNum | StackDescription$ SpellDescription | SpellDescription$ Put a +1/+1 counter on CARDNAME. If this is the third time this ability has resolved this turn, remove all +1/+1 counters from CARDNAME, and it deals that much damage to each creature and each player. +SVar:StoreNum:DB$ StoreSVar | SVar$ AshlingNum | Type$ CountSVar | Expression$ AshlingNum/Plus.1 | SubAbility$ DBRemoveCounter +SVar:DBRemoveCounter:DB$ RemoveCounter | CounterType$ P1P1 | CounterNum$ All | RememberRemoved$ True | SubAbility$ DBDmg | ConditionCheckSVar$ AshlingNum | ConditionSVarCompare$ EQ3 | StackDescription$ None +SVar:DBDmg:DB$ DamageAll | NumDmg$ X | References$ X | ValidCards$ Creature | ValidPlayers$ Each | ValidDescription$ each creature and each player. | SubAbility$ DBCleanup | ConditionCheckSVar$ AshlingNum | ConditionSVarCompare$ EQ3 | StackDescription$ None +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:AshlingNum:Number$0 +SVar:X:Count$RememberedSize +T:Mode$ Phase | Phase$ Cleanup | Execute$ TrigReset | Static$ True +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigReset | Static$ True +SVar:TrigReset:AB$ StoreSVar | Cost$ 0 | SVar$ AshlingNum | Type$ Number | Expression$ 0 +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/ashling_the_pilgrim.jpg +Oracle:{1}{R}: Put a +1/+1 counter on Ashling the Pilgrim. If this is the third time this ability has resolved this turn, remove all +1/+1 counters from Ashling the Pilgrim, and it deals that much damage to each creature and each player. +SetInfo:LRW Rare \ No newline at end of file diff --git a/res/cardsfolder/b/balancing_act.txt b/res/cardsfolder/b/balancing_act.txt index 550ae088aa3..54a0e55d8f6 100644 --- a/res/cardsfolder/b/balancing_act.txt +++ b/res/cardsfolder/b/balancing_act.txt @@ -22,5 +22,5 @@ SVar:DBReset2:DB$ StoreSVar | SVar$ MinHand | Type$ Number | Expression$ 9999 SVar:Picture:http://www.wizards.com/global/images/magic/general/balancing_act.jpg SVar:RemAIDeck:True SVar:RemRandomDeck:True -SetInfo:ODY Rare Oracle:Each player chooses a number of permanents he or she controls equal to the number of permanents controlled by the player who controls the fewest, then sacrifices the rest. Each player discards cards the same way. +SetInfo:ODY Rare \ No newline at end of file diff --git a/res/cardsfolder/f/fog.txt b/res/cardsfolder/f/fog.txt index 457216ed67c..34f36388bcd 100644 --- a/res/cardsfolder/f/fog.txt +++ b/res/cardsfolder/f/fog.txt @@ -6,10 +6,10 @@ SVar:Picture:http://www.wizards.com/global/images/magic/general/fog.jpg Oracle:Prevent all combat damage that would be dealt this turn. SetInfo:2ED Common SetInfo:7ED Common +SetInfo:M12 Common SetInfo:6ED Common SetInfo:M10 Common SetInfo:MIR Common -SetInfo:M12 Common SetInfo:M11 Common SetInfo:LEB Common SetInfo:M13 Common diff --git a/res/cardsfolder/g/griffin_protector.txt b/res/cardsfolder/g/griffin_protector.txt index 320cf6aece4..8a4945f5461 100644 --- a/res/cardsfolder/g/griffin_protector.txt +++ b/res/cardsfolder/g/griffin_protector.txt @@ -3,8 +3,8 @@ ManaCost:3 W Types:Creature Griffin PT:2/3 K:Flying -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever a creature enters the battlefield under your control, CARDNAME gets +1/+1 until end of turn. -SVar:TrigPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 1 | NumDef$ 1 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.YouCtrl+Other | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever another creature enters the battlefield under your control, CARDNAME gets +1/+1 until end of turn. +SVar:TrigPump:AB$ Pump | Cost$ 0 | Defined$ Self | NumAtt$ 1 | NumDef$ 1 SVar:BuffedBy:Creature SVar:Picture:http://www.wizards.com/global/images/magic/general/griffin_protector.jpg Oracle:Flying\nWhenever another creature enters the battlefield under your control, Griffin Protector gets +1/+1 until end of turn. diff --git a/res/cardsfolder/n/natural_balance.txt b/res/cardsfolder/n/natural_balance.txt index 42c0bd771bf..c28b68ac5cd 100644 --- a/res/cardsfolder/n/natural_balance.txt +++ b/res/cardsfolder/n/natural_balance.txt @@ -8,5 +8,5 @@ SVar:LandsControlled:Count$Valid Land.RememberedPlayerCtrl SVar:SacX:SVar$LandsControlled/Minus.5 SVar:FetchX:Number$5/Minus.LandsControlled SVar:Picture:http://www.wizards.com/global/images/magic/general/natural_balance.jpg -SetInfo:MIR Rare Oracle:Each player who controls six or more lands chooses five lands he or she controls and sacrifices the rest. Each player who controls four or fewer lands may search his or her library for up to X basic land cards and put them onto the battlefield, where X is five minus the number of lands he or she controls. Then each player who searched his or her library this way shuffles it. +SetInfo:MIR Rare \ No newline at end of file diff --git a/res/cardsfolder/o/ooze_flux.txt b/res/cardsfolder/o/ooze_flux.txt index c0e81cc8043..20a9cd8a796 100644 --- a/res/cardsfolder/o/ooze_flux.txt +++ b/res/cardsfolder/o/ooze_flux.txt @@ -1,7 +1,7 @@ Name:Ooze Flux ManaCost:3 G Types:Enchantment -A:AB$ Token | Announce$ X | Cost$ XCantBe0 1 G SubCounter | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenImage$ G X X Ooze | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | SpellDescription$ Put a green Saproling creature token onto the battlefield. It has "This creature's power and toughness are each equal to the number of fade counters on CARDNAME." +A:AB$ Token | Announce$ X | Cost$ XCantBe0 1 G SubCounter | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenImage$ G X X Ooze | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | SpellDescription$ Put an X/X green Ooze creature token onto the battlefield, where X is the number of +1/+1 counters removed this way. SVar:X:Count$xPaid SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/ooze_flux.jpg diff --git a/res/cardsfolder/s/simic_manipulator.txt b/res/cardsfolder/s/simic_manipulator.txt new file mode 100644 index 00000000000..4d0ff409550 --- /dev/null +++ b/res/cardsfolder/s/simic_manipulator.txt @@ -0,0 +1,11 @@ +Name:Simic Manipulator +ManaCost:1 U U +Types:Creature Merfolk +PT:0/1 +K:Evolve +A:AB$ GainControl | Announce$ X | Cost$ XCantBe0 T SubCounter | ValidTgts$ Creature.powerLEX | TgtPrompt$ Select target with power less than or equal to the number of +1/+1 counters removed this way | SpellDescription$ Gain control of target creature with power less than or equal to the number of +1/+1 counters removed this way. +SVar:X:Count$xPaid +SVar:RemAIDeck:True +SVar:Picture:http://www.wizards.com/global/images/magic/general/simic_manipulator.jpg +Oracle:Evolve (Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature.)\n{T}, Remove one or more +1/+1 counters from Simic Manipulator: Gain control of target creature with power less than or equal to the number of +1/+1 counters removed this way. +SetInfo:GTC Rare \ No newline at end of file diff --git a/res/cardsfolder/t/taniwha.txt b/res/cardsfolder/t/taniwha.txt index 90dab68bbb9..c630db1185b 100644 --- a/res/cardsfolder/t/taniwha.txt +++ b/res/cardsfolder/t/taniwha.txt @@ -7,5 +7,5 @@ K:Phasing T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPhaseLands | TriggerDescription$ At the beginning of your upkeep, all lands you control phase out. SVar:TrigPhaseLands:DB$ Phases | Defined$ Valid Land.YouCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/taniwha.jpg -SetInfo:MIR Rare Oracle:Trample\nPhasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)\nAt the beginning of your upkeep, all lands you control phase out. (They phase in before you untap during your next untap step.) +SetInfo:MIR Rare \ No newline at end of file diff --git a/res/cardsfolder/v/vision_charm.txt b/res/cardsfolder/v/vision_charm.txt index 9bcef7c8368..ab68557f377 100644 --- a/res/cardsfolder/v/vision_charm.txt +++ b/res/cardsfolder/v/vision_charm.txt @@ -1,7 +1,6 @@ Name:Vision Charm ManaCost:U Types:Instant -Text:no text A:SP$ Charm | Cost$ U | Choices$ MillOpp,ChangeType,PhaseArtifact | CharmNum$ 1 | SpellDescription$ Choose one - Target player puts the top four cards of his or her library into his or her graveyard; or choose a land type and a basic land type, and each land of the first chosen type becomes the second chosen type until end of turn; or target artifact phases out. (While it's phased out, it's treated as though it doesn't exist. It phases in before its controller untaps during his or her next untap step.) SVar:MillOpp:DB$ Mill | NumCards$ 4 | ValidTgts$ Player | TgtPrompt$ Choose a player | SpellDescription$ Target player puts the top four cards of his or her library into his or her graveyard. SVar:ChangeType:DB$ ChooseType | Defined$ You | Type$ Land | SubAbility$ RemFirstLand | SpellDescription$ Choose a land type and a basic land type, and each land of the first chosen type becomes the second chosen type until end of turn. diff --git a/res/cube/GtcGuildSimic.dck b/res/cube/GtcGuildSimic.dck index 18348eaf6fe..07bcf2eaf4a 100644 --- a/res/cube/GtcGuildSimic.dck +++ b/res/cube/GtcGuildSimic.dck @@ -46,6 +46,7 @@ Name=GtcGuildSimic 1 Simic Charm|GTC 1 Simic Fluxmage|GTC 1 Simic Keyrune|GTC +1 Simic Manipulator|GTC 1 Skygames|GTC 1 Spell Rupture|GTC 1 Spire Tracer|GTC diff --git a/src/main/java/forge/card/ability/ai/ChangeZoneAi.java b/src/main/java/forge/card/ability/ai/ChangeZoneAi.java index bffaf12a087..6a2e3d1d703 100644 --- a/src/main/java/forge/card/ability/ai/ChangeZoneAi.java +++ b/src/main/java/forge/card/ability/ai/ChangeZoneAi.java @@ -180,7 +180,7 @@ public class ChangeZoneAi extends SpellAbilityAi { if (part instanceof CostDiscard) { CostDiscard cd = (CostDiscard) part; // this is mainly for typecycling - if (!cd.isTargetingThis() || !ComputerUtil.isWorseThanDraw(ai, source)) { + if (!cd.payCostFromSource() || !ComputerUtil.isWorseThanDraw(ai, source)) { return false; } } diff --git a/src/main/java/forge/card/ability/ai/DestroyAi.java b/src/main/java/forge/card/ability/ai/DestroyAi.java index c02550c868a..11b6058be3a 100644 --- a/src/main/java/forge/card/ability/ai/DestroyAi.java +++ b/src/main/java/forge/card/ability/ai/DestroyAi.java @@ -87,7 +87,7 @@ public class DestroyAi extends SpellAbilityAi { continue; } CostSacrifice sacCost = (CostSacrifice) part; - if (sacCost.isTargetingThis() && ComputerUtilCost.canPayCost(ability, c.getController())) { + if (sacCost.payCostFromSource() && ComputerUtilCost.canPayCost(ability, c.getController())) { return false; } } diff --git a/src/main/java/forge/card/cost/CostDiscard.java b/src/main/java/forge/card/cost/CostDiscard.java index be6e4c495d2..727f61c5abc 100644 --- a/src/main/java/forge/card/cost/CostDiscard.java +++ b/src/main/java/forge/card/cost/CostDiscard.java @@ -69,7 +69,7 @@ public class CostDiscard extends CostPartWithList { final Integer i = this.convertAmount(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); } else if (this.getType().equals("Hand")) { sb.append("your hand"); @@ -108,7 +108,7 @@ public class CostDiscard extends CostPartWithList { String type = this.getType(); final Integer amount = this.convertAmount(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { if (!source.isInZone(ZoneType.Hand)) { return false; } @@ -174,7 +174,7 @@ public class CostDiscard extends CostPartWithList { final String amount = this.getAmount(); this.resetList(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { if (!handList.contains(source)) { return false; } @@ -272,7 +272,7 @@ public class CostDiscard extends CostPartWithList { this.addToList(ai.getLastDrawnCard()); } - else if (this.isTargetingThis()) { + else if (this.payCostFromSource()) { if (!hand.contains(source)) { return false; } diff --git a/src/main/java/forge/card/cost/CostExile.java b/src/main/java/forge/card/cost/CostExile.java index 88c39c9a7f0..b339110f65b 100644 --- a/src/main/java/forge/card/cost/CostExile.java +++ b/src/main/java/forge/card/cost/CostExile.java @@ -492,7 +492,7 @@ public class CostExile extends CostPartWithList { final Integer i = this.convertAmount(); sb.append("Exile "); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); if (!this.from.equals(ZoneType.Battlefield)) { sb.append(" from your ").append(this.from); @@ -507,7 +507,7 @@ public class CostExile extends CostPartWithList { final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription(); sb.append(Cost.convertAmountTypeToWords(i, this.getAmount(), desc)); - if (!this.isTargetingThis()) { + if (!this.payCostFromSource()) { sb.append(" you control"); } return sb.toString(); @@ -561,7 +561,7 @@ public class CostExile extends CostPartWithList { typeList = new ArrayList(activator.getCardsIn(this.getFrom())); } } - if (!this.isTargetingThis()) { + if (!this.payCostFromSource()) { typeList = CardLists.getValidCards(typeList, this.getType().split(";"), activator, source); final Integer amount = this.convertAmount(); @@ -652,7 +652,7 @@ public class CostExile extends CostPartWithList { } Input target = null; - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { target = new InputExileThis(payment, this, ability); } else if (this.from.equals(ZoneType.Battlefield) || this.from.equals(ZoneType.Hand)) { target = new InputExileType(this, payment, this.getType(), c, ability); @@ -691,7 +691,7 @@ public class CostExile extends CostPartWithList { @Override public final boolean decideAIPayment(final AIPlayer ai, final SpellAbility ability, final Card source, final CostPayment payment) { this.resetList(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { this.getList().add(source); } else if (this.getType().equals("All")) { this.setList(new ArrayList(ability.getActivatingPlayer().getCardsIn(this.getFrom()))); diff --git a/src/main/java/forge/card/cost/CostPart.java b/src/main/java/forge/card/cost/CostPart.java index 64cbf34dec0..675d151f993 100644 --- a/src/main/java/forge/card/cost/CostPart.java +++ b/src/main/java/forge/card/cost/CostPart.java @@ -87,7 +87,7 @@ public abstract class CostPart { * * @return the this */ - public final boolean isTargetingThis() { + public final boolean payCostFromSource() { return this.getType().equals("CARDNAME"); } diff --git a/src/main/java/forge/card/cost/CostPutCounter.java b/src/main/java/forge/card/cost/CostPutCounter.java index 6cd3ab9bda7..b3c380d7664 100644 --- a/src/main/java/forge/card/cost/CostPutCounter.java +++ b/src/main/java/forge/card/cost/CostPutCounter.java @@ -97,7 +97,7 @@ public class CostPutCounter extends CostPartWithList { sb.append(Cost.convertAmountTypeToWords(i, this.getAmount(), this.counter.getName() + " counter")); sb.append(" on "); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); } else { final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription(); @@ -128,7 +128,7 @@ public class CostPutCounter extends CostPartWithList { */ @Override public final boolean canPay(final SpellAbility ability, final Card source, final Player activator, final Cost cost, final GameState game) { - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { if (source.hasKeyword("CARDNAME can't have counters placed on it.")) { return false; } @@ -161,7 +161,7 @@ public class CostPutCounter extends CostPartWithList { c = AbilityUtils.calculateAmount(source, this.getAmount(), ability); } - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { source.addCounter(this.getCounter(), c, false); } else { // Put counter on chosen card @@ -185,7 +185,7 @@ public class CostPutCounter extends CostPartWithList { c = AbilityUtils.calculateAmount(source, this.getAmount(), ability); } - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { source.addCounter(this.getCounter(), c, false); payment.setPaidManaPart(this); this.addToList(source); @@ -207,7 +207,7 @@ public class CostPutCounter extends CostPartWithList { @Override public final boolean decideAIPayment(final AIPlayer ai, final SpellAbility ability, final Card source, final CostPayment payment) { this.resetList(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { this.addToList(source); return true; } else { diff --git a/src/main/java/forge/card/cost/CostRemoveCounter.java b/src/main/java/forge/card/cost/CostRemoveCounter.java index b3ec40afee9..dee934b4e69 100644 --- a/src/main/java/forge/card/cost/CostRemoveCounter.java +++ b/src/main/java/forge/card/cost/CostRemoveCounter.java @@ -130,7 +130,7 @@ public class CostRemoveCounter extends CostPartWithList { sb.append(" from "); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); } else { final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription(); @@ -165,7 +165,7 @@ public class CostRemoveCounter extends CostPartWithList { final CounterType cntrs = this.getCounter(); final Integer amount = this.convertAmount(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { if ((amount != null) && ((source.getCounters(cntrs) - amount) < 0)) { return false; } @@ -203,7 +203,7 @@ public class CostRemoveCounter extends CostPartWithList { } } - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { source.subtractCounter(this.counter, c); } else { for (final Card card : this.getList()) { @@ -226,7 +226,7 @@ public class CostRemoveCounter extends CostPartWithList { Integer c = this.convertAmount(); int maxCounters = 0; - if (!this.isTargetingThis()) { + if (!this.payCostFromSource()) { if (c == null) { final String sVar = ability.getSVar(amount); // Generalize this @@ -302,7 +302,7 @@ public class CostRemoveCounter extends CostPartWithList { } } - if (!this.isTargetingThis()) { + if (!this.payCostFromSource()) { this.getList().clear(); final List typeList = CardLists.getValidCards(ai.getCardsIn(this.getZone()), this.getType().split(";"), ai, source); diff --git a/src/main/java/forge/card/cost/CostReturn.java b/src/main/java/forge/card/cost/CostReturn.java index 6db2dacf98f..5849a50a64c 100644 --- a/src/main/java/forge/card/cost/CostReturn.java +++ b/src/main/java/forge/card/cost/CostReturn.java @@ -69,7 +69,7 @@ public class CostReturn extends CostPartWithList { final Integer i = this.convertAmount(); String pronoun = "its"; - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); } else { final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription(); @@ -97,7 +97,7 @@ public class CostReturn extends CostPartWithList { */ @Override public final boolean canPay(final SpellAbility ability, final Card source, final Player activator, final Cost cost, final GameState game) { - if (!this.isTargetingThis()) { + if (!this.payCostFromSource()) { boolean needsAnnoucement = ability.hasParam("Announce") && this.getType().contains(ability.getParam("Announce")); List typeList = new ArrayList(activator.getCardsIn(ZoneType.Battlefield)); @@ -149,7 +149,7 @@ public class CostReturn extends CostPartWithList { c = AbilityUtils.calculateAmount(source, amount, ability); } } - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { final Input inp = CostReturn.returnThis(ability, payment, this); Singletons.getModel().getMatch().getInput().setInputInterrupt(inp); } else { @@ -169,7 +169,7 @@ public class CostReturn extends CostPartWithList { @Override public final boolean decideAIPayment(final AIPlayer ai, final SpellAbility ability, final Card source, final CostPayment payment) { this.resetList(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { this.getList().add(source); } else { Integer c = this.convertAmount(); diff --git a/src/main/java/forge/card/cost/CostReveal.java b/src/main/java/forge/card/cost/CostReveal.java index 45c01505105..42060d82b55 100644 --- a/src/main/java/forge/card/cost/CostReveal.java +++ b/src/main/java/forge/card/cost/CostReveal.java @@ -71,7 +71,7 @@ public class CostReveal extends CostPartWithList { final String type = this.getType(); final Integer amount = this.convertAmount(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { if (!source.isInZone(ZoneType.Hand)) { return false; } @@ -105,7 +105,7 @@ public class CostReveal extends CostPartWithList { List hand = new ArrayList(ai.getCardsIn(ZoneType.Hand)); this.resetList(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { if (!hand.contains(source)) { return false; } @@ -155,7 +155,7 @@ public class CostReveal extends CostPartWithList { final String amount = this.getAmount(); this.resetList(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { this.addToList(source); payment.setPaidManaPart(this); } else if (this.getType().equals("Hand")) { @@ -199,7 +199,7 @@ public class CostReveal extends CostPartWithList { final Integer i = this.convertAmount(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); } else if (this.getType().equals("Hand")) { return ("Reveal you hand"); diff --git a/src/main/java/forge/card/cost/CostSacrifice.java b/src/main/java/forge/card/cost/CostSacrifice.java index 13ad15a9960..75d1994e5f1 100644 --- a/src/main/java/forge/card/cost/CostSacrifice.java +++ b/src/main/java/forge/card/cost/CostSacrifice.java @@ -67,7 +67,7 @@ public class CostSacrifice extends CostPartWithList { final Integer i = this.convertAmount(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { sb.append(this.getType()); } else { final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription(); @@ -90,7 +90,7 @@ public class CostSacrifice extends CostPartWithList { @Override public final boolean canPay(final SpellAbility ability, final Card source, final Player activator, final Cost cost, final GameState game) { // You can always sac all - if (!this.isTargetingThis()) { + if (!this.payCostFromSource()) { // If the sacrificed type is dependant on an annoucement, can't necesarily rule out the CanPlay call boolean needsAnnoucement = ability.hasParam("Announce") && this.getType().contains(ability.getParam("Announce")); @@ -154,7 +154,7 @@ public class CostSacrifice extends CostPartWithList { list = CardLists.getNotType(list, "Creature"); } - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { final Input inp = CostSacrifice.sacrificeThis(ability, payment, this); Singletons.getModel().getMatch().getInput().setInputInterrupt(inp); } else if (amount.equals("All")) { @@ -195,7 +195,7 @@ public class CostSacrifice extends CostPartWithList { public final boolean decideAIPayment(final AIPlayer ai, final SpellAbility ability, final Card source, final CostPayment payment) { this.resetList(); final Player activator = ability.getActivatingPlayer(); - if (this.isTargetingThis()) { + if (this.payCostFromSource()) { this.getList().add(source); } else if (this.getAmount().equals("All")) { /*List typeList = new ArrayList(activator.getCardsIn(ZoneType.Battlefield)); diff --git a/src/main/java/forge/card/spellability/SpellAbility.java b/src/main/java/forge/card/spellability/SpellAbility.java index 655fe32f10c..3b65184dc07 100644 --- a/src/main/java/forge/card/spellability/SpellAbility.java +++ b/src/main/java/forge/card/spellability/SpellAbility.java @@ -1701,7 +1701,8 @@ public abstract class SpellAbility implements ISpellAbility { String value = this.getActivatingPlayer().getController().announceRequirements(this, aVar); if (value == null || !StringUtils.isNumeric(value)) { return false; - } else if (this.getPayCosts().getCostMana().isxCantBe0() && Integer.parseInt(value) == 0) { + } else if (this.getPayCosts().getCostMana() != null && this.getPayCosts().getCostMana().isxCantBe0() + && Integer.parseInt(value) == 0) { return false; } this.setSVar(aVar, "Number$" + value); diff --git a/src/main/java/forge/game/ai/ComputerUtilCost.java b/src/main/java/forge/game/ai/ComputerUtilCost.java index d3871332f0b..5e0b6d9cf00 100644 --- a/src/main/java/forge/game/ai/ComputerUtilCost.java +++ b/src/main/java/forge/game/ai/ComputerUtilCost.java @@ -86,7 +86,7 @@ public class ComputerUtilCost { final CounterType type = remCounter.getCounter(); final double percent = type.name().equals("P1P1") ? p1p1Percent : otherPercent; final int currentNum = source.getCounters(type); - if (!part.isTargetingThis()) { + if (!part.payCostFromSource()) { if (type.name().equals("P1P1")) { return false; } @@ -224,7 +224,7 @@ public class ComputerUtilCost { for (final CostPart part : cost.getCostParts()) { if (part instanceof CostSacrifice) { final CostSacrifice sac = (CostSacrifice) part; - if (sac.isTargetingThis() && source.isCreature()) { + if (sac.payCostFromSource() && source.isCreature()) { return false; } final String type = sac.getType();