*Initial Delve keyword checkin. (Does not work with X-cost spells.)

*Added OwnerDoesntControl property.
*Added
	Bronze Bombshell
	Death Rattle
	Tombstalker
*Ran Setinfo and Oracle script.
This commit is contained in:
Hellfish
2011-10-16 08:07:37 +00:00
parent ab7b9760ee
commit 4c6d2f6eb1
21 changed files with 220 additions and 29 deletions

3
.gitattributes vendored
View File

@@ -1028,6 +1028,7 @@ res/cardsfolder/b/broken_ambitions.txt svneol=native#text/plain
res/cardsfolder/b/broken_dam.txt svneol=native#text/plain res/cardsfolder/b/broken_dam.txt svneol=native#text/plain
res/cardsfolder/b/broken_fall.txt svneol=native#text/plain res/cardsfolder/b/broken_fall.txt svneol=native#text/plain
res/cardsfolder/b/broken_visage.txt svneol=native#text/plain res/cardsfolder/b/broken_visage.txt svneol=native#text/plain
res/cardsfolder/b/bronze_bombshell.txt -text
res/cardsfolder/b/brood_birthing.txt svneol=native#text/plain res/cardsfolder/b/brood_birthing.txt svneol=native#text/plain
res/cardsfolder/b/brood_of_cockroaches.txt svneol=native#text/plain res/cardsfolder/b/brood_of_cockroaches.txt svneol=native#text/plain
res/cardsfolder/b/brood_sliver.txt svneol=native#text/plain res/cardsfolder/b/brood_sliver.txt svneol=native#text/plain
@@ -1840,6 +1841,7 @@ res/cardsfolder/d/death_of_a_thousand_stings.txt svneol=native#text/plain
res/cardsfolder/d/death_pit_offering.txt svneol=native#text/plain res/cardsfolder/d/death_pit_offering.txt svneol=native#text/plain
res/cardsfolder/d/death_pits_of_rath.txt svneol=native#text/plain res/cardsfolder/d/death_pits_of_rath.txt svneol=native#text/plain
res/cardsfolder/d/death_pulse.txt svneol=native#text/plain res/cardsfolder/d/death_pulse.txt svneol=native#text/plain
res/cardsfolder/d/death_rattle.txt -text
res/cardsfolder/d/death_spark.txt svneol=native#text/plain res/cardsfolder/d/death_spark.txt svneol=native#text/plain
res/cardsfolder/d/death_speakers.txt svneol=native#text/plain res/cardsfolder/d/death_speakers.txt svneol=native#text/plain
res/cardsfolder/d/death_stroke.txt svneol=native#text/plain res/cardsfolder/d/death_stroke.txt svneol=native#text/plain
@@ -8337,6 +8339,7 @@ res/cardsfolder/t/tolarian_serpent.txt svneol=native#text/plain
res/cardsfolder/t/tolsimir_wolfblood.txt svneol=native#text/plain res/cardsfolder/t/tolsimir_wolfblood.txt svneol=native#text/plain
res/cardsfolder/t/tomb_hex.txt svneol=native#text/plain res/cardsfolder/t/tomb_hex.txt svneol=native#text/plain
res/cardsfolder/t/tomb_of_urami.txt svneol=native#text/plain res/cardsfolder/t/tomb_of_urami.txt svneol=native#text/plain
res/cardsfolder/t/tombstalker.txt -text
res/cardsfolder/t/tome_scour.txt svneol=native#text/plain res/cardsfolder/t/tome_scour.txt svneol=native#text/plain
res/cardsfolder/t/tonic_peddler.txt svneol=native#text/plain res/cardsfolder/t/tonic_peddler.txt svneol=native#text/plain
res/cardsfolder/t/tooth_and_nail.txt svneol=native#text/plain res/cardsfolder/t/tooth_and_nail.txt svneol=native#text/plain

View File

