add Power Sink (from original base Alpha)

This commit is contained in:
jendave
2011-08-06 14:56:33 +00:00
parent 014dcd3a51
commit 2207ba140e
3 changed files with 28 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -3811,6 +3811,7 @@ res/cardsfolder/pouncing_jaguar.txt -text svneol=native#text/plain
res/cardsfolder/power_armor.txt -text svneol=native#text/plain
res/cardsfolder/power_artifact.txt -text svneol=native#text/plain
res/cardsfolder/power_matrix.txt -text svneol=native#text/plain
res/cardsfolder/power_sink.txt -text svneol=native#text/plain
res/cardsfolder/power_surge.txt -text svneol=native#text/plain
res/cardsfolder/pradesh_gypsies.txt -text svneol=native#text/plain
res/cardsfolder/predator_dragon.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,10 @@
Name:Power Sink
ManaCost:X U
Types:Instant
Text:no text
A:SP$Counter | Cost$ X U | Type$ Spell | UnlessCost$ X |PowerSink$True| SpellDescription$ Counter target spell unless its controller pays X. If he or she doesn't, that player taps all lands with mana abilities he or she controls and empties his or her mana pool.
SVar:X:Count$xPaid
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/power_sink.jpg
End

View File

@@ -143,6 +143,7 @@ public class AbilityFactory_CounterMagic {
public void execute() {
removeFromStack(tgtSA,sa);
if(params.containsKey("PowerSink")) doPowerSink(AllZone.HumanPlayer);
}
};
@@ -153,6 +154,7 @@ public class AbilityFactory_CounterMagic {
if(ComputerUtil.canPayCost(ability)) ComputerUtil.playNoStack(ability);
else {
removeFromStack(tgtSA,sa);
if(params.containsKey("PowerSink")) doPowerSink(AllZone.ComputerPlayer);
}
}
doExtraActions(tgtSA,sa);
@@ -182,6 +184,21 @@ public class AbilityFactory_CounterMagic {
}
private void doPowerSink(Player p) {
//get all lands with mana abilities
CardList lands = AllZoneUtil.getPlayerLandsInPlay(p);
lands = lands.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.getManaAbility().size() > 0;
}
});
//tap them
for(Card c:lands) c.tap();
//empty mana pool
if(p.isHuman()) AllZone.ManaPool.clearPool();
}
private String counterStackDescription(AbilityFactory af, SpellAbility sa){
StringBuilder sb = new StringBuilder();