@@ -1,6 +1,37 @@
|
||||
# Changelog
|
||||
|
||||
## [latest-master] (https://github.com/WagicProject/wagic/tree/latest-master)
|
||||
#### 8/3/16
|
||||
- *Merged pull-request:* andAbility on ATokenCreator, Extend AAFlip [#\824] (https://github.com/WagicProject/wagic/pull/824) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/31/16
|
||||
- *Merged pull-request:* Fix Chandra, Flamecaller & Cryptolith Rite [#\818] (https://github.com/WagicProject/wagic/pull/818) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/28/16
|
||||
- *Merged pull-request:* changing some of the logic to the previous fixes, we want to avoid using code that looks for specific card names. [#\800] (https://github.com/WagicProject/wagic/pull/800) ([zethfoxster](https://github.com/zethfoxster))
|
||||
|
||||
#### 7/26/16
|
||||
- *Merged pull-request:* granted flashback [#\791] (https://github.com/WagicProject/wagic/pull/791) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/23/16
|
||||
- *Merged pull-request:* Fix Flying vs Moat (multiples of them). Fixes issue #526 [#\783] (https://github.com/WagicProject/wagic/pull/783) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/19/16
|
||||
- *Merged pull-request:* pushing to master [#\770] (https://github.com/WagicProject/wagic/pull/770) ([zethfoxster](https://github.com/zethfoxster))
|
||||
|
||||
#### 7/18/16
|
||||
- *Merged pull-request:* Fix Deck Menu layer, Change Main Menu Layout, Fix Crash cdaactive on tokens [#\765] (https://github.com/WagicProject/wagic/pull/765) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/12/16
|
||||
- *Merged pull-request:* Pushing fixes [#\750] (https://github.com/WagicProject/wagic/pull/750) ([zethfoxster](https://github.com/zethfoxster))
|
||||
|
||||
- *Merged pull-request:* try to fix failed logic here [#\747] (https://github.com/WagicProject/wagic/pull/747) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/9/16
|
||||
- *Merged pull-request:* pushing to master [#\738] (https://github.com/WagicProject/wagic/pull/738) ([zethfoxster](https://github.com/zethfoxster))
|
||||
|
||||
- *Merged pull-request:* Sorted Primitives and Cleanup Tabs [#\736] (https://github.com/WagicProject/wagic/pull/736) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
#### 7/7/16
|
||||
- *Merged pull-request:* Sorted Primitives and Cleanup Tabs [#\727] (https://github.com/WagicProject/wagic/pull/719) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
|
||||
@@ -77,6 +77,13 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
|
||||
: "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory");
|
||||
return (result == 0);
|
||||
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
int result;
|
||||
__asm__ __volatile__(
|
||||
"lock ; xchgl %0, (%1)\n"
|
||||
: "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
|
||||
return (result == 0);
|
||||
|
||||
#else
|
||||
/* Need CPU instructions for spinlock here! */
|
||||
__need_spinlock_implementation__
|
||||
|
||||
@@ -20,7 +20,7 @@ It is highly customizable and allows the player to tweak the rules / create thei
|
||||
|
||||
Info, downloads, discussions and more at http://wololo.net/forum/index.php
|
||||
|
||||
-
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/gen
|
||||
/bin
|
||||
/libs
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<application android:debuggable="false" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
||||
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<activity android:debuggable="false" android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
|
||||
</application>
|
||||
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
|
||||
</manifest>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
APP_PROJECT_PATH := $(call my-dir)/..
|
||||
APP_CPPFLAGS += -frtti -fexceptions
|
||||
APP_ABI := armeabi armeabi-v7a
|
||||
#APP_ABI := x86 # mainly for emulators
|
||||
APP_STL := gnustl_static
|
||||
APP_MODULES := libpng libjpeg main SDL
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 7.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 3.5 KiB |
@@ -11,14 +11,13 @@ import android.util.Log;
|
||||
|
||||
public class DeckImporter
|
||||
{
|
||||
|
||||
public static String importDeck( File f, String mypath, String activePath )
|
||||
{
|
||||
String message = "";
|
||||
String deck = "";
|
||||
String deckname = "";
|
||||
String prefix = "#SB:";
|
||||
int cardcount = 0;
|
||||
String prefix = "#SB:";
|
||||
int cardcount = 0;
|
||||
if(f.exists() && !f.isDirectory())
|
||||
{
|
||||
deckname = f.getName();
|
||||
@@ -36,91 +35,86 @@ public class DeckImporter
|
||||
while (scanner.hasNext())
|
||||
{
|
||||
String line = scanner.nextLine();
|
||||
line = line.trim();
|
||||
if (!line.equals("") && cardcount < 61) // don't write out blank lines
|
||||
{
|
||||
String[] slines = line.split("\\s+");
|
||||
String arranged = "";
|
||||
for(int idx = 1; idx < slines.length; idx++)
|
||||
{
|
||||
arranged += slines[idx] + " ";
|
||||
}
|
||||
if ((isNumeric(slines[0])) && arranged != null)
|
||||
{
|
||||
if (slines[1] != null && slines[1].startsWith("["))
|
||||
{
|
||||
arranged = arranged.substring(5);
|
||||
slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]","");
|
||||
deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
deck += arranged + "(*) * " + slines[0] + "\n";
|
||||
}
|
||||
cardcount += Integer.parseInt(slines[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
File profile = new File(activePath+"/Res/settings/options.txt");
|
||||
if(profile.exists() && !profile.isDirectory())
|
||||
{
|
||||
String profileName = getActiveProfile(profile);
|
||||
if(profileName != "Missing!")
|
||||
{
|
||||
File rootProfiles = new File(activePath+"/Res/profiles/"+profileName);
|
||||
if(rootProfiles.exists() && rootProfiles.isDirectory())
|
||||
{
|
||||
//save deck
|
||||
int countdeck = 1;
|
||||
File[] files = rootProfiles.listFiles();
|
||||
for (int i = 0; i < files.length; i++)
|
||||
{//check if there is available deck...
|
||||
if(files[i].getName().startsWith("deck"))
|
||||
countdeck++;
|
||||
}
|
||||
File toSave = new File(rootProfiles+"/deck"+countdeck+".txt");
|
||||
try
|
||||
{
|
||||
FileOutputStream fop = new FileOutputStream(toSave);
|
||||
|
||||
// if file doesn't exists, then create it
|
||||
if (!toSave.exists()) {
|
||||
toSave.createNewFile();
|
||||
}
|
||||
// get the content in bytes
|
||||
byte[] contentInBytes = deck.getBytes();
|
||||
fop.write(contentInBytes);
|
||||
fop.flush();
|
||||
fop.close();
|
||||
message = "Import Deck Success!\n"+cardcount+" total cards in this deck\n\n"+deck;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
message = e.getMessage();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Missing Folder!";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Invalid Profile!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "No errors, and file EMPTY";
|
||||
}
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
message = e.getMessage();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
line = line.trim();
|
||||
if (!line.equals("") && cardcount < 61) // don't write out blank lines
|
||||
{
|
||||
String[] slines = line.split("\\s+");
|
||||
String arranged = "";
|
||||
for (int idx = 1; idx < slines.length; idx++)
|
||||
{
|
||||
arranged += slines[idx] + " ";
|
||||
}
|
||||
if ((isNumeric(slines[0])) && arranged != null)
|
||||
{
|
||||
if (slines[1] != null && slines[1].startsWith("["))
|
||||
{
|
||||
arranged = arranged.substring(5);
|
||||
slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]", "");
|
||||
deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n";
|
||||
} else
|
||||
{
|
||||
deck += arranged + "(*) * " + slines[0] + "\n";
|
||||
}
|
||||
cardcount += Integer.parseInt(slines[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
File profile = new File(activePath + "/Res/settings/options.txt");
|
||||
if (profile.exists() && !profile.isDirectory())
|
||||
{
|
||||
String profileName = getActiveProfile(profile);
|
||||
if (profileName != "Missing!")
|
||||
{
|
||||
File rootProfiles = new File(activePath + "/Res/profiles/" + profileName);
|
||||
if (rootProfiles.exists() && rootProfiles.isDirectory())
|
||||
{
|
||||
//save deck
|
||||
int countdeck = 1;
|
||||
File[] files = rootProfiles.listFiles();
|
||||
for (int i = 0; i < files.length; i++)
|
||||
{//check if there is available deck...
|
||||
if (files[i].getName().startsWith("deck"))
|
||||
countdeck++;
|
||||
}
|
||||
File toSave = new File(rootProfiles + "/deck" + countdeck + ".txt");
|
||||
try
|
||||
{
|
||||
FileOutputStream fop = new FileOutputStream(toSave);
|
||||
|
||||
// if file doesn't exists, then create it
|
||||
if (!toSave.exists())
|
||||
{
|
||||
toSave.createNewFile();
|
||||
}
|
||||
// get the content in bytes
|
||||
byte[] contentInBytes = deck.getBytes();
|
||||
fop.write(contentInBytes);
|
||||
fop.flush();
|
||||
fop.close();
|
||||
message = "Import Deck Success!\n" + cardcount + " total cards in this deck\n\n" + deck;
|
||||
} catch (IOException e)
|
||||
{
|
||||
message = e.getMessage();
|
||||
}
|
||||
} else
|
||||
{
|
||||
message = "Missing Folder!";
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
message = "Invalid Profile!";
|
||||
}
|
||||
} else
|
||||
{
|
||||
message = "No errors, and file EMPTY";
|
||||
}
|
||||
} catch (IOException e)
|
||||
{
|
||||
message = e.getMessage();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
private static boolean isNumeric(String input)
|
||||
@@ -135,7 +129,7 @@ public class DeckImporter
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private static String getActiveProfile(File mypath)
|
||||
{
|
||||
String name = "";
|
||||
@@ -158,7 +152,7 @@ public class DeckImporter
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
private static String renameSet(String set)
|
||||
{
|
||||
if (set == "")
|
||||
@@ -278,5 +272,4 @@ public class DeckImporter
|
||||
else
|
||||
return set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.util.Log;
|
||||
|
||||
public class StorageOptions
|
||||
{
|
||||
private static final String TAG = StorageOptions.class.getCanonicalName();
|
||||
private static ArrayList<String> mMounts = new ArrayList<String>();
|
||||
private static ArrayList<String> mVold = new ArrayList<String>();
|
||||
|
||||
@@ -77,11 +78,11 @@ public class StorageOptions
|
||||
} catch (FileNotFoundException fnfex)
|
||||
{
|
||||
// if proc/mount doesn't exist we just use
|
||||
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||
mMounts.add(defaultMountPoint);
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||
Log.e(TAG, e.getMessage() + ": unknown exception while reading mounts file");
|
||||
mMounts.add(defaultMountPoint);
|
||||
}
|
||||
}
|
||||
@@ -111,11 +112,11 @@ public class StorageOptions
|
||||
} catch (FileNotFoundException fnfex)
|
||||
{
|
||||
// if proc/mount doesn't exist we just use
|
||||
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||
mMounts.add(defaultMountPoint);
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||
Log.e(TAG, e.getMessage() + ": unknown exception while reading mounts file");
|
||||
mMounts.add(defaultMountPoint);
|
||||
}
|
||||
}
|
||||
@@ -144,11 +145,11 @@ public class StorageOptions
|
||||
} catch (FileNotFoundException fnfex)
|
||||
{
|
||||
// if vold.fstab doesn't exist we use the value gathered from the Environment
|
||||
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||
mMounts.add(defaultMountPoint);
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||
Log.e(TAG, e.getMessage() + ": unknown exception while reading vold.fstab file");
|
||||
mMounts.add(defaultMountPoint);
|
||||
}
|
||||
}
|
||||
@@ -174,15 +175,18 @@ public class StorageOptions
|
||||
{
|
||||
/*
|
||||
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
|
||||
*
|
||||
*
|
||||
* Compare the two lists together and remove items that are not in both lists.
|
||||
*/
|
||||
|
||||
for (int i = 0; i < mMounts.size(); i++)
|
||||
if (mVold.size() > 0)
|
||||
{
|
||||
String mount = mMounts.get(i);
|
||||
if (!mVold.contains(mount))
|
||||
mMounts.remove(i--);
|
||||
for (int i = 0; i < mMounts.size(); i++)
|
||||
{
|
||||
String mount = mMounts.get(i);
|
||||
if (!mVold.contains(mount))
|
||||
mMounts.remove(i--);
|
||||
}
|
||||
}
|
||||
|
||||
// don't need this anymore, clear the vold list to reduce memory
|
||||
@@ -204,9 +208,10 @@ public class StorageOptions
|
||||
if (!root.exists() || !root.isDirectory() || !root.canWrite())
|
||||
mMounts.remove(i--);
|
||||
}
|
||||
|
||||
|
||||
if (t == 0 && Build.VERSION.SDK_INT >= 16 && findForcemount())
|
||||
{//if none is found lets force it for Jellybean and above...
|
||||
{
|
||||
//if none is found lets force it for Jellybean and above...
|
||||
if (System.getenv("EXTERNAL_STORAGE") != null)
|
||||
{
|
||||
File root = new File(System.getenv("EXTERNAL_STORAGE"));
|
||||
@@ -224,7 +229,7 @@ public class StorageOptions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (System.getenv("SECONDARY_STORAGE") != null)
|
||||
{
|
||||
File root = new File(System.getenv("SECONDARY_STORAGE"));
|
||||
@@ -247,6 +252,7 @@ public class StorageOptions
|
||||
|
||||
private static void setProperties()
|
||||
{
|
||||
Log.d(TAG, "setProperties()");
|
||||
/*
|
||||
* At this point all the paths in the list should be valid. Build the public properties.
|
||||
*/
|
||||
@@ -268,7 +274,8 @@ public class StorageOptions
|
||||
else
|
||||
{
|
||||
for (String path : mMounts)
|
||||
{ // TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
||||
{
|
||||
// TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
||||
if ("/mnt/sdcard".equalsIgnoreCase(path))
|
||||
mLabels.add("Built-in Storage");
|
||||
else
|
||||
@@ -310,84 +317,97 @@ public class StorageOptions
|
||||
*
|
||||
* @return <code>true</code> if the device is rooted, <code>false</code> otherwise.
|
||||
*/
|
||||
public static boolean isRooted() {
|
||||
|
||||
// get from build info
|
||||
String buildTags = android.os.Build.TAGS;
|
||||
if (buildTags != null && buildTags.contains("test-keys")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if /system/app/Superuser.apk is present
|
||||
try {
|
||||
File file = new File("/system/app/Superuser.apk");
|
||||
if (file.exists()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
File file = new File("/system/app/Superuser/Superuser.apk");
|
||||
if (file.exists()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1) {
|
||||
// ignore
|
||||
}
|
||||
//SuperSU
|
||||
try {
|
||||
File file = new File("/system/app/SuperSU.apk");
|
||||
if (file.exists()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
File file = new File("/system/app/SuperSU/SuperSU.apk");
|
||||
if (file.exists()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1) {
|
||||
// ignore
|
||||
}
|
||||
// try executing commands
|
||||
return canExecuteCommand("/system/xbin/which su")
|
||||
|| canExecuteCommand("/system/bin/which su") || canExecuteCommand("which su");
|
||||
}
|
||||
|
||||
// executes a command on the system
|
||||
private static boolean canExecuteCommand(String command) {
|
||||
boolean executedSuccesfully;
|
||||
try {
|
||||
Runtime.getRuntime().exec(command);
|
||||
executedSuccesfully = true;
|
||||
}
|
||||
catch (Exception e) {
|
||||
executedSuccesfully = false;
|
||||
}
|
||||
|
||||
return executedSuccesfully;
|
||||
}
|
||||
|
||||
private static boolean findForcemount(){
|
||||
try
|
||||
public static boolean isRooted()
|
||||
{
|
||||
File file = new File(System.getenv("EXTERNAL_STORAGE")+"/forcemount");
|
||||
if (file.exists())
|
||||
// get from build info
|
||||
String buildTags = android.os.Build.TAGS;
|
||||
if (buildTags != null && buildTags.contains("test-keys"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e1)
|
||||
|
||||
// check if /system/app/Superuser.apk is present
|
||||
try
|
||||
{
|
||||
File file = new File("/system/app/Superuser.apk");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e1)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
try
|
||||
{
|
||||
File file = new File("/system/app/Superuser/Superuser.apk");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e1)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
//SuperSU
|
||||
try
|
||||
{
|
||||
File file = new File("/system/app/SuperSU.apk");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e1)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
try
|
||||
{
|
||||
File file = new File("/system/app/SuperSU/SuperSU.apk");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e1)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
// try executing commands
|
||||
return canExecuteCommand("/system/xbin/which su")
|
||||
|| canExecuteCommand("/system/bin/which su") || canExecuteCommand("which su");
|
||||
}
|
||||
|
||||
// executes a command on the system
|
||||
private static boolean canExecuteCommand(String command)
|
||||
{
|
||||
boolean executedSuccesfully;
|
||||
try
|
||||
{
|
||||
Runtime.getRuntime().exec(command);
|
||||
executedSuccesfully = true;
|
||||
} catch (Exception e)
|
||||
{
|
||||
executedSuccesfully = false;
|
||||
}
|
||||
|
||||
return executedSuccesfully;
|
||||
}
|
||||
|
||||
private static boolean findForcemount()
|
||||
{
|
||||
Log.d(TAG, "findForcemount()");
|
||||
try
|
||||
{
|
||||
File file = new File(System.getenv("EXTERNAL_STORAGE") + "/forcemount");
|
||||
if (file.exists())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.w(TAG, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.egl.EGLContext;
|
||||
@@ -68,12 +66,11 @@ import android.widget.FrameLayout.LayoutParams;
|
||||
*/
|
||||
public class SDLActivity extends Activity implements OnKeyListener
|
||||
{
|
||||
private static final String TAG = SDLActivity.class.getCanonicalName();
|
||||
|
||||
//import deck globals
|
||||
public ArrayList<String> myresult = new ArrayList<String>();
|
||||
public String myclickedItem = "";
|
||||
|
||||
// TAG used for debugging in DDMS
|
||||
public static String TAG = Activity.class.getCanonicalName();
|
||||
public ArrayList<String> myresult = new ArrayList<String>();
|
||||
public String myclickedItem = "";
|
||||
|
||||
// Main components
|
||||
private static SDLActivity mSingleton;
|
||||
@@ -352,7 +349,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
updateStorageLocations();
|
||||
} catch (Exception ioex)
|
||||
{
|
||||
Log.e("SDL", "An error occurred in setting up the storage locations.");
|
||||
Log.e(TAG, "An error occurred in setting up the storage locations.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,14 +494,12 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
// Log.v("SDL", "onCreate()");
|
||||
//Log.d(TAG, "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// So we can call stuff from static callbacks
|
||||
mSingleton = this;
|
||||
mContext = this.getApplicationContext();
|
||||
// get the current version of the app to set the core filename
|
||||
String versionCodeString = getApplicationCode();
|
||||
RES_FILENAME = getResourceName();
|
||||
|
||||
StorageOptions.determineStorageOptions();
|
||||
@@ -532,7 +527,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
@Override
|
||||
protected void onPause()
|
||||
{
|
||||
// Log.v("SDL", "onPause()");
|
||||
// Log.d(TAG, "onPause()");
|
||||
super.onPause();
|
||||
SDLActivity.nativePause();
|
||||
}
|
||||
@@ -540,7 +535,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
@Override
|
||||
protected void onResume()
|
||||
{
|
||||
// Log.v("SDL", "onResume()");
|
||||
// Log.d(TAG, "onResume()");
|
||||
super.onResume();
|
||||
SDLActivity.nativeResume();
|
||||
}
|
||||
@@ -548,8 +543,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
// Log.v("SDL", "onDestroy()");
|
||||
|
||||
// Log.d(TAG, "onDestroy()");
|
||||
super.onDestroy();
|
||||
mSurface.onDestroy();
|
||||
}
|
||||
@@ -660,7 +654,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
||||
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
||||
|
||||
// Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||
// Log.d(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||
|
||||
// Let the user pick a larger buffer if they really want -- but ye
|
||||
// gods they probably shouldn't, the minimums are horrifyingly high
|
||||
@@ -671,7 +665,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
|
||||
audioStartThread();
|
||||
|
||||
// Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) +
|
||||
// Log.d(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) +
|
||||
// "kHz, " + desiredFrames + " frames buffer");
|
||||
|
||||
if (is16Bit)
|
||||
@@ -719,7 +713,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
}
|
||||
} else
|
||||
{
|
||||
Log.w("SDL", "SDL audio: error return from write(short)");
|
||||
Log.w(TAG, "SDL audio: error return from write(short)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -744,7 +738,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
}
|
||||
} else
|
||||
{
|
||||
Log.w("SDL", "SDL audio: error return from write(short)");
|
||||
Log.w(TAG, "SDL audio: error return from write(short)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -759,11 +753,11 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
mAudioThread.join();
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.v("SDL", "Problem stopping audio thread: " + e);
|
||||
Log.e(TAG, "Problem stopping audio thread: " + e);
|
||||
}
|
||||
mAudioThread = null;
|
||||
|
||||
// Log.v("SDL", "Finished waiting for audio thread");
|
||||
// Log.d(TAG, "Finished waiting for audio thread");
|
||||
}
|
||||
|
||||
if (mAudioTrack != null)
|
||||
@@ -775,7 +769,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
|
||||
class DownloadFileAsync extends AsyncTask<String, Integer, Long>
|
||||
{
|
||||
final String TAG1 = DownloadFileAsync.class.getCanonicalName();
|
||||
private final String TAG = DownloadFileAsync.class.getCanonicalName();
|
||||
|
||||
@Override
|
||||
protected void onPreExecute()
|
||||
@@ -794,7 +788,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
//
|
||||
// Prepare the sdcard folders in order to download the resource file
|
||||
//
|
||||
@@ -815,7 +808,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
conexion.connect();
|
||||
|
||||
int lengthOfFile = conexion.getContentLength();
|
||||
// Log.d("Wagic - " + TAG1, " Length of file: " + lengthOfFile);
|
||||
// Log.d(TAG, " Length of file: " + lengthOfFile);
|
||||
|
||||
input = new BufferedInputStream(url.openStream());
|
||||
// create a File object for the output file
|
||||
@@ -838,8 +831,8 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
{
|
||||
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(TAG1, errorMessage);
|
||||
Log.e(TAG1, e.getMessage());
|
||||
Log.e(TAG, errorMessage);
|
||||
Log.e(TAG, e.getMessage());
|
||||
}
|
||||
|
||||
return Long.valueOf(totalBytes);
|
||||
@@ -849,7 +842,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
{
|
||||
if (progress[0] != mProgressDialog.getProgress())
|
||||
{
|
||||
// Log.d("Wagic - " + TAG1, "current progress : " + progress[0]);
|
||||
// Log.d(TAG, "current progress : " + progress[0]);
|
||||
mProgressDialog.setProgress(progress[0]);
|
||||
}
|
||||
}
|
||||
@@ -922,6 +915,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
*/
|
||||
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener
|
||||
{
|
||||
private static final String TAG = SDLSurface.class.getCanonicalName();
|
||||
|
||||
// This is what SDL runs in. It invokes SDL_main(), eventually
|
||||
private Thread mSDLThread;
|
||||
@@ -961,7 +955,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
|
||||
SDLActivity.nativeQuit();
|
||||
|
||||
Log.v("SDL", "SDL thread terminated");
|
||||
Log.d(TAG, "SDL thread terminated");
|
||||
|
||||
// On exit, tear everything down for a fresh restart next time.
|
||||
System.exit(0);
|
||||
@@ -988,7 +982,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
// Called when we have a valid drawing surface
|
||||
public void surfaceCreated(SurfaceHolder holder)
|
||||
{
|
||||
Log.v("SDL", "surfaceCreated()");
|
||||
//Log.d(TAG, "surfaceCreated()");
|
||||
|
||||
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||
}
|
||||
@@ -1008,18 +1002,18 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
mSDLThread.join();
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.v("SDL", "Problem stopping thread: " + e);
|
||||
Log.e(TAG, "Problem stopping thread: " + e);
|
||||
}
|
||||
mSDLThread = null;
|
||||
|
||||
// Log.v("SDL", "Finished waiting for SDL thread");
|
||||
// Log.d(TAG, "Finished waiting for SDL thread");
|
||||
}
|
||||
}
|
||||
|
||||
// Called when we lose the surface
|
||||
public void surfaceDestroyed(SurfaceHolder holder)
|
||||
{
|
||||
Log.v("SDL", "surfaceDestroyed()");
|
||||
Log.d(TAG, "surfaceDestroyed()");
|
||||
synchronized (mSemSurface)
|
||||
{
|
||||
mSurfaceValid = false;
|
||||
@@ -1031,51 +1025,51 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
// Called when the surface is resized
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
|
||||
{
|
||||
Log.d("SDL", "surfaceChanged()");
|
||||
Log.d(TAG, "surfaceChanged()");
|
||||
|
||||
int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
|
||||
switch (format)
|
||||
{
|
||||
case PixelFormat.A_8:
|
||||
Log.d("SDL", "pixel format A_8");
|
||||
Log.d("TAG", "pixel format A_8");
|
||||
break;
|
||||
case PixelFormat.LA_88:
|
||||
Log.d("SDL", "pixel format LA_88");
|
||||
Log.d("TAG", "pixel format LA_88");
|
||||
break;
|
||||
case PixelFormat.L_8:
|
||||
Log.d("SDL", "pixel format L_8");
|
||||
Log.d("TAG", "pixel format L_8");
|
||||
break;
|
||||
case PixelFormat.RGBA_4444:
|
||||
Log.d("SDL", "pixel format RGBA_4444");
|
||||
Log.d("TAG", "pixel format RGBA_4444");
|
||||
sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
|
||||
break;
|
||||
case PixelFormat.RGBA_5551:
|
||||
Log.d("SDL", "pixel format RGBA_5551");
|
||||
Log.d(TAG, "pixel format RGBA_5551");
|
||||
sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
|
||||
break;
|
||||
case PixelFormat.RGBA_8888:
|
||||
Log.d("SDL", "pixel format RGBA_8888");
|
||||
Log.d(TAG, "pixel format RGBA_8888");
|
||||
sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
|
||||
break;
|
||||
case PixelFormat.RGBX_8888:
|
||||
Log.d("SDL", "pixel format RGBX_8888");
|
||||
Log.d(TAG, "pixel format RGBX_8888");
|
||||
sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
|
||||
break;
|
||||
case PixelFormat.RGB_332:
|
||||
Log.d("SDL", "pixel format RGB_332");
|
||||
Log.d(TAG, "pixel format RGB_332");
|
||||
sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
|
||||
break;
|
||||
case PixelFormat.RGB_565:
|
||||
Log.d("SDL", "pixel format RGB_565");
|
||||
Log.d(TAG, "pixel format RGB_565");
|
||||
sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
|
||||
break;
|
||||
case PixelFormat.RGB_888:
|
||||
Log.d("SDL", "pixel format RGB_888");
|
||||
Log.d(TAG, "pixel format RGB_888");
|
||||
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
|
||||
sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
|
||||
break;
|
||||
default:
|
||||
Log.d("SDL", "pixel format unknown " + format);
|
||||
Log.d(TAG, "pixel format unknown " + format);
|
||||
break;
|
||||
}
|
||||
SDLActivity.onNativeResize(width, height, sdlFormat);
|
||||
@@ -1092,11 +1086,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
// EGL functions
|
||||
public boolean initEGL(int majorVersion, int minorVersion)
|
||||
{
|
||||
Log.d("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
|
||||
Log.d(TAG, "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||
|
||||
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
||||
@@ -1122,7 +1115,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
int[] num_config = new int[1];
|
||||
if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0)
|
||||
{
|
||||
Log.e("SDL", "No EGL config available");
|
||||
Log.e(TAG, "No EGL config available");
|
||||
return false;
|
||||
}
|
||||
mEGLConfig = configs[0];
|
||||
@@ -1130,7 +1123,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
EGLContext ctx = egl.eglCreateContext(dpy, mEGLConfig, EGL10.EGL_NO_CONTEXT, null);
|
||||
if (ctx == EGL10.EGL_NO_CONTEXT)
|
||||
{
|
||||
Log.e("SDL", "Couldn't create context");
|
||||
Log.e(TAG, "Couldn't create context");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1144,10 +1137,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.e("SDL", e + "");
|
||||
Log.e(TAG, e + "");
|
||||
for (StackTraceElement s : e.getStackTrace())
|
||||
{
|
||||
Log.e("SDL", s.toString());
|
||||
Log.e(TAG, s.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1162,7 +1155,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||
if (mEGLSurface != null)
|
||||
{
|
||||
|
||||
/*
|
||||
* Unbind and destroy the old EGL surface, if there is one.
|
||||
*/
|
||||
@@ -1176,7 +1168,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
mEGLSurface = egl.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, holder, null);
|
||||
if (mEGLSurface == EGL10.EGL_NO_SURFACE)
|
||||
{
|
||||
Log.e("SDL", "Couldn't create surface");
|
||||
Log.e(TAG, "Couldn't create surface");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1185,7 +1177,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
*/
|
||||
if (!egl.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext))
|
||||
{
|
||||
Log.e("SDL", "Couldn't make context current");
|
||||
Log.e(TAG, "Couldn't make context current");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1197,7 +1189,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
// EGL buffer flip
|
||||
public void flipEGL()
|
||||
{
|
||||
|
||||
if (!mSurfaceValid)
|
||||
{
|
||||
createSurface(this.getHolder());
|
||||
@@ -1207,7 +1198,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
{
|
||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||
|
||||
egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
|
||||
egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null);
|
||||
|
||||
// drawing here
|
||||
|
||||
@@ -1217,13 +1208,12 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.e("SDL", "flipEGL(): " + e);
|
||||
Log.e(TAG, "flipEGL(): " + e);
|
||||
for (StackTraceElement s : e.getStackTrace())
|
||||
{
|
||||
Log.e("SDL", s.toString());
|
||||
Log.e(TAG, s.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Key events
|
||||
@@ -1234,14 +1224,15 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
||||
return false;
|
||||
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
||||
{
|
||||
// Log.d("SDL", "key down: " + keyCode);
|
||||
// Log.d(TAG, "key down: " + keyCode);
|
||||
SDLActivity.onNativeKeyDown(keyCode);
|
||||
return true;
|
||||
} else if (event.getAction() == KeyEvent.ACTION_UP)
|
||||
{
|
||||
// Log.d("SDL", "key up: " + keyCode);
|
||||
// Log.d(TAG, "key up: " + keyCode);
|
||||
SDLActivity.onNativeKeyUp(keyCode);
|
||||
return true;
|
||||
}
|
||||
@@ -1252,7 +1243,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
||||
// Touch events
|
||||
public boolean onTouch(View v, MotionEvent event)
|
||||
{
|
||||
|
||||
for (int index = 0; index < event.getPointerCount(); ++index)
|
||||
{
|
||||
int action = event.getActionMasked();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#NAME:Etched Affinity
|
||||
#DESC:Modern URB Aggro
|
||||
#HINT:dontattackwith(creature[power<=0])
|
||||
#HINT:combo hold(Glimmervoid|myhand)^until(artifact|mybattlefield)^cast(Glimmervoid|myhand)^totalmananeeded({0})
|
||||
#HINT:combo hold(Glimmervoid|myhand)^cast(Glimmervoid|myhand)^restriction{type(land[fresh]|mybattlefield)~lessthan~1,type(artifact|mybattlefield)~morethan~0}^totalmananeeded({0})
|
||||
#HINT:combo hold(Galvanic Blast|myhand)^cast(Galvanic Blast|myhand)^restriction{type(artifact|mybattlefield)~morethan~2,turn:3}^totalmananeeded({R})
|
||||
|
||||
#25 creatures
|
||||
|
||||
@@ -786,11 +786,6 @@ id=3118
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Splinter Token
|
||||
id=-3148
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Splintering Wind
|
||||
id=3148
|
||||
rarity=R
|
||||
|
||||
@@ -291,11 +291,6 @@ id=401859
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dragon
|
||||
id=-401860
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dragonmaster Outcast
|
||||
id=401860
|
||||
rarity=M
|
||||
@@ -331,106 +326,11 @@ id=401866
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Elemental
|
||||
rarity=T
|
||||
id=-401806
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Elemental
|
||||
rarity=T
|
||||
id=-401973
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi
|
||||
rarity=T
|
||||
id=-401857
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Devastator
|
||||
id=401867
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401803
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401819
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401825
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401832
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401833
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401836
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401838
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401839
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401893
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-402092
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401900
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401863
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401868
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401875
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-401915
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
rarity=T
|
||||
id=-402046
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Skyspawner
|
||||
id=401868
|
||||
rarity=C
|
||||
@@ -756,21 +656,11 @@ id=401932
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Knight Ally
|
||||
rarity=T
|
||||
id=-401897
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kor Ally
|
||||
rarity=T
|
||||
id=-402007
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kor Ally
|
||||
rarity=T
|
||||
id=-402084
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kor Bladewhirl
|
||||
id=401933
|
||||
rarity=U
|
||||
@@ -971,11 +861,6 @@ id=401972
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Octopus
|
||||
rarity=T
|
||||
id=-401931
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Omnath, Locus of Rage
|
||||
id=401973
|
||||
rarity=M
|
||||
@@ -1091,11 +976,6 @@ id=401995
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plant
|
||||
rarity=T
|
||||
id=-401904
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plated Crusher
|
||||
id=401996
|
||||
rarity=U
|
||||
|
||||
@@ -1120,52 +1120,7 @@ id=414301
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=414513
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Horror
|
||||
id=414514
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human
|
||||
id=414515
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human
|
||||
id=414516
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
id=414517
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spider
|
||||
id=414518
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Insect
|
||||
id=414519
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Devil
|
||||
id=414520
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human Soldier
|
||||
id=414521
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wolf
|
||||
id=414522
|
||||
rarity=T
|
||||
[/card]
|
||||
|
||||
@@ -521,11 +521,6 @@ id=391883
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Monk Token
|
||||
id=-391883
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Monastery Siege
|
||||
id=391884
|
||||
rarity=R
|
||||
|
||||
@@ -1425,8 +1425,3 @@ primitive=Wreath of Geists
|
||||
id=237017
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie Token
|
||||
id=-229968
|
||||
rarity=T
|
||||
[/card]
|
||||
|
||||
@@ -625,11 +625,6 @@ id=370740
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Liliana's Reaver Zombie
|
||||
id=-370740
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Liturgy of Blood
|
||||
id=370652
|
||||
rarity=C
|
||||
@@ -1250,11 +1245,6 @@ id=370619
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Xathrid Necromancer Zombie
|
||||
id=-370619
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Young Pyromancer
|
||||
id=370600
|
||||
rarity=U
|
||||
|
||||
@@ -805,11 +805,6 @@ id=383323
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie Token
|
||||
id=-383323
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Negate
|
||||
id=383324
|
||||
rarity=C
|
||||
|
||||
@@ -31,11 +31,6 @@ id=407560
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Angel
|
||||
id=-407535
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ayli, Eternal Pilgrim
|
||||
id=407661
|
||||
rarity=R
|
||||
@@ -226,46 +221,6 @@ id=407606
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
id=-407522
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
id=-407587
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
id=-407635
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
id=-407550
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
id=-407633
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Scion
|
||||
id=-407631
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Elemental
|
||||
id=-407614
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Elemental
|
||||
id=-407653
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Elemental Uprising
|
||||
id=407640
|
||||
rarity=C
|
||||
@@ -436,21 +391,6 @@ id=407622
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Knight Ally
|
||||
id=-407525
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kor Ally
|
||||
id=-407540
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kor Ally
|
||||
id=-407672
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kor Scythemaster
|
||||
id=407533
|
||||
rarity=C
|
||||
@@ -616,11 +556,6 @@ id=407585
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Octopus
|
||||
id=-407563
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ondu War Cleric
|
||||
id=407541
|
||||
rarity=C
|
||||
@@ -631,11 +566,6 @@ id=407571
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plant
|
||||
id=-407648
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Press into Service
|
||||
id=407624
|
||||
rarity=U
|
||||
@@ -1001,21 +931,6 @@ id=407657
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-407594
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-407596
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-407598
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zulaport Chainmage
|
||||
id=407603
|
||||
rarity=C
|
||||
|
||||
@@ -56,11 +56,6 @@ id=193507
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Spawn
|
||||
rarity=T
|
||||
id=-193507
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bala Ged Scorpion
|
||||
id=194944
|
||||
rarity=C
|
||||
|
||||
@@ -41,16 +41,6 @@ id=409952
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Angel
|
||||
id=-409751
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Angel
|
||||
id=-410011
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Angel of Deliverance
|
||||
id=409738
|
||||
rarity=R
|
||||
@@ -221,131 +211,6 @@ id=409955
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409746
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409750
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409757
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409762
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409781
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409784
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409795
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409797
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409799
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409805
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409810
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409813
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409820
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409823
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409838
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409953
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409954
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409956
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409986
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-409997
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-410000
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-410004
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-410007
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-410024
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Clue
|
||||
rarity=T
|
||||
id=-410032
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Compelling Deterrence
|
||||
id=409794
|
||||
rarity=U
|
||||
@@ -441,21 +306,6 @@ id=409751
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Devil
|
||||
rarity=T
|
||||
id=-410068
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Devil
|
||||
rarity=T
|
||||
id=-409902
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Devil
|
||||
rarity=T
|
||||
id=-409903
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Devils' Playground
|
||||
id=409903
|
||||
rarity=R
|
||||
@@ -826,26 +676,6 @@ id=409919
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human Cleric
|
||||
id=-409760
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human Cleric
|
||||
id=-410049
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human Soldier
|
||||
id=-409780
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Human Soldier
|
||||
id=-410015
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Humble the Brute
|
||||
id=409762
|
||||
rarity=U
|
||||
@@ -886,11 +716,6 @@ id=409763
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Insect
|
||||
id=-409957
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Insidious Mist
|
||||
id=409856
|
||||
rarity=T
|
||||
@@ -1191,11 +1016,6 @@ id=409820
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ooze
|
||||
id=-409973
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Open the Armory
|
||||
id=409771
|
||||
rarity=U
|
||||
@@ -1496,41 +1316,6 @@ id=409778
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
id=-409749
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
id=-410031
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
rarity=T
|
||||
id=-409753
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
rarity=T
|
||||
id=-409768
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
rarity=T
|
||||
id=-409769
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
rarity=T
|
||||
id=-409789
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirit
|
||||
rarity=T
|
||||
id=-409755
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spiteful Motives
|
||||
id=409939
|
||||
rarity=U
|
||||
@@ -1761,16 +1546,6 @@ id=409788
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Vampire Knight
|
||||
id=-409850
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Vampire Knight
|
||||
id=-410016
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Vampire Noble
|
||||
id=409893
|
||||
rarity=C
|
||||
@@ -1871,21 +1646,6 @@ id=410037
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wolf
|
||||
id=-409959
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wolf
|
||||
id=-409983
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wolf
|
||||
id=-409991
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wolf of Devil's Breach
|
||||
id=409949
|
||||
rarity=M
|
||||
@@ -1895,38 +1655,3 @@ primitive=Woodland Stream
|
||||
id=410051
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409800
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409826
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409854
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409859
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409860
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409862
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Zombie
|
||||
id=-409884
|
||||
rarity=T
|
||||
[/card]
|
||||
|
||||
@@ -76,21 +76,6 @@ id=401693
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Spawn
|
||||
id=401718
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Spawn
|
||||
id=401719
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Spawn
|
||||
id=401720
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eldrazi Temple
|
||||
id=401710
|
||||
rarity=U
|
||||
|
||||
@@ -96,6 +96,19 @@ auto=counter(1/1,X)
|
||||
auto={3}:counter(1/1)
|
||||
#Not all player can use ability
|
||||
[/card]
|
||||
#need doubler damage ability...
|
||||
[card]
|
||||
name=Goldnight Castigator
|
||||
abilities=flying,haste
|
||||
auto=@damaged(controller):damage:thatmuch controller
|
||||
auto=@damaged(this):damage:thatmuch all(this)
|
||||
text=Flying, haste -- If a source would deal damage to you, it deals double that damage to you instead. -- If a source would deal damage to Goldnight Castigator, it deals double that damage to Goldnight Castigator instead.
|
||||
mana={2}{R}{R}
|
||||
type=Creature
|
||||
subtype=Angel
|
||||
power=4
|
||||
toughness=9
|
||||
[/card]
|
||||
[card]
|
||||
name=Govern the Guildless
|
||||
target=creature[-multicolor]
|
||||
@@ -235,6 +248,18 @@ type=Sorcery
|
||||
text=Draw cards equal to the number of cards in target opponent's hand. Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)
|
||||
[/card]
|
||||
[card]
|
||||
name=Relentless Dead
|
||||
auto=@movedTo(this|graveyard) from(battlefield):transforms((,newability[{B}:moveto(myhand)])) ueot
|
||||
auto=@movedTo(this|graveyard) from(battlefield):transforms((,newability[{X}:moveto(myhand) target(zombie[manacost=X]|mygraveyard)])) ueot
|
||||
text=Menace (This creature can't be blocked except by two or more creatures.) -- When Relentless Dead dies, you may pay {B}. If you do, return it to its owner's hand. -- When Relentless Dead dies, you may pay {X}. If you do, return another target Zombie creature card with converted mana cost X from your graveyard to the battlefield.
|
||||
mana={B}{B}
|
||||
abilities=menace
|
||||
type=Creature
|
||||
subtype=Zombie
|
||||
power=2
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Sacellum Godspeaker
|
||||
auto={T}:foreach(creaure[power>4]|myhand) add{G}
|
||||
text={T}: Reveal any number of creature cards with power 5 or greater from your hand. Add {G} to your mana pool for each card revealed this way.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -551,6 +551,18 @@ private:
|
||||
intValue +=1;
|
||||
}
|
||||
}
|
||||
else if (s == "countallspell")
|
||||
{
|
||||
intValue = card->controller()->game->stack->seenThisTurn("*", Constants::CAST_ALL) + card->controller()->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL);
|
||||
}
|
||||
else if (s == "countmycrespell")
|
||||
{
|
||||
intValue = card->controller()->game->stack->seenThisTurn("creature", Constants::CAST_ALL);
|
||||
}
|
||||
else if (s == "countmynoncrespell")
|
||||
{
|
||||
intValue = card->controller()->game->stack->seenThisTurn("*[-creature]", Constants::CAST_ALL);
|
||||
}
|
||||
else if (s == "evictg")
|
||||
{
|
||||
intValue = card->imprintG;
|
||||
@@ -678,6 +690,14 @@ private:
|
||||
{
|
||||
intValue = target->controller()->opponent()->damageCount;
|
||||
}
|
||||
else if (s == "pdnoncount")
|
||||
{
|
||||
intValue = target->controller()->nonCombatDamage;
|
||||
}
|
||||
else if (s == "odnoncount")
|
||||
{
|
||||
intValue = target->controller()->opponent()->nonCombatDamage;
|
||||
}
|
||||
else if (s == "playerpoisoncount")
|
||||
{
|
||||
intValue = target->controller()->poisonCount;
|
||||
@@ -883,19 +903,29 @@ private:
|
||||
}
|
||||
else if (s == "gravecardtypes")//Tarmogoyf
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
intValue = 0;
|
||||
int pc = 0, tc = 0, sc = 0, lc = 0, ic = 0, ec = 0, cc = 0, ac = 0;
|
||||
for (int j = 0; j < 2; j++)
|
||||
{
|
||||
MTGGameZone * checkZone = card->getObserver()->players[i]->game->graveyard;
|
||||
intValue =
|
||||
cardHasTypeinZone("planeswalker",checkZone) +
|
||||
cardHasTypeinZone("tribal",checkZone) +
|
||||
cardHasTypeinZone("sorcery",checkZone) +
|
||||
cardHasTypeinZone("land",checkZone) +
|
||||
cardHasTypeinZone("instant",checkZone) +
|
||||
cardHasTypeinZone("enchantment",checkZone) +
|
||||
cardHasTypeinZone("creature",checkZone) +
|
||||
cardHasTypeinZone("artifact",checkZone);
|
||||
MTGGameZone * checkZone = card->getObserver()->players[j]->game->graveyard;
|
||||
if(cardHasTypeinZone("planeswalker",checkZone))
|
||||
pc = 1;
|
||||
if(cardHasTypeinZone("tribal",checkZone))
|
||||
tc = 1;
|
||||
if(cardHasTypeinZone("sorcery",checkZone))
|
||||
sc = 1;
|
||||
if(cardHasTypeinZone("land",checkZone))
|
||||
lc = 1;
|
||||
if(cardHasTypeinZone("instant",checkZone))
|
||||
ic = 1;
|
||||
if(cardHasTypeinZone("enchantment",checkZone))
|
||||
ec = 1;
|
||||
if(cardHasTypeinZone("creature",checkZone))
|
||||
cc = 1;
|
||||
if(cardHasTypeinZone("artifact",checkZone))
|
||||
ac = 1;
|
||||
}
|
||||
intValue = pc+tc+sc+lc+ic+ec+cc+ac;
|
||||
}
|
||||
else if (s == "powertotalinplay")//Count Total Power of Creatures you control... Formidable
|
||||
{
|
||||
@@ -1113,10 +1143,13 @@ public:
|
||||
TargetChooser * toTcCard, *fromTcCard;
|
||||
bool sourceUntapped;
|
||||
bool isSuspended;
|
||||
bool limitOnceATurn;
|
||||
int triggeredTurn;
|
||||
TrCardAddedToZone(GameObserver* observer, int id, MTGCardInstance * source, TargetZoneChooser * toTcZone, TargetChooser * toTcCard,
|
||||
TargetZoneChooser * fromTcZone = NULL, TargetChooser * fromTcCard = NULL,bool once = false,bool sourceUntapped = false,bool isSuspended = false) :
|
||||
Trigger(observer, id, source, once), toTcZone(toTcZone), fromTcZone(fromTcZone), toTcCard(toTcCard), fromTcCard(fromTcCard),sourceUntapped(sourceUntapped),isSuspended(isSuspended)
|
||||
TargetZoneChooser * fromTcZone = NULL, TargetChooser * fromTcCard = NULL,bool once = false,bool sourceUntapped = false,bool isSuspended = false, bool limitOnceATurn = false) :
|
||||
Trigger(observer, id, source, once), toTcZone(toTcZone), fromTcZone(fromTcZone), toTcCard(toTcCard), fromTcCard(fromTcCard),sourceUntapped(sourceUntapped),isSuspended(isSuspended),limitOnceATurn(limitOnceATurn)
|
||||
{
|
||||
triggeredTurn = -1;
|
||||
};
|
||||
|
||||
|
||||
@@ -1126,6 +1159,8 @@ public:
|
||||
if (!e) return 0;
|
||||
if(sourceUntapped && source->isTapped() == 1)
|
||||
return 0;
|
||||
if (limitOnceATurn && triggeredTurn == game->turn)
|
||||
return 0;
|
||||
if(isSuspended && !source->suspended)
|
||||
return 0;
|
||||
if (!toTcZone->targetsZone(e->to)) return 0;
|
||||
@@ -1140,7 +1175,7 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
triggeredTurn = game->turn;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1210,6 +1245,28 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class TrCardTransformed: public Trigger
|
||||
{
|
||||
public:
|
||||
TrCardTransformed(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false) :
|
||||
Trigger(observer, id, source, once, tc)
|
||||
{
|
||||
}
|
||||
|
||||
int triggerOnEventImpl(WEvent * event)
|
||||
{
|
||||
WEventCardTransforms * e = dynamic_cast<WEventCardTransforms *> (event);
|
||||
if (!e) return 0;
|
||||
if (!tc->canTarget(e->card)) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
TrCardTransformed * clone() const
|
||||
{
|
||||
return NEW TrCardTransformed(*this);
|
||||
}
|
||||
};
|
||||
|
||||
class TrCombatTrigger: public Trigger
|
||||
{
|
||||
public:
|
||||
@@ -1891,6 +1948,7 @@ public:
|
||||
class AACopier: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
MTGAbility * andAbility;
|
||||
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
||||
int resolve();
|
||||
const string getMenuText();
|
||||
@@ -2211,7 +2269,12 @@ public:
|
||||
|
||||
assert(modifier < 2);
|
||||
((MTGCardInstance *) target)->basicAbilities.set(ability, modifier > 0);
|
||||
|
||||
//---add or subtract so we can keep track - for future use
|
||||
((MTGCardInstance *) target)->modbasicAbilities[ability] += modifier;
|
||||
//---make sure no negative values
|
||||
if(((MTGCardInstance *) target)->modbasicAbilities[ability] < 0)
|
||||
((MTGCardInstance *) target)->modbasicAbilities[ability] = 0;
|
||||
//---end add or subtract abilities
|
||||
return MTGAbility::addToGame();
|
||||
}
|
||||
|
||||
@@ -2262,7 +2325,7 @@ public:
|
||||
|
||||
assert(value < 2);
|
||||
_target->basicAbilities.set(ability, value > 0);
|
||||
_target->modifiedbAbi += 1;
|
||||
|
||||
return InstantAbility::addToGame();
|
||||
}
|
||||
|
||||
@@ -2275,10 +2338,7 @@ public:
|
||||
{
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
if (_target)
|
||||
{
|
||||
_target->basicAbilities.set(ability, stateBeforeActivation);
|
||||
_target->modifiedbAbi -= 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3522,7 +3582,9 @@ public:
|
||||
bool battleReady;
|
||||
MTGCardInstance * myToken;
|
||||
vector<MTGAbility *> currentAbilities;
|
||||
MTGAbility * andAbility;
|
||||
Player * tokenReciever;
|
||||
string cID;
|
||||
//by id
|
||||
ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, int tokenId,string starfound, WParsedInt * multiplier = NULL,
|
||||
int who = 0,bool aLivingWeapon = false) :
|
||||
@@ -3532,6 +3594,8 @@ public:
|
||||
MTGCard * card = MTGCollection()->getCardById(tokenId);
|
||||
if (card) name = card->data->getName();
|
||||
battleReady = false;
|
||||
andAbility = NULL;
|
||||
cID = "";
|
||||
}
|
||||
//by name, card still require valid card.dat info, this just makes the primitive code far more readable. token(Eldrazi scion) instead of token(-1234234)...
|
||||
ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, string cardName, string starfound, WParsedInt * multiplier = NULL,
|
||||
@@ -3543,10 +3607,12 @@ public:
|
||||
tokenId = card->getId();
|
||||
if (card) name = card->data->getName();
|
||||
battleReady = false;
|
||||
andAbility = NULL;
|
||||
cID = "";
|
||||
}
|
||||
//by construction
|
||||
ATokenCreator(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable *, ManaCost * _cost, string sname, string stypes, int _power, int _toughness,
|
||||
string sabilities, string starfound,WParsedInt * multiplier = NULL, int _who = 0,bool aLivingWeapon = false,string spt = "") :
|
||||
string sabilities, string starfound,WParsedInt * multiplier = NULL, int _who = 0,bool aLivingWeapon = false,string spt = "", string tnum = "") :
|
||||
ActivatedAbility(observer, _id, _source, _cost, 0),sabilities(sabilities),starfound(starfound), multiplier(multiplier), who(_who),aLivingWeapon(aLivingWeapon),spt(spt)
|
||||
{
|
||||
power = _power;
|
||||
@@ -3555,6 +3621,8 @@ public:
|
||||
tokenId = 0;
|
||||
aType = MTGAbility::STANDARD_TOKENCREATOR;
|
||||
battleReady = false;
|
||||
andAbility = NULL;
|
||||
cID = tnum;
|
||||
if (!multiplier) this->multiplier = NEW WParsedInt(1);
|
||||
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
|
||||
|
||||
@@ -3641,6 +3709,16 @@ public:
|
||||
else
|
||||
{
|
||||
myToken = NEW Token(name, source, power, toughness);
|
||||
if(!cID.empty())
|
||||
{
|
||||
string customId = "";
|
||||
ostringstream tokID;
|
||||
tokID << abs(myToken->getId());
|
||||
customId.append(""+tokID.str()+cID);
|
||||
customId = cReplaceString(customId," ","");
|
||||
WParsedInt newID(customId, NULL, source);
|
||||
myToken->setMTGId(-newID.getValue());
|
||||
}
|
||||
list<int>::iterator it;
|
||||
for (it = types.begin(); it != types.end(); it++)
|
||||
{
|
||||
@@ -3683,6 +3761,23 @@ public:
|
||||
{
|
||||
battleReadyToken(spell->source);
|
||||
}
|
||||
//andability
|
||||
if(andAbility)
|
||||
{
|
||||
//backup andAbility for copier and cloner
|
||||
spell->source->TokenAndAbility = andAbility->clone();
|
||||
MTGAbility * andAbilityClone = andAbility->clone();
|
||||
andAbilityClone->target = spell->source;
|
||||
if(andAbility->oneShot)
|
||||
{
|
||||
andAbilityClone->resolve();
|
||||
SAFE_DELETE(andAbilityClone);
|
||||
}
|
||||
else
|
||||
{
|
||||
andAbilityClone->addToGame();
|
||||
}
|
||||
}
|
||||
delete spell;
|
||||
}
|
||||
return 1;
|
||||
@@ -4499,7 +4594,8 @@ public:
|
||||
vector<MTGAbility *> currentAbilities;
|
||||
string flipStats;
|
||||
bool isflipcard;
|
||||
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard = false);
|
||||
bool forcedcopy;
|
||||
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard = false, bool forcedcopy = false);
|
||||
int resolve();
|
||||
int testDestroy();
|
||||
const string getMenuText();
|
||||
|
||||
@@ -33,10 +33,10 @@ protected:
|
||||
/*
|
||||
** Tries to render the Big version of a card picture, backups to text version in case of failure
|
||||
*/
|
||||
static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false, bool smallerscale = false);
|
||||
static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false, bool smallerscale = false, bool ingame = false);
|
||||
|
||||
static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal);
|
||||
static void AlternateRender(MTGCard * card, const Pos& pos);
|
||||
static void AlternateRender(MTGCard * card, const Pos& pos, bool noborder = false, bool smallerscale = false);
|
||||
static void TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad);
|
||||
static string FormattedData (string data, string replace, string value);
|
||||
static bool FilterCard (MTGCard * card,string filter);
|
||||
@@ -54,9 +54,9 @@ public:
|
||||
CardGui(MTGCardInstance* card, const Pos& ref);
|
||||
virtual void Render();
|
||||
virtual void Update(float dt);
|
||||
|
||||
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false);
|
||||
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false);
|
||||
bool isBlackBorder(string set);
|
||||
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false, bool ingame = false);
|
||||
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool smallscale = false, bool ingame = false);
|
||||
static void DrawBorder(string setname, const Pos& inPosition, float x, bool noborder = false, bool smallscale = false);
|
||||
static JQuadPtr AlternateThumbQuad(MTGCard * card);
|
||||
virtual ostream& toString(ostream&) const;
|
||||
|
||||
@@ -57,8 +57,8 @@ public:
|
||||
|
||||
uint8_t colors;
|
||||
typedef std::bitset<Constants::NB_BASIC_ABILITIES> BasicAbilitiesSet;
|
||||
vector<int> modbasicAbilities;
|
||||
BasicAbilitiesSet basicAbilities;
|
||||
BasicAbilitiesSet origbasicAbilities;
|
||||
BasicAbilitiesSet LKIbasicAbilities;
|
||||
|
||||
map<string,string> magicTexts;
|
||||
@@ -115,6 +115,8 @@ public:
|
||||
bool isCreature();
|
||||
bool isLand();
|
||||
bool isSpell();
|
||||
bool isPermanent();
|
||||
bool isSorceryorInstant();
|
||||
int dredge();
|
||||
void setPower(int _power);
|
||||
int getPower();
|
||||
|
||||
@@ -24,6 +24,7 @@ public:
|
||||
int handsize;
|
||||
int poisonCount;
|
||||
int damageCount;
|
||||
int nonCombatDamage;
|
||||
int preventable;
|
||||
int thatmuch;
|
||||
int lifeLostThisTurn;
|
||||
|
||||
@@ -25,8 +25,8 @@ struct GuiAvatar: public GuiStatic
|
||||
BOTTOM_RIGHT
|
||||
} Corner;
|
||||
|
||||
static const unsigned Width = 35;
|
||||
static const unsigned Height = 50;
|
||||
static const unsigned Width = 32;//35
|
||||
static const unsigned Height = 45;//50
|
||||
|
||||
protected:
|
||||
int avatarRed;
|
||||
|
||||
@@ -121,6 +121,7 @@ public:
|
||||
MTGGameZone * previousZone;
|
||||
MTGCardInstance * previous;
|
||||
MTGCardInstance * next;
|
||||
MTGAbility * TokenAndAbility;
|
||||
int doDamageTest;
|
||||
bool skipDamageTestOnce;
|
||||
int summoningSickness;
|
||||
@@ -256,7 +257,6 @@ public:
|
||||
bool bypassTC;
|
||||
bool discarded;
|
||||
int copiedID;
|
||||
int modifiedbAbi;
|
||||
bool StackIsEmptyandSorcerySpeed();
|
||||
bool isTargetted();
|
||||
int cardistargetted;
|
||||
|
||||
@@ -257,7 +257,9 @@ class Constants
|
||||
FLYERSONLY = 135,//can attack only if it has flying
|
||||
TEMPFLASHBACK = 136,
|
||||
NOLEGENDRULE =137,
|
||||
NB_BASIC_ABILITIES = 138,
|
||||
CANTTRANSFORM =138,
|
||||
ASFLASH =139,
|
||||
NB_BASIC_ABILITIES = 140,
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
RARITY_M = 'M', //Mythics
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
ManaCost(const ManaCost& manaCost);
|
||||
ManaCost& operator= (const ManaCost& manaCost);
|
||||
void copy(ManaCost * _manaCost);
|
||||
void changeCostTo(ManaCost * _manaCost);
|
||||
int isNull();
|
||||
int getConvertedCost();
|
||||
string toString();
|
||||
|
||||
@@ -301,6 +301,12 @@ struct WEventCardControllerChange : public WEventCardUpdate {
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card transforms
|
||||
struct WEventCardTransforms : public WEventCardUpdate {
|
||||
WEventCardTransforms(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream&, const WEvent&);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
}
|
||||
};
|
||||
virtual JQuadPtr RetrieveCard(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL) = 0;
|
||||
virtual JQuadPtr RetrieveCardToken(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL, int tId = 0) = 0;
|
||||
virtual JSample * RetrieveSample(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL) = 0;
|
||||
virtual JTexture * RetrieveTexture(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL) = 0;
|
||||
virtual JQuadPtr RetrieveQuad(const string& filename, float offX=0.0f, float offY=0.0f, float width=0.0f, float height=0.0f, string resname="", int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL, int id = 0) = 0;
|
||||
|
||||
@@ -141,6 +141,7 @@ public:
|
||||
bool IsThreaded();
|
||||
|
||||
JQuadPtr RetrieveCard(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL);
|
||||
JQuadPtr RetrieveCardToken(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL, int tId = 0);
|
||||
JSample * RetrieveSample(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL);
|
||||
JTexture * RetrieveTexture(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL);
|
||||
JQuadPtr RetrieveQuad(const string& filename, float offX=0.0f, float offY=0.0f, float width=0.0f, float height=0.0f, string resname="", int style = RETRIEVE_LOCK, int submode = CACHE_NORMAL, int id = 0);
|
||||
|
||||
@@ -132,7 +132,8 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string
|
||||
{
|
||||
Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 0.80f, 0.0, 220);
|
||||
pos.actY = 142;//adjust y a little bit
|
||||
CardGui::DrawCard(source, pos, observer->getCardSelector()->GetDrawMode());
|
||||
bool ingame = observer?true:false;
|
||||
CardGui::DrawCard(source, pos, observer->getCardSelector()->GetDrawMode(),false,false,false,ingame);
|
||||
}
|
||||
|
||||
if (targetQuad)
|
||||
|
||||
@@ -1453,6 +1453,7 @@ AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, M
|
||||
ActivatedAbility(observer, _id, _source, _cost, 0)
|
||||
{
|
||||
target = _target;
|
||||
andAbility = NULL;
|
||||
}
|
||||
|
||||
int AACopier::resolve()
|
||||
@@ -1463,15 +1464,30 @@ int AACopier::resolve()
|
||||
{
|
||||
MTGCard* clone ;
|
||||
if(_target->isToken || (_target->isACopier && _target->hasCopiedToken))
|
||||
{
|
||||
{//fix crash when copying token
|
||||
clone = _target;
|
||||
tokencopied = true;
|
||||
}
|
||||
else
|
||||
clone = MTGCollection()->getCardById(_target->copiedID);
|
||||
MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game);
|
||||
source->copy(myClone);
|
||||
SAFE_DELETE(myClone);
|
||||
|
||||
if(tokencopied)
|
||||
{
|
||||
MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game);
|
||||
source->copy(myClone);
|
||||
SAFE_DELETE(myClone);
|
||||
}
|
||||
else
|
||||
{/*********************************************
|
||||
* instead of using source->copy(myClone) use *
|
||||
* AAFlip with forcedcopy to true *
|
||||
*********************************************/
|
||||
AAFlip * af = NEW AAFlip(game, game->mLayers->actionLayer()->getMaxId(), source, source, clone->data->name, false, true);
|
||||
af->oneShot = 1;
|
||||
af->canBeInterrupted = false;
|
||||
af->resolve();
|
||||
SAFE_DELETE(af);
|
||||
}
|
||||
source->isACopier = true;
|
||||
source->hasCopiedToken = tokencopied;
|
||||
source->copiedID = _target->copiedID;
|
||||
@@ -1488,6 +1504,34 @@ int AACopier::resolve()
|
||||
source->basicAbilities.reset();
|
||||
source->getManaCost()->resetCosts();
|
||||
}
|
||||
if(_target->TokenAndAbility)
|
||||
{//the source copied a token with andAbility
|
||||
MTGAbility * TokenandAbilityClone = _target->TokenAndAbility->clone();
|
||||
TokenandAbilityClone->target = source;
|
||||
if(_target->TokenAndAbility->oneShot)
|
||||
{
|
||||
TokenandAbilityClone->resolve();
|
||||
SAFE_DELETE(TokenandAbilityClone);
|
||||
}
|
||||
else
|
||||
{
|
||||
TokenandAbilityClone->addToGame();
|
||||
}
|
||||
}
|
||||
if(andAbility)
|
||||
{
|
||||
MTGAbility * andAbilityClone = andAbility->clone();
|
||||
andAbilityClone->target = source;
|
||||
if(andAbility->oneShot)
|
||||
{
|
||||
andAbilityClone->resolve();
|
||||
SAFE_DELETE(andAbilityClone);
|
||||
}
|
||||
else
|
||||
{
|
||||
andAbilityClone->addToGame();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -1609,6 +1653,11 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
|
||||
if (target)
|
||||
{
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
if(_target->isFlipped && _target->hasType(Subtypes::TYPE_PLANESWALKER))//is flipping pw
|
||||
{
|
||||
this->forceDestroy = 1;
|
||||
return 0;
|
||||
}
|
||||
AbilityFactory af(game);
|
||||
if(counterstring.size())
|
||||
{
|
||||
@@ -3155,8 +3204,8 @@ AAMeld * AAMeld::clone() const
|
||||
}
|
||||
|
||||
// flip a card
|
||||
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard) :
|
||||
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard)
|
||||
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy) :
|
||||
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy)
|
||||
{
|
||||
target = _target;
|
||||
}
|
||||
@@ -3179,7 +3228,7 @@ int AAFlip::resolve()
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
if (_target)
|
||||
{
|
||||
if((_target->isACopier||_target->isToken) && !isflipcard)
|
||||
if((_target->isACopier||_target->isToken||_target->has(Constants::CANTTRANSFORM)) && !isflipcard && !forcedcopy)
|
||||
{
|
||||
game->removeObserver(this);
|
||||
return 0;
|
||||
@@ -3196,6 +3245,9 @@ int AAFlip::resolve()
|
||||
MTGCard * fcard = MTGCollection()->getCardByName(flipStats);
|
||||
if(!fcard) return 0;
|
||||
MTGCardInstance * myFlip = NEW MTGCardInstance(fcard, _target->controller()->game);
|
||||
MTGCardInstance * myParent = NULL;
|
||||
if(_target->target)
|
||||
myParent = _target->target;
|
||||
_target->name = myFlip->name;
|
||||
_target->setName(myFlip->name);
|
||||
if(!isflipcard)//transform card
|
||||
@@ -3208,9 +3260,15 @@ int AAFlip::resolve()
|
||||
_target->types = myFlip->types;
|
||||
_target->text = myFlip->text;
|
||||
_target->formattedText = myFlip->formattedText;
|
||||
_target->basicAbilities = myFlip->basicAbilities;
|
||||
_target->basicAbilities = myFlip->model->data->basicAbilities;
|
||||
_target->modbasicAbilities = myFlip->modbasicAbilities;
|
||||
cdaDamage = _target->damageCount;
|
||||
_target->copiedID = myFlip->getMTGId();//for copier
|
||||
if(forcedcopy && _target->owner->playMode != Player::MODE_TEST_SUITE)
|
||||
{
|
||||
_target->setMTGId(myFlip->getMTGId());
|
||||
_target->setId = myFlip->setId;
|
||||
}
|
||||
for(unsigned int i = 0;i < _target->cardsAbilities.size();i++)
|
||||
{
|
||||
MTGAbility * a = dynamic_cast<MTGAbility *>(_target->cardsAbilities[i]);
|
||||
@@ -3278,8 +3336,18 @@ int AAFlip::resolve()
|
||||
{//pbonus & tbonus are already computed except damage taken...
|
||||
_target->life -= cdaDamage;
|
||||
}
|
||||
if(_target->hasSubtype(Subtypes::TYPE_EQUIPMENT))
|
||||
{
|
||||
if(myParent)
|
||||
_target->target = myParent;
|
||||
}
|
||||
SAFE_DELETE(myFlip);
|
||||
_target->mPropertiesChangedSinceLastUpdate = true;
|
||||
if(!isflipcard)
|
||||
{
|
||||
WEvent * e = NEW WEventCardTransforms(_target);
|
||||
game->receiveEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
currentAbilities.clear();
|
||||
@@ -3923,10 +3991,10 @@ int AACloner::resolve()
|
||||
}
|
||||
}
|
||||
list<int>::iterator it;
|
||||
for (it = awith.begin(); it != awith.end(); it++)
|
||||
/*for (it = awith.begin(); it != awith.end(); it++)
|
||||
{//there must be a layer of temporary abilities and original abilities
|
||||
spell->source->basicAbilities[*it] = 1;
|
||||
}
|
||||
}*/
|
||||
for (it = colors.begin(); it != colors.end(); it++)
|
||||
{
|
||||
spell->source->setColor(*it);
|
||||
@@ -3935,13 +4003,25 @@ int AACloner::resolve()
|
||||
{
|
||||
spell->source->addType(*it);
|
||||
}
|
||||
spell->source->modifiedbAbi = _target->modifiedbAbi;
|
||||
//spell->source->basicAbilities = _target->origbasicAbilities;
|
||||
for(int k = 0; k < Constants::NB_BASIC_ABILITIES; k++)
|
||||
{
|
||||
if(_target->model->data->basicAbilities[k])
|
||||
spell->source->basicAbilities[k] = _target->model->data->basicAbilities[k];
|
||||
}
|
||||
if(_target->TokenAndAbility)
|
||||
{//the source copied a token with andAbility
|
||||
MTGAbility * andAbilityClone = _target->TokenAndAbility->clone();
|
||||
andAbilityClone->target = spell->source;
|
||||
if(_target->TokenAndAbility->oneShot)
|
||||
{
|
||||
andAbilityClone->resolve();
|
||||
SAFE_DELETE(andAbilityClone);
|
||||
}
|
||||
else
|
||||
{
|
||||
andAbilityClone->addToGame();
|
||||
}
|
||||
}
|
||||
delete spell;
|
||||
}
|
||||
return 1;
|
||||
@@ -4112,8 +4192,11 @@ int AAMover::resolve()
|
||||
//inplay is a special zone !
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
if (!_target->hasSubtype(Subtypes::TYPE_AURA) && destZone == game->players[i]->game->inPlay && fromZone != game->players[i]->game->inPlay && fromZone
|
||||
!= game->players[i]->opponent()->game->inPlay)
|
||||
if (!_target->isSorceryorInstant() &&
|
||||
!_target->hasSubtype(Subtypes::TYPE_AURA) &&
|
||||
destZone == game->players[i]->game->inPlay &&
|
||||
fromZone != game->players[i]->game->inPlay &&
|
||||
fromZone != game->players[i]->opponent()->game->inPlay)
|
||||
{
|
||||
MTGCardInstance * copy = game->players[i]->game->putInZone(_target, fromZone, game->players[i]->game->temp);
|
||||
Spell * spell = NEW Spell(game, copy);
|
||||
@@ -4172,6 +4255,16 @@ int AAMover::resolve()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_target->isSorceryorInstant() && (destZone == game->players[0]->game->inPlay || destZone == game->players[1]->game->inPlay))
|
||||
{
|
||||
if(andAbility)
|
||||
{
|
||||
if(!dynamic_cast<AAFlip *>(andAbility))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
p->game->putInZone(_target, fromZone, destZone);
|
||||
while(_target->next)
|
||||
_target = _target->next;
|
||||
@@ -5634,7 +5727,6 @@ for (it = types.begin(); it != types.end(); it++)
|
||||
for (it = abilities.begin(); it != abilities.end(); it++)
|
||||
{
|
||||
_target->basicAbilities.set(*it);
|
||||
_target->modifiedbAbi += 1;
|
||||
}
|
||||
|
||||
if(newAbilityFound)
|
||||
@@ -5783,7 +5875,6 @@ int ATransformer::destroy()
|
||||
for (it = abilities.begin(); it != abilities.end(); it++)
|
||||
{
|
||||
_target->basicAbilities.reset(*it);
|
||||
_target->modifiedbAbi -= 1;
|
||||
}
|
||||
|
||||
for (it = oldcolors.begin(); it != oldcolors.end(); it++)
|
||||
@@ -7077,7 +7168,7 @@ void ABlink::resolveBlink()
|
||||
|
||||
void ABlink::returnCardIntoPlay(MTGCardInstance* _target) {
|
||||
MTGCardInstance * Blinker = NULL;
|
||||
if(!_target->blinked)
|
||||
if(!_target->blinked || _target->hasSubtype(Subtypes::TYPE_INSTANT) || _target->hasSubtype(Subtypes::TYPE_SORCERY))
|
||||
{
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
@@ -7640,12 +7731,24 @@ int AACastCard::resolveSpell()
|
||||
if (game->targetChooser)
|
||||
{
|
||||
game->targetChooser->Owner = source->controller();
|
||||
spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL, 1, 0);
|
||||
if(putinplay)
|
||||
{
|
||||
spell = NEW Spell(game, 0,copy,game->targetChooser,NULL, 1);
|
||||
spell->resolve();
|
||||
}
|
||||
else
|
||||
spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL, 1, 0);
|
||||
game->targetChooser = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
spell = game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, 1, 0);
|
||||
if(putinplay)
|
||||
{
|
||||
spell = NEW Spell(game, 0,copy,NULL,NULL, 1);
|
||||
spell->resolve();
|
||||
}
|
||||
else
|
||||
spell = game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, 1, 0);
|
||||
}
|
||||
|
||||
if (copy->has(Constants::STORM))
|
||||
|
||||
@@ -271,8 +271,8 @@ void CardDisplay::Render()
|
||||
if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2;
|
||||
drawMode = observer->getCardSelector()->GetDrawMode();
|
||||
}
|
||||
|
||||
cardg->DrawCard(pos, drawMode);
|
||||
bool ingame = observer?true:false;
|
||||
cardg->DrawCard(pos, drawMode, false, false, false,ingame);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,20 +111,20 @@ void CardGui::Update(float dt)
|
||||
PlayGuiObject::Update(dt);
|
||||
}
|
||||
|
||||
void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale)
|
||||
void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale, bool ingame)
|
||||
{
|
||||
DrawCard(card, inPosition, inMode, thumb, noborder, smallerscale);
|
||||
DrawCard(card, inPosition, inMode, thumb, noborder, smallerscale, ingame);
|
||||
}
|
||||
|
||||
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale)
|
||||
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder, bool smallerscale, bool ingame)
|
||||
{
|
||||
switch (inMode)
|
||||
{
|
||||
case DrawMode::kNormal:
|
||||
RenderBig(inCard, inPosition, thumb, noborder, smallerscale);
|
||||
RenderBig(inCard, inPosition, thumb, noborder, smallerscale, ingame);
|
||||
break;
|
||||
case DrawMode::kText:
|
||||
AlternateRender(inCard, inPosition);
|
||||
AlternateRender(inCard, inPosition, noborder, smallerscale);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -137,6 +137,10 @@ void CardGui::Render()
|
||||
WFont * mFont = game?game->getResourceManager()->GetWFont(Fonts::MAIN_FONT):WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
TargetChooser * tc = NULL;
|
||||
//fake border and mask...
|
||||
JQuadPtr fakeborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
|
||||
JQuadPtr highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
|
||||
JQuadPtr fakemask = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
|
||||
|
||||
if (game)
|
||||
tc = game->getCurrentTargetChooser();
|
||||
@@ -148,6 +152,11 @@ void CardGui::Render()
|
||||
MTGCard * fcard = MTGCollection()->getCardByName(card->name);
|
||||
quad = game->getResourceManager()->RetrieveCard(fcard, CACHE_THUMB);
|
||||
}
|
||||
if (card->hasCopiedToken && !quad.get())
|
||||
{
|
||||
MTGCard * tcard = MTGCollection()->getCardById(abs(card->copiedID));
|
||||
quad = game->getResourceManager()->RetrieveCardToken(tcard, CACHE_THUMB, 1, abs(card->copiedID));
|
||||
}
|
||||
if (quad.get())
|
||||
alternate = false;
|
||||
else
|
||||
@@ -247,18 +256,15 @@ void CardGui::Render()
|
||||
if (quad)
|
||||
{
|
||||
quad->SetColor(ARGB(static_cast<unsigned char>(actA),255,255,255));
|
||||
//fake border...
|
||||
JQuadPtr fakeborder;
|
||||
JQuadPtr highlightborder;
|
||||
fakeborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
|
||||
highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
|
||||
if(fakeborder)
|
||||
{
|
||||
int rgb = isBlackBorder(setlist[card->setId].c_str())?15:240;
|
||||
if(card->has(Constants::CANPLAYFROMGRAVEYARD)||card->has(Constants::CANPLAYFROMEXILE)||card->has(Constants::PAYZERO))
|
||||
fakeborder->SetColor(ARGB((int)(actA),7,235,7));//green border
|
||||
else
|
||||
fakeborder->SetColor(ARGB((int)(actA),15,15,15));
|
||||
fakeborder->SetColor(ARGB((int)(actA),rgb,rgb,rgb));
|
||||
renderer->RenderQuad(fakeborder.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16);
|
||||
//renderer->DrawRect(actX, (actY-yy),((28 * (actZ*zz) + 1) / 16),(40 * (actZ*zz) / 16),ARGB((int)(actA),240,240,240));
|
||||
}
|
||||
//draw border for highlighting
|
||||
if (game)
|
||||
@@ -438,7 +444,7 @@ void CardGui::Render()
|
||||
else if(card->chooseacolor == 5)
|
||||
buff += "\n-White";
|
||||
}
|
||||
if(!alternate && buff != "" && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm...
|
||||
if(buff != "")//enable indicator at all modes
|
||||
{
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
char buffer[200];
|
||||
@@ -477,7 +483,7 @@ void CardGui::Render()
|
||||
if (shadow)
|
||||
{
|
||||
shadow->SetColor(ARGB(200,255,255,255));
|
||||
renderer->RenderQuad(shadow.get(), actX, (actY-yy), actT, (25 * (actZ*zz) + 1) / 16, 37 * (actZ*zz) / 16);
|
||||
renderer->RenderQuad(shadow.get(), actX, (actY-yy), actT, (28 * (actZ*zz) + 1) / 16, 40 * (actZ*zz) / 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,28 +493,18 @@ void CardGui::Render()
|
||||
|
||||
if ((tc && tc->alreadyHasTarget(card)) || (game && card == game->mLayers->actionLayer()->currentActionCard))//paint targets red.
|
||||
{
|
||||
float xy = yy>0.0f?2.0f:1.0f;
|
||||
float modx = mHasFocus?xy:0.0f;
|
||||
if (card->isTapped())
|
||||
if(fakemask)
|
||||
{
|
||||
renderer->FillRect(actX - (scale * quad->mWidth / 2)-(7+modx),(actY-yy) - (scale * quad->mHeight / 2)+(7+modx),scale* quad->mHeight,scale * quad->mWidth, ARGB(128,255,0,0));
|
||||
}
|
||||
else
|
||||
{
|
||||
renderer->FillRect(actX - (scale * quad->mWidth / 2),(actY-yy) - (scale * quad->mHeight / 2), scale * quad->mWidth, scale* quad->mHeight, ARGB(128,255,0,0));
|
||||
fakemask->SetColor(ARGB(150,255,0,0));
|
||||
renderer->RenderQuad(fakemask.get(), actX, (actY-yy), actT, (26 * (actZ*zz) + 1) / 16, 38 * (actZ*zz) / 16);
|
||||
}
|
||||
}
|
||||
if(tc && tc->source && tc->source->view && tc->source->view->actY >= 1.3 && card == tc->source)//paint the source green while infocus.
|
||||
if(tc && tc->source && tc->source->view && tc->source->view->actZ >= 1.3 && card == tc->source)//paint the source green while infocus.
|
||||
{
|
||||
float xy = yy>0.0f?2.0f:1.0f;
|
||||
float modx = mHasFocus?xy:0.0f;
|
||||
if (tc->source->isTapped())
|
||||
if(fakemask)
|
||||
{
|
||||
renderer->FillRect(actX - (scale * quad->mWidth / 2)-(7+modx),(actY-yy) - (scale * quad->mHeight / 2)+(7+modx),scale* quad->mHeight,scale * quad->mWidth, ARGB(128,0,255,0));
|
||||
}
|
||||
else
|
||||
{
|
||||
renderer->FillRect(tc->source->view->actX - (scale * quad->mWidth / 2),(tc->source->view->actY-yy) - (scale * quad->mHeight / 2), scale*quad->mWidth, scale*quad->mHeight, ARGB(128,0,255,0));
|
||||
fakemask->SetColor(ARGB(150,0,255,0));
|
||||
renderer->RenderQuad(fakemask.get(), actX, (actY-yy), actT, (26 * (actZ*zz) + 1) / 16, 38 * (actZ*zz) / 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,12 +534,13 @@ JQuadPtr CardGui::AlternateThumbQuad(MTGCard * card)
|
||||
return q;
|
||||
}
|
||||
|
||||
void CardGui::AlternateRender(MTGCard * card, const Pos& pos)
|
||||
void CardGui::AlternateRender(MTGCard * card, const Pos& pos, bool noborder, bool smallerscale)
|
||||
{
|
||||
// Draw the "unknown" card model
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
JQuadPtr q;
|
||||
|
||||
//set id
|
||||
string cardsetname = setlist[card->setId].c_str();
|
||||
float x = pos.actX;
|
||||
|
||||
vector<ModRulesBackGroundCardGuiItem *>items = gModRules.cardgui.background;
|
||||
@@ -567,6 +564,10 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos)
|
||||
|
||||
float scale = pos.actZ * 250 / q->mHeight;
|
||||
q->SetColor(ARGB((int)pos.actA,255,255,255));
|
||||
|
||||
//Draw border
|
||||
DrawBorder(cardsetname, pos, x, noborder, smallerscale);
|
||||
//render alternate
|
||||
renderer->RenderQuad(q.get(), x, pos.actY, pos.actT, scale, scale);
|
||||
}
|
||||
|
||||
@@ -1128,7 +1129,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
|
||||
}
|
||||
|
||||
//Renders a big card on screen. Defaults to the "alternate" rendering if no image is found
|
||||
void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder, bool smallerscale)
|
||||
void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder, bool smallerscale, bool ingame)
|
||||
{
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
//GameObserver * game = GameObserver::GetInstance();
|
||||
@@ -1146,6 +1147,15 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder
|
||||
MTGCard * fcard = MTGCollection()->getCardByName(kcard->name);
|
||||
quad = WResourceManager::Instance()->RetrieveCard(fcard);
|
||||
}
|
||||
if(ingame)
|
||||
{
|
||||
if (kcard->hasCopiedToken && kcard->getObserver() && !quad.get())
|
||||
{
|
||||
MTGCard * tcard = MTGCollection()->getCardById(abs(kcard->copiedID));
|
||||
quad = thumb ? WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_THUMB, 1, abs(kcard->copiedID))
|
||||
: WResourceManager::Instance()->RetrieveCardToken(tcard, RETRIEVE_NORMAL, 1, abs(kcard->copiedID));
|
||||
}
|
||||
}
|
||||
if (quad.get())
|
||||
{
|
||||
if (quad->mHeight < quad->mWidth)
|
||||
@@ -1158,11 +1168,19 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder
|
||||
DrawBorder(cardsetname, pos, x, noborder, smallerscale);
|
||||
//force smaller scale on alpha beta
|
||||
smallerscale = cardsetname=="LEA"||cardsetname=="LEB"?true:smallerscale;
|
||||
float modxscale = (cardsetname =="UNH")?0.02f:0.008f;
|
||||
float modyscale = (cardsetname =="UNH")?0.015f:0.0075f;
|
||||
bool unh = (cardsetname =="UNH")?true:false;
|
||||
//Draw card
|
||||
if(smallerscale)
|
||||
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale-0.01f, scale-0.01f);
|
||||
if(smallerscale && !unh)
|
||||
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale-0.001f, scale-0.001f);
|
||||
else
|
||||
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale);
|
||||
{
|
||||
if(ingame)
|
||||
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale+modxscale, scale+modyscale);
|
||||
else
|
||||
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale+0.002f, scale+0.0015f);
|
||||
}
|
||||
RenderCountersBig(card, pos);
|
||||
return;
|
||||
}
|
||||
@@ -1170,7 +1188,7 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder
|
||||
//DebugTrace("Unable to fetch image: " << card->getImageName());
|
||||
|
||||
// If we come here, we do not have the picture.
|
||||
AlternateRender(card, pos);
|
||||
AlternateRender(card, pos, noborder, smallerscale);
|
||||
}
|
||||
|
||||
void CardGui::DrawBorder(string cardsetname, const Pos& pos, float x, bool noborder, bool smallerscale)
|
||||
@@ -1190,8 +1208,8 @@ void CardGui::DrawBorder(string cardsetname, const Pos& pos, float x, bool nobor
|
||||
if(cardsetname == "LEA")
|
||||
{//BETA HAS REGULAR BORDER
|
||||
//Draw more rounder black border
|
||||
renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-10.5f,(pos.actY - (pos.actZ * 119.7f))-11.5f,pos.actZ * 168.f + 0.5f,pos.actZ * 239.4f + 4.f,10.f,ARGB(255,5,5,5));
|
||||
renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-10.5f,(pos.actY - (pos.actZ * 119.7f))-11.5f,pos.actZ * 168.f + 0.5f,pos.actZ * 239.4f + 4.f,10.f,ARGB(50,240,240,240));
|
||||
renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f - 0.5f,pos.actZ * 239.4f + 8.f,10.f,ARGB(255,5,5,5));
|
||||
renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f - 0.5f,pos.actZ * 239.4f + 8.f,10.f,ARGB(50,240,240,240));
|
||||
}
|
||||
else
|
||||
{//draw black border
|
||||
@@ -1206,13 +1224,29 @@ void CardGui::DrawBorder(string cardsetname, const Pos& pos, float x, bool nobor
|
||||
if(alphabeta.get())
|
||||
{
|
||||
alphabeta->SetHotSpot(static_cast<float> (alphabeta->mWidth / 2), static_cast<float> (alphabeta->mHeight / 2));
|
||||
float myscale = pos.actZ * 250 / alphabeta->mHeight;
|
||||
float myscale = pos.actZ * 254 / alphabeta->mHeight;
|
||||
alphabeta->SetColor(ARGB((int)pos.actA,255,255,255));
|
||||
renderer->RenderQuad(alphabeta.get(), x, pos.actY, pos.actT, myscale, myscale);
|
||||
renderer->RenderQuad(alphabeta.get(), x, pos.actY+0.2f, pos.actT, myscale, myscale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CardGui::isBlackBorder(string cardsetname)
|
||||
{
|
||||
if(cardsetname == "2ED"||
|
||||
cardsetname == "RV"||
|
||||
cardsetname == "4ED"||
|
||||
cardsetname == "5ED"||
|
||||
cardsetname == "6ED"||
|
||||
cardsetname == "7ED"||
|
||||
cardsetname == "8ED"||
|
||||
cardsetname == "9ED"||
|
||||
cardsetname == "CHR"||
|
||||
cardsetname == "DM")
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
string CardGui::FormattedData(string data, string replace, string value)
|
||||
{
|
||||
size_t found = data.find(replace.c_str());
|
||||
|
||||
@@ -41,7 +41,10 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
|
||||
if(!source)
|
||||
return;
|
||||
basicAbilities = source->basicAbilities;
|
||||
origbasicAbilities = source->basicAbilities;
|
||||
for(int k=0; k < Constants::NB_BASIC_ABILITIES; k++)
|
||||
{
|
||||
modbasicAbilities.push_back(source->basicAbilities[k]);
|
||||
}
|
||||
LKIbasicAbilities = source->basicAbilities;
|
||||
|
||||
for (size_t i = 0; i < source->types.size(); ++i)
|
||||
@@ -79,7 +82,7 @@ CardPrimitive::~CardPrimitive()
|
||||
int CardPrimitive::init()
|
||||
{
|
||||
basicAbilities.reset();
|
||||
origbasicAbilities.reset();
|
||||
modbasicAbilities.clear();
|
||||
|
||||
types.clear();
|
||||
|
||||
@@ -110,6 +113,18 @@ bool CardPrimitive::isSpell()
|
||||
return (!isCreature() && !isLand());
|
||||
}
|
||||
|
||||
bool CardPrimitive::isPermanent()
|
||||
{
|
||||
return (!isSorceryorInstant());
|
||||
}
|
||||
|
||||
bool CardPrimitive::isSorceryorInstant()
|
||||
{
|
||||
if(hasSubtype(Subtypes::TYPE_SORCERY)||hasSubtype(Subtypes::TYPE_INSTANT))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int CardPrimitive::dredge()
|
||||
{
|
||||
return dredgeAmount;
|
||||
|
||||
@@ -344,7 +344,8 @@ void CardSelector::Render()
|
||||
float modx = 14.f;
|
||||
Pos npos = Pos(bigpos.x+modx,bigpos.y-4.f,bigpos.zoom-(bigpos.zoom/5),bigpos.t,bigpos.alpha);
|
||||
//render card
|
||||
card->DrawCard(npos, mDrawMode);
|
||||
bool ingame = observer?true:false;
|
||||
card->DrawCard(npos, mDrawMode, false, false, false,ingame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +184,8 @@ int Damage::resolve()
|
||||
if(!_target->inPlay()->hasAbility(Constants::POISONSHROUD))
|
||||
_target->poisonCount += damage;//this will be changed to poison counters.
|
||||
_target->damageCount += damage;
|
||||
if(typeOfDamage == 2)
|
||||
target->nonCombatDamage += damage;
|
||||
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
|
||||
{
|
||||
vector<string> values = MTGAllCards::getCreatureValuesById();
|
||||
@@ -202,6 +204,8 @@ int Damage::resolve()
|
||||
if(!_target->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
|
||||
a = target->dealDamage(damage);
|
||||
target->damageCount += damage;
|
||||
if(typeOfDamage == 2)
|
||||
target->nonCombatDamage += damage;
|
||||
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
|
||||
{
|
||||
vector<string> values = MTGAllCards::getCreatureValuesById();
|
||||
@@ -237,6 +241,8 @@ int Damage::resolve()
|
||||
else
|
||||
a = target->dealDamage(damage);
|
||||
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
|
||||
if(typeOfDamage == 2)
|
||||
target->nonCombatDamage += damage;
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
|
||||
((MTGCardInstance*)target)->wasDealtDamage = true;
|
||||
((MTGCardInstance*)source)->damageToCreature = true;
|
||||
|
||||
@@ -211,11 +211,13 @@ void GameObserver::nextGamePhase()
|
||||
{
|
||||
cleanupPhase();
|
||||
currentPlayer->damageCount = 0;
|
||||
currentPlayer->nonCombatDamage = 0;
|
||||
currentPlayer->drawCounter = 0;
|
||||
currentPlayer->raidcount = 0;
|
||||
currentPlayer->opponent()->raidcount = 0;
|
||||
currentPlayer->prowledTypes.clear();
|
||||
currentPlayer->opponent()->damageCount = 0; //added to clear odcount
|
||||
currentPlayer->opponent()->nonCombatDamage = 0;
|
||||
currentPlayer->preventable = 0;
|
||||
mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn;
|
||||
mLayers->stackLayer()->garbageCollect(); //clean stack history for this turn;
|
||||
@@ -954,12 +956,8 @@ void GameObserver::gameStateBasedEffects()
|
||||
p->game->putInExile(c);
|
||||
|
||||
}
|
||||
}/*
|
||||
if(c->modifiedbAbi > 0)
|
||||
{
|
||||
c->modifiedbAbi = 0;
|
||||
c->basicAbilities = c->origbasicAbilities;
|
||||
}*///disabled this failed logic I introduce... when copying/cloning a card copy orig basic abilities...
|
||||
}
|
||||
|
||||
if(nbcards > z->nb_cards)
|
||||
{
|
||||
t = 0;
|
||||
@@ -1186,56 +1184,56 @@ void GameObserver::Affinity()
|
||||
//kicker is an addon to normal cost, suspend is not casting. add cost as needed EXACTLY as seen below.
|
||||
card->getManaCost()->resetCosts();
|
||||
ManaCost *newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost(), card->model->data->getManaCost()));
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost(), card->model->data->getManaCost()));
|
||||
|
||||
card->getManaCost()->copy(newCost);
|
||||
card->getManaCost()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
if (card->getManaCost()->getAlternative())
|
||||
{
|
||||
card->getManaCost()->getAlternative()->resetCosts();
|
||||
ManaCost * newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost()->getAlternative(), card->model->data->getManaCost()->getAlternative()));
|
||||
card->getManaCost()->getAlternative()->copy(newCost);
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getAlternative(), card->model->data->getManaCost()->getAlternative()));
|
||||
card->getManaCost()->getAlternative()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
}
|
||||
if (card->getManaCost()->getBestow())
|
||||
{
|
||||
card->getManaCost()->getBestow()->resetCosts();
|
||||
ManaCost * newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost()->getBestow(), card->model->data->getManaCost()->getBestow()));
|
||||
card->getManaCost()->getBestow()->copy(newCost);
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getBestow(), card->model->data->getManaCost()->getBestow()));
|
||||
card->getManaCost()->getBestow()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
}
|
||||
if (card->getManaCost()->getRetrace())
|
||||
{
|
||||
card->getManaCost()->getRetrace()->resetCosts();
|
||||
ManaCost * newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost()->getRetrace(), card->model->data->getManaCost()->getRetrace()));
|
||||
card->getManaCost()->getRetrace()->copy(newCost);
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getRetrace(), card->model->data->getManaCost()->getRetrace()));
|
||||
card->getManaCost()->getRetrace()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
}
|
||||
if (card->getManaCost()->getBuyback())
|
||||
{
|
||||
card->getManaCost()->getBuyback()->resetCosts();
|
||||
ManaCost * newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost()->getBuyback(), card->model->data->getManaCost()->getBuyback()));
|
||||
card->getManaCost()->getBuyback()->copy(newCost);
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getBuyback(), card->model->data->getManaCost()->getBuyback()));
|
||||
card->getManaCost()->getBuyback()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
}
|
||||
if (card->getManaCost()->getFlashback())
|
||||
{
|
||||
card->getManaCost()->getFlashback()->resetCosts();
|
||||
ManaCost * newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost()->getFlashback(), card->model->data->getManaCost()->getFlashback()));
|
||||
card->getManaCost()->getFlashback()->copy(newCost);
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getFlashback(), card->model->data->getManaCost()->getFlashback()));
|
||||
card->getManaCost()->getFlashback()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
}
|
||||
if (card->getManaCost()->getMorph())
|
||||
{
|
||||
card->getManaCost()->getMorph()->resetCosts();
|
||||
ManaCost * newCost = NEW ManaCost();
|
||||
newCost->copy(card->computeNewCost(card, card->getManaCost()->getMorph(), card->model->data->getManaCost()->getMorph()));
|
||||
card->getManaCost()->getMorph()->copy(newCost);
|
||||
newCost->changeCostTo(card->computeNewCost(card, card->getManaCost()->getMorph(), card->model->data->getManaCost()->getMorph()));
|
||||
card->getManaCost()->getMorph()->changeCostTo(newCost);
|
||||
SAFE_DELETE(newCost);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,16 +20,16 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) :
|
||||
Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this));
|
||||
opponent->zoom = 0.9f;
|
||||
//opponentExile
|
||||
Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10,
|
||||
Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2f - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10,
|
||||
false, mpDuelLayers->getRenderedPlayerOpponent(), this));
|
||||
//opponentGraveyard
|
||||
Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5, false,
|
||||
Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 5, false,
|
||||
mpDuelLayers->getRenderedPlayerOpponent(), this));
|
||||
//opponentHand
|
||||
Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false,
|
||||
Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false,
|
||||
mpDuelLayers->getRenderedPlayerOpponent(), this));
|
||||
//opponentLibrary
|
||||
Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false,
|
||||
Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false,
|
||||
mpDuelLayers->getRenderedPlayerOpponent(), this));
|
||||
|
||||
observer->getCardSelector()->Add(self);
|
||||
@@ -145,12 +145,12 @@ void GuiAvatars::Update(float dt)
|
||||
void GuiAvatars::Render()
|
||||
{
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
float w = 54;
|
||||
float h = 54;
|
||||
float w = 52;
|
||||
float h = 52;
|
||||
if (opponent == active)
|
||||
{
|
||||
r->FillRect(opponent->actX, opponent->actY, 40 * opponent->actZ, h+20 * opponent->actZ, ARGB(200,0,0,0));
|
||||
r->FillRect(opponent->actX, opponent->actY, w * opponent->actZ, h * opponent->actZ, ARGB(200,0,0,0));
|
||||
r->FillRect(opponent->actX, opponent->actY, 34 * opponent->actZ, h+22 * opponent->actZ, ARGB(200,0,0,0));
|
||||
r->FillRect(opponent->actX, opponent->actY, (w * opponent->actZ)-1, (h * opponent->actZ)+2, ARGB(200,0,0,0));
|
||||
}
|
||||
else if (self == active)
|
||||
{
|
||||
|
||||
@@ -122,9 +122,9 @@ void GuiHandSelf::Repos()
|
||||
{
|
||||
float dist = 180.0f / cards.size();
|
||||
if (dist > 20)
|
||||
dist = 20.0;
|
||||
dist = 18.0;//20.0
|
||||
else
|
||||
y = 40.0;
|
||||
y = 35.0;//40.0
|
||||
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
|
||||
{
|
||||
(*it)->x = ClosedRowX;
|
||||
|
||||
@@ -62,12 +62,20 @@ void GuiPlay::HorzStack::Enstack(CardView* card)
|
||||
{
|
||||
card->x = x + baseX;
|
||||
card->y = y + baseY;
|
||||
if (total < 8)
|
||||
/*if (total < 8)
|
||||
x += CARD_WIDTH;
|
||||
else if (total < 16)
|
||||
x += (SCREEN_WIDTH - 200 - baseX) / total;
|
||||
else
|
||||
x += (SCREEN_WIDTH - 50 - baseX) / total;
|
||||
x += (SCREEN_WIDTH - 50 - baseX) / total;*/
|
||||
|
||||
// new adjustment
|
||||
if (total < 8)
|
||||
x += CARD_WIDTH;
|
||||
else if (total < 24)
|
||||
x += (SCREEN_WIDTH - 200 - baseX) / total;
|
||||
else
|
||||
x += (SCREEN_WIDTH - 70 - baseX) / total;
|
||||
}
|
||||
|
||||
void GuiPlay::VertStack::Enstack(CardView* card)
|
||||
@@ -83,9 +91,10 @@ void GuiPlay::VertStack::Enstack(CardView* card)
|
||||
|
||||
card->x = x + baseX;
|
||||
card->y = y + baseY;
|
||||
y += 12;
|
||||
if (++count == total - 1 && y == 12)
|
||||
y += 12;
|
||||
y += 9;
|
||||
if (++count == total - 1 && y == 9)
|
||||
y += 9;
|
||||
//last value += 12...
|
||||
}
|
||||
|
||||
void GuiPlay::VertStack::Render(CardView* card, iterator begin, iterator end)
|
||||
@@ -124,13 +133,13 @@ void GuiPlay::BattleField::reset(float x, float y)
|
||||
void GuiPlay::BattleField::EnstackAttacker(CardView* card)
|
||||
{
|
||||
//card->x = CARD_WIDTH + 20 + (currentAttacker * (HORZWIDTH) / (attackers+1));
|
||||
card->x = x + baseX;
|
||||
if (total < 8)
|
||||
card->x = x-4 + baseX;
|
||||
if (attackers+1 < 8)
|
||||
x += CARD_WIDTH;
|
||||
else if (total < 16)
|
||||
x += (SCREEN_WIDTH - 200 - baseX) / total;
|
||||
else if (attackers+1 < 24)
|
||||
x += (SCREEN_WIDTH - 200 - baseX) / attackers+1;
|
||||
else
|
||||
x += (SCREEN_WIDTH - 50 - baseX) / total;
|
||||
x += (HORZWIDTH - baseX) / attackers+1;
|
||||
|
||||
card->y = baseY + (card->card->getObserver()->getView()->getRenderedPlayer() == card->card->controller() ? 20 + y : -20 - y);
|
||||
++currentAttacker;
|
||||
@@ -424,6 +433,8 @@ int GuiPlay::receiveEventPlus(WEvent * e)
|
||||
Replace();
|
||||
else if (dynamic_cast<WEventCardControllerChange*> (e))
|
||||
Replace();
|
||||
else if (dynamic_cast<WEventCardTransforms*> (e))
|
||||
Replace();
|
||||
Replace();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ void GuiAvatar::Render()
|
||||
}
|
||||
|
||||
if (player->getObserver()->currentPlayer == player)
|
||||
r->DrawRect(x0 - 1, y0 - 1, 36 * actZ, 51 * actZ, ARGB((int)actA, 0, 255, 0));
|
||||
r->DrawRect(x0 - 1, y0 - 1, (Width+1) * actZ, (Height+1) * actZ, ARGB((int)actA, 0, 255, 0));
|
||||
else if (player->getObserver()->currentActionPlayer == player)
|
||||
r->DrawRect(x0, y0, 34 * actZ, 49 * actZ, ARGB((int)actA, 0, 0, 255));
|
||||
r->DrawRect(x0, y0, (Width-1) * actZ, (Height-1) * actZ, ARGB((int)actA, 0, 0, 255));
|
||||
if (player->getObserver()->isInterrupting == player)
|
||||
r->DrawRect(x0, y0, 34 * actZ, 49 * actZ, ARGB((int)actA, 255, 0, 0));
|
||||
r->DrawRect(x0, y0, (Width-1) * actZ, (Height-1) * actZ, ARGB((int)actA, 255, 0, 0));
|
||||
|
||||
//Life
|
||||
char buffer[10];
|
||||
|
||||
@@ -371,6 +371,24 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
||||
return 0;
|
||||
}
|
||||
|
||||
check = restriction[i].find("notdelirum");
|
||||
if (check != string::npos)
|
||||
{
|
||||
Player * checkCurrent = card->controller();
|
||||
MTGGameZone * grave = checkCurrent->game->graveyard;
|
||||
|
||||
int checkTypesAmount = 0;
|
||||
if(grave->hasType("creature")) checkTypesAmount++;
|
||||
if (grave->hasType("enchantment")) checkTypesAmount++;
|
||||
if (grave->hasType("sorcery")) checkTypesAmount++;
|
||||
if (grave->hasType("instant")) checkTypesAmount++;
|
||||
if (grave->hasType("land")) checkTypesAmount++;
|
||||
if (grave->hasType("artifact")) checkTypesAmount++;
|
||||
if (grave->hasType("planeswalker")) checkTypesAmount++;
|
||||
if (checkTypesAmount > 3)
|
||||
return 0;
|
||||
}
|
||||
|
||||
check = restriction[i].find("miracle");
|
||||
if(check != string::npos)
|
||||
{
|
||||
@@ -824,7 +842,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
|
||||
fromTc->targetter = NULL; //avoid protection from
|
||||
}
|
||||
TriggeredAbility * mover = NEW TrCardAddedToZone(observer, id, card, (TargetZoneChooser *) toTc,
|
||||
toTcCard, (TargetZoneChooser *) fromTc, fromTcCard, once, sourceUntapped, isSuspended);
|
||||
toTcCard, (TargetZoneChooser *) fromTc, fromTcCard, once, sourceUntapped, isSuspended, limitOnceATurn);
|
||||
if(neverRemove)
|
||||
{
|
||||
mover->forcedAlive = 1;
|
||||
@@ -845,6 +863,10 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
|
||||
if (TargetChooser *tc = parseSimpleTC(s,"tappedformana", card))
|
||||
return NEW TrCardTappedformana(observer, id, card, tc, true,once);
|
||||
|
||||
//Card Transforms
|
||||
if (TargetChooser *tc = parseSimpleTC(s,"transformed", card))
|
||||
return NEW TrCardTransformed(observer, id, card, tc,once);
|
||||
|
||||
//CombatTrigger
|
||||
//Card card attacked and is blocked
|
||||
found = s.find("combat(");
|
||||
@@ -2381,13 +2403,20 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
|
||||
ATokenCreator * tok = NEW ATokenCreator(observer, id, card,target, NULL, tokenId, starfound, multiplier, who);
|
||||
tok->oneShot = 1;
|
||||
//andability
|
||||
if(storedAndAbility.size())
|
||||
{
|
||||
string stored = storedAndAbility;
|
||||
storedAndAbility.clear();
|
||||
((ATokenCreator*)tok)->andAbility = parseMagicLine(stored, id, spell, card);
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
|
||||
string tokenDesc = splitToken[1];
|
||||
vector<string> tokenParameters = split(tokenDesc, ',');
|
||||
//lets try finding a token by card name.
|
||||
if (splitToken[1].size() && tokenParameters.size() ==1)
|
||||
if (splitToken[1].size() && tokenParameters.size() <3)
|
||||
{
|
||||
string cardName = splitToken[1];
|
||||
MTGCard * safetycard = MTGCollection()->getCardByName(cardName);
|
||||
@@ -2395,6 +2424,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
{
|
||||
ATokenCreator * tok = NEW ATokenCreator(observer, id, card, target, NULL, cardName, starfound, multiplier, who);
|
||||
tok->oneShot = 1;
|
||||
//andability
|
||||
if(storedAndAbility.size())
|
||||
{
|
||||
string stored = storedAndAbility;
|
||||
storedAndAbility.clear();
|
||||
((ATokenCreator*)tok)->andAbility = parseMagicLine(stored, id, spell, card);
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
}
|
||||
@@ -2406,7 +2442,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
string sname = tokenParameters[0];
|
||||
string stypes = tokenParameters[1];
|
||||
string spt = tokenParameters[2];
|
||||
|
||||
string cID = "";
|
||||
//reconstructing string abilities from the split version,
|
||||
// then we re-split it again in the token constructor,
|
||||
// this needs to be improved
|
||||
@@ -2416,6 +2452,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
sabilities.append(",");
|
||||
sabilities.append(tokenParameters[i]);
|
||||
}
|
||||
if(sabilities.find(",tnum:") != string::npos)
|
||||
{
|
||||
size_t begins = sabilities.find(",tnum:");
|
||||
cID = sabilities.substr(begins+6);
|
||||
sabilities = cReplaceString(sabilities,",tnum:"+cID,"");
|
||||
}
|
||||
int value = 0;
|
||||
if (spt.find("xx/xx") != string::npos)
|
||||
value = card->X / 2;
|
||||
@@ -2427,10 +2469,17 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
|
||||
ATokenCreator * tok = NEW ATokenCreator(
|
||||
observer, id, card,target, NULL, sname, stypes, power + value, toughness + value,
|
||||
sabilities, starfound, multiplier, who, aLivingWeapon, spt);
|
||||
sabilities, starfound, multiplier, who, aLivingWeapon, spt, cID);
|
||||
tok->oneShot = 1;
|
||||
if(aLivingWeapon)
|
||||
tok->forceDestroy = 1;
|
||||
//andability
|
||||
if(storedAndAbility.size())
|
||||
{
|
||||
string stored = storedAndAbility;
|
||||
storedAndAbility.clear();
|
||||
((ATokenCreator*)tok)->andAbility = parseMagicLine(stored, id, spell, card);
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
|
||||
@@ -2497,6 +2546,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
{
|
||||
MTGAbility * a = NEW AACopier(observer, id, card, target);
|
||||
a->oneShot = 1;
|
||||
a->canBeInterrupted = false;
|
||||
//andability
|
||||
if(storedAndAbility.size())
|
||||
{
|
||||
string stored = storedAndAbility;
|
||||
storedAndAbility.clear();
|
||||
((AACopier*)a)->andAbility = parseMagicLine(stored, id, spell, card);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
|
||||
bypassTC = false;
|
||||
discarded = false;
|
||||
copiedID = getId();
|
||||
modifiedbAbi = 0;
|
||||
LKIpower = power;
|
||||
LKItoughness = toughness;
|
||||
cardistargetted = 0;
|
||||
@@ -99,16 +98,8 @@ void MTGCardInstance::copy(MTGCardInstance * card)
|
||||
{
|
||||
MTGCard * source = card->model;
|
||||
CardPrimitive * data = source->data;
|
||||
|
||||
//basicAbilities = card->origbasicAbilities;
|
||||
for(int k = 0; k < Constants::NB_BASIC_ABILITIES; k++)
|
||||
{
|
||||
if(card->model->data->basicAbilities[k])
|
||||
basicAbilities[k] = card->model->data->basicAbilities[k];
|
||||
}
|
||||
|
||||
origbasicAbilities = card->origbasicAbilities;
|
||||
modifiedbAbi = card->modifiedbAbi;
|
||||
basicAbilities = card->model->data->basicAbilities;
|
||||
modbasicAbilities = card->modbasicAbilities;
|
||||
for (size_t i = 0; i < data->types.size(); i++)
|
||||
{
|
||||
types.push_back(data->types[i]);
|
||||
@@ -145,14 +136,15 @@ void MTGCardInstance::copy(MTGCardInstance * card)
|
||||
mtgid = backupid; // there must be a way to get the token id...
|
||||
else
|
||||
{
|
||||
mtgid = card->getMTGId(); ///////////////////////////////////////////////////
|
||||
setId = card->setId; // Copier/Cloner cards produces the same token...//
|
||||
rarity = card->getRarity(); ///////////////////////////////////////////////////
|
||||
mtgid = card->getMTGId(); ///////////////////////////////////////////////////
|
||||
setId = card->setId; // Copier/Cloner cards produces the same token...//
|
||||
//rarity = card->getRarity(); ///////////////////////////////////////////////////
|
||||
}
|
||||
castMethod = castMethodBackUP;
|
||||
backupTargets = this->backupTargets;
|
||||
storedCard = oldStored;
|
||||
miracle = false;
|
||||
mPropertiesChangedSinceLastUpdate = true;
|
||||
}
|
||||
|
||||
MTGCardInstance::~MTGCardInstance()
|
||||
@@ -269,6 +261,7 @@ void MTGCardInstance::initMTGCI()
|
||||
previousZone = NULL;
|
||||
previous = NULL;
|
||||
next = NULL;
|
||||
TokenAndAbility = NULL;
|
||||
lastController = NULL;
|
||||
regenerateTokens = 0;
|
||||
blocked = false;
|
||||
@@ -615,7 +608,7 @@ int MTGCardInstance::hasSummoningSickness()
|
||||
{
|
||||
if (!summoningSickness)
|
||||
return 0;
|
||||
if (basicAbilities[(int)Constants::HASTE])
|
||||
if (has(Constants::HASTE))
|
||||
return 0;
|
||||
if (!isCreature())
|
||||
return 0;
|
||||
|
||||
@@ -168,7 +168,9 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"shackler",
|
||||
"flyersonly",
|
||||
"tempflashback",
|
||||
"legendruleremove"
|
||||
"legendruleremove",
|
||||
"canttransform",
|
||||
"asflash"
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
@@ -334,7 +334,7 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::ASFLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
{
|
||||
if(card->controller()->epic)
|
||||
return 0;
|
||||
@@ -559,7 +559,7 @@ int MTGKickerRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
|
||||
if(!card->getManaCost()->getKicker())
|
||||
return 0;
|
||||
|
||||
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::ASFLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
{
|
||||
if(card->controller()->epic)
|
||||
return 0;
|
||||
@@ -748,7 +748,7 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::SPELLMASTERY) || card->has(Constants::OFFERING) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::ASFLASH) || card->has(Constants::SPELLMASTERY) || card->has(Constants::OFFERING) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
{
|
||||
if(card->controller()->epic)
|
||||
return 0;
|
||||
@@ -1313,7 +1313,7 @@ int MTGMorphCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
|
||||
if(card->controller()->epic)//zoetic cavern... morph is casted for a cost...
|
||||
return 0;
|
||||
//note lands can morph too, this is different from other cost types.
|
||||
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::ASFLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
{
|
||||
if (card->controller()->game->playRestrictions->canPutIntoZone(card, card->controller()->game->stack) == PlayRestriction::CANT_PLAY)
|
||||
return 0;
|
||||
@@ -1661,8 +1661,7 @@ int MTGAttackCostRule::reactToClick(MTGCardInstance * card)
|
||||
Player * player = game->currentlyActing();
|
||||
ManaCost * attackcost = NEW ManaCost(ManaCost::parseManaCost("{0}",NULL,NULL));
|
||||
attackcost->add(0,card->attackCostBackup);
|
||||
ManaCost * playerMana = player->getManaPool();
|
||||
playerMana->pay(attackcost);//I think you can't pay partial cost to attack cost so you pay full (508.1i)
|
||||
player->getManaPool()->pay(attackcost);//I think you can't pay partial cost to attack cost so you pay full (508.1i)
|
||||
card->attackCost = 0;
|
||||
card->attackPlaneswalkerCost = 0;
|
||||
SAFE_DELETE(attackcost);
|
||||
@@ -1737,8 +1736,7 @@ int MTGBlockCostRule::reactToClick(MTGCardInstance * card)
|
||||
Player * player = game->currentlyActing();
|
||||
ManaCost * blockcost = NEW ManaCost(ManaCost::parseManaCost("{0}",NULL,NULL));
|
||||
blockcost->add(0,card->blockCostBackup);
|
||||
ManaCost * playerMana = player->getManaPool();
|
||||
playerMana->pay(blockcost);//I think you can't pay partial cost to block cost so you pay full (509.1f)
|
||||
player->getManaPool()->pay(blockcost);//I think you can't pay partial cost to block cost so you pay full (509.1f)
|
||||
card->blockCost = 0;
|
||||
SAFE_DELETE(blockcost);
|
||||
return 1;
|
||||
@@ -1836,6 +1834,8 @@ int MTGAttackRule::receiveEvent(WEvent *e)
|
||||
card->setAttacker(0);
|
||||
if (card->isAttacker() && !card->has(Constants::VIGILANCE))
|
||||
card->tap();
|
||||
if (card->isAttacker() && card->has(Constants::CANTATTACK))
|
||||
card->toggleAttacker();//if a card has cantattack, then you cant
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -666,6 +666,30 @@ void ManaCost::copy(ManaCost * _manaCost)
|
||||
xColor = _manaCost->xColor;
|
||||
}
|
||||
|
||||
void ManaCost::changeCostTo(ManaCost * _manaCost)
|
||||
{
|
||||
if (!_manaCost)
|
||||
return;
|
||||
|
||||
cost.erase(cost.begin() ,cost.end());
|
||||
|
||||
for (int i = 0; i <= Constants::NB_Colors; i++)
|
||||
{
|
||||
cost.push_back(_manaCost->getCost(i));
|
||||
}
|
||||
|
||||
hybrids = _manaCost->hybrids;
|
||||
|
||||
SAFE_DELETE(extraCosts);
|
||||
|
||||
if (_manaCost->extraCosts)
|
||||
{
|
||||
extraCosts = _manaCost->extraCosts->clone();
|
||||
}
|
||||
|
||||
xColor = _manaCost->xColor;
|
||||
}
|
||||
|
||||
int ManaCost::getCost(int color)
|
||||
{
|
||||
if (cost.size() <= (size_t)color)
|
||||
|
||||
@@ -26,6 +26,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
|
||||
nomaxhandsize = false;
|
||||
poisonCount = 0;
|
||||
damageCount = 0;
|
||||
nonCombatDamage = 0;
|
||||
preventable = 0;
|
||||
mAvatarTex = NULL;
|
||||
type_as_damageable = DAMAGEABLE_PLAYER;
|
||||
|
||||
@@ -231,6 +231,11 @@ WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) :
|
||||
{
|
||||
}
|
||||
|
||||
WEventCardTransforms::WEventCardTransforms(MTGCardInstance * card) :
|
||||
WEventCardUpdate(card)
|
||||
{
|
||||
}
|
||||
|
||||
WEventCombatStepChange::WEventCombatStepChange(CombatStep step) :
|
||||
WEvent(), step(step)
|
||||
{
|
||||
@@ -397,6 +402,12 @@ Targetable * WEventCardControllerChange::getTarget(int target)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Targetable * WEventCardTransforms::getTarget(int target)
|
||||
{
|
||||
if (target) return card;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::ostream& WEvent::toString(std::ostream& out) const
|
||||
{
|
||||
return out << "EVENT";
|
||||
|
||||
@@ -263,6 +263,46 @@ JQuadPtr ResourceManagerImpl::RetrieveCard(MTGCard * card, int style, int submod
|
||||
return JQuadPtr();
|
||||
}
|
||||
|
||||
JQuadPtr ResourceManagerImpl::RetrieveCardToken(MTGCard * card, int style, int submode, int tId)
|
||||
{
|
||||
//Cards are never, ever resource managed, so just check cache.
|
||||
if (!card || options[Options::DISABLECARDS].number) return JQuadPtr();
|
||||
|
||||
submode = submode | TEXTURE_SUB_CARD;
|
||||
|
||||
//static std::ostringstream filename;
|
||||
//filename.str("");
|
||||
string filename;
|
||||
filename.reserve(4096);
|
||||
//filename << setlist[card->setId] << "/" << card->getImageName();
|
||||
filename.append(setlist[card->setId]);
|
||||
filename.append("/");
|
||||
int id = -card->getMTGId();
|
||||
if(tId)
|
||||
id = -tId;
|
||||
ostringstream imagename;
|
||||
imagename << "-" << id << "t.jpg";
|
||||
filename.append(imagename.str());
|
||||
|
||||
//Aliases.
|
||||
if (style == RETRIEVE_THUMB)
|
||||
{
|
||||
submode = submode | TEXTURE_SUB_THUMB;
|
||||
style = RETRIEVE_NORMAL;
|
||||
}
|
||||
|
||||
JQuadPtr jq = RetrieveQuad(filename, 0, 0, 0, 0, "", style, submode | TEXTURE_SUB_5551, id);
|
||||
|
||||
lastError = textureWCache.mError;
|
||||
if (jq)
|
||||
{
|
||||
jq->SetHotSpot(static_cast<float> (jq->mTex->mWidth / 2), static_cast<float> (jq->mTex->mHeight / 2));
|
||||
return jq;
|
||||
}
|
||||
|
||||
return JQuadPtr();
|
||||
}
|
||||
|
||||
int ResourceManagerImpl::AddQuadToManaged(const WManagedQuad& inQuad)
|
||||
{
|
||||
int id = mIDLookupMap.size();
|
||||
|
||||
Reference in New Issue
Block a user