@@ -0,0 +1,14 @@
Name:Bronze Bombshell
ManaCost:4
Types:Artifact Creature Construct
Text:no text
PT:4/1
T:Mode$ Always | IsPresent$ Card.Self+OwnerDoesntControl | Execute$ TrigSac | TriggerDescription$ When a player other than CARDNAME's owner controls it, that player sacrifices it. If the player does, CARDNAME deals 7 damage to him or her.
SVar:TrigSac:AB$SacrificeAll | Cost$ 0 | Defined$ Self | RememberSacrificed$ True | SubAbility$ DBDmg
SVar:DBDmg:DB$DealDamage | Defined$ You | NumDmg$ 7 | CheckSVar$ X | SVarCompare$ GE1
SVar:X:Remembered$Amount
SVar:RemAIDeck:True
SVar:Rarity:Rare
SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/160.jpg
Oracle:When a player other than Bronze Bombshell's owner controls it, that player sacrifices it. If the player does, Bronze Bombshell deals 7 damage to him or her.
End

View File

@@ -0,0 +1,9 @@
Name:Death Rattle
ManaCost:5 B
Types:Instant
Text:no text
K:Delve
A:SP$Destroy | Cost$ 5 B | ValidTgts$ Creature.nonGreen | TgtPrompt$ Select target non-green creature. | NoRegen$ True | SpellDescription$ Destroy target non-green creature. It can't be regenerated.
SetInfo:FUT|Common|http://magiccards.info/scans/en/fut/82.jpg
Oracle:Delve (You may exile any number of cards from your graveyard as you cast this spell. It costs {1} less to cast for each card exiled this way.)\nDestroy target nongreen creature. It can't be regenerated.
End

View File

@@ -8,4 +8,7 @@ SVar:TrigChangeZone:AB$ ChangeZone | Cost$ 0 | ChangeNum$ X | ChangeType$ Goblin
SVar:X:Count$InYourLibrary.Goblin SVar:X:Count$InYourLibrary.Goblin
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_recruiter.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_recruiter.jpg
SetInfo:VIS|Uncommon|http://magiccards.info/scans/en/vi/80.jpg
SetInfo:6ED|Uncommon|http://magiccards.info/scans/en/6e/186.jpg
Oracle:When Goblin Recruiter enters the battlefield, search your library for any number of Goblin cards and reveal those cards. Shuffle your library, then put them on top of it in any order.
End End

View File

@@ -8,4 +8,6 @@ SVar:X:Remembered$Valid Card.White
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/inquisition.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/inquisition.jpg
SetInfo:DRK|Common|http://magiccards.info/scans/en/dk/9.jpg
Oracle:Target player reveals his or her hand. Inquisition deals damage to that player equal to the number of white cards in his or her hand.
End End

View File

@@ -9,4 +9,6 @@ SVar:Y:Number$3/Times.ChosenX
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/martyr_of_sands.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/martyr_of_sands.jpg
SetInfo:CSP|Common|http://magiccards.info/scans/en/cs/15.jpg
Oracle:{1}, Reveal X white cards from your hand, Sacrifice Martyr of Sands: You gain three times X life.
End End

View File

@@ -8,4 +8,6 @@ SVar:X:XChoice
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/martyr_of_spores.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/martyr_of_spores.jpg
SetInfo:CSP|Common|http://magiccards.info/scans/en/cs/113.jpg
Oracle:{1}, Reveal X green cards from your hand, Sacrifice Martyr of Spores: Target creature gets +X/+X until end of turn.
End End

View File

@@ -10,4 +10,6 @@ SVar:TrigPump:AB$ Pump | Cost$ 0 | Defined$ Enchanted | NumAtt$ X
SVar:X:Count$Valid Creature.YouCtrl+nonWall SVar:X:Count$Valid Creature.YouCtrl+nonWall
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/mob_mentality.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mob_mentality.jpg
SetInfo:VIS|Uncommon|http://magiccards.info/scans/en/vi/88.jpg
Oracle:Enchant creature\nEnchanted creature has trample.\nWhenever all non-Wall creatures you control attack, enchanted creature gets +X/+0 until end of turn, where X is the number of attacking creatures.
End End

