- Added a possibility to couple sacrifice costs with other costs (currently by sacrificing, pun semi-intended, the input-based sacrifice interface and replacing it with a menu-based selection one).

- Added 4 cards by swordshine (Leviathan, Exalted Dragon, Reclamation, Flooded Woodlands).
This commit is contained in:
Agetian
2012-12-01 13:10:39 +00:00
parent 903d724267
commit 3fc58ac107
6 changed files with 94 additions and 7 deletions

4
.gitattributes vendored
View File

@@ -3158,6 +3158,7 @@ res/cardsfolder/e/evolution_charm.txt svneol=native#text/plain
res/cardsfolder/e/evolution_vat.txt svneol=native#text/plain res/cardsfolder/e/evolution_vat.txt svneol=native#text/plain
res/cardsfolder/e/evolving_wilds.txt svneol=native#text/plain res/cardsfolder/e/evolving_wilds.txt svneol=native#text/plain
res/cardsfolder/e/exalted_angel.txt svneol=native#text/plain res/cardsfolder/e/exalted_angel.txt svneol=native#text/plain
res/cardsfolder/e/exalted_dragon.txt -text
res/cardsfolder/e/excavation.txt svneol=native#text/plain res/cardsfolder/e/excavation.txt svneol=native#text/plain
res/cardsfolder/e/excise.txt svneol=native#text/plain res/cardsfolder/e/excise.txt svneol=native#text/plain
res/cardsfolder/e/exclude.txt svneol=native#text/plain res/cardsfolder/e/exclude.txt svneol=native#text/plain
@@ -3536,6 +3537,7 @@ res/cardsfolder/f/floodchaser.txt svneol=native#text/plain
res/cardsfolder/f/flooded_grove.txt svneol=native#text/plain res/cardsfolder/f/flooded_grove.txt svneol=native#text/plain
res/cardsfolder/f/flooded_shoreline.txt svneol=native#text/plain res/cardsfolder/f/flooded_shoreline.txt svneol=native#text/plain
res/cardsfolder/f/flooded_strand.txt svneol=native#text/plain res/cardsfolder/f/flooded_strand.txt svneol=native#text/plain
res/cardsfolder/f/flooded_woodlands.txt -text
res/cardsfolder/f/floodgate.txt -text res/cardsfolder/f/floodgate.txt -text
res/cardsfolder/f/floodwater_dam.txt svneol=native#text/plain res/cardsfolder/f/floodwater_dam.txt svneol=native#text/plain
res/cardsfolder/f/floral_spuzzem.txt svneol=native#text/plain res/cardsfolder/f/floral_spuzzem.txt svneol=native#text/plain
@@ -5634,6 +5636,7 @@ res/cardsfolder/l/lesser_gargadon.txt svneol=native#text/plain
res/cardsfolder/l/lesser_werewolf.txt -text svneol=unset#text/plain res/cardsfolder/l/lesser_werewolf.txt -text svneol=unset#text/plain
res/cardsfolder/l/lethargy_trap.txt svneol=native#text/plain res/cardsfolder/l/lethargy_trap.txt svneol=native#text/plain
res/cardsfolder/l/leveler.txt svneol=native#text/plain res/cardsfolder/l/leveler.txt svneol=native#text/plain
res/cardsfolder/l/leviathan.txt -text
res/cardsfolder/l/levitation.txt svneol=native#text/plain res/cardsfolder/l/levitation.txt svneol=native#text/plain
res/cardsfolder/l/ley_druid.txt svneol=native#text/plain res/cardsfolder/l/ley_druid.txt svneol=native#text/plain
res/cardsfolder/l/leyline_of_anticipation.txt svneol=native#text/plain res/cardsfolder/l/leyline_of_anticipation.txt svneol=native#text/plain
@@ -7900,6 +7903,7 @@ res/cardsfolder/r/reckless_spite.txt svneol=native#text/plain
res/cardsfolder/r/reckless_waif_merciless_predator.txt -text res/cardsfolder/r/reckless_waif_merciless_predator.txt -text
res/cardsfolder/r/reckless_wurm.txt svneol=native#text/plain res/cardsfolder/r/reckless_wurm.txt svneol=native#text/plain
res/cardsfolder/r/reclaim.txt svneol=native#text/plain res/cardsfolder/r/reclaim.txt svneol=native#text/plain
res/cardsfolder/r/reclamation.txt -text
res/cardsfolder/r/reclusive_wight.txt svneol=native#text/plain res/cardsfolder/r/reclusive_wight.txt svneol=native#text/plain
res/cardsfolder/r/recoil.txt svneol=native#text/plain res/cardsfolder/r/recoil.txt svneol=native#text/plain
res/cardsfolder/r/recollect.txt svneol=native#text/plain res/cardsfolder/r/recollect.txt svneol=native#text/plain

View File

@@ -0,0 +1,12 @@
Name:Exalted Dragon
ManaCost:4 W W
Types:Creature Dragon
Text:no text
PT:5/5
K:Flying
S:Mode$ CantAttackUnless | ValidCard$ Creature.Self | Target$ Player,Planeswalker | Cost$ Sac<1/Land> | Description$ CARDNAME can't attack unless you sacrifice a land.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/exalted_dragon.jpg
SetInfo:EXO|Rare|http://magiccards.info/scans/en/ex/5.jpg
Oracle:Flying\nExalted Dragon can't attack unless you sacrifice a land.
End

View File

