diff --git a/.gitattributes b/.gitattributes index 96403e6e130..e222be7aa69 100644 --- a/.gitattributes +++ b/.gitattributes @@ -117,6 +117,7 @@ res/cardsfolder/alexis_cloak.txt -text svneol=native#text/plain res/cardsfolder/algae_gharial.txt -text svneol=native#text/plain res/cardsfolder/ali_baba.txt -text svneol=native#text/plain res/cardsfolder/ali_from_cairo.txt -text svneol=native#text/plain +res/cardsfolder/alibans_tower.txt -text svneol=native#text/plain res/cardsfolder/all_hallows_eve.txt -text svneol=native#text/plain res/cardsfolder/all_is_dust.txt -text svneol=native#text/plain res/cardsfolder/allay.txt -text svneol=native#text/plain @@ -2496,6 +2497,7 @@ res/cardsfolder/karplusan_forest.txt -text svneol=native#text/plain res/cardsfolder/karplusan_giant.txt -text svneol=native#text/plain res/cardsfolder/karplusan_strider.txt -text svneol=native#text/plain res/cardsfolder/karplusan_wolverine.txt -text svneol=native#text/plain +res/cardsfolder/kashi_tribe_warriors.txt -text svneol=native#text/plain res/cardsfolder/kasimir_the_lone_wolf.txt -text svneol=native#text/plain res/cardsfolder/kataki_wars_wage.txt -text svneol=native#text/plain res/cardsfolder/kathari_remnant.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/alibans_tower.txt b/res/cardsfolder/alibans_tower.txt new file mode 100644 index 00000000000..5a1a16f92b8 --- /dev/null +++ b/res/cardsfolder/alibans_tower.txt @@ -0,0 +1,9 @@ +Name:Aliban's Tower +ManaCost:1 R +Types:Instant +Text:no text +A:SP$Pump | Cost$ 1 R | ValidTgts$ Creature.blocking | TgtPrompt$ Select target blocking creature | NumAtt$ +3 | NumDef$ +1 | SpellDescription$ Target blocking creature gets +3/+1 until end of turn. +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/alibans_tower.jpg +End diff --git a/res/cardsfolder/chub_toad.txt b/res/cardsfolder/chub_toad.txt index 54fedd61e56..e29f89b46c1 100644 --- a/res/cardsfolder/chub_toad.txt +++ b/res/cardsfolder/chub_toad.txt @@ -1,7 +1,7 @@ Name:Chub Toad ManaCost:2 G Types:Creature Toad -Text:No text. +Text:No text PT:1/1 K:Bushido 2 SVar:Rarity:Common diff --git a/res/cardsfolder/kashi_tribe_warriors.txt b/res/cardsfolder/kashi_tribe_warriors.txt new file mode 100644 index 00000000000..4a68febe6aa --- /dev/null +++ b/res/cardsfolder/kashi_tribe_warriors.txt @@ -0,0 +1,9 @@ +Name:Kashi-Tribe Warriors +ManaCost:3 G G +Types:Snow Creature Snake Warrior +Text:no text +PT:2/4 +K:Whenever CARDNAME deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step. +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/kashi_tribe_warriors.jpg +End diff --git a/src/forge/Card.java b/src/forge/Card.java index edfcc7bb711..1f493cb2c91 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -2690,53 +2690,10 @@ public class Card extends MyObservable { damageToAdd = preventDamage(damageToAdd, source, true); - if (damageToAdd > 0) { - if(isCreature() && source.getName().equals("Mirri the Cursed") ) { - final Card thisCard = source; - Ability ability2 = new Ability(thisCard, "0") { - @Override - public void resolve() { - thisCard.addCounter(Counters.P1P1, 1); - } - }; // ability2 - - StringBuilder sb2 = new StringBuilder(); - sb2.append(thisCard.getName()).append(" - gets a +1/+1 counter"); - ability2.setStackDescription(sb2.toString()); - - AllZone.Stack.add(ability2); - } - - /* - if(source.getKeyword().contains("Deathtouch") && isCreature()) { - AllZone.GameAction.destroy(this); - }*/ - - if(isCreature() - && source.hasKeyword("Whenever CARDNAME deals combat damage to a creature, destroy that creature at end of combat.")) - { - final Card damagedCard = this; - final Ability ability = new Ability(source, "0") { - @Override - public void resolve() { AllZone.GameAction.destroy(damagedCard); } - }; - - StringBuilder sb = new StringBuilder(); - sb.append(source).append(" - destroy damaged creature."); - ability.setStackDescription(sb.toString()); - - final Command atEOC = new Command() { - private static final long serialVersionUID = 3789617910009764326L; - - public void execute() { - if(AllZone.GameAction.isCardInPlay(damagedCard)) - AllZone.Stack.add(ability); - } - }; - - AllZone.EndOfCombat.addAt(atEOC); - }//Whenever CARDNAME deals combat damage to a creature, destroy that creature at end of combat. - } + if( damageToAdd == 0 ) return; //Rule 119.8 + + GameActionUtil.executeCombatDamageToCreatureEffects(source, this, damageToAdd); + map.put(source, damageToAdd); } diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index b03a9530ed7..5ca93b0425b 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -5363,6 +5363,70 @@ public class GameActionUtil { } } + //not restricted to combat damage and dealing damage to creatures + public static void executeCombatDamageToCreatureEffects(final Card source, final Card affected, int damage) { + + if(source.getKeyword().contains("Whenever CARDNAME deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step.")) { + + Ability ability = new Ability(affected, "0") { + @Override + public void resolve() { + affected.tap(); + affected.addExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step."); + } + }; + StringBuilder sb = new StringBuilder(); + sb.append(affected.getName()+" - tap"); + ability.setStackDescription(sb.toString()); + int amount = source.getAmountOfKeyword("Whenever CARDNAME deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step."); + + for(int i=0 ; i < amount ; i++) + AllZone.Stack.add(ability); + } + + if(source.getName().equals("Mirri the Cursed") ) { + final Card thisCard = source; + Ability ability2 = new Ability(thisCard, "0") { + @Override + public void resolve() { + thisCard.addCounter(Counters.P1P1, 1); + } + }; // ability2 + + StringBuilder sb2 = new StringBuilder(); + sb2.append(thisCard.getName()).append(" - gets a +1/+1 counter"); + ability2.setStackDescription(sb2.toString()); + + AllZone.Stack.add(ability2); + } + + + if( source.hasKeyword("Whenever CARDNAME deals combat damage to a creature, destroy that creature at end of combat.")) { + final Card damagedCard = affected; + final Ability ability = new Ability(source, "0") { + @Override + public void resolve() { AllZone.GameAction.destroy(damagedCard); } + }; + + StringBuilder sb = new StringBuilder(); + sb.append(source).append(" - destroy damaged creature."); + ability.setStackDescription(sb.toString()); + + final Command atEOC = new Command() { + private static final long serialVersionUID = 3789617910009764326L; + + public void execute() { + if(AllZone.GameAction.isCardInPlay(damagedCard)) AllZone.Stack.add(ability); + } + }; + int amount = source.getAmountOfKeyword("Whenever CARDNAME deals combat damage to a creature, destroy that creature at end of combat."); + + for(int i=0 ; i < amount ; i++) + AllZone.EndOfCombat.addAt(atEOC); + }//Whenever CARDNAME deals combat damage to a creature, destroy that creature at end of combat. + } + + //not restricted to combat damage, restricted to dealing damage to creatures public static void executeDamageToCreatureEffects(final Card source, final Card affected, int damage) { diff --git a/src/forge/PhaseUtil.java b/src/forge/PhaseUtil.java index 9049f668950..ecb4d02cb81 100644 --- a/src/forge/PhaseUtil.java +++ b/src/forge/PhaseUtil.java @@ -128,7 +128,10 @@ public class PhaseUtil { && !c.getKeyword().contains("This card doesn't untap during your next untap step.")) { c.untap(); } - else c.removeExtrinsicKeyword("This card doesn't untap during your next untap step."); + else { + c.removeExtrinsicKeyword("This card doesn't untap during your next untap step."); + c.removeExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step."); + } } if( canOnlyUntapOneLand()) { if( AllZone.Phase.getPlayerTurn().equals(AllZone.ComputerPlayer)) {