View File

@@ -12,4 +12,6 @@ SVar:Y:TriggeredCard$CardCounters.AGE/Times.2
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_etchings.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_etchings.jpg
SetInfo:CSP|Rare|http://magiccards.info/scans/en/cs/67.jpg
Oracle:Cumulative upkeep {B} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)\nAt the beginning of your end step, draw a card for each age counter on Phyrexian Etchings.\nWhen Phyrexian Etchings is put into a graveyard from the battlefield, you lose 2 life for each age counter on it.
End End

View File

@@ -8,4 +8,6 @@ SVar:STPrevent:Mode$ PreventDamage | Target$ Creature,Player | Source$ Card.Chos
A:SP$ ChooseColor | Cost$ tapXType<1/Creature.YouCtrl+White+untapped> | Defined$ You | AILogic$ MostProminentInHumanDeck | SubAbility$ DBEffect | Flashback$ True | CostDesc$ Flashback - Tap an untapped white creature you control. | SpellDescription$ (You may cast this card from your graveyard for its flashback cost. Then exile it.) A:SP$ ChooseColor | Cost$ tapXType<1/Creature.YouCtrl+White+untapped> | Defined$ You | AILogic$ MostProminentInHumanDeck | SubAbility$ DBEffect | Flashback$ True | CostDesc$ Flashback - Tap an untapped white creature you control. | SpellDescription$ (You may cast this card from your graveyard for its flashback cost. Then exile it.)
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/prismatic_strands.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/prismatic_strands.jpg
SetInfo:JUD|Common|http://magiccards.info/scans/en/ju/18.jpg
Oracle:Prevent all damage that sources of the color of your choice would deal this turn.\nFlashback-Tap an untapped white creature you control. (You may cast this card from your graveyard for its flashback cost. Then exile it.)
End End

View File

@@ -7,4 +7,10 @@ A:AB$ RevealHand | Cost$ B B B T | ValidTgts$ Player | TgtPrompt$ Select target
SVar:DBDiscard:DB$ Discard | Defined$ Targeted | NumCards$ 1 | Mode$ Random | DiscardValid$ Creature SVar:DBDiscard:DB$ Discard | Defined$ Targeted | NumCards$ 1 | Mode$ Random | DiscardValid$ Creature
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rag_man.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/rag_man.jpg
SetInfo:5ED|Rare|http://magiccards.info/scans/en/5e/52.jpg
SetInfo:DRK|Rare|http://magiccards.info/scans/en/dk/13.jpg
SetInfo:4ED|Rare|http://magiccards.info/scans/en/4e/39.jpg
SetInfo:6ED|Rare|http://magiccards.info/scans/en/6e/151.jpg
SetInfo:7ED|Rare|http://magiccards.info/scans/en/7e/156.jpg
Oracle:{B}{B}{B}, {T}: Target opponent reveals his or her hand and discards a creature card at random. Activate this ability only during your turn.
End End

View File

@@ -7,4 +7,6 @@ SVar:Y:Count$NamedInAllYards.Rune Snag/Times.2
SVar:X:Number$2/Plus.Y SVar:X:Number$2/Plus.Y
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/rune_snag.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/rune_snag.jpg
SetInfo:CSP|Common|http://magiccards.info/scans/en/cs/46.jpg
Oracle:Counter target spell unless its controller pays {2} plus an additional {2} for each card named Rune Snag in each graveyard.
End End

View File

@@ -8,4 +8,6 @@ A:AB$ MustBlock | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creat
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/tangle_angler.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/tangle_angler.jpg
SetInfo:SOM|Uncommon|http://magiccards.info/scans/en/som/128.jpg
Oracle:Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)\n{G}: Target creature blocks Tangle Angler this turn if able.
End End

View File

