...
 
Commits (22)
This diff is collapsed.
......@@ -55,8 +55,10 @@ public class PowerExchangeEffect extends SpellAbilityEffect {
final int power1 = c1.getNetPower();
final int power2 = c2.getNetPower();
c1.addTempPowerBoost(power2 - power1);
c2.addTempPowerBoost(power1 - power2);
final long timestamp = game.getNextTimestamp();
c1.addNewPT(power2, null, timestamp);
c2.addNewPT(power1, null, timestamp);
game.fireEvent(new GameEventCardStatsChanged(c1));
game.fireEvent(new GameEventCardStatsChanged(c2));
......@@ -69,8 +71,8 @@ public class PowerExchangeEffect extends SpellAbilityEffect {
@Override
public void run() {
c1.addTempPowerBoost(power1 - power2);
c2.addTempPowerBoost(power2 - power1);
c1.removeNewPT(timestamp);
c2.removeNewPT(timestamp);
game.fireEvent(new GameEventCardStatsChanged(c1));
game.fireEvent(new GameEventCardStatsChanged(c2));
}
......
......@@ -49,6 +49,7 @@ public class Forge implements ApplicationListener {
private static int continuousRenderingCount = 1; //initialize to 1 since continuous rendering is the default
private static final Stack<FScreen> screens = new Stack<FScreen>();
private static boolean textureFiltering = false;
private static boolean destroyThis = false;
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0) {
if (GuiBase.getInterface() == null) {
......@@ -70,7 +71,14 @@ public class Forge implements ApplicationListener {
graphics = new Graphics();
splashScreen = new SplashScreen();
Gdx.input.setInputProcessor(new MainInputProcessor());
/*
Set CatchBackKey here and exit the app when you hit the
back button while the textures,fonts,etc are still loading,
to prevent rendering issue when you try to restart
the app again (seems it doesnt dispose correctly...?!?)
*/
Gdx.input.setCatchBackKey(true);
destroyThis = true; //Prevent back()
ForgePreferences prefs = new ForgePreferences();
String skinName;
......@@ -115,7 +123,7 @@ public class Forge implements ApplicationListener {
FSkin.loadFull(splashScreen);
SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music
destroyThis = false; //Allow back()
Gdx.input.setCatchBackKey(true);
Gdx.input.setCatchMenuKey(true);
openScreen(HomeScreen.instance);
......@@ -167,6 +175,8 @@ public class Forge implements ApplicationListener {
}
public static void back() {
if(destroyThis && isLandscapeMode())
return;
if (screens.size() < 2) {
exit(false); //prompt to exit if attempting to go back from home screen
return;
......@@ -481,7 +491,12 @@ public class Forge implements ApplicationListener {
touchDown(0,0,0,0);
return fling(0,1000);
}
if(keyCode == Keys.BACK){
if (destroyThis)
deviceAdapter.exit();
else if(onHomeScreen() && isLandscapeMode())
back();
}
if (keyInputAdapter == null) {
if (KeyInputAdapter.isModifierKey(keyCode)) {
return false; //don't process modifiers keys for unknown adapter
......
......@@ -42,7 +42,12 @@ public class FDeckImportDialog extends FDialog {
private final FTextArea txtInput = add(new FTextArea(true));
private final FCheckBox newEditionCheck = add(new FCheckBox("Import latest version of card", true));
private final FCheckBox dateTimeCheck = add(new FCheckBox("Use only sets released before:", false));
private final FCheckBox onlyCoreExpCheck = add(new FCheckBox("Use only core and expansion sets", true));
/*setting onlyCoreExpCheck to false allow the copied cards to pass the check of deck contents
forge-core\src\main\java\forge\deck\Deck.javaDeck.java starting @ Line 320 which is called by
forge-gui-mobile\src\forge\deck\FDeckEditor.java starting @ Line 373
(as of latest commit: 8e6655e3ee67688cff66b422d4722c58392eaa7e)
*/
private final FCheckBox onlyCoreExpCheck = add(new FCheckBox("Use only core and expansion sets", false));
private final FComboBox<String> monthDropdown = add(new FComboBox<String>()); //don't need wrappers since skin can't change while this dialog is open
private final FComboBox<Integer> yearDropdown = add(new FComboBox<Integer>());
......
......@@ -94,7 +94,7 @@ public class SplashScreen extends FContainer {
String disclaimer = "Forge is not affiliated in any way with Wizards of the Coast.\n"
+ "Forge is open source software, released under the GNU Public License.";
g.drawText(disclaimer, disclaimerFont, FProgressBar.SEL_FORE_COLOR,
x, y, w, disclaimerHeight, true, Align.center, true);
x, y, w, disclaimerHeight, false, Align.center, true);
float padding = 20f / 450f * w;
float pbHeight = 57f / 450f * h;
......
......@@ -514,7 +514,7 @@ public class SettingsPage extends TabPage<SettingsScreen> {
g.drawText(value.label, font, foreColor, x, y, w, h, false, Align.left, false);
value.drawPrefValue(g, font, foreColor, x, y, w, h);
h += SettingsScreen.SETTING_PADDING;
h += SettingsScreen.SETTING_PADDING;//TODO: adjust settings page description bounds
g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, Align.left, false);
}
}
......
......@@ -4,5 +4,6 @@ Types:Sorcery
A:SP$ Destroy | Cost$ 4 B G | ValidTgts$ Creature | TgtPrompt$ Select target creature | SubAbility$ DBGainLife | SpellDescription$ Destroy target creature. You gain life equal to its toughness. You may search your library and/or graveyard from a card named Vraska, Regal Gorgon, reveal it, and put it into your hand. If you search your library this way, shuffle it.
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ X | SubAbility$ DBCleanup | References$ X | SubAbility$ DBSearch
SVar:DBSearch:DB$ ChangeZone | Origin$ Library,Graveyard | Destination$ Hand | ChangeType$ Card.namedVraska; Regal Gorgon | ChangeNum$ 1 | Optional$ True
SVar:X:TargetedLKI$CardToughness
DeckNeeds:Name$Vraska, Regal Gorgon
Oracle:Destroy target creature. You gain life equal to its toughness. You may search your library and/or graveyard from a card named Vraska, Regal Gorgon, reveal it, and put it in to your hand. If you search your library this way, shuffle it.
This diff is collapsed.
Name:Ryan Overturf's Grixis Cube (MTGO)
DeckFile:Ryan Overturf's Grixis Cube (MTGO)
Singleton:True
Booster: 15 Any
NumPacks: 3
[metadata]
Name:Possibility Storm - Magic Core Set 2020 #07
URL:http://www.possibilitystorm.com/wp-content/uploads/2019/08/126.-M207.jpg
Goal:Win
Turns:1
Difficulty:Rare
Description:Win this turn. Your Dauntless Bodyguard chose Shanna, Sisay's Legacy when it entered the battlefield.
[state]
humanlife=20
ailife=7
turn=1
activeplayer=human
activephase=MAIN1
humanhand=Strength of the Pack;Depose // Deploy;Storm the Citadel;Masterful Replication;Short Sword
humanbattlefield=Gideon Blackblade|Counters:LOYALTY=6;Blackblade Reforged;Omnispell Adept;Shanna, Sisay's Legacy|Id:9;Sigiled Sword of Valeron|AttachedTo:9;Dauntless Bodyguard|ChosenCards:9|Id:10|NoETBTrigs;Forebear's Blade|AttachedTo:10;Hallowed Fountain|NoETBTrigs;Hallowed Fountain|NoETBTrigs;Hallowed Fountain|NoETBTrigs;Temple Garden|NoETBTrigs;Temple Garden|NoETBTrigs;Temple Garden|NoETBTrigs
aibattlefield=Charity Extractor;Looming Altisaur;Gate Colossus;Looming Altisaur;Charity Extractor
......@@ -255,6 +255,8 @@ public abstract class GuiDownloadService implements Runnable {
byte[] buffer = new byte[1024];
for (Entry<String, String> kv : files.entrySet()) {
boolean isJPG = true;
boolean isLogged = false;
if (cancel) {//stop prevent sleep
GuiBase.getInterface().preventSystemSleep(false);
break; }
......@@ -265,8 +267,10 @@ public abstract class GuiDownloadService implements Runnable {
//decode URL Key
String decodedKey = URLDecoder.decode(kv.getKey());
final File fileDest = new File(decodedKey);
final String filePath = fileDest.getPath();
final String subLastIndex = filePath.contains("pics") ? "\\pics\\" : "\\db\\";
System.out.println(count + "/" + totalCount + " - " + fileDest);
System.out.println(count + "/" + totalCount + " - .." + filePath.substring(filePath.lastIndexOf(subLastIndex)+1));
FileOutputStream fos = null;
try {
......@@ -287,8 +291,12 @@ public abstract class GuiDownloadService implements Runnable {
// if file is not found and this is a JPG, give PNG a shot...
if ((conn.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) && (url.endsWith(".jpg")))
{
isJPG = false;
conn.disconnect();
System.out.println(" File not found: " + url);
if(url.contains("/images/")){
isLogged = true;
System.out.println("File not found: .." + url.substring(url.lastIndexOf("/images/")+1));
}
url = url.substring(0,url.length() - 4) + ".png";
imageUrl = new URL(url);
conn = (HttpURLConnection) imageUrl.openConnection(p);
......@@ -307,7 +315,8 @@ public abstract class GuiDownloadService implements Runnable {
break;
case HttpURLConnection.HTTP_NOT_FOUND:
conn.disconnect();
System.out.println(" File not found: " + url);
if(url.contains("/images/") && !isJPG && !isLogged)
System.out.println("File not found: .." + url.substring(url.lastIndexOf("/images/")+1));
break;
default:
conn.disconnect();
......