mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixes for Flashback so it properly removes the card from the game.
- Added Retrieve to AF_Fetch for Retrieving cards from your graveyard. - Converted Hammer of Bogardan, Eternal Dragon, Undead Gladiator to AF_Retrieve - Added Soldevi Digger and Reassembling Skeleton
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -3398,6 +3398,7 @@ res/cardsfolder/reach_of_branches.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/reach_through_mists.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/reanimate.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/reaping_the_graves.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/reassembling_skeleton.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/reborn_hope.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/rebuff_the_wicked.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/rebuild.txt -text svneol=native#text/plain
|
||||
@@ -3969,6 +3970,7 @@ res/cardsfolder/snow_covered_swamp.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/snow_devil.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/sokenzan_bruiser.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/sol_ring.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/soldevi_digger.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/soldevi_simulacrum.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/soldevi_steam_beast.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/soldier_replica.txt -text svneol=native#text/plain
|
||||
|
||||
@@ -5,6 +5,7 @@ Text:no text
|
||||
PT:5/5
|
||||
K:Flying
|
||||
K:TypeCycling:Plains:2
|
||||
A:AB$Retrieve|Cost$3 W W|Destination$Hand|ActivatingZone$Graveyard|ActivatingPhases$Upkeep|PlayerTurn$True|SpellDescription$Return Eternal Dragon from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/eternal_dragon.jpg
|
||||
End
|
||||
|
||||
@@ -2,7 +2,8 @@ Name:Hammer of Bogardan
|
||||
ManaCost:1 R R
|
||||
Types:Sorcery
|
||||
Text:no text
|
||||
K:spDamageTgtCP:3
|
||||
A:SP$DealDamage|Cost$1 R R|Tgt$TgtCP|NumDmg$3|SpellDescription$CARDNAME deals 3 damage to target creature or player.
|
||||
A:AB$Retrieve|Cost$2 R R R|Destination$Hand|ActivatingZone$Graveyard|ActivatingPhases$Upkeep|PlayerTurn$True|SpellDescription$Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/hammer_of_bogardan.jpg
|
||||
End
|
||||
|
||||
9
res/cardsfolder/reassembling_skeleton.txt
Normal file
9
res/cardsfolder/reassembling_skeleton.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Name:Reassembling Skeleton
|
||||
ManaCost:1 B
|
||||
Types:Creature Skeleton Warrior
|
||||
Text:no text
|
||||
PT:1/1
|
||||
A:AB$Retrieve|Cost$1 B|Destination$Battlefield|ActivatingZone$Graveyard|Tapped$True|SpellDescription$Return Reassembling Skeleton from your graveyard to the battlefield tapped.
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/reassembling_skeleton.jpg
|
||||
End
|
||||
8
res/cardsfolder/soldevi_digger.txt
Normal file
8
res/cardsfolder/soldevi_digger.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Name:Soldevi Digger
|
||||
ManaCost:2
|
||||
Types:Artifact
|
||||
Text:no text
|
||||
A:AB$Retrieve|Cost$2|Destination$Library|LibraryPosition$-1|Defined$Top|SpellDescription$Put the top card of your graveyard on the bottom of your library.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/soldevi_digger.jpg
|
||||
End
|
||||
@@ -4,6 +4,7 @@ Types:Creature Zombie Barbarian
|
||||
Text:no text
|
||||
PT:3/1
|
||||
K:Cycling:1 B
|
||||
A:AB$Retrieve|Cost$1 B Discard<1/Any>|Destination$Hand|ActivatingZone$Graveyard|ActivatingPhases$Upkeep|PlayerTurn$True|Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/undead_gladiator.jpg
|
||||
End
|
||||
|
||||
@@ -129,9 +129,6 @@ public class AbilityFactory {
|
||||
isTargeted = true;
|
||||
}
|
||||
|
||||
if (mapParams.containsKey("ValidCards"))
|
||||
hasValid = true;
|
||||
|
||||
if (mapParams.containsKey("Tgt"))
|
||||
{
|
||||
isTargeted = true;
|
||||
@@ -143,7 +140,6 @@ public class AbilityFactory {
|
||||
abTgt = new Target("TgtV", mapParams.get("TgtPrompt"), mapParams.get("ValidTgts").split(","));
|
||||
else
|
||||
abTgt = new Target(mapParams.get("Tgt"));
|
||||
|
||||
if (mapParams.containsKey("TgtZone")) // if Targeting something not in play, this Key should be set
|
||||
abTgt.setZone(mapParams.get("TgtZone"));
|
||||
}
|
||||
@@ -195,6 +191,14 @@ public class AbilityFactory {
|
||||
}
|
||||
}
|
||||
|
||||
if (API.equals("Retrieve")){
|
||||
if (isAb)
|
||||
SA = AbilityFactory_Fetch.createAbilityRetrieve(this);
|
||||
if (isSp){
|
||||
SA = AbilityFactory_Fetch.createSpellRetrieve(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (API.equals("Pump"))
|
||||
{
|
||||
AbilityFactory_Pump afPump = new AbilityFactory_Pump(this);
|
||||
|
||||
@@ -5,10 +5,10 @@ import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
public class AbilityFactory_Fetch {
|
||||
// An AbilityFactory subclass for Fetching Cards from the Library
|
||||
// An AbilityFactory subclass for Fetching Cards from Places
|
||||
|
||||
//Destination$Battlefield|Valid$Basic|FetchNum$2|UpTo$True|[Tgt$TgtP]
|
||||
|
||||
// Fetch from the library
|
||||
public static SpellAbility createAbilityFetch(final AbilityFactory AF){
|
||||
final SpellAbility abFetch = new Ability_Activated(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()){
|
||||
private static final long serialVersionUID = 3728332812890211671L;
|
||||
@@ -68,7 +68,7 @@ public class AbilityFactory_Fetch {
|
||||
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
CardList library = AllZoneUtil.getPlayerCardsInLibrary(player);
|
||||
library = filterDeck(library, params);
|
||||
library = filterListByType(library, params, "FetchType");
|
||||
String DrawBack = params.get("SubAbility");
|
||||
String destination = params.get("Destination");
|
||||
Card card = af.getHostCard();
|
||||
@@ -111,7 +111,7 @@ public class AbilityFactory_Fetch {
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
Card card = af.getHostCard();
|
||||
CardList library = AllZoneUtil.getPlayerCardsInLibrary(player);
|
||||
library = filterDeck(library, params);
|
||||
library = filterListByType(library, params, "FetchType");
|
||||
String DrawBack = params.get("SubAbility");
|
||||
String destination = params.get("Destination");
|
||||
String type = params.get("FetchType");
|
||||
@@ -206,9 +206,9 @@ public class AbilityFactory_Fetch {
|
||||
}
|
||||
|
||||
|
||||
private static CardList filterDeck(CardList list, HashMap<String,String> params){
|
||||
if (params.containsKey("FetchType"))
|
||||
list = list.getValidCards(params.get("FetchType").split(","));
|
||||
private static CardList filterListByType(CardList list, HashMap<String,String> params, String type){
|
||||
if (params.containsKey(type))
|
||||
list = list.getValidCards(params.get(type).split(","));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -292,4 +292,199 @@ public class AbilityFactory_Fetch {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ********** Retrieve card from Graveyard ***********
|
||||
// Self Retrieval
|
||||
// A:AB$Retrieve|Cost$2 R R R|Destination$Hand|ActivatingZone$Graveyard
|
||||
// Targeted Retrieval
|
||||
// A:SP$Retrieve|Cost$B|Destination$Hand|TgtPrompt$Choose target creature card in your graveyard|ValidTgts$Creature|SpellDescription$<Desc>
|
||||
// Currently limited to returning itself or targeting one Valid
|
||||
// Defined Retrieval
|
||||
// A:AB$Retrieve|Cost$2|Destination$Library|LibraryPosition$-1|Defined$Top
|
||||
|
||||
public static SpellAbility createAbilityRetrieve(final AbilityFactory AF){
|
||||
final SpellAbility abRetrieve = new Ability_Activated(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()){
|
||||
private static final long serialVersionUID = 3728332812890211671L;
|
||||
|
||||
AbilityFactory af = AF;
|
||||
|
||||
public boolean canPlayAI(){
|
||||
return fetchCanPlayAI(this, AF);
|
||||
}
|
||||
|
||||
public boolean canPlay(){
|
||||
// super takes care of AdditionalCosts
|
||||
// make sure there's a legal Target
|
||||
|
||||
return super.canPlay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
Card retrieval = getTargetCard();
|
||||
|
||||
if(null == retrieval){
|
||||
// see if the choice is defined, like "Top" or "Random"
|
||||
if (AF.getMapParams().containsKey("Defined"))
|
||||
retrieval = retrieveDetermineDefined(AF.getMapParams().get("Defined"), getActivatingPlayer());
|
||||
else
|
||||
retrieval = this.getSourceCard();
|
||||
}
|
||||
|
||||
if (null != retrieval)
|
||||
doRetrieve(af, this, retrieval);
|
||||
}
|
||||
|
||||
};
|
||||
if (abRetrieve.getTarget() != null && !AF.getMapParams().containsKey("TgtZone"))
|
||||
abRetrieve.getTarget().setZone(Constant.Zone.Graveyard);
|
||||
return abRetrieve;
|
||||
}
|
||||
|
||||
public static SpellAbility createSpellRetrieve(final AbilityFactory AF){
|
||||
final SpellAbility spRetrieve = new Spell(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()) {
|
||||
private static final long serialVersionUID = 3270484211099902059L;
|
||||
|
||||
AbilityFactory af = AF;
|
||||
|
||||
public boolean canPlayAI(){
|
||||
return retrieveCanPlayAI(this, AF);
|
||||
}
|
||||
|
||||
public boolean canPlay(){
|
||||
// super takes care of AdditionalCosts
|
||||
return super.canPlay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
Card retrieval = getTargetCard();
|
||||
|
||||
if(null == retrieval){
|
||||
// see if the choice is defined, like "Top" or "Random"
|
||||
if (AF.getMapParams().containsKey("Defined"))
|
||||
retrieval = retrieveDetermineDefined(AF.getMapParams().get("Defined"), getActivatingPlayer());
|
||||
else
|
||||
retrieval = this.getSourceCard();
|
||||
}
|
||||
|
||||
if (null != retrieval)
|
||||
doRetrieve(af, this, retrieval);
|
||||
}
|
||||
};
|
||||
if (spRetrieve.getTarget() != null && !AF.getMapParams().containsKey("TgtZone"))
|
||||
spRetrieve.getTarget().setZone(Constant.Zone.Graveyard);
|
||||
return spRetrieve;
|
||||
}
|
||||
|
||||
private static Card retrieveDetermineDefined(String defined, Player player){
|
||||
CardList grave = AllZoneUtil.getCardsInZone(Constant.Zone.Graveyard, player);
|
||||
|
||||
if (defined.equals("Top")){
|
||||
// i think the "top" of the graveyard, is the last to be added to the graveyard list?
|
||||
if (grave.size() == 0)
|
||||
return null;
|
||||
return grave.get(grave.size()-1);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean retrieveCanPlayAI(SpellAbility sa, AbilityFactory af){
|
||||
// Retrieve either this card, or target Cards in Graveyard
|
||||
Ability_Cost abCost = af.getAbCost();
|
||||
Card source = af.getHostCard();
|
||||
|
||||
if (abCost != null){
|
||||
// AI currently disabled for these costs
|
||||
if (abCost.getSacCost()){
|
||||
// Sac is ok in general, but should add some decision making based off SacType and Retrieve Type
|
||||
}
|
||||
if (abCost.getLifeCost()){
|
||||
if (AllZone.ComputerPlayer.getLife() < 5)
|
||||
return false;
|
||||
}
|
||||
if (abCost.getDiscardCost()) return false;
|
||||
|
||||
if (abCost.getSubCounter()) return false;
|
||||
|
||||
}
|
||||
|
||||
if (!ComputerUtil.canPayCost(sa))
|
||||
return false;
|
||||
|
||||
Random r = new Random();
|
||||
// prevent run-away activations - first time will always return true
|
||||
boolean chance = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed());
|
||||
|
||||
Target tgt = af.getAbTgt();
|
||||
if(tgt != null) {
|
||||
// AI Targeting
|
||||
CardList list = AllZoneUtil.getPlayerGraveyard(AllZone.ComputerPlayer);
|
||||
list = list.getValidCards(tgt.getValidTgts(), AllZone.ComputerPlayer);
|
||||
|
||||
if (list.size() == 0)
|
||||
return false;
|
||||
|
||||
list.shuffle();
|
||||
sa.setTargetCard(list.get(0));
|
||||
// todo: the AI actually needs a "smart" way to choose before we add any Retrieve cards that tgt.
|
||||
// reuse some code from spReturn here
|
||||
}
|
||||
else{
|
||||
Card retrieval;
|
||||
if (af.getMapParams().containsKey("Defined")){
|
||||
retrieval = retrieveDetermineDefined(af.getMapParams().get("Defined"), sa.getActivatingPlayer());
|
||||
if (retrieval == null)
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
retrieval = sa.getSourceCard();
|
||||
}
|
||||
}
|
||||
|
||||
// todo: add more decision making for Retrieve
|
||||
|
||||
return ((r.nextFloat() < .8) && chance);
|
||||
}
|
||||
|
||||
private static void doRetrieve(AbilityFactory af, final SpellAbility sa, Card tgt){
|
||||
// retrieve currently can't target things due to a lack of an input method
|
||||
HashMap<String,String> params = af.getMapParams();
|
||||
|
||||
Player player = sa.getActivatingPlayer();
|
||||
CardList grave = AllZoneUtil.getPlayerGraveyard(player);
|
||||
grave = filterListByType(grave, params, "RetrieveType");
|
||||
|
||||
String DrawBack = params.get("SubAbility");
|
||||
String destination = params.get("Destination");
|
||||
Card card = af.getHostCard();
|
||||
|
||||
if(grave.size() == 0 || destination == null)
|
||||
return;
|
||||
|
||||
grave.remove(tgt);
|
||||
AllZone.getZone(tgt).remove(tgt);
|
||||
|
||||
if (destination.equals("Hand"))
|
||||
AllZone.getZone(Constant.Zone.Hand, player).add(tgt); //move to hand
|
||||
else if (destination.equals("Library")){
|
||||
int libraryPosition = 0; // this needs to be zero indexed. Top = 0, Third = 2, -1 = Bottom
|
||||
if (params.containsKey("LibraryPosition"))
|
||||
libraryPosition = Integer.parseInt(params.get("LibraryPosition"));
|
||||
|
||||
if (libraryPosition == -1)
|
||||
libraryPosition = AllZone.Human_Library.size();
|
||||
|
||||
AllZone.getZone(Constant.Zone.Library, player).add(tgt, libraryPosition); //move to library
|
||||
}
|
||||
else if (destination.equals("Battlefield")){
|
||||
AllZone.getZone(Constant.Zone.Play, player).add(tgt); //move to battlefield
|
||||
if (params.containsKey("Tapped"))
|
||||
tgt.tap();
|
||||
}
|
||||
|
||||
if (af.hasSubAbility())
|
||||
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
|
||||
}//if
|
||||
}
|
||||
|
||||
@@ -1125,16 +1125,13 @@ public class CardFactoryUtil {
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, sourceCard.getController());
|
||||
PlayerZone removed = AllZone.getZone(Constant.Zone.Removed_From_Play, sourceCard.getController());
|
||||
|
||||
SpellAbility[] sa = sourceCard.getSpellAbility();
|
||||
|
||||
AllZone.Stack.add(sa[0]);
|
||||
|
||||
grave.remove(sourceCard);
|
||||
removed.add(sourceCard);
|
||||
SpellAbility flash = sa[0];
|
||||
flash.setFlashBackAbility(true);
|
||||
AllZone.Stack.add(flash);
|
||||
|
||||
//AllZone.GameAction.getPlayerLife(sourceCard.getController()).subtractLife(loss,sourceCard);
|
||||
sourceCard.getController().loseLife(loss, sourceCard);
|
||||
|
||||
}
|
||||
@@ -1162,7 +1159,6 @@ public class CardFactoryUtil {
|
||||
String lifecost = "";
|
||||
if(loss != 0) lifecost = ", pay " + lifeloss + " life";
|
||||
|
||||
flashback.setFlashBackAbility(true);
|
||||
flashback.setManaCost(manaCost);
|
||||
|
||||
StringBuilder sbDesc = new StringBuilder();
|
||||
@@ -3597,19 +3593,33 @@ public class CardFactoryUtil {
|
||||
return cl;
|
||||
}
|
||||
|
||||
public static CardList getFlashbackUnearthCards(Player player) {
|
||||
final CardList crucible = AllZoneUtil.getPlayerCardsInPlay(player, "Crucible of Worlds");
|
||||
|
||||
public static CardList getGraveyardActivationCards(final Player player) {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player);
|
||||
CardList cl = new CardList(grave.getCards());
|
||||
cl = cl.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.hasFlashback() || c.hasUnearth() || (c.isLand() && crucible.size() > 0);
|
||||
return activateFromGrave(c, player);
|
||||
}
|
||||
});
|
||||
return cl;
|
||||
}
|
||||
|
||||
public static boolean activateFromGrave(Card c, Player player){
|
||||
if (c.hasFlashback() || c.hasUnearth())
|
||||
return true;
|
||||
|
||||
final CardList crucible = AllZoneUtil.getPlayerCardsInPlay(player, "Crucible of Worlds");
|
||||
if (c.isLand() && crucible.size() > 0)
|
||||
return true;
|
||||
|
||||
for(SpellAbility sa : c.getSpellAbility()){
|
||||
if (sa.getRestrictions().getActivateZone().equals(Constant.Zone.Graveyard))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int countOccurrences(String arg1, String arg2) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
@@ -11083,98 +11083,6 @@ public class CardFactory_Creatures {
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Eternal Dragon")) {
|
||||
final Ability ability = new Ability(card, "3 W W") {
|
||||
|
||||
private static final long serialVersionUID = -5633265048009L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
|
||||
grave.remove(card);
|
||||
hand.add(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
|
||||
return AllZone.GameAction.isCardInZone(card, grave) && AllZone.Phase.isPlayerTurn(card.getController()) && hand.size() > 0;
|
||||
}
|
||||
};//Ability
|
||||
|
||||
card.addSpellAbility(ability);
|
||||
ability.setFlashBackAbility(true);
|
||||
card.setUnearth(true);
|
||||
ability.setDescription("3 W W: Return Eternal Dragon from your graveyard to your hand. Activate this ability only during your upkeep.");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(card.getName()).append(" returns from the graveyard to hand");
|
||||
ability.setStackDescription(sb.toString());
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Undead Gladiator")) {
|
||||
final Ability ability = new Ability(card, "1 B") {
|
||||
|
||||
private static final long serialVersionUID = -56339412048009L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
|
||||
grave.remove(card);
|
||||
hand.add(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
|
||||
return AllZone.GameAction.isCardInZone(card, grave) && AllZone.Phase.isPlayerTurn(card.getController()) && hand.size() > 0;
|
||||
}
|
||||
};//Ability
|
||||
|
||||
Input target = new Input() {
|
||||
|
||||
private static final long serialVersionUID = 42466124531655L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
AllZone.Display.showMessage("Select a card to discard");
|
||||
ButtonUtil.enableOnlyCancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectCard(Card c, PlayerZone zone) {
|
||||
PlayerZone Player_Hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
if(AllZone.GameAction.isCardInZone(c, Player_Hand)) {
|
||||
c.getController().discard(c,ability);
|
||||
AllZone.Stack.add(ability);
|
||||
stopSetNext(new ComputerAI_StackNotEmpty());
|
||||
}
|
||||
}//selectCard()
|
||||
};//Input
|
||||
|
||||
card.addSpellAbility(ability);
|
||||
ability.setFlashBackAbility(true);
|
||||
card.setUnearth(true);
|
||||
ability.setDescription("1 B, Discard a card: Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep.");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(card.getName()).append(" returns from the graveyard to hand");
|
||||
ability.setStackDescription(sb.toString());
|
||||
ability.setAfterPayMana(target);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
if(cardName.equals("Doomed Necromancer")) {
|
||||
final SpellAbility ability = new Ability_Tap(card, "B") {
|
||||
|
||||
@@ -4044,45 +4044,6 @@ public class CardFactory_Sorceries {
|
||||
card.addSpellAbility(spell);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Hammer of Bogardan")) {
|
||||
final Ability ability2 = new Ability(card, "2 R R R") {
|
||||
|
||||
private static final long serialVersionUID = -5633123448009L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
// PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
// grave.remove(card);
|
||||
card.addReplaceMoveToGraveyardCommand(new Command() {
|
||||
private static final long serialVersionUID = -25594893330418L;
|
||||
|
||||
public void execute() {
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
AllZone.GameAction.moveTo(hand, card);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
|
||||
return AllZone.GameAction.isCardInZone(card, grave) && AllZone.Phase.isPlayerTurn(card.getController());
|
||||
}
|
||||
|
||||
};
|
||||
card.addSpellAbility(ability2);
|
||||
ability2.setFlashBackAbility(true);
|
||||
card.setUnearth(true);
|
||||
ability2.setDescription("2 R R R: Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep.");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(card.getName()).append(" returns from the graveyard to hand");
|
||||
ability2.setStackDescription(sb.toString());
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Innocent Blood")) {
|
||||
|
||||
@@ -136,7 +136,7 @@ public class ComputerUtil
|
||||
CardList all = new CardList();
|
||||
all.addAll(AllZone.Computer_Play.getCards());
|
||||
all.addAll(AllZone.Computer_Hand.getCards());
|
||||
all.addAll(CardFactoryUtil.getFlashbackUnearthCards(AllZone.ComputerPlayer).toArray());
|
||||
all.addAll(CardFactoryUtil.getGraveyardActivationCards(AllZone.ComputerPlayer).toArray());
|
||||
|
||||
CardList humanPlayable = new CardList();
|
||||
humanPlayable.addAll(AllZone.Human_Play.getCards());
|
||||
|
||||
@@ -149,7 +149,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo
|
||||
|
||||
@Override
|
||||
protected Card[] getCards() {
|
||||
return CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).toArray();
|
||||
return CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -481,7 +481,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo
|
||||
playerHandValue.setText("" + AllZone.Human_Hand.getCards().length);
|
||||
playerGraveValue.setText("" + AllZone.Human_Graveyard.getCards().length);
|
||||
playerLibraryValue.setText("" + AllZone.Human_Library.getCards().length);
|
||||
playerFBValue.setText("" + CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).size());
|
||||
playerFBValue.setText("" + CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).size());
|
||||
playerRemovedValue.setText("" + AllZone.Human_Removed.getCards().length);
|
||||
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
||||
|
||||
@Override
|
||||
protected Card[] getCards() {
|
||||
return CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).toArray();
|
||||
return CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -463,7 +463,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
||||
playerHandValue.setText("" + AllZone.Human_Hand.getCards().length);
|
||||
playerGraveValue.setText("" + AllZone.Human_Graveyard.getCards().length);
|
||||
playerLibraryValue.setText("" + AllZone.Human_Library.getCards().length);
|
||||
playerFBValue.setText("" + CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).size());
|
||||
playerFBValue.setText("" + CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).size());
|
||||
playerRemovedValue.setText("" + AllZone.Human_Removed.getCards().length);
|
||||
|
||||
}
|
||||
|
||||
@@ -436,12 +436,17 @@ public class MagicStack extends MyObservable {
|
||||
}
|
||||
|
||||
// Handle cards that need to be moved differently
|
||||
if (sa.isFlashBackAbility())
|
||||
c.replaceMoveToGraveyard();
|
||||
if (sa.isFlashBackAbility()){
|
||||
AllZone.GameAction.exile(c);
|
||||
sa.setFlashBackAbility(false);
|
||||
}
|
||||
|
||||
else if (fizzle)
|
||||
else if (fizzle && sa.isSpell())
|
||||
AllZone.GameAction.moveToGraveyard(c);
|
||||
|
||||
else if (sa.isAbility())
|
||||
{} // don't send to graveyard if the spell is using an ability
|
||||
|
||||
else if ((c.isInstant() || c.isSorcery()) && (!c.getName().startsWith("Beacon of"))
|
||||
&& (!c.getName().startsWith("Pulse of the")))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user