Compare commits
261 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 81770a8bc4 | |||
| 34972176fe | |||
| 600aa45ff7 | |||
| 56ccebb720 | |||
| 8ef3789970 | |||
| ed7769c373 | |||
| 5745006c35 | |||
| 16b243c52a | |||
| bc91eaf5ca | |||
| 6962d1e888 | |||
| 4d1e8dfb36 | |||
| 6ff6f95044 | |||
| 5369983b35 | |||
| 46a8041c48 | |||
| 84185a7c78 | |||
| 4f41248978 | |||
| 92d52a78be | |||
| a76594046b | |||
| 2214ec66f1 | |||
| b8da46ac18 | |||
| d656730d3a | |||
| 2f230e4b38 | |||
| 494f64acbd | |||
| 50978200d4 | |||
| a38e1daec7 | |||
| 57a26b4583 | |||
| c018c8fcd1 | |||
| 3ba4aca8bc | |||
| 870f6e3b58 | |||
| 83e0869548 | |||
| 90b08db038 | |||
| c888e143a1 | |||
| 4e727bc164 | |||
| b37afadb01 | |||
| 2c2744f6fb | |||
| db2b2fa3b5 | |||
| 0127f7aab9 | |||
| ce41791fa4 | |||
| ec4be4f6b1 | |||
| f82d89b3db | |||
| 202175f2a7 | |||
| b91a9aeed4 | |||
| 6a1534750f | |||
| 1cb20e4138 | |||
| 8458745bc4 | |||
| 2d61ff6e2e | |||
| c5fe5243a9 | |||
| a6a25be3d3 | |||
| 63694785c6 | |||
| c68f83491e | |||
| 257082ea02 | |||
| e5fe25dfba | |||
| 93ba3d107d | |||
| fcf0078f26 | |||
| d8c1933abc | |||
| d7628b3eb2 | |||
| 7560db571c | |||
| 775143355d | |||
| 846ba30821 | |||
| ad88592229 | |||
| 6b90956af1 | |||
| 26e905a36e | |||
| 1a9ff38f0c | |||
| 8b22d032cd | |||
| 8d58baf4a3 | |||
| a447a0c9af | |||
| 555fb3ae93 | |||
| 7053531a4d | |||
| 7d4e5177b9 | |||
| 06f30eca3a | |||
| ac5c14b977 | |||
| c3d810bd3b | |||
| 1e24f25c18 | |||
| 28db884498 | |||
| 36ecc1ffef | |||
| 9ec6803a02 | |||
| e87996a7f2 | |||
| f2a5273029 | |||
| 9bc750da9a | |||
| 539c5bd18a | |||
| bdc1ada090 | |||
| 2efc24a1ce | |||
| 63561e6122 | |||
| d2390b1227 | |||
| d0799ea3f2 | |||
| 44cbfbb1fb | |||
| b078dd1f6a | |||
| 225dd23753 | |||
| 51b4755242 | |||
| 8f233b3027 | |||
| 197540763e | |||
| 5d7667dc01 | |||
| 18383579e9 | |||
| 03d4f8ffa1 | |||
| 30d92eb68c | |||
| 6e6a0fd5c2 | |||
| cd4a980182 | |||
| aad54fd98d | |||
| 6b7a49506c | |||
| 7ecf67c176 | |||
| 77aeb2d0ac | |||
| 7a9f989104 | |||
| ae06bebd24 | |||
| 042fb7b376 | |||
| c3583ade01 | |||
| f97d9805dd | |||
| 1d33de59a9 | |||
| 0c4b09891b | |||
| 25955303e7 | |||
| 27b75eecb0 | |||
| e40921cf13 | |||
| 083cebcc7e | |||
| a722736335 | |||
| c483c20c81 | |||
| dec1caa43c | |||
| 9526e22118 | |||
| d9816c7ad0 | |||
| 8e327a27df | |||
| 43fe67d7d8 | |||
| a63991bb4e | |||
| b09db0c60f | |||
| 928ca3497a | |||
| 60219411f6 | |||
| 642f5bb515 | |||
| 20e878a102 | |||
| da31371d86 | |||
| 0df408793a | |||
| 9630bcd56b | |||
| 3c38e21b25 | |||
| caec886e22 | |||
| 927f8955e9 | |||
| d4e0296d2b | |||
| 8eb664f93d | |||
| b180c3d1a7 | |||
| db9f18a644 | |||
| 95805ea387 | |||
| 4765890d0a | |||
| 2e13f29945 | |||
| 22b1c3b5d8 | |||
| c7bae65697 | |||
| 2381f0306c | |||
| b12e15e4ff | |||
| 9e21751e12 | |||
| db60c38eda | |||
| 1a4327a2e6 | |||
| 88095c67b8 | |||
| ec34380668 | |||
| 89dcd6c71d | |||
| fd3cf574cf | |||
| f21452feec | |||
| 0f85471216 | |||
| 5d92553017 | |||
| f0e6d820c7 | |||
| 545fc21260 | |||
| 8b68568106 | |||
| 739a5d9e2b | |||
| 4c627f74b6 | |||
| 1e610ff653 | |||
| 5d6557a49f | |||
| 7528329a58 | |||
| c62597dce5 | |||
| d8dfcdba67 | |||
| 7b5f00260b | |||
| f9dc551942 | |||
| 718ceca919 | |||
| 89fb76a8e7 | |||
| 1cc65ab611 | |||
| 3b22354ad9 | |||
| 2b9977a334 | |||
| 12c5f31562 | |||
| 8cfd887375 | |||
| 292bf7b1d2 | |||
| 4041fe690b | |||
| cb73e2b90d | |||
| a1fa36a934 | |||
| bdd0e6c042 | |||
| ee217e94a8 | |||
| 38e19f7d35 | |||
| 0bbfd00d15 | |||
| aaceb3c038 | |||
| 5efa7e10bd | |||
| 14c164364e | |||
| 4514725aba | |||
| 2b0f50bb88 | |||
| a65fc0c0f0 | |||
| 99db363253 | |||
| c25dfec67e | |||
| dd7210d187 | |||
| 904b7a6d86 | |||
| 31b353c5ec | |||
| 0d350af1b6 | |||
| 3bc9c93bab | |||
| 2002bb4e16 | |||
| 7e9c4ddbdd | |||
| 12b71de63c | |||
| 15011961f4 | |||
| b851103711 | |||
| 67b8af8d15 | |||
| 8100e390b1 | |||
| 72e6876001 | |||
| 96aeaffa1b | |||
| 74faa35b91 | |||
| 8bb58ca3b1 | |||
| 93d1a637b6 | |||
| 30e86ffcd8 | |||
| cbe6c0c842 | |||
| 77eb7f2777 | |||
| 077ab10c05 | |||
| 1194463349 | |||
| 8de50532f2 | |||
| 334454655d | |||
| d8d52e185d | |||
| 9f1d225259 | |||
| 0c72bfd4c4 | |||
| 55e0366f19 | |||
| 667b95f2b8 | |||
| e90f6fe224 | |||
| 2289fffb8d | |||
| 826403a512 | |||
| 35fec3d9a0 | |||
| e9eb86488e | |||
| ae97abbf96 | |||
| a8391112b0 | |||
| 4257592568 | |||
| 657479e0e4 | |||
| 9e969881fd | |||
| 2b434a7182 | |||
| d2e41f98c3 | |||
| 318fc98a39 | |||
| b7a4b7f6b9 | |||
| ed03fb744d | |||
| 02be213d1e | |||
| 0d4db9ee54 | |||
| ae927576c5 | |||
| f08ddac77b | |||
| 9effa7c975 | |||
| a70259b5ba | |||
| bf0a0a1580 | |||
| eb8b22b2d5 | |||
| 4095676b6b | |||
| bedd1e8da8 | |||
| 965d4f6d45 | |||
| 0db2925e7a | |||
| 031f2dbffb | |||
| dbece750f8 | |||
| 6699902c24 | |||
| e8407caa2a | |||
| 69c6745f53 | |||
| 6f083389c2 | |||
| 9ee44ca091 | |||
| 3f0dd987f0 | |||
| 672b0be7bd | |||
| 9d5a83d588 | |||
| 5d0d130587 | |||
| c85d857604 | |||
| f68568cc1e | |||
| 89206b3a6b | |||
| a8cff5ed8e | |||
| dc118c64b8 | |||
| a43854420d | |||
| 02a65ecd82 |
+65
-14
@@ -1,17 +1,68 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
|
||||||
|
matrix:
|
||||||
|
- BUILD_TYPE=PSP
|
||||||
|
- BUILD_TYPE=Android
|
||||||
|
- BUILD_TYPE=Qt
|
||||||
|
|
||||||
|
branches:
|
||||||
|
except:
|
||||||
|
- latest-master
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
|
|
||||||
- export PSPSDK="$PSPDEV/psp/sdk"
|
|
||||||
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
|
|
||||||
- export ANDROID="android-sdk-linux/tools/android"
|
|
||||||
install:
|
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi
|
# Building for PSP here
|
||||||
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
|
- if [ "$BUILD_TYPE" == "PSP" ]; then
|
||||||
- tar -x --xz -f sdk.lzma
|
export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" &&
|
||||||
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
|
export PSPSDK="$PSPDEV/psp/sdk" &&
|
||||||
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
|
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" &&
|
||||||
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
|
wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download;
|
||||||
- tar -zxf android-sdk_r22-linux.tgz
|
fi
|
||||||
- echo yes | $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt
|
# Building for Android here
|
||||||
script: "./travis-script.sh"
|
- if [ "$BUILD_TYPE" == "Android" ]; then
|
||||||
|
export ANDROID="android-sdk-linux/tools/android" &&
|
||||||
|
if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi &&
|
||||||
|
wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv &&
|
||||||
|
wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz -nv;
|
||||||
|
fi
|
||||||
|
# Building for Qt here
|
||||||
|
- if [ "$BUILD_TYPE" == "Qt" ]; then
|
||||||
|
sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa &&
|
||||||
|
sudo apt-get update -qq &&
|
||||||
|
sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev &&
|
||||||
|
export QMAKE="qmake -qt=qt5";
|
||||||
|
fi
|
||||||
|
|
||||||
|
install:
|
||||||
|
# Building for PSP here
|
||||||
|
- if [ "$BUILD_TYPE" == "PSP" ]; then
|
||||||
|
tar -x --xz -f sdk.lzma;
|
||||||
|
fi
|
||||||
|
- if [ "$BUILD_TYPE" == "Android" ]; then
|
||||||
|
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
|
||||||
|
tar -zxf android-sdk_r23.0.2-linux.tgz &&
|
||||||
|
$ANDROID list sdk --extended -a &&
|
||||||
|
echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-21.1.1,android-10 --no-ui --force --no-https;
|
||||||
|
fi
|
||||||
|
- sudo pip install pyjavaproperties
|
||||||
|
- sudo pip install github3.py
|
||||||
|
script: ./travis-script.sh
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api-key:
|
||||||
|
secure: "gzfDEihpfTmoO6CSjTNpHSlLTPtQUZUqTlmD91CQby6+znDsOy4xsqj10MNXe+l/3KYny1DtM48nxNKeVjsyeYg66TTzKsrgMVzt6Ah5CBhSXO99/TiaMJmSXmMO7GGfKDct190Dqej1gbR7AMd38DOYe2vpR0LX+Lf3gzDVLoU="
|
||||||
|
file:
|
||||||
|
- ${TRAVIS_BUILD_DIR}/core.zip
|
||||||
|
- ${TRAVIS_BUILD_DIR}/projects/mtg/Android/bin/Wagic-debug.apk
|
||||||
|
- ${TRAVIS_BUILD_DIR}/projects/mtg/psprelease.zip
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
repo: WagicProject/wagic
|
||||||
|
tags: false
|
||||||
|
branch: auto_releases
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+3
-3
@@ -73,7 +73,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>SDL_CONFIG;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>SDL_CONFIG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<Optimization>Full</Optimization>
|
<Optimization>Full</Optimization>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>SDL_CONFIG;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
|
|||||||
|
|
||||||
|
|
||||||
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
||||||
|
CXXFLAGS += -DTIXML_USE_STL
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CXXFLAGS += -ggdb3
|
CXXFLAGS += -ggdb3
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ std::string ToHex(T* pointer)
|
|||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString << std::endl; \
|
stream << inString << std::endl; \
|
||||||
OutputDebugString(stream.str().c_str()); \
|
OutputDebugStringA(stream.str().c_str()); \
|
||||||
}
|
}
|
||||||
#endif // QT_CONFIG
|
#endif // QT_CONFIG
|
||||||
#endif // Win32, Linux
|
#endif // Win32, Linux
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
#ifndef DOWNLOADER_H
|
||||||
|
#define DOWNLOADER_H
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This class handles download of remote resources (any kind of file)
|
||||||
|
// All the resources are stored locally in the userPath
|
||||||
|
// For every resources, the downloader verifies if the resource was modifed
|
||||||
|
// on the server before downloading the update. The Downloader maintains a catalogue
|
||||||
|
// of resource downloaded to be able to check if they need to be updated.
|
||||||
|
//
|
||||||
|
// The interface can be used completly synchronously by the application and some
|
||||||
|
// context or message loop is needed in the implementation of this interface
|
||||||
|
//
|
||||||
|
// Note that the Downloader could in theory by implemented on top of JNetwork.
|
||||||
|
//
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
#include <string>
|
||||||
|
#include <ostream>
|
||||||
|
#include <istream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <map>
|
||||||
|
#include "Threading.h"
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
#include <QObject>
|
||||||
|
#include <QNetworkRequest>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class DownloadRequest
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
: public QObject
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
#endif
|
||||||
|
void fileDownloaded();
|
||||||
|
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
signals:
|
||||||
|
void percentChanged(int percent);
|
||||||
|
void statusChanged(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef enum {
|
||||||
|
NOT_PRESENT,
|
||||||
|
DOWNLOADING,
|
||||||
|
DOWNLOADED,
|
||||||
|
DOWNLOAD_ERROR
|
||||||
|
} DownloadStatus;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
string mLocalPath;
|
||||||
|
string mRemoteResourceURL;
|
||||||
|
// previous one is the original, next one can change after redirection
|
||||||
|
string mRequestedRemoteResourceURL;
|
||||||
|
string mETag;
|
||||||
|
DownloadStatus mDownloadStatus;
|
||||||
|
bool mUpgradeAvailable;
|
||||||
|
size_t mTotalSize;
|
||||||
|
size_t mCurrentSize;
|
||||||
|
ofstream mFile;
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QNetworkReply* mNetworkReply;
|
||||||
|
static QNetworkAccessManager networkAccessManager;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
DownloadRequest(string localPath="",
|
||||||
|
string remoteResourceURL="",
|
||||||
|
string ETag = "",
|
||||||
|
DownloadStatus downloadStatus=NOT_PRESENT,
|
||||||
|
size_t totalSize = 0,
|
||||||
|
size_t currentSize = 0);
|
||||||
|
~DownloadRequest();
|
||||||
|
static bool NetworkIsAccessible();
|
||||||
|
|
||||||
|
string getTempLocalPath() const { return (mLocalPath+".tmp"); };
|
||||||
|
string getLocalPath() const { return mLocalPath; };
|
||||||
|
string getRemoteResource() const { return mRemoteResourceURL; };
|
||||||
|
string getETag() const { return mETag; };
|
||||||
|
void startGet();
|
||||||
|
void startHead();
|
||||||
|
DownloadStatus getDownloadStatus() const { return mDownloadStatus; };
|
||||||
|
bool upgradeAvailable() const { return mUpgradeAvailable; };
|
||||||
|
void getSizes(size_t& totalSize, size_t¤tSize) {
|
||||||
|
totalSize = mTotalSize;
|
||||||
|
currentSize = mCurrentSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
friend ostream& operator<<(ostream& out, const DownloadRequest& d);
|
||||||
|
friend istream& operator>>(istream&, DownloadRequest&);
|
||||||
|
friend class Downloader;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Downloader
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
Downloader(string globalRemoteURL="", string localCacheRecords="");
|
||||||
|
virtual ~Downloader();
|
||||||
|
static Downloader* mInstance;
|
||||||
|
string mGlobalRemoteURL;
|
||||||
|
string mLocalCacheRecords;
|
||||||
|
boost::mutex mMutex;
|
||||||
|
map<string, DownloadRequest*> mRequestMap;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Downloader* GetInstance();
|
||||||
|
static void Release();
|
||||||
|
|
||||||
|
void Update();
|
||||||
|
DownloadRequest* Get(string localPath, string remoteResourceURL="");
|
||||||
|
|
||||||
|
friend ostream& operator<<(ostream& out, const Downloader& d);
|
||||||
|
friend istream& operator>>(istream&, Downloader&);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DOWNLOADER_H
|
||||||
@@ -297,7 +297,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
float mTimer;
|
float mTimer;
|
||||||
float mFrameTime;
|
float mFrameTime;
|
||||||
JAnimator* mAnimator;
|
|
||||||
vector<JAnimatorObject *> mObjects;
|
vector<JAnimatorObject *> mObjects;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ private:
|
|||||||
float mTexY;
|
float mTexY;
|
||||||
float mTexWidth;
|
float mTexWidth;
|
||||||
float mTexHeight;
|
float mTexHeight;
|
||||||
JTexture* mTexture;
|
|
||||||
JQuad* mQuad;
|
JQuad* mQuad;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ public:
|
|||||||
bool readIntoString(const string & FilePath, string & target);
|
bool readIntoString(const string & FilePath, string & target);
|
||||||
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
|
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
|
||||||
bool Rename(string from, string to);
|
bool Rename(string from, string to);
|
||||||
|
bool Remove(string aFile);
|
||||||
|
|
||||||
//Returns true if strFilename exists somewhere in the fileSystem
|
//Returns true if strFilename exists somewhere in the fileSystem
|
||||||
bool FileExists(const string& strFilename);
|
bool FileExists(const string& strFilename);
|
||||||
|
|||||||
+125
-113
@@ -23,28 +23,32 @@
|
|||||||
#include "SLES/OpenSLES_Android.h"
|
#include "SLES/OpenSLES_Android.h"
|
||||||
|
|
||||||
#elif defined USE_PHONON
|
#elif defined USE_PHONON
|
||||||
#include <phonon/AudioOutput>
|
#include <phonon/AudioOutput>
|
||||||
#include <phonon/MediaObject>
|
#include <phonon/MediaObject>
|
||||||
|
#elif (defined QT_CONFIG)
|
||||||
|
#include "QMediaPlayer"
|
||||||
|
#include "QMediaPlaylist"
|
||||||
|
#include "QSoundEffect"
|
||||||
#elif defined WIN32
|
#elif defined WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define WITH_FMOD
|
#define WITH_FMOD
|
||||||
#elif defined (PSP)
|
#elif defined (PSP)
|
||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
#include <pspkernel.h>
|
#include <pspkernel.h>
|
||||||
#include <pspdisplay.h>
|
#include <pspdisplay.h>
|
||||||
#include <pspdebug.h>
|
#include <pspdebug.h>
|
||||||
#include <pspctrl.h>
|
#include <pspctrl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pspaudiolib.h>
|
#include <pspaudiolib.h>
|
||||||
#include <psprtc.h>
|
#include <psprtc.h>
|
||||||
|
|
||||||
#include "JAudio.h"
|
#include "JAudio.h"
|
||||||
#include "JMP3.h"
|
#include "JMP3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_FMOD
|
#ifdef WITH_FMOD
|
||||||
#include "../Dependencies/include/fmod.h"
|
#include "../Dependencies/include/fmod.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
@@ -67,7 +71,7 @@ public:
|
|||||||
#ifdef USE_PHONON
|
#ifdef USE_PHONON
|
||||||
Phonon::AudioOutput* mOutput;
|
Phonon::AudioOutput* mOutput;
|
||||||
Phonon::MediaObject* mMediaObject;
|
Phonon::MediaObject* mMediaObject;
|
||||||
public slots:
|
public slots:
|
||||||
void seekAtTheBegining();
|
void seekAtTheBegining();
|
||||||
#elif defined (PSP)
|
#elif defined (PSP)
|
||||||
JMP3* mTrack;
|
JMP3* mTrack;
|
||||||
@@ -82,6 +86,10 @@ public:
|
|||||||
SLPlayItf playInterface;
|
SLPlayItf playInterface;
|
||||||
SLSeekItf seekInterface;
|
SLSeekItf seekInterface;
|
||||||
SLVolumeItf musicVolumeInterface;
|
SLVolumeItf musicVolumeInterface;
|
||||||
|
#elif (defined QT_CONFIG)
|
||||||
|
QMediaPlaylist* playlist;
|
||||||
|
QMediaPlayer* player;
|
||||||
|
string fullpath;
|
||||||
#else
|
#else
|
||||||
void* mTrack;
|
void* mTrack;
|
||||||
#endif //WITH_FMOD
|
#endif //WITH_FMOD
|
||||||
@@ -92,13 +100,15 @@ public:
|
|||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
class JSample
|
class JSample
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JSample();
|
JSample();
|
||||||
~JSample();
|
~JSample();
|
||||||
|
|
||||||
unsigned long fileSize();
|
unsigned long fileSize();
|
||||||
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
#if defined (PSP)
|
QMediaPlayer* effect;
|
||||||
|
void* mSample;
|
||||||
|
#elif defined (PSP)
|
||||||
WAVDATA *mSample;
|
WAVDATA *mSample;
|
||||||
#elif defined (IOS)
|
#elif defined (IOS)
|
||||||
std::string filename;
|
std::string filename;
|
||||||
@@ -133,126 +143,128 @@ class JSoundSystem
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Get the singleton instance
|
/// Get the singleton instance
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
static JSoundSystem* GetInstance();
|
static JSoundSystem* GetInstance();
|
||||||
|
|
||||||
static void Destroy();
|
static void Destroy();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Load music.
|
/// Load music.
|
||||||
///
|
///
|
||||||
/// @note MP3 is the only supported format for the moment.
|
/// @note MP3 is the only supported format for the moment.
|
||||||
///
|
///
|
||||||
/// @param filename - Name of the music file.
|
/// @param filename - Name of the music file.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JMusic *LoadMusic(const char *fileName);
|
JMusic *LoadMusic(const char *fileName);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Delete music from memory.
|
/// Delete music from memory.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be deleted.
|
/// @param music - Music to be deleted.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//void FreeMusic(JMusic *music);
|
//void FreeMusic(JMusic *music);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Play music.
|
/// Play music.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be played.
|
/// @param music - Music to be played.
|
||||||
/// @param looping - Play the music in a loop.
|
/// @param looping - Play the music in a loop.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PlayMusic(JMusic *music, bool looping = false);
|
void PlayMusic(JMusic *music, bool looping = false);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Stop playing.
|
/// Stop playing.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be stopped.
|
/// @param music - Music to be stopped.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void StopMusic(JMusic *music);
|
void StopMusic(JMusic *music);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Resume playing.
|
/// Resume playing.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be resumed.
|
/// @param music - Music to be resumed.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void ResumeMusic(JMusic *music);
|
void ResumeMusic(JMusic *music);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Pause playing.
|
/// Pause playing.
|
||||||
///
|
///
|
||||||
/// @param music - Music to be paused.
|
/// @param music - Music to be paused.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PauseMusic(JMusic *music);
|
void PauseMusic(JMusic *music);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Load sound effect.
|
/// Load sound effect.
|
||||||
///
|
///
|
||||||
/// @note WAV sound effect only.
|
/// @note WAV sound effect only.
|
||||||
///
|
///
|
||||||
/// @param fileName - Sound effect for loading.
|
/// @param fileName - Sound effect for loading.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JSample *LoadSample(const char *fileName);
|
JSample *LoadSample(const char *fileName);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Delete sound effect from memory.
|
/// Delete sound effect from memory.
|
||||||
///
|
///
|
||||||
/// @param sample - Sound to be deleted.
|
/// @param sample - Sound to be deleted.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//void FreeSample(JSample *sample);
|
//void FreeSample(JSample *sample);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Play sound effect.
|
/// Play sound effect.
|
||||||
///
|
///
|
||||||
/// @param sample - Sound for playing.
|
/// @param sample - Sound for playing.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PlaySample(JSample *sample);
|
void PlaySample(JSample *sample);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Set volume for audio playback.
|
/// Set volume for audio playback.
|
||||||
///
|
///
|
||||||
/// @param volume - New volume.
|
/// @param volume - New volume.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void SetVolume(int volume);
|
void SetVolume(int volume);
|
||||||
|
|
||||||
void SetMusicVolume(int volume);
|
void SetMusicVolume(int volume);
|
||||||
|
|
||||||
void SetSfxVolume(int volume);
|
void SetSfxVolume(int volume);
|
||||||
|
|
||||||
int mChannel;
|
int mChannel;
|
||||||
protected:
|
protected:
|
||||||
JSoundSystem();
|
JSoundSystem();
|
||||||
~JSoundSystem();
|
~JSoundSystem();
|
||||||
|
|
||||||
void InitSoundSystem();
|
void InitSoundSystem();
|
||||||
void DestroySoundSystem();
|
void DestroySoundSystem();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#if (defined PSP || defined ANDROID)
|
||||||
JMusic *mCurrentMusic;
|
JMusic *mCurrentMusic;
|
||||||
JSample *mCurrentSample;
|
JSample *mCurrentSample;
|
||||||
|
#endif
|
||||||
|
|
||||||
int mVolume;
|
int mVolume;
|
||||||
int mMusicVolume;
|
int mMusicVolume;
|
||||||
int mSampleVolume;
|
int mSampleVolume;
|
||||||
|
|
||||||
|
|
||||||
static JSoundSystem* mInstance;
|
static JSoundSystem* mInstance;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+84
-10
@@ -1,7 +1,7 @@
|
|||||||
#ifndef THREADING_H
|
#ifndef THREADING_H
|
||||||
#define THREADING_H
|
#define THREADING_H
|
||||||
|
|
||||||
#if !defined(PSP) && !defined(QT_CONFIG)
|
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
|
||||||
#include <boost/date_time.hpp>
|
#include <boost/date_time.hpp>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#elif !defined(QT_CONFIG)
|
#elif defined(PSP)
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
@@ -212,13 +212,13 @@ namespace boost
|
|||||||
**
|
**
|
||||||
** The intent of its usage is this form only:
|
** The intent of its usage is this form only:
|
||||||
** mWorkerThread = boost::thread(ThreadProc, this);
|
** mWorkerThread = boost::thread(ThreadProc, this);
|
||||||
** where ThreadProc is a static member function of the 'this' class,eg:
|
** where ThreadProc is a static member function of the 'this' class,eg:
|
||||||
** static void FOO::ThreadProc(void* inParam)
|
** static void FOO::ThreadProc(void* inParam)
|
||||||
** {
|
** {
|
||||||
** FOO* instance = reinterpret_cast<FOO*>(inParam);
|
** FOO* instance = reinterpret_cast<FOO*>(inParam);
|
||||||
** // now you have class instance data available...
|
** // now you have class instance data available...
|
||||||
** }
|
** }
|
||||||
**
|
**
|
||||||
** Any other variant of a thread proc with more than one param is unimplemented.
|
** Any other variant of a thread proc with more than one param is unimplemented.
|
||||||
*/
|
*/
|
||||||
class thread
|
class thread
|
||||||
@@ -307,7 +307,7 @@ namespace boost
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(QT_CONFIG)
|
#elif defined(QT_CONFIG) && (__cplusplus <= 199711L)
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
@@ -537,6 +537,80 @@ namespace boost
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif (__cplusplus > 199711L)
|
||||||
|
|
||||||
|
#include <thread>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
typedef std::thread thread;
|
||||||
|
|
||||||
|
template <class Mutex>
|
||||||
|
struct unique_lock
|
||||||
|
{
|
||||||
|
unique_lock(Mutex& inMutex) : mMutex(&inMutex)
|
||||||
|
{
|
||||||
|
mMutex->lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
~unique_lock()
|
||||||
|
{
|
||||||
|
mMutex->unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
Mutex* mMutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
class mutex
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
typedef unique_lock<mutex> scoped_lock;
|
||||||
|
|
||||||
|
mutex()
|
||||||
|
: mQMutex()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~mutex()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void lock()
|
||||||
|
{
|
||||||
|
mQMutex.lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
void unlock()
|
||||||
|
{
|
||||||
|
mQMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::mutex mQMutex;
|
||||||
|
|
||||||
|
private:
|
||||||
|
mutex(mutex const&);
|
||||||
|
mutex& operator=(mutex const&);
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace posix_time
|
||||||
|
{
|
||||||
|
typedef unsigned int milliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** boost's platform neutral sleep call.
|
||||||
|
*/
|
||||||
|
namespace this_thread
|
||||||
|
{
|
||||||
|
inline void sleep(boost::posix_time::milliseconds const& time)
|
||||||
|
{
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(time));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // THREADING_H
|
#endif // THREADING_H
|
||||||
|
|||||||
@@ -136,6 +136,20 @@ signals:
|
|||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
int lastPosx(){
|
||||||
|
#if QT_VERSION >= 0x050100
|
||||||
|
return m_lastPos.x()*devicePixelRatio();
|
||||||
|
#else
|
||||||
|
return m_lastPos.x();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
int lastPosy(){
|
||||||
|
#if QT_VERSION >= 0x050100
|
||||||
|
return m_lastPos.y()*devicePixelRatio();
|
||||||
|
#else
|
||||||
|
return m_lastPos.y();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
void timerEvent( QTimerEvent* );
|
void timerEvent( QTimerEvent* );
|
||||||
void doAndEnqueue(JButton action) {
|
void doAndEnqueue(JButton action) {
|
||||||
m_engine->HoldKey_NoRepeat(action);
|
m_engine->HoldKey_NoRepeat(action);
|
||||||
@@ -154,6 +168,7 @@ private:
|
|||||||
int m_timerId;
|
int m_timerId;
|
||||||
bool m_active;
|
bool m_active;
|
||||||
QRect m_viewPort;
|
QRect m_viewPort;
|
||||||
|
QPoint m_lastPos;
|
||||||
#ifdef QT_WIDGET
|
#ifdef QT_WIDGET
|
||||||
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
|
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
|
||||||
int mMouseDownX;
|
int mMouseDownX;
|
||||||
|
|||||||
@@ -0,0 +1,298 @@
|
|||||||
|
#include "DebugRoutines.h"
|
||||||
|
#include "JFileSystem.h"
|
||||||
|
#include "Downloader.h"
|
||||||
|
|
||||||
|
#define RECORDS_DEFAULT_FILE "cache/records.txt"
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QNetworkAccessManager DownloadRequest::networkAccessManager;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DownloadRequest::DownloadRequest(string localPath,
|
||||||
|
string remoteResourceURL,
|
||||||
|
string ETag,
|
||||||
|
DownloadStatus downloadStatus,
|
||||||
|
size_t totalSize,
|
||||||
|
size_t currentSize):
|
||||||
|
mLocalPath(localPath),
|
||||||
|
mRemoteResourceURL(remoteResourceURL),
|
||||||
|
mRequestedRemoteResourceURL(remoteResourceURL),
|
||||||
|
mETag(ETag),
|
||||||
|
mDownloadStatus(downloadStatus),
|
||||||
|
mUpgradeAvailable(false),
|
||||||
|
mTotalSize(totalSize),
|
||||||
|
mCurrentSize(currentSize)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadRequest::~DownloadRequest()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::startHead()
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str())));
|
||||||
|
request.setRawHeader("If-None-Match", mETag.c_str());
|
||||||
|
mNetworkReply = networkAccessManager.head(request);
|
||||||
|
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::startGet()
|
||||||
|
{
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
mNetworkReply = networkAccessManager.get(QNetworkRequest(QUrl(QString(mRequestedRemoteResourceURL.c_str()))));
|
||||||
|
#endif
|
||||||
|
mFile.close();
|
||||||
|
JFileSystem::GetInstance()->Remove(getTempLocalPath());
|
||||||
|
JFileSystem::GetInstance()->openForWrite(mFile, getTempLocalPath());
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
connect(mNetworkReply, SIGNAL(downloadProgress(qint64, qint64)),
|
||||||
|
SLOT(downloadProgress(qint64, qint64)));
|
||||||
|
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::fileDownloaded()
|
||||||
|
{
|
||||||
|
do {
|
||||||
|
QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag");
|
||||||
|
if(!eTagByteArray.isEmpty()) {
|
||||||
|
string oldETag = mETag;
|
||||||
|
mETag = QString(eTagByteArray).toStdString();
|
||||||
|
if(oldETag!="" && oldETag != mETag)
|
||||||
|
mUpgradeAvailable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// let's check some error
|
||||||
|
if(mNetworkReply->error() != QNetworkReply::NoError) {
|
||||||
|
DebugTrace(mNetworkReply->errorString().toStdString());
|
||||||
|
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
|
||||||
|
mFile.close();
|
||||||
|
JFileSystem::GetInstance()->Remove(getTempLocalPath());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if we're getting redirected
|
||||||
|
QVariant redirectionTarget = mNetworkReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
|
||||||
|
if (!redirectionTarget.isNull()) {
|
||||||
|
QUrl newUrl = QUrl(mRequestedRemoteResourceURL.c_str()).resolved(redirectionTarget.toUrl());
|
||||||
|
DebugTrace(string("Redirect to ")+ newUrl.toString().toStdString());
|
||||||
|
|
||||||
|
mRequestedRemoteResourceURL = newUrl.toString().toStdString();
|
||||||
|
mNetworkReply->deleteLater();
|
||||||
|
if(mFile.is_open())
|
||||||
|
startGet();
|
||||||
|
else
|
||||||
|
startHead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mFile.is_open())
|
||||||
|
{
|
||||||
|
QByteArray byteArray = mNetworkReply->readAll();
|
||||||
|
mFile.write(byteArray.constData(), byteArray.size());
|
||||||
|
mFile.close();
|
||||||
|
if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) {
|
||||||
|
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mDownloadStatus = DownloadRequest::DOWNLOADED;
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
Downloader::GetInstance()->Update();
|
||||||
|
mNetworkReply->deleteLater();
|
||||||
|
|
||||||
|
emit statusChanged((int)mDownloadStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DownloadRequest::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
|
||||||
|
{
|
||||||
|
QByteArray byteArray = mNetworkReply->readAll();
|
||||||
|
mFile.write(byteArray.constData(), byteArray.size());
|
||||||
|
mCurrentSize = bytesReceived;
|
||||||
|
mTotalSize = bytesTotal;
|
||||||
|
int percent = 0;
|
||||||
|
if(bytesTotal)
|
||||||
|
percent = (bytesReceived/bytesTotal)*100;
|
||||||
|
emit percentChanged(percent);
|
||||||
|
}
|
||||||
|
|
||||||
|
Downloader* Downloader::mInstance = 0;
|
||||||
|
|
||||||
|
Downloader::Downloader(string globalRemoteURL, string localcacheRecords):
|
||||||
|
mGlobalRemoteURL(globalRemoteURL),
|
||||||
|
mLocalCacheRecords(localcacheRecords)
|
||||||
|
{
|
||||||
|
JFileSystem::GetInstance()->MakeDir("cache");
|
||||||
|
|
||||||
|
izfstream downloadRecords;
|
||||||
|
if(mLocalCacheRecords.empty())
|
||||||
|
mLocalCacheRecords = RECORDS_DEFAULT_FILE;
|
||||||
|
if(JFileSystem::GetInstance()->openForRead(downloadRecords, mLocalCacheRecords))
|
||||||
|
{// File exists, let's read it.
|
||||||
|
downloadRecords >> (*this);
|
||||||
|
}
|
||||||
|
JFileSystem::GetInstance()->CloseFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
Downloader::~Downloader()
|
||||||
|
{
|
||||||
|
map<string, DownloadRequest*>::iterator ite;
|
||||||
|
for(ite = mRequestMap.begin(); ite != mRequestMap.end(); ite++)
|
||||||
|
{
|
||||||
|
delete (*ite).second;
|
||||||
|
}
|
||||||
|
mRequestMap.erase(mRequestMap.begin(), mRequestMap.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
Downloader* Downloader::GetInstance()
|
||||||
|
{
|
||||||
|
if(!mInstance)
|
||||||
|
{
|
||||||
|
mInstance = new Downloader();
|
||||||
|
}
|
||||||
|
return mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Downloader::Release()
|
||||||
|
{
|
||||||
|
if(mInstance)
|
||||||
|
{
|
||||||
|
delete mInstance;
|
||||||
|
mInstance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DownloadRequest::NetworkIsAccessible()
|
||||||
|
{
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
networkAccessManager.setNetworkAccessible(QNetworkAccessManager::Accessible);
|
||||||
|
result = networkAccessManager.networkAccessible();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
DownloadRequest* Downloader::Get(string localPath, string remoteResourceURL)
|
||||||
|
{
|
||||||
|
map<string, DownloadRequest*>::iterator ite = mRequestMap.find(localPath);
|
||||||
|
if(ite == mRequestMap.end())
|
||||||
|
{ // request does not exist, let's create it
|
||||||
|
DownloadRequest* request = new DownloadRequest(localPath, remoteResourceURL);
|
||||||
|
std::pair<std::map<string,DownloadRequest*>::iterator,bool> ret;
|
||||||
|
ret = mRequestMap.insert ( std::pair<string,DownloadRequest*>(localPath, request) );
|
||||||
|
if (ret.second==false) {
|
||||||
|
DebugTrace("Downloader::Get Error inserting request in Map");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ite = ret.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now, we can check the server
|
||||||
|
if((*ite).second->getDownloadStatus() == DownloadRequest::NOT_PRESENT ||
|
||||||
|
(*ite).second->upgradeAvailable())
|
||||||
|
{ // File is not here or an update is available, let's get it
|
||||||
|
(*ite).second->startGet();
|
||||||
|
(*ite).second->mDownloadStatus = DownloadRequest::DOWNLOADING;
|
||||||
|
}
|
||||||
|
else if ((*ite).second->getDownloadStatus() == DownloadRequest::DOWNLOADED)
|
||||||
|
{ // File is here, let's check if there is some update without blocking the playback
|
||||||
|
(*ite).second->startHead();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (*ite).second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Downloader::Update()
|
||||||
|
{
|
||||||
|
ofstream downloadRecords;
|
||||||
|
if(JFileSystem::GetInstance()->openForWrite(downloadRecords, mLocalCacheRecords))
|
||||||
|
{
|
||||||
|
downloadRecords << (*this);
|
||||||
|
}
|
||||||
|
downloadRecords.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
ostream& operator<<(ostream& out, const DownloadRequest& d)
|
||||||
|
{
|
||||||
|
// HEAD request fails, so this line erase cache record after upgrade check :(
|
||||||
|
// if(d.getDownloadStatus() == DownloadRequest::DOWNLOADED)
|
||||||
|
{
|
||||||
|
out << "localPath=" << d.mLocalPath << endl;
|
||||||
|
out << "remoteResource=" << d.mRemoteResourceURL << endl;
|
||||||
|
out << "ETag=" << d.mETag << endl;
|
||||||
|
out << "upgradeAvailable=" << d.mUpgradeAvailable <<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
istream& operator>>(istream& in, DownloadRequest& d)
|
||||||
|
{
|
||||||
|
string s;
|
||||||
|
|
||||||
|
while(std::getline(in, s))
|
||||||
|
{
|
||||||
|
size_t limiter = s.find("=");
|
||||||
|
string areaS;
|
||||||
|
if (limiter != string::npos)
|
||||||
|
{
|
||||||
|
areaS = s.substr(0, limiter);
|
||||||
|
if (areaS.compare("localPath") == 0)
|
||||||
|
{
|
||||||
|
d.mLocalPath = s.substr(limiter + 1);
|
||||||
|
}
|
||||||
|
else if (areaS.compare("remoteResource") == 0)
|
||||||
|
{
|
||||||
|
d.mRemoteResourceURL = s.substr(limiter + 1);
|
||||||
|
d.mRequestedRemoteResourceURL = d.mRemoteResourceURL;
|
||||||
|
}
|
||||||
|
else if (areaS.compare("ETag") == 0)
|
||||||
|
{
|
||||||
|
d.mETag = s.substr(limiter + 1);
|
||||||
|
d.mDownloadStatus = DownloadRequest::DOWNLOADED;
|
||||||
|
}
|
||||||
|
else if (areaS.compare("upgradeAvailable") == 0)
|
||||||
|
{
|
||||||
|
d.mUpgradeAvailable = (bool)atoi(s.substr(limiter + 1).c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
ostream& operator<<(ostream& out, const Downloader& d)
|
||||||
|
{
|
||||||
|
map<string, DownloadRequest*>::const_iterator ite;
|
||||||
|
for(ite = d.mRequestMap.begin(); ite != d.mRequestMap.end(); ite++)
|
||||||
|
{
|
||||||
|
out << (*(*ite).second) << endl;
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
istream& operator>>(istream& in, Downloader& d)
|
||||||
|
{
|
||||||
|
while(!in.eof())
|
||||||
|
{
|
||||||
|
DownloadRequest* downloadRequest = new DownloadRequest();
|
||||||
|
in >> (*downloadRequest);
|
||||||
|
|
||||||
|
if(!downloadRequest->getLocalPath().empty() &&
|
||||||
|
!downloadRequest->getRemoteResource().empty() &&
|
||||||
|
!downloadRequest->getETag().empty()) {
|
||||||
|
d.mRequestMap[downloadRequest->getLocalPath()] = downloadRequest;
|
||||||
|
} else {
|
||||||
|
delete downloadRequest;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ bool JAnimator::Load(const char* scriptFile)
|
|||||||
element = script->ToElement();
|
element = script->ToElement();
|
||||||
printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name"));
|
printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name"));
|
||||||
|
|
||||||
const char *type[] =
|
string type[] =
|
||||||
{
|
{
|
||||||
"ANIMATION_TYPE_LOOPING",
|
"ANIMATION_TYPE_LOOPING",
|
||||||
"ANIMATION_TYPE_ONCE_AND_STAY",
|
"ANIMATION_TYPE_ONCE_AND_STAY",
|
||||||
@@ -78,7 +78,7 @@ bool JAnimator::Load(const char* scriptFile)
|
|||||||
|
|
||||||
const char* aniType = element->Attribute("type");
|
const char* aniType = element->Attribute("type");
|
||||||
for (int i=0;i<5;i++)
|
for (int i=0;i<5;i++)
|
||||||
if (strcmp(type[i], aniType)==0)
|
if (type[i] == aniType)
|
||||||
{
|
{
|
||||||
SetAnimationType(i);
|
SetAnimationType(i);
|
||||||
break;
|
break;
|
||||||
@@ -108,7 +108,7 @@ bool JAnimator::Load(const char* scriptFile)
|
|||||||
element = param->ToElement();
|
element = param->ToElement();
|
||||||
if (element != NULL)
|
if (element != NULL)
|
||||||
{
|
{
|
||||||
if (strcmp(element->Value(), "settings")==0)
|
if (element->ValueStr() == "settings")
|
||||||
{
|
{
|
||||||
const char* quadName = element->Attribute("quad");
|
const char* quadName = element->Attribute("quad");
|
||||||
JQuad* quad = mResource->GetQuad(quadName);
|
JQuad* quad = mResource->GetQuad(quadName);
|
||||||
|
|||||||
+12
-2
@@ -126,7 +126,7 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
|
|||||||
DebugTrace("User path " << userPath);
|
DebugTrace("User path " << userPath);
|
||||||
#elif defined (QT_CONFIG)
|
#elif defined (QT_CONFIG)
|
||||||
|
|
||||||
QDir sysDir("projects/mtg/bin/Res");
|
QDir sysDir(RESDIR);
|
||||||
QDir dir(QDir::homePath());
|
QDir dir(QDir::homePath());
|
||||||
dir.mkdir(USERDIR);
|
dir.mkdir(USERDIR);
|
||||||
dir.cd(USERDIR);
|
dir.cd(USERDIR);
|
||||||
@@ -313,11 +313,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
|
|||||||
|
|
||||||
int fileSize = GetFileSize(file);
|
int fileSize = GetFileSize(file);
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
try {
|
try {
|
||||||
|
#endif
|
||||||
target.resize((std::string::size_type) fileSize);
|
target.resize((std::string::size_type) fileSize);
|
||||||
|
#ifndef __MINGW32__
|
||||||
} catch (bad_alloc&) {
|
} catch (bad_alloc&) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (fileSize)
|
if (fileSize)
|
||||||
@@ -553,7 +557,13 @@ bool JFileSystem::Rename(string _from, string _to)
|
|||||||
string from = mUserFSPath + _from;
|
string from = mUserFSPath + _from;
|
||||||
string to = mUserFSPath + _to;
|
string to = mUserFSPath + _to;
|
||||||
std::remove(to.c_str());
|
std::remove(to.c_str());
|
||||||
return rename(from.c_str(), to.c_str()) ? true: false;
|
return (rename(from.c_str(), to.c_str()) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool JFileSystem::Remove(string aFile)
|
||||||
|
{
|
||||||
|
string toRemove = mUserFSPath + aFile;
|
||||||
|
return (std::remove(toRemove.c_str()) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int JFileSystem::GetFileSize(izfstream & file)
|
int JFileSystem::GetFileSize(izfstream & file)
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void JQuad::SetHotSpot(float x, float y)
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
JTexture::JTexture() : mBuffer(NULL)
|
JTexture::JTexture() : mWidth(0), mHeight(0), mBuffer(NULL)
|
||||||
{
|
{
|
||||||
mTexId = -1;
|
mTexId = -1;
|
||||||
}
|
}
|
||||||
@@ -305,14 +305,12 @@ void JRenderer::TransferTextureToGLContext(JTexture& inTexture)
|
|||||||
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
|
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
|
||||||
{
|
{
|
||||||
JTexture *tex = new JTexture();
|
JTexture *tex = new JTexture();
|
||||||
|
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureFormat)
|
JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureFormat)
|
||||||
{
|
{
|
||||||
JTexture *tex = new JTexture();
|
JTexture *tex = new JTexture();
|
||||||
|
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
|
|||||||
|
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
while (filePtr < size)
|
while (filePtr < size)
|
||||||
{
|
{
|
||||||
filePtr = ReadLine(tmpLine, buffer, filePtr, size);
|
filePtr = ReadLine(tmpLine, buffer, filePtr, size);
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3))
|
if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3))
|
||||||
{
|
{
|
||||||
@@ -89,16 +89,16 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
|
|||||||
|
|
||||||
if (count == 4)
|
if (count == 4)
|
||||||
{
|
{
|
||||||
if (strcmp(s1, "vn") == 0)
|
if (string("vn") == s1)
|
||||||
normalList.push_back(vert);
|
normalList.push_back(vert);
|
||||||
else if (strcmp(s1, "vt") == 0)
|
else if (string("vt") == s1)
|
||||||
texList.push_back(vert);
|
texList.push_back(vert);
|
||||||
else if (strcmp(s1, "v") == 0)
|
else if (string("v") == s1)
|
||||||
vertList.push_back(vert);
|
vertList.push_back(vert);
|
||||||
}
|
}
|
||||||
else if (count == 3)
|
else if (count == 3)
|
||||||
{
|
{
|
||||||
if (strcmp(s1, "vt") == 0)
|
if (string("vt") == s1)
|
||||||
texList.push_back(vert);
|
texList.push_back(vert);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
|
|||||||
if (textureName != NULL)
|
if (textureName != NULL)
|
||||||
mTexture = JRenderer::GetInstance()->LoadTexture(textureName);
|
mTexture = JRenderer::GetInstance()->LoadTexture(textureName);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-16
@@ -90,7 +90,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
// FIELD_COUNT
|
// FIELD_COUNT
|
||||||
// };
|
// };
|
||||||
|
|
||||||
const char* lifeValues[] =
|
const string lifeValues[] =
|
||||||
{
|
{
|
||||||
"speed",
|
"speed",
|
||||||
"size",
|
"size",
|
||||||
@@ -104,7 +104,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
"gravity"
|
"gravity"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* typeNames[] =
|
const string typeNames[] =
|
||||||
{
|
{
|
||||||
"POINT",
|
"POINT",
|
||||||
"AREA",
|
"AREA",
|
||||||
@@ -113,7 +113,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
"CIRCLE"
|
"CIRCLE"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* modeNames[] =
|
const string modeNames[] =
|
||||||
{
|
{
|
||||||
"REPEAT",
|
"REPEAT",
|
||||||
"ONCE",
|
"ONCE",
|
||||||
@@ -149,32 +149,32 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
{
|
{
|
||||||
element = param->ToElement();
|
element = param->ToElement();
|
||||||
|
|
||||||
if (strcmp(element->Attribute("name"), "settings")==0)
|
if (string("settings") == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(element->Attribute("blend"), "NORMAL")==0)
|
if (string("NORMAL") == element->Attribute("blend"))
|
||||||
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
||||||
else if (strcmp(element->Attribute("blend"), "ADDITIVE")==0)
|
else if (string("ADDITIVE") == element->Attribute("blend"))
|
||||||
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE);
|
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE);
|
||||||
|
|
||||||
for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++)
|
for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++)
|
||||||
{
|
{
|
||||||
if (strcmp(element->Attribute("mode"), modeNames[i])==0)
|
if (modeNames[i] == element->Attribute("mode"))
|
||||||
{
|
{
|
||||||
mParticleEmitters[mEmitterCount]->mEmitterMode = i;
|
mParticleEmitters[mEmitterCount]->mEmitterMode = i;
|
||||||
#if defined (_DEBUG)
|
#if defined (_DEBUG)
|
||||||
printf("emitter mode:%s\n", modeNames[i]);
|
printf("emitter mode:%s\n", modeNames[i].c_str());
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++)
|
for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++)
|
||||||
{
|
{
|
||||||
if (strcmp(element->Attribute("type"), typeNames[i])==0)
|
if (typeNames[i] == element->Attribute("type"))
|
||||||
{
|
{
|
||||||
mParticleEmitters[mEmitterCount]->mType = i;
|
mParticleEmitters[mEmitterCount]->mType = i;
|
||||||
#if defined (_DEBUG)
|
#if defined (_DEBUG)
|
||||||
printf("emitter type:%s\n", typeNames[i]);
|
printf("emitter type:%s\n", typeNames[i].c_str());
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Attribute("name"), "quantity")==0)
|
else if (string("quantity") == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
for (key = param->FirstChild(); key; key = key->NextSibling())
|
for (key = param->FirstChild(); key; key = key->NextSibling())
|
||||||
{
|
{
|
||||||
@@ -227,7 +227,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Attribute("name"), "lifex")==0)
|
else if (string("lifex") == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
||||||
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
||||||
@@ -236,7 +236,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
mParticleEmitters[mEmitterCount]->mLifeMax= value;
|
mParticleEmitters[mEmitterCount]->mLifeMax= value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Attribute("name"), "anglex")==0)
|
else if (string("anglex") == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
||||||
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
||||||
@@ -245,7 +245,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD;
|
mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Attribute("name"), "speedx")==0)
|
else if (string("speedx") == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
||||||
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
||||||
@@ -254,7 +254,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
mParticleEmitters[mEmitterCount]->mSpeedMax= value;
|
mParticleEmitters[mEmitterCount]->mSpeedMax= value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Attribute("name"), "sizex")==0)
|
else if (string("sizex") == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
|
||||||
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
|
||||||
@@ -267,7 +267,7 @@ bool JParticleEffect::Load(const char* filename)
|
|||||||
{
|
{
|
||||||
for (int i=0;i<FIELD_COUNT;i++)
|
for (int i=0;i<FIELD_COUNT;i++)
|
||||||
{
|
{
|
||||||
if (strcmp(element->Attribute("name"), lifeValues[i])==0)
|
if (lifeValues[i] == element->Attribute("name"))
|
||||||
{
|
{
|
||||||
for (key = param->FirstChild(); key; key = key->NextSibling())
|
for (key = param->FirstChild(); key; key = key->NextSibling())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -119,11 +119,11 @@ bool JResourceManager::LoadResource(const string& resourceName)
|
|||||||
element = node->ToElement();
|
element = node->ToElement();
|
||||||
if (element != NULL)
|
if (element != NULL)
|
||||||
{
|
{
|
||||||
if (strcmp(element->Value(), "texture")==0)
|
if (element->ValueStr() == "texture")
|
||||||
{
|
{
|
||||||
CreateTexture(element->Attribute("name"));
|
CreateTexture(element->Attribute("name"));
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Value(), "quad")==0)
|
else if (element->ValueStr() == "quad")
|
||||||
{
|
{
|
||||||
string quadName = element->Attribute("name");
|
string quadName = element->Attribute("name");
|
||||||
string textureName = element->Attribute("texture");
|
string textureName = element->Attribute("texture");
|
||||||
@@ -170,7 +170,7 @@ bool JResourceManager::LoadResource(const string& resourceName)
|
|||||||
GetQuad(id)->SetHotSpot(hotspotX, hotspotY);
|
GetQuad(id)->SetHotSpot(hotspotX, hotspotY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(element->Value(), "font")==0)
|
else if (element->ValueStr() == "font")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,9 +96,8 @@ int main(int argc, char* argv[])
|
|||||||
options.reloadProfile();
|
options.reloadProfile();
|
||||||
TestSuite testSuite("test/_tests.txt");
|
TestSuite testSuite("test/_tests.txt");
|
||||||
result = testSuite.run();
|
result = testSuite.run();
|
||||||
int totalTests = testSuite.nbTests + testSuite.nbAITests;
|
|
||||||
delete wagicCore;
|
delete wagicCore;
|
||||||
DebugTrace("TestSuite done: failed test: " << result << " out of " << totalTests << " total");
|
DebugTrace("TestSuite done: failed test: " << result << " out of " << testSuite.nbTests + testSuite.nbAITests << " total");
|
||||||
#ifdef CAPTURE_STDERR
|
#ifdef CAPTURE_STDERR
|
||||||
OutputCapturer::debugAndClear();
|
OutputCapturer::debugAndClear();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+18
-11
@@ -9,11 +9,11 @@
|
|||||||
#include <QtDeclarative>
|
#include <QtDeclarative>
|
||||||
#include "qmlapplicationviewer.h"
|
#include "qmlapplicationviewer.h"
|
||||||
#endif //QT_WIDGET
|
#endif //QT_WIDGET
|
||||||
#include "filedownloader.h"
|
#include "Downloader.h"
|
||||||
#include "GameApp.h"
|
#include "GameApp.h"
|
||||||
#include "corewrapper.h"
|
#include "corewrapper.h"
|
||||||
|
|
||||||
QWidget* g_glwidget = NULL;
|
WagicCore* g_glwidget = NULL;
|
||||||
|
|
||||||
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
|
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
|
||||||
{
|
{
|
||||||
@@ -69,18 +69,25 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
#endif //QT_WIDGET
|
#endif //QT_WIDGET
|
||||||
|
|
||||||
if(argc >= 2 && strcmp(argv[1], "testsuite")==0)
|
|
||||||
{
|
|
||||||
int result = 0;
|
|
||||||
result += WagicCore::runTestSuite();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
app->setApplicationName(WagicCore::getApplicationName());
|
app->setApplicationName(WagicCore::getApplicationName());
|
||||||
FileDownloader fileDownloader(USERDIR, WAGIC_RESOURCE_NAME);
|
DownloadRequest* downloadRequest = NULL;
|
||||||
|
#ifdef WAGIC_RESOURCE_URL
|
||||||
|
Downloader*downloader = Downloader::GetInstance();
|
||||||
|
downloadRequest = downloader->Get(
|
||||||
|
"core.zip",
|
||||||
|
WAGIC_RESOURCE_URL
|
||||||
|
);
|
||||||
|
#endif
|
||||||
#ifdef QT_WIDGET
|
#ifdef QT_WIDGET
|
||||||
g_glwidget = new WagicCore();
|
g_glwidget = new WagicCore();
|
||||||
g_glwidget->connect(&fileDownloader, SIGNAL(finished(int)), SLOT(start(int)));
|
if(!downloadRequest || downloadRequest->getDownloadStatus() == DownloadRequest::DOWNLOADED)
|
||||||
|
{
|
||||||
|
g_glwidget->start(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_glwidget->connect(downloadRequest, SIGNAL(statusChanged(int)), SLOT(start(int)));
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore");
|
qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore");
|
||||||
|
|
||||||
|
|||||||
+14
-1
@@ -78,7 +78,20 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume(
|
|||||||
{
|
{
|
||||||
if (!g_engine)
|
if (!g_engine)
|
||||||
return;
|
return;
|
||||||
g_engine->Resume();
|
g_engine->Resume();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "Wagic_Version.h"
|
||||||
|
extern "C" jstring Java_org_libsdl_app_SDLActivity_getResourceName(
|
||||||
|
JNIEnv* env, jclass cls)
|
||||||
|
{
|
||||||
|
return env->NewStringUTF (WAGIC_RESOURCE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" jstring Java_org_libsdl_app_SDLActivity_getResourceUrl(
|
||||||
|
JNIEnv* env, jclass cls)
|
||||||
|
{
|
||||||
|
return env->NewStringUTF (WAGIC_RESOURCE_URL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -343,7 +343,7 @@ void JQuad::SetHotSpot(float x, float y)
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
JTexture::JTexture() : mBuffer(NULL)
|
JTexture::JTexture() : mWidth(0), mHeight(0), mBuffer(NULL)
|
||||||
{
|
{
|
||||||
mTexId = -1;
|
mTexId = -1;
|
||||||
}
|
}
|
||||||
@@ -2486,7 +2486,7 @@ void JRenderer::Enable2D()
|
|||||||
#if (defined GL_VERSION_ES_CM_1_1) || (defined GL_OES_VERSION_1_1)
|
#if (defined GL_VERSION_ES_CM_1_1) || (defined GL_OES_VERSION_1_1)
|
||||||
glOrthof(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
|
glOrthof(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
|
||||||
#else
|
#else
|
||||||
gluOrtho2D(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f);
|
glOrtho(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
|
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
|
||||||
|
|||||||
+125
-77
@@ -22,6 +22,8 @@
|
|||||||
JMusic::JMusic()
|
JMusic::JMusic()
|
||||||
#ifdef USE_PHONON
|
#ifdef USE_PHONON
|
||||||
: mOutput(0), mMediaObject(0)
|
: mOutput(0), mMediaObject(0)
|
||||||
|
#elif defined QT_CONFIG
|
||||||
|
: playlist(0), player(0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -40,11 +42,16 @@ int JMusic::getPlayTime(){
|
|||||||
|
|
||||||
JMusic::~JMusic()
|
JMusic::~JMusic()
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if defined USE_PHONON
|
||||||
if(mOutput)
|
if(mOutput)
|
||||||
delete mOutput;
|
delete mOutput;
|
||||||
if(mMediaObject)
|
if(mMediaObject)
|
||||||
delete mMediaObject;
|
delete mMediaObject;
|
||||||
|
#elif defined QT_CONFIG
|
||||||
|
if(player)
|
||||||
|
delete player;
|
||||||
|
if(playlist)
|
||||||
|
delete playlist;
|
||||||
#elif defined WITH_FMOD
|
#elif defined WITH_FMOD
|
||||||
JSoundSystem::GetInstance()->StopMusic(this);
|
JSoundSystem::GetInstance()->StopMusic(this);
|
||||||
if (mTrack) FSOUND_Sample_Free(mTrack);
|
if (mTrack) FSOUND_Sample_Free(mTrack);
|
||||||
@@ -69,7 +76,10 @@ JSample::JSample()
|
|||||||
|
|
||||||
JSample::~JSample()
|
JSample::~JSample()
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
|
if(effect)
|
||||||
|
delete effect;
|
||||||
|
#elif USE_PHONON
|
||||||
if(mOutput)
|
if(mOutput)
|
||||||
delete mOutput;
|
delete mOutput;
|
||||||
if(mMediaObject)
|
if(mMediaObject)
|
||||||
@@ -144,65 +154,84 @@ void JSoundSystem::DestroySoundSystem()
|
|||||||
|
|
||||||
JMusic *JSoundSystem::LoadMusic(const char *fileName)
|
JMusic *JSoundSystem::LoadMusic(const char *fileName)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
JMusic* music = NULL;
|
||||||
JMusic* music = new JMusic();
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if (music)
|
music = new JMusic();
|
||||||
{
|
if (music)
|
||||||
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
|
||||||
music->mMediaObject = new Phonon::MediaObject(0);
|
|
||||||
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
|
||||||
music->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
|
||||||
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
|
|
||||||
Q_ASSERT(mediapath.isValid());
|
|
||||||
}
|
|
||||||
return music;
|
|
||||||
#elif (defined WITH_FMOD)
|
|
||||||
JMusic* music = new JMusic();
|
|
||||||
if (music)
|
|
||||||
{
|
{
|
||||||
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
music->player = new QMediaPlayer;
|
||||||
if (fileSystem->OpenFile(fileName))
|
music->player->setVolume(100);
|
||||||
{
|
music->playlist = new QMediaPlaylist;
|
||||||
int size = fileSystem->GetFileSize();
|
music->fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
char *buffer = new char[size];
|
music->playlist->addMedia(QUrl::fromLocalFile(music->fullpath.c_str()));
|
||||||
fileSystem->ReadFile(buffer, size);
|
music->playlist->setCurrentIndex(0);
|
||||||
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
}
|
||||||
|
#elif defined USE_PHONON
|
||||||
delete[] buffer;
|
music = new JMusic();
|
||||||
fileSystem->CloseFile();
|
if (music)
|
||||||
}
|
{
|
||||||
|
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
||||||
|
music->mMediaObject = new Phonon::MediaObject(0);
|
||||||
|
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
|
music->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
||||||
|
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
|
||||||
|
Q_ASSERT(mediapath.isValid());
|
||||||
|
}
|
||||||
|
#elif (defined WITH_FMOD)
|
||||||
|
music = new JMusic();
|
||||||
|
if (music)
|
||||||
|
{
|
||||||
|
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
||||||
|
if (fileSystem->OpenFile(fileName))
|
||||||
|
{
|
||||||
|
int size = fileSystem->GetFileSize();
|
||||||
|
char *buffer = new char[size];
|
||||||
|
fileSystem->ReadFile(buffer, size);
|
||||||
|
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
||||||
|
|
||||||
|
delete[] buffer;
|
||||||
|
fileSystem->CloseFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return music;
|
|
||||||
#else
|
#else
|
||||||
cerr << fileName << endl;
|
cerr << fileName << endl;
|
||||||
return NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
return music;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if (music && music->mMediaObject && music->mOutput)
|
if(music && music->player && music->playlist)
|
||||||
{
|
|
||||||
if(looping)
|
|
||||||
{
|
{
|
||||||
music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining()));
|
if(looping)
|
||||||
|
music->playlist->setPlaybackMode(QMediaPlaylist::Loop);
|
||||||
|
|
||||||
|
music->player->setPlaylist(music->playlist);
|
||||||
|
music->player->play();
|
||||||
}
|
}
|
||||||
music->mOutput->setVolume((qreal)mVolume*0.01);
|
#elif USE_PHONON
|
||||||
music->mMediaObject->play();
|
if (music && music->mMediaObject && music->mOutput)
|
||||||
|
|
||||||
}
|
|
||||||
#elif (defined WITH_FMOD)
|
|
||||||
if (music && music->mTrack)
|
|
||||||
{
|
{
|
||||||
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
|
if(looping)
|
||||||
SetMusicVolume(mVolume);
|
{
|
||||||
|
music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining()));
|
||||||
|
}
|
||||||
|
music->mOutput->setVolume((qreal)mVolume*0.01);
|
||||||
|
music->mMediaObject->play();
|
||||||
|
|
||||||
if (looping)
|
}
|
||||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL);
|
#elif (defined WITH_FMOD)
|
||||||
else
|
if (music && music->mTrack)
|
||||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
|
{
|
||||||
|
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
|
||||||
|
SetMusicVolume(mVolume);
|
||||||
|
|
||||||
|
if (looping)
|
||||||
|
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL);
|
||||||
|
else
|
||||||
|
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
music = 0;
|
music = 0;
|
||||||
@@ -213,7 +242,12 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
|||||||
|
|
||||||
void JSoundSystem::StopMusic(JMusic *music)
|
void JSoundSystem::StopMusic(JMusic *music)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
|
if (music && music->player && music->playlist)
|
||||||
|
{
|
||||||
|
music->player->stop();
|
||||||
|
}
|
||||||
|
#elif defined USE_PHONON
|
||||||
if (music && music->mMediaObject && music->mOutput)
|
if (music && music->mMediaObject && music->mOutput)
|
||||||
{
|
{
|
||||||
music->mMediaObject->stop();
|
music->mMediaObject->stop();
|
||||||
@@ -264,47 +298,61 @@ void JSoundSystem::SetSfxVolume(int volume){
|
|||||||
|
|
||||||
JSample *JSoundSystem::LoadSample(const char *fileName)
|
JSample *JSoundSystem::LoadSample(const char *fileName)
|
||||||
{
|
{
|
||||||
#if (defined USE_PHONON)
|
JSample* sample = NULL;
|
||||||
JSample* sample = new JSample();
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if (sample)
|
sample = new JSample();
|
||||||
{
|
if (sample)
|
||||||
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
|
||||||
sample->mMediaObject = new Phonon::MediaObject(0);
|
|
||||||
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
|
||||||
sample->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
|
||||||
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
|
|
||||||
Q_ASSERT(mediapath.isValid());
|
|
||||||
}
|
|
||||||
return sample;
|
|
||||||
#elif (defined WITH_FMOD)
|
|
||||||
JSample* sample = new JSample();
|
|
||||||
if (sample)
|
|
||||||
{
|
{
|
||||||
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
if (fileSystem->OpenFile(fileName))
|
sample->effect = new QMediaPlayer;
|
||||||
{
|
sample->effect->setMedia(QUrl::fromLocalFile(fullpath.c_str()));
|
||||||
int size = fileSystem->GetFileSize();
|
sample->effect->setVolume(100);
|
||||||
char *buffer = new char[size];
|
sample->mSample = &(sample->effect);
|
||||||
fileSystem->ReadFile(buffer, size);
|
}
|
||||||
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
#elif (defined USE_PHONON)
|
||||||
|
sample = new JSample();
|
||||||
|
if (sample)
|
||||||
|
{
|
||||||
|
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
|
||||||
|
sample->mMediaObject = new Phonon::MediaObject(0);
|
||||||
|
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||||
|
sample->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
|
||||||
|
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
|
||||||
|
Q_ASSERT(mediapath.isValid());
|
||||||
|
}
|
||||||
|
#elif (defined WITH_FMOD)
|
||||||
|
sample = new JSample();
|
||||||
|
if (sample)
|
||||||
|
{
|
||||||
|
JFileSystem* fileSystem = JFileSystem::GetInstance();
|
||||||
|
if (fileSystem->OpenFile(fileName))
|
||||||
|
{
|
||||||
|
int size = fileSystem->GetFileSize();
|
||||||
|
char *buffer = new char[size];
|
||||||
|
fileSystem->ReadFile(buffer, size);
|
||||||
|
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
|
||||||
|
|
||||||
delete[] buffer;
|
delete[] buffer;
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
}else
|
}else
|
||||||
sample->mSample = NULL;
|
sample->mSample = NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
return sample;
|
|
||||||
#else
|
#else
|
||||||
cerr << fileName << endl;
|
cerr << fileName << endl;
|
||||||
return NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
return sample;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSoundSystem::PlaySample(JSample *sample)
|
void JSoundSystem::PlaySample(JSample *sample)
|
||||||
{
|
{
|
||||||
#ifdef USE_PHONON
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
|
if(sample)
|
||||||
|
{
|
||||||
|
sample->effect->play();
|
||||||
|
}
|
||||||
|
#elif defined USE_PHONON
|
||||||
if (sample && sample->mMediaObject && sample->mOutput)
|
if (sample && sample->mMediaObject && sample->mOutput)
|
||||||
{
|
{
|
||||||
sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
|
sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
|
||||||
|
|||||||
+29
-29
@@ -335,7 +335,7 @@ void WagicCore::resizeGL(int width, int height)
|
|||||||
#if (defined GL_VERSION_ES_CM_1_1 || defined GL_OES_VERSION_1_1)
|
#if (defined GL_VERSION_ES_CM_1_1 || defined GL_OES_VERSION_1_1)
|
||||||
glOrthof(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
|
glOrthof(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
|
||||||
#else
|
#else
|
||||||
gluOrtho2D(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f);
|
glOrtho(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
|
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
|
||||||
@@ -418,29 +418,29 @@ void WagicCore::mousePressEvent(QMouseEvent *event)
|
|||||||
{
|
{
|
||||||
if(event->button() == Qt::LeftButton)
|
if(event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
QPoint lastPos = event->pos();
|
m_lastPos = event->pos();
|
||||||
// this is intended to convert window coordinate into game coordinate.
|
// this is intended to convert window coordinate into game coordinate.
|
||||||
// this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
|
// this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
|
||||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||||
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
||||||
|
|
||||||
if (lastPos.y() >= m_viewPort.top() &&
|
if (lastPosy() >= m_viewPort.top() &&
|
||||||
lastPos.y() <= m_viewPort.bottom() &&
|
lastPosy() <= m_viewPort.bottom() &&
|
||||||
lastPos.x() <= m_viewPort.right() &&
|
lastPosx() <= m_viewPort.right() &&
|
||||||
lastPos.x() >= m_viewPort.left()) {
|
lastPosx() >= m_viewPort.left()) {
|
||||||
m_engine->LeftClicked(
|
m_engine->LeftClicked(
|
||||||
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
||||||
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
||||||
#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID)
|
#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID)
|
||||||
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
||||||
#else
|
#else
|
||||||
mMouseDownX = lastPos.x();
|
mMouseDownX = lastPosx();
|
||||||
mMouseDownY = lastPos.y();
|
mMouseDownY = lastPosy();
|
||||||
mLastFingerDownTime = g_startTimer.elapsed();
|
mLastFingerDownTime = g_startTimer.elapsed();
|
||||||
#endif
|
#endif
|
||||||
} else if(lastPos.y()<m_viewPort.top()) {
|
} else if(lastPosy()<m_viewPort.top()) {
|
||||||
m_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
|
m_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
|
||||||
} else if(lastPos.y()>m_viewPort.bottom()) {
|
} else if(lastPosy()>m_viewPort.bottom()) {
|
||||||
m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
|
m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
|
||||||
}
|
}
|
||||||
event->accept();
|
event->accept();
|
||||||
@@ -465,33 +465,33 @@ void WagicCore::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
{
|
{
|
||||||
if(event->button() == Qt::LeftButton)
|
if(event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
QPoint lastPos = event->pos();
|
m_lastPos = event->pos();
|
||||||
|
|
||||||
if (lastPos.y() >= m_viewPort.top() &&
|
if (lastPosy() >= m_viewPort.top() &&
|
||||||
lastPos.y() <= m_viewPort.bottom() &&
|
lastPosy() <= m_viewPort.bottom() &&
|
||||||
lastPos.x() <= m_viewPort.right() &&
|
lastPosx() <= m_viewPort.right() &&
|
||||||
lastPos.x() >= m_viewPort.left()) {
|
lastPosx() >= m_viewPort.left()) {
|
||||||
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
|
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
|
||||||
if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout )
|
if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout )
|
||||||
{
|
{
|
||||||
if(abs(mMouseDownX - lastPos.x()) < kHitzonePliancy &&
|
if(abs(mMouseDownX - lastPosx()) < kHitzonePliancy &&
|
||||||
abs(mMouseDownY - lastPos.y()) < kHitzonePliancy)
|
abs(mMouseDownY - lastPosy()) < kHitzonePliancy)
|
||||||
{
|
{
|
||||||
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration)
|
else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration)
|
||||||
{ // Let's swipe
|
{ // Let's swipe
|
||||||
m_engine->Scroll(lastPos.x()-mMouseDownX, lastPos.y()-mMouseDownY);
|
m_engine->Scroll(lastPosx()-mMouseDownX, lastPosy()-mMouseDownY);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
//#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN)
|
//#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN)
|
||||||
m_engine->ReleaseKey(JGE_BTN_OK);
|
m_engine->ReleaseKey(JGE_BTN_OK);
|
||||||
#endif
|
#endif
|
||||||
m_engine->ReleaseKey(JGE_BTN_MENU);
|
m_engine->ReleaseKey(JGE_BTN_MENU);
|
||||||
} else if(lastPos.y() < m_viewPort.top()) {
|
} else if(lastPosy() < m_viewPort.top()) {
|
||||||
m_engine->ReleaseKey(JGE_BTN_MENU);
|
m_engine->ReleaseKey(JGE_BTN_MENU);
|
||||||
} else if(lastPos.y() > m_viewPort.bottom()) {
|
} else if(lastPosy() > m_viewPort.bottom()) {
|
||||||
m_engine->ReleaseKey(JGE_BTN_NEXT);
|
m_engine->ReleaseKey(JGE_BTN_NEXT);
|
||||||
}
|
}
|
||||||
event->accept();
|
event->accept();
|
||||||
@@ -517,15 +517,15 @@ void WagicCore::mouseMoveEvent(QMouseEvent *event)
|
|||||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||||
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
||||||
|
|
||||||
QPoint lastPos = event->pos();
|
m_lastPos = event->pos();
|
||||||
|
|
||||||
if (lastPos.y() >= m_viewPort.top() &&
|
if (lastPosy() >= m_viewPort.top() &&
|
||||||
lastPos.y() <= m_viewPort.bottom() &&
|
lastPosy() <= m_viewPort.bottom() &&
|
||||||
lastPos.x() <= m_viewPort.right() &&
|
lastPosx() <= m_viewPort.right() &&
|
||||||
lastPos.x() >= m_viewPort.left()) {
|
lastPosx() >= m_viewPort.left()) {
|
||||||
m_engine->LeftClicked(
|
m_engine->LeftClicked(
|
||||||
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
||||||
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
||||||
event->accept();
|
event->accept();
|
||||||
} else {
|
} else {
|
||||||
super::mouseMoveEvent(event);
|
super::mouseMoveEvent(event);
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ public:
|
|||||||
virtual int overflow(int c = EOF);
|
virtual int overflow(int c = EOF);
|
||||||
virtual int underflow();
|
virtual int underflow();
|
||||||
virtual int sync();
|
virtual int sync();
|
||||||
|
using std::streambuf::setbuf;
|
||||||
virtual std::streambuf * setbuf(char * pr, int nLength);
|
virtual std::streambuf * setbuf(char * pr, int nLength);
|
||||||
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
|
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
|
||||||
|
|
||||||
@@ -131,6 +132,7 @@ public:
|
|||||||
virtual int overflow(int c = EOF);
|
virtual int overflow(int c = EOF);
|
||||||
virtual int underflow();
|
virtual int underflow();
|
||||||
virtual int sync();
|
virtual int sync();
|
||||||
|
using std::streambuf::setbuf;
|
||||||
virtual std::streambuf * setbuf(char * pr, int nLength);
|
virtual std::streambuf * setbuf(char * pr, int nLength);
|
||||||
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
|
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
[](https://travis-ci.org/WagicProject/wagic)
|
[](https://travis-ci.org/WagicProject/wagic)
|
||||||
|
[](https://ci.appveyor.com/project/xawotihs/wagic/branch/master)
|
||||||
|
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -16,6 +18,11 @@ Wagic, the Homebrew, is a C++ game engine that allows to play card games against
|
|||||||
It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc...
|
It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc...
|
||||||
|
|
||||||
|
|
||||||
Info, Downloads, and more at http://wololo.net
|
Info, downloads, discussions and more at http://wololo.net/forum/index.php
|
||||||
|
|
||||||
-
|
-
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Sample round play-through video
|
||||||
|
[](http://www.youtube.com/watch?v=WUFSAPZuDIk)
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Notes:
|
||||||
|
# - Minimal appveyor.yml file is an empty file. All sections are optional.
|
||||||
|
# - Indent each level of configuration with 2 spaces. Do not use tabs!
|
||||||
|
# - All section names are case-sensitive.
|
||||||
|
# - Section names should be unique on each level.
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# environment configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
environment:
|
||||||
|
GH_TOKEN:
|
||||||
|
secure: dYnBDQkiY5oVjIlswzBX9BJigNtBGXgGlp1tK3XbHzrDEDrs2vaKD5m+Oz5OSz1C
|
||||||
|
|
||||||
|
# scripts that run after cloning repository
|
||||||
|
install:
|
||||||
|
- ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
|
||||||
|
- "C:/Python27/python.exe C:/get-pip.py"
|
||||||
|
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
|
||||||
|
- "C:/Python27/Scripts/pip.exe install github3.py"
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# build configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# build Configuration, i.e. Debug, Release, etc.
|
||||||
|
configuration: Release
|
||||||
|
|
||||||
|
build:
|
||||||
|
project: projects/mtg/mtg_vs2010.sln # path to Visual Studio solution or project
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# tests configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# to disable automatic tests
|
||||||
|
test: off
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# artifacts configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
# pushing windows package
|
||||||
|
- path: projects\mtg\bin\Wagic-windows*.zip
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# deployment configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# scripts to run before deployment
|
||||||
|
before_deploy:
|
||||||
|
- cd projects/mtg/bin
|
||||||
|
- "C:/Python27/python.exe createWindowsZip.py"
|
||||||
|
- cd ../../..
|
||||||
|
|
||||||
|
# scripts to run after deployment
|
||||||
|
after_deploy:
|
||||||
|
|
||||||
|
# to run your custom scripts instead of provider deployments
|
||||||
|
deploy_script:
|
||||||
|
- "C:/Python27/python.exe upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%"
|
||||||
|
|
||||||
|
# to disable deployment
|
||||||
|
#deploy: off
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ PNG_PATH := $(JGE_PATH)/Dependencies/libpng
|
|||||||
DEBUG ?= DEBUG
|
DEBUG ?= DEBUG
|
||||||
|
|
||||||
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG -D_$(DEBUG)
|
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG -D_$(DEBUG)
|
||||||
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC
|
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC -DTIXML_USE_STL
|
||||||
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
|
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
|
||||||
LOCAL_STATIC_LIBRARIES := libpng libjpeg
|
LOCAL_STATIC_LIBRARIES := libpng libjpeg
|
||||||
LOCAL_SHARED_LIBRARIES := SDL
|
LOCAL_SHARED_LIBRARIES := SDL
|
||||||
@@ -57,7 +57,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
|
|||||||
$(MTG_PATH)/src/DeckMetaData.cpp \
|
$(MTG_PATH)/src/DeckMetaData.cpp \
|
||||||
$(MTG_PATH)/src/DeckStats.cpp \
|
$(MTG_PATH)/src/DeckStats.cpp \
|
||||||
$(MTG_PATH)/src/DuelLayers.cpp \
|
$(MTG_PATH)/src/DuelLayers.cpp \
|
||||||
$(MTG_PATH)/src/Effects.cpp \
|
|
||||||
$(MTG_PATH)/src/ExtraCost.cpp \
|
$(MTG_PATH)/src/ExtraCost.cpp \
|
||||||
$(MTG_PATH)/src/GameApp.cpp \
|
$(MTG_PATH)/src/GameApp.cpp \
|
||||||
$(MTG_PATH)/src/GameLauncher.cpp \
|
$(MTG_PATH)/src/GameLauncher.cpp \
|
||||||
@@ -136,6 +135,9 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
|
|||||||
$(MTG_PATH)/src/WFont.cpp \
|
$(MTG_PATH)/src/WFont.cpp \
|
||||||
$(MTG_PATH)/src/WGui.cpp \
|
$(MTG_PATH)/src/WGui.cpp \
|
||||||
$(MTG_PATH)/src/WResourceManager.cpp \
|
$(MTG_PATH)/src/WResourceManager.cpp \
|
||||||
|
$(MTG_PATH)/src/DeckView.cpp \
|
||||||
|
$(MTG_PATH)/src/CarouselDeckView.cpp \
|
||||||
|
$(MTG_PATH)/src/GridDeckView.cpp \
|
||||||
$(JGE_PATH)/src/SDLmain.cpp \
|
$(JGE_PATH)/src/SDLmain.cpp \
|
||||||
$(JGE_PATH)/src/Encoding.cpp \
|
$(JGE_PATH)/src/Encoding.cpp \
|
||||||
$(JGE_PATH)/src/JAnimator.cpp \
|
$(JGE_PATH)/src/JAnimator.cpp \
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
public Boolean mErrorHappened = false;
|
public Boolean mErrorHappened = false;
|
||||||
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||||
public static String RES_FILENAME = "core_0184.zip";
|
public static String RES_FILENAME = "core_0184.zip";
|
||||||
public static final String RES_URL = "http://wagic.googlecode.com/files/";
|
|
||||||
|
|
||||||
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||||
private String userFolder;
|
private String userFolder;
|
||||||
@@ -307,7 +306,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
private void startDownload()
|
private void startDownload()
|
||||||
{
|
{
|
||||||
String url = RES_URL + RES_FILENAME;
|
String url = getResourceUrl();
|
||||||
if (!checkStorageState())
|
if (!checkStorageState())
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Error in initializing storage space.");
|
Log.e(TAG, "Error in initializing storage space.");
|
||||||
@@ -437,7 +436,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
mContext = this.getApplicationContext();
|
mContext = this.getApplicationContext();
|
||||||
// get the current version of the app to set the core filename
|
// get the current version of the app to set the core filename
|
||||||
String versionCodeString = getApplicationCode();
|
String versionCodeString = getApplicationCode();
|
||||||
RES_FILENAME = "core_" + versionCodeString + ".zip";
|
RES_FILENAME = getResourceName();
|
||||||
|
|
||||||
StorageOptions.determineStorageOptions();
|
StorageOptions.determineStorageOptions();
|
||||||
checkStorageLocationPreference();
|
checkStorageLocationPreference();
|
||||||
@@ -525,6 +524,9 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
// C functions we call
|
// C functions we call
|
||||||
|
public static native String getResourceUrl();
|
||||||
|
public static native String getResourceName();
|
||||||
|
|
||||||
public static native void nativeInit();
|
public static native void nativeInit();
|
||||||
|
|
||||||
public static native void nativeQuit();
|
public static native void nativeQuit();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
|
|||||||
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
|
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
|
||||||
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
|
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
|
||||||
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
|
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
|
||||||
objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
|
objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
|
||||||
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
|
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
|
||||||
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
|
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
|
||||||
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
|
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
|
||||||
@@ -27,7 +27,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
|
|||||||
objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o\
|
objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o\
|
||||||
objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o\
|
objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o\
|
||||||
objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\
|
objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\
|
||||||
objs/WFont.o
|
objs/WFont.o objs/CarouselDeckView.o objs/GridDeckView.o objs/DeckView.o
|
||||||
DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS))
|
DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS))
|
||||||
|
|
||||||
RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache)
|
RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache)
|
||||||
@@ -73,7 +73,7 @@ PSP_EBOOT_UNKPNG = pic0.png
|
|||||||
PSP_EBOOT_PIC1 = pic1.png
|
PSP_EBOOT_PIC1 = pic1.png
|
||||||
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
|
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
|
||||||
LIBDIR = ../../JGE/lib/psp
|
LIBDIR = ../../JGE/lib/psp
|
||||||
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP
|
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL
|
||||||
else
|
else
|
||||||
OBJS += objs/TestSuiteAI.o
|
OBJS += objs/TestSuiteAI.o
|
||||||
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
|
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
|
||||||
|
|||||||
@@ -7,10 +7,13 @@ from optparse import OptionParser
|
|||||||
def createResZipFile(filename):
|
def createResZipFile(filename):
|
||||||
|
|
||||||
utilities = ZipUtilities()
|
utilities = ZipUtilities()
|
||||||
|
rename = False
|
||||||
if not os.path.isfile('settings/options.txt'):
|
if not os.path.isfile('settings/options.txt'):
|
||||||
os.rename('settings/options.orig.txt', 'settings/options.txt')
|
os.rename('settings/options.orig.txt', 'settings/options.txt')
|
||||||
|
remame = True
|
||||||
if not os.path.isfile('player/options.txt'):
|
if not os.path.isfile('player/options.txt'):
|
||||||
os.rename('player/options.orig.txt', 'player/options.txt')
|
os.rename('player/options.orig.txt', 'player/options.txt')
|
||||||
|
rename = True
|
||||||
|
|
||||||
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
|
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
|
||||||
utilities.addFolderToZip(zip_file, 'themes')
|
utilities.addFolderToZip(zip_file, 'themes')
|
||||||
@@ -26,6 +29,10 @@ def createResZipFile(filename):
|
|||||||
utilities.addFolderToZip(zip_file, 'ai')
|
utilities.addFolderToZip(zip_file, 'ai')
|
||||||
zip_file.close()
|
zip_file.close()
|
||||||
|
|
||||||
|
if rename:
|
||||||
|
os.rename('settings/options.txt', 'settings/options.orig.txt')
|
||||||
|
os.rename('player/options.txt', 'player/options.orig.txt')
|
||||||
|
|
||||||
def getFilename():
|
def getFilename():
|
||||||
p = Properties();
|
p = Properties();
|
||||||
p.load(open('../../build.number.properties'));
|
p.load(open('../../build.number.properties'));
|
||||||
@@ -37,16 +44,18 @@ def getFilename():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def createStandardResFile():
|
def createStandardResFile(filename):
|
||||||
print "Creating Standard Resource File"
|
print('Creating Standard Resource File')
|
||||||
filename = getFilename() + '.zip'
|
if not filename:
|
||||||
|
filename = getFilename() + '.zip'
|
||||||
createResZipFile( filename )
|
createResZipFile( filename )
|
||||||
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
|
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
|
||||||
|
|
||||||
def createIosResFile():
|
def createIosResFile(filename):
|
||||||
print 'Preparing Resource Package for iOS'
|
print('Preparing Resource Package for iOS')
|
||||||
utilities = ZipUtilities()
|
utilities = ZipUtilities()
|
||||||
filename = getFilename() + '_iOS.zip'
|
if not filename:
|
||||||
|
filename = getFilename() + '_iOS.zip'
|
||||||
#createResZipFile( filename )
|
#createResZipFile( filename )
|
||||||
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
|
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
|
||||||
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
|
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
|
||||||
@@ -71,10 +80,10 @@ class ZipUtilities:
|
|||||||
if file != '.svn':
|
if file != '.svn':
|
||||||
full_path = os.path.join(folder, file)
|
full_path = os.path.join(folder, file)
|
||||||
if os.path.isfile(full_path):
|
if os.path.isfile(full_path):
|
||||||
print 'File added: ' + str(full_path)
|
print('File added: ' + str(full_path))
|
||||||
zip_file.write(full_path)
|
zip_file.write(full_path)
|
||||||
elif os.path.isdir(full_path):
|
elif os.path.isdir(full_path):
|
||||||
print 'Entering folder: ' + str(full_path)
|
print('Entering folder: ' + str(full_path))
|
||||||
self.addFolderToZip(zip_file, full_path)
|
self.addFolderToZip(zip_file, full_path)
|
||||||
|
|
||||||
|
|
||||||
@@ -83,16 +92,17 @@ def main():
|
|||||||
|
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
|
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
|
||||||
|
parser.add_option("-n", "--name", help="NAME: specify resource file name", metavar="NAME", dest="name")
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if (options.platform):
|
if (options.platform):
|
||||||
if (options.platform == "ios"):
|
if (options.platform == "ios"):
|
||||||
createIosResFile()
|
createIosResFile(options.name)
|
||||||
else:
|
else:
|
||||||
createStandardResFile()
|
createStandardResFile(options.name)
|
||||||
else:
|
else:
|
||||||
createStandardResFile()
|
createStandardResFile(options.name)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ auto=flashbackrule
|
|||||||
auto=retracerule
|
auto=retracerule
|
||||||
auto=suspendrule
|
auto=suspendrule
|
||||||
auto=morphrule
|
auto=morphrule
|
||||||
|
auto=playfromgraveyardrule
|
||||||
auto=attackrule
|
auto=attackrule
|
||||||
auto=blockrule
|
auto=blockrule
|
||||||
auto=combattriggerrule
|
auto=combattriggerrule
|
||||||
|
|||||||
@@ -0,0 +1,846 @@
|
|||||||
|
[meta]
|
||||||
|
author=Wagic Team
|
||||||
|
name=Born of the Gods
|
||||||
|
year=2014
|
||||||
|
block=Theros
|
||||||
|
[/meta]
|
||||||
|
[card]
|
||||||
|
primitive=Acolyte's Reward
|
||||||
|
id=378373
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Aerie Worshippers
|
||||||
|
id=378402
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Akroan Conscriptor
|
||||||
|
id=378459
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Akroan Phalanx
|
||||||
|
id=378374
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Akroan Skyguard
|
||||||
|
id=378375
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Arbiter of the Ideal
|
||||||
|
id=378403
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Archetype of Aggression
|
||||||
|
id=378460
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Archetype of Courage
|
||||||
|
id=378376
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Archetype of Endurance
|
||||||
|
id=378488
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Archetype of Finality
|
||||||
|
id=378430
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Archetype of Imagination
|
||||||
|
id=378404
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ashiok's Adept
|
||||||
|
id=378431
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Aspect of Hydra
|
||||||
|
id=378489
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Asphyxiate
|
||||||
|
id=378432
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Astral Cornucopia
|
||||||
|
id=378529
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Bile Blight
|
||||||
|
id=378433
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Black Oak of Odunos
|
||||||
|
id=378434
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Bolt of Keranos
|
||||||
|
id=378461
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Brimaz, King of Oreskos
|
||||||
|
id=378377
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Champion of Stray Souls
|
||||||
|
id=378435
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Charging Badger
|
||||||
|
id=378490
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Chorus of the Tides
|
||||||
|
id=378405
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Chromanticore
|
||||||
|
id=378516
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Claim of Erebos
|
||||||
|
id=378436
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Courser of Kruphix
|
||||||
|
id=378491
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Crypsis
|
||||||
|
id=378406
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Culling Mark
|
||||||
|
id=378492
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Cyclops of One-Eyed Pass
|
||||||
|
id=378462
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Dawn to Dusk
|
||||||
|
id=378378
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Deepwater Hypnotist
|
||||||
|
id=378407
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Divination
|
||||||
|
id=378408
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Drown in Sorrow
|
||||||
|
id=378437
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Eater of Hope
|
||||||
|
id=378438
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Eidolon of Countless Battles
|
||||||
|
id=378379
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Elite Skirmisher
|
||||||
|
id=378380
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ephara, God of the Polis
|
||||||
|
id=378517
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ephara's Enlightenment
|
||||||
|
id=378518
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ephara's Radiance
|
||||||
|
id=378381
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Epiphany Storm
|
||||||
|
id=378463
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Eternity Snare
|
||||||
|
id=378409
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Evanescent Intellect
|
||||||
|
id=378410
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Everflame Eidolon
|
||||||
|
id=378464
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Excoriate
|
||||||
|
id=378382
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Eye Gouge
|
||||||
|
id=378439
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fall of the Hammer
|
||||||
|
id=378465
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fanatic of Xenagos
|
||||||
|
id=378519
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fate Unraveler
|
||||||
|
id=378440
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fated Conflagration
|
||||||
|
id=378466
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fated Infatuation
|
||||||
|
id=378411
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fated Intervention
|
||||||
|
id=378493
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fated Retribution
|
||||||
|
id=378383
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fated Return
|
||||||
|
id=378441
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fearsome Temper
|
||||||
|
id=378467
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Felhide Brawler
|
||||||
|
id=378442
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Felhide Spiritbinder
|
||||||
|
id=378468
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Flame-Wreathed Phoenix
|
||||||
|
id=378469
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Flitterstep Eidolon
|
||||||
|
id=378412
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Floodtide Serpent
|
||||||
|
id=378413
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Forgestoker Dragon
|
||||||
|
id=378470
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Forlorn Pseudamma
|
||||||
|
id=378443
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Forsaken Drifters
|
||||||
|
id=378444
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ghostblade Eidolon
|
||||||
|
id=378384
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Gild
|
||||||
|
id=378445
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Gold
|
||||||
|
id=-378445
|
||||||
|
rarity=T
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Glimpse the Sun God
|
||||||
|
id=378385
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=God-Favored General
|
||||||
|
id=378386
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Gorgon's Head
|
||||||
|
id=378530
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Graverobber Spider
|
||||||
|
id=378494
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Great Hart
|
||||||
|
id=378387
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Griffin Dreamfinder
|
||||||
|
id=378388
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Grisly Transformation
|
||||||
|
id=378446
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Herald of Torment
|
||||||
|
id=378447
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Hero of Iroas
|
||||||
|
id=378389
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Hero of Leina Tower
|
||||||
|
id=378495
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Heroes' Podium
|
||||||
|
id=378531
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Hold at Bay
|
||||||
|
id=378390
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Hunter's Prowess
|
||||||
|
id=378496
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Impetuous Sunchaser
|
||||||
|
id=378471
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Karametra, God of Harvests
|
||||||
|
id=378520
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Karametra's Favor
|
||||||
|
id=378497
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kiora, the Crashing Wave
|
||||||
|
id=378521
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kiora's Prevention
|
||||||
|
id=37852101
|
||||||
|
rarity=T
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kiora's Kraken
|
||||||
|
id=-378521
|
||||||
|
rarity=T
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kiora's Follower
|
||||||
|
id=378522
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kragma Butcher
|
||||||
|
id=378472
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kraken of the Straits
|
||||||
|
id=378414
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Lightning Volley
|
||||||
|
id=378473
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Loyal Pegasus
|
||||||
|
id=378391
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Marshmist Titan
|
||||||
|
id=378448
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Meletis Astronomer
|
||||||
|
id=378415
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Mindreaver
|
||||||
|
id=378416
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Mischief and Mayhem
|
||||||
|
id=378498
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Mogis, God of Slaughter
|
||||||
|
id=378523
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Mortal's Ardor
|
||||||
|
id=378392
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Mortal's Resolve
|
||||||
|
id=378499
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Necrobite
|
||||||
|
id=378449
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nessian Demolok
|
||||||
|
id=378500
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nessian Wilds Ravager
|
||||||
|
id=378501
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Noble Quarry
|
||||||
|
id=378502
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nullify
|
||||||
|
id=378417
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nyxborn Eidolon
|
||||||
|
id=378450
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nyxborn Rollicker
|
||||||
|
id=378474
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nyxborn Shieldmate
|
||||||
|
id=378393
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nyxborn Triton
|
||||||
|
id=378418
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Nyxborn Wolf
|
||||||
|
id=378503
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Odunos River Trawler
|
||||||
|
id=378451
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Oracle of Bones
|
||||||
|
id=378475
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Oracle's Insight
|
||||||
|
id=378419
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Oreskos Sun Guide
|
||||||
|
id=378394
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ornitharch
|
||||||
|
id=378395
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Pain Seer
|
||||||
|
id=378452
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Peregrination
|
||||||
|
id=378504
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Perplexing Chimera
|
||||||
|
id=378420
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Pharagax Giant
|
||||||
|
id=378476
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Phenax, God of Deception
|
||||||
|
id=378524
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Pheres-Band Raiders
|
||||||
|
id=378505
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Pheres-Band Tromper
|
||||||
|
id=378506
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Pillar of War
|
||||||
|
id=378532
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Pinnacle of Rage
|
||||||
|
id=378477
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Plea for Guidance
|
||||||
|
id=378396
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ragemonger
|
||||||
|
id=378525
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Raised by Wolves
|
||||||
|
id=378507
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Reap what is Sown
|
||||||
|
id=378526
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Reckless Reveler
|
||||||
|
id=378478
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Retraction Helix
|
||||||
|
id=378421
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Revoke Existence
|
||||||
|
id=378397
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Rise to the Challenge
|
||||||
|
id=378479
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Sanguimancy
|
||||||
|
id=378453
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Satyr Firedancer
|
||||||
|
id=378480
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Satyr Nyx-Smith
|
||||||
|
id=378481
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Satyr Wayfinder
|
||||||
|
id=378508
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Scourge of Skola Vale
|
||||||
|
id=378509
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Scouring Sands
|
||||||
|
id=378482
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Searing Blood
|
||||||
|
id=378483
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Servant of Tymaret
|
||||||
|
id=378454
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Setessan Oathsworn
|
||||||
|
id=378510
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Setessan Starbreaker
|
||||||
|
id=378511
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Shrike Harpy
|
||||||
|
id=378455
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Silent Sentinel
|
||||||
|
id=378398
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Siren of the Fanged Coast
|
||||||
|
id=378422
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Siren of the Silent Song
|
||||||
|
id=378527
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Siren Song Lyre
|
||||||
|
id=378533
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Skyreaping
|
||||||
|
id=378512
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Snake of the Golden Grove
|
||||||
|
id=378513
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Sphinx's Disciple
|
||||||
|
id=378423
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Spirit of the Labyrinth
|
||||||
|
id=378399
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Spiteful Returned
|
||||||
|
id=378456
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Springleaf Drum
|
||||||
|
id=378534
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Stormcaller of Keranos
|
||||||
|
id=378484
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Stratus Walk
|
||||||
|
id=378424
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Sudden Storm
|
||||||
|
id=378425
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Sunbond
|
||||||
|
id=378400
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Swordwise Centaur
|
||||||
|
id=378514
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Temple of Enlightenment
|
||||||
|
id=378535
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Temple of Malice
|
||||||
|
id=378536
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Temple of Plenty
|
||||||
|
id=378537
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Thassa's Rebuff
|
||||||
|
id=378426
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Thunder Brute
|
||||||
|
id=378485
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Thunderous Might
|
||||||
|
id=378486
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Tromokratis
|
||||||
|
id=378427
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Unravel the AEther
|
||||||
|
id=378515
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Vanguard of Brimaz
|
||||||
|
id=378401
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Vortex Elemental
|
||||||
|
id=378428
|
||||||
|
rarity=U
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Warchanter of Mogis
|
||||||
|
id=378457
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Weight of the Underworld
|
||||||
|
id=378458
|
||||||
|
rarity=C
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Whelming Wave
|
||||||
|
id=378429
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Whims of the Fates
|
||||||
|
id=378487
|
||||||
|
rarity=R
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Xenagos, God of Revels
|
||||||
|
id=378528
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
@@ -1513,3 +1513,8 @@ primitive=Zephyr Net
|
|||||||
id=142357
|
id=142357
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Avatar Token
|
||||||
|
id=-140233
|
||||||
|
rarity=T
|
||||||
|
[/card]
|
||||||
|
|||||||
@@ -1248,3 +1248,8 @@ primitive=Zombie Goliath
|
|||||||
id=190545
|
id=190545
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Avatar Token
|
||||||
|
id=-191239
|
||||||
|
rarity=T
|
||||||
|
[/card]
|
||||||
|
|||||||
@@ -1258,3 +1258,8 @@ primitive=Yavimaya Wurm
|
|||||||
id=205221
|
id=205221
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Avatar Token
|
||||||
|
id=-205957
|
||||||
|
rarity=T
|
||||||
|
[/card]
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3187,19 +3187,6 @@ mana={2}
|
|||||||
type=Artifact
|
type=Artifact
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Crucible of Worlds
|
|
||||||
auto={0}:may moveTo(myBattlefield) target(land|mygraveyard) limit:1 myTurnOnly
|
|
||||||
# Above line does not work: "May moveto" from graveyards does
|
|
||||||
# not work due to interface issues. The "limit:1" doesn't work
|
|
||||||
# here either. Even if both worked, then the card would allow
|
|
||||||
# you to play lands *in addition* to the 1 land you can play per
|
|
||||||
# turn. Instead it should just give you the option to play this
|
|
||||||
# 1 land from your hand or your graveyard.
|
|
||||||
text=You may play land cards from your graveyard.
|
|
||||||
mana={3}
|
|
||||||
type=Artifact
|
|
||||||
[/card]
|
|
||||||
[card]
|
|
||||||
name=Cruel Deceiver
|
name=Cruel Deceiver
|
||||||
text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Cruel Deceiver gains "Whenever Cruel Deceiver deals damage to a creature, destroy that creature" until end of turn. Activate this ability only once each turn.
|
text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Cruel Deceiver gains "Whenever Cruel Deceiver deals damage to a creature, destroy that creature" until end of turn. Activate this ability only once each turn.
|
||||||
mana={1}{B}
|
mana={1}{B}
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ brass_man.txt
|
|||||||
brass_man_i161.txt
|
brass_man_i161.txt
|
||||||
briarhorn.txt
|
briarhorn.txt
|
||||||
bringer_of_the_red_dawn.txt
|
bringer_of_the_red_dawn.txt
|
||||||
|
buyback.txt
|
||||||
cage_of_hands.txt
|
cage_of_hands.txt
|
||||||
Call_to_Heel_1.txt
|
Call_to_Heel_1.txt
|
||||||
Call_to_Heel_2.txt
|
Call_to_Heel_2.txt
|
||||||
@@ -249,6 +250,7 @@ curiosity2_i217.txt
|
|||||||
crimson_kobolds.txt
|
crimson_kobolds.txt
|
||||||
crosis_s_catacombs_1.txt
|
crosis_s_catacombs_1.txt
|
||||||
crosis_s_catacombs_2.txt
|
crosis_s_catacombs_2.txt
|
||||||
|
crucible_of_worlds.txt
|
||||||
crumble.txt
|
crumble.txt
|
||||||
crystal_rod_i172.txt
|
crystal_rod_i172.txt
|
||||||
cursed_land1_i188.txt
|
cursed_land1_i188.txt
|
||||||
@@ -307,6 +309,9 @@ evil_presence3.txt
|
|||||||
evil_presence_i647.txt
|
evil_presence_i647.txt
|
||||||
evil_presence_i647_2.txt
|
evil_presence_i647_2.txt
|
||||||
exaltedsourcekilled.txt
|
exaltedsourcekilled.txt
|
||||||
|
executioners_swing.txt
|
||||||
|
executioners_swing2.txt
|
||||||
|
executioners_swing3.txt
|
||||||
explore.txt
|
explore.txt
|
||||||
Faceless_Butcher.txt
|
Faceless_Butcher.txt
|
||||||
fading.txt
|
fading.txt
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Cast card once with buyback and second time without.
|
||||||
|
# The card must be in the graveyard, not in the hand
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
hand:Capsize
|
||||||
|
manapool:{5}{U}{U}{U}{U}
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:Swamp,Island
|
||||||
|
|
||||||
|
[DO]
|
||||||
|
Capsize
|
||||||
|
# pay buyback
|
||||||
|
choice 1
|
||||||
|
Swamp
|
||||||
|
Capsize
|
||||||
|
Island
|
||||||
|
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:Capsize
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
hand:Swamp,Island
|
||||||
|
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Testing crucible of worlds (keyword: CANPLAYFROMGRAVEYARD)
|
||||||
|
|
||||||
|
# name=Crucible of Worlds
|
||||||
|
# text=You may play land cards from your graveyard.
|
||||||
|
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
hand:island,plains
|
||||||
|
inplay:crucible of worlds
|
||||||
|
graveyard:forest,mountain
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
forest
|
||||||
|
# all next lands shouldn't be played
|
||||||
|
island
|
||||||
|
mountain
|
||||||
|
plains
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:crucible of worlds,forest
|
||||||
|
hand:island,plains
|
||||||
|
graveyard:mountain
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#NAME: Executioner's Swing
|
||||||
|
#DESC: Checks targetability
|
||||||
|
#DESC: Test that can target creature that damaged creature this turn
|
||||||
|
|
||||||
|
[INIT]
|
||||||
|
combatattackers
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Grizzly Bears
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:Flying Men,Swamp,Plains
|
||||||
|
hand:Executioner's Swing
|
||||||
|
|
||||||
|
[DO]
|
||||||
|
Grizzly Bears
|
||||||
|
next
|
||||||
|
Flying Men
|
||||||
|
next
|
||||||
|
next
|
||||||
|
next
|
||||||
|
|
||||||
|
# second main
|
||||||
|
# kill bear
|
||||||
|
yes
|
||||||
|
Swamp
|
||||||
|
Plains
|
||||||
|
Executioner's Swing
|
||||||
|
Grizzly Bears
|
||||||
|
endinterruption
|
||||||
|
|
||||||
|
[ASSERT]
|
||||||
|
secondmain
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:Grizzly Bears
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:Executioner's Swing,Flying Men
|
||||||
|
inplay:Plains,Swamp
|
||||||
|
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#NAME: Executioner's Swing
|
||||||
|
#DESC: Checks targetability
|
||||||
|
#DESC: Test that can target creature that damaged player
|
||||||
|
|
||||||
|
[INIT]
|
||||||
|
combatattackers
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Grizzly Bears
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:Swamp,Plains
|
||||||
|
hand:Executioner's Swing
|
||||||
|
|
||||||
|
[DO]
|
||||||
|
Grizzly Bears
|
||||||
|
next
|
||||||
|
next
|
||||||
|
next
|
||||||
|
next
|
||||||
|
|
||||||
|
# second main
|
||||||
|
# kill bear
|
||||||
|
yes
|
||||||
|
Swamp
|
||||||
|
Plains
|
||||||
|
Executioner's Swing
|
||||||
|
Grizzly Bears
|
||||||
|
endinterruption
|
||||||
|
|
||||||
|
[ASSERT]
|
||||||
|
secondmain
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:Grizzly Bears
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:Executioner's Swing
|
||||||
|
inplay:Plains,Swamp
|
||||||
|
life:18
|
||||||
|
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#NAME: Executioner's Swing
|
||||||
|
#DESC: Checks targetability
|
||||||
|
#DESC: Prove that can't target passive creature
|
||||||
|
|
||||||
|
[INIT]
|
||||||
|
secondmain
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Grizzly Bears
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
manapool:{B}{W}
|
||||||
|
hand:Executioner's Swing
|
||||||
|
|
||||||
|
[DO]
|
||||||
|
# attempt to kill bear
|
||||||
|
yes
|
||||||
|
Swamp
|
||||||
|
Plains
|
||||||
|
Executioner's Swing
|
||||||
|
Grizzly Bears
|
||||||
|
endinterruption
|
||||||
|
|
||||||
|
[ASSERT]
|
||||||
|
secondmain
|
||||||
|
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Grizzly Bears
|
||||||
|
|
||||||
|
[PLAYER2]
|
||||||
|
hand:Executioner's Swing
|
||||||
|
manapool:{W}{B}
|
||||||
|
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#Testing Griselbrand with the new specific life cost {L:7}
|
||||||
|
#Player has 8 life and you cannot use the ability the second time if you cannot pay life.
|
||||||
|
#Must change griselbrand code to {L:7}:draw:7 instead of {L}{L}{L}{L}{L}{L}{L}:draw:7
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Griselbrand
|
||||||
|
life:8
|
||||||
|
library:forest,forest,forest,forest,forest,forest,forest,plains,mountain,mountain,mountain,mountain,mountain,mountain,island
|
||||||
|
[PLAYER2]
|
||||||
|
life:20
|
||||||
|
[DO]
|
||||||
|
Griselbrand
|
||||||
|
Griselbrand
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Griselbrand
|
||||||
|
life:1
|
||||||
|
hand:mountain,mountain,mountain,mountain,mountain,mountain,island
|
||||||
|
library:forest,forest,forest,forest,forest,forest,forest,plains
|
||||||
|
[PLAYER2]
|
||||||
|
life:20
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#Testing guild keyword gruul for Xenagos, God of Revels. You must have Born of the gods set (BNG)
|
||||||
|
#[card]
|
||||||
|
#name=Xenagos, God of Revels
|
||||||
|
#abilities=indestructible
|
||||||
|
#auto=@each my combatbegins:name(haste and +x/+x) target(other creature|mybattlefield) transforms((,newability[haste],newability[power/power])) ueot
|
||||||
|
#auto=this(variable{gruul}>6) transforms((Creature))
|
||||||
|
#text=Indestructible -- As long as your devotion to red and green is less than seven, Xenagos isn't a creature. -- At the beginning of combat on your turn, another target creature you control gains haste and gets +X/+X until end of turn, where X is that creature's power.
|
||||||
|
#mana={3}{R}{G}
|
||||||
|
#type=Legendary Enchantment
|
||||||
|
#subtype=God
|
||||||
|
#power=6
|
||||||
|
#toughness=5
|
||||||
|
#[/card]
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:378528
|
||||||
|
hand:19869
|
||||||
|
life:20
|
||||||
|
manapool:{G}{G}{G}{G}{G}
|
||||||
|
[PLAYER2]
|
||||||
|
life:20
|
||||||
|
[DO]
|
||||||
|
19869
|
||||||
|
next
|
||||||
|
choice 0
|
||||||
|
19869
|
||||||
|
next
|
||||||
|
19869
|
||||||
|
eot
|
||||||
|
[ASSERT]
|
||||||
|
UNTAP
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:378528,19869
|
||||||
|
life:20
|
||||||
|
[PLAYER2]
|
||||||
|
life:12
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import zipfile
|
||||||
|
from pyjavaproperties import Properties
|
||||||
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
def createWindowsZipFile(filename):
|
||||||
|
utilities = ZipUtilities()
|
||||||
|
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
|
||||||
|
zip_file.write('../../../LICENSE')
|
||||||
|
zip_file.write('libpng13.dll')
|
||||||
|
zip_file.write('SDL.dll')
|
||||||
|
zip_file.write('fmod.dll')
|
||||||
|
zip_file.write('zlib1.dll')
|
||||||
|
zip_file.write('Wagic.exe')
|
||||||
|
zip_file.write('Res/' + getFilename('core') + '.zip')
|
||||||
|
zip_file.close()
|
||||||
|
|
||||||
|
def getFilename(filename):
|
||||||
|
p = Properties();
|
||||||
|
p.load(open('../build.number.properties'));
|
||||||
|
minor = p['build.minor'];
|
||||||
|
major = p['build.major'];
|
||||||
|
point = p['build.point'];
|
||||||
|
filename = filename + '-' + major + minor + point
|
||||||
|
return filename
|
||||||
|
|
||||||
|
def createStandardResFile():
|
||||||
|
print "Creating Resource File"
|
||||||
|
cmd = 'python createResourceZip.py -n ' + getFilename('core') + '.zip'
|
||||||
|
os.chdir("Res")
|
||||||
|
os.system(cmd)
|
||||||
|
os.chdir("..")
|
||||||
|
print "Creating Windows Package File"
|
||||||
|
filename = 'Wagic-windows.zip'
|
||||||
|
createWindowsZipFile( filename )
|
||||||
|
print >> sys.stderr, 'Created Windows Package: {0}'.format( filename)
|
||||||
|
|
||||||
|
class ZipUtilities:
|
||||||
|
|
||||||
|
def toZip(self, file, filename):
|
||||||
|
zip_file = zipfile.ZipFile(filename, 'w')
|
||||||
|
if os.path.isfile(file):
|
||||||
|
zip_file.write(file)
|
||||||
|
else:
|
||||||
|
self.addFolderToZip(zip_file, file)
|
||||||
|
zip_file.close()
|
||||||
|
|
||||||
|
def addFolderToZip(self, zip_file, folder):
|
||||||
|
zip_file.writestr(folder + '/', '')
|
||||||
|
for file in os.listdir(folder):
|
||||||
|
if file != '.svn':
|
||||||
|
full_path = os.path.join(folder, file)
|
||||||
|
if os.path.isfile(full_path):
|
||||||
|
print 'File added: ' + str(full_path)
|
||||||
|
zip_file.write(full_path)
|
||||||
|
elif os.path.isdir(full_path):
|
||||||
|
print 'Entering folder: ' + str(full_path)
|
||||||
|
self.addFolderToZip(zip_file, full_path)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
## using optparse instead of argParse for now since python 2.7 may not be installed.
|
||||||
|
|
||||||
|
parser = OptionParser()
|
||||||
|
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
|
||||||
|
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
createStandardResFile()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<!-- build.properties should contain the values for major, minor and point -->
|
<!-- build.properties should contain the values for major, minor and point -->
|
||||||
<property file="build.properties" />
|
<property file="build.properties" />
|
||||||
<property file="build.number.properties" />
|
<property file="build.number.properties" />
|
||||||
|
<property environment="env"/>
|
||||||
|
|
||||||
<path id="groovy.class.path" >
|
<path id="groovy.class.path" >
|
||||||
<fileset dir="${groovy.dir}" />
|
<fileset dir="${groovy.dir}" />
|
||||||
@@ -76,19 +77,22 @@ Author: Michael Nguyen
|
|||||||
#define WAGIC_VERSION_MAJOR ${build.major}
|
#define WAGIC_VERSION_MAJOR ${build.major}
|
||||||
#define WAGIC_VERSION_MEDIUM ${build.minor}
|
#define WAGIC_VERSION_MEDIUM ${build.minor}
|
||||||
#define WAGIC_VERSION_MINOR ${build.point}
|
#define WAGIC_VERSION_MINOR ${build.point}
|
||||||
|
#define WAGIC_VERSION_REVISION ${env.TRAVIS_BUILD_NUMBER}
|
||||||
|
|
||||||
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
|
#define VERSION_DOT(a, b, c, d) a ##.## b ##.## c ##.## d
|
||||||
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
|
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
|
||||||
#define VERSION_GAME(a, b, c) VERSION_DOT(a, b, c)
|
#define VERSION_GAME(a, b, c, d) VERSION_DOT(a, b, c, d)
|
||||||
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
|
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
|
||||||
#define VERSION_TOSTRING(a) #a
|
#define VERSION_TOSTRING(a) #a
|
||||||
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
|
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
|
||||||
|
|
||||||
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR, WAGIC_VERSION_REVISION)
|
||||||
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
||||||
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
|
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
|
||||||
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
|
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
|
||||||
#define WAGIC_RESOURCE_NAME WAGIC_CORE_VERSION_STRING ".zip"
|
#define WAGIC_RESOURCE_NAME "Wagic-core.zip"
|
||||||
|
#define WAGIC_RELEASE_NAME "${env.RELEASE_NAME}"
|
||||||
|
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
virtual const char * getMenuText()
|
virtual const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Ability";
|
return "Ability";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false)
|
Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false)
|
||||||
: PlayGuiObject(40, x, y, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL)
|
: PlayGuiObject(40, 0.0f, 0.0f, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,6 +172,206 @@ private:
|
|||||||
{
|
{
|
||||||
intValue = target->getManaCost()->getConvertedCost();
|
intValue = target->getManaCost()->getConvertedCost();
|
||||||
}
|
}
|
||||||
|
else if (s == "azorius")//devotion blue white
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 2);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "boros")//devotion red white
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 3);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "dimir")//devotion blue black
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 2);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "golgari")//devotion to green black
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 1);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "gruul")//devotion to green red
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 1);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "izzet")//devotion to red blue
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 2);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "orzhov")//devotion to white black
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 4);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "rakdos")//devotion to red black
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 3);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "selesnya")//devotion to green white
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 1);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
|
else if (s == "simic")//devotion to green blue
|
||||||
|
{
|
||||||
|
TargetChooserFactory dtf(card->getObserver());
|
||||||
|
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * dp = card->getObserver()->players[i];
|
||||||
|
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = dzones[k];
|
||||||
|
if (dtc->targetsZone(zone, card))
|
||||||
|
{
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 1);
|
||||||
|
intValue += zone->countTotalManaSymbols(dtc, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(dtc);
|
||||||
|
}
|
||||||
else if (s.find("type:") != string::npos)
|
else if (s.find("type:") != string::npos)
|
||||||
{
|
{
|
||||||
size_t begins = s.find("type:");
|
size_t begins = s.find("type:");
|
||||||
@@ -1081,7 +1281,7 @@ public:
|
|||||||
ManaCost * cost = NULL);
|
ManaCost * cost = NULL);
|
||||||
|
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AACounter * clone() const;
|
AACounter * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1100,7 +1300,7 @@ public:
|
|||||||
bool all,ManaCost * cost = NULL);
|
bool all,ManaCost * cost = NULL);
|
||||||
|
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AARemoveAllCounter * clone() const;
|
AARemoveAllCounter * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1110,7 +1310,7 @@ class AAResetDamage: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AAResetDamage(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, ManaCost * cost = NULL);
|
AAResetDamage(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AAResetDamage * clone() const;
|
AAResetDamage * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1120,7 +1320,7 @@ public:
|
|||||||
string named;
|
string named;
|
||||||
AAFakeAbility(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string _newName, ManaCost * cost = NULL);
|
AAFakeAbility(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string _newName, ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AAFakeAbility * clone() const;
|
AAFakeAbility * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1131,7 +1331,7 @@ public:
|
|||||||
|
|
||||||
AAFizzler(GameObserver* observer, int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost = NULL);
|
AAFizzler(GameObserver* observer, int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAFizzler* clone() const;
|
AAFizzler* clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1160,7 +1360,7 @@ public:
|
|||||||
string Cond;
|
string Cond;
|
||||||
IfThenAbility(GameObserver* observer, int _id,MTGAbility * delayedAbility = NULL,MTGAbility * delayedElseAbility = NULL, MTGCardInstance * _source=NULL, Targetable * target = NULL, int type = 1,string Cond = "");
|
IfThenAbility(GameObserver* observer, int _id,MTGAbility * delayedAbility = NULL,MTGAbility * delayedElseAbility = NULL, MTGCardInstance * _source=NULL, Targetable * target = NULL, int type = 1,string Cond = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
IfThenAbility * clone() const;
|
IfThenAbility * clone() const;
|
||||||
~IfThenAbility();
|
~IfThenAbility();
|
||||||
};
|
};
|
||||||
@@ -1179,7 +1379,7 @@ public:
|
|||||||
|
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
|
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
|
|
||||||
int isReactingToTargetClick(Targetable * card);
|
int isReactingToTargetClick(Targetable * card);
|
||||||
@@ -1209,7 +1409,7 @@ public:
|
|||||||
bool CheckUserInput(JButton key);
|
bool CheckUserInput(JButton key);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
int isReactingToTargetClick(Targetable * card);
|
int isReactingToTargetClick(Targetable * card);
|
||||||
int reactToTargetClick(Targetable * object);
|
int reactToTargetClick(Targetable * object);
|
||||||
@@ -1225,7 +1425,7 @@ class AAProliferate: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AAProliferate(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,ManaCost * cost = NULL);
|
AAProliferate(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AAProliferate * clone() const;
|
AAProliferate * clone() const;
|
||||||
~AAProliferate();
|
~AAProliferate();
|
||||||
};
|
};
|
||||||
@@ -1243,7 +1443,7 @@ public:
|
|||||||
int resolve();
|
int resolve();
|
||||||
int addToGame();
|
int addToGame();
|
||||||
int destroy();
|
int destroy();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
MultiAbility * clone() const;
|
MultiAbility * clone() const;
|
||||||
~MultiAbility();
|
~MultiAbility();
|
||||||
};
|
};
|
||||||
@@ -1258,8 +1458,9 @@ public:
|
|||||||
|
|
||||||
GenericActivatedAbility(GameObserver* observer, string newName,string castRestriction,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "",
|
GenericActivatedAbility(GameObserver* observer, string newName,string castRestriction,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "",
|
||||||
int restrictions = 0, MTGGameZone * dest = NULL);
|
int restrictions = 0, MTGGameZone * dest = NULL);
|
||||||
|
GenericActivatedAbility(const GenericActivatedAbility& other);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
@@ -1274,7 +1475,7 @@ class AALibraryBottom: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AALibraryBottom(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
AALibraryBottom(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AALibraryBottom * clone() const;
|
AALibraryBottom * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1284,7 +1485,7 @@ class AACopier: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AACopier * clone() const;
|
AACopier * clone() const;
|
||||||
};
|
};
|
||||||
//imprint
|
//imprint
|
||||||
@@ -1293,7 +1494,7 @@ class AAPhaseOut: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AAPhaseOut(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
AAPhaseOut(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAPhaseOut * clone() const;
|
AAPhaseOut * clone() const;
|
||||||
};
|
};
|
||||||
//cloning...this makes a token thats a copy of the target.
|
//cloning...this makes a token thats a copy of the target.
|
||||||
@@ -1310,7 +1511,7 @@ public:
|
|||||||
AACloner(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL, int who = 0,
|
AACloner(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL, int who = 0,
|
||||||
string abilitiesStringList = "",string typeslist = "");
|
string abilitiesStringList = "",string typeslist = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
AACloner * clone() const;
|
AACloner * clone() const;
|
||||||
~AACloner();
|
~AACloner();
|
||||||
@@ -1326,7 +1527,7 @@ public:
|
|||||||
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL);
|
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL);
|
||||||
MTGGameZone * destinationZone(Targetable * target = NULL);
|
MTGGameZone * destinationZone(Targetable * target = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
const char * getMenuText(TargetChooser * fromTc);
|
const char * getMenuText(TargetChooser * fromTc);
|
||||||
AAMover * clone() const;
|
AAMover * clone() const;
|
||||||
~AAMover();
|
~AAMover();
|
||||||
@@ -1342,7 +1543,7 @@ public:
|
|||||||
AARandomMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string tcs, string from, string to);
|
AARandomMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string tcs, string from, string to);
|
||||||
MTGGameZone * destinationZone(Targetable * target = NULL,string zone = "");
|
MTGGameZone * destinationZone(Targetable * target = NULL,string zone = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AARandomMover * clone() const;
|
AARandomMover * clone() const;
|
||||||
~AARandomMover();
|
~AARandomMover();
|
||||||
};
|
};
|
||||||
@@ -1356,7 +1557,7 @@ public:
|
|||||||
string menu;
|
string menu;
|
||||||
AABuryCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
AABuryCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AABuryCard * clone() const;
|
AABuryCard * clone() const;
|
||||||
~AABuryCard();
|
~AABuryCard();
|
||||||
};
|
};
|
||||||
@@ -1367,7 +1568,7 @@ public:
|
|||||||
MTGAbility * andAbility;
|
MTGAbility * andAbility;
|
||||||
AADestroyCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
AADestroyCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AADestroyCard * clone() const;
|
AADestroyCard * clone() const;
|
||||||
~AADestroyCard();
|
~AADestroyCard();
|
||||||
};
|
};
|
||||||
@@ -1378,7 +1579,7 @@ public:
|
|||||||
MTGAbility * andAbility;
|
MTGAbility * andAbility;
|
||||||
AASacrificeCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
AASacrificeCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AASacrificeCard * clone() const;
|
AASacrificeCard * clone() const;
|
||||||
~AASacrificeCard();
|
~AASacrificeCard();
|
||||||
};
|
};
|
||||||
@@ -1389,7 +1590,7 @@ public:
|
|||||||
MTGAbility * andAbility;
|
MTGAbility * andAbility;
|
||||||
AADiscardCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
AADiscardCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AADiscardCard * clone() const;
|
AADiscardCard * clone() const;
|
||||||
~AADiscardCard();
|
~AADiscardCard();
|
||||||
};
|
};
|
||||||
@@ -1409,7 +1610,7 @@ public:
|
|||||||
string tcString;
|
string tcString;
|
||||||
|
|
||||||
GenericTargetAbility(GameObserver* observer, string newName, string castRestriction, int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a, ManaCost * _cost = NULL, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "", int restrictions = 0, MTGGameZone * dest = NULL,string tcString ="");
|
GenericTargetAbility(GameObserver* observer, string newName, string castRestriction, int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a, ManaCost * _cost = NULL, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "", int restrictions = 0, MTGGameZone * dest = NULL,string tcString ="");
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
~GenericTargetAbility();
|
~GenericTargetAbility();
|
||||||
GenericTargetAbility * clone() const;
|
GenericTargetAbility * clone() const;
|
||||||
int resolve();
|
int resolve();
|
||||||
@@ -1447,7 +1648,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Ninjutsu";
|
return "Ninjutsu";
|
||||||
}
|
}
|
||||||
@@ -1479,7 +1680,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Remove From Combat";
|
return "Remove From Combat";
|
||||||
}
|
}
|
||||||
@@ -1501,7 +1702,7 @@ public:
|
|||||||
AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost,string nbcardsStr, int who =
|
AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost,string nbcardsStr, int who =
|
||||||
TargetChooser::UNSET,bool noReplace = false);
|
TargetChooser::UNSET,bool noReplace = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AADrawer * clone() const;
|
AADrawer * clone() const;
|
||||||
int getNumCards();
|
int getNumCards();
|
||||||
};
|
};
|
||||||
@@ -1521,7 +1722,7 @@ public:
|
|||||||
ACastRestriction(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
|
ACastRestriction(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
|
||||||
int addToGame();
|
int addToGame();
|
||||||
int destroy();
|
int destroy();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
ACastRestriction * clone() const;
|
ACastRestriction * clone() const;
|
||||||
~ACastRestriction();
|
~ACastRestriction();
|
||||||
|
|
||||||
@@ -1536,7 +1737,7 @@ public:
|
|||||||
|
|
||||||
AInstantCastRestrictionUEOT(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
|
AInstantCastRestrictionUEOT(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AInstantCastRestrictionUEOT * clone() const;
|
AInstantCastRestrictionUEOT * clone() const;
|
||||||
~AInstantCastRestrictionUEOT();
|
~AInstantCastRestrictionUEOT();
|
||||||
};
|
};
|
||||||
@@ -1549,7 +1750,7 @@ public:
|
|||||||
AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string life_s, ManaCost * _cost = NULL,
|
AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string life_s, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AALifer * clone() const;
|
AALifer * clone() const;
|
||||||
int getLife();
|
int getLife();
|
||||||
|
|
||||||
@@ -1562,7 +1763,7 @@ public:
|
|||||||
AAWinGame(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
AAWinGame(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
||||||
TargetChooser::UNSET);
|
TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAWinGame * clone() const;
|
AAWinGame * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1603,7 +1804,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return Constants::MTGBasicAbilities[ability];
|
return Constants::MTGBasicAbilities[ability];
|
||||||
}
|
}
|
||||||
@@ -1645,7 +1846,7 @@ public:
|
|||||||
return InstantAbility::addToGame();
|
return InstantAbility::addToGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return Constants::MTGBasicAbilities[ability];
|
return Constants::MTGBasicAbilities[ability];
|
||||||
}
|
}
|
||||||
@@ -1706,7 +1907,7 @@ public:
|
|||||||
return ActivatedAbility::addToGame();
|
return ActivatedAbility::addToGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -1862,7 +2063,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
sprintf(menuText,"Protection from %s",tcstr.c_str());
|
sprintf(menuText,"Protection from %s",tcstr.c_str());
|
||||||
return menuText;
|
return menuText;
|
||||||
@@ -2054,7 +2255,7 @@ public:
|
|||||||
((MTGCardInstance *) target)->addToToughness(-wppt->toughness.getValue());
|
((MTGCardInstance *) target)->addToToughness(-wppt->toughness.getValue());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
if(PT.size())
|
if(PT.size())
|
||||||
{
|
{
|
||||||
@@ -2147,7 +2348,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -2189,7 +2390,7 @@ public:
|
|||||||
return toAdd->addToGame();
|
return toAdd->addToGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -2287,7 +2488,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Regenerate";
|
return "Regenerate";
|
||||||
}
|
}
|
||||||
@@ -2494,7 +2695,7 @@ public:
|
|||||||
SAFE_DELETE(ability);
|
SAFE_DELETE(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
if(ability)
|
if(ability)
|
||||||
{
|
{
|
||||||
@@ -2523,13 +2724,13 @@ public:
|
|||||||
|
|
||||||
ALord(GameObserver* observer, int _id, MTGCardInstance * card, TargetChooser * _tc, int _includeSelf, MTGAbility * a) :
|
ALord(GameObserver* observer, int _id, MTGCardInstance * card, TargetChooser * _tc, int _includeSelf, MTGAbility * a) :
|
||||||
ListMaintainerAbility(observer, _id, card), NestedAbility(a)
|
ListMaintainerAbility(observer, _id, card), NestedAbility(a)
|
||||||
{
|
{
|
||||||
tc = _tc;
|
tc = _tc;
|
||||||
tc->targetter = NULL;
|
tc->targetter = NULL;
|
||||||
includeSelf = _includeSelf;
|
includeSelf = _includeSelf;
|
||||||
if(ability->aType == MTGAbility::STANDARD_PREVENT)
|
if(ability->aType == MTGAbility::STANDARD_PREVENT)
|
||||||
aType = MTGAbility::STANDARD_PREVENT;
|
aType = MTGAbility::STANDARD_PREVENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//returns true if it is me who created ability a attached to Damageable d
|
//returns true if it is me who created ability a attached to Damageable d
|
||||||
bool isParentOf(Damageable * d, MTGAbility * a)
|
bool isParentOf(Damageable * d, MTGAbility * a)
|
||||||
@@ -2607,7 +2808,8 @@ public:
|
|||||||
|
|
||||||
int removed(MTGCardInstance * card)
|
int removed(MTGCardInstance * card)
|
||||||
{
|
{
|
||||||
if (abilities.find(card) != abilities.end() && !(forceDestroy == -1 && forcedAlive == 1))//only embelms have forcedestroy = -1 and forcedalive = 1
|
if (abilities.find(card) != abilities.end()
|
||||||
|
&& !(forceDestroy == -1 && forcedAlive == 1)) //only embelms have forcedestroy = -1 and forcedalive = 1
|
||||||
{
|
{
|
||||||
game->removeObserver(abilities[card]);
|
game->removeObserver(abilities[card]);
|
||||||
abilities.erase(card);
|
abilities.erase(card);
|
||||||
@@ -2620,7 +2822,7 @@ public:
|
|||||||
SAFE_DELETE(ability);
|
SAFE_DELETE(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
//Special case for move
|
//Special case for move
|
||||||
if (AAMover * move = dynamic_cast<AAMover *>(ability))
|
if (AAMover * move = dynamic_cast<AAMover *>(ability))
|
||||||
@@ -2806,7 +3008,7 @@ public:
|
|||||||
int equip(MTGCardInstance * equipped);
|
int equip(MTGCardInstance * equipped);
|
||||||
|
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
|
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
int destroy();
|
int destroy();
|
||||||
@@ -3034,7 +3236,7 @@ public:
|
|||||||
card->setAttacker(1);
|
card->setAttacker(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
sprintf(menuText, "Create %s", name.c_str());
|
sprintf(menuText, "Create %s", name.c_str());
|
||||||
return menuText;
|
return menuText;
|
||||||
@@ -3135,7 +3337,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
if(name.size())
|
if(name.size())
|
||||||
return name.c_str();
|
return name.c_str();
|
||||||
@@ -3308,7 +3510,7 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -3520,7 +3722,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -3543,7 +3745,7 @@ public:
|
|||||||
AASetHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int hand, ManaCost * _cost = NULL,
|
AASetHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int hand, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AASetHand * clone() const;
|
AASetHand * clone() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -3557,7 +3759,7 @@ public:
|
|||||||
AALifeSet(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost = NULL,
|
AALifeSet(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AALifeSet * clone() const;
|
AALifeSet * clone() const;
|
||||||
~AALifeSet();
|
~AALifeSet();
|
||||||
|
|
||||||
@@ -3574,7 +3776,7 @@ public:
|
|||||||
AADamager(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost = NULL,
|
AADamager(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
int getDamage();
|
int getDamage();
|
||||||
AADamager * clone() const;
|
AADamager * clone() const;
|
||||||
|
|
||||||
@@ -3588,7 +3790,7 @@ public:
|
|||||||
|
|
||||||
AADamagePrevent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost = NULL, int who = TargetChooser::UNSET);
|
AADamagePrevent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost = NULL, int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AADamagePrevent * clone() const;
|
AADamagePrevent * clone() const;
|
||||||
~AADamagePrevent();
|
~AADamagePrevent();
|
||||||
};
|
};
|
||||||
@@ -3602,7 +3804,7 @@ public:
|
|||||||
AAAlterPoison(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost = NULL,
|
AAAlterPoison(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAAlterPoison * clone() const;
|
AAAlterPoison * clone() const;
|
||||||
~AAAlterPoison();
|
~AAAlterPoison();
|
||||||
};
|
};
|
||||||
@@ -3630,7 +3832,7 @@ class AATapper: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AATapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
AATapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AATapper * clone() const;
|
AATapper * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3640,7 +3842,7 @@ class AAUntapper: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AAUntapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
AAUntapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAUntapper * clone() const;
|
AAUntapper * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3661,7 +3863,7 @@ class AAFrozen: public ActivatedAbility
|
|||||||
public:
|
public:
|
||||||
AAFrozen(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
AAFrozen(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAFrozen * clone() const;
|
AAFrozen * clone() const;
|
||||||
};
|
};
|
||||||
/* ghetto new target*/
|
/* ghetto new target*/
|
||||||
@@ -3671,7 +3873,7 @@ public:
|
|||||||
bool retarget;
|
bool retarget;
|
||||||
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL);
|
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AANewTarget * clone() const;
|
AANewTarget * clone() const;
|
||||||
};
|
};
|
||||||
/* morph*/
|
/* morph*/
|
||||||
@@ -3682,7 +3884,7 @@ public:
|
|||||||
AAMorph(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
AAMorph(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAMorph * clone() const;
|
AAMorph * clone() const;
|
||||||
};
|
};
|
||||||
/* flip*/
|
/* flip*/
|
||||||
@@ -3694,7 +3896,7 @@ public:
|
|||||||
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats);
|
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats);
|
||||||
int resolve();
|
int resolve();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAFlip * clone() const;
|
AAFlip * clone() const;
|
||||||
};
|
};
|
||||||
/* dynamic ability build*/
|
/* dynamic ability build*/
|
||||||
@@ -3759,7 +3961,7 @@ string menu;
|
|||||||
int resolve();
|
int resolve();
|
||||||
int activateMainAbility(MTGAbility * toActivate,MTGCardInstance * source , Damageable * target);
|
int activateMainAbility(MTGAbility * toActivate,MTGCardInstance * source , Damageable * target);
|
||||||
int activateStored();
|
int activateStored();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AADynamic * clone() const;
|
AADynamic * clone() const;
|
||||||
~AADynamic();
|
~AADynamic();
|
||||||
};
|
};
|
||||||
@@ -3812,7 +4014,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Swap power and toughness";
|
return "Swap power and toughness";
|
||||||
}
|
}
|
||||||
@@ -3828,7 +4030,7 @@ public:
|
|||||||
AAExchangeLife(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost = NULL,
|
AAExchangeLife(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAExchangeLife * clone() const;
|
AAExchangeLife * clone() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -4064,7 +4266,7 @@ public:
|
|||||||
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false);
|
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false);
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
int destroy();
|
int destroy();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
ATransformer * clone() const;
|
ATransformer * clone() const;
|
||||||
~ATransformer();
|
~ATransformer();
|
||||||
};
|
};
|
||||||
@@ -4087,7 +4289,7 @@ public:
|
|||||||
|
|
||||||
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "",bool newpowerfound = false,string newtoughness = "",bool newtoughnessfound = false,vector<string>newAbilitiesList = vector<string>(),bool newAbilityFound = false,bool aForever = false, bool UYNT = false,string menutext = "");
|
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "",bool newpowerfound = false,string newtoughness = "",bool newtoughnessfound = false,vector<string>newAbilitiesList = vector<string>(),bool newAbilityFound = false,bool aForever = false, bool UYNT = false,string menutext = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
ATransformerInstant * clone() const;
|
ATransformerInstant * clone() const;
|
||||||
~ATransformerInstant();
|
~ATransformerInstant();
|
||||||
};
|
};
|
||||||
@@ -4103,7 +4305,7 @@ public:
|
|||||||
WParsedPT * newWppt;
|
WParsedPT * newWppt;
|
||||||
PTInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, WParsedPT * wppt,string s = "",bool nonstatic = false);
|
PTInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, WParsedPT * wppt,string s = "",bool nonstatic = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
PTInstant * clone() const;
|
PTInstant * clone() const;
|
||||||
~PTInstant();
|
~PTInstant();
|
||||||
};
|
};
|
||||||
@@ -4162,7 +4364,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Exalted";
|
return "Exalted";
|
||||||
}
|
}
|
||||||
@@ -4180,7 +4382,7 @@ public:
|
|||||||
ASwapPT * ability;
|
ASwapPT * ability;
|
||||||
ASwapPTUEOT(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
|
ASwapPTUEOT(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
ASwapPTUEOT * clone() const;
|
ASwapPTUEOT * clone() const;
|
||||||
~ASwapPTUEOT();
|
~ASwapPTUEOT();
|
||||||
};
|
};
|
||||||
@@ -4257,7 +4459,7 @@ public:
|
|||||||
APreventDamageTypesUEOT(GameObserver* observer, int id, MTGCardInstance * source, string to, string from, int type = 0);
|
APreventDamageTypesUEOT(GameObserver* observer, int id, MTGCardInstance * source, string to, string from, int type = 0);
|
||||||
int resolve();
|
int resolve();
|
||||||
int destroy();
|
int destroy();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
APreventDamageTypesUEOT * clone() const;
|
APreventDamageTypesUEOT * clone() const;
|
||||||
~APreventDamageTypesUEOT();
|
~APreventDamageTypesUEOT();
|
||||||
};
|
};
|
||||||
@@ -4274,7 +4476,7 @@ public:
|
|||||||
AVanishing(GameObserver* observer, int _id, MTGCardInstance * card, ManaCost * _cost, int restrictions = 0,int amount = 0,string counterName = "");
|
AVanishing(GameObserver* observer, int _id, MTGCardInstance * card, ManaCost * _cost, int restrictions = 0,int amount = 0,string counterName = "");
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AVanishing * clone() const;
|
AVanishing * clone() const;
|
||||||
~AVanishing();
|
~AVanishing();
|
||||||
};
|
};
|
||||||
@@ -4296,7 +4498,7 @@ public:
|
|||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
AUpkeep * clone() const;
|
AUpkeep * clone() const;
|
||||||
~AUpkeep();
|
~AUpkeep();
|
||||||
@@ -4322,7 +4524,7 @@ public:
|
|||||||
MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = true,bool opponentturn = true,bool once = false);
|
MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = true,bool opponentturn = true,bool once = false);
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
APhaseAction * clone() const;
|
APhaseAction * clone() const;
|
||||||
~APhaseAction();
|
~APhaseAction();
|
||||||
};
|
};
|
||||||
@@ -4336,7 +4538,7 @@ public:
|
|||||||
APhaseActionGeneric(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions = 0, int _phase =
|
APhaseActionGeneric(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions = 0, int _phase =
|
||||||
MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = false,bool opponentturn = false,bool once = false);
|
MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = false,bool opponentturn = false,bool once = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
APhaseActionGeneric * clone() const;
|
APhaseActionGeneric * clone() const;
|
||||||
~APhaseActionGeneric();
|
~APhaseActionGeneric();
|
||||||
|
|
||||||
@@ -4356,7 +4558,7 @@ public:
|
|||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
void resolveBlink();
|
void resolveBlink();
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
ABlink * clone() const;
|
ABlink * clone() const;
|
||||||
~ABlink();
|
~ABlink();
|
||||||
private:
|
private:
|
||||||
@@ -4374,7 +4576,7 @@ public:
|
|||||||
MTGAbility * stored;
|
MTGAbility * stored;
|
||||||
ABlinkGeneric(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * _target,bool blinkueot=false,bool blinkForSource = false,bool blinkhand = false,MTGAbility * stored = NULL);
|
ABlinkGeneric(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * _target,bool blinkueot=false,bool blinkForSource = false,bool blinkhand = false,MTGAbility * stored = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
ABlinkGeneric * clone() const;
|
ABlinkGeneric * clone() const;
|
||||||
~ABlinkGeneric();
|
~ABlinkGeneric();
|
||||||
|
|
||||||
@@ -5280,7 +5482,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "phase alter";
|
return "phase alter";
|
||||||
}
|
}
|
||||||
@@ -5299,7 +5501,7 @@ public:
|
|||||||
AADepleter(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
AADepleter(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AADepleter * clone() const;
|
AADepleter * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5312,7 +5514,7 @@ public:
|
|||||||
AAModTurn(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbTurnStr, ManaCost * _cost = NULL,
|
AAModTurn(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbTurnStr, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAModTurn * clone() const;
|
AAModTurn * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5323,7 +5525,7 @@ public:
|
|||||||
AAShuffle(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
AAShuffle(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
||||||
TargetChooser::UNSET);
|
TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AAShuffle * clone() const;
|
AAShuffle * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5336,7 +5538,7 @@ public:
|
|||||||
|
|
||||||
AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string ManaDesc, int who = TargetChooser::UNSET);
|
AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string ManaDesc, int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AARemoveMana * clone() const;
|
AARemoveMana * clone() const;
|
||||||
~AARemoveMana();
|
~AARemoveMana();
|
||||||
|
|
||||||
@@ -5351,7 +5553,7 @@ public:
|
|||||||
AARandomDiscarder(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
AARandomDiscarder(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
|
||||||
int who = TargetChooser::UNSET);
|
int who = TargetChooser::UNSET);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
AARandomDiscarder * clone() const;
|
AARandomDiscarder * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5523,7 +5725,7 @@ public:
|
|||||||
|
|
||||||
int testDestroy(){return 0;};
|
int testDestroy(){return 0;};
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
int isReactingToTargetClick(Targetable * card);
|
int isReactingToTargetClick(Targetable * card);
|
||||||
int reactToTargetClick(Targetable * object);
|
int reactToTargetClick(Targetable * object);
|
||||||
MTGCardInstance * makeCard();
|
MTGCardInstance * makeCard();
|
||||||
@@ -5640,7 +5842,7 @@ public:
|
|||||||
MTGAbility * abilityAltered;
|
MTGAbility * abilityAltered;
|
||||||
AASetColorChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _color = 0 ,string toAdd = "");
|
AASetColorChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _color = 0 ,string toAdd = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AASetColorChosen * clone() const;
|
AASetColorChosen * clone() const;
|
||||||
~AASetColorChosen();
|
~AASetColorChosen();
|
||||||
};
|
};
|
||||||
@@ -5653,7 +5855,7 @@ public:
|
|||||||
MTGAbility * abilityAltered;
|
MTGAbility * abilityAltered;
|
||||||
AASetTypeChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _type = 0,string menu = "error" ,string toAdd = "");
|
AASetTypeChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _type = 0,string menu = "error" ,string toAdd = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AASetTypeChosen * clone() const;
|
AASetTypeChosen * clone() const;
|
||||||
~AASetTypeChosen();
|
~AASetTypeChosen();
|
||||||
};
|
};
|
||||||
@@ -5667,7 +5869,7 @@ public:
|
|||||||
bool ANonWall;
|
bool ANonWall;
|
||||||
GenericChooseTypeColor(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "",bool chooseColor = false,bool nonwall = false, ManaCost * cost = NULL);
|
GenericChooseTypeColor(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "",bool chooseColor = false,bool nonwall = false, ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
GenericChooseTypeColor * clone() const;
|
GenericChooseTypeColor * clone() const;
|
||||||
~GenericChooseTypeColor();
|
~GenericChooseTypeColor();
|
||||||
|
|
||||||
@@ -5684,7 +5886,7 @@ public:
|
|||||||
MTGAbility * abilityAltered;
|
MTGAbility * abilityAltered;
|
||||||
AASetCoin(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int side = -1,string toAdd = "");
|
AASetCoin(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int side = -1,string toAdd = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AASetCoin * clone() const;
|
AASetCoin * clone() const;
|
||||||
~AASetCoin();
|
~AASetCoin();
|
||||||
};
|
};
|
||||||
@@ -5695,7 +5897,7 @@ public:
|
|||||||
AASetCoin * setCoin;
|
AASetCoin * setCoin;
|
||||||
GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "", ManaCost * cost = NULL);
|
GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "", ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
GenericFlipACoin * clone() const;
|
GenericFlipACoin * clone() const;
|
||||||
~GenericFlipACoin();
|
~GenericFlipACoin();
|
||||||
|
|
||||||
@@ -5714,7 +5916,7 @@ public:
|
|||||||
|
|
||||||
GenericPaidAbility(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,string _newName,string _castRestriction,string _mayCost, string toAdd, ManaCost * cost = NULL);
|
GenericPaidAbility(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,string _newName,string _castRestriction,string _mayCost, string toAdd, ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
GenericPaidAbility * clone() const;
|
GenericPaidAbility * clone() const;
|
||||||
~GenericPaidAbility();
|
~GenericPaidAbility();
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class CardDescriptor: public MTGCardInstance
|
|||||||
string compareName;
|
string compareName;
|
||||||
int CDopponentDamaged;
|
int CDopponentDamaged;
|
||||||
int CDcontrollerDamaged;
|
int CDcontrollerDamaged;
|
||||||
|
int CDdamager;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ protected:
|
|||||||
/*
|
/*
|
||||||
** Tries to render the Big version of a card picture, backups to text version in case of failure
|
** 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);
|
static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false);
|
||||||
|
|
||||||
static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal);
|
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);
|
||||||
@@ -55,8 +55,8 @@ public:
|
|||||||
virtual void Render();
|
virtual void Render();
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
|
|
||||||
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal);
|
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
|
||||||
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal);
|
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
|
||||||
|
|
||||||
static JQuadPtr AlternateThumbQuad(MTGCard * card);
|
static JQuadPtr AlternateThumbQuad(MTGCard * card);
|
||||||
virtual ostream& toString(ostream&) const;
|
virtual ostream& toString(ostream&) const;
|
||||||
|
|||||||
@@ -101,10 +101,9 @@ public:
|
|||||||
int removeType(string value, int removeAll = 0);
|
int removeType(string value, int removeAll = 0);
|
||||||
int removeType(int value, int removeAll = 0);
|
int removeType(int value, int removeAll = 0);
|
||||||
bool hasSubtype(int _subtype);
|
bool hasSubtype(int _subtype);
|
||||||
bool hasSubtype(const char * _subtype);
|
|
||||||
bool hasSubtype(const string& _subtype);
|
bool hasSubtype(const string& _subtype);
|
||||||
bool hasType(int _type);
|
bool hasType(int _type);
|
||||||
bool hasType(const char * type);
|
bool hasType(const string& type);
|
||||||
|
|
||||||
void setManaCost(const string& value);
|
void setManaCost(const string& value);
|
||||||
ManaCost * getManaCost();
|
ManaCost * getManaCost();
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#ifndef _CAROUSEL_DECK_VIEW_H_
|
||||||
|
#define _CAROUSEL_DECK_VIEW_H_
|
||||||
|
|
||||||
|
#include "DeckView.h"
|
||||||
|
#include "Easing.h"
|
||||||
|
|
||||||
|
class CarouselDeckView : public DeckView
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
static const float max_scale;
|
||||||
|
static const float x_center;
|
||||||
|
static const float right_border;
|
||||||
|
static const float slide_animation_duration;
|
||||||
|
static const float scroll_animation_duration;
|
||||||
|
|
||||||
|
public:
|
||||||
|
CarouselDeckView();
|
||||||
|
virtual ~CarouselDeckView();
|
||||||
|
void Reset();
|
||||||
|
|
||||||
|
void UpdateViewState(float dt);
|
||||||
|
void UpdateCardPosition(int index);
|
||||||
|
void renderCard(int index)
|
||||||
|
{
|
||||||
|
int alpha = (int) (255 * (mCards[index].scale + 1.0 - max_scale));
|
||||||
|
DeckView::renderCard(index, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Render();
|
||||||
|
|
||||||
|
bool ButtonPressed(Buttons button);
|
||||||
|
MTGCard * Click(int x, int y);
|
||||||
|
MTGCard * Click();
|
||||||
|
|
||||||
|
void changePositionAnimated(int offset);
|
||||||
|
void changeFilterAnimated(int offset);
|
||||||
|
|
||||||
|
MTGCard *getActiveCard();
|
||||||
|
private:
|
||||||
|
float mScrollOffset, mSlideOffset;
|
||||||
|
InOutQuadEasing mScrollEasing;
|
||||||
|
InOutQuadEasing mSlideEasing;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //_CAROUSEL_DECK_VIEW_H_
|
||||||
@@ -17,7 +17,7 @@ private:
|
|||||||
StatsWrapper *stw;
|
StatsWrapper *stw;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const char * _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL);
|
DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const string& _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL);
|
||||||
void Render();
|
void Render();
|
||||||
virtual ~DeckEditorMenu();
|
virtual ~DeckEditorMenu();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public:
|
|||||||
virtual void Render();
|
virtual void Render();
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
using JGuiController::Add;
|
using JGuiController::Add;
|
||||||
virtual void Add(int id, const char * Text, string desc = "", bool forceFocus = false, DeckMetaData *deckMetaData = NULL);
|
virtual void Add(int id, const string& Text, const string& desc = "", bool forceFocus = false, DeckMetaData *deckMetaData = NULL);
|
||||||
virtual void Close();
|
virtual void Close();
|
||||||
void updateScroller();
|
void updateScroller();
|
||||||
void RenderBackground();
|
void RenderBackground();
|
||||||
|
|||||||
@@ -77,9 +77,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
void setDescription( const string description ) { mDescription = description; };
|
void setDescription( const string& description ) { mDescription = description; }
|
||||||
|
|
||||||
;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public:
|
|||||||
string getManaColorIndex();
|
string getManaColorIndex();
|
||||||
void updateStats(string filename, MTGAllCards * collection);
|
void updateStats(string filename, MTGAllCards * collection);
|
||||||
void updateStats(DeckDataWrapper *mtgDeck);
|
void updateStats(DeckDataWrapper *mtgDeck);
|
||||||
int countCardsByType(const char * _type, DeckDataWrapper * myDeck);
|
int countCardsByType(const string& _type, DeckDataWrapper * myDeck);
|
||||||
float noLuck(int n, int a, int x);
|
float noLuck(int n, int a, int x);
|
||||||
|
|
||||||
vector<string> aiDeckNames;
|
vector<string> aiDeckNames;
|
||||||
|
|||||||
@@ -0,0 +1,241 @@
|
|||||||
|
#ifndef _DECK_VIEW_H_
|
||||||
|
#define _DECK_VIEW_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "MTGCard.h"
|
||||||
|
#include "DeckDataWrapper.h"
|
||||||
|
#include "WFont.h"
|
||||||
|
#include "WResourceManager.h"
|
||||||
|
#include "Pos.h"
|
||||||
|
|
||||||
|
/*! \brief A abstract base class for deck views
|
||||||
|
*
|
||||||
|
* The deck editor uses a deck view to present the cards
|
||||||
|
* e.g. in a circular "Carousel" layout or in a flat grid
|
||||||
|
* layout. Both layouts inherit this base class to ensure
|
||||||
|
* a common interface which the deck editor can rely on.
|
||||||
|
*/
|
||||||
|
class DeckView
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
/*! \brief defines the delay until additional card informations get shown
|
||||||
|
*
|
||||||
|
* \note I am not entirely sure about that
|
||||||
|
*/
|
||||||
|
static const float no_user_activity_show_card_delay;
|
||||||
|
|
||||||
|
/*! \brief Represents a card for internal use in the deck view
|
||||||
|
*
|
||||||
|
* It stores positional information and a pointer to the actual card structure.
|
||||||
|
*/
|
||||||
|
struct CardRep{
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float scale;
|
||||||
|
MTGCard * card;
|
||||||
|
};
|
||||||
|
public:
|
||||||
|
/*! \brief Defines if the filter needs an update
|
||||||
|
*
|
||||||
|
* The owner of the deck that is shown is responsible for updating the filters.
|
||||||
|
*/
|
||||||
|
bool dirtyFilters;
|
||||||
|
|
||||||
|
/*! \brief Defines if the card positions need an update
|
||||||
|
*
|
||||||
|
* If the card positions are dirty, UpdateCardPosition will get called on
|
||||||
|
* all cards during Update(float dt);
|
||||||
|
*
|
||||||
|
* \see Update
|
||||||
|
* \see UpdateCardPosition
|
||||||
|
*/
|
||||||
|
bool dirtyCardPos;
|
||||||
|
|
||||||
|
/*! \brief Constructs the view and initializes datamembers
|
||||||
|
*
|
||||||
|
* It sets the dirty states to true, the currently shown deck to NULL and selects filter 0.
|
||||||
|
*
|
||||||
|
* \param numberOfCards the number of cards the view handles (this includes hidden cards for caching)
|
||||||
|
*/
|
||||||
|
DeckView(int numberOfCards);
|
||||||
|
|
||||||
|
/*! \brief Does nothing but is needed to ensure proper deletion of derived classes.
|
||||||
|
*/
|
||||||
|
virtual ~DeckView();
|
||||||
|
|
||||||
|
/*! \brief Resets nearly all datamembers to their initial values
|
||||||
|
*
|
||||||
|
* Does not reset mCards.
|
||||||
|
*/
|
||||||
|
virtual void Reset();
|
||||||
|
|
||||||
|
/*! \brief Advances the view by dt time units
|
||||||
|
*
|
||||||
|
* This method calls UpdateViewState unconditionally and UpdateCardPosition on every card
|
||||||
|
* if dirtyCardPos is set. It then resets dirtyCardPos.
|
||||||
|
*
|
||||||
|
* \param dt the number of time units to advance
|
||||||
|
* \see UpdateViewState
|
||||||
|
* \see UpdateCardPosition
|
||||||
|
*/
|
||||||
|
void Update(float dt);
|
||||||
|
|
||||||
|
/*! \brief Sets the deck that this view shows
|
||||||
|
*
|
||||||
|
* This method replaces the currently shown deck with toShow, sets all dirty states and
|
||||||
|
* reloads the mtg cards. No ownership changes.
|
||||||
|
*
|
||||||
|
* \param toShow the deck to show
|
||||||
|
* \see reloadIndexes
|
||||||
|
*/
|
||||||
|
void SetDeck(DeckDataWrapper *toShow);
|
||||||
|
|
||||||
|
/*! \brief Returns a pointer to the current deck.
|
||||||
|
*/
|
||||||
|
DeckDataWrapper *deck();
|
||||||
|
|
||||||
|
/*! \brief Performs an immediate switch of the filter without animations
|
||||||
|
*
|
||||||
|
* This method rotates the currently selected filter by delta and sets dirtyFilters.
|
||||||
|
*
|
||||||
|
* \param delta the filter to select relatively to the currently selected filter
|
||||||
|
* \see dirtyFilters
|
||||||
|
*/
|
||||||
|
void changeFilter(int delta);
|
||||||
|
|
||||||
|
/*! \brief Performs an immediate switch of the position without animations
|
||||||
|
*
|
||||||
|
* If the i-th card stored in mCards points to the j-th card in the deck, it will point
|
||||||
|
* to the (j+delta)-th card after this method is called. No dirty states are set.
|
||||||
|
*
|
||||||
|
* \param delta the number of cards to advances
|
||||||
|
* \see mCards
|
||||||
|
*/
|
||||||
|
void changePosition(int delta);
|
||||||
|
|
||||||
|
/*! \brief Returns the number of the currently selected filter
|
||||||
|
*
|
||||||
|
* \return the currently selected filter
|
||||||
|
*/
|
||||||
|
int filter();
|
||||||
|
|
||||||
|
/*! \brief Reloads the mtg card pointers of mCards from the deck
|
||||||
|
*
|
||||||
|
* This is called when: We change the position in the deck or the deck structure changes
|
||||||
|
* (due to filtering or addition or removal of cards).
|
||||||
|
*/
|
||||||
|
void reloadIndexes();
|
||||||
|
|
||||||
|
/*! \brief Returns the current position in the deck
|
||||||
|
*/
|
||||||
|
int getPosition();
|
||||||
|
|
||||||
|
/*! \brief Renders the view
|
||||||
|
*/
|
||||||
|
virtual void Render() = 0;
|
||||||
|
|
||||||
|
/*! \brief Reacts to selections by a pointer device (e. g. mouse, touch)
|
||||||
|
*
|
||||||
|
* If the selection in view internal i. e. a card got selected, there is
|
||||||
|
* no outside action performed and this method will return NULL. If a action got
|
||||||
|
* triggered i. e. a selected card was activated, it returns that card
|
||||||
|
* for further handling by the caller.
|
||||||
|
*
|
||||||
|
* \param x the x coordinate of the pointer during the action
|
||||||
|
* \param y the y coordinate of the pointer during the action
|
||||||
|
* \returns the card the action corresponds to
|
||||||
|
*/
|
||||||
|
virtual MTGCard * Click(int x, int y) = 0;
|
||||||
|
|
||||||
|
/*! \brief Reacts to selections by pointerless devices (e. g. buttons)
|
||||||
|
*
|
||||||
|
* \see Click(int x, int y)
|
||||||
|
* \returns the card the actions corresponds to
|
||||||
|
*/
|
||||||
|
virtual MTGCard * Click() = 0;
|
||||||
|
|
||||||
|
/*! \brief Handles ordinary button presses
|
||||||
|
*
|
||||||
|
* \param the pressed JButton
|
||||||
|
* \returns true if the view reacted to the button and false otherwise
|
||||||
|
*/
|
||||||
|
virtual bool ButtonPressed(Buttons button) = 0;
|
||||||
|
|
||||||
|
/*! \brief Returns the currently active card
|
||||||
|
*/
|
||||||
|
virtual MTGCard *getActiveCard() = 0;
|
||||||
|
|
||||||
|
/*! \brief Changes the position by a given offset
|
||||||
|
*
|
||||||
|
* Advances the view by offset cards and animates the change.
|
||||||
|
*
|
||||||
|
* \param offset the number of positions to advance
|
||||||
|
*/
|
||||||
|
virtual void changePositionAnimated(int offset) = 0;
|
||||||
|
|
||||||
|
/*! \brief Changes the filter by a given offset
|
||||||
|
*
|
||||||
|
* Rotates the selected filter by the given offset and animates the change.
|
||||||
|
*/
|
||||||
|
virtual void changeFilterAnimated(int offset) = 0;
|
||||||
|
protected:
|
||||||
|
|
||||||
|
/*! \brief The number of time units since an user activity occurred
|
||||||
|
*/
|
||||||
|
float last_user_activity;
|
||||||
|
|
||||||
|
/*! \brief The currently selected filter
|
||||||
|
*/
|
||||||
|
int mFilter;
|
||||||
|
|
||||||
|
/*! \brief The currently selected deck
|
||||||
|
*
|
||||||
|
* This class does not take ownership of the deck
|
||||||
|
*/
|
||||||
|
DeckDataWrapper *mCurrentDeck;
|
||||||
|
|
||||||
|
/*! \brief The card positions and pointers
|
||||||
|
*/
|
||||||
|
vector<CardRep> mCards;
|
||||||
|
|
||||||
|
/*! \brief Renders a card with given alpha value
|
||||||
|
*
|
||||||
|
* \param index of the card in mCards to render
|
||||||
|
* \param alpha the alpha value of the card
|
||||||
|
* \param asThumbnail renders the thumbnail image of the card if set to true
|
||||||
|
*
|
||||||
|
* \see mCards
|
||||||
|
*/
|
||||||
|
void renderCard(int index, int alpha, bool asThumbnail = false);
|
||||||
|
|
||||||
|
/*! \brief Returns the index in mCards of the card that is nearest to the given point
|
||||||
|
*
|
||||||
|
* \note This method uses the euclidian distance to the center of the card
|
||||||
|
*
|
||||||
|
* \param x the reference points x coordinate
|
||||||
|
* \param y the reference points y coordinate
|
||||||
|
* \returns the index of the nearest card to the reference point and -1 of mCards is empty
|
||||||
|
*/
|
||||||
|
int getCardIndexNextTo(int x, int y);
|
||||||
|
private:
|
||||||
|
|
||||||
|
/*! \brief Updates the state of the view e. g. view transitions
|
||||||
|
*
|
||||||
|
* \param dt the passes time since the last update
|
||||||
|
*/
|
||||||
|
virtual void UpdateViewState(float dt) = 0;
|
||||||
|
|
||||||
|
/*! \brief Updates the given card reps positional members
|
||||||
|
*
|
||||||
|
* This method is called from Update when dirtyCardPos is set
|
||||||
|
*
|
||||||
|
* \param index the index in mCards of the card to update
|
||||||
|
*
|
||||||
|
* \see Update
|
||||||
|
* \see mCards
|
||||||
|
*/
|
||||||
|
virtual void UpdateCardPosition(int index) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _DECK_VIEW_H_
|
||||||
@@ -0,0 +1,245 @@
|
|||||||
|
#ifndef _EASING_H_
|
||||||
|
#define _EASING_H_
|
||||||
|
|
||||||
|
/*! \brief A class for eased floats for use in animations
|
||||||
|
*
|
||||||
|
* Animations often defines values a floating point variable
|
||||||
|
* should have at given times and interpolates between them to
|
||||||
|
* calculate the value of that variable at any given intermediate
|
||||||
|
* time step.
|
||||||
|
*
|
||||||
|
* The simplest case would be linear interpolation:
|
||||||
|
* Suppose a float "position" should be a at time = 0 and
|
||||||
|
* b at time = x. If the current time is y, the value of
|
||||||
|
* "position" is then a + (b-a)*y/x.
|
||||||
|
*
|
||||||
|
* This class defines the interface needed to implement different
|
||||||
|
* kind of interpolations with a common interface. See
|
||||||
|
* http://www.gizma.com/easing/ for more information for a few
|
||||||
|
* examples.
|
||||||
|
*/
|
||||||
|
class Easing
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief The value at the start of an animation.
|
||||||
|
*
|
||||||
|
* start_value is undefined if no animation is running.
|
||||||
|
*/
|
||||||
|
float start_value;
|
||||||
|
|
||||||
|
/*! \brief The amount the value should change during the animation.
|
||||||
|
*
|
||||||
|
* delta_value is undefined if no animation is running.
|
||||||
|
*/
|
||||||
|
float delta_value;
|
||||||
|
|
||||||
|
/*! \brief The current value.
|
||||||
|
*
|
||||||
|
* Use this member to read the value or to write the value without
|
||||||
|
* to animate intermediate values and. Make sure that the easing
|
||||||
|
* is not used once value is deleted.
|
||||||
|
*/
|
||||||
|
float& value;
|
||||||
|
|
||||||
|
/*! \brief The duration the animation should take
|
||||||
|
*
|
||||||
|
* It is not relevant which unit is used. This value is undefined
|
||||||
|
* if no animation is running.
|
||||||
|
*/
|
||||||
|
float duration;
|
||||||
|
|
||||||
|
/*! \brief The accumulated time the animation did run until now.
|
||||||
|
*
|
||||||
|
* It is not relevant which unit is used. This values is undefined
|
||||||
|
* if no animation is running.
|
||||||
|
*/
|
||||||
|
float time_acc;
|
||||||
|
|
||||||
|
/*! \brief Sets Easing::float to val and sets the animation as not running.
|
||||||
|
*
|
||||||
|
* Make sure that the easing is not used once value is deleted.
|
||||||
|
*
|
||||||
|
* \param val The value to ease
|
||||||
|
*/
|
||||||
|
Easing(float& val): start_value(val), delta_value(0), value(val), duration(0), time_acc(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Resets the animation to its initial value
|
||||||
|
*
|
||||||
|
* This method does set the value to the start value and sets the passed time to 0.
|
||||||
|
* If there is no animation animation running, the resulting value is undefined.
|
||||||
|
*/
|
||||||
|
void reset()
|
||||||
|
{
|
||||||
|
value = start_value;
|
||||||
|
time_acc = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Finishes the animation immediately
|
||||||
|
*
|
||||||
|
* Sets the value to the animations target value and the passed time to the
|
||||||
|
* animations duration. If there is no animation running, the behaviour is undefined.
|
||||||
|
*/
|
||||||
|
void finish()
|
||||||
|
{
|
||||||
|
value = start_value + delta_value;
|
||||||
|
time_acc = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Lets dt time pass
|
||||||
|
*
|
||||||
|
* Advances the animation by dt time units and updates the value accordingly.
|
||||||
|
*
|
||||||
|
* \val dt The amount of time to jump forward
|
||||||
|
*/
|
||||||
|
void update(float dt)
|
||||||
|
{
|
||||||
|
if(time_acc < duration)
|
||||||
|
{
|
||||||
|
time_acc += dt;
|
||||||
|
|
||||||
|
if(time_acc > duration)
|
||||||
|
{
|
||||||
|
time_acc = duration;
|
||||||
|
value = start_value + delta_value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updateValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Calculates the value from all other members.
|
||||||
|
*
|
||||||
|
* This method gets implemented by all specific easing classes.
|
||||||
|
*/
|
||||||
|
virtual void updateValue() = 0;
|
||||||
|
|
||||||
|
/*! \brief Starts the animation.
|
||||||
|
*
|
||||||
|
* Starts the interpolation from the current value (now) to
|
||||||
|
* targetValue (in now + _duration).
|
||||||
|
*
|
||||||
|
* If the animation is currently running, it gets replaced.
|
||||||
|
*
|
||||||
|
* \param targetValue The value to interpolate to
|
||||||
|
* \param _duration The duration the interpolation should take
|
||||||
|
*/
|
||||||
|
void start(float targetValue, float _duration)
|
||||||
|
{
|
||||||
|
start_value = value;
|
||||||
|
delta_value = targetValue - start_value;
|
||||||
|
time_acc = 0;
|
||||||
|
duration = _duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Translates the current value and the target value by delta_value
|
||||||
|
*
|
||||||
|
* This method is mainly used for trickery. Suppose there is one object in the
|
||||||
|
* middle of the screen that should move to the top until it is outside of the
|
||||||
|
* screen and gets replaced by a second one entering the screen from the lower
|
||||||
|
* side once the first one disappeared. This method can be used to simulate this
|
||||||
|
* effect with one animation by translating (i.e. moving) the animation from the
|
||||||
|
* top to the bottom:
|
||||||
|
*
|
||||||
|
* Object1 and object2 are the same object: object1 whose y position is bound to value
|
||||||
|
* To start the transition, use start(SCREEN_HEIGHT, desired time); Once the first
|
||||||
|
* object left the screen (i.e. object.y < 0), change objects appearance to object2
|
||||||
|
* and translate the easing by (SCREEN_HEIGHT).
|
||||||
|
*
|
||||||
|
* \param delta_value The change in start_value and value
|
||||||
|
*/
|
||||||
|
void translate(float delta_value)
|
||||||
|
{
|
||||||
|
start_value += delta_value;
|
||||||
|
value += delta_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Returns if the passed time exceeds duration.
|
||||||
|
*
|
||||||
|
* If ther is no animation running, it is ensured that this is true.
|
||||||
|
*/
|
||||||
|
bool finished()
|
||||||
|
{
|
||||||
|
return time_acc >= duration;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! \brief This class defines an easing with quadratic acceleration
|
||||||
|
*/
|
||||||
|
class InQuadEasing : public Easing
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Calls Easing::Easing(val).
|
||||||
|
*
|
||||||
|
* \see Easing::Easing(float& val)
|
||||||
|
*/
|
||||||
|
InQuadEasing(float& val): Easing(val) {}
|
||||||
|
|
||||||
|
/*! \brief Implements the value calculation.
|
||||||
|
*
|
||||||
|
* \see Easing::updateValue()
|
||||||
|
*/
|
||||||
|
void updateValue()
|
||||||
|
{
|
||||||
|
float time_tmp = time_acc / duration;
|
||||||
|
value = delta_value * time_tmp * time_tmp + start_value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! \brief This class defines an easing with quadratic decceleration
|
||||||
|
*/
|
||||||
|
class OutQuadEasing : public Easing
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Calls Easing::Easing(val).
|
||||||
|
*
|
||||||
|
* \see Easing::Easing(float& val)
|
||||||
|
*/
|
||||||
|
OutQuadEasing(float& val): Easing(val) {}
|
||||||
|
|
||||||
|
/*! \brief Implements the value calculation.
|
||||||
|
*
|
||||||
|
* \see Easing::updateValue()
|
||||||
|
*/
|
||||||
|
void updateValue()
|
||||||
|
{
|
||||||
|
float time_tmp = time_acc / duration;
|
||||||
|
value = (-delta_value) * time_tmp * (time_tmp - 2.0f) + start_value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! \brief This class defines an easing with quadratic acceleration and decceleration.
|
||||||
|
*/
|
||||||
|
class InOutQuadEasing : public Easing
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*! \brief Calls Easing::Easing(val).
|
||||||
|
*
|
||||||
|
* \see Easing::Easing(float& val)
|
||||||
|
*/
|
||||||
|
InOutQuadEasing(float& val): Easing(val) {}
|
||||||
|
|
||||||
|
/*! \brief Implements the value calculation.
|
||||||
|
*
|
||||||
|
* \see Easing::updateValue()
|
||||||
|
*/
|
||||||
|
void updateValue()
|
||||||
|
{
|
||||||
|
float time_tmp = (time_acc * 2) / duration;
|
||||||
|
if (time_tmp < 1)
|
||||||
|
{
|
||||||
|
value = (float)(delta_value * 0.5 * time_tmp * time_tmp + start_value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
time_tmp -= 1;
|
||||||
|
value = (float)(- delta_value * 0.5 * (time_tmp * (time_tmp - 2) - 1) + start_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //_EASING_H_
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#ifndef _EFFECTS_H_
|
|
||||||
#define _EFFECTS_H_
|
|
||||||
|
|
||||||
#include <JGui.h>
|
|
||||||
|
|
||||||
class Effect: public JGuiObject
|
|
||||||
{
|
|
||||||
static int id_counter;
|
|
||||||
public:
|
|
||||||
Effect() : JGuiObject(++id_counter) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _EFFECTS_H_
|
|
||||||
@@ -90,6 +90,19 @@ public:
|
|||||||
virtual LifeCost * clone() const;
|
virtual LifeCost * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Specific life cost
|
||||||
|
class SpecificLifeCost : public ExtraCost
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
int slc;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SpecificLifeCost(TargetChooser *_tc = NULL, int slc = 0);
|
||||||
|
virtual int canPay();
|
||||||
|
virtual int doPay();
|
||||||
|
virtual SpecificLifeCost * clone() const;
|
||||||
|
};
|
||||||
|
|
||||||
//phyrexian mana
|
//phyrexian mana
|
||||||
class LifeorManaCost : public ExtraCost
|
class LifeorManaCost : public ExtraCost
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ class GameObserver{
|
|||||||
int cardClick(MTGCardInstance * card,Targetable * _object = NULL, bool log = true);
|
int cardClick(MTGCardInstance * card,Targetable * _object = NULL, bool log = true);
|
||||||
GamePhase getCurrentGamePhase();
|
GamePhase getCurrentGamePhase();
|
||||||
void setCurrentGamePhase(GamePhase phase) { mCurrentGamePhase = phase; };
|
void setCurrentGamePhase(GamePhase phase) { mCurrentGamePhase = phase; };
|
||||||
const char * getCurrentGamePhaseName();
|
const string& getCurrentGamePhaseName();
|
||||||
const char * getNextGamePhaseName();
|
const string& getNextGamePhaseName();
|
||||||
void nextCombatStep();
|
void nextCombatStep();
|
||||||
void userRequestNextGamePhase(bool allowInterrupt = true, bool log = true);
|
void userRequestNextGamePhase(bool allowInterrupt = true, bool log = true);
|
||||||
void cleanupPhase();
|
void cleanupPhase();
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ private:
|
|||||||
WSrcCards * setSrc;
|
WSrcCards * setSrc;
|
||||||
SimpleMenu * menu;
|
SimpleMenu * menu;
|
||||||
bool showMenu;
|
bool showMenu;
|
||||||
bool showAlt;
|
|
||||||
bool saveMe;
|
bool saveMe;
|
||||||
int mState;
|
int mState;
|
||||||
int mDetailItem;
|
int mDetailItem;
|
||||||
|
|||||||
@@ -19,22 +19,7 @@
|
|||||||
#include "WGui.h"
|
#include "WGui.h"
|
||||||
#include "InteractiveButton.h"
|
#include "InteractiveButton.h"
|
||||||
|
|
||||||
#define NO_USER_ACTIVITY_HELP_DELAY 10
|
class DeckView;
|
||||||
#define NO_USER_ACTIVITY_SHOWCARD_DELAY 0.1
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
STAGE_TRANSITION_RIGHT = 0,
|
|
||||||
STAGE_TRANSITION_LEFT = 1,
|
|
||||||
STAGE_WAITING = 2,
|
|
||||||
STAGE_TRANSITION_UP = 3,
|
|
||||||
STAGE_TRANSITION_DOWN = 4,
|
|
||||||
STAGE_ONSCREEN_MENU = 5,
|
|
||||||
STAGE_WELCOME = 6,
|
|
||||||
STAGE_MENU = 7,
|
|
||||||
STAGE_FILTERS = 8,
|
|
||||||
STAGE_TRANSITION_SELECTED = 9
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: need a better name for MENU_FIRST_MENU, this is reused for the 1st submenu of
|
// TODO: need a better name for MENU_FIRST_MENU, this is reused for the 1st submenu of
|
||||||
// available options in the duel menu
|
// available options in the duel menu
|
||||||
@@ -44,7 +29,7 @@ enum
|
|||||||
MENU_DECK_SELECTION = 10,
|
MENU_DECK_SELECTION = 10,
|
||||||
MENU_DECK_BUILDER = 11,
|
MENU_DECK_BUILDER = 11,
|
||||||
MENU_FIRST_DUEL_SUBMENU = 102,
|
MENU_FIRST_DUEL_SUBMENU = 102,
|
||||||
MENU_LANGUAGE_SELECTION = 103,
|
MENU_LANGUAGE_SELECTION = 103
|
||||||
};
|
};
|
||||||
|
|
||||||
// enums for menu options
|
// enums for menu options
|
||||||
@@ -64,79 +49,69 @@ enum DECK_VIEWER_MENU_ITEMS
|
|||||||
MENU_ITEM_NO = 21,
|
MENU_ITEM_NO = 21,
|
||||||
MENU_ITEM_FILTER_BY = 22,
|
MENU_ITEM_FILTER_BY = 22,
|
||||||
MENUITEM_MORE_INFO = kInfoMenuID
|
MENUITEM_MORE_INFO = kInfoMenuID
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ALL_COLORS -1
|
|
||||||
|
|
||||||
#define ROTATE_LEFT 1;
|
|
||||||
#define ROTATE_RIGHT 0;
|
|
||||||
|
|
||||||
#define HIGH_SPEED 15.0
|
|
||||||
#define MED_SPEED 5.0f
|
|
||||||
#define LOW_SPEED 1.5
|
|
||||||
|
|
||||||
#define MAX_SAVED_FILTERS Constants::NB_Colors + 1
|
|
||||||
#define CARDS_DISPLAYED 10
|
|
||||||
|
|
||||||
class GameStateDeckViewer: public GameState, public JGuiListener
|
class GameStateDeckViewer: public GameState, public JGuiListener
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
enum DeckViewerStages
|
||||||
|
{
|
||||||
|
STAGE_WAITING = 0,
|
||||||
|
STAGE_ONSCREEN_MENU,
|
||||||
|
STAGE_WELCOME,
|
||||||
|
STAGE_MENU,
|
||||||
|
STAGE_FILTERS
|
||||||
|
};
|
||||||
|
|
||||||
vector<JQuadPtr> mIcons;
|
vector<JQuadPtr> mIcons;
|
||||||
JQuadPtr pspIcons[8];
|
JQuadPtr pspIcons[8];
|
||||||
JTexture * pspIconsTexture;
|
JTexture * pspIconsTexture;
|
||||||
float last_user_activity;
|
float last_user_activity;
|
||||||
float onScreenTransition;
|
float onScreenTransition;
|
||||||
float mRotation;
|
DeckViewerStages mStage;
|
||||||
float mSlide;
|
|
||||||
int mAlpha;
|
|
||||||
int mStage;
|
|
||||||
int useFilter;
|
|
||||||
JMusic * bgMusic;
|
JMusic * bgMusic;
|
||||||
int lastPos;
|
|
||||||
int lastTotal;
|
|
||||||
int mSelected;
|
|
||||||
|
|
||||||
InteractiveButton *toggleDeckButton, *sellCardButton, *statsPrevButton, *filterButton;
|
InteractiveButton *toggleDeckButton, *sellCardButton, *statsPrevButton, *filterButton, *toggleViewButton;
|
||||||
|
|
||||||
WGuiFilters * filterMenu;
|
WGuiFilters * filterMenu;
|
||||||
WSrcDeckViewer * source;
|
WSrcDeckViewer * source;
|
||||||
|
|
||||||
DeckEditorMenu * welcome_menu;
|
DeckEditorMenu * welcome_menu;
|
||||||
SimpleMenu * subMenu;
|
SimpleMenu * subMenu;
|
||||||
DeckEditorMenu * menu;
|
DeckEditorMenu * deckMenu;
|
||||||
PriceList* pricelist;
|
PriceList* pricelist;
|
||||||
PlayerData * playerdata;
|
PlayerData * playerdata;
|
||||||
int price;
|
|
||||||
DeckDataWrapper * displayed_deck;
|
|
||||||
DeckDataWrapper * myDeck;
|
DeckDataWrapper * myDeck;
|
||||||
DeckDataWrapper * myCollection;
|
DeckDataWrapper * myCollection;
|
||||||
MTGCard * cardIndex[CARDS_DISPLAYED];
|
StatsWrapper * mStatsWrapper;
|
||||||
StatsWrapper *stw;
|
|
||||||
|
|
||||||
int hudAlpha;
|
int hudAlpha;
|
||||||
string newDeckname;
|
string newDeckname;
|
||||||
bool isAIDeckSave;
|
bool isAIDeckSave;
|
||||||
bool mSwitching;
|
bool mSwitching;
|
||||||
|
|
||||||
|
enum AvailableView{
|
||||||
|
CAROUSEL_VIEW,
|
||||||
|
GRID_VIEW
|
||||||
|
};
|
||||||
|
DeckView* mView;
|
||||||
|
AvailableView mCurrentView;
|
||||||
|
|
||||||
void saveDeck(); //Saves the deck and additional necessary information
|
void saveDeck(); //Saves the deck and additional necessary information
|
||||||
void saveAsAIDeck(string deckName); // saves deck as an AI Deck
|
void saveAsAIDeck(string deckName); // saves deck as an AI Deck
|
||||||
int getCurrentPos();
|
|
||||||
void sellCard();
|
void sellCard();
|
||||||
void setButtonState(bool state);
|
void setButtonState(bool state);
|
||||||
bool userPressedButton();
|
bool userPressedButton();
|
||||||
void RenderButtons();
|
void RenderButtons();
|
||||||
|
void setupView(AvailableView view, DeckDataWrapper *deck);
|
||||||
pair<float, float> cardsCoordinates[CARDS_DISPLAYED];
|
void toggleView();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GameStateDeckViewer(GameApp* parent);
|
GameStateDeckViewer(GameApp* parent);
|
||||||
virtual ~GameStateDeckViewer();
|
virtual ~GameStateDeckViewer();
|
||||||
void updateDecks();
|
void updateDecks();
|
||||||
void rotateCards(int direction);
|
|
||||||
void loadIndexes();
|
|
||||||
void updateFilters();
|
void updateFilters();
|
||||||
void rebuildFilters();
|
void rebuildFilters();
|
||||||
void switchDisplay();
|
void toggleCollection();
|
||||||
void Start();
|
void Start();
|
||||||
virtual void End();
|
virtual void End();
|
||||||
void addRemove(MTGCard * card);
|
void addRemove(MTGCard * card);
|
||||||
@@ -145,11 +120,8 @@ public:
|
|||||||
void renderSlideBar();
|
void renderSlideBar();
|
||||||
void renderDeckBackground();
|
void renderDeckBackground();
|
||||||
void renderOnScreenMenu();
|
void renderOnScreenMenu();
|
||||||
virtual void renderCard(int id, float rotation);
|
|
||||||
virtual void renderCard(int id);
|
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
int loadDeck(int deckid);
|
int loadDeck(int deckid);
|
||||||
void LoadDeckStatistics(int deckId);
|
|
||||||
|
|
||||||
void OnScroll(int inXVelocity, int inYVelocity);
|
void OnScroll(int inXVelocity, int inYVelocity);
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ private:
|
|||||||
JQuadPtr pspIcons[8];
|
JQuadPtr pspIcons[8];
|
||||||
WSrcCards * srcCards;
|
WSrcCards * srcCards;
|
||||||
TaskList * taskList;
|
TaskList * taskList;
|
||||||
float mElapsed;
|
|
||||||
WGuiMenu * shopMenu;
|
WGuiMenu * shopMenu;
|
||||||
WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom.
|
WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom.
|
||||||
WGuiCardImage * bigDisplay;
|
WGuiCardImage * bigDisplay;
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
#ifndef _GRID_DECK_VIEW_H
|
||||||
|
#define _GRID_DECK_VIEW_H
|
||||||
|
|
||||||
|
#include "DeckView.h"
|
||||||
|
#include "Easing.h"
|
||||||
|
|
||||||
|
/*! \brief Implements a grid view
|
||||||
|
*
|
||||||
|
* This view displays 12 cards in two rows as thumbnails. The currently
|
||||||
|
* selected card is dislayed bigger than the rest and uses the fullsize
|
||||||
|
* image. Scrolling the view horizontally and toggeling filters is
|
||||||
|
* animated and uses quadratic easing.
|
||||||
|
*
|
||||||
|
* It also implements a button mode for pointerless devices.
|
||||||
|
*/
|
||||||
|
class GridDeckView : public DeckView
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
static const float scroll_animation_duration;
|
||||||
|
static const float slide_animation_duration;
|
||||||
|
static const float card_scale_small;
|
||||||
|
static const float card_scale_big;
|
||||||
|
public:
|
||||||
|
/*! \brief Constructs a grid view with no decks set
|
||||||
|
*/
|
||||||
|
GridDeckView();
|
||||||
|
|
||||||
|
/*! \brief Does nothing but is needed to ensure proper deletion of derived classes.
|
||||||
|
*/
|
||||||
|
virtual ~GridDeckView();
|
||||||
|
|
||||||
|
/*! \brief Resets almost all member variables but mRows and mCols
|
||||||
|
*/
|
||||||
|
void Reset();
|
||||||
|
|
||||||
|
/*! \brief Advances scrolling and sliding animations
|
||||||
|
*
|
||||||
|
* \param dt the time since the last update
|
||||||
|
*
|
||||||
|
* \see DeckView::UpdateViewState()
|
||||||
|
*/
|
||||||
|
void UpdateViewState(float dt);
|
||||||
|
|
||||||
|
/*! \brief Updates the cards position
|
||||||
|
*
|
||||||
|
* \see DeckView::UpdateCardPosition()
|
||||||
|
*/
|
||||||
|
void UpdateCardPosition(int index);
|
||||||
|
|
||||||
|
/*! \brief Renders the view
|
||||||
|
*
|
||||||
|
* This method prefetches all rendered cards as thumbnails except the
|
||||||
|
* selected card to reduce cache pressure.
|
||||||
|
*/
|
||||||
|
void Render();
|
||||||
|
|
||||||
|
/*! \brief Handles button presses
|
||||||
|
*
|
||||||
|
* The mapping is as follows:
|
||||||
|
* JGE_BTN_LEFT moves the position to the left if not in button mode
|
||||||
|
* moves the selection otherwise
|
||||||
|
* JGE_BTN_RIGHT move the position to the right if not in button mode
|
||||||
|
* moves the selection otherwise
|
||||||
|
* JGE_BTN_UP select the previous filter if not in button mode
|
||||||
|
* moves the selection otherwise
|
||||||
|
* JGE_BTN_DOWN select the next filter if not in button mode
|
||||||
|
* moves the selection otherwise
|
||||||
|
* JGE_BTN_CTRL deactivate button mode
|
||||||
|
*
|
||||||
|
* \param button the pressed button
|
||||||
|
* \returns if the view handled the button
|
||||||
|
*/
|
||||||
|
bool ButtonPressed(Buttons button);
|
||||||
|
|
||||||
|
/*! \brief Handles clicks and triggers scrolling and the selection of cards
|
||||||
|
*
|
||||||
|
* This method deactivates the button mode and searches for the nearest
|
||||||
|
* card to the given position. If this card is in column 0 or 1 it scrolls
|
||||||
|
* left. If it is in column (mCols-1) or (mCols-2) it scrolls to the right.
|
||||||
|
* In any other case, it selects the card.
|
||||||
|
*
|
||||||
|
* \param x the clicks x coordinate
|
||||||
|
* \param y the clicks y coordinate
|
||||||
|
*
|
||||||
|
* \return selected card c if c was already selected and no animation is running, NULL otherwise
|
||||||
|
*/
|
||||||
|
MTGCard * Click(int x, int y);
|
||||||
|
|
||||||
|
/*! \brief Handles pointerless clicks (JGE_BTN_OK)
|
||||||
|
*
|
||||||
|
* If no card is selected, this method activates button mode and selects a card.
|
||||||
|
*
|
||||||
|
* \returns selected card, NULL otherwise
|
||||||
|
*/
|
||||||
|
MTGCard * Click();
|
||||||
|
|
||||||
|
/*! \brief Scrolls the view horizontally
|
||||||
|
*
|
||||||
|
* \param offset the number of columns to scroll
|
||||||
|
*/
|
||||||
|
void changePositionAnimated(int offset);
|
||||||
|
|
||||||
|
/*! \brief Rotates the selected filter and slides vertically
|
||||||
|
*
|
||||||
|
* \param the number of filters to rotate
|
||||||
|
*/
|
||||||
|
void changeFilterAnimated(int offset);
|
||||||
|
|
||||||
|
/*! \brief Returns the currently selected card
|
||||||
|
*
|
||||||
|
* \returns card c if c is selected and in column 4 to 6 and NULL otherwise*/
|
||||||
|
MTGCard *getActiveCard();
|
||||||
|
private:
|
||||||
|
/*! \brief The amount of columns (visible and hidden)
|
||||||
|
*/
|
||||||
|
const int mCols;
|
||||||
|
|
||||||
|
/*! \brief The amount of rows
|
||||||
|
*/
|
||||||
|
const int mRows;
|
||||||
|
|
||||||
|
/*! \brief The current scrolling offset
|
||||||
|
*/
|
||||||
|
float mScrollOffset;
|
||||||
|
|
||||||
|
/*! \brief The current sliding offset
|
||||||
|
*/
|
||||||
|
float mSlideOffset;
|
||||||
|
|
||||||
|
/*! \brief The easing functor that gets applied while scrolling
|
||||||
|
*/
|
||||||
|
InOutQuadEasing mScrollEasing;
|
||||||
|
|
||||||
|
/*! \brief The easing functor that gets applied while sliding
|
||||||
|
*/
|
||||||
|
InOutQuadEasing mSlideEasing;
|
||||||
|
|
||||||
|
/*! \brief The current selected card index
|
||||||
|
*/
|
||||||
|
int mCurrentSelection;
|
||||||
|
|
||||||
|
/*! \brief Stores if we are in button mode.
|
||||||
|
*/
|
||||||
|
bool mButtonMode;
|
||||||
|
|
||||||
|
/*! \brief Moves the card selection by an offset.
|
||||||
|
*
|
||||||
|
* \param offset the offset to move the selection
|
||||||
|
* \param alignIfOutOfBounds the view will scroll if the selection moves out of bound if set to true
|
||||||
|
*/
|
||||||
|
void moveSelection(int offset, bool alignIfOutOfBounds);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //_GRID_DECK_VIEW_H
|
||||||
@@ -6,8 +6,9 @@
|
|||||||
#include <hge/hgeparticle.h>
|
#include <hge/hgeparticle.h>
|
||||||
#include "JGE.h"
|
#include "JGE.h"
|
||||||
#include "MTGDefinitions.h"
|
#include "MTGDefinitions.h"
|
||||||
#include "GameApp.h"
|
#include "Pos.h"
|
||||||
#include "GuiLayers.h"
|
#include "GuiLayers.h"
|
||||||
|
#include "WResource_Fwd.h"
|
||||||
|
|
||||||
class ManaIcon : public Pos
|
class ManaIcon : public Pos
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,15 +4,25 @@
|
|||||||
#include "GuiLayers.h"
|
#include "GuiLayers.h"
|
||||||
#include "PhaseRing.h"
|
#include "PhaseRing.h"
|
||||||
#include "WEvent.h"
|
#include "WEvent.h"
|
||||||
|
#include "PlayGuiObject.h"
|
||||||
|
|
||||||
|
#include "Easing.h"
|
||||||
|
|
||||||
class GuiPhaseBar: public GuiLayer, public PlayGuiObject
|
class GuiPhaseBar: public GuiLayer, public PlayGuiObject
|
||||||
{
|
{
|
||||||
protected:
|
private:
|
||||||
Phase* phase;
|
static const float zoom_big;
|
||||||
|
static const float zoom_small;
|
||||||
|
static const float step;
|
||||||
|
|
||||||
|
int displayedPhaseId;
|
||||||
float angle;
|
float angle;
|
||||||
float zoomFactor;
|
float zoomFactor;
|
||||||
DuelLayers* mpDuelLayers;
|
OutQuadEasing angleEasing;
|
||||||
|
InOutQuadEasing zoomFactorEasing;
|
||||||
|
DuelLayers* mpDuelLayers;
|
||||||
|
|
||||||
|
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale);
|
||||||
public:
|
public:
|
||||||
GuiPhaseBar(DuelLayers* duelLayers);
|
GuiPhaseBar(DuelLayers* duelLayers);
|
||||||
~GuiPhaseBar();
|
~GuiPhaseBar();
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ protected:
|
|||||||
{
|
{
|
||||||
static const float HEIGHT;
|
static const float HEIGHT;
|
||||||
unsigned attackers;
|
unsigned attackers;
|
||||||
unsigned blockers;
|
|
||||||
unsigned currentAttacker;
|
unsigned currentAttacker;
|
||||||
float height;
|
float height;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const int kNextStatsButtonId = 10005;
|
|||||||
const int kPrevStatsButtonId = 10006;
|
const int kPrevStatsButtonId = 10006;
|
||||||
const int kCycleCardsButtonId = 10007;
|
const int kCycleCardsButtonId = 10007;
|
||||||
const int kShowCardListButtonId = 10008;
|
const int kShowCardListButtonId = 10008;
|
||||||
|
const int kSwitchViewButton = 10009;
|
||||||
|
|
||||||
class InteractiveButton: public SimpleButton
|
class InteractiveButton: public SimpleButton
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ public:
|
|||||||
virtual TargetAbility* clone() const = 0;
|
virtual TargetAbility* clone() const = 0;
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
virtual int resolve();
|
virtual int resolve();
|
||||||
virtual const char * getMenuText();
|
virtual const string getMenuText();
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -436,7 +436,7 @@ public:
|
|||||||
|
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
virtual GenericTriggeredAbility* clone() const;
|
virtual GenericTriggeredAbility* clone() const;
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
~GenericTriggeredAbility();
|
~GenericTriggeredAbility();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -525,7 +525,7 @@ public:
|
|||||||
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
|
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
int reactToClick(MTGCardInstance* _card);
|
int reactToClick(MTGCardInstance* _card);
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
~AManaProducer();
|
~AManaProducer();
|
||||||
virtual AManaProducer * clone() const;
|
virtual AManaProducer * clone() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public:
|
|||||||
bool wasDealtDamage;
|
bool wasDealtDamage;
|
||||||
bool damageToOpponent;
|
bool damageToOpponent;
|
||||||
bool damageToController;
|
bool damageToController;
|
||||||
|
bool damageToCreature;
|
||||||
bool mPropertiesChangedSinceLastUpdate;
|
bool mPropertiesChangedSinceLastUpdate;
|
||||||
int reduxamount;
|
int reduxamount;
|
||||||
int flanked;
|
int flanked;
|
||||||
@@ -129,11 +130,11 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//types
|
//types
|
||||||
void addType(char * type_text);
|
void addType(const string& type_text);
|
||||||
virtual void addType(int id);
|
virtual void addType(int id);
|
||||||
void setType(const char * type_text);
|
void setType(const string& type_text);
|
||||||
void setSubtype( string value);
|
void setSubtype(const string &value);
|
||||||
int removeType(string value, int removeAll = 0);
|
int removeType(const string &value, int removeAll = 0);
|
||||||
int removeType(int value, int removeAll = 0);
|
int removeType(int value, int removeAll = 0);
|
||||||
|
|
||||||
//dangerranking is a hint to Ai which creatures are the ones it should be targetting for effects.
|
//dangerranking is a hint to Ai which creatures are the ones it should be targetting for effects.
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#define MTG_ERROR -1
|
#define MTG_ERROR -1
|
||||||
|
|
||||||
#include "MTGDefinitions.h"
|
#include "MTGDefinitions.h"
|
||||||
#include "GameApp.h"
|
|
||||||
#include "WResourceManager.h"
|
#include "WResourceManager.h"
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <Threading.h>
|
#include <Threading.h>
|
||||||
@@ -19,7 +18,7 @@ class MTGPack;
|
|||||||
class MTGSetInfo
|
class MTGSetInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MTGSetInfo(string _id);
|
MTGSetInfo(const string& _id);
|
||||||
~MTGSetInfo();
|
~MTGSetInfo();
|
||||||
string id; //Short name: 10E, RAV, etc. Automatic from folder.
|
string id; //Short name: 10E, RAV, etc. Automatic from folder.
|
||||||
string author; //Author of set, for crediting mod makers, etc.
|
string author; //Author of set, for crediting mod makers, etc.
|
||||||
@@ -70,7 +69,7 @@ public:
|
|||||||
MTGSets();
|
MTGSets();
|
||||||
~MTGSets();
|
~MTGSets();
|
||||||
|
|
||||||
int Add(const char * subtype);
|
int Add(const string& subtype);
|
||||||
int findSet(string value);
|
int findSet(string value);
|
||||||
int findBlock(string s);
|
int findBlock(string s);
|
||||||
int size();
|
int size();
|
||||||
@@ -127,8 +126,10 @@ public:
|
|||||||
MTGCard * getCardByName(string name);
|
MTGCard * getCardByName(string name);
|
||||||
void loadFolder(const string& folder, const string& filename="" );
|
void loadFolder(const string& folder, const string& filename="" );
|
||||||
|
|
||||||
int load(const char * config_file, const char * setName = NULL, int autoload = 1);
|
int load(const string& config_file);
|
||||||
int countByType(const char * _type);
|
int load(const string& config_file, const string& setName);
|
||||||
|
int load(const string& config_file, int set_id);
|
||||||
|
int countByType(const string& _type);
|
||||||
int countByColor(int color);
|
int countByColor(int color);
|
||||||
int countBySet(int setId);
|
int countBySet(int setId);
|
||||||
int totalCards();
|
int totalCards();
|
||||||
@@ -136,7 +137,7 @@ public:
|
|||||||
|
|
||||||
static int findType(string subtype, bool forceAdd = true) {
|
static int findType(string subtype, bool forceAdd = true) {
|
||||||
boost::mutex::scoped_lock lock(instance->mMutex);
|
boost::mutex::scoped_lock lock(instance->mMutex);
|
||||||
int result = instance->subtypesList.find(subtype, forceAdd);
|
int result = instance->subtypesList.find(subtype, forceAdd);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
static int add(string value, unsigned int parentType) {
|
static int add(string value, unsigned int parentType) {
|
||||||
@@ -218,8 +219,8 @@ public:
|
|||||||
int totalCards();
|
int totalCards();
|
||||||
int totalPrice();
|
int totalPrice();
|
||||||
MTGDeck(MTGAllCards * _allcards);
|
MTGDeck(MTGAllCards * _allcards);
|
||||||
MTGDeck(const char * config_file, MTGAllCards * _allcards, int meta_only = 0,int difficultySetting = 0);
|
MTGDeck(const string& config_file, MTGAllCards * _allcards, int meta_only = 0,int difficultySetting = 0);
|
||||||
int addRandomCards(int howmany, int * setIds = NULL, int nbSets = 0, int rarity = -1, const char * subtype = NULL,
|
int addRandomCards(int howmany, int * setIds = NULL, int nbSets = 0, int rarity = -1, const string& subtype = "",
|
||||||
int * colors = NULL, int nbcolors = 0);
|
int * colors = NULL, int nbcolors = 0);
|
||||||
int add(int cardid);
|
int add(int cardid);
|
||||||
int add(MTGDeck * deck); // adds the contents of "deck" into myself
|
int add(MTGDeck * deck); // adds the contents of "deck" into myself
|
||||||
|
|||||||
@@ -218,7 +218,8 @@ class Constants
|
|||||||
soulbond = 100,
|
soulbond = 100,
|
||||||
LURE = 101,
|
LURE = 101,
|
||||||
NOLEGEND = 102,
|
NOLEGEND = 102,
|
||||||
NB_BASIC_ABILITIES = 103,
|
CANPLAYFROMGRAVEYARD = 103,
|
||||||
|
NB_BASIC_ABILITIES = 104,
|
||||||
|
|
||||||
|
|
||||||
RARITY_S = 'S', //Special Rarity
|
RARITY_S = 'S', //Special Rarity
|
||||||
@@ -293,7 +294,7 @@ class Constants
|
|||||||
|
|
||||||
static map<string,int> MTGBasicAbilitiesMap;
|
static map<string,int> MTGBasicAbilitiesMap;
|
||||||
static const char* MTGBasicAbilities[];
|
static const char* MTGBasicAbilities[];
|
||||||
static const char* MTGPhaseNames[];
|
static const string MTGPhaseNames[];
|
||||||
static const char* MTGPhaseCodeNames[];
|
static const char* MTGPhaseCodeNames[];
|
||||||
|
|
||||||
static int GetBasicAbilityIndex(string mtgAbility);
|
static int GetBasicAbilityIndex(string mtgAbility);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class MTGGameZone {
|
|||||||
void cleanupPhase();
|
void cleanupPhase();
|
||||||
void beforeBeginPhase();
|
void beforeBeginPhase();
|
||||||
|
|
||||||
unsigned int countByType(const char * value);
|
unsigned int countByType(const string &value);
|
||||||
unsigned int countByCanTarget(TargetChooser * tc);
|
unsigned int countByCanTarget(TargetChooser * tc);
|
||||||
unsigned int countTotalManaSymbols(TargetChooser * tc, int color);
|
unsigned int countTotalManaSymbols(TargetChooser * tc, int color);
|
||||||
MTGCardInstance * findByName(string name);
|
MTGCardInstance * findByName(string name);
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public:
|
|||||||
MTGEventBonus(GameObserver* observer, int _id);
|
MTGEventBonus(GameObserver* observer, int _id);
|
||||||
virtual MTGEventBonus * clone() const;
|
virtual MTGEventBonus * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MTGPutInPlayRule: public PermanentAbility
|
class MTGPutInPlayRule: public PermanentAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -73,7 +74,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGPutInPlayRule(GameObserver* observer, int _id);
|
MTGPutInPlayRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "cast card normally";
|
return "cast card normally";
|
||||||
}
|
}
|
||||||
@@ -87,7 +88,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGKickerRule(GameObserver* observer, int _id);
|
MTGKickerRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "pay kicker";
|
return "pay kicker";
|
||||||
}
|
}
|
||||||
@@ -105,7 +106,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGAlternativeCostRule(GameObserver* observer, int _id);
|
MTGAlternativeCostRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
if(alternativeName.size())
|
if(alternativeName.size())
|
||||||
return alternativeName.c_str();
|
return alternativeName.c_str();
|
||||||
@@ -121,7 +122,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGBuyBackRule(GameObserver* observer, int _id);
|
MTGBuyBackRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "cast and buy back";
|
return "cast and buy back";
|
||||||
}
|
}
|
||||||
@@ -136,7 +137,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGFlashBackRule(GameObserver* observer, int _id);
|
MTGFlashBackRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "flash back";
|
return "flash back";
|
||||||
}
|
}
|
||||||
@@ -150,7 +151,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGRetraceRule(GameObserver* observer, int _id);
|
MTGRetraceRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "retrace";
|
return "retrace";
|
||||||
}
|
}
|
||||||
@@ -165,13 +166,28 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGMorphCostRule(GameObserver* observer, int _id);
|
MTGMorphCostRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "play morphed";
|
return "play morphed";
|
||||||
}
|
}
|
||||||
virtual MTGMorphCostRule * clone() const;
|
virtual MTGMorphCostRule * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MTGPlayFromGraveyardRule: public MTGAlternativeCostRule
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||||
|
int reactToClick(MTGCardInstance * card);
|
||||||
|
virtual ostream& toString(ostream& out) const;
|
||||||
|
MTGPlayFromGraveyardRule(GameObserver* observer, int _id);
|
||||||
|
const string getMenuText()
|
||||||
|
{
|
||||||
|
return "cast card from graveyard";
|
||||||
|
}
|
||||||
|
virtual MTGPlayFromGraveyardRule * clone() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class MTGSuspendRule: public MTGAlternativeCostRule
|
class MTGSuspendRule: public MTGAlternativeCostRule
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -181,7 +197,7 @@ public:
|
|||||||
string suspendmenu;
|
string suspendmenu;
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGSuspendRule(GameObserver* observer, int _id);
|
MTGSuspendRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
virtual MTGSuspendRule * clone() const;
|
virtual MTGSuspendRule * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -195,7 +211,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGAttackRule(GameObserver* observer, int _id);
|
MTGAttackRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Attacker";
|
return "Attacker";
|
||||||
}
|
}
|
||||||
@@ -213,7 +229,7 @@ public:
|
|||||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
MTGPlaneswalkerAttackRule(GameObserver* observer, int _id);
|
MTGPlaneswalkerAttackRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Attack Planeswalker";
|
return "Attack Planeswalker";
|
||||||
}
|
}
|
||||||
@@ -226,7 +242,7 @@ public:
|
|||||||
MTGCardInstance* attacker;
|
MTGCardInstance* attacker;
|
||||||
AAPlaneswalkerAttacked(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
|
AAPlaneswalkerAttacked(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char* getMenuText();
|
const string getMenuText();
|
||||||
AAPlaneswalkerAttacked * clone() const;
|
AAPlaneswalkerAttacked * clone() const;
|
||||||
~AAPlaneswalkerAttacked();
|
~AAPlaneswalkerAttacked();
|
||||||
};
|
};
|
||||||
@@ -252,7 +268,7 @@ public:
|
|||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
MTGBlockRule(GameObserver* observer, int _id);
|
MTGBlockRule(GameObserver* observer, int _id);
|
||||||
const char * getMenuText();
|
const string getMenuText();
|
||||||
virtual MTGBlockRule * clone() const;
|
virtual MTGBlockRule * clone() const;
|
||||||
~MTGBlockRule();
|
~MTGBlockRule();
|
||||||
};
|
};
|
||||||
@@ -386,7 +402,7 @@ public:
|
|||||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||||
int reactToClick(MTGCardInstance * card);
|
int reactToClick(MTGCardInstance * card);
|
||||||
int reactToClick(MTGCardInstance * card, int id);
|
int reactToClick(MTGCardInstance * card, int id);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Momir";
|
return "Momir";
|
||||||
}
|
}
|
||||||
@@ -406,7 +422,7 @@ public:
|
|||||||
MTGCardInstance * genEquip(int id);
|
MTGCardInstance * genEquip(int id);
|
||||||
MTGStoneHewerRule(GameObserver* observer, int _id, MTGAllCards * _collection);
|
MTGStoneHewerRule(GameObserver* observer, int _id, MTGAllCards * _collection);
|
||||||
int receiveEvent(WEvent * event);
|
int receiveEvent(WEvent * event);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Stone Hewer";
|
return "Stone Hewer";
|
||||||
}
|
}
|
||||||
@@ -419,7 +435,7 @@ class MTGHermitRule: public PermanentAbility
|
|||||||
public:
|
public:
|
||||||
MTGHermitRule(GameObserver* observer, int _id);
|
MTGHermitRule(GameObserver* observer, int _id);
|
||||||
int receiveEvent(WEvent * event);
|
int receiveEvent(WEvent * event);
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Hermit";
|
return "Hermit";
|
||||||
}
|
}
|
||||||
@@ -447,7 +463,7 @@ public:
|
|||||||
|
|
||||||
int receiveEvent(WEvent * event);
|
int receiveEvent(WEvent * event);
|
||||||
|
|
||||||
const char * getMenuText()
|
const string getMenuText()
|
||||||
{
|
{
|
||||||
return "Deathtouch";
|
return "Deathtouch";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef OBJECTANALYTICS_H
|
#ifndef OBJECTANALYTICS_H
|
||||||
#define OBJECTANALYTICS_H
|
#define OBJECTANALYTICS_H
|
||||||
|
|
||||||
|
#include <boost/cstdint.hpp>
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define TRACK_OBJECT_USAGE
|
#define TRACK_OBJECT_USAGE
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include <JGui.h>
|
#include <JGui.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "GameApp.h"
|
|
||||||
#include "GameStateOptions.h"
|
#include "GameStateOptions.h"
|
||||||
#include "WFilter.h"
|
#include "WFilter.h"
|
||||||
#include "WDataSrc.h"
|
#include "WDataSrc.h"
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
int addCombatAfter(Player* player, int after_id, bool withMain = false);
|
int addCombatAfter(Player* player, int after_id, bool withMain = false);
|
||||||
int addPhaseAfter(GamePhase id, Player* player, int after_id);
|
int addPhaseAfter(GamePhase id, Player* player, int after_id);
|
||||||
int removePhase(int id);
|
int removePhase(int id);
|
||||||
const char * phaseName(int id);
|
const string& phaseName(int id);
|
||||||
static GamePhase phaseStrToInt(string s);
|
static GamePhase phaseStrToInt(string s);
|
||||||
static string phaseIntToStr(int id);
|
static string phaseIntToStr(int id);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#define GUI_OPPONENTHAND 5
|
#define GUI_OPPONENTHAND 5
|
||||||
|
|
||||||
#include <JGui.h>
|
#include <JGui.h>
|
||||||
#include "Effects.h"
|
|
||||||
#include "WEvent.h"
|
#include "WEvent.h"
|
||||||
#include "Pos.h"
|
#include "Pos.h"
|
||||||
|
|
||||||
@@ -65,7 +64,6 @@ public:
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
virtual ~PlayGuiObject() {};
|
virtual ~PlayGuiObject() {};
|
||||||
vector<Effect*> effects;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,16 +20,18 @@ public:
|
|||||||
~PriceList();
|
~PriceList();
|
||||||
int save();
|
int save();
|
||||||
int getSellPrice(int cardid);
|
int getSellPrice(int cardid);
|
||||||
|
int getSellPrice(MTGCard* card);
|
||||||
int getPurchasePrice(int cardid);
|
int getPurchasePrice(int cardid);
|
||||||
|
int getPrice(MTGCard *card);
|
||||||
int getPrice(int cardId);
|
int getPrice(int cardId);
|
||||||
int setPrice(int cardId, int price);
|
int setPrice(int cardId, int price);
|
||||||
|
int setPrice(MTGCard *card, int price);
|
||||||
int getOtherPrice(int amt);
|
int getOtherPrice(int amt);
|
||||||
static float difficultyScalar(float price, int cardid = 0);
|
static float difficultyScalar(float price, int cardid = 0);
|
||||||
static void updateKey()
|
static void updateKey()
|
||||||
{
|
{
|
||||||
randomKey = rand();
|
randomKey = rand();
|
||||||
}
|
}
|
||||||
;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
virtual bool CheckUserInput(JButton key);
|
virtual bool CheckUserInput(JButton key);
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
using JGuiController::Add;
|
using JGuiController::Add;
|
||||||
virtual void Add(int id, const char * Text, string desc = "", bool forceFocus = false);
|
virtual void Add(int id, const string &Text, string desc = "", bool forceFocus = false);
|
||||||
int getmCurr(){return mCurr;}
|
int getmCurr(){return mCurr;}
|
||||||
float getWidth(){return mWidth; }
|
float getWidth(){return mWidth; }
|
||||||
virtual void Close();
|
virtual void Close();
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class SimplePopup: public JGuiController
|
|||||||
private:
|
private:
|
||||||
float mWidth, mX, mY;
|
float mWidth, mX, mY;
|
||||||
int mMaxLines;
|
int mMaxLines;
|
||||||
int mFontId;
|
|
||||||
DeckMetaData * mDeckInformation;
|
DeckMetaData * mDeckInformation;
|
||||||
string mTitle;
|
string mTitle;
|
||||||
WFont *mTextFont;
|
WFont *mTextFont;
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
#define TASK_H
|
#define TASK_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "Easing.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class GameObserver;
|
||||||
|
class JQuad;
|
||||||
|
class JTexture;
|
||||||
|
|
||||||
// Task type constant
|
// Task type constant
|
||||||
|
|
||||||
@@ -70,8 +79,11 @@ class TaskList
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
string fileName;
|
string fileName;
|
||||||
|
|
||||||
float vPos;
|
float vPos;
|
||||||
float mElapsed;
|
OutQuadEasing vPosInEasing;
|
||||||
|
InQuadEasing vPosOutEasing;
|
||||||
|
|
||||||
int mState;
|
int mState;
|
||||||
JQuad * mBg[9];
|
JQuad * mBg[9];
|
||||||
JTexture * mBgTex;
|
JTexture * mBgTex;
|
||||||
@@ -95,7 +107,6 @@ public:
|
|||||||
{
|
{
|
||||||
return mState;
|
return mState;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
void addTask(string params, bool rand = false);
|
void addTask(string params, bool rand = false);
|
||||||
void addTask(Task *task);
|
void addTask(Task *task);
|
||||||
void addRandomTask(int diff = 100);
|
void addRandomTask(int diff = 100);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include "MTGDeck.h"
|
||||||
|
|
||||||
#ifndef _WFILTER_H_
|
#ifndef _WFILTER_H_
|
||||||
#define _WFILTER_H_
|
#define _WFILTER_H_
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
class hgeDistortionMesh;
|
class hgeDistortionMesh;
|
||||||
class GameStateOptions;
|
class GameStateOptions;
|
||||||
|
class SimpleMenu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@defgroup WGui Basic Gui
|
@defgroup WGui Basic Gui
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#ifndef WRESOURCE_FWD_H
|
#ifndef WRESOURCE_FWD_H
|
||||||
#define WRESOURCE_FWD_H
|
#define WRESOURCE_FWD_H
|
||||||
|
|
||||||
#ifndef WP8
|
#if (__cplusplus > 199711L)
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
typedef boost::shared_ptr<JQuad> JQuadPtr;
|
|
||||||
#else
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
typedef std::shared_ptr<JQuad> JQuadPtr;
|
typedef std::shared_ptr<JQuad> JQuadPtr;
|
||||||
|
#else
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
typedef boost::shared_ptr<JQuad> JQuadPtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef _DEBUG_H_
|
#ifndef _DEBUG_H_
|
||||||
#define _DEBUG_H_
|
#define _DEBUG_H_
|
||||||
|
|
||||||
#if ((defined WIN32) || (defined WP8))
|
#if ((defined WIN32) || (defined WP8)) && !defined(__MINGW32__)
|
||||||
#define snprintf sprintf_s
|
#define snprintf sprintf_s
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
#include "DebugRoutines.h"
|
#include "DebugRoutines.h"
|
||||||
|
|
||||||
@@ -140,4 +141,20 @@ template <class T> istream& operator>>(istream& in, T& p)
|
|||||||
/* replace_all ... replacement to avoid depending on boost for that */
|
/* replace_all ... replacement to avoid depending on boost for that */
|
||||||
void ReplaceString(std::string& subject, const std::string& search, const std::string& replace);
|
void ReplaceString(std::string& subject, const std::string& search, const std::string& replace);
|
||||||
|
|
||||||
|
/*! \brief Returns true if base starts with start, otherwise false
|
||||||
|
*
|
||||||
|
* Compares the first strlen(start) characters of base with start and
|
||||||
|
* returns true if both match.
|
||||||
|
*/
|
||||||
|
bool StartsWith(const std::string& base, const char *start);
|
||||||
|
|
||||||
|
/*! \brief Returns true if base starts with start, otherwise false
|
||||||
|
*
|
||||||
|
* This version is slightly more efficient as strlen does not need to
|
||||||
|
* get called. Otherwise, it behaves exactly like
|
||||||
|
* StartsWith(const std::string& base, const char *start)
|
||||||
|
*
|
||||||
|
* \see StartsWith(const std::string& base, const char *start)
|
||||||
|
*/
|
||||||
|
bool StartsWith(const std::string& base, const std::string& start);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB
|
|||||||
int comboPartsRestriction = 0;
|
int comboPartsRestriction = 0;
|
||||||
|
|
||||||
if(gotCombo)
|
if(gotCombo)
|
||||||
return gotCombo;//because more then one might be possible at any time.
|
return gotCombo;//because more than one might be possible at any time.
|
||||||
if (hints[i]->hold.size())
|
if (hints[i]->hold.size())
|
||||||
{
|
{
|
||||||
for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++)
|
for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++)
|
||||||
|
|||||||
@@ -445,7 +445,7 @@ int OrderedAIAction::getEfficiency()
|
|||||||
}
|
}
|
||||||
if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget()))
|
if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget()))
|
||||||
{
|
{
|
||||||
//if the amount im drawing will mill me to death or i have more then 10 cards in hand, eff is 0;
|
//if the amount im drawing will mill me to death or i have more than 10 cards in hand, eff is 0;
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -853,7 +853,7 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
|
|||||||
if (card == target)
|
if (card == target)
|
||||||
used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76
|
used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76
|
||||||
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1)
|
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1)
|
||||||
{//ai can't use cards which produce more then 1 converted while using the old pMana method.
|
{//ai can't use cards which produce more than 1 converted while using the old pMana method.
|
||||||
result->add(amp->output);
|
result->add(amp->output);
|
||||||
used[card] = true;
|
used[card] = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void NextGamePhase::Render()
|
|||||||
if (observer->currentActionPlayer == observer->players[1])
|
if (observer->currentActionPlayer == observer->players[1])
|
||||||
playerId = 2;
|
playerId = 2;
|
||||||
|
|
||||||
sprintf(buffer, "%s %i : %s", _("Player").c_str(), playerId, observer->getNextGamePhaseName());
|
sprintf(buffer, "%s %i : %s", _("Player").c_str(), playerId, observer->getNextGamePhaseName().c_str());
|
||||||
|
|
||||||
mFont->DrawString(buffer, x + 15, y+10, JGETEXT_LEFT);
|
mFont->DrawString(buffer, x + 15, y+10, JGETEXT_LEFT);
|
||||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||||
@@ -675,6 +675,7 @@ ActionStack::ActionStack(GameObserver* game)
|
|||||||
currentState = -1;
|
currentState = -1;
|
||||||
mode = ACTIONSTACK_STANDARD;
|
mode = ACTIONSTACK_STANDARD;
|
||||||
checked = 0;
|
checked = 0;
|
||||||
|
lastActionController = NULL;
|
||||||
|
|
||||||
if(!observer->getResourceManager()) return;
|
if(!observer->getResourceManager()) return;
|
||||||
for (int i = 0; i < 8; ++i)
|
for (int i = 0; i < 8; ++i)
|
||||||
|
|||||||
+146
-141
@@ -55,6 +55,12 @@ GenericActivatedAbility::GenericActivatedAbility(GameObserver* observer, string
|
|||||||
target = ability->target;
|
target = ability->target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GenericActivatedAbility::GenericActivatedAbility(const GenericActivatedAbility &other):
|
||||||
|
ActivatedAbility(other), NestedAbility(other), activeZone(other.activeZone), newName(other.newName)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int GenericActivatedAbility::resolve()
|
int GenericActivatedAbility::resolve()
|
||||||
{
|
{
|
||||||
//Note: I've seen a similar block in some other MTGAbility, can this be refactored .
|
//Note: I've seen a similar block in some other MTGAbility, can this be refactored .
|
||||||
@@ -71,7 +77,7 @@ int GenericActivatedAbility::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * GenericActivatedAbility::getMenuText()
|
const string GenericActivatedAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if(newName.size())
|
if(newName.size())
|
||||||
return newName.c_str();
|
return newName.c_str();
|
||||||
@@ -105,6 +111,7 @@ int GenericActivatedAbility::testDestroy()
|
|||||||
GenericActivatedAbility * GenericActivatedAbility::clone() const
|
GenericActivatedAbility * GenericActivatedAbility::clone() const
|
||||||
{
|
{
|
||||||
GenericActivatedAbility * a = NEW GenericActivatedAbility(*this);
|
GenericActivatedAbility * a = NEW GenericActivatedAbility(*this);
|
||||||
|
|
||||||
a->ability = ability->clone();
|
a->ability = ability->clone();
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -133,7 +140,7 @@ int AAAlterPoison::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAAlterPoison::getMenuText()
|
const string AAAlterPoison::getMenuText()
|
||||||
{
|
{
|
||||||
return "Poison";
|
return "Poison";
|
||||||
}
|
}
|
||||||
@@ -165,7 +172,7 @@ int AADamagePrevent::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADamagePrevent::getMenuText()
|
const string AADamagePrevent::getMenuText()
|
||||||
{
|
{
|
||||||
return "Prevent Damage";
|
return "Prevent Damage";
|
||||||
}
|
}
|
||||||
@@ -237,7 +244,7 @@ AADamager::AADamager(GameObserver* observer, int _id, MTGCardInstance * _source,
|
|||||||
return damage.getValue();
|
return damage.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADamager::getMenuText()
|
const string AADamager::getMenuText()
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = dynamic_cast<MTGCardInstance*>(target);
|
MTGCardInstance * _target = dynamic_cast<MTGCardInstance*>(target);
|
||||||
if(_target && _target->hasType(Subtypes::TYPE_PLANESWALKER))
|
if(_target && _target->hasType(Subtypes::TYPE_PLANESWALKER))
|
||||||
@@ -276,7 +283,7 @@ AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADepleter::getMenuText()
|
const string AADepleter::getMenuText()
|
||||||
{
|
{
|
||||||
return "Deplete";
|
return "Deplete";
|
||||||
}
|
}
|
||||||
@@ -311,7 +318,7 @@ AAModTurn::AAModTurn(GameObserver* observer, int _id, MTGCardInstance * card, Ta
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAModTurn::getMenuText()
|
const string AAModTurn::getMenuText()
|
||||||
{
|
{
|
||||||
WParsedInt numTurns(nbTurnStr, NULL, source);
|
WParsedInt numTurns(nbTurnStr, NULL, source);
|
||||||
if(numTurns.getValue() > 0)
|
if(numTurns.getValue() > 0)
|
||||||
@@ -354,7 +361,7 @@ int AALibraryBottom::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AALibraryBottom::getMenuText()
|
const string AALibraryBottom::getMenuText()
|
||||||
{
|
{
|
||||||
return "Bottom Of Library";
|
return "Bottom Of Library";
|
||||||
}
|
}
|
||||||
@@ -382,7 +389,7 @@ int AACopier::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AACopier::getMenuText()
|
const string AACopier::getMenuText()
|
||||||
{
|
{
|
||||||
return "Copy";
|
return "Copy";
|
||||||
}
|
}
|
||||||
@@ -415,7 +422,7 @@ int AAPhaseOut::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAPhaseOut::getMenuText()
|
const string AAPhaseOut::getMenuText()
|
||||||
{
|
{
|
||||||
return "Phase Out";
|
return "Phase Out";
|
||||||
}
|
}
|
||||||
@@ -506,7 +513,7 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AACounter::getMenuText()
|
const string AACounter::getMenuText()
|
||||||
{
|
{
|
||||||
if (menu.size())
|
if (menu.size())
|
||||||
{
|
{
|
||||||
@@ -695,7 +702,7 @@ int AARemoveAllCounter::resolve()
|
|||||||
return nb;
|
return nb;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AARemoveAllCounter::getMenuText()
|
const string AARemoveAllCounter::getMenuText()
|
||||||
{
|
{
|
||||||
if (menu.size())
|
if (menu.size())
|
||||||
{
|
{
|
||||||
@@ -773,7 +780,7 @@ int AAProliferate::resolve()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AAProliferate::getMenuText()
|
const string AAProliferate::getMenuText()
|
||||||
{
|
{
|
||||||
return "Proliferate";
|
return "Proliferate";
|
||||||
}
|
}
|
||||||
@@ -816,13 +823,13 @@ int GenericChooseTypeColor::resolve()
|
|||||||
for (size_t i = 0; i < values.size(); ++i)
|
for (size_t i = 0; i < values.size(); ++i)
|
||||||
{
|
{
|
||||||
string menu = values[i];
|
string menu = values[i];
|
||||||
if(!ANonWall || (menu != "wall" && menu != "Wall"))
|
if (!ANonWall || (menu != "wall" && menu != "Wall"))
|
||||||
{
|
{
|
||||||
setType = NEW AASetTypeChosen(game, game->mLayers->actionLayer()->getMaxId(), source,(MTGCardInstance*)target, i,menu,baseAbility);
|
setType = NEW AASetTypeChosen(game, game->mLayers->actionLayer()->getMaxId(), source,(MTGCardInstance*)target, i,menu,baseAbility);
|
||||||
MTGAbility * set = setType->clone();
|
MTGAbility * set = setType->clone();
|
||||||
set->oneShot = true;
|
set->oneShot = true;
|
||||||
selection.push_back(set);
|
selection.push_back(set);
|
||||||
SAFE_DELETE(setType);
|
SAFE_DELETE(setType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -837,7 +844,7 @@ int GenericChooseTypeColor::resolve()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GenericChooseTypeColor::getMenuText()
|
const string GenericChooseTypeColor::getMenuText()
|
||||||
{
|
{
|
||||||
if(chooseColor)
|
if(chooseColor)
|
||||||
return "Choose a color";
|
return "Choose a color";
|
||||||
@@ -899,7 +906,7 @@ int AASetColorChosen::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AASetColorChosen::getMenuText()
|
const string AASetColorChosen::getMenuText()
|
||||||
{
|
{
|
||||||
return Constants::MTGColorStrings[color];
|
return Constants::MTGColorStrings[color];
|
||||||
}
|
}
|
||||||
@@ -956,7 +963,7 @@ int AASetTypeChosen::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AASetTypeChosen::getMenuText()
|
const string AASetTypeChosen::getMenuText()
|
||||||
{
|
{
|
||||||
return menutext.c_str();
|
return menutext.c_str();
|
||||||
}
|
}
|
||||||
@@ -1003,7 +1010,7 @@ int GenericFlipACoin::resolve()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GenericFlipACoin::getMenuText()
|
const string GenericFlipACoin::getMenuText()
|
||||||
{
|
{
|
||||||
return "Flip A Coin";
|
return "Flip A Coin";
|
||||||
}
|
}
|
||||||
@@ -1095,7 +1102,7 @@ int AASetCoin::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AASetCoin::getMenuText()
|
const string AASetCoin::getMenuText()
|
||||||
{
|
{
|
||||||
if(side == 1)
|
if(side == 1)
|
||||||
return "Tails";
|
return "Tails";
|
||||||
@@ -1186,7 +1193,7 @@ int GenericPaidAbility::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GenericPaidAbility::getMenuText()
|
const string GenericPaidAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if (newName.size())
|
if (newName.size())
|
||||||
return newName.c_str();
|
return newName.c_str();
|
||||||
@@ -1288,7 +1295,7 @@ int AAResetDamage::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AAResetDamage::getMenuText()
|
const string AAResetDamage::getMenuText()
|
||||||
{
|
{
|
||||||
return "Reset Damages";
|
return "Reset Damages";
|
||||||
}
|
}
|
||||||
@@ -1309,7 +1316,7 @@ int AAFakeAbility::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* AAFakeAbility::getMenuText()
|
const string AAFakeAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if(named.size())
|
if(named.size())
|
||||||
return named.c_str();
|
return named.c_str();
|
||||||
@@ -1356,7 +1363,7 @@ int AAFizzler::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAFizzler::getMenuText()
|
const string AAFizzler::getMenuText()
|
||||||
{
|
{
|
||||||
return "Fizzle";
|
return "Fizzle";
|
||||||
}
|
}
|
||||||
@@ -1403,7 +1410,7 @@ int AABuryCard::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AABuryCard::getMenuText()
|
const string AABuryCard::getMenuText()
|
||||||
{
|
{
|
||||||
if(menu.size())
|
if(menu.size())
|
||||||
return menu.c_str();
|
return menu.c_str();
|
||||||
@@ -1459,7 +1466,7 @@ int AADestroyCard::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADestroyCard::getMenuText()
|
const string AADestroyCard::getMenuText()
|
||||||
{
|
{
|
||||||
return "Destroy";
|
return "Destroy";
|
||||||
}
|
}
|
||||||
@@ -1515,7 +1522,7 @@ int AASacrificeCard::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AASacrificeCard::getMenuText()
|
const string AASacrificeCard::getMenuText()
|
||||||
{
|
{
|
||||||
return "Sacrifice";
|
return "Sacrifice";
|
||||||
}
|
}
|
||||||
@@ -1570,7 +1577,7 @@ int AADiscardCard::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADiscardCard::getMenuText()
|
const string AADiscardCard::getMenuText()
|
||||||
{
|
{
|
||||||
return "Discard";
|
return "Discard";
|
||||||
}
|
}
|
||||||
@@ -1634,7 +1641,7 @@ AADrawer::AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targ
|
|||||||
return numCards.getValue();
|
return numCards.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADrawer::getMenuText()
|
const string AADrawer::getMenuText()
|
||||||
{
|
{
|
||||||
return "Draw";
|
return "Draw";
|
||||||
}
|
}
|
||||||
@@ -1663,7 +1670,7 @@ int AAFrozen::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAFrozen::getMenuText()
|
const string AAFrozen::getMenuText()
|
||||||
{
|
{
|
||||||
return "Freeze";
|
return "Freeze";
|
||||||
}
|
}
|
||||||
@@ -1728,7 +1735,7 @@ int AANewTarget::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AANewTarget::getMenuText()
|
const string AANewTarget::getMenuText()
|
||||||
{
|
{
|
||||||
return "New Target";
|
return "New Target";
|
||||||
}
|
}
|
||||||
@@ -1809,7 +1816,7 @@ int AAMorph::testDestroy()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAMorph::getMenuText()
|
const string AAMorph::getMenuText()
|
||||||
{
|
{
|
||||||
return "Morph";
|
return "Morph";
|
||||||
}
|
}
|
||||||
@@ -1946,7 +1953,7 @@ int AAFlip::testDestroy()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAFlip::getMenuText()
|
const string AAFlip::getMenuText()
|
||||||
{
|
{
|
||||||
string s = flipStats;
|
string s = flipStats;
|
||||||
sprintf(menuText, "Transform:%s", s.c_str());
|
sprintf(menuText, "Transform:%s", s.c_str());
|
||||||
@@ -1987,28 +1994,23 @@ int AADynamic::resolve()
|
|||||||
break;
|
break;
|
||||||
case DYNAMIC_ABILITY_WHO_ITSELF:
|
case DYNAMIC_ABILITY_WHO_ITSELF:
|
||||||
source = ((MTGCardInstance *) _target);
|
source = ((MTGCardInstance *) _target);
|
||||||
_target = _target;
|
|
||||||
break;
|
break;
|
||||||
case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER:
|
case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER:
|
||||||
_target = _target;
|
|
||||||
secondaryTarget = ((MTGCardInstance *) _target)->controller();
|
secondaryTarget = ((MTGCardInstance *) _target)->controller();
|
||||||
break;
|
break;
|
||||||
case DYNAMIC_ABILITY_WHO_TARGETOPPONENT:
|
case DYNAMIC_ABILITY_WHO_TARGETOPPONENT:
|
||||||
_target = _target;
|
|
||||||
secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent();
|
secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent();
|
||||||
break;
|
break;
|
||||||
case DYNAMIC_ABILITY_WHO_TOSOURCE:
|
case DYNAMIC_ABILITY_WHO_TOSOURCE:
|
||||||
tosrc = true;
|
tosrc = true;
|
||||||
break;
|
break;
|
||||||
case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER:
|
case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER:
|
||||||
_target = _target;
|
|
||||||
secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller();
|
secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller();
|
||||||
break;
|
break;
|
||||||
case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT:
|
case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT:
|
||||||
secondaryTarget = OriginalSrc->controller()->opponent();
|
secondaryTarget = OriginalSrc->controller()->opponent();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_target = _target;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(amountsource == DYNAMIC_MYSELF_AMOUNT)
|
if(amountsource == DYNAMIC_MYSELF_AMOUNT)
|
||||||
@@ -2252,7 +2254,7 @@ int AADynamic::activateStored()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AADynamic::getMenuText()
|
const string AADynamic::getMenuText()
|
||||||
{
|
{
|
||||||
if (menu.size())
|
if (menu.size())
|
||||||
{
|
{
|
||||||
@@ -2367,7 +2369,7 @@ int AALifer::getLife()
|
|||||||
return life.getValue();
|
return life.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AALifer::getMenuText()
|
const string AALifer::getMenuText()
|
||||||
{
|
{
|
||||||
if(getLife() < 0)
|
if(getLife() < 0)
|
||||||
return "Life Loss";
|
return "Life Loss";
|
||||||
@@ -2400,7 +2402,7 @@ int AASetHand::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AASetHand::getMenuText()
|
const string AASetHand::getMenuText()
|
||||||
{
|
{
|
||||||
return "Set Hand Size";
|
return "Set Hand Size";
|
||||||
}
|
}
|
||||||
@@ -2431,7 +2433,7 @@ int AALifeSet::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AALifeSet::getMenuText()
|
const string AALifeSet::getMenuText()
|
||||||
{
|
{
|
||||||
return "Set Life";
|
return "Set Life";
|
||||||
}
|
}
|
||||||
@@ -2513,7 +2515,7 @@ int AACloner::resolve()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AACloner::getMenuText()
|
const string AACloner::getMenuText()
|
||||||
{
|
{
|
||||||
if (who == 1)
|
if (who == 1)
|
||||||
return "Clone For Opponent";
|
return "Clone For Opponent";
|
||||||
@@ -2588,7 +2590,7 @@ int ACastRestriction::destroy()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * ACastRestriction::getMenuText()
|
const string ACastRestriction::getMenuText()
|
||||||
{
|
{
|
||||||
if (modifyExisting)
|
if (modifyExisting)
|
||||||
return "Additional Lands"; //hardoced because only the lands rule allows to modify existing rule for now
|
return "Additional Lands"; //hardoced because only the lands rule allows to modify existing rule for now
|
||||||
@@ -2623,7 +2625,7 @@ int AInstantCastRestrictionUEOT::resolve()
|
|||||||
wrapper->addToGame();
|
wrapper->addToGame();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const char * AInstantCastRestrictionUEOT::getMenuText()
|
const string AInstantCastRestrictionUEOT::getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -2717,14 +2719,14 @@ int AAMover::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAMover::getMenuText()
|
const string AAMover::getMenuText()
|
||||||
{
|
{
|
||||||
if(named.size())
|
if(named.size())
|
||||||
return named.c_str();
|
return named.c_str();
|
||||||
return "Move";
|
return "Move";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAMover::getMenuText(TargetChooser * tc)
|
const char* AAMover::getMenuText(TargetChooser * tc)
|
||||||
{
|
{
|
||||||
if(named.size())
|
if(named.size())
|
||||||
return named.c_str();
|
return named.c_str();
|
||||||
@@ -2864,7 +2866,7 @@ int AARandomMover::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AARandomMover::getMenuText()
|
const string AARandomMover::getMenuText()
|
||||||
{
|
{
|
||||||
return "Dig";
|
return "Dig";
|
||||||
}
|
}
|
||||||
@@ -2902,7 +2904,7 @@ int AARandomDiscarder::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AARandomDiscarder::getMenuText()
|
const string AARandomDiscarder::getMenuText()
|
||||||
{
|
{
|
||||||
return "Discard Random";
|
return "Discard Random";
|
||||||
}
|
}
|
||||||
@@ -2929,7 +2931,7 @@ int AAShuffle::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAShuffle::getMenuText()
|
const string AAShuffle::getMenuText()
|
||||||
{
|
{
|
||||||
return "Shuffle";
|
return "Shuffle";
|
||||||
}
|
}
|
||||||
@@ -3027,7 +3029,7 @@ int AARemoveMana::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AARemoveMana::getMenuText()
|
const string AARemoveMana::getMenuText()
|
||||||
{
|
{
|
||||||
if (mRemoveAll && !mManaDesc)
|
if (mRemoveAll && !mManaDesc)
|
||||||
return "Empty Manapool";
|
return "Empty Manapool";
|
||||||
@@ -3066,7 +3068,7 @@ int AATapper::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AATapper::getMenuText()
|
const string AATapper::getMenuText()
|
||||||
{
|
{
|
||||||
return "Tap";
|
return "Tap";
|
||||||
}
|
}
|
||||||
@@ -3096,7 +3098,7 @@ int AAUntapper::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAUntapper::getMenuText()
|
const string AAUntapper::getMenuText()
|
||||||
{
|
{
|
||||||
return "Untap";
|
return "Untap";
|
||||||
}
|
}
|
||||||
@@ -3177,7 +3179,7 @@ int AAWinGame::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAWinGame::getMenuText()
|
const string AAWinGame::getMenuText()
|
||||||
{
|
{
|
||||||
return "Win Game";
|
return "Win Game";
|
||||||
}
|
}
|
||||||
@@ -3268,7 +3270,7 @@ int IfThenAbility::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * IfThenAbility::getMenuText()
|
const string IfThenAbility::getMenuText()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -3320,7 +3322,7 @@ void MayAbility::Update(float dt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * MayAbility::getMenuText()
|
const string MayAbility::getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -3456,7 +3458,7 @@ int MenuAbility::resolve()
|
|||||||
return a->addToGame();
|
return a->addToGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * MenuAbility::getMenuText()
|
const string MenuAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if((abilities.size() > 1 && must)||(abilities.size() > 2 && !must))
|
if((abilities.size() > 1 && must)||(abilities.size() > 2 && !must))
|
||||||
return "choose one";
|
return "choose one";
|
||||||
@@ -3657,7 +3659,7 @@ int MultiAbility::destroy()
|
|||||||
return ActivatedAbility::destroy();
|
return ActivatedAbility::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * MultiAbility::getMenuText()
|
const string MultiAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if (abilities.size() && abilities[0])
|
if (abilities.size() && abilities[0])
|
||||||
return abilities[0]->getMenuText();
|
return abilities[0]->getMenuText();
|
||||||
@@ -3696,7 +3698,7 @@ GenericTargetAbility::GenericTargetAbility(GameObserver* observer, string newNam
|
|||||||
counters = 0;
|
counters = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * GenericTargetAbility::getMenuText()
|
const string GenericTargetAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if (!ability)
|
if (!ability)
|
||||||
return "Error";
|
return "Error";
|
||||||
@@ -4249,7 +4251,7 @@ int ATransformer::destroy()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * ATransformer::getMenuText()
|
const string ATransformer::getMenuText()
|
||||||
{
|
{
|
||||||
if(menutext.size())
|
if(menutext.size())
|
||||||
return menutext.c_str();
|
return menutext.c_str();
|
||||||
@@ -4282,7 +4284,7 @@ int ATransformerInstant::resolve()
|
|||||||
wrapper->addToGame();
|
wrapper->addToGame();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const char * ATransformerInstant::getMenuText()
|
const string ATransformerInstant::getMenuText()
|
||||||
{
|
{
|
||||||
if(menu.size())
|
if(menu.size())
|
||||||
return menu.c_str();
|
return menu.c_str();
|
||||||
@@ -4316,7 +4318,7 @@ int PTInstant::resolve()
|
|||||||
wrapper->addToGame();
|
wrapper->addToGame();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const char * PTInstant::getMenuText()
|
const string PTInstant::getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -4347,7 +4349,7 @@ int ASwapPTUEOT::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * ASwapPTUEOT::getMenuText()
|
const string ASwapPTUEOT::getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -4417,7 +4419,7 @@ int AAExchangeLife::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AAExchangeLife::getMenuText()
|
const string AAExchangeLife::getMenuText()
|
||||||
{
|
{
|
||||||
return "Exchange life";
|
return "Exchange life";
|
||||||
}
|
}
|
||||||
@@ -4655,7 +4657,7 @@ int APreventDamageTypesUEOT::destroy()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * APreventDamageTypesUEOT::getMenuText()
|
const string APreventDamageTypesUEOT::getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -4721,14 +4723,15 @@ void AVanishing::Update(float dt)
|
|||||||
|
|
||||||
int AVanishing::resolve()
|
int AVanishing::resolve()
|
||||||
{
|
{
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AVanishing::getMenuText()
|
const string AVanishing::getMenuText()
|
||||||
{
|
{
|
||||||
if(counterName.find("fade") != string::npos)
|
if (counterName.find("fade") != string::npos)
|
||||||
return "Fading";
|
{
|
||||||
|
return "Fading";
|
||||||
|
}
|
||||||
return "Vanishing";
|
return "Vanishing";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4821,7 +4824,7 @@ int AUpkeep::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AUpkeep::getMenuText()
|
const string AUpkeep::getMenuText()
|
||||||
{
|
{
|
||||||
return "Upkeep";
|
return "Upkeep";
|
||||||
}
|
}
|
||||||
@@ -4921,7 +4924,7 @@ int APhaseAction::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * APhaseAction::getMenuText()
|
const string APhaseAction::getMenuText()
|
||||||
{
|
{
|
||||||
if(psMenuText.size())
|
if(psMenuText.size())
|
||||||
return psMenuText.c_str();
|
return psMenuText.c_str();
|
||||||
@@ -4958,7 +4961,7 @@ int APhaseActionGeneric::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * APhaseActionGeneric::getMenuText()
|
const string APhaseActionGeneric::getMenuText()
|
||||||
{
|
{
|
||||||
return ability->getMenuText();
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
@@ -5116,7 +5119,7 @@ int ABlink::resolve()
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const char * ABlink::getMenuText()
|
const string ABlink::getMenuText()
|
||||||
{
|
{
|
||||||
return "Blink";
|
return "Blink";
|
||||||
}
|
}
|
||||||
@@ -5147,7 +5150,7 @@ int ABlinkGeneric::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * ABlinkGeneric::getMenuText()
|
const string ABlinkGeneric::getMenuText()
|
||||||
{
|
{
|
||||||
return "Blink";
|
return "Blink";
|
||||||
}
|
}
|
||||||
@@ -5316,6 +5319,7 @@ int AEquip::unequip()
|
|||||||
{
|
{
|
||||||
MTGAbility * a = currentAbilities[i];
|
MTGAbility * a = currentAbilities[i];
|
||||||
if (dynamic_cast<AEquip *> (a) || dynamic_cast<ATeach *> (a) || dynamic_cast<AAConnect *> (a)
|
if (dynamic_cast<AEquip *> (a) || dynamic_cast<ATeach *> (a) || dynamic_cast<AAConnect *> (a)
|
||||||
|
|| dynamic_cast<AANewTarget *> (AbilityFactory::getCoreAbility(a))
|
||||||
|| (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot))
|
|| (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot))
|
||||||
{
|
{
|
||||||
SAFE_DELETE(a);
|
SAFE_DELETE(a);
|
||||||
@@ -5369,7 +5373,7 @@ int AEquip::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AEquip::getMenuText()
|
const string AEquip::getMenuText()
|
||||||
{
|
{
|
||||||
if (isAttach)
|
if (isAttach)
|
||||||
return "Attach";
|
return "Attach";
|
||||||
@@ -5411,83 +5415,83 @@ AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _sourc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AACastCard::Update(float dt)
|
void AACastCard::Update(float dt)
|
||||||
|
{
|
||||||
|
MTGAbility::Update(dt);
|
||||||
|
if (processed)
|
||||||
|
return;
|
||||||
|
if(cardNamed.size() && !theNamedCard)
|
||||||
|
{
|
||||||
|
theNamedCard = makeCard();
|
||||||
|
}
|
||||||
|
if (restricted)
|
||||||
{
|
{
|
||||||
MTGAbility::Update(dt);
|
|
||||||
if (processed)
|
|
||||||
return;
|
|
||||||
if(cardNamed.size() && !theNamedCard)
|
|
||||||
{
|
|
||||||
theNamedCard = makeCard();
|
|
||||||
}
|
|
||||||
if (restricted)
|
|
||||||
{
|
|
||||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
|
||||||
if(theNamedCard)
|
|
||||||
toCheck = theNamedCard;
|
|
||||||
if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(toCheck, source->controller()->game->stack) == PlayRestriction::CANT_PLAY)
|
|
||||||
{
|
|
||||||
processed = true;
|
|
||||||
this->forceDestroy = 1;
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
if(!allowedToCast(toCheck,source->controller()))
|
|
||||||
{
|
|
||||||
processed = true;
|
|
||||||
this->forceDestroy = 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!toCheck->hasType(Subtypes::TYPE_INSTANT) && !(game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
|
|
||||||
{
|
|
||||||
processed = true;
|
|
||||||
this->forceDestroy = 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||||
if(theNamedCard)
|
if(theNamedCard)
|
||||||
toCheck = theNamedCard;
|
toCheck = theNamedCard;
|
||||||
if (Spell * checkSpell = dynamic_cast<Spell*>(target))
|
if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(toCheck, source->controller()->game->stack) == PlayRestriction::CANT_PLAY)
|
||||||
{
|
{
|
||||||
toCheck = checkSpell->source;
|
processed = true;
|
||||||
|
this->forceDestroy = 1;
|
||||||
|
return ;
|
||||||
}
|
}
|
||||||
if (!game->targetListIsSet(toCheck))
|
if(!allowedToCast(toCheck,source->controller()))
|
||||||
{
|
{
|
||||||
if(game->targetChooser)
|
processed = true;
|
||||||
game->targetChooser->Owner = source->controller();//sources controller is the caster
|
this->forceDestroy = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
resolveSpell();
|
if(!toCheck->hasType(Subtypes::TYPE_INSTANT) && !(game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
|
||||||
this->forceDestroy = 1;
|
{
|
||||||
|
processed = true;
|
||||||
|
this->forceDestroy = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||||
|
if(theNamedCard)
|
||||||
|
toCheck = theNamedCard;
|
||||||
|
if (Spell * checkSpell = dynamic_cast<Spell*>(target))
|
||||||
|
{
|
||||||
|
toCheck = checkSpell->source;
|
||||||
|
}
|
||||||
|
if (!game->targetListIsSet(toCheck))
|
||||||
|
{
|
||||||
|
if(game->targetChooser)
|
||||||
|
game->targetChooser->Owner = source->controller();//sources controller is the caster
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int AACastCard::isReactingToTargetClick(Targetable * card){return 0;}
|
resolveSpell();
|
||||||
int AACastCard::reactToTargetClick(Targetable * object)
|
this->forceDestroy = 1;
|
||||||
{
|
return;
|
||||||
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
}
|
||||||
return reactToClick(cObject);
|
int AACastCard::isReactingToTargetClick(Targetable * card){return 0;}
|
||||||
|
int AACastCard::reactToTargetClick(Targetable * object)
|
||||||
|
{
|
||||||
|
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
||||||
|
return reactToClick(cObject);
|
||||||
|
|
||||||
if (waitingForAnswer)
|
if (waitingForAnswer)
|
||||||
|
{
|
||||||
|
if (tc->toggleTarget(object) == TARGET_OK_FULL)
|
||||||
{
|
{
|
||||||
if (tc->toggleTarget(object) == TARGET_OK_FULL)
|
waitingForAnswer = 0;
|
||||||
{
|
game->mLayers->actionLayer()->setCurrentWaitingAction(NULL);
|
||||||
waitingForAnswer = 0;
|
return MTGAbility::reactToClick(source);
|
||||||
game->mLayers->actionLayer()->setCurrentWaitingAction(NULL);
|
|
||||||
return MTGAbility::reactToClick(source);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
MTGCardInstance * AACastCard::makeCard()
|
MTGCardInstance * AACastCard::makeCard()
|
||||||
{
|
{
|
||||||
MTGCardInstance * card = NULL;
|
MTGCardInstance * card = NULL;
|
||||||
MTGCard * cardData = MTGCollection()->getCardByName(cardNamed);
|
MTGCard * cardData = MTGCollection()->getCardByName(cardNamed);
|
||||||
card = NEW MTGCardInstance(cardData, source->controller()->game);
|
card = NEW MTGCardInstance(cardData, source->controller()->game);
|
||||||
source->controller()->game->temp->addCard(card);
|
source->controller()->game->temp->addCard(card);
|
||||||
return card;
|
return card;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AACastCard::resolveSpell()
|
int AACastCard::resolveSpell()
|
||||||
{
|
{
|
||||||
@@ -5583,7 +5587,7 @@ int AACastCard::resolveSpell()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * AACastCard::getMenuText()
|
const string AACastCard::getMenuText()
|
||||||
{
|
{
|
||||||
if(nameThis.size())
|
if(nameThis.size())
|
||||||
return nameThis.c_str();
|
return nameThis.c_str();
|
||||||
@@ -5700,7 +5704,8 @@ void ATutorialMessage::Update(float dt)
|
|||||||
|
|
||||||
mElapsed += dt;
|
mElapsed += dt;
|
||||||
|
|
||||||
IconButtonsController::Update(dt);
|
if(!mUserCloseRequest)
|
||||||
|
IconButtonsController::Update(dt);
|
||||||
|
|
||||||
if (mIsImage)
|
if (mIsImage)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor()
|
|||||||
colorComparisonMode = COMPARISON_NONE;
|
colorComparisonMode = COMPARISON_NONE;
|
||||||
CDopponentDamaged = 0;
|
CDopponentDamaged = 0;
|
||||||
CDcontrollerDamaged = 0;
|
CDcontrollerDamaged = 0;
|
||||||
|
CDdamager = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CardDescriptor::init()
|
int CardDescriptor::init()
|
||||||
@@ -226,16 +227,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
|
|||||||
{
|
{
|
||||||
match = NULL;
|
match = NULL;
|
||||||
}
|
}
|
||||||
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
|
|
||||||
{
|
if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature))
|
||||||
Player * p = card->controller()->opponent();//controller()->opponent();
|
|| (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
|
||||||
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) || (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|
|
||||||
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent()) || (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
|
|
||||||
{
|
{
|
||||||
match = NULL;
|
match = NULL;
|
||||||
}
|
}
|
||||||
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) || (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|
|
||||||
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent()) || (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
|
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
|
||||||
|
{
|
||||||
|
Player * p = card->controller()->opponent();//controller()->opponent();
|
||||||
|
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p)
|
||||||
|
|| (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|
||||||
|
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent())
|
||||||
|
|| (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
|
||||||
|
{
|
||||||
|
match = NULL;
|
||||||
|
}
|
||||||
|
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p)
|
||||||
|
|| (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|
||||||
|
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent())
|
||||||
|
|| (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
|
||||||
{
|
{
|
||||||
match = NULL;
|
match = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "Counters.h"
|
#include "Counters.h"
|
||||||
#include "ModRules.h"
|
#include "ModRules.h"
|
||||||
#include "CardDescriptor.h"
|
#include "CardDescriptor.h"
|
||||||
|
#include "GameApp.h"
|
||||||
|
|
||||||
const float CardGui::Width = 28.0;
|
const float CardGui::Width = 28.0;
|
||||||
const float CardGui::Height = 40.0;
|
const float CardGui::Height = 40.0;
|
||||||
@@ -110,17 +111,17 @@ void CardGui::Update(float dt)
|
|||||||
PlayGuiObject::Update(dt);
|
PlayGuiObject::Update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardGui::DrawCard(const Pos& inPosition, int inMode)
|
void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb)
|
||||||
{
|
{
|
||||||
DrawCard(card, inPosition, inMode);
|
DrawCard(card, inPosition, inMode, thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode)
|
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb)
|
||||||
{
|
{
|
||||||
switch (inMode)
|
switch (inMode)
|
||||||
{
|
{
|
||||||
case DrawMode::kNormal:
|
case DrawMode::kNormal:
|
||||||
RenderBig(inCard, inPosition);
|
RenderBig(inCard, inPosition, thumb);
|
||||||
break;
|
break;
|
||||||
case DrawMode::kText:
|
case DrawMode::kText:
|
||||||
AlternateRender(inCard, inPosition);
|
AlternateRender(inCard, inPosition);
|
||||||
@@ -957,7 +958,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
|
//Renders a big card on screen. Defaults to the "alternate" rendering if no image is found
|
||||||
void CardGui::RenderBig(MTGCard* card, const Pos& pos)
|
void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb)
|
||||||
{
|
{
|
||||||
JRenderer * renderer = JRenderer::GetInstance();
|
JRenderer * renderer = JRenderer::GetInstance();
|
||||||
//GameObserver * game = GameObserver::GetInstance();
|
//GameObserver * game = GameObserver::GetInstance();
|
||||||
@@ -966,7 +967,8 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos)
|
|||||||
//i want this but ai targets cards so quickly that it can crash the game.
|
//i want this but ai targets cards so quickly that it can crash the game.
|
||||||
float x = pos.actX;
|
float x = pos.actX;
|
||||||
|
|
||||||
JQuadPtr quad = WResourceManager::Instance()->RetrieveCard(card);
|
JQuadPtr quad = thumb ? WResourceManager::Instance()->RetrieveCard(card, RETRIEVE_THUMB)
|
||||||
|
: WResourceManager::Instance()->RetrieveCard(card);
|
||||||
MTGCardInstance * kcard = dynamic_cast<MTGCardInstance*>(card);
|
MTGCardInstance * kcard = dynamic_cast<MTGCardInstance*>(card);
|
||||||
if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name)
|
if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name)
|
||||||
{
|
{
|
||||||
@@ -1222,6 +1224,18 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
cd.CDcontrollerDamaged = 1;
|
cd.CDcontrollerDamaged = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//creature dealt damage to anything
|
||||||
|
else if (attribute.find("damager") != string::npos)
|
||||||
|
{
|
||||||
|
if (minus)
|
||||||
|
{
|
||||||
|
cd.CDdamager = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cd.CDdamager = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (attribute.find("multicolor") != string::npos)
|
else if (attribute.find("multicolor") != string::npos)
|
||||||
{
|
{
|
||||||
//card is multicolored?
|
//card is multicolored?
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user