@@ -0,0 +1,10 @@
Name:Tombstalker
ManaCost:6 B B
Types:Creature Demon
Text:no text
PT:5/5
K:Flying
K:Delve
SetInfo:FUT|Rare|http://magiccards.info/scans/en/fut/91.jpg
Oracle:Flying\nDelve (You may exile any number of cards from your graveyard as you cast this spell. It costs {1} less to cast for each card exiled this way.)
End

View File

@@ -13,4 +13,6 @@ SVar:Y:Remembered$CardToughness
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/vanish_into_memory.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/vanish_into_memory.jpg
SetInfo:CSP|Uncommon|http://magiccards.info/scans/en/cs/133.jpg
Oracle:Exile target creature. You draw cards equal to that creature's power. At the beginning of your next upkeep, return that card to the battlefield under its owner's control. If you do, discard cards equal to its toughness.
End End

View File

@@ -9,4 +9,6 @@ T:Mode$ Blocks | ValidCard$ Card.Self | Execute$ TrigRemoveCounter | TriggerZone
SVar:TrigRemoveCounter:AB$ RemoveCounter | Cost$ 0 | CounterType$ ICE | CounterNum$ 1 | Defined$ TriggeredBlocker SVar:TrigRemoveCounter:AB$ RemoveCounter | Cost$ 0 | CounterType$ ICE | CounterNum$ 1 | Defined$ TriggeredBlocker
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/woolly_razorback.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/woolly_razorback.jpg
SetInfo:CSP|Rare|http://magiccards.info/scans/en/cs/25.jpg
Oracle:Woolly Razorback enters the battlefield with three ice counters on it.\nAs long as Woolly Razorback has an ice counter on it, prevent all combat damage it would deal and it has defender.\nWhenever Woolly Razorback blocks, remove an ice counter from it.
End End

View File

@@ -5109,6 +5109,8 @@ public class Card extends GameEntity implements Comparable<Card> {
if (!getOwner().isPlayer(sourceController)) return false; if (!getOwner().isPlayer(sourceController)) return false;
} else if (Property.startsWith("YouDontOwn")) { } else if (Property.startsWith("YouDontOwn")) {
if (getOwner().isPlayer(sourceController)) return false; if (getOwner().isPlayer(sourceController)) return false;
} else if (Property.startsWith("OwnerDoesntControl")) {
if(getOwner().isPlayer(getController())) return false;
} else if (Property.startsWith("ControllerControls")) { } else if (Property.startsWith("ControllerControls")) {
String type = Property.substring(18); String type = Property.substring(18);
CardList list = getController().getCardsIn(Zone.Battlefield); CardList list = getController().getCardsIn(Zone.Battlefield);

View File

@@ -1769,6 +1769,73 @@ public class GameAction {
manaCost = new ManaCost("G G"); manaCost = new ManaCost("G G");
} // Avatar of Might } // Avatar of Might
} }
else if(spell.getIsDelve()) {
int cardsInGrave = originalCard.getController().getCardsIn(Zone.Graveyard).size();
ArrayList<Integer> choiceList = new ArrayList<Integer>();
for(int i=0;i<=cardsInGrave;i++) {
choiceList.add(i);
}
if(originalCard.getController().isHuman()) {
int chosenAmount = (Integer)GuiUtils.getChoice("Exile how many cards?", choiceList.toArray());
System.out.println("Delve for " + chosenAmount);
CardList choices = AllZone.getHumanPlayer().getCardsIn(Zone.Graveyard);
CardList chosen = new CardList();
for(int i=0;i<chosenAmount;i++) {
Card nowChosen = (Card)GuiUtils.getChoiceOptional("Exile which card?", choices.toArray());
if(nowChosen == null) //User canceled,abort delving.
{
chosen.clear();
break;
}
choices.remove(nowChosen);
chosen.add(nowChosen);
}
for(Card c : chosen) {
exile(c);
}
manaCost = new ManaCost(originalCost.toString());
manaCost.decreaseColorlessMana(chosenAmount);
}
else {
//AI
int numToExile = 0;
int colorlessCost = originalCost.getColorlessManaAmount();
if(cardsInGrave <= colorlessCost) {
numToExile = cardsInGrave;
}
else {
numToExile = colorlessCost;
}
for(int i=0;i<numToExile;i++) {
CardList grave = new CardList(AllZone.getComputerPlayer().getZone(Zone.Graveyard).getCards());
Card chosen = null;
for(Card c : grave) { //Exile noncreatures first in case we can revive. Might wanna do some additional checking here for Flashback and the like.
if(!c.isCreature()) {
chosen = c;
break;
}
}
if(chosen == null) {
chosen = CardFactoryUtil.AI_getWorstCreature(grave);
}
if(chosen == null) {
//Should never get here but... You know how it is.
chosen = grave.get(0);
}
exile(chosen);
}
}
}
} // isSpell } // isSpell
// Get Cost Reduction // Get Cost Reduction

