mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Added UntapUpTo to AF_Untap
- Converted Urza's "Free" Spells from Drawback to AF SubAbility
This commit is contained in:
@@ -3,7 +3,8 @@ ManaCost:2 U
|
|||||||
Types:Instant
|
Types:Instant
|
||||||
Text:no text
|
Text:no text
|
||||||
A:SP$ Draw | Cost$ 2 U | NumCards$ 2 | SpellDescription$ Draw two cards, then discard two cards. Untap up to three lands. | SubAbility$ SVar=DBDiscard
|
A:SP$ Draw | Cost$ 2 U | NumCards$ 2 | SpellDescription$ Draw two cards, then discard two cards. Untap up to three lands. | SubAbility$ SVar=DBDiscard
|
||||||
SVar:DBDiscard:DB$Discard | NumCards$ 2 | Mode$ TgtChoose | SubAbility$ YouUntapUpTo/3/Land
|
SVar:DBDiscard:DB$Discard | NumCards$ 2 | Mode$ TgtChoose | SubAbility$ SVar=DBUntap
|
||||||
|
SVar:DBUntap:DB$ Untap | UntapUpTo$ True | UntapType$ Land | Amount$ 3
|
||||||
# Use old subability for untapping until AF$Untap can handle Urza block style "Free" spells
|
# Use old subability for untapping until AF$Untap can handle Urza block style "Free" spells
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ Name:Rewind
|
|||||||
ManaCost:2 U U
|
ManaCost:2 U U
|
||||||
Types:Instant
|
Types:Instant
|
||||||
Text:no text
|
Text:no text
|
||||||
A:SP$ Counter | Cost$ 2 U U | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | SubAbility$ YouUntapUpTo/4/Land | SpellDescription$ Counter target spell. Untap up to four lands.
|
A:SP$ Counter | Cost$ 2 U U | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | SubAbility$ SVar=DBUntap | SpellDescription$ Counter target spell. Untap up to four lands.
|
||||||
|
SVar:DBUntap:DB$ Untap | UntapUpTo$ True | UntapType$ Land | Amount$ 4
|
||||||
SVar:Rarity:Uncommon
|
SVar:Rarity:Uncommon
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/rewind.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/rewind.jpg
|
||||||
SetInfo:8ED|Uncommon|http://magiccards.info/scans/en/8e/96.jpg
|
SetInfo:8ED|Uncommon|http://magiccards.info/scans/en/8e/96.jpg
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ Name:Snap
|
|||||||
ManaCost:1 U
|
ManaCost:1 U
|
||||||
Types:Instant
|
Types:Instant
|
||||||
Text:no text
|
Text:no text
|
||||||
A:SP$ChangeZone | Cost$ 1 U | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. Untap up to two lands. | SubAbility$ YouUntapUpTo/2/Land
|
A:SP$ChangeZone | Cost$ 1 U | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. Untap up to two lands. | SubAbility$ SVar=DBUntap
|
||||||
|
SVar:DBUntap:DB$ Untap | UntapUpTo$ True | UntapType$ Land | Amount$ 2
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/snap.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/snap.jpg
|
||||||
SetInfo:ULG|Common|http://magiccards.info/scans/en/ul/43.jpg
|
SetInfo:ULG|Common|http://magiccards.info/scans/en/ul/43.jpg
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ Text:no text
|
|||||||
A:SP$ ChangeZoneAll | Cost$ 4 U U | ChangeType$ Card | Origin$ Hand | Destination$ Library | Shuffle$ True | SubAbility$ SVar=DBChangeAll | SpellDescription$ Each player shuffles his or her graveyard and hand into his or her library
|
A:SP$ ChangeZoneAll | Cost$ 4 U U | ChangeType$ Card | Origin$ Hand | Destination$ Library | Shuffle$ True | SubAbility$ SVar=DBChangeAll | SpellDescription$ Each player shuffles his or her graveyard and hand into his or her library
|
||||||
SVar:DBChangeAll:DB$ChangeZoneAll | ChangeType$ Card | Origin$ Graveyard | Destination$ Library | SubAbility$ SVar=DBDraw
|
SVar:DBChangeAll:DB$ChangeZoneAll | ChangeType$ Card | Origin$ Graveyard | Destination$ Library | SubAbility$ SVar=DBDraw
|
||||||
SVar:DBDraw:DB$Draw | NumCards$ 7 | Defined$ Each | SubAbility$ SVar=DBChange | SpellDescription$ , then draws seven cards.
|
SVar:DBDraw:DB$Draw | NumCards$ 7 | Defined$ Each | SubAbility$ SVar=DBChange | SpellDescription$ , then draws seven cards.
|
||||||
SVar:DBChange:DB$ChangeZone | Origin$ Stack | Destination$ Exile | SubAbility$ YouUntapUpTo/6/Land | SpellDescription$ Exile Time Spiral. You untap up to six lands.
|
SVar:DBChange:DB$ChangeZone | Origin$ Stack | Destination$ Exile | SubAbility$ SVar=DBUntap | SpellDescription$ Exile Time Spiral. You untap up to six lands.
|
||||||
|
SVar:DBUntap:DB$ Untap | UntapUpTo$ True | UntapType$ Land | Amount$ 6
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/time_spiral.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/time_spiral.jpg
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ import forge.Card;
|
|||||||
import forge.CardList;
|
import forge.CardList;
|
||||||
import forge.CardListFilter;
|
import forge.CardListFilter;
|
||||||
import forge.ComputerUtil;
|
import forge.ComputerUtil;
|
||||||
|
import forge.GameAction;
|
||||||
import forge.MyRandom;
|
import forge.MyRandom;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
import forge.card.cardFactory.CardFactoryUtil;
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
import forge.card.spellability.Ability_Activated;
|
import forge.card.spellability.Ability_Activated;
|
||||||
import forge.card.spellability.Ability_Sub;
|
import forge.card.spellability.Ability_Sub;
|
||||||
@@ -111,38 +114,44 @@ public class AbilityFactory_PermanentState {
|
|||||||
|
|
||||||
public static String untapStackDescription(AbilityFactory af, SpellAbility sa){
|
public static String untapStackDescription(AbilityFactory af, SpellAbility sa){
|
||||||
// when getStackDesc is called, just build exactly what is happening
|
// when getStackDesc is called, just build exactly what is happening
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
final HashMap<String, String> params = af.getMapParams();
|
||||||
Card hostCard = sa.getSourceCard();
|
Card hostCard = sa.getSourceCard();
|
||||||
|
|
||||||
if (sa instanceof Ability_Sub)
|
|
||||||
sb.append(" ");
|
|
||||||
else
|
|
||||||
sb.append(sa.getSourceCard()).append(" - ");
|
|
||||||
|
|
||||||
sb.append("Untap ");
|
|
||||||
|
|
||||||
ArrayList<Card> tgtCards;
|
if (sa instanceof Ability_Sub)
|
||||||
Target tgt = af.getAbTgt();
|
sb.append(" ");
|
||||||
if (tgt != null)
|
else
|
||||||
tgtCards = tgt.getTargetCards();
|
sb.append(sa.getSourceCard()).append(" - ");
|
||||||
else{
|
|
||||||
tgtCards = AbilityFactory.getDefinedCards(hostCard, params.get("Defined"), sa);
|
sb.append("Untap ");
|
||||||
|
|
||||||
|
if (params.containsKey("UntapUpTo")) {
|
||||||
|
sb.append("up to ").append(params.get("Amount")).append(" ");
|
||||||
|
sb.append(params.get("UntapType")).append("s");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ArrayList<Card> tgtCards;
|
||||||
|
Target tgt = af.getAbTgt();
|
||||||
|
if (tgt != null)
|
||||||
|
tgtCards = tgt.getTargetCards();
|
||||||
|
else {
|
||||||
|
tgtCards = AbilityFactory.getDefinedCards(hostCard, params.get("Defined"), sa);
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator<Card> it = tgtCards.iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
sb.append(it.next());
|
||||||
|
if (it.hasNext())
|
||||||
|
sb.append(", ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<Card> it = tgtCards.iterator();
|
|
||||||
while(it.hasNext()) {
|
|
||||||
sb.append(it.next());
|
|
||||||
if(it.hasNext()) sb.append(", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.append(".");
|
sb.append(".");
|
||||||
|
|
||||||
Ability_Sub subAb = sa.getSubAbility();
|
Ability_Sub subAb = sa.getSubAbility();
|
||||||
if (subAb != null)
|
if (subAb != null)
|
||||||
sb.append(subAb.getStackDescription());
|
sb.append(subAb.getStackDescription());
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean untapCanPlayAI(final AbilityFactory af, SpellAbility sa){
|
public static boolean untapCanPlayAI(final AbilityFactory af, SpellAbility sa){
|
||||||
@@ -351,18 +360,22 @@ public class AbilityFactory_PermanentState {
|
|||||||
public static void untapResolve(final AbilityFactory af, final SpellAbility sa){
|
public static void untapResolve(final AbilityFactory af, final SpellAbility sa){
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
|
|
||||||
ArrayList<Card> tgtCards;
|
|
||||||
Target tgt = af.getAbTgt();
|
Target tgt = af.getAbTgt();
|
||||||
if (tgt != null)
|
ArrayList<Card> tgtCards = null;
|
||||||
tgtCards = tgt.getTargetCards();
|
|
||||||
else{
|
if (params.containsKey("UntapUpTo"))
|
||||||
tgtCards = AbilityFactory.getDefinedCards(card, params.get("Defined"), sa);
|
chooseUntapUpTo(af, sa, params);
|
||||||
}
|
else{
|
||||||
|
if (tgt != null)
|
||||||
for(Card tgtC : tgtCards){
|
tgtCards = tgt.getTargetCards();
|
||||||
if (AllZone.GameAction.isCardInPlay(tgtC) && (tgt == null || CardFactoryUtil.canTarget(af.getHostCard(), tgtC)))
|
else{
|
||||||
tgtC.untap();
|
tgtCards = AbilityFactory.getDefinedCards(card, params.get("Defined"), sa);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Card tgtC : tgtCards){
|
||||||
|
if (AllZone.GameAction.isCardInPlay(tgtC) && (tgt == null || CardFactoryUtil.canTarget(af.getHostCard(), tgtC)))
|
||||||
|
tgtC.untap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (af.hasSubAbility()){
|
if (af.hasSubAbility()){
|
||||||
@@ -379,6 +392,32 @@ public class AbilityFactory_PermanentState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void chooseUntapUpTo(AbilityFactory af, SpellAbility sa, HashMap<String,String> params){
|
||||||
|
int num = Integer.parseInt(params.get("Amount"));
|
||||||
|
String valid = params.get("UntapType");
|
||||||
|
|
||||||
|
Player activatingPlayer = sa.getActivatingPlayer();
|
||||||
|
|
||||||
|
// Reuse existing UntapUpTo Input
|
||||||
|
if (activatingPlayer.isHuman())
|
||||||
|
AllZone.InputControl.setInput(CardFactoryUtil.input_UntapUpToNType(num, valid));
|
||||||
|
else{
|
||||||
|
CardList list = new CardList(AllZone.Computer_Battlefield.getCards());
|
||||||
|
list = list.getType(valid);
|
||||||
|
list = list.getTapState("Tapped");
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
while(list.size() != 0 )
|
||||||
|
for(int i = 0; i < num && i < list.size(); i++){
|
||||||
|
|
||||||
|
Card c = CardFactoryUtil.AI_getBestLand(list);
|
||||||
|
c.untap();
|
||||||
|
list.remove(c);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ****************************************
|
// ****************************************
|
||||||
// ************** Tap *********************
|
// ************** Tap *********************
|
||||||
// ****************************************
|
// ****************************************
|
||||||
|
|||||||
@@ -3973,7 +3973,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectCard(Card card, PlayerZone zone) {
|
public void selectCard(Card card, PlayerZone zone) {
|
||||||
if(card.isLand() && zone.is(Constant.Zone.Battlefield)) {
|
if(card.isType(type) && zone.is(Constant.Zone.Battlefield)) {
|
||||||
card.untap();
|
card.untap();
|
||||||
count++;
|
count++;
|
||||||
if(count == stop) stop();
|
if(count == stop) stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user