From f39e6e9fc3fd9587b246fc506c1478af6b995814 Mon Sep 17 00:00:00 2001 From: RedDeckWins Date: Sun, 19 May 2013 04:21:40 +0000 Subject: [PATCH] implement bronze horse. added IsTargetingSource property. --- .gitattributes | 1 + res/cardsfolder/b/bronze_horse.txt | 13 +++++++++++++ src/main/java/forge/Card.java | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 res/cardsfolder/b/bronze_horse.txt diff --git a/.gitattributes b/.gitattributes index a0c2a4d390b..84df1b92f61 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1348,6 +1348,7 @@ res/cardsfolder/b/broken_fall.txt svneol=native#text/plain res/cardsfolder/b/broken_visage.txt svneol=native#text/plain res/cardsfolder/b/brontotherium.txt -text res/cardsfolder/b/bronze_bombshell.txt -text +res/cardsfolder/b/bronze_horse.txt -text res/cardsfolder/b/bronzebeak_moa.txt -text res/cardsfolder/b/brood_birthing.txt svneol=native#text/plain res/cardsfolder/b/brood_of_cockroaches.txt svneol=native#text/plain diff --git a/res/cardsfolder/b/bronze_horse.txt b/res/cardsfolder/b/bronze_horse.txt new file mode 100644 index 00000000000..9c1fb61902c --- /dev/null +++ b/res/cardsfolder/b/bronze_horse.txt @@ -0,0 +1,13 @@ +Name:Bronze Horse +ManaCost:7 +Types:Artifact Creature Horse +PT:4/4 +K:Trample +S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ PreventAllDamageBy Spell.IsTargetingSource | CheckSVar$ X | SVarCompare$ GE1 | Description$ Prevent all damage that would be dealt to CARDNAME by spells that target it. +SVar:X:Count$Valid Creature.YouCtrl+Other +SVar:BuffedBy:Creature +SVar:Picture:http://www.wizards.com/global/images/magic/general/bronze_horse.jpg +Oracle:Trample\nAs long as you control another creature, prevent all damage that would be dealt to Bronze Horse by spells that target it. +SetInfo:LEG Rare +SetInfo:CHN Rare +SetInfo:TSB Uncommon \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index e428b416123..098e8f2ca20 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -5615,6 +5615,18 @@ public class Card extends GameEntity implements Comparable { if (!this.dealtDamageToThisTurn.containsKey(source)) { return false; } + } else if (property.startsWith("IsTargetingSource")) { + for (final SpellAbility sa : this.getCharacteristics().getSpellAbility()) { + final SpellAbility saTargeting = sa.getSATargetingCard(); + if (saTargeting != null) { + for (final Card c : saTargeting.getTarget().getTargetCards()) { + if (c.equals(source)) { + return true; + } + } + } + } + return false; } else if (property.startsWith("SharesColorWith")) { if (property.equals("SharesColorWith")) { if (!this.sharesColorWith(source)) {