From df559b9abffe848fe9f0028eb10d8c4ef838cc2d Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 03:08:57 +0000 Subject: [PATCH] - Fixed Dakmor Ghoul CIP text. - Added Chronatog, Kismet, Frozen AEther, Loxodon Gatekeeper, Gush. - Removed warnings (mostly just by adding a @SuppressWarnings("unused"); ) from the JLayer libs. - Removed some old commented out code of cards that have been replaced by keywords. - Boreal Centaur and Knight of the Skyward Eye abilities can only be used once per turn now. --- res/cards.txt | 27 + res/main.properties | 2 +- src/forge/CardFactory.java | 1260 ++--------------- src/forge/CardFactoryUtil.java | 19 + src/forge/CardFactory_Creatures.java | 81 +- src/forge/CardListUtil.java | 20 + src/forge/ComputerUtil.java | 1 + src/forge/GameAction.java | 6 + src/forge/Phase.java | 30 + src/forge/PlayerZone_ComesIntoPlay.java | 7 +- src/forge/SpellAbility.java | 10 +- src/javazoom/jl/converter/RiffFile.java | 2 + .../jl/converter/WaveFileObuffer.java | 9 +- src/javazoom/jl/converter/jlc.java | 2 + src/javazoom/jl/decoder/BitReserve.java | 1 + src/javazoom/jl/decoder/Bitstream.java | 3 + .../jl/decoder/BitstreamException.java | 5 +- src/javazoom/jl/decoder/Decoder.java | 1 + src/javazoom/jl/decoder/DecoderException.java | 1 + src/javazoom/jl/decoder/JavaLayerError.java | 3 +- .../jl/decoder/JavaLayerException.java | 2 +- src/javazoom/jl/decoder/JavaLayerUtils.java | 4 + src/javazoom/jl/decoder/SynthesisFilter.java | 3 + src/javazoom/jl/decoder/huffcodetab.java | 7 + .../jl/player/AudioDeviceFactory.java | 1 + src/javazoom/jl/player/FactoryRegistry.java | 7 +- src/javazoom/jl/player/Player.java | 1 + src/javazoom/jl/player/PlayerApplet.java | 2 + .../jl/player/advanced/AdvancedPlayer.java | 2 + 29 files changed, 292 insertions(+), 1227 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index dc2cb5d0d7b..f523fd8eb6c 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,30 @@ +Chronatog +1 U +Creature Atog +no text +1/2 + +Loxodon Gatekeeper +2 W W +Creature Elephant Soldier +Artifacts, creatures, and lands your opponents control enter the battlefield tapped. +2/3 + +Frozen AEther +3 U +Enchantment +Artifacts, creatures, and lands your opponents control enter the battlefield tapped. + +Kismet +3 W +Enchantment +Artifacts, creatures, and lands your opponents control enter the battlefield tapped. + +Gush +4 U +Instant +no text + Stasis 1 U Enchantment diff --git a/res/main.properties b/res/main.properties index e756da7a054..0ac2588a084 100644 --- a/res/main.properties +++ b/res/main.properties @@ -1,6 +1,6 @@ program/mail=mtgerror@yahoo.com program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 -program/version=Forge -- official beta: 09/12/14, SVN revision: 245 +program/version=Forge -- official beta: 09/12/14, SVN revision: 246 tokens--file=AllTokens.txt diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 85b761b77d7..619f72c64f1 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -3477,8 +3477,6 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** - - //contributed code @@ -4168,147 +4166,6 @@ public class CardFactory implements NewConstants { }//*************** END ************ END ************************** -/* - //*************** START *********** START ************************** - else if(cardName.equals("Terror")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 8809370679594989382L; - - public boolean canPlayAI() - { - return (getCreature().size() != 0) && (AllZone.Phase.getTurn() > 4); - } - public void chooseTargetAI() - { - Card best = CardFactoryUtil.AI_getBestCreature(getCreature()); - setTargetCard(best); - } - CardList getCreature() - { - CardList list = CardFactoryUtil.AI_getHumanCreature(card, true); - list = list.filter(new CardListFilter() - { - public boolean addCard(Card c) - { - return (! CardUtil.getColors(c).contains(Constant.Color.Black)) && - (! c.getType().contains("Artifact")) && - (2 < c.getNetAttack()); - } - }); - return list; - }//getCreature() - public void resolve() - { - if (AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard())) - AllZone.GameAction.destroyNoRegeneration(getTargetCard()); - }//resolve() - }; - - Input runtime = new Input() - { - private static final long serialVersionUID = -1750678113925588670L; - - public void showMessage() - { - CardList choice = new CardList(); - choice.addAll(AllZone.Human_Play.getCards()); - choice.addAll(AllZone.Computer_Play.getCards()); - - choice = choice.getType("Creature"); - choice = choice.filter(new CardListFilter() - { - public boolean addCard(Card c) - { - return (! CardUtil.getColors(c).contains(Constant.Color.Black)) && - (! c.getType().contains("Artifact")); - } - }); - - stopSetNext(CardFactoryUtil.input_targetSpecific(spell, choice, "Select target non-artifact, non-black creature to destroy.", true)); - } - }; - - card.clearSpellAbility(); - spell.setBeforePayMana(runtime); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** -*/ - - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Expunge")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 5773953475935635628L; - - public boolean canPlayAI() - { - return (getCreature().size() != 0) && (AllZone.Phase.getTurn() > 4); - } - public void chooseTargetAI() - { - Card best = CardFactoryUtil.AI_getBestCreature(getCreature()); - setTargetCard(best); - } - CardList getCreature() - { - CardList list = CardFactoryUtil.AI_getHumanCreature(card, true); - list = list.filter(new CardListFilter() - { - public boolean addCard(Card c) - { - return (! CardUtil.getColors(c).contains(Constant.Color.Black)) && - (! c.getType().contains("Artifact")) && - (2 < c.getNetAttack()); - } - }); - return list; - }//getCreature() - public void resolve() - { - AllZone.GameAction.destroyNoRegeneration(getTargetCard()); - }//resolve() - }; - - Input runtime = new Input() - { - private static final long serialVersionUID = 3015711791310250186L; - - public void showMessage() - { - CardList choice = new CardList(); - choice.addAll(AllZone.Human_Play.getCards()); - choice.addAll(AllZone.Computer_Play.getCards()); - - choice = choice.getType("Creature"); - choice = choice.filter(new CardListFilter() - { - public boolean addCard(Card c) - { - return (! CardUtil.getColors(c).contains(Constant.Color.Black)) && - (! c.getType().contains("Artifact")); - } - }); - - stopSetNext(CardFactoryUtil.input_targetSpecific(spell, choice, "Select target non-artifact, non-black creature to destroy.", true)); - } - }; - - card.clearSpellAbility(); - spell.setBeforePayMana(runtime); - - spell.setDescription(card.getText()); - card.addSpellAbility(spell); - - - card.addSpellAbility(CardFactoryUtil.ability_cycle(card, "2")); - }//*************** END ************ END ************************** -*/ - //*************** START *********** START ************************** else if(cardName.equals("Pongify")) @@ -7907,65 +7764,6 @@ public class CardFactory implements NewConstants { spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); }//*************** END ************ END ************************** - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Douse in Gloom")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 7134826062024728943L; - - public boolean canPlayAI() - { - CardList c = getCreature(); - if(c.isEmpty()) - return false; - else - { - setTargetCard(c.get(0)); - return true; - } - }//canPlayAI() - CardList getCreature() - { - CardList out = new CardList(); - CardList list = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - list.shuffle(); - - for(int i = 0; i < list.size(); i++) - if((list.get(i).getNetAttack() >= 2) && (list.get(i).getNetDefense() <= 2)) - out.add(list.get(i)); - - //in case human player only has a few creatures in play, target anything - if(out.isEmpty() && - 0 < CardFactoryUtil.AI_getHumanCreature(2, card, true).size() && - 3 > CardFactoryUtil.AI_getHumanCreature(card, true).size()) - { - out.addAll(CardFactoryUtil.AI_getHumanCreature(2, card, true).toArray()); - CardListUtil.sortFlying(out); - } - return out; - }//getCreature() - - - public void resolve() - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) - { - getTargetCard().addDamage(2, card); - AllZone.GameAction.getPlayerLife(card.getController()).addLife(2); - } - }//resolve() - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); - }//*************** END ************ END ************************** -*/ - - //*************** START *********** START ************************** else if(cardName.equals("Echoing Decay")) { @@ -8499,244 +8297,6 @@ public class CardFactory implements NewConstants { }//*************** END ************ END ************************** -/* - //*************** START *********** START ************************** - else if(cardName.equals("Cackling Flames")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 2635417318395677454L; - - int damage = 3; - Card check; - public boolean canPlayAI() - { - if(AllZone.Human_Life.getLife() <= damage) - return true; - - check = getFlying(); - return check != null; - } - public void chooseTargetAI() - { - if(AllZone.Human_Life.getLife() <= damage) - { - setTargetPlayer(Constant.Player.Human); - return; - } - - Card c = getFlying(); - if((c == null) || (! check.equals(c))) - throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() - { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) - return flying.get(i); - - return null; - } - - public void resolve() - { - int damage = getDamage(); - - if(getTargetCard() != null) - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) - { - Card c = getTargetCard(); - c.addDamage(damage, card); - } - } - else - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - } - int getDamage() - { - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - if(hand.size() == 0) - return 5; - - return 3; - } - };//SpellAbility - card.clearSpellAbility(); - - card.addSpellAbility(spell); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell,true)); - }//*************** END ************ END ************************** -*/ - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Mob Justice")) - { - final SpellAbility spell = new Spell(card) - { - - private static final long serialVersionUID = -671093248575416927L; - - public boolean canPlayAI() - { - int damage = countControlledCreatures(Constant.Player.Computer); - - if(AllZone.Human_Life.getLife() <= damage || damage >= 4) - return true; - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if (hand.size() >= 8) - return true; - - return false; - } - public void chooseTargetAI() - { - setTargetPlayer(Constant.Player.Human); - }//chooseTargetAI() - - public void resolve() - { - int damage = countControlledCreatures(card.getController()); - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - } - //count basic lands you control - int countControlledCreatures(String player) - { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); - CardList creatures = new CardList(play.getCards()); - creatures = creatures.getType("Creature"); - - return creatures.size(); - }//countControlledCreatures(); - - };//SpellAbility - card.clearSpellAbility(); - - card.addSpellAbility(spell); - - spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); - }//*************** END ************ END ************************** -*/ - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Tribal Flames")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -9055422004395136061L; - - Card check; - public boolean canPlayAI() - { - int damage = countLandTypes(); - - if(AllZone.Human_Life.getLife() <= damage) - return true; - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if (hand.size() >= 8) - return true; - - check = getFlying(); - return check != null; - } - public void chooseTargetAI() - { - int damage = countLandTypes(); - - if(AllZone.Human_Life.getLife() <= damage) - { - setTargetPlayer(Constant.Player.Human); - return; - } - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if(getFlying() == null && hand.size() >= 7 ) //not 8, since it becomes 7 when getting cast - { - setTargetPlayer(Constant.Player.Human); - return; - } - - Card c = getFlying(); - if((c == null) || (! check.equals(c))) - throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() - { - int damage = countLandTypes(); - - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) - return flying.get(i); - - return null; - } - - - public void resolve() - { - int damage = countLandTypes(); - - if(getTargetCard() != null) - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) - { - Card c = getTargetCard(); - c.addDamage(damage, card); - } - } - else - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - } - //count basic lands you control - int countLandTypes() - { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); - CardList land = new CardList(play.getCards()); - - String basic[] = {"Forest", "Plains", "Mountain", "Island", "Swamp"}; - int count = 0; - - for(int i = 0; i < basic.length; i++) - { - CardList c = land.getType(basic[i]); - if(! c.isEmpty()) - count++; - } - - return count; - }//countLandTypes() - - };//SpellAbility - card.clearSpellAbility(); - - card.addSpellAbility(spell); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell,true)); - }//*************** END ************ END ************************** -*/ - - //*************** START *********** START ************************** else if(cardName.equals("Erratic Explosion")) { @@ -8828,230 +8388,6 @@ public class CardFactory implements NewConstants { spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell, true)); }//*************** END ************ END ************************** - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Char")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -1379875309204771345L; - - int damage = 4; - Card check; - public boolean canPlayAI() - { - if(AllZone.Computer_Life.getLife() < 2) - return false; - - if(AllZone.Human_Life.getLife() <= damage) - return true; - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if (hand.size() >= 8) - return true; - - check = getFlying(); - return check != null; - } - public void chooseTargetAI() - { - if(AllZone.Human_Life.getLife() <= damage) - { - setTargetPlayer(Constant.Player.Human); - return; - } - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if(getFlying() == null && hand.size() >= 7 ) //not 8, since it becomes 7 when getting cast - { - setTargetPlayer(Constant.Player.Human); - return; - } - - Card c = getFlying(); - if((c == null) || (! check.equals(c))) - throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() - { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) - return flying.get(i); - - return null; - } - public void resolve() - { - if(getTargetCard() != null) - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) - { - Card c = getTargetCard(); - c.addDamage(damage, card); - AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(2); - } - } - else - { - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(2); - } - - } - };//SpellAbility - card.clearSpellAbility(); - card.addSpellAbility(spell); - - Input target = new Input() - { - private static final long serialVersionUID = -7645439029870010010L; - - public void showMessage() - { - AllZone.Display.showMessage("Select target Creature, Player or Planeswalker"); - ButtonUtil.enableOnlyCancel(); - } - public void selectButtonCancel() {stop();} - public void selectCard(Card card, PlayerZone zone) - { - if((card.isCreature() || card.isPlaneswalker())&& zone.is(Constant.Zone.Play)) - { - spell.setTargetCard(card); - stopSetNext(new Input_PayManaCost(spell)); - } - }//selectCard() - public void selectPlayer(String player) - { - spell.setTargetPlayer(player); - stopSetNext(new Input_PayManaCost(spell)); - } - }; - spell.setBeforePayMana(target); - }//*************** END ************ END ************************** -*/ - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Psionic Blast")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -5315747587330795963L; - - int damage = 4; - Card check; - public boolean canPlayAI() - { - if(AllZone.Computer_Life.getLife() <= 2) - return false; - - if(AllZone.Human_Life.getLife() <= damage) - return true; - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if (hand.size() >= 8) - return true; - - check = getFlying(); - return check != null; - } - public void chooseTargetAI() - { - if(AllZone.Human_Life.getLife() <= damage) - { - setTargetPlayer(Constant.Player.Human); - return; - } - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if(getFlying() == null && hand.size() >= 7 ) //not 8, since it becomes 7 when getting cast - { - setTargetPlayer(Constant.Player.Human); - return; - } - - Card c = getFlying(); - if((c == null) || (! check.equals(c))) - throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() - { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) - return flying.get(i); - - return null; - } - public void resolve() - { - if(getTargetCard() != null) - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard())) - { - Card c = getTargetCard(); - c.addDamage(damage, card); - AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(2); - } - } - else - { - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(2); - } - - } - };//SpellAbility - card.clearSpellAbility(); - card.addSpellAbility(spell); - - Input target = new Input() - { - private static final long serialVersionUID = -3883369136409452222L; - - public void showMessage() - { - AllZone.Display.showMessage("Select target Creature, Player or Planeswalker"); - ButtonUtil.enableOnlyCancel(); - } - public void selectButtonCancel() {stop();} - public void selectCard(Card card, PlayerZone zone) - { - if((card.isCreature() || card.isPlaneswalker())&& zone.is(Constant.Zone.Play)) - { - spell.setTargetCard(card); - stopSetNext(new Input_PayManaCost(spell)); - } - }//selectCard() - public void selectPlayer(String player) - { - spell.setTargetPlayer(player); - stopSetNext(new Input_PayManaCost(spell)); - } - }; - spell.setBeforePayMana(target); - }//*************** END ************ END ************************** -*/ - - //*************** START *********** START ************************** else if(cardName.equals("Hidetsugu's Second Rite")) { @@ -11609,56 +10945,6 @@ public class CardFactory implements NewConstants { card.setFlashback(true); }//*************** END ************ END ************************** - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Tendrils of Corruption")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -618587752177627111L; - - public boolean canPlayAI() - { - CardList human = CardFactoryUtil.AI_getHumanCreature(card, true); - return 0 < human.size(); - }//canPlayAI() - - public void chooseTargetAI() - { - CardList human = CardFactoryUtil.AI_getHumanCreature(card, true); - CardListUtil.sortAttack(human); - setTargetCard(human.get(0)); - } - - public void resolve() - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) - { - int n = countSwamps(); - getTargetCard().addDamage(n, card); - - PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController()); - life.addLife(n); - } - }//resolve() - - int countSwamps() - { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); - CardList list = new CardList(play.getCards()); - list = list.getType("Swamp"); - return list.size(); - } - };//SpellAbility - spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); - - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** -*/ - - //*************** START *********** START ************************** else if(cardName.equals("Ichor Slick")) { @@ -13345,110 +12631,6 @@ public class CardFactory implements NewConstants { spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); }//*************** END ************ END ************************** - - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Lightning Helix")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -2880908876263802588L; - int damage = 3; - Card check; - public boolean canPlayAI() - { - if(AllZone.Human_Life.getLife() <= damage) - return true; - - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - CardList hand = new CardList(compHand.getCards()); - - if (hand.size() >= 8) - return true; - - check = getFlying(); - return check != null; - } - public void chooseTargetAI() - { - if(AllZone.Human_Life.getLife() <= damage) - { - setTargetPlayer(Constant.Player.Human); - return; - } - - Card c = getFlying(); - if((c == null) || (! check.equals(c))) - throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check); - - if (c == null) { - setTargetPlayer(Constant.Player.Human); - return; - } - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() - { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) - return flying.get(i); - - return null; - } - - public void resolve() - { - if(getTargetCard() != null) - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard())) - { - Card c = getTargetCard(); - c.addDamage(damage, card); - } - } - else - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - AllZone.GameAction.getPlayerLife(card.getController()).addLife(3); - - } - };//SpellAbility - card.clearSpellAbility(); - card.addSpellAbility(spell); - - Input target = new Input() - { - private static final long serialVersionUID = -924544537419004913L; - public void showMessage() - { - AllZone.Display.showMessage("Select target Creature, Player or Planeswalker"); - ButtonUtil.enableOnlyCancel(); - } - public void selectButtonCancel() {stop();} - public void selectCard(Card card, PlayerZone zone) - { - if(!CardFactoryUtil.canTarget(spell, card)){ - AllZone.Display.showMessage("Cannot target this card (Shroud? Protection?)."); - } - else if((card.isCreature() || card.isPlaneswalker()) && zone.is(Constant.Zone.Play)) - { - spell.setTargetCard(card); - stopSetNext(new Input_PayManaCost(spell)); - } - }//selectCard() - public void selectPlayer(String player) - { - spell.setTargetPlayer(player); - stopSetNext(new Input_PayManaCost(spell)); - } - }; - spell.setBeforePayMana(target); - }//*************** END ************ END ************************** -*/ - //*************** START *********** START ************************** else if(cardName.equals("Hoofprints of the Stag")) @@ -13651,43 +12833,8 @@ public class CardFactory implements NewConstants { ability.setBeforePayMana(runtime); }//*************** END ************ END ************************** - - /* - //*************** START *********** START ************************** - else if (cardName.equals("Acridian")) - { - final String player = card.getController(); - - final Ability echo = new Ability(card, "1 G") - { - public void resolve() - { - card.setEchoPaid(true); - System.out.println("set echo to true"); - } - public boolean canPlay() - { - //this is set to false, since it should only TRIGGER - return false; - } - };// ability2 - //card.clearSpellAbility(); - card.addSpellAbility(echo); - echo.setStackDescription(card.getName() + " - " + player + " paid echo."); - - Command paid = new Command() {public void execute() {AllZone.Stack.add(echo);}}; - - //echo.setBeforePayMana(new Input_PayManaCost_Ability(echo.getManaCost(), paid)); - echo.setAfterPayMana(new Input_PayManaCost_Ability(echo.getManaCost(), paid)); - - - }//*************** END ************ END ************************** - - */ - - //*************** START *********** START ************************** else if(cardName.equals("Hatching Plans")) { @@ -15653,209 +14800,6 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Shatter")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -8518902112426882210L; - - public boolean canPlayAI() - { - return (getArtifact().size() != 0) && (AllZone.Phase.getTurn() > 4); - } - public void chooseTargetAI() - { - if(getArtifact().size() != 0){ - Card bestArtifact = CardFactoryUtil.AI_getBestArtifact(getArtifact()); - setTargetCard(bestArtifact); - } - }//getEnchantment() - CardList getArtifact() - { - CardList list = CardFactoryUtil.AI_getHumanArtifact(card, true); - return list; - }//getArtifact() - public void resolve() - { - AllZone.GameAction.destroy(getTargetCard()); - }//resolve() - }; - - Input runtime = new Input() - { - private static final long serialVersionUID = 7950082427462078698L; - - public void showMessage() - { - //Display all artifacts in play - //Allow human player to select which one to destroy - CardList allCards = new CardList(); - allCards.addAll(AllZone.Human_Play.getCards()); - allCards.addAll(AllZone.Computer_Play.getCards()); - - //get artifacts - CardList allArtifacts = allCards.getType("Artifact"); - stopSetNext(CardFactoryUtil.input_targetSpecific(spell, allArtifacts, "Select target Artifact to destroy.",true)); - - } - }; - - card.clearSpellAbility(); - spell.setBeforePayMana(runtime); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** -*/ - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Disenchant") || cardName.equals("Naturalize")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 6231507037766815249L; - - public boolean canPlayAI() - { - return (getEnchantment().size() != 0 || getArtifact().size() != 0) && (AllZone.Phase.getTurn() > 4); - } - public void chooseTargetAI() - { - if(getEnchantment().size() != 0) - { - Card bestEnchantment = CardFactoryUtil.AI_getBestEnchantment(getEnchantment(), card, true); - if(getArtifact().size() != 0){ - Card bestArtifact = CardFactoryUtil.AI_getBestArtifact(getArtifact()); - if(CardUtil.getConvertedManaCost(bestArtifact.getManaCost()) > CardUtil.getConvertedManaCost(bestEnchantment.getManaCost())){ - setTargetCard(bestArtifact); - } - else{ - setTargetCard(bestEnchantment); - } - } - else{ - setTargetCard(bestEnchantment); - } - } - else if(getArtifact().size() != 0){ - Card bestArtifact = CardFactoryUtil.AI_getBestArtifact(getArtifact()); - setTargetCard(bestArtifact); - } - - } - CardList getEnchantment() - { - CardList list = CardFactoryUtil.AI_getHumanEnchantment(card, true); - list = list.filter(new CardListFilter() - { - public boolean addCard(Card c) { - return !c.getKeyword().contains("Indestructible"); - } - }); - return list; - }//getEnchantment() - CardList getArtifact() - { - CardList list = CardFactoryUtil.AI_getHumanArtifact(card, true); - list = list.filter(new CardListFilter() - { - public boolean addCard(Card c) { - return !c.getKeyword().contains("Indestructible"); - } - }); - return list; - }//getArtifact() - public void resolve() - { - //AllZone.GameAction.destroyNoRegeneration(getTargetCard()); - AllZone.GameAction.destroy(getTargetCard()); - - }//resolve() - }; - - Input runtime = new Input() - { - private static final long serialVersionUID = -1212213052029735882L; - - public void showMessage() - { - //Display all artifacts and enchantments in play - //Allow human player to select which one to destroy - CardList allCards = new CardList(); - allCards.addAll(AllZone.Human_Play.getCards()); - allCards.addAll(AllZone.Computer_Play.getCards()); - - //get enchantments and get artifacts - CardList allEnchantments = allCards.getType("Enchantment"); - CardList allArtifacts = allCards.getType("Artifact"); - - //put enchantments and artifacts in same cardList to display - CardList allEnchantmentsAndArtifacts = allEnchantments; - allEnchantmentsAndArtifacts.addAll(allArtifacts.toArray()); - - - stopSetNext(CardFactoryUtil.input_targetSpecific(spell, allEnchantmentsAndArtifacts, "Select target Enchantment or Artifact to destroy.", true)); - } - }; - - card.clearSpellAbility(); - spell.setBeforePayMana(runtime); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** -*/ - -/* - //*************** START *********** START ************************** - else if(cardName.equals("Demystify")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -4045818747862804365L; - - public boolean canPlayAI() - { - return (getEnchantment().size() != 0) && (AllZone.Phase.getTurn() > 4); - } - public void chooseTargetAI() - { - Card best = CardFactoryUtil.AI_getBestEnchantment(getEnchantment(), card, true); - setTargetCard(best); - } - CardList getEnchantment() - { - CardList list = CardFactoryUtil.AI_getHumanEnchantment(card, true); - return list; - }//getCreature() - public void resolve() - { - AllZone.GameAction.destroyNoRegeneration(getTargetCard()); - }//resolve() - }; - - Input runtime = new Input() - { - private static final long serialVersionUID = 746063168471322007L; - - public void showMessage() - { - CardList choice = new CardList(); - choice.addAll(AllZone.Human_Play.getCards()); - choice.addAll(AllZone.Computer_Play.getCards()); - - choice = choice.getType("Enchantment"); - - stopSetNext(CardFactoryUtil.input_targetSpecific(spell, choice, "Select target Enchantment to destroy.",true)); - } - }; - - card.clearSpellAbility(); - spell.setBeforePayMana(runtime); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** -*/ - //*************** START *********** START ************************** else if(cardName.equals("Animate Land")) @@ -17254,87 +16198,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); }//*************** END ************ END ************************** - - -/* - //*************** START *********** START ************************** - if(cardName.equals("Corrupt")) - { - - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 335838994716307031L; - - Card check; - public boolean canPlayAI() - { - if(AllZone.Human_Life.getLife() <= countSwamps(card)) - return true; - - check = getFlying(); - return check != null; - } - - public int countSwamps(Card c) - { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); - CardList swamps = new CardList(play.getCards()); - swamps = swamps.getType("Swamp"); - return swamps.size(); - } - - public void chooseTargetAI() - { - if(AllZone.Human_Life.getLife() <= 12) //12? mebbe 15? - { - setTargetPlayer(Constant.Player.Human); - return; - } - - Card c = getFlying(); - if((c == null) || (! check.equals(c))) - throw new RuntimeException(card +" error in chooseTargetAI() - Card c is " +c +", Card check is " +check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() - { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= countSwamps(card)) - return flying.get(i); - - return null; - } - - public void resolve() - { - int damage = countSwamps(card); - if(getTargetCard() != null) - { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) ) - { - Card c = getTargetCard(); - c.addDamage(damage, card); - AllZone.GameAction.getPlayerLife(card.getController()).addLife(damage); - } - } - else { - AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(damage); - AllZone.GameAction.getPlayerLife(card.getController()).addLife(damage); - } - }//resolve() - };//SpellAbility - card.clearSpellAbility(); - card.addSpellAbility(spell); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell,true)); - }//*************** END ************ END ************************** -*/ - - + //*************** START *********** START ************************** else if (cardName.equals("Staff of Domination")) { @@ -17767,38 +16631,6 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); card.addSpellAbility(spell); }//*************** END ************ END ************************** - /* - //*************** START *********** START ************************** - else if (cardName.equals("Time Walk")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 8634822208146060381L; - - public void resolve() { - final Command atEOT = new Command() - { - - private static final long serialVersionUID = -8380743460207665203L; - - public void execute() - { - AllZone.Phase.setPhase(Constant.Phase.Untap, card.getController()); - int turn = AllZone.Phase.getTurn(); - //System.out.println("Turn: " +turn); - AllZone.Phase.setTurn(++turn); - - } - }; - String opponent = AllZone.GameAction.getOpponent(AllZone.Phase.getActivePlayer()); - AllZone.GameAction.setLastPlayerToDraw(opponent); - AllZone.EndOfTurn.addLast(atEOT); - } - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - */ //*************** START *********** START ************************** else if (cardName.equals("Time Walk") || cardName.equals("Temporal Manipulation") || cardName.equals("Capture of Jingzhou")) @@ -18626,6 +17458,96 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); card.addSpellAbility(spell); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Gush")) + { + final SpellAbility spell = new Spell(card) + { + private static final long serialVersionUID = 8881817765689776033L; + + public void resolve() + { + AllZone.GameAction.drawCard(card.getController()); + AllZone.GameAction.drawCard(card.getController()); + } + }; + spell.setDescription("Draw two cards."); + spell.setStackDescription(card.getName() + " - Draw two cards."); + + final SpellAbility bounce = new Spell(card) + { + private static final long serialVersionUID = 1950742710354343569L; + + public void resolve() + { + AllZone.GameAction.drawCard(card.getController()); + AllZone.GameAction.drawCard(card.getController()); + } + public boolean canPlay() + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); + CardList list = new CardList(play.getCards()); + list = list.getType("Island"); + return list.size() >= 2; + } + + }; + bounce.setDescription("You may return two Islands you control to their owner's hand rather than pay Gush's mana cost."); + bounce.setStackDescription(card.getName() + " - Draw two cards."); + bounce.setManaCost("0"); + + final Input bounceIslands = new Input() + { + private static final long serialVersionUID = 3124427514142382129L; + int stop = 2; + int count = 0; + + public void showMessage() + { + AllZone.Display.showMessage("Select an Island"); + ButtonUtil.disableAll(); + } + public void selectButtonCancel() {stop();} + public void selectCard(Card c, PlayerZone zone) + { + if(c.getType().contains("Island") && zone.is(Constant.Zone.Play)) + { + AllZone.GameAction.moveToHand(c); + + count++; + if(count == stop) + stop(); + } + }//selectCard() + }; + + bounce.setBeforePayMana(bounceIslands); + + Command bounceIslandsAI = new Command() + { + private static final long serialVersionUID = 235908265780575226L; + + public void execute() + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer); + CardList list = new CardList(play.getCards()); + list = list.getType("Island"); + //TODO: sort by tapped + + for (int i=0;i<2;i++) + { + AllZone.GameAction.moveToHand(list.get(i)); + } + } + }; + + bounce.setBeforePayManaAI(bounceIslandsAI); + + card.clearSpellAbility(); + card.addSpellAbility(bounce); + card.addSpellAbility(spell); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 0c4febcba88..7e477deded6 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -223,6 +223,9 @@ public class CardFactoryUtil {"Wild Aesthir", new Integer(1)}, {"Viashino Slaughtermaster", new Integer(1)}, {"Twinblade Slasher", new Integer(1)}, + {"Boreal Centaur", new Integer(1)}, + {"Knight of the Skyward Eye", new Integer(1)}, + {"Chronatog", new Integer(1)}, {"Phyrexian Battleflies" , new Integer(2)}, {"Pit Imp" , new Integer(2)}, @@ -2097,6 +2100,22 @@ public class CardFactoryUtil } + public static boolean oppHasKismet(String player) + { + String opp = AllZone.GameAction.getOpponent(player); + PlayerZone play = AllZone.getZone(Constant.Zone.Play, opp); + CardList list = new CardList(play.getCards()); + list = list.filter(new CardListFilter() + { + public boolean addCard(Card c) + { + return c.getName().equals("Kismet") || c.getName().equals("Frozen AEther") || + c.getName().equals("Loxodon Gatekeeper"); + } + }); + return list.size() > 0; + } + public static int getNumberOfManaSymbolsControlledByColor(String colorAbb, String player) { PlayerZone play = AllZone.getZone(Constant.Zone.Play,player); diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index fce33d65b95..861dbb0890c 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -2999,7 +2999,7 @@ public class CardFactory_Creatures { public void execute() { - ability.setStackDescription("Highway Robber - " +card.getController() +" gains 2 life and opponent loses 2 life."); + ability.setStackDescription(card.getName() + " - " +card.getController() +" gains 2 life and opponent loses 2 life."); AllZone.Stack.add(ability); } }; @@ -13965,7 +13965,6 @@ public class CardFactory_Creatures { //*************** START *********** START ************************** else if(cardName.equals("Fallen Angel")) { - final SpellAbility a2 = new Ability(card, "0") { final Command eot1 = new Command() @@ -19211,23 +19210,49 @@ public class CardFactory_Creatures { return newCard; }//*************** END ************ END ************************** - /* - else if (cardName.equals("Acridian")) + + //*************** START *********** START ************************** + else if (cardName.equals("Chronatog")) { - card.setEchoCost(card.getManaCost()); - final Command intoPlay = new Command() - { - private static final long serialVersionUID = 8930023870127082001L; + final Command untilEOT = new Command() + { + private static final long serialVersionUID = 6926430725410883578L; - public void execute() { - card.addIntrinsicKeyword("(Echo unpaid)"); + public void execute() + { + if(AllZone.GameAction.isCardInPlay(card)) + { + card.addTempAttackBoost(-3); + card.addTempDefenseBoost(-3); + } + } + }; + + final Ability ability = new Ability(card, "0") + { + public void resolve() + { + if(AllZone.GameAction.isCardInPlay(card)) + { + card.addTempAttackBoost(3); + card.addTempDefenseBoost(3); + AllZone.EndOfTurn.addUntil(untilEOT); + + AllZone.Phase.subtractExtraTurn(card.getController()); + } + } + + public boolean canPlayAI() + { + return false; } }; - card.addComesIntoPlayCommand(intoPlay); - } - */ - + ability.setStackDescription(card.getName() + " gets +3/+3 until end of turn, " +card.getController() + " skips his/her next turn."); + ability.setDescription("0: Chronatog gets +3/+3 until end of turn. You skip your next turn. Activate this ability only once each turn."); + + card.addSpellAbility(ability); + }//*************** END ************ END ************************** // Cards with Cycling abilities // -1 means keyword "Cycling" not found @@ -19334,33 +19359,7 @@ public class CardFactory_Creatures { } }//echo - /* - if (hasKeyword(card, "Upkeep") != -1) - { - int n = hasKeyword(card, "Upkeep"); - if (n != -1) - { - String parse = card.getKeyword().get(n).toString(); - card.removeIntrinsicKeyword(parse); - - String k[] = parse.split(":"); - final String manacost = k[1]; - card.addIntrinsicKeyword("At the beginning of your upkeep, sacrifice " + card.getName() + " unless you pay " + manacost+"."); - - final Command intoPlay = new Command() - { - private static final long serialVersionUID = 925179072354331141L; - - public void execute() { - card.setUpkeepCost(manacost); - } - }; - card.addComesIntoPlayCommand(intoPlay); - - } - }//upkeep - */ - + return card; } } \ No newline at end of file diff --git a/src/forge/CardListUtil.java b/src/forge/CardListUtil.java index 03c8ff1d2a3..01cc9d3c9e1 100644 --- a/src/forge/CardListUtil.java +++ b/src/forge/CardListUtil.java @@ -150,6 +150,26 @@ public class CardListUtil list.sort(com); } + public static void sortByTapped(CardList list) + { + Comparator com = new Comparator() + { + public int compare(Card a, Card b) + { + + if( a.isTapped() && b.isTapped()) + return 0; + else if(a.isTapped()) + return 1; + else if(b.isTapped()) + return -1; + + return 0; + } + }; + list.sort(com); + } + public static void sortCMC(CardList list) { diff --git a/src/forge/ComputerUtil.java b/src/forge/ComputerUtil.java index 11b3c86795e..108d2e5cad3 100644 --- a/src/forge/ComputerUtil.java +++ b/src/forge/ComputerUtil.java @@ -37,6 +37,7 @@ private static Random random = new Random(); payManaCost(all[i]); all[i].chooseTargetAI(); + all[i].getBeforePayManaAI().execute(); AllZone.Stack.add(all[i]); return false; diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index c18c92afd88..308780919a7 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -73,6 +73,12 @@ private Card getCurrentCard(int ID) PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, c.getOwner()); moveTo(grave, c); } + + public void moveToHand(Card c) + { + PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, c.getOwner()); + moveTo(hand, c); + } public void moveToTopOfLibrary(Card c) { diff --git a/src/forge/Phase.java b/src/forge/Phase.java index 9e85141a028..a3ebd76fc64 100644 --- a/src/forge/Phase.java +++ b/src/forge/Phase.java @@ -108,10 +108,28 @@ public class Phase extends MyObservable String player = getActivePlayer(); String opponent = AllZone.GameAction.getOpponent(player); + if (player.equals(Constant.Player.Computer)) + computerExtraTurns--; + else + humanExtraTurns--; + AllZone.GameAction.setLastPlayerToDraw(opponent); setPhase(Constant.Phase.Untap, player); } + else if ((is(Constant.Phase.Cleanup, Constant.Player.Computer) && humanExtraTurns < 0 ) || + (is(Constant.Phase.Cleanup, Constant.Player.Human) && computerExtraTurns < 0 ) ) + { + String player = getActivePlayer(); + String opp = AllZone.GameAction.getOpponent(player); + if (player.equals(Constant.Player.Computer)) + humanExtraTurns++; + else + computerExtraTurns++; + + AllZone.GameAction.setLastPlayerToDraw(opp); + setPhase(Constant.Phase.Untap, player); + } else { phaseIndex++; @@ -124,18 +142,22 @@ public class Phase extends MyObservable if (is(Constant.Phase.Untap, Constant.Player.Human)) { turn++; + /* if (humanExtraTurns > 0) humanExtraTurns--; else if(humanExtraTurns < 0) humanExtraTurns++; + */ } else if (is(Constant.Phase.Untap, Constant.Player.Computer)) { turn++; + /* if (computerExtraTurns > 0) computerExtraTurns--; else if(computerExtraTurns < 0) computerExtraTurns++; + */ } //for debugging: System.out.println(getPhase()); @@ -188,6 +210,14 @@ public class Phase extends MyObservable computerExtraTurns++; } + public void subtractExtraTurn(String player) + { + if (player.equals(Constant.Player.Human)) + humanExtraTurns--; + else + computerExtraTurns--; + } + public int getExtraTurns(String player) { if (player.equals(Constant.Player.Human)) diff --git a/src/forge/PlayerZone_ComesIntoPlay.java b/src/forge/PlayerZone_ComesIntoPlay.java index 30607fe236e..ecc567b1346 100644 --- a/src/forge/PlayerZone_ComesIntoPlay.java +++ b/src/forge/PlayerZone_ComesIntoPlay.java @@ -18,11 +18,14 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone if (o == null) throw new RuntimeException( "PlayerZone_ComesInto Play : add() object is null"); - + super.add(o); Card c = (Card) o; + if (CardFactoryUtil.oppHasKismet(c.getController()) && (c.isLand() || c.isCreature() || c.isArtifact() )) + c.tap(); + //cannot use addComesIntoPlayCommand - trigger might be set to false; if (c.getName().equals("Exploration")) { Input_Main.canPlayNumberOfLands++; @@ -161,8 +164,6 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone } } - - /* for (String effect : AllZone.StateBasedEffects.getStateBasedMap().keySet() ) { Command com = GameActionUtil.commands.get(effect); diff --git a/src/forge/SpellAbility.java b/src/forge/SpellAbility.java index 8f1ee9d849f..82aeac47ee2 100644 --- a/src/forge/SpellAbility.java +++ b/src/forge/SpellAbility.java @@ -28,7 +28,8 @@ public abstract class SpellAbility private Input afterResolve; private Input afterPayMana; - private Command cancelCommand = null; + private Command cancelCommand = Command.Blank; + private Command beforePayManaAI = Command.Blank; private CommandArgs randomTarget = new CommandArgs() { @@ -89,11 +90,14 @@ public void execute(Object o) {}}; public void setSourceCard(Card c) {sourceCard=c;} public Card getSourceCard() {return sourceCard;} - + + public Command getBeforePayManaAI() { return beforePayManaAI; } + public void setBeforePayManaAI(Command c) { beforePayManaAI = c; } + //begin - Input methods public Input getBeforePayMana() {return beforePayMana;} public void setBeforePayMana(Input in) {beforePayMana = in; } - + public Input getAfterPayMana() {return afterPayMana;} public void setAfterPayMana(Input in) {afterPayMana = in;} diff --git a/src/javazoom/jl/converter/RiffFile.java b/src/javazoom/jl/converter/RiffFile.java index 7fb93948c62..2c8284b5787 100644 --- a/src/javazoom/jl/converter/RiffFile.java +++ b/src/javazoom/jl/converter/RiffFile.java @@ -466,6 +466,7 @@ public class RiffFile /** * Error Messages. */ + @SuppressWarnings("unused") private String DDCRET_String(int retcode) { switch ( retcode ) @@ -484,6 +485,7 @@ public class RiffFile /** * Fill the header. */ + @SuppressWarnings("deprecation") public static int FourCC(String ChunkName) { byte[] p = {0x20,0x20,0x20,0x20}; diff --git a/src/javazoom/jl/converter/WaveFileObuffer.java b/src/javazoom/jl/converter/WaveFileObuffer.java index 48e20160453..9c911031c4a 100644 --- a/src/javazoom/jl/converter/WaveFileObuffer.java +++ b/src/javazoom/jl/converter/WaveFileObuffer.java @@ -67,7 +67,8 @@ public class WaveFileObuffer extends Obuffer outWave = new WaveFile(); - int rc = outWave.OpenForWrite (FileName,freq,(short)16,(short)channels); + @SuppressWarnings("unused") + int rc = outWave.OpenForWrite (FileName,freq,(short)16,(short)channels); } /** @@ -86,8 +87,10 @@ public class WaveFileObuffer extends Obuffer public void write_buffer(int val) { - int k = 0; - int rc = 0; + @SuppressWarnings("unused") + int k = 0; + @SuppressWarnings("unused") + int rc = 0; rc = outWave.WriteData(buffer, bufferp[0]); // REVIEW: handle RiffFile errors. diff --git a/src/javazoom/jl/converter/jlc.java b/src/javazoom/jl/converter/jlc.java index d64523591ee..9d5bbbfffcf 100644 --- a/src/javazoom/jl/converter/jlc.java +++ b/src/javazoom/jl/converter/jlc.java @@ -46,6 +46,7 @@ public class jlc static public void main(String args[]) { String[] argv; + @SuppressWarnings("unused") long start = System.currentTimeMillis(); int argc = args.length + 1; argv = new String[argc]; @@ -118,6 +119,7 @@ public class jlc public boolean processArgs(String[] argv) { filename = null; + @SuppressWarnings("unused") Crc16[] crc; crc = new Crc16[1]; int i; diff --git a/src/javazoom/jl/decoder/BitReserve.java b/src/javazoom/jl/decoder/BitReserve.java index 9b6da48e951..604e0f39c49 100644 --- a/src/javazoom/jl/decoder/BitReserve.java +++ b/src/javazoom/jl/decoder/BitReserve.java @@ -57,6 +57,7 @@ final class BitReserve private int offset, totbit, buf_byte_idx; private final int[] buf = new int[BUFSIZE]; + @SuppressWarnings("unused") private int buf_bit_idx; BitReserve() diff --git a/src/javazoom/jl/decoder/Bitstream.java b/src/javazoom/jl/decoder/Bitstream.java index d91ea26f797..50828d3eb56 100644 --- a/src/javazoom/jl/decoder/Bitstream.java +++ b/src/javazoom/jl/decoder/Bitstream.java @@ -218,7 +218,9 @@ public final class Bitstream implements BitstreamErrors if ( (id3header[0]=='I') && (id3header[1]=='D') && (id3header[2]=='3')) { in.read(id3header,0,3); + @SuppressWarnings("unused") int majorVersion = id3header[0]; + @SuppressWarnings("unused") int revision = id3header[1]; in.read(id3header,0,4); size = (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]); @@ -514,6 +516,7 @@ public final class Bitstream implements BitstreamErrors for (int k=0;k, AudioDeviceFactory> factories = new Hashtable(); /** * Registers an AudioDeviceFactory instance @@ -61,7 +62,7 @@ public class FactoryRegistry extends AudioDeviceFactory factories.put(factory.getClass(), factory); } - public void removeFactoryType(Class cls) + public void removeFactoryType(Class cls) { factories.remove(cls); } @@ -111,7 +112,7 @@ public class FactoryRegistry extends AudioDeviceFactory { fa = new AudioDeviceFactory[size]; int idx = 0; - Enumeration e = factories.elements(); + Enumeration e = factories.elements(); while (e.hasMoreElements()) { AudioDeviceFactory factory = (AudioDeviceFactory)e.nextElement(); diff --git a/src/javazoom/jl/player/Player.java b/src/javazoom/jl/player/Player.java index c3020575f94..f0907d4f90a 100644 --- a/src/javazoom/jl/player/Player.java +++ b/src/javazoom/jl/player/Player.java @@ -44,6 +44,7 @@ public class Player /** * The current frame number. */ + @SuppressWarnings("unused") private int frame = 0; /** diff --git a/src/javazoom/jl/player/PlayerApplet.java b/src/javazoom/jl/player/PlayerApplet.java index ecfa0b8fefd..bc66d3b8df7 100644 --- a/src/javazoom/jl/player/PlayerApplet.java +++ b/src/javazoom/jl/player/PlayerApplet.java @@ -37,6 +37,8 @@ import javazoom.jl.decoder.JavaLayerException; */ public class PlayerApplet extends Applet implements Runnable { + private static final long serialVersionUID = 713230088845043034L; + static public final String AUDIO_PARAMETER = "audioURL"; /** diff --git a/src/javazoom/jl/player/advanced/AdvancedPlayer.java b/src/javazoom/jl/player/advanced/AdvancedPlayer.java index ac0d939730a..6effa388066 100644 --- a/src/javazoom/jl/player/advanced/AdvancedPlayer.java +++ b/src/javazoom/jl/player/advanced/AdvancedPlayer.java @@ -45,7 +45,9 @@ public class AdvancedPlayer /** Has the player been closed? */ private boolean closed = false; /** Has the player played back all frames from the stream? */ + @SuppressWarnings("unused") private boolean complete = false; + @SuppressWarnings("unused") private int lastPosition = 0; /** Listener for the playback process */ private PlaybackListener listener;