Date: Tue, 5 Jun 2012 21:50:59 +0000
Subject: [PATCH 17/33] - CheckStyle.
---
.../java/forge/card/mana/ManaCostShard.java | 10 ++--
.../forge/card/spellability/SpellAbility.java | 4 +-
.../StaticAbilityCostChange.java | 2 +-
.../forge/game/limited/BoosterDraftAI.java | 17 ++++---
.../java/forge/game/limited/SealedDeck.java | 17 ++++---
.../forge/game/zone/DefaultPlayerZone.java | 3 +-
.../java/forge/game/zone/IPlayerZone.java | 2 +-
src/main/java/forge/game/zone/MagicStack.java | 2 +-
.../controllers/CEditorQuestCardShop.java | 2 +-
.../forge/gui/toolbox/CardFaceSymbols.java | 5 +-
.../forge/gui/toolbox/SaveOpenDialog.java | 50 +++++++++----------
src/main/java/forge/util/MyObservable.java | 4 +-
12 files changed, 61 insertions(+), 57 deletions(-)
diff --git a/src/main/java/forge/card/mana/ManaCostShard.java b/src/main/java/forge/card/mana/ManaCostShard.java
index b4d421b1459..df87ae38d7f 100644
--- a/src/main/java/forge/card/mana/ManaCostShard.java
+++ b/src/main/java/forge/card/mana/ManaCostShard.java
@@ -70,7 +70,7 @@ public class ManaCostShard {
/** A bitmask to represent any mana symbol as an integer. */
public abstract static class Atom {
public static final int COLORLESS = 1 << 0;
-
+
/** The Constant WHITE. */
public static final int WHITE = 1 << 1;
@@ -109,9 +109,9 @@ public class ManaCostShard {
* I choose the latter, because memory for boxed objects will be taken from
* heap, while unboxed values will lay on stack, which is faster
*/
-
+
public static final ManaCostShard COLORLESS = new ManaCostShard(Atom.COLORLESS, "1");
-
+
/** The Constant X. */
public static final ManaCostShard X = new ManaCostShard(Atom.IS_X, "X");
@@ -340,11 +340,11 @@ public class ManaCostShard {
public boolean isSnow() {
return (this.shard & Atom.IS_SNOW) != 0;
}
-
+
public boolean isMonoColor() {
int colormask = this.shard & (Atom.WHITE | Atom.BLUE | Atom.BLACK | Atom.RED | Atom.GREEN);
return BinaryUtil.bitCount(colormask) == 1;
-
+
}
/**
diff --git a/src/main/java/forge/card/spellability/SpellAbility.java b/src/main/java/forge/card/spellability/SpellAbility.java
index 7c2d632fe35..9c104330d50 100644
--- a/src/main/java/forge/card/spellability/SpellAbility.java
+++ b/src/main/java/forge/card/spellability/SpellAbility.java
@@ -250,8 +250,8 @@ public abstract class SpellAbility {
public void setManaCost(final String cost) {
this.manaCost = cost;
- }
-
+ }
+
/**
*
* Getter for the field additionalManaCost.
diff --git a/src/main/java/forge/card/staticability/StaticAbilityCostChange.java b/src/main/java/forge/card/staticability/StaticAbilityCostChange.java
index 9895ebfbf32..12ba8f0bca8 100644
--- a/src/main/java/forge/card/staticability/StaticAbilityCostChange.java
+++ b/src/main/java/forge/card/staticability/StaticAbilityCostChange.java
@@ -66,7 +66,7 @@ public class StaticAbilityCostChange {
//modify the cost here
return originalCost;
}
-
+
/**
* Applies applyReduceCostAbility ability.
*
diff --git a/src/main/java/forge/game/limited/BoosterDraftAI.java b/src/main/java/forge/game/limited/BoosterDraftAI.java
index 9a7c5553b72..7e64afb309b 100644
--- a/src/main/java/forge/game/limited/BoosterDraftAI.java
+++ b/src/main/java/forge/game/limited/BoosterDraftAI.java
@@ -522,17 +522,22 @@ public class BoosterDraftAI {
// count each mana symbol in the mana cost
for (ManaCostShard shard : mc.getShards()) {
byte mask = shard.getColorMask();
-
- if ((mask & CardColor.WHITE) > 0 )
+
+ if ((mask & CardColor.WHITE) > 0) {
clrCnts[0].setCount(clrCnts[0].getCount() + 1);
- if ((mask & CardColor.BLUE) > 0 )
+ }
+ if ((mask & CardColor.BLUE) > 0) {
clrCnts[1].setCount(clrCnts[1].getCount() + 1);
- if ((mask & CardColor.BLACK) > 0 )
+ }
+ if ((mask & CardColor.BLACK) > 0) {
clrCnts[2].setCount(clrCnts[2].getCount() + 1);
- if ((mask & CardColor.RED) > 0 )
+ }
+ if ((mask & CardColor.RED) > 0) {
clrCnts[3].setCount(clrCnts[3].getCount() + 1);
- if ((mask & CardColor.GREEN) > 0 )
+ }
+ if ((mask & CardColor.GREEN) > 0) {
clrCnts[4].setCount(clrCnts[4].getCount() + 1);
+ }
}
}
diff --git a/src/main/java/forge/game/limited/SealedDeck.java b/src/main/java/forge/game/limited/SealedDeck.java
index af435e5dfaf..88ba97282ce 100644
--- a/src/main/java/forge/game/limited/SealedDeck.java
+++ b/src/main/java/forge/game/limited/SealedDeck.java
@@ -360,17 +360,22 @@ public class SealedDeck {
// count each mana symbol in the mana cost
for (ManaCostShard shard : mc.getShards()) {
byte mask = shard.getColorMask();
-
- if ((mask & CardColor.WHITE) > 0 )
+
+ if ((mask & CardColor.WHITE) > 0) {
clrCnts[0].setCount(clrCnts[0].getCount() + 1);
- if ((mask & CardColor.BLUE) > 0 )
+ }
+ if ((mask & CardColor.BLUE) > 0) {
clrCnts[1].setCount(clrCnts[1].getCount() + 1);
- if ((mask & CardColor.BLACK) > 0 )
+ }
+ if ((mask & CardColor.BLACK) > 0) {
clrCnts[2].setCount(clrCnts[2].getCount() + 1);
- if ((mask & CardColor.RED) > 0 )
+ }
+ if ((mask & CardColor.RED) > 0) {
clrCnts[3].setCount(clrCnts[3].getCount() + 1);
- if ((mask & CardColor.GREEN) > 0 )
+ }
+ if ((mask & CardColor.GREEN) > 0) {
clrCnts[4].setCount(clrCnts[4].getCount() + 1);
+ }
}
}
diff --git a/src/main/java/forge/game/zone/DefaultPlayerZone.java b/src/main/java/forge/game/zone/DefaultPlayerZone.java
index 0d61060ebe2..264dcf3624d 100644
--- a/src/main/java/forge/game/zone/DefaultPlayerZone.java
+++ b/src/main/java/forge/game/zone/DefaultPlayerZone.java
@@ -180,7 +180,7 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
public final boolean contains(final Card c) {
return this.getCardList().contains(c);
}
-
+
/*
* (non-Javadoc)
*
@@ -194,7 +194,6 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
}
return index;
}
-
/**
* Removes the.
diff --git a/src/main/java/forge/game/zone/IPlayerZone.java b/src/main/java/forge/game/zone/IPlayerZone.java
index 9a213ba2f8e..6733d6c578e 100644
--- a/src/main/java/forge/game/zone/IPlayerZone.java
+++ b/src/main/java/forge/game/zone/IPlayerZone.java
@@ -156,7 +156,7 @@ interface IPlayerZone {
* @return position
*/
Integer getPosition(Card c);
-
+
/**
* isEmpty returns true if given zone contains no cards.
*
diff --git a/src/main/java/forge/game/zone/MagicStack.java b/src/main/java/forge/game/zone/MagicStack.java
index c08655a86e9..2e88f6d6920 100644
--- a/src/main/java/forge/game/zone/MagicStack.java
+++ b/src/main/java/forge/game/zone/MagicStack.java
@@ -1376,7 +1376,7 @@ public class MagicStack extends MyObservable {
public final void clearSimultaneousStack() {
this.simultaneousStackEntryList.clear();
}
-
+
/**
*
* addSimultaneousStackEntry.
diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java
index d9583a5b967..f09925e9996 100644
--- a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java
+++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java
@@ -148,7 +148,7 @@ public final class CEditorQuestCardShop extends ACEditorBase 0) || manaCost.isPureGeneric();
final List shards = manaCost.getShards();
@@ -234,7 +233,7 @@ public class CardFaceSymbols {
*/
public static int getWidth(final CardManaCost manaCost) {
int width = manaCost.getShards().size();
- if ( manaCost.getGenericCost() > 0 || ( manaCost.getGenericCost() == 0 && width == 0 ) );
+ if (manaCost.getGenericCost() > 0 || (manaCost.getGenericCost() == 0 && width == 0));
width++;
/*
diff --git a/src/main/java/forge/gui/toolbox/SaveOpenDialog.java b/src/main/java/forge/gui/toolbox/SaveOpenDialog.java
index 800cbf33e6b..d70726f0637 100644
--- a/src/main/java/forge/gui/toolbox/SaveOpenDialog.java
+++ b/src/main/java/forge/gui/toolbox/SaveOpenDialog.java
@@ -32,20 +32,19 @@ import javax.swing.filechooser.FileNameExtensionFilter;
*/
@SuppressWarnings("serial")
public class SaveOpenDialog extends JPanel {
-
+
private JFileChooser fc;
-
-
+
/**
* Enum to contain information for filetype filtering in the open/save dialog.
* Add more entries to enum as needed.
- *
- *
+ *
+ *
*/
public enum Filetypes {
LAYOUT ("Layout File", "xml"),
DECK ("Deck File", "dck");
-
+
private final String TypeName;
private final String TypeExtension;
Filetypes(String Name, String Extension) {
@@ -53,16 +52,15 @@ public class SaveOpenDialog extends JPanel {
this.TypeExtension = Extension;
}
}
-
+
/**
*
- * constructor for a save or open dialog
+ * constructor for a save or open dialog.
*/
public SaveOpenDialog() {
fc = new JFileChooser();
}
-
-
+
/**
* Shows the open dialog for files. If no file selected, returns null. Pass null
* to Type to allow all files to be viewed/opened.
@@ -73,14 +71,13 @@ public class SaveOpenDialog extends JPanel {
*/
public File OpenDialog(final File defFileName, final Filetypes type) {
fc.setCurrentDirectory(defFileName);
-
- if (type!=null) {
+
+ if (type != null) {
fc.setAcceptAllFileFilterUsed(false);
final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension);
fc.addChoosableFileFilter(filter);
}
-
-
+
int RetValue = fc.showOpenDialog(getParent());
if (RetValue == JFileChooser.APPROVE_OPTION) {
final File RetFile = fc.getSelectedFile();
@@ -88,7 +85,7 @@ public class SaveOpenDialog extends JPanel {
}
return null;
}
-
+
/**
* Shows the save dialog.
*
@@ -100,31 +97,30 @@ public class SaveOpenDialog extends JPanel {
public File SaveDialog(final File defFileName, final Filetypes type) {
File RetFile = defFileName;
fc.setCurrentDirectory(defFileName);
-
+
/* set the file filter if desired */
- if (type!=null) {
+ if (type != null) {
fc.setAcceptAllFileFilterUsed(false);
final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension);
fc.addChoosableFileFilter(filter);
}
-
+
int RetValue = fc.showSaveDialog(getParent());
-
+
/* user picked save */
if (RetValue == JFileChooser.APPROVE_OPTION) {
RetFile = fc.getSelectedFile();
-
+
/* Adds extension if it is known and not given */
- if (type!=null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) {
- RetFile = new File(RetFile.getAbsolutePath()+"."+type.TypeExtension);
+ if (type != null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) {
+ RetFile = new File(RetFile.getAbsolutePath() + "." + type.TypeExtension);
}
-
-
+
return RetFile;
}
-
+
/* user picked cancel */
return null;
}
-
-}
\ No newline at end of file
+
+}
diff --git a/src/main/java/forge/util/MyObservable.java b/src/main/java/forge/util/MyObservable.java
index 304f71cdf2d..e0b9b3e3757 100644
--- a/src/main/java/forge/util/MyObservable.java
+++ b/src/main/java/forge/util/MyObservable.java
@@ -41,8 +41,8 @@ public class MyObservable extends Observable {
this.notifyObservers();
if (Singletons.getModel() == null) { return; }
- PhaseHandler phases = Singletons.getModel().getGameState().getPhaseHandler();
-
+ PhaseHandler phases = Singletons.getModel().getGameState().getPhaseHandler();
+
if ((phases != null) && phases.isNeedToNextPhase()) {
if (phases.isNeedToNextPhaseInit()) {
// this is used.
From 37f50ef5eefae0ba3b83d0760eea68dae8a21c82 Mon Sep 17 00:00:00 2001
From: Sloth
Date: Tue, 5 Jun 2012 21:53:21 +0000
Subject: [PATCH 18/33] - Improved AI of some cards using AF Charm.
---
res/cardsfolder/e/ebony_charm.txt | 4 ++--
res/cardsfolder/u/umezawas_jitte.txt | 2 +-
.../abilityfactory/AbilityFactoryChangeZone.java | 10 ++++++++++
.../abilityfactory/AbilityFactoryCounters.java | 5 +++++
.../abilityfactory/AbilityFactoryDealDamage.java | 10 ++++++++++
.../abilityfactory/AbilityFactoryDestroy.java | 5 +++++
.../AbilityFactoryPermanentState.java | 15 +++++++++++++++
.../card/abilityfactory/AbilityFactoryPump.java | 5 +++++
.../card/abilityfactory/AbilityFactoryReveal.java | 5 +++++
.../AbilityFactoryZoneAffecting.java | 10 ++++++++++
10 files changed, 68 insertions(+), 3 deletions(-)
diff --git a/res/cardsfolder/e/ebony_charm.txt b/res/cardsfolder/e/ebony_charm.txt
index 83cdda1176c..7d7be22ea1a 100644
--- a/res/cardsfolder/e/ebony_charm.txt
+++ b/res/cardsfolder/e/ebony_charm.txt
@@ -3,8 +3,8 @@ ManaCost:B
Types:Instant
Text:no text
A:SP$ Charm | Cost$ B | Choices$ EbonyDrain,EbonyExile,EbonyFear | Defined$ You | SpellDescription$ Choose one - Target opponent loses 1 life and you gain 1 life; or exile up to three target cards from a single graveyard; or target creature gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.)
-SVar:EbonyDrain:DB$LoseLife | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | LifeAmount$ 1 | SubAbility$ EbonyGain | SpellDescription$ Target opponent loses 1 life and you gain 1 life;
-SVar:EbonyGain:DB$GainLife | Defined$ You | LifeAmount$ 1
+SVar:EbonyDrain:DB$ LoseLife | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | LifeAmount$ 1 | SubAbility$ EbonyGain | SpellDescription$ Target opponent loses 1 life and you gain 1 life;
+SVar:EbonyGain:DB$ GainLife | Defined$ You | LifeAmount$ 1
SVar:EbonyExile:DB$ ChangeZone | TargetMin$ 0 | TargetMax$ 3 | TargetsFromSingleZone$ True | Origin$ Graveyard | Destination$ Exile | TgtPrompt$ Choose target card in a graveyard | ValidTgts$ Card | SpellDescription$ Exile up to three target cards from a single graveyard;
SVar:EbonyFear:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ Fear | SpellDescription$ Target creature gains fear until end of turn.
SVar:RemAIDeck:True
diff --git a/res/cardsfolder/u/umezawas_jitte.txt b/res/cardsfolder/u/umezawas_jitte.txt
index 5dc4a1003ba..7aead1a5e0c 100644
--- a/res/cardsfolder/u/umezawas_jitte.txt
+++ b/res/cardsfolder/u/umezawas_jitte.txt
@@ -8,7 +8,7 @@ A:AB$ Charm | Cost$ SubCounter<1/CHARGE> | Choices$ JittePump,JitteCurse,JitteLi
SVar:JittePump:DB$ Pump | Defined$ Equipped | NumAtt$ +2 | NumDef$ +2 | SpellDescription$ Equipped creature gets +2/+2 until end of turn;
SVar:JitteCurse:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -1 | NumDef$ -1 | IsCurse$ True | SpellDescription$ or target creature gets -1/-1 until end of turn;
SVar:JitteLife:DB$ GainLife | LifeAmount$ 2 | SpellDescription$ or you gain 2 life.
-SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | CounterType$ CHARGE | CounterNum$ 2
+SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | CounterType$ CHARGE | CounterNum$ 2
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/umezawas_jitte.jpg
SetInfo:BOK|Rare|http://magiccards.info/scans/en/bok/163.jpg
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java
index e501d5ad55c..3ca8415d720 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryChangeZone.java
@@ -166,6 +166,11 @@ public final class AbilityFactoryChangeZone {
AbilityFactoryChangeZone.changeZoneResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryChangeZone.changeZoneCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryChangeZone.changeZonePlayDrawbackAI(af, this);
@@ -2249,6 +2254,11 @@ public final class AbilityFactoryChangeZone {
AbilityFactoryChangeZone.changeZoneAllResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryChangeZone.changeZoneAllCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryChangeZone.changeZoneAllPlayDrawbackAI(af, this);
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryCounters.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryCounters.java
index df55c61a061..0542c29dc53 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryCounters.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryCounters.java
@@ -171,6 +171,11 @@ public class AbilityFactoryCounters {
AbilityFactoryCounters.putResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryCounters.putCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryCounters.putPlayDrawbackAI(af, this);
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryDealDamage.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryDealDamage.java
index 055ee8b9d5b..6222ba4a893 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryDealDamage.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryDealDamage.java
@@ -173,6 +173,11 @@ public class AbilityFactoryDealDamage {
return AbilityFactoryDealDamage.this.damageDrawback(this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryDealDamage.this.dealDamageCanPlayAI(this);
+ }
+
@Override
public String getStackDescription() {
return AbilityFactoryDealDamage.this.dealDamageStackDescription(
@@ -959,6 +964,11 @@ public class AbilityFactoryDealDamage {
return AbilityFactoryDealDamage.this.damageAllStackDescription(this.af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryDealDamage.this.damageAllCanPlayAI(this.af, this);
+ }
+
@Override
public void resolve() {
AbilityFactoryDealDamage.this.damageAllResolve(this.af, this);
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java
index 93c151ed98a..9fc6b626412 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryDestroy.java
@@ -688,6 +688,11 @@ public class AbilityFactoryDestroy {
return AbilityFactoryDestroy.destroyAllStackDescription(af, this, this.noRegen);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryDestroy.destroyAllCanPlayAI(af, this, this.noRegen);
+ }
+
@Override
public void resolve() {
AbilityFactoryDestroy.destroyAllResolve(af, this, this.noRegen);
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java
index 4fb63b384be..404e1fe33b2 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryPermanentState.java
@@ -150,6 +150,11 @@ public class AbilityFactoryPermanentState {
AbilityFactoryPermanentState.untapResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryPermanentState.untapCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryPermanentState.untapPlayDrawbackAI(af, this);
@@ -714,6 +719,11 @@ public class AbilityFactoryPermanentState {
AbilityFactoryPermanentState.tapResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryPermanentState.tapCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryPermanentState.tapPlayDrawbackAI(af, this);
@@ -1485,6 +1495,11 @@ public class AbilityFactoryPermanentState {
AbilityFactoryPermanentState.tapAllResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryPermanentState.tapAllCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryPermanentState.tapAllPlayDrawbackAI(af, this);
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java
index 1ba51fc3f6a..6a9a203cc8f 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryPump.java
@@ -1385,6 +1385,11 @@ public class AbilityFactoryPump {
AbilityFactoryPump.this.pumpAllResolve(this);
} // resolve
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryPump.this.pumpAllCanPlayAI(this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryPump.this.pumpAllChkDrawbackAI(this);
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java
index c1d1ab79a17..cfb1d351d09 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java
@@ -160,6 +160,11 @@ public final class AbilityFactoryReveal {
AbilityFactoryReveal.digResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryReveal.digCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return true;
diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryZoneAffecting.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryZoneAffecting.java
index ccb9ba0aa65..02d3e988c6a 100644
--- a/src/main/java/forge/card/abilityfactory/AbilityFactoryZoneAffecting.java
+++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryZoneAffecting.java
@@ -152,6 +152,11 @@ public class AbilityFactoryZoneAffecting {
return AbilityFactoryZoneAffecting.drawStackDescription(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryZoneAffecting.drawCanPlayAI(af, this);
+ }
+
@Override
public void resolve() {
AbilityFactoryZoneAffecting.drawResolve(af, this);
@@ -1121,6 +1126,11 @@ public class AbilityFactoryZoneAffecting {
AbilityFactoryZoneAffecting.discardResolve(af, this);
}
+ @Override
+ public boolean canPlayAI() {
+ return AbilityFactoryZoneAffecting.discardCanPlayAI(af, this);
+ }
+
@Override
public boolean chkAIDrawback() {
return AbilityFactoryZoneAffecting.discardCheckDrawbackAI(af, this);
From 418693d45f99fb5096a944ebf43f1ae25ae77ae2 Mon Sep 17 00:00:00 2001
From: slowe
Date: Wed, 6 Jun 2012 08:01:27 +0000
Subject: [PATCH 19/33] Changed delayed triggers of Pacts to abilities rather
than spells; Summoner's Pact no longer shuffles into library
---
res/cardsfolder/p/pact_of_negation.txt | 2 +-
res/cardsfolder/p/pact_of_the_titan.txt | 2 +-
res/cardsfolder/s/slaughter_pact.txt | 2 +-
res/cardsfolder/s/summoners_pact.txt | 5 ++---
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/res/cardsfolder/p/pact_of_negation.txt b/res/cardsfolder/p/pact_of_negation.txt
index 4e0dc8c1171..3731c5f885e 100644
--- a/res/cardsfolder/p/pact_of_negation.txt
+++ b/res/cardsfolder/p/pact_of_negation.txt
@@ -5,7 +5,7 @@ Text:no text
Colors:blue
A:SP$ Counter | Cost$ 0 | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next upkeep, pay 3 U U. If you don't, you lose the game.
SVar:DBDelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseGame | TriggerDescription$ At the beginning of your next upkeep, pay 3 U U. If you don't, you lose the game.
-SVar:TrigLoseGame:SP$LosesGame | Cost$ 0 | UnlessCost$ 3 U U | UnlessPayer$ You | Defined$ You
+SVar:TrigLoseGame:AB$LosesGame | Cost$ 0 | UnlessCost$ 3 U U | UnlessPayer$ You | Defined$ You
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/pact_of_negation.jpg
diff --git a/res/cardsfolder/p/pact_of_the_titan.txt b/res/cardsfolder/p/pact_of_the_titan.txt
index 074a5d7c1ad..d6ee64c470f 100644
--- a/res/cardsfolder/p/pact_of_the_titan.txt
+++ b/res/cardsfolder/p/pact_of_the_titan.txt
@@ -5,7 +5,7 @@ Text:no text
Colors:red
A:SP$ Token | Cost$ 0| TokenAmount$ 1 | TokenName$ Giant | TokenTypes$ Creature,Giant | TokenOwner$ You | TokenColors$ Red | TokenPower$ 4 | TokenToughness$ 4 | SubAbility$ DBDelTrig | SpellDescription$ Put a 4/4 red Giant creature token onto the battlefield. At the beginning of your next upkeep, pay 4 R. If you don't, you lose the game.
SVar:DBDelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseGame | TriggerDescription$ At the beginning of your next upkeep, pay 4 R. If you don't, you lose the game.
-SVar:TrigLoseGame:SP$LosesGame | Cost$ 0 | UnlessCost$ 4 R | UnlessPayer$ You | Defined$ You
+SVar:TrigLoseGame:AB$LosesGame | Cost$ 0 | UnlessCost$ 4 R | UnlessPayer$ You | Defined$ You
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/pact_of_the_titan.jpg
diff --git a/res/cardsfolder/s/slaughter_pact.txt b/res/cardsfolder/s/slaughter_pact.txt
index 9d0e85cda17..ca5eefe095e 100644
--- a/res/cardsfolder/s/slaughter_pact.txt
+++ b/res/cardsfolder/s/slaughter_pact.txt
@@ -5,7 +5,7 @@ Text:no text
Colors:black
A:SP$ Destroy | Cost$ 0 | ValidTgts$ Creature.nonBlack | TgtPrompt$ Select target nonblack creature | SubAbility$ DBDelTrig | SpellDescription$ Destroy target nonblack creature. At the beginning of your next upkeep, pay 2 B. If you don't, you lose the game.
SVar:DBDelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseGame | TriggerDescription$ At the beginning of your next upkeep, pay 2 B. If you don't, you lose the game.
-SVar:TrigLoseGame:SP$LosesGame | Cost$ 0 | UnlessCost$ 2 B | UnlessPayer$ You | Defined$ You
+SVar:TrigLoseGame:AB$LosesGame | Cost$ 0 | UnlessCost$ 2 B | UnlessPayer$ You | Defined$ You
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/slaughter_pact.jpg
diff --git a/res/cardsfolder/s/summoners_pact.txt b/res/cardsfolder/s/summoners_pact.txt
index d149da465ae..086cdf4b03d 100644
--- a/res/cardsfolder/s/summoners_pact.txt
+++ b/res/cardsfolder/s/summoners_pact.txt
@@ -3,10 +3,9 @@ ManaCost:0
Types:Instant
Text:no text
Colors:green
-A:SP$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Creature.Green+YouOwn | ChangeNum$ 1 | SubAbility$ DBShuffle | SpellDescription$ Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library. At the beginning of your next upkeep, pay 2 G G. If you don't, you lose the game.
-SVar:DBShuffle:DB$ChangeZone | Origin$ Stack | Destination$ Library | Shuffle$ True | SubAbility$ DBDelTrig
+A:SP$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Creature.Green+YouOwn | ChangeNum$ 1 | SubAbility$ DBDelTrig | SpellDescription$ Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library. At the beginning of your next upkeep, pay 2 G G. If you don't, you lose the game.
SVar:DBDelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseGame | TriggerDescription$ At the beginning of your next upkeep, pay 2 G G. If you don't, you lose the game.
-SVar:TrigLoseGame:SP$LosesGame | Cost$ 0 | UnlessCost$ 2 G G | UnlessPayer$ You | Defined$ You
+SVar:TrigLoseGame:AB$LosesGame | Cost$ 0 | UnlessCost$ 2 G G | UnlessPayer$ You | Defined$ You
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/summoners_pact.jpg
From 154963542168c85f1e327787e63071a7e31bb464 Mon Sep 17 00:00:00 2001
From: Sloth
Date: Wed, 6 Jun 2012 09:03:18 +0000
Subject: [PATCH 20/33] - Fixed Riders of Gavony.
---
.../forge/card/staticability/StaticAbilityContinuous.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/main/java/forge/card/staticability/StaticAbilityContinuous.java b/src/main/java/forge/card/staticability/StaticAbilityContinuous.java
index 216465ff5cf..111c792bb6d 100644
--- a/src/main/java/forge/card/staticability/StaticAbilityContinuous.java
+++ b/src/main/java/forge/card/staticability/StaticAbilityContinuous.java
@@ -128,6 +128,10 @@ public class StaticAbilityContinuous {
addKeywords[w] = addKeywords[w].replaceAll("ChosenColor", color.substring(0, 1).toUpperCase().concat(color.substring(1, color.length())));
}
}
+ final String chosenType = hostCard.getChosenType();
+ for (int w = 0; w < addKeywords.length; w++) {
+ addKeywords[w] = addKeywords[w].replaceAll("ChosenType", chosenType);
+ }
}
if (params.containsKey("AddHiddenKeyword")) {
From 5d0b1e8520dba4dfae1a763d6199bc210161fa42 Mon Sep 17 00:00:00 2001
From: Sloth
Date: Wed, 6 Jun 2012 10:32:06 +0000
Subject: [PATCH 21/33] - Added Dragonlair Spider.
---
.gitattributes | 1 +
res/cardsfolder/d/dragonlair_spider.txt | 13 +++++++++++++
2 files changed, 14 insertions(+)
create mode 100644 res/cardsfolder/d/dragonlair_spider.txt
diff --git a/.gitattributes b/.gitattributes
index 3fc3f5a1383..0b8cf70e7fc 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2437,6 +2437,7 @@ res/cardsfolder/d/dragon_shadow.txt -text
res/cardsfolder/d/dragon_tyrant.txt svneol=native#text/plain
res/cardsfolder/d/dragon_whelp.txt svneol=native#text/plain
res/cardsfolder/d/dragon_wings.txt -text
+res/cardsfolder/d/dragonlair_spider.txt -text
res/cardsfolder/d/dragonmaster_outcast.txt svneol=native#text/plain
res/cardsfolder/d/dragons_claw.txt svneol=native#text/plain
res/cardsfolder/d/dragons_herald.txt -text
diff --git a/res/cardsfolder/d/dragonlair_spider.txt b/res/cardsfolder/d/dragonlair_spider.txt
new file mode 100644
index 00000000000..4f48c8a066c
--- /dev/null
+++ b/res/cardsfolder/d/dragonlair_spider.txt
@@ -0,0 +1,13 @@
+Name:Dragonlair Spider
+ManaCost:2 R R G G
+Types:Creature Spider
+Text:no text
+PT:5/6
+K:Reach
+T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Whenever an opponent casts a spell, put a 1/1 green Insect creature token onto the battlefield.
+SVar:TrigToken:AB$Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Insect | TokenTypes$ Creature,Insect | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1
+SVar:Rarity:Rare
+SVar:Picture:http://www.wizards.com/global/images/magic/general/dragonlair_spider.jpg
+SetInfo:PC2|Rare|http://magiccards.info/scans/en/pc2/87.jpg
+Oracle:Reach\nWhenever an opponent casts a spell, put a 1/1 green Insect creature token onto the battlefield.
+End
\ No newline at end of file
From 674a43eeab4eed95e3ffbb24935fde314de73d64 Mon Sep 17 00:00:00 2001
From: Sloth
Date: Wed, 6 Jun 2012 10:36:37 +0000
Subject: [PATCH 22/33] - Added Dreampod Druid.
---
.gitattributes | 1 +
res/cardsfolder/d/dreampod_druid.txt | 12 ++++++++++++
2 files changed, 13 insertions(+)
create mode 100644 res/cardsfolder/d/dreampod_druid.txt
diff --git a/.gitattributes b/.gitattributes
index 0b8cf70e7fc..a9aeb3fc58e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2483,6 +2483,7 @@ res/cardsfolder/d/dream_thrush.txt -text
res/cardsfolder/d/dream_twist.txt -text
res/cardsfolder/d/dreamborn_muse.txt svneol=native#text/plain
res/cardsfolder/d/dreamcatcher.txt svneol=native#text/plain
+res/cardsfolder/d/dreampod_druid.txt -text
res/cardsfolder/d/dreams_grip.txt svneol=native#text/plain
res/cardsfolder/d/dreams_of_the_dead.txt -text
res/cardsfolder/d/dreamscape_artist.txt svneol=native#text/plain
diff --git a/res/cardsfolder/d/dreampod_druid.txt b/res/cardsfolder/d/dreampod_druid.txt
new file mode 100644
index 00000000000..402a0862d51
--- /dev/null
+++ b/res/cardsfolder/d/dreampod_druid.txt
@@ -0,0 +1,12 @@
+Name:Dreampod Druid
+ManaCost:1 G
+Types:Creature Human Druid
+Text:no text
+PT:2/2
+T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigToken | IsPresent$ Card.Self+enchanted | TriggerDescription$ At the beginning of each upkeep, if CARDNAME is enchanted, put a 1/1 green Saproling creature token onto the battlefield.
+SVar:TrigToken:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1
+SVar:Rarity:Uncommon
+SVar:Picture:http://www.wizards.com/global/images/magic/general/dreampod_druid.jpg
+SetInfo:PC2|Uncommon|http://magiccards.info/scans/en/pc2/64.jpg
+Oracle:At the beginning of each upkeep, if Dreampod Druid is enchanted, put a 1/1 green Saproling creature token onto the battlefield.
+End
\ No newline at end of file
From 185d1da1c9ccb73b6f2ad9ba118cd72bb6b05d10 Mon Sep 17 00:00:00 2001
From: Chris
Date: Wed, 6 Jun 2012 10:36:38 +0000
Subject: [PATCH 23/33] - Added the recent commit logs to changes.txt.
Preparing for the snapshot build release.
---
CHANGES.txt | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/CHANGES.txt b/CHANGES.txt
index 16af33d8b9c..05804f2bf6a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -392,6 +392,16 @@ Fixes/Features:
- Graft will no longer trigger if the card has no more +1/+1 counters.
- The AI will now be more careful when fetching legendary permanents.
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
+- Fixed Sever the Bloodline.
+- Updated text of Hunting Grounds.
+- Added unpairing to moveToLibrary.
+- Fixed targeting in gainLifeDoTriggerAINoCost.
+- CheckStyle.
+- Improved AI of some cards using AF Charm.
+- Creating branch for M13 Cards
+- Changed delayed triggers of Pacts to abilities rather than spells; Summoner's Pact no longer shuffles into library
+- Fixed Riders of Gavony.
+- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
Many people helped with this version. A special thank you goes out to them. (Attempted to list names alphabetically):
@@ -487,6 +497,10 @@ Beetleback Chief
Brindle Shoat
Thing from the Deep
Bog Elemental
+Krond the Dawn-Clad
+Preyseizer Dragon
+Indrik Umbra
+Dragonlair Spider
end
From 02a242e62c024b762fa4aa6417bf72441496bfca Mon Sep 17 00:00:00 2001
From: Chris
Date: Wed, 6 Jun 2012 10:38:10 +0000
Subject: [PATCH 24/33] - Added the recent commit logs to changes.txt.
Preparing for the snapshot build release.
---
CHANGES.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CHANGES.txt b/CHANGES.txt
index 05804f2bf6a..601ab2c8dcc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -401,6 +401,7 @@ Fixes/Features:
- Creating branch for M13 Cards
- Changed delayed triggers of Pacts to abilities rather than spells; Summoner's Pact no longer shuffles into library
- Fixed Riders of Gavony.
+- Added the recent commit logs to changes.txt.
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
@@ -501,6 +502,7 @@ Krond the Dawn-Clad
Preyseizer Dragon
Indrik Umbra
Dragonlair Spider
+Dreampod Druid
end
From e9e6d11692788a712b48584133ee4c6f47cfbcf2 Mon Sep 17 00:00:00 2001
From: Rob Cashwalker
Date: Thu, 7 Jun 2012 02:43:58 +0000
Subject: [PATCH 25/33] Cardshop UI tweaks: Removed Add/Remove 4-of. Relabeled
As Buy/Sell. Added credits counter. Added Max Selling Percentage and Price.
Fixed labels and buttons to return to normal for regular deck editor.
---
.../controllers/CEditorQuestCardShop.java | 45 +++++++++++++++++--
.../gui/deckeditor/views/VCardCatalog.java | 5 +++
.../gui/deckeditor/views/VCurrentDeck.java | 5 +++
3 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java
index f09925e9996..d97079eead3 100644
--- a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java
+++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java
@@ -41,6 +41,8 @@ import forge.gui.deckeditor.views.VCardCatalog;
import forge.gui.deckeditor.views.VCurrentDeck;
import forge.gui.home.quest.CSubmenuQuestDecks;
import forge.gui.home.quest.SSubmenuQuestUtil;
+import forge.gui.toolbox.FLabel;
+import forge.gui.toolbox.FSkin;
import forge.item.BoosterPack;
import forge.item.CardPrinted;
import forge.item.FatPack;
@@ -63,8 +65,13 @@ import forge.util.closures.Lambda1;
* @version $Id: CEditorQuestCardShop.java 15088 2012-04-07 11:34:05Z Max mtg $
*/
public final class CEditorQuestCardShop extends ACEditorBase {
- private final JLabel creditsLabel = new JLabel();
- private final JLabel sellPercentageLabel = new JLabel();
+ private final JLabel creditsLabel = new FLabel.Builder()
+ .icon(FSkin.getIcon(FSkin.QuestIcons.ICO_COINSTACK))
+ .fontSize(15).build();
+ private final JLabel sellPercentageLabel = new FLabel.Builder().text("0")
+ .fontSize(11)
+ .build();
+
private double multiplier;
private final QuestController questData;
@@ -73,6 +80,12 @@ public final class CEditorQuestCardShop extends ACEditorBase mapPrices = this.r.getPriceList();
private Map decksUsingMyCards;
+ // remember changed gui elements
+ private String CCTabLabel = new String();
+ private String CCAddLabel = new String();
+ private String CDTabLabel = new String();
+ private String CDRemLabel = new String();
+
/**
* Child controller for quest card shop UI.
*
@@ -128,8 +141,17 @@ public final class CEditorQuestCardShop extends ACEditorBaseSelling cards at " + formatter.format(multiPercent)
+ "% of their value.
" + maxSellingPrice + "