Fixed Umbral Mantle glitch, it seems I forgot to add an untilEndOfTurn event. Also coded {Q} ability handling, inserting it in all places I found "card.isTapAbility": therefore, no more "untap on resolve" funny business.

This commit is contained in:
jendave
2011-08-06 03:31:44 +00:00
parent 3e7929f70c
commit 53c521f7c9
7 changed files with 37 additions and 6 deletions

View File

@@ -247,12 +247,16 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria
@Override @Override
public boolean canPlay() { public boolean canPlay() {
Card card = getSourceCard(); Card card = getSourceCard();
if(AllZone.GameAction.isCardInPlay(card) && (!isTapAbility() || card.isUntapped())) { if(AllZone.GameAction.isCardInPlay(card) &!
((isTapAbility() && card.isTapped()) ||
(isUntapAbility() && card.isUntapped()))) {
if(card.isFaceDown()) return false; if(card.isFaceDown()) return false;
if(card.isArtifact() && card.isCreature()) return !(card.hasSickness() && isTapAbility()); if(card.isArtifact() && card.isCreature()) return !(card.hasSickness() &&
(isTapAbility() || isUntapAbility()));
if(card.isCreature() && (!card.hasSickness() || !isTapAbility())) return true; if(card.isCreature() && !(card.hasSickness() &&
(isTapAbility() || isUntapAbility()))) return true;
//Dryad Arbor, Mishra's Factory, Mutavault, ... //Dryad Arbor, Mishra's Factory, Mutavault, ...
else if(card.isCreature() && card.isLand() && card.hasSickness()) return false; else if(card.isCreature() && card.isLand() && card.hasSickness()) return false;
else if(card.isArtifact() || card.isGlobalEnchantment() || card.isLand()) return true; else if(card.isArtifact() || card.isGlobalEnchantment() || card.isLand()) return true;

View File

@@ -1746,6 +1746,7 @@ public class CardFactoryUtil {
this.setFree(false); this.setFree(false);
AllZone.Stack.add(spell); AllZone.Stack.add(spell);
if(spell.isTapAbility()) spell.getSourceCard().tap(); if(spell.isTapAbility()) spell.getSourceCard().tap();
if(spell.isUntapAbility()) spell.getSourceCard().untap();
stop(); stop();
} else stopSetNext(new Input_PayManaCost(spell)); } else stopSetNext(new Input_PayManaCost(spell));
} }

View File

@@ -1581,7 +1581,6 @@ public class CardFactory_Creatures {
@Override @Override
public void resolve() { public void resolve() {
Card c = getTargetCard(); Card c = getTargetCard();
card.untap();
if(c.sumAllCounters() == 0) return; if(c.sumAllCounters() == 0) return;
else if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) { else if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) {
@@ -1623,6 +1622,7 @@ public class CardFactory_Creatures {
return perms.size() > 0; return perms.size() > 0;
} }
};//SpellAbility };//SpellAbility
a1.makeUntapAbility();
Input runtime = new Input() { Input runtime = new Input() {
private static final long serialVersionUID = 1571239319226728848L; private static final long serialVersionUID = 1571239319226728848L;
@@ -1700,6 +1700,7 @@ public class CardFactory_Creatures {
return true; return true;
} }
};//SpellAbility };//SpellAbility
a1.makeUntapAbility();
card.addSpellAbility(a1); card.addSpellAbility(a1);
a1.setDescription("1 W W, Untap: Return target creature card with converted mana cost 3 or less from your graveyard to play."); a1.setDescription("1 W W, Untap: Return target creature card with converted mana cost 3 or less from your graveyard to play.");
a1.setStackDescription(card.getName() a1.setStackDescription(card.getName()
@@ -1735,6 +1736,7 @@ public class CardFactory_Creatures {
return true; return true;
} }
};//SpellAbility };//SpellAbility
a1.makeUntapAbility();
card.addSpellAbility(a1); card.addSpellAbility(a1);
a1.setDescription("1 W, Untap: Put a 1/1 white Kithkin Soldier creature token into play."); a1.setDescription("1 W, Untap: Put a 1/1 white Kithkin Soldier creature token into play.");
a1.setStackDescription(card.getName() + " - put a 1/1 white Kithkin Soldier creature token into play."); a1.setStackDescription(card.getName() + " - put a 1/1 white Kithkin Soldier creature token into play.");

View File

@@ -1238,11 +1238,22 @@ class CardFactory_Equipment {
equip.setType("Extrinsic"); equip.setType("Extrinsic");
final Ability untapboost = new Ability(card, "3") { final Ability untapboost = new Ability(card, "3") {
Command EOT(final Card c){return new Command() {
private static final long serialVersionUID = -8840812331316327448L;
public void execute() {
if(AllZone.GameAction.isCardInPlay(getSourceCard())) {
c.addTempAttackBoost(-2);
c.addTempDefenseBoost(-2);
}
}
};}
@Override @Override
public void resolve() { public void resolve() {
getSourceCard().addTempAttackBoost(2); getSourceCard().addTempAttackBoost(2);
getSourceCard().addTempDefenseBoost(2); getSourceCard().addTempDefenseBoost(2);
getSourceCard().untap(); AllZone.EndOfTurn.addUntil(EOT(getSourceCard()));
} }
@Override @Override
@@ -1250,7 +1261,7 @@ class CardFactory_Equipment {
return (getSourceCard().isTapped() && !getSourceCard().hasSickness() && super.canPlay()); return (getSourceCard().isTapped() && !getSourceCard().hasSickness() && super.canPlay());
} }
};//equiped creature's ability };//equiped creature's ability
untapboost.makeUntapAbility();
Command onEquip = new Command() { Command onEquip = new Command() {
private static final long serialVersionUID = -4784079305541955698L; private static final long serialVersionUID = -4784079305541955698L;

View File

@@ -1214,6 +1214,7 @@ public class GameAction {
if(sa.getManaCost().equals("0") && sa.getBeforePayMana() == null) { if(sa.getManaCost().equals("0") && sa.getBeforePayMana() == null) {
AllZone.Stack.add(sa); AllZone.Stack.add(sa);
if(sa.isTapAbility()) sa.getSourceCard().tap(); if(sa.isTapAbility()) sa.getSourceCard().tap();
if(sa.isUntapAbility()) sa.getSourceCard().untap();
return; return;
} }

View File

@@ -54,6 +54,7 @@ public class Input_PayManaCost extends Input {
//if tap ability, tap card //if tap ability, tap card
if(spell.isTapAbility()) originalCard.tap(); if(spell.isTapAbility()) originalCard.tap();
if(spell.isUntapAbility()) originalCard.untap();
//this seems to remove a card if it is in the player's hand //this seems to remove a card if it is in the player's hand
//and trys to remove abilities, but no error messsage is generated //and trys to remove abilities, but no error messsage is generated

View File

@@ -25,6 +25,7 @@ public abstract class SpellAbility {
private boolean spell; private boolean spell;
private boolean tapAbility; private boolean tapAbility;
private boolean untapAbility;
private boolean buyBackAbility = false; //false by default private boolean buyBackAbility = false; //false by default
private boolean flashBackAbility = false; private boolean flashBackAbility = false;
private boolean multiKicker = false; private boolean multiKicker = false;
@@ -126,6 +127,16 @@ public abstract class SpellAbility {
return tapAbility; return tapAbility;
} }
public boolean isUntapAbility() {
return untapAbility;
}
public void makeUntapAbility()
{
untapAbility = true;
tapAbility = false;
}
public void setIsBuyBackAbility(boolean b) { public void setIsBuyBackAbility(boolean b) {
buyBackAbility = b; buyBackAbility = b;
} }