diff --git a/.gitattributes b/.gitattributes index 6626a3b897b..08e7cbefc49 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5322,6 +5322,7 @@ res/cardsfolder/traproot_kami.txt -text svneol=native#text/plain res/cardsfolder/trash_for_treasure.txt -text svneol=native#text/plain res/cardsfolder/traumatic_visions.txt -text svneol=native#text/plain res/cardsfolder/traumatize.txt -text svneol=native#text/plain +res/cardsfolder/treacherous_link.txt -text svneol=native#text/plain res/cardsfolder/treachery.txt -text svneol=native#text/plain res/cardsfolder/treasure_hunter.txt -text svneol=native#text/plain res/cardsfolder/treasure_trove.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/torture.txt b/res/cardsfolder/torture.txt index b9c80932443..7916a05c72f 100644 --- a/res/cardsfolder/torture.txt +++ b/res/cardsfolder/torture.txt @@ -3,7 +3,7 @@ ManaCost:B Types:Enchantment Aura Text:no text K:Enchant creature -K:enPump:+0/+0 +K:enPumpCurse:+0/+0 A:AB$PutCounter | Cost$ 1 B | Defined$ Enchanted | CounterType$ M1M1 | CounterNum$ 1 | SpellDescription$ Put a -1/-1 counter on enchanted creature. SVar:RemAIDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/treacherous_link.txt b/res/cardsfolder/treacherous_link.txt new file mode 100644 index 00000000000..c6481b379f9 --- /dev/null +++ b/res/cardsfolder/treacherous_link.txt @@ -0,0 +1,10 @@ +Name:Treacherous Link +ManaCost:1 B +Types:Enchantment Aura +Text:All damage that would be dealt to enchanted creature is dealt to its controller instead. +K:Enchant creature +K:enPumpCurse:+0/+0 +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/treacherous_link.jpg +End \ No newline at end of file diff --git a/src/forge/AIPlayer.java b/src/forge/AIPlayer.java index ed69a1a91e8..3bae0e85e7c 100644 --- a/src/forge/AIPlayer.java +++ b/src/forge/AIPlayer.java @@ -227,10 +227,7 @@ public class AIPlayer extends Player{ public void sacrificePermanent(String prompt, CardList choices) { if(choices.size() > 0) { //TODO - this could probably use better AI - CardListUtil.sortDefense(choices); - choices.reverse(); - CardListUtil.sortAttackLowFirst(choices); - Card c = choices.get(0); + Card c = CardFactoryUtil.AI_getWorstPermanent(choices,false,false,false,false); AllZone.GameAction.sacrificeDestroy(c); } } diff --git a/src/forge/Card.java b/src/forge/Card.java index c472de9dfc0..96b4aa8d686 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -3005,7 +3005,7 @@ public class Card extends MyObservable { restDamage -= 1; } - if( AllZoneUtil.isCardInPlay("Divine Presence") && restDamage > 3) { + if( AllZoneUtil.isCardInPlay("Divine Presence") && isCreature() && restDamage > 3) { restDamage = 3; } @@ -3020,12 +3020,18 @@ public class Card extends MyObservable { public int replaceDamage(final int damage, Card source, boolean isCombat) { int restDamage = damage; + CardList auras = new CardList(getEnchantedBy().toArray()); if(getName().equals("Phytohydra")) { addCounter(Counters.P1P1, restDamage); return 0; } + if(auras.containsName("Treacherous Link")) { + getController().addDamage(restDamage, source); + return 0; + } + restDamage = staticReplaceDamage(restDamage, source, isCombat); if(getName().equals("Lichenthrope")) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index cde7581c6bd..bca6cba9fa2 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -5942,6 +5942,32 @@ public class GameActionUtil { playerDamage_Farsight_Mask(player, c, crd); } + if(AllZoneUtil.isCardInPlay("Lich", player)) { + CardList lichs = playerPerms.getName("Lich"); + for(Card crd:lichs) { + final Card lich = crd; + SpellAbility ability = new Ability(lich, "0") { + public void resolve() { + for(int i = 0; i < damage; i++) { + CardList nonTokens = AllZoneUtil.getPlayerCardsInPlay(player); + nonTokens = nonTokens.filter(AllZoneUtil.nonToken); + if(nonTokens.size() == 0) { + player.altLoseConditionMet("Lich"); + } + else player.sacrificePermanent("Select a permanent to sacrifice", nonTokens); + } + } + }; + + StringBuilder sb = new StringBuilder(); + sb.append(lich.getName()).append(" - ").append(lich.getController()); + sb.append(" sacrifices ").append(damage).append(" nontoken Permanents."); + ability.setStackDescription(sb.toString()); + + AllZone.Stack.add(ability); + } + } + if(c.getKeyword().contains("Whenever this creature deals damage to a player, that player gets a poison counter.")) playerCombatDamage_PoisonCounter(c, 1); diff --git a/src/forge/Player.java b/src/forge/Player.java index b29f25950fa..1f204643549 100644 --- a/src/forge/Player.java +++ b/src/forge/Player.java @@ -229,16 +229,6 @@ public abstract class Player extends MyObservable{ if(PlayerUtil.worshipFlag(this) && life <= damageToDo) { damageToDo = Math.min(damageToDo, life - 1); } - if(AllZoneUtil.isCardInPlay("Lich", this)) { - for(int i = 0; i < damageToDo; i++) { - CardList nonTokens = AllZoneUtil.getPlayerCardsInPlay(this); - nonTokens = nonTokens.filter(AllZoneUtil.nonToken); - if(nonTokens.size() == 0) { - this.altLoseConditionMet("Lich"); - } - else sacrificePermanent("Select a permanent to sacrifice", nonTokens); - } - } //rule 118.2. Damage dealt to a player normally causes that player to lose that much life. loseLife(damageToDo, source); }