Merge pull request #1027 from Vitty85/master
Added TD2 set, increased Wagic version to 0.22.1, fixed some bugs in Android Java wrapper.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0211" android:installLocation="preferExternal" android:versionName="@string/app_version" package="net.wagic.app">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0221" android:installLocation="preferExternal" android:versionName="@string/app_version" package="net.wagic.app">
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Wagic</string>
|
||||
<string name="app_version">0.21.1</string>
|
||||
<string name="info_text">Wagic v0.21.1\\nAll Rights Reserved.</string>
|
||||
<string name="app_version">0.22.1</string>
|
||||
<string name="info_text">Wagic v0.22.1\\nAll Rights Reserved.</string>
|
||||
</resources>
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
|
||||
import android.graphics.*;
|
||||
import android.app.ProgressDialog;
|
||||
@@ -47,10 +46,9 @@ public class ImgDownloader {
|
||||
|
||||
static HashMap<String, HashMap<String, String>> database;
|
||||
|
||||
public static boolean loadDatabase(String path) {
|
||||
public static boolean loadDatabase(String path, String databaseurl) {
|
||||
database = new HashMap<String, HashMap<String, String>>();
|
||||
try {
|
||||
String databaseurl = "https://github.com/Vitty85/wagic/releases/download/wagic-v0.21.1/CardImageLinks.csv";
|
||||
URL url = new URL(databaseurl);
|
||||
HttpURLConnection httpcon = (HttpURLConnection) url.openConnection();
|
||||
if (httpcon == null) {
|
||||
@@ -549,12 +547,24 @@ public class ImgDownloader {
|
||||
cardurl = "https://deckmaster.info/images/cards/M15/-109-hr.jpg";
|
||||
else if (id.equals("383290t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/M15/-108-hr.jpg";
|
||||
else if (id.equals("74272"))
|
||||
cardurl = "https://img.scryfall.com/cards/large/front/4/5/45af7f55-9a69-43dd-969f-65411711b13e.jpg?1562487939";
|
||||
else if (id.equals("378445t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/BNG/-11-hr.jpg";
|
||||
else if (id.equals("378521t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/DDO/394383-hr.jpg";
|
||||
else if(id.equals("16699t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/NPH/-205-hr.jpg";
|
||||
else if(id.equals("16708t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/M10/-292-hr.jpg";
|
||||
else if(id.equals("16710t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/M11/-238-hr.jpg";
|
||||
else if(id.equals("16717t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/MBS/-212-hr.jpg";
|
||||
else if(id.equals("16718t"))
|
||||
cardurl = "http://1.bp.blogspot.com/-0-mLvfUVgNk/VmdZWXWxikI/AAAAAAAAAUM/TVCIiZ_c67g/s1600/Spawn%2BToken.jpg";
|
||||
else if(id.equals("16729t"))
|
||||
cardurl = "https://deckmaster.info/images/cards/MRD/-2829-hr.jpg";
|
||||
else if (id.equals("74272"))
|
||||
cardurl = "https://img.scryfall.com/cards/large/front/4/5/45af7f55-9a69-43dd-969f-65411711b13e.jpg?1562487939";
|
||||
else if (id.equals("687701"))
|
||||
cardurl = "https://deckmaster.info/images/cards/DKM/-2437-hr.jpg";
|
||||
else if (id.equals("687702"))
|
||||
@@ -1253,7 +1263,15 @@ public class ImgDownloader {
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public static String DownloadCardImages(String set, String[] availableSets, String targetres, String basePath, String destinationPath, ProgressDialog progressBarDialog, SDLActivity parent) throws IOException {
|
||||
public static String DownloadCardImages(String set, String[] availableSets, String targetres, String basePath, String destinationPath, ProgressDialog progressBarDialog, SDLActivity parent, boolean skipDownloaded) throws IOException {
|
||||
try {
|
||||
File oldzip = new File(destinationPath + File.separator + set + File.separator + set + ".zip");
|
||||
if(oldzip.exists() && skipDownloaded)
|
||||
return "";
|
||||
else
|
||||
oldzip.delete();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
String res = "";
|
||||
|
||||
String baseurl = "https://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=";
|
||||
@@ -1581,46 +1599,136 @@ public class ImgDownloader {
|
||||
if (id.endsWith("t"))
|
||||
continue;
|
||||
Document doc = null;
|
||||
try {
|
||||
doc = Jsoup.connect(baseurl + id).get();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Warning: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i will retry 2 times more...");
|
||||
String cardname = "";
|
||||
Elements divs = new Elements();
|
||||
int k;
|
||||
if(scryset.equals("TD2")){
|
||||
try {
|
||||
doc = Jsoup.connect(baseurl + id).get();
|
||||
} catch (Exception e2) {
|
||||
System.out.println("Warning: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i will retry 1 time more...");
|
||||
doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get();
|
||||
Elements outlinks = doc.select("body a");
|
||||
if (outlinks != null) {
|
||||
for (int h = 0; h < outlinks.size(); h++) {
|
||||
String linkcard = outlinks.get(h).attributes().get("href");
|
||||
if (linkcard != null && linkcard.contains(mappa.get(id).toLowerCase().replace(" ", "-"))) {
|
||||
try {
|
||||
doc = Jsoup.connect(linkcard).get();
|
||||
if (doc == null)
|
||||
continue;
|
||||
Elements metadata = doc.select("head meta");
|
||||
if (metadata != null) {
|
||||
for (int j = 0; j < metadata.size(); j++) {
|
||||
if (metadata.get(j).attributes().get("content").toLowerCase().contains(mappa.get(id).toLowerCase())) {
|
||||
h = outlinks.size();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("Warning: Problem downloading card: " + mappa.get(id) + " (" + id + ".jpg), i will retry 2 times more...");
|
||||
try {
|
||||
doc = Jsoup.connect(baseurl + id).get();
|
||||
} catch (Exception e3) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i will not retry anymore...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get();
|
||||
Elements outlinks = doc.select("body a");
|
||||
if (outlinks != null) {
|
||||
for (int h = 0; h < outlinks.size(); h++) {
|
||||
String linkcard = outlinks.get(h).attributes().get("href");
|
||||
if (linkcard != null && linkcard.contains(mappa.get(id).toLowerCase().replace(" ", "-"))) {
|
||||
try {
|
||||
doc = Jsoup.connect(linkcard).get();
|
||||
if (doc == null)
|
||||
continue;
|
||||
Elements metadata = doc.select("head meta");
|
||||
if (metadata != null) {
|
||||
for (int j = 0; j < metadata.size(); j++) {
|
||||
if (metadata.get(j).attributes().get("content").toLowerCase().contains(mappa.get(id).toLowerCase())) {
|
||||
h = outlinks.size();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
System.out.println("Warning: Problem downloading card: " + mappa.get(id) + " (" + id + ".jpg), i will retry 1 time more...");
|
||||
try {
|
||||
doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get();
|
||||
Elements outlinks = doc.select("body a");
|
||||
if (outlinks != null) {
|
||||
for (int h = 0; h < outlinks.size(); h++) {
|
||||
String linkcard = outlinks.get(h).attributes().get("href");
|
||||
if (linkcard != null && linkcard.contains(mappa.get(id).toLowerCase().replace(" ", "-"))) {
|
||||
try {
|
||||
doc = Jsoup.connect(linkcard).get();
|
||||
if (doc == null)
|
||||
continue;
|
||||
Elements metadata = doc.select("head meta");
|
||||
if (metadata != null) {
|
||||
for (int j = 0; j < metadata.size(); j++) {
|
||||
if (metadata.get(j).attributes().get("content").toLowerCase().contains(mappa.get(id).toLowerCase())) {
|
||||
h = outlinks.size();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e3) {
|
||||
System.err.println("Error: Problem downloading card: " + mappa.get(id) + " (" + id + ".jpg), i will not retry anymore...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doc == null) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i can't download it...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
Elements divs = doc.select("body div");
|
||||
if (divs == null) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i can't download it...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
doc = Jsoup.connect(baseurl + id).get();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Warning: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i will retry 2 times more...");
|
||||
try {
|
||||
doc = Jsoup.connect(baseurl + id).get();
|
||||
} catch (Exception e2) {
|
||||
System.out.println("Warning: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i will retry 1 time more...");
|
||||
try {
|
||||
doc = Jsoup.connect(baseurl + id).get();
|
||||
} catch (Exception e3) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i will not retry anymore...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doc == null) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i can't download it...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
divs = doc.select("body div");
|
||||
if (divs == null) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i can't download it...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
|
||||
int k;
|
||||
for (k = 0; k < divs.size(); k++)
|
||||
if (divs.get(k).childNodes().size() > 0 && divs.get(k).childNode(0).toString().toLowerCase().contains("card name"))
|
||||
break;
|
||||
if (k >= divs.size()) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i can't download it...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
for (k = 0; k < divs.size(); k++)
|
||||
if (divs.get(k).childNodes().size() > 0 && divs.get(k).childNode(0).toString().toLowerCase().contains("card name"))
|
||||
break;
|
||||
if (k >= divs.size()) {
|
||||
System.err.println("Error: Problem reading card (" + mappa.get(id) + ") infos from: " + baseurl + id + ", i can't download it...");
|
||||
res = mappa.get(id) + " - " + set + File.separator + id + ".jpg\n" + res;
|
||||
continue;
|
||||
}
|
||||
cardname = divs.get(k + 1).childNode(0).attributes().get("#text").replace("\r\n", "").trim();
|
||||
}
|
||||
String cardname = divs.get(k + 1).childNode(0).attributes().get("#text").replace("\r\n", "").trim();
|
||||
|
||||
while (parent.paused && parent.downloadInProgress) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@@ -1656,7 +1764,7 @@ public class ImgDownloader {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (targetres.equals("High")) {
|
||||
} else if (targetres.equals("High") && !scryset.equals("TD2")) {
|
||||
try {
|
||||
doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get();
|
||||
Elements outlinks = doc.select("body a");
|
||||
@@ -1743,7 +1851,7 @@ public class ImgDownloader {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (!scryset.equals("TD2")){
|
||||
try {
|
||||
doc = Jsoup.connect(imageurl + scryset.toLowerCase()).get();
|
||||
} catch (Exception e) {
|
||||
@@ -2261,11 +2369,6 @@ public class ImgDownloader {
|
||||
|
||||
if (parent.downloadInProgress) {
|
||||
try {
|
||||
try {
|
||||
File oldzip = new File(destinationPath + File.separator + set + File.separator + set + ".zip");
|
||||
oldzip.delete();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
ZipParameters zipParameters = new ZipParameters();
|
||||
zipParameters.setCompressionMethod(CompressionMethod.STORE);
|
||||
File folder = new File(destinationPath + set + File.separator);
|
||||
|
||||
@@ -9,15 +9,12 @@ import android.os.StrictMode;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
@@ -31,7 +28,6 @@ import net.wagic.utils.DeckImporter;
|
||||
import net.wagic.utils.ImgDownloader;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.widget.ListView;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
@@ -54,7 +50,6 @@ import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -94,8 +89,8 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
public String mErrorMessage = "";
|
||||
public Boolean mErrorHappened = false;
|
||||
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||
public static String RES_FILENAME = "core_0211.zip";
|
||||
public static String RES_URL = "https://github.com/Vitty85/wagic/releases/download/wagic-v0.21.1/core_0211.zip";
|
||||
public static String RES_FILENAME = "";
|
||||
public static String databaseurl = "https://github.com/WagicProject/wagic/releases/download/wagic-v0.22.1/CardImageLinks.csv";
|
||||
|
||||
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||
private String userFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/User/";
|
||||
@@ -338,8 +333,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
}
|
||||
|
||||
private void startDownload() {
|
||||
//String url = getResourceUrl();
|
||||
String url = RES_URL;
|
||||
String url = getResourceUrl();
|
||||
if (!checkStorageState()) {
|
||||
Log.e(TAG, "Error in initializing storage space.");
|
||||
mSingleton.downloadError("Failed to initialize storage space for game. Please verify that your sdcard or internal memory is mounted properly.");
|
||||
@@ -384,7 +378,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
File[] listOfFiles = baseFolder.listFiles();
|
||||
ZipFile zipFile = null;
|
||||
try {
|
||||
zipFile = new ZipFile(baseFolder + "/" + listOfFiles[0].getName());
|
||||
zipFile = new ZipFile(baseFolder + "/" + RES_FILENAME);
|
||||
Enumeration<? extends ZipEntry> e = zipFile.entries();
|
||||
while (e.hasMoreElements()) {
|
||||
ZipEntry entry = e.nextElement();
|
||||
@@ -437,7 +431,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
fast = ImgDownloader.loadDatabase(getSystemStorageLocation());
|
||||
fast = ImgDownloader.loadDatabase(getSystemStorageLocation(), databaseurl);
|
||||
}
|
||||
}).start();
|
||||
|
||||
@@ -452,7 +446,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
|
||||
infoDialog.setNegativeButton("Retry", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
fast = ImgDownloader.loadDatabase(getSystemStorageLocation());
|
||||
fast = ImgDownloader.loadDatabase(getSystemStorageLocation(), databaseurl);
|
||||
showWarningFast();
|
||||
}
|
||||
});
|
||||
@@ -531,7 +525,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
|
||||
resChooser.setPositiveButton("Start Download", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
downloadCardImagesStart();
|
||||
skipDownloadedSets();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -544,12 +538,35 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
resChooser.create().show();
|
||||
}
|
||||
|
||||
private void skipDownloadedSets() {
|
||||
AlertDialog.Builder skipChooser = new AlertDialog.Builder(this);
|
||||
|
||||
skipChooser.setTitle("Do you want to overwrite existing sets?");
|
||||
|
||||
skipChooser.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
skipDownloaded = false;
|
||||
downloadCardImagesStart();
|
||||
}
|
||||
});
|
||||
|
||||
skipChooser.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
skipDownloaded = true;
|
||||
downloadCardImagesStart();
|
||||
}
|
||||
});
|
||||
|
||||
skipChooser.create().show();
|
||||
}
|
||||
|
||||
boolean error = false;
|
||||
boolean skipDownloaded = false;
|
||||
String res = "";
|
||||
public volatile boolean downloadInProgress = false;
|
||||
public volatile boolean paused = false;
|
||||
ProgressDialog cardDownloader;
|
||||
|
||||
volatile int currentIndex = 0;
|
||||
private void downloadCardImagesStart() {
|
||||
final SDLActivity parent = this;
|
||||
final Handler mHandler = new Handler();
|
||||
@@ -567,7 +584,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
downloadInProgress = true;
|
||||
paused = false;
|
||||
if (selectedSets != null) {
|
||||
for (int i = 0; i < selectedSets.size() && downloadInProgress; i++) {
|
||||
for (currentIndex = 0; currentIndex < selectedSets.size() && downloadInProgress; currentIndex++) {
|
||||
while (paused) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@@ -577,13 +594,13 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
set = selectedSets.get(i);
|
||||
set = selectedSets.get(currentIndex);
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
cardDownloader.setTitle("Downloading set: " + set);
|
||||
cardDownloader.setTitle("Downloading set: " + set + " (" + (currentIndex + 1) + " of " + selectedSets.size() + ")");
|
||||
}
|
||||
});
|
||||
String details = ImgDownloader.DownloadCardImages(set, availableSets, targetRes, getSystemStorageLocation(), getUserStorageLocation() + "sets/", cardDownloader, parent);
|
||||
String details = ImgDownloader.DownloadCardImages(set, availableSets, targetRes, getSystemStorageLocation(), getUserStorageLocation() + "sets/", cardDownloader, parent, skipDownloaded);
|
||||
if (!details.isEmpty()) {
|
||||
if (!res.isEmpty())
|
||||
res = res + "\nSET " + set + ":\n" + details;
|
||||
@@ -672,6 +689,8 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
res = "";
|
||||
set = "";
|
||||
targetRes = "High";
|
||||
skipDownloaded = false;
|
||||
currentIndex = 0;
|
||||
selectedSets = new ArrayList<String>();
|
||||
for (int i = 0; i < checkedSet.length; i++) {
|
||||
checkedSet[i] = false;
|
||||
@@ -695,6 +714,8 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
res = "";
|
||||
set = "";
|
||||
targetRes = "High";
|
||||
skipDownloaded = false;
|
||||
currentIndex = 0;
|
||||
selectedSets = new ArrayList<String>();
|
||||
for (int i = 0; i < checkedSet.length; i++) {
|
||||
checkedSet[i] = false;
|
||||
@@ -814,7 +835,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
// So we can call stuff from static callbacks
|
||||
mSingleton = this;
|
||||
mContext = this.getApplicationContext();
|
||||
//RES_FILENAME = getResourceName();
|
||||
RES_FILENAME = getResourceName();
|
||||
StorageOptions.determineStorageOptions();
|
||||
checkStorageLocationPreference();
|
||||
}
|
||||
@@ -1092,10 +1113,10 @@ public class SDLActivity extends Activity implements OnKeyListener {
|
||||
output.close();
|
||||
input.close();
|
||||
} catch (Exception e) {
|
||||
String errorMessage = "An error happened while downloading the resources. It could be that our server is temporarily down, that your device is not connected to a network, or that we cannot write to " + mSingleton.getSystemStorageLocation() + ". Please check your phone settings and try again. For more help please go to http://wagic.net";
|
||||
//mSingleton.downloadError(errorMessage);
|
||||
//Log.e(TAG, errorMessage);
|
||||
//Log.e(TAG, e.getMessage());
|
||||
String errorMessage = "An error happened while downloading the resources. It could be that our server is temporarily down, that your device is not connected to a network, or that we cannot write to " + mSingleton.getSystemStorageLocation() + ". Please check your phone settings and try again. For more help please go to http://wololo.net/forum/";
|
||||
mSingleton.downloadError(errorMessage);
|
||||
Log.e(TAG, errorMessage);
|
||||
Log.e(TAG, e.getMessage());
|
||||
}
|
||||
|
||||
return Long.valueOf(totalBytes);
|
||||
|
||||
@@ -54,7 +54,7 @@ PRESS CIRCLE TO GO TO THE DECK EDITOR!=PREMI CERCHIO PER TORNARE AL DECK EDITOR!
|
||||
#Testo Ciclico:
|
||||
Interested in playing Momir Basic? You'll have to unlock it first :)=Ti interessa giocare alla modalita' Momir? Devi prima sbloccarla :).
|
||||
Love Equipment and want a real challenge? Unlock Stone Hewer Basic:)=Ti piacciono gli equipaggiamenti e vuoi una vera sfida? Sblocca la Stone Hewer :)
|
||||
More cards and mods at http://wololo.net/wagic=Scarica le ultimae carte aggiornate online.
|
||||
More cards and mods at http://wololo.net/wagic=Scarica le ultime carte aggiornate online.
|
||||
The cards in your collection have an average value of %i credits=Le carte della tua collezione hanno un valore di %i crediti.
|
||||
The shopkeeper would buy your entire collection for around %i credits=Potresti vendere la tua intera collezione per circa %i crediti
|
||||
These stats will be updated next time you run Wagic=Queste satistiche saranno aggiornate la prossima volta che giocherai a Magic
|
||||
|
||||
481
projects/mtg/bin/Res/sets/TD2/_cards.dat
Normal file
481
projects/mtg/bin/Res/sets/TD2/_cards.dat
Normal file
@@ -0,0 +1,481 @@
|
||||
[meta]
|
||||
author=Wagic Team
|
||||
name=Duel Decks: Mirrodin Pure vs. New Phyrexia
|
||||
year=2011-05-12
|
||||
total=88
|
||||
[/meta]
|
||||
[card]
|
||||
primitive=Platinum Angel
|
||||
id=16650
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Memnite
|
||||
id=16651
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Steel Wall
|
||||
id=16652
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ardent Recruit
|
||||
id=16653
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Vedalken Certarch
|
||||
id=16654
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Gold Myr
|
||||
id=16655
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Myr Retriever
|
||||
id=16656
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Silver Myr
|
||||
id=16657
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Trinket Mage
|
||||
id=16658
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Grand Architect
|
||||
id=16659
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Silent Arbiter
|
||||
id=16660
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Glimmerpoint Stag
|
||||
id=16661
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Argent Sphinx
|
||||
id=16662
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kuldotha Forgemaster
|
||||
id=16663
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spire Serpent
|
||||
id=16664
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Darksteel Sentinel
|
||||
id=16665
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Duplicant
|
||||
id=16666
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lumengrid Gargoyle
|
||||
id=16667
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Darksteel Gargoyle
|
||||
id=16668
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bonesplitter
|
||||
id=16669
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Slagwurm Armor
|
||||
id=16670
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Condemn
|
||||
id=16671
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dispatch
|
||||
id=16672
|
||||
rarityU
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Steelshaper's Gift
|
||||
id=16673
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Neurok Stealthsuit
|
||||
id=16674
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Talisman of Progress
|
||||
id=16675
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Viridian Claw
|
||||
id=16676
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Purge
|
||||
id=16677
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Test of Faith
|
||||
id=16678
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Turn the Tide
|
||||
id=16679
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Thunderstaff
|
||||
id=16680
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Arrest
|
||||
id=16681
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Thirst for Knowledge
|
||||
id=16682
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Stoic Rebuttal
|
||||
id=16683
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=White Sun's Zenith
|
||||
id=16684
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ancient Den
|
||||
id=16685
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Blinkmoth Nexus
|
||||
id=16686
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Coastal Tower
|
||||
id=16687
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forbidding Watchtower
|
||||
id=16688
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Seat of the Synod
|
||||
id=16689
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Terramorphic Expanse
|
||||
id=16690
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plains
|
||||
id=16691
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plains
|
||||
id=16692
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plains
|
||||
id=16693
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Island
|
||||
id=16694
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Island
|
||||
id=16695
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Island
|
||||
id=16696
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Phyrexian Plaguelord
|
||||
id=16697
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Fume Spitter
|
||||
id=16698
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Myr Sire
|
||||
id=16699
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plague Myr
|
||||
id=16700
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Viridian Emissary
|
||||
id=16701
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Phyrexian Ghoul
|
||||
id=16702
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rot Wolf
|
||||
id=16703
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Necroskitter
|
||||
id=16704
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Viridian Corrupter
|
||||
id=16705
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Desecration Elemental
|
||||
id=16706
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Flesh-Eater Imp
|
||||
id=16707
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Symbiotic Elf
|
||||
id=16708
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Soul Snuffers
|
||||
id=16709
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mitotic Slime
|
||||
id=16710
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plaguemaw Beast
|
||||
id=16711
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Phyrexian Juggernaut
|
||||
id=16712
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Drooling Groodion
|
||||
id=16713
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Protean Hulk
|
||||
id=16714
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Innocent Blood
|
||||
id=16715
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Contagion Clasp
|
||||
id=16716
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mortarpod
|
||||
id=16717
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spawning Pit
|
||||
id=16718
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Exhume
|
||||
id=16719
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Phyrexian Altar
|
||||
id=16720
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Morbid Plunder
|
||||
id=16721
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Putrefy
|
||||
id=16722
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Grafted Exoskeleton
|
||||
id=16723
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Diabolic Servitude
|
||||
id=16724
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Barter in Blood
|
||||
id=16725
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Reprocess
|
||||
id=16726
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Triumph of the Hordes
|
||||
id=16727
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spread the Sickness
|
||||
id=16728
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=One Dozen Eyes
|
||||
id=16729
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Black Sun's Zenith
|
||||
id=16730
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Tainted Wood
|
||||
id=16731
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swamp
|
||||
id=16732
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swamp
|
||||
id=16733
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swamp
|
||||
id=16734
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forest
|
||||
id=16735
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forest
|
||||
id=16736
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forest
|
||||
id=16737
|
||||
rarity=L
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cat
|
||||
id=-16684
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Myr
|
||||
id=-16699
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Insect
|
||||
id=-16708
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ooze
|
||||
id=-16710
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Germ
|
||||
id=-16717
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spawn
|
||||
id=-16718
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Beast
|
||||
id=-16729
|
||||
rarity=T
|
||||
[/card]
|
||||
@@ -880,3 +880,31 @@ subtype=Zombie Wizard
|
||||
power=2
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
name=Diabolic Servitude
|
||||
auto=moveTo(myBattlefield) target(creature|mygraveyard)
|
||||
auto=soulbond @movedto(this|graveyard) from(battlefield):moveto(exile) && all(this) transforms((,newability[moveTo(ownerhand)]))
|
||||
auto=soulbond @movedto(this|graveyard) from(battlefield):moveto(exile)
|
||||
text={B}{B}, Pay 2 life, Sacrifice a Swamp: Return target creature card from your graveyard to the battlefield.
|
||||
mana={3}{B}
|
||||
type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
name=Protean Hulk
|
||||
aicode=activate moveTo(myBattlefield) target(<anyamount>creature[manacost<=6]|myLibrary)
|
||||
auto=@movedTo(this|graveyard) from(battlefield):name(Search any number of creatures with casting cost 6 or less) reveal:plibrarycount optionone name(Choose card) target(<anyamount>creature[manacost<=6]|reveal) moveto(ownerlibrary) and!( becomes(tobecast) ueot )! optiononeend optiontwo name(Put them back) target(<anyamount>*|reveal) moveto(ownerlibrary) and!( all(*|reveal) moveto(ownerlibrary) and!(shuffle)! )! optiontwoend afterrevealed all(tobecast|mylibrary) moveto(ownerlibrary) and!(activate castcard(putinplay))! afterrevealedend revealend
|
||||
text=When Protean Hulk dies, search your library for any number of creature cards with total converted mana cost 6 or less, put them onto the battlefield, then suffle your library.
|
||||
mana={5}{G}{G}
|
||||
type=Creature
|
||||
subtype=Beast
|
||||
power=6
|
||||
toughness=6
|
||||
[/card]
|
||||
[card]
|
||||
name=Thunderstaff
|
||||
auto=@sourcenottap:each blockers:absorb:type:creature[attacking]:opponentbattlefield controller
|
||||
auto={2}{T}:lord(creature[attacking]) 1/0
|
||||
text=As long as Thunderstaff is untapped, if a creature would deal combate to you, prevent 1 of that damage. / {2},{T}: Attacking creatures get +1/+0 until end of turn.
|
||||
mana={3}
|
||||
type=Artifact
|
||||
[/card]
|
||||
@@ -32421,6 +32421,16 @@ power=1
|
||||
toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
name=Drooling Groodion
|
||||
auto={2}{B}{G}{S(creature|mybattlefield)}: target(creature|battlefield) 2/2 && target(other creature|battlefield) -2/-2
|
||||
text={2}{B}{G},sacrifice a creature: Target creature gets +2/+2 until end of turn. Another target creature gets -2/-2 until end of turn.
|
||||
mana={3}{B}{B}{G}
|
||||
type=Creature
|
||||
subtype=Beast
|
||||
power=4
|
||||
toughness=3
|
||||
[/card]
|
||||
[card]
|
||||
name=Drooling Ogre
|
||||
auto=@movedto(*[artifact]|opponentstack):moveto(opponentBattlefield)
|
||||
text=Whenever a player casts an artifact spell, that player gains control of Drooling Ogre. (This effect lasts indefinitely.)
|
||||
@@ -49478,6 +49488,18 @@ power=2
|
||||
toughness=3
|
||||
[/card]
|
||||
[card]
|
||||
name=Grand Architect
|
||||
auto=lord(other creature[blue]|myBattlefield) 1/1
|
||||
auto={U}:target(creature[artifact]) becomes(blue)
|
||||
auto=={T(creature[blue]|mybattlefield)}:Add{2}
|
||||
text=Other blue creatures you control get +1/+1. / {U}:Target artifact creature becomes blue until end of turn. / Tap an untapped blue creature you control: Add {C}{C}. Spend this mana only to cast artifact spells or activate abilities of artifacts.
|
||||
mana={1}{U}{U}
|
||||
type=Creature
|
||||
subtype=Vedalken Artificer
|
||||
power=1
|
||||
toughness=3
|
||||
[/card]
|
||||
[card]
|
||||
name=Grand Coliseum
|
||||
auto=tap(noevent)
|
||||
auto={T}:Add{1}
|
||||
@@ -105691,6 +105713,18 @@ mana={W}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
name=Silent Arbiter
|
||||
auto=aslongas(creature[attacking]|battlefield) lord(creature[-attacking]|battlefield) cantattack
|
||||
auto=aslongas(creature[attacking]|battlefield) lord(creature[-attacking]|battlefield) cantpwattack
|
||||
auto=aslongas(creature[blocking]|battlefield) lord(creature[-blocking]|battlefield) cantblock
|
||||
text=No more than one creature can attack each combat. / No more than one creature can block each combat.
|
||||
mana={4}
|
||||
type=Artifact Creature
|
||||
subtype=Construct
|
||||
power=1
|
||||
toughness=5
|
||||
[/card]
|
||||
[card]
|
||||
name=Silent Artisan
|
||||
mana={3}{W}{W}
|
||||
type=Creature
|
||||
@@ -113968,6 +114002,15 @@ power=5
|
||||
toughness=5
|
||||
[/card]
|
||||
[card]
|
||||
name=Stoic Rebuttal
|
||||
target=*|stack
|
||||
auto=fizzle
|
||||
auto=aslongas(artifact|mybattlefield) changecost(colorless:-1) >2
|
||||
text=Metalcraft -- This spell cost {1} less to cast if you control three or more artifacts. / Counter target spell.
|
||||
mana={1}{U}{U}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
name=Stoke the Flames
|
||||
target=creature,player
|
||||
auto=damage:4
|
||||
|
||||
@@ -12,7 +12,7 @@ Author: Michael Nguyen
|
||||
|
||||
/* Wagic versions */
|
||||
#define WAGIC_VERSION_MAJOR 0
|
||||
#define WAGIC_VERSION_MEDIUM 21
|
||||
#define WAGIC_VERSION_MEDIUM 22
|
||||
#define WAGIC_VERSION_MINOR 1
|
||||
|
||||
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
|
||||
@@ -26,8 +26,8 @@ Author: Michael Nguyen
|
||||
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
||||
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
|
||||
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
|
||||
#define WAGIC_RESOURCE_NAME "Wagic-core.zip"
|
||||
#define WAGIC_RELEASE_NAME "latest-master"
|
||||
#define WAGIC_RESOURCE_NAME "Wagic-core-" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) ".zip"
|
||||
#define WAGIC_RELEASE_NAME "wagic-v" WAGIC_VERSION_STRING
|
||||
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user