- Fixing issue with Mana Abilities and Undoable timing

- Convert Undiscovered Paradise to script
This commit is contained in:
Sol
2013-01-20 19:21:54 +00:00
parent 21570e526a
commit 02b5984039
5 changed files with 16 additions and 41 deletions

View File

@@ -1,8 +1,9 @@
Name:Undiscovered Paradise
ManaCost:no cost
Types:Land
Text:Whenever you tap CARDNAME for mana, return it to it's owner's hand during the controller's next untap phase.
A:AB$ Mana | Cost$ T | Produced$ Any | SpellDescription$ Add one mana of any color to your mana pool
Text:no text
A:AB$ Mana | Cost$ T | Produced$ Any | SpellDescription$ Add one mana of any color to your mana pool | SubAbility$ DBReturn
SVar:DBReturn:DB$ Pump | Defined$ Self | KW$ HIDDEN During your next untap step, as you untap your permanents, return CARDNAME to its owner's hand. | Permanent$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/undiscovered_paradise.jpg
SetInfo:VIS|Rare|http://magiccards.info/scans/en/vi/167.jpg

View File

@@ -150,7 +150,6 @@ public class Card extends GameEntity implements Comparable<Card> {
private boolean evoked = false;
private boolean levelUp = false;
private boolean bounceAtUntap = false;
private boolean unearth = false;
private boolean unearthed;
@@ -1202,29 +1201,6 @@ public class Card extends GameEntity implements Comparable<Card> {
return this.hasKeyword("At the beginning of the end step, sacrifice CARDNAME.");
}
/**
* <p>
* Getter for the field <code>bounceAtUntap</code>.
* </p>
*
* @return a boolean.
*/
public final boolean getBounceAtUntap() {
return this.bounceAtUntap;
}
/**
* <p>
* Setter for the field <code>bounceAtUntap</code>.
* </p>
*
* @param bounce
* a boolean.
*/
public final void setBounceAtUntap(final boolean bounce) {
this.bounceAtUntap = bounce;
}
/**
* <p>
* hasFirstStrike.

View File

@@ -1783,6 +1783,11 @@ public final class GameActionUtil {
amount += bonus;
}
if (sa.getSubAbility() != null) {
// Mark SAs with subAbilities as undoable. These are generally things like damage, and other stuff
// that's hard to track and remove
sa.setUndoable(false);
} else {
try {
if ((sa.getParam("Amount") != null) && (amount != Integer.parseInt(sa.getParam("Amount")))) {
sa.setUndoable(false);
@@ -1790,6 +1795,7 @@ public final class GameActionUtil {
} catch (final NumberFormatException n) {
sa.setUndoable(false);
}
}
final StringBuilder sb = new StringBuilder();
if (amount == 0) {

View File

@@ -126,13 +126,6 @@ public class AbilityManaPart implements java.io.Serializable {
// add the mana produced to the mana pool
manaPool.addManaToFloating(this.lastProduced);
// TODO all of the following would be better as trigger events
// "tapped for mana"
if (source.getName().equals("Undiscovered Paradise")) {
// Probably best to conver this to an Extrinsic Ability
source.setBounceAtUntap(true);
}
// Run triggers
final HashMap<String, Object> runParams = new HashMap<String, Object>();

View File

@@ -114,11 +114,10 @@ public class Untap extends Phase {
List<Card> list = new ArrayList<Card>(player.getCardsIn(ZoneType.Battlefield));
for (final Card c : list) {
if (c.getBounceAtUntap() && c.getName().contains("Undiscovered Paradise")) {
List<Card> bounceList = CardLists.getKeyword(list, "During your next untap step, as you untap your permanents, return CARDNAME to its owner's hand.");
for (final Card c : bounceList) {
Singletons.getModel().getGame().getAction().moveToHand(c);
}
}
list = CardLists.filter(list, new Predicate<Card>() {
@Override