@@ -0,0 +1,10 @@
Name:Flooded Woodlands
ManaCost:2 U B
Types:Enchantment
Text:no text
S:Mode$ CantAttackUnless | ValidCard$ Creature.Green | Target$ Player,Planeswalker | Cost$ Sac<1/Land> | Description$ Green creatures can't attack unless their controller sacrifices a land for each green creature he or she controls that's attacking.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/flooded_woodlands.jpg
SetInfo:ICE|Rare|http://magiccards.info/scans/en/ia/368.jpg
Oracle:Green creatures can't attack unless their controller sacrifices a land for each green creature he or she controls that's attacking.
End

View File

@@ -0,0 +1,20 @@
Name:Leviathan
ManaCost:5 U U U U
Types:Creature Leviathan
Text:no text
PT:10/10
K:Trample
K:CARDNAME enters the battlefield tapped.
K:CARDNAME doesn't untap during your untap step.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | OptionalDecider$ You | Execute$ TrigUntap | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may sacrifice two Islands. If you do, untap CARDNAME.
SVar:TrigUntap:AB$ Untap | Cost$ Sac<2/Island>
S:Mode$ CantAttackUnless | ValidCard$ Creature.Self | Target$ Player,Planeswalker | Cost$ Sac<2/Island> | Description$ CARDNAME can't attack unless you sacrifice two islands.
SVar:NeedsToPlayVar:Y GE4
SVar:Y:Count$Valid Island.YouCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/leviathan.jpg
SetInfo:5ED|Rare|http://magiccards.info/scans/en/5e/97.jpg
SetInfo:4ED|Rare|http://magiccards.info/scans/en/4e/79.jpg
SetInfo:DRK|Rare|http://magiccards.info/scans/en/dk/28.jpg
Oracle:Trample\nLeviathan enters the battlefield tapped and doesn't untap during your untap step.\nAt the beginning of your upkeep, you may sacrifice two Islands. If you do, untap Leviathan.\nLeviathan can't attack unless you sacrifice two Islands.
End

View File

@@ -0,0 +1,10 @@
Name:Reclamation
ManaCost:2 W G
Types:Enchantment
Text:no text
S:Mode$ CantAttackUnless | ValidCard$ Creature.Black | Target$ Player,Planeswalker | Cost$ Sac<1/Land> | Description$ Black creatures can't attack unless their controller sacrifices a land for each black creature he or she controls that's attacking.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/reclamation.jpg
SetInfo:ICE|Rare|http://magiccards.info/scans/en/ia/377.jpg
Oracle:Black creatures can't attack unless their controller sacrifices a land for each black creature he or she controls that's attacking.
End

View File

@@ -380,6 +380,7 @@ public final class GameActionUtil {
final ArrayList<CostPart> parts = cost.getCostParts(); final ArrayList<CostPart> parts = cost.getCostParts();
ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts()); ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts());
CostPart costPart = null; CostPart costPart = null;
int num_parts = parts.size();
if (!parts.isEmpty()) { if (!parts.isEmpty()) {
costPart = parts.get(0); costPart = parts.get(0);
} }
@@ -486,6 +487,42 @@ public final class GameActionUtil {
} }
} }
} }
else if (part instanceof CostSacrifice) {
CostSacrifice sacCost = (CostSacrifice)part;
Player p = Singletons.getControl().getPlayer();
String valid = sacCost.getType();
int amount = Integer.parseInt(sacCost.getAmount());
List<Card> list = AbilityFactory.filterListByType(p.getCardsIn(ZoneType.Battlefield), valid, ability);
if (list.size() < amount) {
// unable to pay (not enough cards)
hasPaid = false;
break;
}
if (!showYesNoDialog(source, "Do you want to pay the sacrifice cost?")) {
hasPaid = false;
break;
}
for (int i = 0; i < amount; i++) {
if (list.isEmpty()) {
hasPaid = false;
break;
}
Object o = GuiChoose.one("Select a card to sacrifice", list);
if (o != null) {
final Card c = (Card) o;
Singletons.getModel().getGame().getAction().sacrifice(c, ability);
list.remove(c);
}
}
remainingParts.remove(part);
}
} }
if (!hasPaid) { if (!hasPaid) {
unpaid.execute(); unpaid.execute();
@@ -501,13 +538,7 @@ public final class GameActionUtil {
costPart = remainingParts.get(0); costPart = remainingParts.get(0);
//the following costs need inputs and can't be combined at the moment //the following costs need inputs and can't be combined at the moment
if (costPart instanceof CostSacrifice) { if (costPart instanceof CostReturn) {
final boolean bResolving = Singletons.getModel().getGame().getStack().isResolving();
Singletons.getModel().getGame().getStack().setResolving(false);
Singletons.getModel().getMatch().getInput().setInput(new InputPaySacCost((CostSacrifice) costPart, ability, paid, unpaid));
Singletons.getModel().getGame().getStack().setResolving(bResolving);
}
else if (costPart instanceof CostReturn) {
final boolean bResolving = Singletons.getModel().getGame().getStack().isResolving(); final boolean bResolving = Singletons.getModel().getGame().getStack().isResolving();
Singletons.getModel().getGame().getStack().setResolving(false); Singletons.getModel().getGame().getStack().setResolving(false);
Singletons.getModel().getMatch().getInput().setInput(new InputPayReturnCost((CostReturn) costPart, ability, paid, unpaid)); Singletons.getModel().getMatch().getInput().setInput(new InputPayReturnCost((CostReturn) costPart, ability, paid, unpaid));