diff --git a/.gitattributes b/.gitattributes index bdaf30bc1a1..1957e63d05e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1308,6 +1308,7 @@ res/cardsfolder/c/cancel.txt svneol=native#text/plain res/cardsfolder/c/candelabra_of_tawnos.txt svneol=native#text/plain res/cardsfolder/c/candles_of_leng.txt -text svneol=unset#text/plain res/cardsfolder/c/canker_abomination.txt svneol=native#text/plain +res/cardsfolder/c/cankerous_thirst.txt -text res/cardsfolder/c/canopy_claws.txt svneol=native#text/plain res/cardsfolder/c/canopy_cover.txt svneol=native#text/plain res/cardsfolder/c/canopy_dragon.txt svneol=native#text/plain diff --git a/res/cardsfolder/c/cankerous_thirst.txt b/res/cardsfolder/c/cankerous_thirst.txt new file mode 100644 index 00000000000..c1310aedee6 --- /dev/null +++ b/res/cardsfolder/c/cankerous_thirst.txt @@ -0,0 +1,11 @@ +Name:Cankerous Thirst +ManaCost:3 BG +Types:Instant +Text:no text +A:SP$ Pump | Cost$ 3 BG | ValidTgts$ Creature | TgtPrompt$ Select target creature to get -3/-3 | Optional$ True | OptionQuestion$ Do you want TARGETS to get -3/-3? | NumAtt$ -3 | NumDef$ -3 | IsCurse$ True | ConditionManaSpent$ B | SubAbility$ GPaid | SpellDescription$ If B was spent to cast CARDNAME, you may have target creature get -3/-3 until end of turn. If G was spent to cast CARDNAME, you may have target creature get +3/+3 until end of turn. (Do both if B G was spent.) +SVar:GPaid:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature to get +3/+3 | Optional$ True | OptionQuestion$ Do you want TARGETS to get +3/+3? | NumAtt$ 3 | NumDef$ 3 | ConditionManaSpent$ G +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/cankerous_thirst.jpg +SetInfo:EVE|Uncommon|http://magiccards.info/scans/en/eve/116.jpg +Oracle:If {B} was spent to cast Cankerous Thirst, you may have target creature get -3/-3 until end of turn. If {G} was spent to cast Cankerous Thirst, you may have target creature get +3/+3 until end of turn. (Do both if {B}{G} was spent.) +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java index 390949218c2..839f8bcbcf5 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java @@ -30,6 +30,7 @@ import forge.CardListFilter; import forge.CardListUtil; import forge.CardUtil; import forge.Command; +import forge.GameActionUtil; import forge.GameEntity; import forge.Singletons; import forge.card.cardfactory.CardFactoryUtil; @@ -600,7 +601,7 @@ public class AbilityFactoryPump { return true; } CardList blockedBy = AllZone.getCombat().getAttackersBlockedBy(c); - // For now, Only care the first creature blocked by a card. + // For now, Only care the first creature blocked by a card. // TODO Add in better BlockAdditional support if (blockedBy.size() != 0 && !CombatUtil.attackerWouldBeDestroyed(blockedBy.get(0))) { return true; @@ -625,10 +626,10 @@ public class AbilityFactoryPump { // if the life of the computer is in danger, try to pump blockers blocking Tramplers CardList blockedBy = AllZone.getCombat().getAttackersBlockedBy(c); boolean attackerHasTrample = false; - for(Card b : blockedBy) { + for (Card b : blockedBy) { attackerHasTrample |= b.hasKeyword("Trample"); } - + if (phase.getPhase().equals(PhaseType.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY) && phase.isPlayerTurn(AllZone.getHumanPlayer()) && c.isBlocking() @@ -784,7 +785,7 @@ public class AbilityFactoryPump { if (!CostUtil.checkRemoveCounterCost(cost, sa.getSourceCard())) { return false; } - + if (AllZone.getStack().isEmpty() && CostUtil.hasTapCost(cost, sa.getSourceCard())) { if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS) && ph.isPlayerTurn(AllZone.getComputerPlayer())) { return false; @@ -889,12 +890,12 @@ public class AbilityFactoryPump { if (!this.pumpTgtAI(sa, defense, attack, false)) { return false; } - + final AbilitySub subAb = sa.getSubAbility(); if (subAb != null && !subAb.chkAIDrawback()) { return false; } - + return true; } // pumpPlayAI() @@ -1208,7 +1209,7 @@ public class AbilityFactoryPump { if (!this.pumpTgtAI(sa, defense, attack, false)) { return false; } - + final AbilitySub subAb = sa.getSubAbility(); if (subAb != null && !subAb.chkAIDrawback()) { return false; @@ -1328,6 +1329,7 @@ public class AbilityFactoryPump { final Target tgt = sa.getTarget(); ArrayList tgtPlayers = new ArrayList(); String pumpRemembered = null; + if (tgt != null) { tgtCards = tgt.getTargetCards(); tgtPlayers = tgt.getTargetPlayers(); @@ -1340,6 +1342,27 @@ public class AbilityFactoryPump { } } + if (this.params.containsKey("Optional")) { + if (sa.getActivatingPlayer().isHuman()) { + final StringBuilder targets = new StringBuilder(); + for (final Card tc : tgtCards) { + targets.append(tc); + } + final StringBuilder sb = new StringBuilder(); + final String descBasic = "Apply pump to " + targets + "?"; + final String pumpDesc = params.containsKey("OptionQuestion") + ? params.get("OptionQuestion").replace("TARGETS", targets) : descBasic; + sb.append(pumpDesc); + if (!GameActionUtil.showYesNoDialog(sa.getSourceCard(), sb.toString())) { + return; + } + } else { //Computer player + //TODO Add logic here if necessary but I think the AI won't cast + //the spell in the first place if it would curse its own creature + //and the pump isn't mandatory + } + } + if (this.params.containsKey("RememberObjects")) { pumpRemembered = params.get("RememberObjects"); }