diff --git a/.gitattributes b/.gitattributes index 1c7c5d5e4d4..7b977463538 100644 --- a/.gitattributes +++ b/.gitattributes @@ -292,6 +292,7 @@ res/cardsfolder/armed_response.txt -text svneol=native#text/plain res/cardsfolder/armillary_sphere.txt -text svneol=native#text/plain res/cardsfolder/armistice.txt -text svneol=native#text/plain res/cardsfolder/armor_of_faith.txt -text svneol=native#text/plain +res/cardsfolder/armor_sliver.txt -text svneol=native#text/plain res/cardsfolder/armor_thrull.txt -text svneol=native#text/plain res/cardsfolder/armored_ascension.txt -text svneol=native#text/plain res/cardsfolder/armored_cancrix.txt -text svneol=native#text/plain @@ -448,6 +449,7 @@ res/cardsfolder/barbary_apes.txt -text svneol=native#text/plain res/cardsfolder/barbed_battlegear.txt -text svneol=native#text/plain res/cardsfolder/barbed_lightning.txt svneol=native#text/plain res/cardsfolder/barbed_sextant.txt -text svneol=native#text/plain +res/cardsfolder/barbed_sliver.txt -text svneol=native#text/plain res/cardsfolder/barbtooth_wurm.txt -text svneol=native#text/plain res/cardsfolder/bargain.txt -text svneol=native#text/plain res/cardsfolder/barkhide_mauler.txt -text svneol=native#text/plain @@ -1008,6 +1010,7 @@ res/cardsfolder/clock_of_omens.txt -text svneol=native#text/plain res/cardsfolder/clockwork_gnomes.txt -text svneol=native#text/plain res/cardsfolder/clone.txt -text svneol=native#text/plain res/cardsfolder/close_quarters.txt -text svneol=native#text/plain +res/cardsfolder/clot_sliver.txt -text svneol=native#text/plain res/cardsfolder/cloud_crusader.txt -text svneol=native#text/plain res/cardsfolder/cloud_djinn.txt -text svneol=native#text/plain res/cardsfolder/cloud_dragon.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/armor_sliver.txt b/res/cardsfolder/armor_sliver.txt new file mode 100644 index 00000000000..52449505265 --- /dev/null +++ b/res/cardsfolder/armor_sliver.txt @@ -0,0 +1,12 @@ +Name:Armor Sliver +ManaCost:2 W +Types:Creature Sliver +Text:no text +PT:2/2 +K:stPumpAll:Creature.Sliver:0/0/ABSVar=Pump:no Condition:All Sliver creatures have "2: This creature gets +0/+1 until end of turn." +SVar:Pump:AB$Pump | Cost$ 2 | NumDef$ +1 | SpellDescription$ CARDNAME gets +0/+1 until end of turn. +SVar:PlayMain1:TRUE +SVar:BuffedBy:Sliver +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/armor_sliver.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/barbed_sliver.txt b/res/cardsfolder/barbed_sliver.txt new file mode 100644 index 00000000000..5c962f72cf5 --- /dev/null +++ b/res/cardsfolder/barbed_sliver.txt @@ -0,0 +1,12 @@ +Name:Barbed Sliver +ManaCost:2 R +Types:Creature Sliver +Text:no text +PT:2/2 +K:stPumpAll:Creature.Sliver:0/0/ABSVar=Pump:no Condition:All Sliver creatures have "2: This creature gets +1/+0 until end of turn." +SVar:Pump:AB$Pump | Cost$ 2 | NumAtt$ +1 | SpellDescription$ CARDNAME gets +0/+1 until end of turn. +SVar:PlayMain1:TRUE +SVar:BuffedBy:Sliver +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/barbed_sliver.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/clot_sliver.txt b/res/cardsfolder/clot_sliver.txt new file mode 100644 index 00000000000..072efb30929 --- /dev/null +++ b/res/cardsfolder/clot_sliver.txt @@ -0,0 +1,12 @@ +Name:Clot Sliver +ManaCost:1 B +Types:Creature Sliver +Text:no text +PT:1/1 +K:stPumpAll:Sliver:0/0/ABSVar=Pump:no Condition:All Slivers have "2: Regenerate this permanent." +SVar:Pump:AB$Regenerate | Cost$ 2 | SpellDescription$ Regenerate CARDNAME. +SVar:PlayMain1:TRUE +SVar:BuffedBy:Sliver +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/clot_sliver.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/smoldering_spires.txt b/res/cardsfolder/smoldering_spires.txt index f422d7522fa..5de3c0ac6b6 100644 --- a/res/cardsfolder/smoldering_spires.txt +++ b/res/cardsfolder/smoldering_spires.txt @@ -5,7 +5,8 @@ Text:no text K:CARDNAME enters the battlefield tapped. A:AB$ Mana | Cost$ T | Produced$ R | SpellDescription$ Add R to your mana pool. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPump | TriggerDescription$ When CARDNAME enters the battlefield, target creature can't block this turn. -SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature | IsCurse$ True | KW$ CARDNAME can't block | TgtPrompt$ Select target creature. +SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature | IsCurse$ True | KW$ HIDDEN CARDNAME can't block | TgtPrompt$ Select target creature. +SVar:PlayMain1:TRUE SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/Smoldering_Spires.jpg End diff --git a/res/cardsfolder/vermiculos.txt b/res/cardsfolder/vermiculos.txt index a0ccc65d744..e5b5dbd4f09 100644 --- a/res/cardsfolder/vermiculos.txt +++ b/res/cardsfolder/vermiculos.txt @@ -3,7 +3,7 @@ ManaCost:4 B Types:Creature Horror Text:no text PT:1/1 -T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Artifact | Execute$ TrigPump | TriggerDescription$ Whenever an artifact enters the battlefield, CARDNAME gets +4/+4 until end of turn. +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Artifact | Execute$ TrigPump | TriggerZones$ Battlefield | TriggerDescription$ Whenever an artifact enters the battlefield, CARDNAME gets +4/+4 until end of turn. SVar:TrigPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 4 | NumDef$ 4 SVar:BuffedBy:Artifact SVar:Rarity:Rare diff --git a/src/forge/Card.java b/src/forge/Card.java index c954522ce43..99a846d0c57 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -888,7 +888,7 @@ public class Card extends MyObservable { String k[] = keyword.get(i).split(":"); sbLong.append(k[5]).append("\r\n"); } else if (keyword.get(i).toString().contains("stPump")) { - String k[] = keyword.get(i).split(":"); + String k[] = keyword.get(i).split(":",5); if (!k[4].contains("no text")) sbLong.append(k[4]).append("\r\n"); } else if (keyword.get(i).toString().contains("stSetPT")) { String k[] = keyword.get(i).split(":"); diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index fee7d68343d..615bbab2e73 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -10290,7 +10290,7 @@ public class GameActionUtil { //get the affected cards - String k[] = keyword.split(":"); + String k[] = keyword.split(":",5); if(SpecialConditionsMet(cardWithKeyword, k[3])) { //special Conditions are Threshold, etc. @@ -10305,7 +10305,7 @@ public class GameActionUtil { x = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("X").split("\\$")[1]); se.setXValue(x); - addStaticEffects(affectedCards,k[2],x); //give the boni to the affected cards + addStaticEffects(cardWithKeyword,affectedCards,k[2],x); //give the boni to the affected cards storage.add(se); // store the information } @@ -10314,7 +10314,7 @@ public class GameActionUtil { } }// execute() - void addStaticEffects(CardList affectedCards, String Keyword_Details, int xValue) { + void addStaticEffects(Card source, CardList affectedCards, String Keyword_Details, int xValue) { int powerbonus = 0; int toughnessbonus = 0; @@ -10336,25 +10336,34 @@ public class GameActionUtil { if (Keyword.length > 2) { String Keywords[] = Keyword[2].split(" & "); for(int j = 0; j < Keywords.length; j++) { - affectedCard.addExtrinsicKeyword(Keywords[j]); + String keyword = Keywords[j]; + if(keyword.startsWith("ABSVar=")) { + String ability = source.getSVar(keyword.split("SVar=")[1]); + AbilityFactory AF = new AbilityFactory(); + SpellAbility sa = AF.getAbility(ability, affectedCard); + sa.setType("Temporary"); + + affectedCard.addSpellAbility(sa); + } + else affectedCard.addExtrinsicKeyword(keyword); } } } } void removeStaticEffect(StaticEffect se) { - Card Source = se.getSource(); + Card source = se.getSource(); CardList affected = se.getAffectedCards(); int KeywordNumber = se.getKeywordNumber(); int xValue = se.getXValue(); // the old xValue has to be removed, not the actual one! - String parse = Source.getKeyword().get(KeywordNumber).toString(); + String parse = source.getKeyword().get(KeywordNumber).toString(); String k[] = parse.split(":"); for(int i = 0; i < affected.size(); i++) { - removeStaticEffect(affected.get(i),k,xValue); + removeStaticEffect(source, affected.get(i),k,xValue); } } - void removeStaticEffect(Card affectedCard, String[] Keyword_Details, int xValue) { + void removeStaticEffect(Card source, Card affectedCard, String[] Keyword_Details, int xValue) { int powerbonus = 0; int toughnessbonus = 0; @@ -10374,7 +10383,16 @@ public class GameActionUtil { if (Keyword.length > 2) { String Keywords[] = Keyword[2].split(" & "); for(int j = 0; j < Keywords.length; j++) { - affectedCard.removeExtrinsicKeyword(Keywords[j]); + String keyword = Keywords[j]; + if(keyword.startsWith("ABSVar=")) { + SpellAbility[] spellAbility = affectedCard.getSpellAbility(); + for(SpellAbility s : spellAbility) + { + if (s.getType().equals("Temporary")) + affectedCard.removeSpellAbility(s); + } + } + affectedCard.removeExtrinsicKeyword(keyword); } } } diff --git a/src/forge/SpellAbility.java b/src/forge/SpellAbility.java index fc4d656ecf7..ebb8d04c052 100644 --- a/src/forge/SpellAbility.java +++ b/src/forge/SpellAbility.java @@ -383,6 +383,11 @@ public abstract class SpellAbility { type = s; } + public String getType() //Extrinsic or Intrinsic: + { + return type; + } + //setDescription() includes mana cost and everything like //"G, tap: put target creature from your hand onto the battlefield" public void setDescription(String s) {