mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
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:
@@ -247,12 +247,16 @@ abstract public class Ability_Mana extends SpellAbility implements java.io.Seria
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
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.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, ...
|
||||
else if(card.isCreature() && card.isLand() && card.hasSickness()) return false;
|
||||
else if(card.isArtifact() || card.isGlobalEnchantment() || card.isLand()) return true;
|
||||
|
||||
@@ -1746,6 +1746,7 @@ public class CardFactoryUtil {
|
||||
this.setFree(false);
|
||||
AllZone.Stack.add(spell);
|
||||
if(spell.isTapAbility()) spell.getSourceCard().tap();
|
||||
if(spell.isUntapAbility()) spell.getSourceCard().untap();
|
||||
stop();
|
||||
} else stopSetNext(new Input_PayManaCost(spell));
|
||||
}
|
||||
|
||||
@@ -1581,7 +1581,6 @@ public class CardFactory_Creatures {
|
||||
@Override
|
||||
public void resolve() {
|
||||
Card c = getTargetCard();
|
||||
card.untap();
|
||||
|
||||
if(c.sumAllCounters() == 0) return;
|
||||
else if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) {
|
||||
@@ -1623,6 +1622,7 @@ public class CardFactory_Creatures {
|
||||
return perms.size() > 0;
|
||||
}
|
||||
};//SpellAbility
|
||||
a1.makeUntapAbility();
|
||||
|
||||
Input runtime = new Input() {
|
||||
private static final long serialVersionUID = 1571239319226728848L;
|
||||
@@ -1700,6 +1700,7 @@ public class CardFactory_Creatures {
|
||||
return true;
|
||||
}
|
||||
};//SpellAbility
|
||||
a1.makeUntapAbility();
|
||||
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.setStackDescription(card.getName()
|
||||
@@ -1735,6 +1736,7 @@ public class CardFactory_Creatures {
|
||||
return true;
|
||||
}
|
||||
};//SpellAbility
|
||||
a1.makeUntapAbility();
|
||||
card.addSpellAbility(a1);
|
||||
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.");
|
||||
|
||||
@@ -1238,11 +1238,22 @@ class CardFactory_Equipment {
|
||||
equip.setType("Extrinsic");
|
||||
|
||||
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
|
||||
public void resolve() {
|
||||
getSourceCard().addTempAttackBoost(2);
|
||||
getSourceCard().addTempDefenseBoost(2);
|
||||
getSourceCard().untap();
|
||||
AllZone.EndOfTurn.addUntil(EOT(getSourceCard()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1250,7 +1261,7 @@ class CardFactory_Equipment {
|
||||
return (getSourceCard().isTapped() && !getSourceCard().hasSickness() && super.canPlay());
|
||||
}
|
||||
};//equiped creature's ability
|
||||
|
||||
untapboost.makeUntapAbility();
|
||||
Command onEquip = new Command() {
|
||||
|
||||
private static final long serialVersionUID = -4784079305541955698L;
|
||||
|
||||
@@ -1214,6 +1214,7 @@ public class GameAction {
|
||||
if(sa.getManaCost().equals("0") && sa.getBeforePayMana() == null) {
|
||||
AllZone.Stack.add(sa);
|
||||
if(sa.isTapAbility()) sa.getSourceCard().tap();
|
||||
if(sa.isUntapAbility()) sa.getSourceCard().untap();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ public class Input_PayManaCost extends Input {
|
||||
|
||||
//if tap ability, tap card
|
||||
if(spell.isTapAbility()) originalCard.tap();
|
||||
if(spell.isUntapAbility()) originalCard.untap();
|
||||
|
||||
//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
|
||||
|
||||
@@ -25,6 +25,7 @@ public abstract class SpellAbility {
|
||||
|
||||
private boolean spell;
|
||||
private boolean tapAbility;
|
||||
private boolean untapAbility;
|
||||
private boolean buyBackAbility = false; //false by default
|
||||
private boolean flashBackAbility = false;
|
||||
private boolean multiKicker = false;
|
||||
@@ -126,6 +127,16 @@ public abstract class SpellAbility {
|
||||
return tapAbility;
|
||||
}
|
||||
|
||||
public boolean isUntapAbility() {
|
||||
return untapAbility;
|
||||
}
|
||||
|
||||
public void makeUntapAbility()
|
||||
{
|
||||
untapAbility = true;
|
||||
tapAbility = false;
|
||||
}
|
||||
|
||||
public void setIsBuyBackAbility(boolean b) {
|
||||
buyBackAbility = b;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user