diff --git a/.gitattributes b/.gitattributes index 504fdd56bc9..d9accd52fed 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1793,9 +1793,14 @@ res/cardsfolder/c/crovax_ascendant_hero.txt svneol=native#text/plain res/cardsfolder/c/crovax_the_cursed.txt -text svneol=unset#text/plain res/cardsfolder/c/crowd_favorites.txt svneol=native#text/plain res/cardsfolder/c/crowd_of_cinders.txt svneol=native#text/plain +res/cardsfolder/c/crown_of_ascension.txt -text +res/cardsfolder/c/crown_of_awe.txt -text res/cardsfolder/c/crown_of_convergence.txt -text svneol=unset#text/plain res/cardsfolder/c/crown_of_empires.txt -text res/cardsfolder/c/crown_of_flames.txt svneol=native#text/plain +res/cardsfolder/c/crown_of_fury.txt -text +res/cardsfolder/c/crown_of_suspicion.txt -text +res/cardsfolder/c/crown_of_vigor.txt -text res/cardsfolder/c/crucible_of_fire.txt svneol=native#text/plain res/cardsfolder/c/crucible_of_worlds.txt svneol=native#text/plain res/cardsfolder/c/crude_rampart.txt svneol=native#text/plain diff --git a/res/cardsfolder/c/crown_of_ascension.txt b/res/cardsfolder/c/crown_of_ascension.txt new file mode 100644 index 00000000000..866eeca297e --- /dev/null +++ b/res/cardsfolder/c/crown_of_ascension.txt @@ -0,0 +1,14 @@ +Name:Crown of Ascension +ManaCost:1 U +Types:Enchantment Aura +Text:no text +K:Enchant creature +A:SP$ Attach | Cost$ 1 U | ValidTgts$ Creature | AILogic$ Pump +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Flying | Description$ Enchanted creature has flying. +A:AB$ PumpAll | Cost$ Sac<1/CARDNAME> | ValidCards$ Creature.sharesCreatureTypeWith Enchanted | KW$ Flying | SpellDescription$ Enchanted creature and other creatures that share a creature type with it gain flying until end of turn. +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_ascension.jpg +SetInfo:ONS|Common|http://magiccards.info/scans/en/on/78.jpg +Oracle:Enchant creature\nEnchanted creature has flying.\nSacrifice Crown of Ascension: Enchanted creature and other creatures that share a creature type with it gain flying until end of turn. +End \ No newline at end of file diff --git a/res/cardsfolder/c/crown_of_awe.txt b/res/cardsfolder/c/crown_of_awe.txt new file mode 100644 index 00000000000..8e37cbdc168 --- /dev/null +++ b/res/cardsfolder/c/crown_of_awe.txt @@ -0,0 +1,14 @@ +Name:Crown of Awe +ManaCost:1 W +Types:Enchantment Aura +Text:no text +K:Enchant creature +A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Pump +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Protection from black & Protection from red | Description$ Enchanted creature has protection from black and from red. +A:AB$ PumpAll | Cost$ Sac<1/CARDNAME> | ValidCards$ Creature.sharesCreatureTypeWith Enchanted | KW$ Protection from black & Protection from red | SpellDescription$ Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn. +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_awe.jpg +SetInfo:ONS|Common|http://magiccards.info/scans/en/on/16.jpg +Oracle:Enchant creature\nEnchanted creature has protection from black and from red.\nSacrifice Crown of Awe: Enchanted creature and other creatures that share a creature type with it gain protection from black and from red until end of turn. +End \ No newline at end of file diff --git a/res/cardsfolder/c/crown_of_fury.txt b/res/cardsfolder/c/crown_of_fury.txt new file mode 100644 index 00000000000..baf0c94cea0 --- /dev/null +++ b/res/cardsfolder/c/crown_of_fury.txt @@ -0,0 +1,14 @@ +Name:Crown of Fury +ManaCost:1 R +Types:Enchantment Aura +Text:no text +K:Enchant creature +A:SP$ Attach | Cost$ 1 R | ValidTgts$ Creature | AILogic$ Pump +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 1 | AddKeyword$ First Strike | Description$ Enchanted creature gets +1/+0 and has first strike. +A:AB$ PumpAll | Cost$ Sac<1/CARDNAME> | ValidCards$ Creature.sharesCreatureTypeWith Enchanted | NumAtt$ 1 | KW$ First Strike | SpellDescription$ Enchanted creature and other creatures that share a creature type with it get +1/+0 and gain first strike until end of turn. +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_fury.jpg +SetInfo:ONS|Common|http://magiccards.info/scans/en/on/196.jpg +Oracle:Enchant creature\nEnchanted creature gets +1/+0 and has first strike.\nSacrifice Crown of Fury: Enchanted creature and other creatures that share a creature type with it get +1/+0 and gain first strike until end of turn. +End \ No newline at end of file diff --git a/res/cardsfolder/c/crown_of_suspicion.txt b/res/cardsfolder/c/crown_of_suspicion.txt new file mode 100644 index 00000000000..c9d91e51e86 --- /dev/null +++ b/res/cardsfolder/c/crown_of_suspicion.txt @@ -0,0 +1,14 @@ +Name:Crown of Suspicion +ManaCost:1 B +Types:Enchantment Aura +Text:no text +K:Enchant creature +A:SP$ Attach | Cost$ 1 B | ValidTgts$ Creature | AILogic$ Pump +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 2 | AddToughness$ -1 | Description$ Enchanted creature gets +2/-1. +A:AB$ PumpAll | Cost$ Sac<1/CARDNAME> | ValidCards$ Creature.sharesCreatureTypeWith Enchanted | NumAtt$ 2 | NumDef$ -1 | SpellDescription$ Enchanted creature and other creatures that share a creature type with it get +2/-1 until end of turn. +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_suspicion.jpg +SetInfo:ONS|Common|http://magiccards.info/scans/en/on/134.jpg +Oracle:Enchant creature\nEnchanted creature gets +2/-1.\nSacrifice Crown of Suspicion: Enchanted creature and other creatures that share a creature type with it get +2/-1 until end of turn. +End \ No newline at end of file diff --git a/res/cardsfolder/c/crown_of_vigor.txt b/res/cardsfolder/c/crown_of_vigor.txt new file mode 100644 index 00000000000..f8671f5aad5 --- /dev/null +++ b/res/cardsfolder/c/crown_of_vigor.txt @@ -0,0 +1,14 @@ +Name:Crown of Vigor +ManaCost:1 G +Types:Enchantment Aura +Text:no text +K:Enchant creature +A:SP$ Attach | Cost$ 1 G | ValidTgts$ Creature | AILogic$ Pump +S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 1 | AddToughness$ 1 | Description$ Enchanted creature gets +1/+1. +A:AB$ PumpAll | Cost$ Sac<1/CARDNAME> | ValidCards$ Creature.sharesCreatureTypeWith Enchanted | NumAtt$ 1 | NumDef$ 1 | SpellDescription$ Enchanted creature and other creatures that share a creature type with it get +1/+1 until end of turn. +SVar:RemAIDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/crown_of_vigor.jpg +SetInfo:ONS|Common|http://magiccards.info/scans/en/on/253.jpg +Oracle:Enchant creature\nEnchanted creature gets +1/+1.\nSacrifice Crown of Vigor: Enchanted creature and other creatures that share a creature type with it get +1/+1 until end of turn. +End \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 326c6b7d2bf..0487317b0d4 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -69,7 +69,7 @@ public class Card extends GameEntity implements Comparable { private long value; - private final Map characteristicsMap + private final Map characteristicsMap = new EnumMap(CardCharactersticName.class); private CardCharactersticName curCharacteristics = CardCharactersticName.Original; private CardCharactersticName preTFDCharacteristic = CardCharactersticName.Original; @@ -224,7 +224,7 @@ public class Card extends GameEntity implements Comparable { // this code presumes that each card only has one ability that can be // used a limited number of times per turn // CardFactory.SSP_canPlay(Card) uses these variables - + // Only used with Replicate private int abilityUsed; @@ -247,20 +247,20 @@ public class Card extends GameEntity implements Comparable { if (state == CardCharactersticName.FaceDown && this.isDoubleFaced) { return false; // Doublefaced cards can't be turned face-down. } - + if (!this.characteristicsMap.containsKey(state)) { System.out.println(this.getName() + " tried to switch to non-existant state \"" + state + "\"!"); return false; // Nonexistant state. } - + if (state.equals(this.curCharacteristics)) { return false; } - + CardCharactersticName cur = this.curCharacteristics; - + this.curCharacteristics = state; - + if ((cur == CardCharactersticName.Original && state == CardCharactersticName.Transformed) || (cur == CardCharactersticName.Transformed && state == CardCharactersticName.Original)) { HashMap runParams = new HashMap(); @@ -268,7 +268,7 @@ public class Card extends GameEntity implements Comparable { runParams.put("Transformer", this); AllZone.getTriggerHandler().runTrigger(TriggerType.Transformed, runParams); } - + return true; } @@ -324,7 +324,7 @@ public class Card extends GameEntity implements Comparable { this.preTFDCharacteristic = this.curCharacteristics; return this.setState(CardCharactersticName.FaceDown); } - + return false; } @@ -337,7 +337,7 @@ public class Card extends GameEntity implements Comparable { if (this.curCharacteristics == CardCharactersticName.FaceDown) { return this.setState(this.preTFDCharacteristic); } - + return false; } @@ -6572,6 +6572,19 @@ public class Card extends GameEntity implements Comparable { if (list.isEmpty() || !this.sharesCreatureTypeWith(list.get(0))) { return false; } + } if (restriction.equals("Enchanted")) { + for (final SpellAbility sa : source.getCharacteristics().getSpellAbility()) { + final SpellAbility root = AbilityFactory.findRootAbility(sa); + Card c = source.getEnchantingCard(); + if ((c == null) && (root != null) + && (root.getPaidList("Sacrificed") != null) + && !root.getPaidList("Sacrificed").isEmpty()) { + c = root.getPaidList("Sacrificed").get(0).getEnchantingCard(); + if (!this.sharesCreatureTypeWith(c)) { + return false; + } + } + } } else { boolean shares = false; for (final Card card : sourceController.getCardsIn(Constant.Zone.Battlefield)) {