- Added Mindleech Mass.

This commit is contained in:
Sloth
2012-02-18 11:03:10 +00:00
parent 212a3d16b7
commit 8ff267c982
4 changed files with 41 additions and 6 deletions

1
.gitattributes vendored
View File

@@ -5516,6 +5516,7 @@ res/cardsfolder/m/mindblaze.txt -text svneol=unset#text/plain
res/cardsfolder/m/mindcrank.txt svneol=native#text/plain
res/cardsfolder/m/mindculling.txt svneol=native#text/plain
res/cardsfolder/m/mindlash_sliver.txt svneol=native#text/plain
res/cardsfolder/m/mindleech_mass.txt -text
res/cardsfolder/m/mindless_automaton.txt svneol=native#text/plain
res/cardsfolder/m/mindless_null.txt -text
res/cardsfolder/m/mindmoil.txt -text

View File

@@ -5,7 +5,7 @@ Text:no text
PT:5/5
K:Flying
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigPlay | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may cast a nonland card from your hand without paying its mana cost.
SVar:TrigPlay:DB$ Play | Valid$ Card.nonLand+YouCtrl | ValidZone$ Hand | WithoutManaCost$ True
SVar:TrigPlay:DB$ Play | Valid$ Card.nonLand+YouCtrl | ValidZone$ Hand | WithoutManaCost$ True | Optional$ True
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/maelstrom_archangel.jpg
SetInfo:CFX|Mythic|http://magiccards.info/scans/en/cfx/115.jpg

View File

@@ -0,0 +1,14 @@
Name:Mindleech Mass
ManaCost:5 U B B
Types:Creature Horror
Text:no text
PT:6/6
K:Trample
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigReveal | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may look at that player's hand. If you do, you may cast a nonland card in it without paying that card's mana cost.
SVar:TrigReveal:DB$ RevealHand | Defined$ TriggeredTarget | SubAbility$ TrigPlay
SVar:TrigPlay:DB$ Play | Valid$ Card.nonLand+YouDontCtrl | ValidZone$ Hand | WithoutManaCost$ True | Optional$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mindleech_mass.jpg
SetInfo:RAV|Rare|http://magiccards.info/scans/en/rav/215.jpg
Oracle:Trample\nWhenever Mindleech Mass deals combat damage to a player, you may look at that player's hand. If you do, you may cast a nonland card in it without paying that card's mana cost.
End

View File

@@ -26,6 +26,7 @@ import forge.AllZone;
import forge.AllZoneUtil;
import forge.Card;
import forge.CardList;
import forge.CardListFilter;
import forge.ComputerUtil;
import forge.GameActionUtil;
import forge.Player;
@@ -125,9 +126,6 @@ public final class AbilityFactoryPlay {
@Override
public boolean canPlayFromEffectAI(final boolean mandatory, final boolean withOutManaCost) {
if (withOutManaCost) {
return true;
}
return AbilityFactoryPlay.playTriggerAI(af, this, mandatory);
}
@@ -321,16 +319,17 @@ public final class AbilityFactoryPlay {
private static void playResolve(final AbilityFactory af, final SpellAbility sa) {
final HashMap<String, String> params = af.getMapParams();
final Card source = sa.getSourceCard();
Player controller = sa.getActivatingPlayer();
Player activator = sa.getActivatingPlayer();
int amount = 1;
if (params.containsKey("Amount")) {
amount = AbilityFactory.calculateAmount(source, params.get("Amount"), sa);
}
if (params.containsKey("Controller")) {
controller = AbilityFactory.getDefinedPlayers(source, params.get("Controller"), sa).get(0);
activator = AbilityFactory.getDefinedPlayers(source, params.get("Controller"), sa).get(0);
}
final Player controller = activator;
CardList tgtCards = new CardList();
final Target tgt = sa.getTarget();
@@ -357,6 +356,27 @@ public final class AbilityFactoryPlay {
if (controller.isHuman()) {
tgtCard = (Card) GuiUtils.getChoice("Select a card to play", tgtCards.toArray());
} else {
// AI
tgtCards = tgtCards.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
ArrayList<SpellAbility> SpellAbilities = c.getBasicSpells();
ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>();
for (SpellAbility s : SpellAbilities) {
Spell spell = (Spell) s;
s.setActivatingPlayer(controller);
SpellAbilityRestriction res = s.getRestrictions();
// timing restrictions still apply
if (res.checkTimingRestrictions(c, s) && spell.canPlayFromEffectAI(false, true)) {
sas.add(s);
}
}
if (sas.isEmpty()) {
return false;
}
return true;
}
});
tgtCard = CardFactoryUtil.getBestAI(tgtCards);
}
}