diff --git a/.gitattributes b/.gitattributes index f725daa236f..1264ae5597a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2979,6 +2979,7 @@ res/cardsfolder/rotting_rats.txt -text svneol=native#text/plain res/cardsfolder/roughshod_mentor.txt -text svneol=native#text/plain res/cardsfolder/rowan_treefolk.txt -text svneol=native#text/plain res/cardsfolder/royal_assassin.txt -text svneol=native#text/plain +res/cardsfolder/royal_decree.txt -text svneol=native#text/plain res/cardsfolder/royal_falcon.txt -text svneol=native#text/plain res/cardsfolder/rubinia_soulsinger.txt -text svneol=native#text/plain res/cardsfolder/ruby_leech.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/royal_decree.txt b/res/cardsfolder/royal_decree.txt new file mode 100644 index 00000000000..f2d7b8eda45 --- /dev/null +++ b/res/cardsfolder/royal_decree.txt @@ -0,0 +1,8 @@ +Name:Royal Decree +ManaCost:2 W W +Types:Enchantment +Text:Whenever a Swamp, Mountain, black permanent, or red permanent becomes tapped, Royal Decree deals 1 damage to that permanent's controller. +K:Cumulative upkeep:W +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/royal_decree.jpg +End \ No newline at end of file diff --git a/src/forge/Card.java b/src/forge/Card.java index c13c495bbd5..d7188d2efef 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -2183,5 +2183,30 @@ public class Card extends MyObservable { public boolean isImmutable() { return isImmutable; } + + /* + * there are easy checkers for Color. The CardUtil functions should + * be made part of the Card class, so calling out is not necessary + */ + + public boolean isBlack() { + return CardUtil.getColors(this).contains(Constant.Color.Black); + } + + public boolean isBlue() { + return CardUtil.getColors(this).contains(Constant.Color.Blue); + } + + public boolean isRed() { + return CardUtil.getColors(this).contains(Constant.Color.Red); + } + + public boolean isGreen() { + return CardUtil.getColors(this).contains(Constant.Color.Green); + } + + public boolean isWhite() { + return CardUtil.getColors(this).contains(Constant.Color.White); + } } diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 0cffad6840d..d70f09d3cfe 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -257,6 +257,28 @@ public class GameActionUtil { } } }//end Spirit Shackle + + /* + * Royal Decree - Whenever a Swamp, Mountain, black permanent, or red + * permanent becomes tapped, Royal Decree deals 1 damage to that + * permanent's controller. + */ + if(c.getType().contains("Mountain") || c.getType().contains("Swamp") || + (c.isPermanent() && (c.isRed() || c.isBlack()))) { + final CardList decrees = AllZoneUtil.getCardsInPlay("Royal Decree"); + for(Card decree:decrees) { + final Card crd = decree; + final Card source = c; + Ability ability = new Ability(decree, "0") { + @Override + public void resolve() { + AllZone.GameAction.addDamage(source.getController(), crd, 1); + } + };//Ability + ability.setStackDescription(decree.getName()+" - does 1 damage to "+c.getController()+". ("+c.getName()+" was tapped.)"); + AllZone.Stack.add(ability); + }//for + } }//end executeTapSideEffects()