View File

@@ -4800,6 +4800,10 @@ public class CardFactoryUtil {
} }
} }
if(card.hasKeyword("Delve")) {
card.getSpellAbilities().get(0).setIsDelve(true);
}
if(card.hasStartOfKeyword("Haunt")) { if(card.hasStartOfKeyword("Haunt")) {
int hauntPos = card.getKeywordPosition("Haunt"); int hauntPos = card.getKeywordPosition("Haunt");
String[] splitKeyword = card.getKeyword().get(hauntPos).split(":"); String[] splitKeyword = card.getKeyword().get(hauntPos).split(":");

View File

@@ -239,6 +239,44 @@ public class ManaCost {
} }
manaPart.add(new Mana_PartColorless(manaToAdd)); manaPart.add(new Mana_PartColorless(manaToAdd));
} }
/**
* <p>decreaseColorlessMana</p>
* @param manaToSubtract an int. The amount of colorless mana to subtract from the cost.Used by Delve.
*/
public void decreaseColorlessMana(int manaToSubtract) {
if(manaToSubtract <= 0)
return;
Mana_Part m;
for(int i = 0; i < manaPart.size();i++) {
m = (Mana_Part) manaPart.get(i);
if(m instanceof Mana_PartColorless) {
int remainingColorless = ((Mana_PartColorless) m).getManaNeeded() - manaToSubtract;
if(remainingColorless <= 0) {
manaPart.remove(m);
break;
}
else {
manaPart.remove(m);
manaPart.add(new Mana_PartColorless(remainingColorless));
}
}
}
}
/**
* <p>getColorlessManaAmount</p>
* Returns how much colorless mana must be paid to pay the cost.Used by Delve AI.
* @return an int.
*/
public int getColorlessManaAmount() {
for(Object m : manaPart) {
if(m instanceof Mana_PartColorless) {
return ((Mana_PartColorless) m).getManaNeeded();
}
}
return 0;
}
/** /**
* <p>addMana.</p> * <p>addMana.</p>

View File

@@ -62,6 +62,7 @@ public abstract class SpellAbility {
private boolean kothThirdAbility = false; private boolean kothThirdAbility = false;
private boolean cycling = false; private boolean cycling = false;
private boolean isCharm = false; private boolean isCharm = false;
private boolean isDelve = false;
private int charmNumber; private int charmNumber;
private ArrayList<SpellAbility> charmChoices = new ArrayList<SpellAbility>(); private ArrayList<SpellAbility> charmChoices = new ArrayList<SpellAbility>();
@@ -1340,4 +1341,18 @@ public abstract class SpellAbility {
return charmChoices; return charmChoices;
} }
/**
* @return the isDelve
*/
public boolean getIsDelve() {
return isDelve;
}
/**
* @param isDelve0 the isDelve to set
*/
public void setIsDelve(boolean isDelve0) {
this.isDelve = isDelve0; // TODO: Add 0 to parameter's name.
}
} }