Compare commits
250 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab34d0d366 | ||
|
|
963ab2840b | ||
|
|
a25b010429 | ||
|
|
504160a740 | ||
|
|
5061f7c37f | ||
|
|
30f5a49988 | ||
|
|
2998e95a3b | ||
|
|
ac29367ff8 | ||
|
|
dbd7f82eab | ||
|
|
176b74489e | ||
|
|
f940f8e303 | ||
|
|
2679213121 | ||
|
|
59c0cf467f | ||
|
|
5a2637856f | ||
|
|
26ecb199d3 | ||
|
|
62d42fb61f | ||
|
|
19c96e496b | ||
|
|
e982ba50be | ||
|
|
27ad956034 | ||
|
|
8c6f694645 | ||
|
|
8ce85636d9 | ||
|
|
07683480b4 | ||
|
|
7d8fdbfd58 | ||
|
|
2a1cb03484 | ||
|
|
baa90fb605 | ||
|
|
1b67b736df | ||
|
|
e6514a8b33 | ||
|
|
636b07b350 | ||
|
|
4b5478530c | ||
|
|
4a721a7e18 | ||
|
|
2470629afd | ||
|
|
ccdd16bbc7 | ||
|
|
9cf6e621ab | ||
|
|
94a97a3032 | ||
|
|
f4ef7b9851 | ||
|
|
c2be7dd025 | ||
|
|
b51dfc7733 | ||
|
|
9999820a8f | ||
|
|
10bc8283ed | ||
|
|
66f3ba5a7b | ||
|
|
07f0175c5e | ||
|
|
7376ac382f | ||
|
|
3646219da4 | ||
|
|
bfbc073593 | ||
|
|
307be96fd6 | ||
|
|
22f4f21619 | ||
|
|
1738e216d0 | ||
|
|
567650357f | ||
|
|
32de6ac124 | ||
|
|
60f3c87de1 | ||
|
|
d9561118bc | ||
|
|
228e5342fb | ||
|
|
8574154071 | ||
|
|
80379ecde5 | ||
|
|
31b8ad248f | ||
|
|
2d02f97f7f | ||
|
|
6a37b5e461 | ||
|
|
38ed60bf63 | ||
|
|
e664ecfaf5 | ||
|
|
e2814c04f4 | ||
|
|
8c2836b0c2 | ||
|
|
fcfab4c756 | ||
|
|
ddd59c489a | ||
|
|
db922a0e77 | ||
|
|
793c4d1d7d | ||
|
|
24eab33b6d | ||
|
|
4985323ad9 | ||
|
|
9fc551982b | ||
|
|
8ee67b5af8 | ||
|
|
78ad22479c | ||
|
|
2041aa45f0 | ||
|
|
c8b0ce9669 | ||
|
|
11eb6de57e | ||
|
|
c451234bd5 | ||
|
|
b56862fcf8 | ||
|
|
21a6da91ca | ||
|
|
410108a005 | ||
|
|
51d5b166a6 | ||
|
|
1f77243881 | ||
|
|
f63afb2dd6 | ||
|
|
dbe1c6e2ae | ||
|
|
6a37425a38 | ||
|
|
02efa4745f | ||
|
|
e78754bcd5 | ||
|
|
16dcf3cc5e | ||
|
|
03d168f972 | ||
|
|
6f6c8b0eb6 | ||
|
|
fa14219e12 | ||
|
|
15cd86fad1 | ||
|
|
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 | ||
|
|
165eb699e8 | ||
|
|
33760f4066 | ||
|
|
656ab78cf5 | ||
|
|
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 | ||
|
|
541698f98e | ||
|
|
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 | ||
|
|
746a486e7a | ||
|
|
261a6e4780 | ||
|
|
a8cff5ed8e | ||
|
|
a683f5a2b7 |
72
.travis.yml
72
.travis.yml
@@ -1,24 +1,60 @@
|
||||
language: cpp
|
||||
branches:
|
||||
except:
|
||||
- latest-master
|
||||
|
||||
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"
|
||||
- export BUILD_PSP=YES
|
||||
- export BUILD_ANDROID=YES
|
||||
- export BUILD_Qt=YES
|
||||
- export BUILD_MAC=YES
|
||||
- sudo apt-get update -qq
|
||||
# Building for PSP here
|
||||
- if [ "$BUILD_PSP" == "YES" ]; then
|
||||
export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" &&
|
||||
export PSPSDK="$PSPDEV/psp/sdk" &&
|
||||
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" &&
|
||||
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;
|
||||
fi
|
||||
# Building for Android here
|
||||
- if [ "$BUILD_ANDROID" == "YES" ]; 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_r24.3.3-linux.tgz -nv;
|
||||
fi
|
||||
# Building for Qt here
|
||||
- if [ "$BUILD_Qt" == "YES" ]; 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:
|
||||
- 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 jq; fi
|
||||
- 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 -x --xz -f sdk.lzma
|
||||
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
|
||||
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
|
||||
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
|
||||
- tar -zxf android-sdk_r22-linux.tgz
|
||||
- $ANDROID list sdk -a
|
||||
- echo yes | $ANDROID update sdk -a --filter 1,2,4,18 --no-ui --force > log.txt
|
||||
- if [ "$BUILD_PSP" == "YES" ]; then
|
||||
tar -x --xz -f sdk.lzma;
|
||||
fi
|
||||
- if [ "$BUILD_ANDROID" == "YES" ]; then
|
||||
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
|
||||
tar -zxf android-sdk_r24.3.3-linux.tgz &&
|
||||
$ANDROID list sdk --extended -a &&
|
||||
echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-22.0.1,android-10 --no-ui --force --no-https;
|
||||
fi
|
||||
- sudo pip install pyjavaproperties
|
||||
script: ./travis-script.sh
|
||||
- sudo pip install github3.py
|
||||
- sudo pip install cpp-coveralls
|
||||
|
||||
env:
|
||||
global:
|
||||
secure: YocijVYZa1oDPviFubPIpmBmXyw0gQ7D0YA6tC01wExXvY+8tGUh1HQ5uXn8LotRZ+Ob5HLHDaCzkKWF8+57ILSMeHrnf6tcRyyeO7wjNY9P7WvSZyCjvqnWzsUN9tiMmsEzhTz2MaUgsY6ocB/4nbWZwfQvL7z+s7z41R4J1I4=
|
||||
script: "./travis-script.sh"
|
||||
after_success: ./upload-binaries.sh
|
||||
- secure: "EBzr1+qjQsOhn0s+tcFmXR1jP9B0xiOSXuXbRXWZ1OEHNvp8+A5/pS84LYVFlaZqmxr5dApxvPtwhgLIUbQ3EPXm8LpC3KgSD4dS+9/QMbxhe5TK4oczgFRGcDTMJQZsCzhOh7hp3tbcbJg5Gp+VT7aFjFQSHDGwhzSJXsXwh/8="
|
||||
- secure: "X5dTQfofqAutnXxmu11Ep2MQ5QYnMN8m0AITRtwymhEF2UclcOudI1+skPtuhAGbWQnSO+lhunV3cvMfw2/Ml3k/VDz6VdFSKFrzAu7ja1VLJfcxr7chi0s8q30pVBb66tGydjIBac3B+RQyqgmZQW1frbRrhC/kPFQ6wPWOJdQ="
|
||||
- secure: "T97NUPnxCpVZ/c5HH0zfo0FO3DPSRMSmze58ubW5EUTZOjAMtEt+OFdsrNZvUTCugUj2M1agtonZbAbczpaAL+lgZcHDgXgWMkfO0pMnsWX1yyCNqMuE/iTMpJr/xsLQeyWlftWjJLsseQU45abZsd1XVmda/G+ZhrDLF1y55SA="
|
||||
|
||||
script: "tools/travis-script.sh"
|
||||
|
||||
after_success:
|
||||
- coveralls -b . -e JGE/src -e JGE/include -i projects/mtg/include -i projects/mtg/src --gcov-options '\-lp'
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-android.apk -b $TRAVIS_BRANCH
|
||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH
|
||||
|
||||
80
CHANGELOG.md
Normal file
80
CHANGELOG.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# Changelog
|
||||
|
||||
## [latest-master] (https://github.com/WagicProject/wagic/tree/latest-master)
|
||||
#### 08/12/14
|
||||
- *Merged pull-request:* Fix for guild_keywords Devotion, added some "Chroma" cards [\#606](https://github.com/WagicProject/wagic/pull/606) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
- *Merged pull-request:* added guild keywords, added specific life cost [\#605](https://github.com/WagicProject/wagic/pull/605) ([kevlahnota](https://github.com/kevlahnota))
|
||||
|
||||
- *Merged pull-request:* Buyback issue and a fix [\#604](https://github.com/WagicProject/wagic/pull/604) ([apollovy](https://github.com/apollovy))
|
||||
|
||||
- *Merged pull-request:* Feature/ios update xcode5.1 [\#602](https://github.com/WagicProject/wagic/pull/602) ([mjnguyen](https://github.com/mjnguyen))
|
||||
|
||||
- *Merged pull-request:* Remove dead code and fix circular initialization [\#601](https://github.com/WagicProject/wagic/pull/601) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* update android build tools version [\#600](https://github.com/WagicProject/wagic/pull/600) ([Rolzad73](https://github.com/Rolzad73))
|
||||
|
||||
- *Merged pull-request:* Attempt to make android tools fetching for TravisCI explicit and futureproof [\#599](https://github.com/WagicProject/wagic/pull/599) ([Rolzad73](https://github.com/Rolzad73))
|
||||
|
||||
- *Merged pull-request:* Damager keyword [\#598](https://github.com/WagicProject/wagic/pull/598) ([bjornsnoen](https://github.com/bjornsnoen))
|
||||
|
||||
- *Merged pull-request:* Fix a rarity mistake and a grammatical error [\#596](https://github.com/WagicProject/wagic/pull/596) ([bjornsnoen](https://github.com/bjornsnoen))
|
||||
|
||||
- *Merged pull-request:* Fix bug where the phase wheel got out of sync [\#588](https://github.com/WagicProject/wagic/pull/588) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* More easing [\#586](https://github.com/WagicProject/wagic/pull/586) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Added Avatar Tokens created by Ajani Goldmane. [\#585](https://github.com/WagicProject/wagic/pull/585) ([bjornsnoen](https://github.com/bjornsnoen))
|
||||
|
||||
- *Merged pull-request:* Cleanup, usability fixes and source code documentation for DeckView.h and GridDeckView.h [\#583](https://github.com/WagicProject/wagic/pull/583) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Fixed bug:* Blight does not destroy at the end of turn but right now [\#592](https://github.com/WagicProject/wagic/issues/592)
|
||||
|
||||
- *Fixed bug:* game freezes on Android when the phone returns from "sleep mode" [\#544](https://github.com/WagicProject/wagic/issues/544)
|
||||
|
||||
- *Fixed bug:* Android port needs to be able to respond to attaching/detaching devices to it [\#522](https://github.com/WagicProject/wagic/issues/522)
|
||||
|
||||
## [alpha-195] (https://github.com/WagicProject/wagic/tree/alpha-195)
|
||||
#### 07/12/13
|
||||
- *Merged pull-request:* Reset positions and filters when reopening the editor [\#578](https://github.com/WagicProject/wagic/pull/578) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Deck viewer [\#577](https://github.com/WagicProject/wagic/pull/577) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Do not specify the system directory in JGE [\#576](https://github.com/WagicProject/wagic/pull/576) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Changed Travis build file to use Android API 10 and Android build tools 18.1.1 [\#575](https://github.com/WagicProject/wagic/pull/575) ([Rolzad73](https://github.com/Rolzad73))
|
||||
|
||||
- *Merged pull-request:* Feature/play from grave [\#574](https://github.com/WagicProject/wagic/pull/574) ([pankdm](https://github.com/pankdm))
|
||||
|
||||
- *Merged pull-request:* Fix Valgrind warnings appearing during the test suit. [\#573](https://github.com/WagicProject/wagic/pull/573) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Strings 2 [\#572](https://github.com/WagicProject/wagic/pull/572) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Android travis ci [\#570](https://github.com/WagicProject/wagic/pull/570) ([xawotihs](https://github.com/xawotihs))
|
||||
|
||||
- *Merged pull-request:* Android NDK build fix [\#569](https://github.com/WagicProject/wagic/pull/569) ([Rolzad73](https://github.com/Rolzad73))
|
||||
|
||||
- *Merged pull-request:* Add a few namespaces and fix header guards. [\#564](https://github.com/WagicProject/wagic/pull/564) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Updated deckmenu.cpp to properly render deck description and summary [\#562](https://github.com/WagicProject/wagic/pull/562) ([citiral](https://github.com/citiral))
|
||||
|
||||
- *Merged pull-request:* Fix some valgrind memcheck warnings. However there remains one... [\#561](https://github.com/WagicProject/wagic/pull/561) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Remove some dead code [\#560](https://github.com/WagicProject/wagic/pull/560) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Show output only for failing tests [\#559](https://github.com/WagicProject/wagic/pull/559) ([pankdm](https://github.com/pankdm))
|
||||
|
||||
- *Merged pull-request:* Defines/Typos [\#557](https://github.com/WagicProject/wagic/pull/557) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Simplify Damage::resolve a bit [\#556](https://github.com/WagicProject/wagic/pull/556) ([ZobyTwo](https://github.com/ZobyTwo))
|
||||
|
||||
- *Merged pull-request:* Fix cranial plating [\#555](https://github.com/WagicProject/wagic/pull/555) ([pankdm](https://github.com/pankdm))
|
||||
|
||||
- *Merged pull-request:* Android cleanup [\#1](https://github.com/WagicProject/wagic/pull/1) ([Rolzad73](https://github.com/Rolzad73))
|
||||
|
||||
- *Fixed bug:* Iona and Nin don't work [\#527](https://github.com/WagicProject/wagic/issues/527)
|
||||
|
||||
- *Closed issue:* Less verbose output of tests at Travis [\#558](https://github.com/WagicProject/wagic/issues/558)
|
||||
|
||||
## [wagic-0.19.2] (https://github.com/WagicProject/wagic/tree/wagic-v0.19.2)
|
||||
#### 28/10/13
|
||||
128
JGE/include/Downloader.h
Normal file
128
JGE/include/Downloader.h
Normal file
@@ -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:
|
||||
float mTimer;
|
||||
float mFrameTime;
|
||||
JAnimator* mAnimator;
|
||||
vector<JAnimatorObject *> mObjects;
|
||||
|
||||
};
|
||||
|
||||
@@ -37,7 +37,6 @@ private:
|
||||
float mTexY;
|
||||
float mTexWidth;
|
||||
float mTexHeight;
|
||||
JTexture* mTexture;
|
||||
JQuad* mQuad;
|
||||
|
||||
|
||||
|
||||
@@ -128,6 +128,7 @@ public:
|
||||
bool readIntoString(const string & FilePath, string & target);
|
||||
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
|
||||
bool Rename(string from, string to);
|
||||
bool Remove(string aFile);
|
||||
|
||||
//Returns true if strFilename exists somewhere in the fileSystem
|
||||
bool FileExists(const string& strFilename);
|
||||
@@ -163,4 +164,4 @@ protected:
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -23,28 +23,32 @@
|
||||
#include "SLES/OpenSLES_Android.h"
|
||||
|
||||
#elif defined USE_PHONON
|
||||
#include <phonon/AudioOutput>
|
||||
#include <phonon/MediaObject>
|
||||
#include <phonon/AudioOutput>
|
||||
#include <phonon/MediaObject>
|
||||
#elif (defined QT_CONFIG)
|
||||
#include "QMediaPlayer"
|
||||
#include "QMediaPlaylist"
|
||||
#include "QSoundEffect"
|
||||
#elif defined WIN32
|
||||
#include <windows.h>
|
||||
#include <windows.h>
|
||||
#define WITH_FMOD
|
||||
#elif defined (PSP)
|
||||
#include <pspgu.h>
|
||||
#include <pspkernel.h>
|
||||
#include <pspdisplay.h>
|
||||
#include <pspdebug.h>
|
||||
#include <pspctrl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <pspaudiolib.h>
|
||||
#include <psprtc.h>
|
||||
#include <pspgu.h>
|
||||
#include <pspkernel.h>
|
||||
#include <pspdisplay.h>
|
||||
#include <pspdebug.h>
|
||||
#include <pspctrl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <pspaudiolib.h>
|
||||
#include <psprtc.h>
|
||||
|
||||
#include "JAudio.h"
|
||||
#include "JMP3.h"
|
||||
#include "JAudio.h"
|
||||
#include "JMP3.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FMOD
|
||||
#include "../Dependencies/include/fmod.h"
|
||||
#include "../Dependencies/include/fmod.h"
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
@@ -67,7 +71,7 @@ public:
|
||||
#ifdef USE_PHONON
|
||||
Phonon::AudioOutput* mOutput;
|
||||
Phonon::MediaObject* mMediaObject;
|
||||
public slots:
|
||||
public slots:
|
||||
void seekAtTheBegining();
|
||||
#elif defined (PSP)
|
||||
JMP3* mTrack;
|
||||
@@ -82,6 +86,10 @@ public:
|
||||
SLPlayItf playInterface;
|
||||
SLSeekItf seekInterface;
|
||||
SLVolumeItf musicVolumeInterface;
|
||||
#elif (defined QT_CONFIG)
|
||||
QMediaPlaylist* playlist;
|
||||
QMediaPlayer* player;
|
||||
string fullpath;
|
||||
#else
|
||||
void* mTrack;
|
||||
#endif //WITH_FMOD
|
||||
@@ -92,13 +100,15 @@ public:
|
||||
//------------------------------------------------------------------------------------------------
|
||||
class JSample
|
||||
{
|
||||
public:
|
||||
public:
|
||||
JSample();
|
||||
~JSample();
|
||||
|
||||
unsigned long fileSize();
|
||||
|
||||
#if defined (PSP)
|
||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||
QMediaPlayer* effect;
|
||||
void* mSample;
|
||||
#elif defined (PSP)
|
||||
WAVDATA *mSample;
|
||||
#elif defined (IOS)
|
||||
std::string filename;
|
||||
@@ -133,126 +143,128 @@ class JSoundSystem
|
||||
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Get the singleton instance
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static JSoundSystem* GetInstance();
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Get the singleton instance
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static JSoundSystem* GetInstance();
|
||||
|
||||
static void Destroy();
|
||||
static void Destroy();
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Load music.
|
||||
///
|
||||
/// @note MP3 is the only supported format for the moment.
|
||||
///
|
||||
/// @param filename - Name of the music file.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JMusic *LoadMusic(const char *fileName);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Load music.
|
||||
///
|
||||
/// @note MP3 is the only supported format for the moment.
|
||||
///
|
||||
/// @param filename - Name of the music file.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JMusic *LoadMusic(const char *fileName);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Delete music from memory.
|
||||
///
|
||||
/// @param music - Music to be deleted.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//void FreeMusic(JMusic *music);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Delete music from memory.
|
||||
///
|
||||
/// @param music - Music to be deleted.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//void FreeMusic(JMusic *music);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Play music.
|
||||
///
|
||||
/// @param music - Music to be played.
|
||||
/// @param looping - Play the music in a loop.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PlayMusic(JMusic *music, bool looping = false);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Play music.
|
||||
///
|
||||
/// @param music - Music to be played.
|
||||
/// @param looping - Play the music in a loop.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PlayMusic(JMusic *music, bool looping = false);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Stop playing.
|
||||
///
|
||||
/// @param music - Music to be stopped.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void StopMusic(JMusic *music);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Stop playing.
|
||||
///
|
||||
/// @param music - Music to be stopped.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void StopMusic(JMusic *music);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Resume playing.
|
||||
///
|
||||
/// @param music - Music to be resumed.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void ResumeMusic(JMusic *music);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Resume playing.
|
||||
///
|
||||
/// @param music - Music to be resumed.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void ResumeMusic(JMusic *music);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Pause playing.
|
||||
///
|
||||
/// @param music - Music to be paused.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PauseMusic(JMusic *music);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Pause playing.
|
||||
///
|
||||
/// @param music - Music to be paused.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PauseMusic(JMusic *music);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Load sound effect.
|
||||
///
|
||||
/// @note WAV sound effect only.
|
||||
///
|
||||
/// @param fileName - Sound effect for loading.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JSample *LoadSample(const char *fileName);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Load sound effect.
|
||||
///
|
||||
/// @note WAV sound effect only.
|
||||
///
|
||||
/// @param fileName - Sound effect for loading.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JSample *LoadSample(const char *fileName);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Delete sound effect from memory.
|
||||
///
|
||||
/// @param sample - Sound to be deleted.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//void FreeSample(JSample *sample);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Delete sound effect from memory.
|
||||
///
|
||||
/// @param sample - Sound to be deleted.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//void FreeSample(JSample *sample);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Play sound effect.
|
||||
///
|
||||
/// @param sample - Sound for playing.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PlaySample(JSample *sample);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Play sound effect.
|
||||
///
|
||||
/// @param sample - Sound for playing.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void PlaySample(JSample *sample);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Set volume for audio playback.
|
||||
///
|
||||
/// @param volume - New volume.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SetVolume(int volume);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Set volume for audio playback.
|
||||
///
|
||||
/// @param volume - New 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:
|
||||
JSoundSystem();
|
||||
~JSoundSystem();
|
||||
JSoundSystem();
|
||||
~JSoundSystem();
|
||||
|
||||
void InitSoundSystem();
|
||||
void DestroySoundSystem();
|
||||
void InitSoundSystem();
|
||||
void DestroySoundSystem();
|
||||
|
||||
private:
|
||||
|
||||
JMusic *mCurrentMusic;
|
||||
#if (defined PSP || defined ANDROID)
|
||||
JMusic *mCurrentMusic;
|
||||
JSample *mCurrentSample;
|
||||
#endif
|
||||
|
||||
int mVolume;
|
||||
int mMusicVolume;
|
||||
int mSampleVolume;
|
||||
int mVolume;
|
||||
int mMusicVolume;
|
||||
int mSampleVolume;
|
||||
|
||||
|
||||
static JSoundSystem* mInstance;
|
||||
static JSoundSystem* mInstance;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef THREADING_H
|
||||
#define THREADING_H
|
||||
|
||||
#if !defined(PSP) && !defined(QT_CONFIG)
|
||||
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
|
||||
#include <boost/date_time.hpp>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -14,7 +14,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#elif !defined(QT_CONFIG)
|
||||
#elif defined(PSP)
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
namespace boost
|
||||
{
|
||||
/**
|
||||
** PSP specific variant of a boost mutex & scoped_lock
|
||||
** PSP specific variant of a boost mutex & scoped_lock
|
||||
*/
|
||||
|
||||
template <class Mutex>
|
||||
@@ -60,7 +60,7 @@ namespace boost
|
||||
{
|
||||
sceKernelDeleteSema(mID);
|
||||
}
|
||||
|
||||
|
||||
void lock()
|
||||
{
|
||||
int result = sceKernelWaitSema(mID, 1, 0);
|
||||
@@ -142,7 +142,7 @@ namespace boost
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int mID;
|
||||
int mThreadID;
|
||||
volatile int mRecursionCount;
|
||||
@@ -164,7 +164,7 @@ namespace boost
|
||||
|
||||
|
||||
/**
|
||||
** Emulating boost::thread configuration glue, with some shortcuts
|
||||
** Emulating boost::thread configuration glue, with some shortcuts
|
||||
** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp.
|
||||
*/
|
||||
namespace detail
|
||||
@@ -212,13 +212,13 @@ namespace boost
|
||||
**
|
||||
** The intent of its usage is this form only:
|
||||
** mWorkerThread = boost::thread(ThreadProc, this);
|
||||
** where ThreadProc is a static member function of the 'this' class,eg:
|
||||
** static void FOO::ThreadProc(void* inParam)
|
||||
** {
|
||||
** FOO* instance = reinterpret_cast<FOO*>(inParam);
|
||||
** // now you have class instance data available...
|
||||
** }
|
||||
**
|
||||
** where ThreadProc is a static member function of the 'this' class,eg:
|
||||
** static void FOO::ThreadProc(void* inParam)
|
||||
** {
|
||||
** FOO* instance = reinterpret_cast<FOO*>(inParam);
|
||||
** // now you have class instance data available...
|
||||
** }
|
||||
**
|
||||
** Any other variant of a thread proc with more than one param is unimplemented.
|
||||
*/
|
||||
class thread
|
||||
@@ -227,7 +227,7 @@ namespace boost
|
||||
** Helper class for sceKernelStartThread, which passes args by value, not by reference
|
||||
** We use this struct to wrap any pointers that we want to pass to the worker thread.
|
||||
*/
|
||||
struct CallbackData
|
||||
struct CallbackData
|
||||
{
|
||||
CallbackData(detail::thread_data_ptr inThreadInfo)
|
||||
: mThreadInfo(inThreadInfo)
|
||||
@@ -307,7 +307,7 @@ namespace boost
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(QT_CONFIG)
|
||||
#elif defined(QT_CONFIG) && (__cplusplus <= 199711L)
|
||||
|
||||
#include <QMutex>
|
||||
#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 // THREADING_H
|
||||
|
||||
@@ -136,6 +136,20 @@ signals:
|
||||
private slots:
|
||||
|
||||
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 doAndEnqueue(JButton action) {
|
||||
m_engine->HoldKey_NoRepeat(action);
|
||||
@@ -154,6 +168,7 @@ private:
|
||||
int m_timerId;
|
||||
bool m_active;
|
||||
QRect m_viewPort;
|
||||
QPoint m_lastPos;
|
||||
#ifdef QT_WIDGET
|
||||
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
|
||||
int mMouseDownX;
|
||||
|
||||
298
JGE/src/Downloader.cpp
Normal file
298
JGE/src/Downloader.cpp
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ void JFileSystem::clearZipCache()
|
||||
|
||||
bool JFileSystem::AttachZipFile(const string &zipfile, char *password /* = NULL */)
|
||||
{
|
||||
if (mZipAvailable && mZipFile != NULL)
|
||||
if (mZipAvailable && mZipFile.is_open())
|
||||
{
|
||||
if (mZipFileName != zipfile)
|
||||
DetachZipFile(); // close the previous zip file
|
||||
@@ -313,11 +313,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
|
||||
|
||||
int fileSize = GetFileSize(file);
|
||||
|
||||
#ifndef __MINGW32__
|
||||
try {
|
||||
#endif
|
||||
target.resize((std::string::size_type) fileSize);
|
||||
#ifndef __MINGW32__
|
||||
} catch (bad_alloc&) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (fileSize)
|
||||
@@ -553,7 +557,13 @@ bool JFileSystem::Rename(string _from, string _to)
|
||||
string from = mUserFSPath + _from;
|
||||
string to = mUserFSPath + _to;
|
||||
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)
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
#include <QtDeclarative>
|
||||
#include "qmlapplicationviewer.h"
|
||||
#endif //QT_WIDGET
|
||||
#include "filedownloader.h"
|
||||
#include "Downloader.h"
|
||||
#include "GameApp.h"
|
||||
#include "corewrapper.h"
|
||||
|
||||
QWidget* g_glwidget = NULL;
|
||||
WagicCore* g_glwidget = NULL;
|
||||
|
||||
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
|
||||
{
|
||||
@@ -69,18 +69,25 @@ int main(int argc, char* argv[])
|
||||
|
||||
#endif //QT_WIDGET
|
||||
|
||||
if(argc >= 2 && string(argv[1]) == "testsuite")
|
||||
{
|
||||
int result = 0;
|
||||
result += WagicCore::runTestSuite();
|
||||
return result;
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore");
|
||||
|
||||
|
||||
@@ -78,7 +78,20 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume(
|
||||
{
|
||||
if (!g_engine)
|
||||
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
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
JMusic::JMusic()
|
||||
#ifdef USE_PHONON
|
||||
: mOutput(0), mMediaObject(0)
|
||||
#elif defined QT_CONFIG
|
||||
: playlist(0), player(0)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
@@ -40,11 +42,16 @@ int JMusic::getPlayTime(){
|
||||
|
||||
JMusic::~JMusic()
|
||||
{
|
||||
#ifdef USE_PHONON
|
||||
#if defined USE_PHONON
|
||||
if(mOutput)
|
||||
delete mOutput;
|
||||
if(mMediaObject)
|
||||
delete mMediaObject;
|
||||
#elif defined QT_CONFIG
|
||||
if(player)
|
||||
delete player;
|
||||
if(playlist)
|
||||
delete playlist;
|
||||
#elif defined WITH_FMOD
|
||||
JSoundSystem::GetInstance()->StopMusic(this);
|
||||
if (mTrack) FSOUND_Sample_Free(mTrack);
|
||||
@@ -60,7 +67,9 @@ void JMusic::seekAtTheBegining()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
JSample::JSample()
|
||||
#ifdef USE_PHONON
|
||||
#ifdef QT_CONFIG
|
||||
: effect(0)
|
||||
#elif (defined USE_PHONON)
|
||||
: mOutput(0), mMediaObject(0)
|
||||
#endif
|
||||
{
|
||||
@@ -69,7 +78,12 @@ JSample::JSample()
|
||||
|
||||
JSample::~JSample()
|
||||
{
|
||||
#ifdef USE_PHONON
|
||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||
if(effect) {
|
||||
delete effect;
|
||||
effect = 0;
|
||||
}
|
||||
#elif (defined USE_PHONON)
|
||||
if(mOutput)
|
||||
delete mOutput;
|
||||
if(mMediaObject)
|
||||
@@ -144,65 +158,84 @@ void JSoundSystem::DestroySoundSystem()
|
||||
|
||||
JMusic *JSoundSystem::LoadMusic(const char *fileName)
|
||||
{
|
||||
#ifdef USE_PHONON
|
||||
JMusic* 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)
|
||||
JMusic* music = NULL;
|
||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||
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();
|
||||
}
|
||||
music->player = new QMediaPlayer;
|
||||
music->player->setVolume(100);
|
||||
music->playlist = new QMediaPlaylist;
|
||||
music->fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||
music->playlist->addMedia(QUrl::fromLocalFile(music->fullpath.c_str()));
|
||||
music->playlist->setCurrentIndex(0);
|
||||
}
|
||||
#elif defined USE_PHONON
|
||||
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());
|
||||
}
|
||||
#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
|
||||
cerr << fileName << endl;
|
||||
return NULL;
|
||||
#endif
|
||||
return music;
|
||||
}
|
||||
|
||||
|
||||
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
||||
{
|
||||
#ifdef USE_PHONON
|
||||
if (music && music->mMediaObject && music->mOutput)
|
||||
{
|
||||
if(looping)
|
||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||
if(music && music->player && music->playlist)
|
||||
{
|
||||
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);
|
||||
music->mMediaObject->play();
|
||||
|
||||
}
|
||||
#elif (defined WITH_FMOD)
|
||||
if (music && music->mTrack)
|
||||
#elif USE_PHONON
|
||||
if (music && music->mMediaObject && music->mOutput)
|
||||
{
|
||||
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
|
||||
SetMusicVolume(mVolume);
|
||||
if(looping)
|
||||
{
|
||||
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);
|
||||
else
|
||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
|
||||
}
|
||||
#elif (defined WITH_FMOD)
|
||||
if (music && music->mTrack)
|
||||
{
|
||||
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
|
||||
SetMusicVolume(mVolume);
|
||||
|
||||
if (looping)
|
||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL);
|
||||
else
|
||||
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
|
||||
}
|
||||
#else
|
||||
music = 0;
|
||||
@@ -213,7 +246,12 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
|
||||
|
||||
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)
|
||||
{
|
||||
music->mMediaObject->stop();
|
||||
@@ -264,47 +302,61 @@ void JSoundSystem::SetSfxVolume(int volume){
|
||||
|
||||
JSample *JSoundSystem::LoadSample(const char *fileName)
|
||||
{
|
||||
#if (defined USE_PHONON)
|
||||
JSample* 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)
|
||||
JSample* sample = NULL;
|
||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||
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);
|
||||
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
|
||||
sample->effect = new QMediaPlayer;
|
||||
sample->effect->setMedia(QUrl::fromLocalFile(fullpath.c_str()));
|
||||
sample->effect->setVolume(100);
|
||||
sample->mSample = &(sample->effect);
|
||||
}
|
||||
#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;
|
||||
fileSystem->CloseFile();
|
||||
}else
|
||||
sample->mSample = NULL;
|
||||
delete[] buffer;
|
||||
fileSystem->CloseFile();
|
||||
}else
|
||||
sample->mSample = NULL;
|
||||
|
||||
}
|
||||
return sample;
|
||||
#else
|
||||
cerr << fileName << endl;
|
||||
return NULL;
|
||||
#endif
|
||||
return 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)
|
||||
{
|
||||
sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
|
||||
|
||||
@@ -418,29 +418,29 @@ void WagicCore::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
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 correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
|
||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
||||
|
||||
if (lastPos.y() >= m_viewPort.top() &&
|
||||
lastPos.y() <= m_viewPort.bottom() &&
|
||||
lastPos.x() <= m_viewPort.right() &&
|
||||
lastPos.x() >= m_viewPort.left()) {
|
||||
if (lastPosy() >= m_viewPort.top() &&
|
||||
lastPosy() <= m_viewPort.bottom() &&
|
||||
lastPosx() <= m_viewPort.right() &&
|
||||
lastPosx() >= m_viewPort.left()) {
|
||||
m_engine->LeftClicked(
|
||||
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
||||
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
||||
((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
||||
((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
||||
#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID)
|
||||
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
||||
#else
|
||||
mMouseDownX = lastPos.x();
|
||||
mMouseDownY = lastPos.y();
|
||||
mMouseDownX = lastPosx();
|
||||
mMouseDownY = lastPosy();
|
||||
mLastFingerDownTime = g_startTimer.elapsed();
|
||||
#endif
|
||||
} else if(lastPos.y()<m_viewPort.top()) {
|
||||
} else if(lastPosy()<m_viewPort.top()) {
|
||||
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);
|
||||
}
|
||||
event->accept();
|
||||
@@ -465,33 +465,33 @@ void WagicCore::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if(event->button() == Qt::LeftButton)
|
||||
{
|
||||
QPoint lastPos = event->pos();
|
||||
m_lastPos = event->pos();
|
||||
|
||||
if (lastPos.y() >= m_viewPort.top() &&
|
||||
lastPos.y() <= m_viewPort.bottom() &&
|
||||
lastPos.x() <= m_viewPort.right() &&
|
||||
lastPos.x() >= m_viewPort.left()) {
|
||||
if (lastPosy() >= m_viewPort.top() &&
|
||||
lastPosy() <= m_viewPort.bottom() &&
|
||||
lastPosx() <= m_viewPort.right() &&
|
||||
lastPosx() >= m_viewPort.left()) {
|
||||
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
|
||||
if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout )
|
||||
{
|
||||
if(abs(mMouseDownX - lastPos.x()) < kHitzonePliancy &&
|
||||
abs(mMouseDownY - lastPos.y()) < kHitzonePliancy)
|
||||
if(abs(mMouseDownX - lastPosx()) < kHitzonePliancy &&
|
||||
abs(mMouseDownY - lastPosy()) < kHitzonePliancy)
|
||||
{
|
||||
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
||||
}
|
||||
}
|
||||
else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration)
|
||||
{ // Let's swipe
|
||||
m_engine->Scroll(lastPos.x()-mMouseDownX, lastPos.y()-mMouseDownY);
|
||||
m_engine->Scroll(lastPosx()-mMouseDownX, lastPosy()-mMouseDownY);
|
||||
}
|
||||
#else
|
||||
//#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN)
|
||||
m_engine->ReleaseKey(JGE_BTN_OK);
|
||||
#endif
|
||||
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);
|
||||
} else if(lastPos.y() > m_viewPort.bottom()) {
|
||||
} else if(lastPosy() > m_viewPort.bottom()) {
|
||||
m_engine->ReleaseKey(JGE_BTN_NEXT);
|
||||
}
|
||||
event->accept();
|
||||
@@ -517,15 +517,15 @@ void WagicCore::mouseMoveEvent(QMouseEvent *event)
|
||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
||||
|
||||
QPoint lastPos = event->pos();
|
||||
m_lastPos = event->pos();
|
||||
|
||||
if (lastPos.y() >= m_viewPort.top() &&
|
||||
lastPos.y() <= m_viewPort.bottom() &&
|
||||
lastPos.x() <= m_viewPort.right() &&
|
||||
lastPos.x() >= m_viewPort.left()) {
|
||||
if (lastPosy() >= m_viewPort.top() &&
|
||||
lastPosy() <= m_viewPort.bottom() &&
|
||||
lastPosx() <= m_viewPort.right() &&
|
||||
lastPosx() >= m_viewPort.left()) {
|
||||
m_engine->LeftClicked(
|
||||
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
||||
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
||||
((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
|
||||
((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
|
||||
event->accept();
|
||||
} else {
|
||||
super::mouseMoveEvent(event);
|
||||
|
||||
@@ -106,6 +106,7 @@ public:
|
||||
virtual int overflow(int c = EOF);
|
||||
virtual int underflow();
|
||||
virtual int sync();
|
||||
using std::streambuf::setbuf;
|
||||
virtual std::streambuf * setbuf(char * pr, int nLength);
|
||||
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 underflow();
|
||||
virtual int sync();
|
||||
using std::streambuf::setbuf;
|
||||
virtual std::streambuf * setbuf(char * pr, int nLength);
|
||||
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
|
||||
[](https://travis-ci.org/WagicProject/wagic)
|
||||
[](https://ci.appveyor.com/project/xawotihs/wagic/branch/master)
|
||||
[](https://coveralls.io/r/WagicProject/wagic?branch=master)
|
||||
|
||||
## 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...
|
||||
|
||||
|
||||
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)
|
||||
|
||||
76
appveyor.yml
Normal file
76
appveyor.yml
Normal file
@@ -0,0 +1,76 @@
|
||||
# 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.
|
||||
|
||||
# branches to build
|
||||
branches:
|
||||
# blacklist
|
||||
except:
|
||||
- travis_mac_osx
|
||||
# Do not build on tags (GitHub only)
|
||||
skip_tags: true
|
||||
|
||||
#---------------------------------#
|
||||
# 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 tools/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
|
||||
|
||||
@@ -57,7 +57,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
|
||||
$(MTG_PATH)/src/DeckMetaData.cpp \
|
||||
$(MTG_PATH)/src/DeckStats.cpp \
|
||||
$(MTG_PATH)/src/DuelLayers.cpp \
|
||||
$(MTG_PATH)/src/Effects.cpp \
|
||||
$(MTG_PATH)/src/ExtraCost.cpp \
|
||||
$(MTG_PATH)/src/GameApp.cpp \
|
||||
$(MTG_PATH)/src/GameLauncher.cpp \
|
||||
|
||||
@@ -80,7 +80,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
public Boolean mErrorHappened = false;
|
||||
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
|
||||
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/";
|
||||
private String userFolder;
|
||||
@@ -307,7 +306,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
|
||||
private void startDownload()
|
||||
{
|
||||
String url = RES_URL + RES_FILENAME;
|
||||
String url = getResourceUrl();
|
||||
if (!checkStorageState())
|
||||
{
|
||||
Log.e(TAG, "Error in initializing storage space.");
|
||||
@@ -437,7 +436,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
mContext = this.getApplicationContext();
|
||||
// get the current version of the app to set the core filename
|
||||
String versionCodeString = getApplicationCode();
|
||||
RES_FILENAME = "core_" + versionCodeString + ".zip";
|
||||
RES_FILENAME = getResourceName();
|
||||
|
||||
StorageOptions.determineStorageOptions();
|
||||
checkStorageLocationPreference();
|
||||
@@ -525,6 +524,9 @@ public class SDLActivity extends Activity implements OnKeyListener
|
||||
}
|
||||
|
||||
// C functions we call
|
||||
public static native String getResourceUrl();
|
||||
public static native String getResourceName();
|
||||
|
||||
public static native void nativeInit();
|
||||
|
||||
public static native void nativeQuit();
|
||||
|
||||
20
projects/mtg/MacOS/Info.plist
Normal file
20
projects/mtg/MacOS/Info.plist
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>Created by Qt/QMake</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>wagic.launcher</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>wagic.wagic</string>
|
||||
<key>NOTE</key>
|
||||
<string>This file was generated by Qt/QMake.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
projects/mtg/MacOS/wagic.icns
Normal file
BIN
projects/mtg/MacOS/wagic.icns
Normal file
Binary file not shown.
5
projects/mtg/MacOS/wagic.launcher
Executable file
5
projects/mtg/MacOS/wagic.launcher
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ${0%/*/*}/Resources
|
||||
#cd ../Resources
|
||||
exec ../MacOS/wagic -platformpluginpath ../PlugIns >> ../logs/out.log 2> ../logs/err.log
|
||||
@@ -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/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.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/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
|
||||
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
|
||||
@@ -86,7 +86,7 @@ all: $(DEFAULT_RULE)
|
||||
|
||||
endif
|
||||
|
||||
CFLAGS := -Wall -W -Werror -Wno-unused $(CFLAGS)
|
||||
CFLAGS := -Wall -W -Wno-unused $(CFLAGS)
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
# -fno-exceptions
|
||||
|
||||
@@ -128,7 +128,7 @@ clean:
|
||||
endif
|
||||
|
||||
define compile
|
||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||
endef
|
||||
|
||||
PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h
|
||||
|
||||
@@ -7,10 +7,13 @@ from optparse import OptionParser
|
||||
def createResZipFile(filename):
|
||||
|
||||
utilities = ZipUtilities()
|
||||
rename = False
|
||||
if not os.path.isfile('settings/options.txt'):
|
||||
os.rename('settings/options.orig.txt', 'settings/options.txt')
|
||||
remame = True
|
||||
if not os.path.isfile('player/options.txt'):
|
||||
os.rename('player/options.orig.txt', 'player/options.txt')
|
||||
rename = True
|
||||
|
||||
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
|
||||
utilities.addFolderToZip(zip_file, 'themes')
|
||||
@@ -25,6 +28,10 @@ def createResZipFile(filename):
|
||||
utilities.addFolderToZip(zip_file, 'campaigns')
|
||||
utilities.addFolderToZip(zip_file, 'ai')
|
||||
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():
|
||||
p = Properties();
|
||||
@@ -37,16 +44,18 @@ def getFilename():
|
||||
|
||||
|
||||
|
||||
def createStandardResFile():
|
||||
print "Creating Standard Resource File"
|
||||
filename = getFilename() + '.zip'
|
||||
def createStandardResFile(filename):
|
||||
print('Creating Standard Resource File')
|
||||
if not filename:
|
||||
filename = getFilename() + '.zip'
|
||||
createResZipFile( filename )
|
||||
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
|
||||
|
||||
def createIosResFile():
|
||||
print 'Preparing Resource Package for iOS'
|
||||
def createIosResFile(filename):
|
||||
print('Preparing Resource Package for iOS')
|
||||
utilities = ZipUtilities()
|
||||
filename = getFilename() + '_iOS.zip'
|
||||
if not filename:
|
||||
filename = getFilename() + '_iOS.zip'
|
||||
#createResZipFile( filename )
|
||||
zip_file = zipfile.ZipFile(filename, 'a', 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':
|
||||
full_path = os.path.join(folder, file)
|
||||
if os.path.isfile(full_path):
|
||||
print 'File added: ' + str(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)
|
||||
print('Entering folder: ' + str(full_path))
|
||||
self.addFolderToZip(zip_file, full_path)
|
||||
|
||||
|
||||
@@ -83,16 +92,17 @@ def main():
|
||||
|
||||
parser = OptionParser()
|
||||
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()
|
||||
|
||||
if (options.platform):
|
||||
if (options.platform == "ios"):
|
||||
createIosResFile()
|
||||
else:
|
||||
createStandardResFile()
|
||||
if (options.platform == "ios"):
|
||||
createIosResFile(options.name)
|
||||
else:
|
||||
createStandardResFile(options.name)
|
||||
else:
|
||||
createStandardResFile()
|
||||
createStandardResFile(options.name)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
846
projects/mtg/bin/Res/sets/BNG/_cards.dat
Normal file
846
projects/mtg/bin/Res/sets/BNG/_cards.dat
Normal file
@@ -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]
|
||||
1324
projects/mtg/bin/Res/sets/DTK/_cards.dat
Normal file
1324
projects/mtg/bin/Res/sets/DTK/_cards.dat
Normal file
File diff suppressed because it is too large
Load Diff
21
projects/mtg/bin/Res/sets/DTK/booster.txt
Normal file
21
projects/mtg/bin/Res/sets/DTK/booster.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
<PACK name="Dragons of Tarkir" type="Booster" pool="all set:DTK;" price="700">
|
||||
<slot copies="1">
|
||||
<random_card>rarity:mythic;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
</slot>
|
||||
<slot copies="3">
|
||||
<random_card>rarity:uncommon;</random_card>
|
||||
</slot>
|
||||
<slot copies="1">
|
||||
<random_card>rarity:special;</random_card>
|
||||
</slot>
|
||||
<slot copies="10">
|
||||
<random_card>rarity:common;</random_card>
|
||||
</slot>
|
||||
</PACK>
|
||||
934
projects/mtg/bin/Res/sets/FRF/_cards.dat
Normal file
934
projects/mtg/bin/Res/sets/FRF/_cards.dat
Normal file
@@ -0,0 +1,934 @@
|
||||
[meta]
|
||||
author=Wagic Team
|
||||
year=2015
|
||||
[/meta]
|
||||
[card]
|
||||
primitive=Abzan Advantage
|
||||
id=391781
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Abzan Beastmaster
|
||||
id=391782
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Abzan Kin-Guard
|
||||
id=391783
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Abzan Runemark
|
||||
id=391784
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Abzan Skycaptain
|
||||
id=391785
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ainok Guide
|
||||
id=391786
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Alesha, Who Smiles at Death
|
||||
id=391787
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Alesha's Vanguard
|
||||
id=391788
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ambush Krotiq
|
||||
id=391789
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ancestral Vengeance
|
||||
id=391790
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Arashin Cleric
|
||||
id=391791
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Arashin War Beast
|
||||
id=391792
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Arcbond
|
||||
id=391793
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Archers of Qarsi
|
||||
id=391794
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Archfiend of Depravity
|
||||
id=391795
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Atarka, World Render
|
||||
id=391796
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Aven Skirmisher
|
||||
id=391797
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Aven Surveyor
|
||||
id=391798
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bathe in Dragonfire
|
||||
id=391799
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Battle Brawler
|
||||
id=391800
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Battlefront Krushok
|
||||
id=391801
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bloodfell Caves
|
||||
id=391802
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bloodfire Enforcers
|
||||
id=391803
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Blossoming Sands
|
||||
id=391804
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Break Through the Line
|
||||
id=391805
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Brutal Hordechief
|
||||
id=391806
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cached Defenses
|
||||
id=391807
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Channel Harm
|
||||
id=391808
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Citadel Siege
|
||||
id=391809
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cloudform
|
||||
id=391810
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Collateral Damage
|
||||
id=391811
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Crucible of the Spirit Dragon
|
||||
id=391812
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Crux of Fate
|
||||
id=391813
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cunning Strike
|
||||
id=391814
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Daghatar the Adamant
|
||||
id=391815
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dark Deal
|
||||
id=391816
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Defiant Ogre
|
||||
id=391817
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Destructor Dragon
|
||||
id=391818
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Diplomacy of the Wastes
|
||||
id=391819
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dismal Backwater
|
||||
id=391820
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Douse in Gloom
|
||||
id=391821
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dragon Bell Monk
|
||||
id=391822
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dragonrage
|
||||
id=391823
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dragonscale General
|
||||
id=391824
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dromoka, the Eternal
|
||||
id=391825
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Elite Scaleguard
|
||||
id=391826
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Enhanced Awareness
|
||||
id=391827
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ethereal Ambush
|
||||
id=391828
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Fascination
|
||||
id=391829
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Fearsome Awakening
|
||||
id=391830
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Feral Krushok
|
||||
id=391831
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Fierce Invocation
|
||||
id=391832
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Flamerush Rider
|
||||
id=391833
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Flamewake Phoenix
|
||||
id=391834
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forest
|
||||
id=391836
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Formless Nurturing
|
||||
id=391837
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Friendly Fire
|
||||
id=391838
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Frontier Mastodon
|
||||
id=391839
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Frontier Siege
|
||||
id=391840
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Frost Walker
|
||||
id=391841
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Fruit of the First Tree
|
||||
id=391842
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ghastly Conscription
|
||||
id=391843
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Goblin Boom Keg
|
||||
id=391844
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Goblin Heelcutter
|
||||
id=391845
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Gore Swine
|
||||
id=391846
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Grave Strength
|
||||
id=391847
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Great-Horn Krushok
|
||||
id=391848
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Grim Contest
|
||||
id=391849
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Gurmag Angler
|
||||
id=391850
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Harsh Sustenance
|
||||
id=391851
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hero's Blade
|
||||
id=391852
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hewed Stone Retainers
|
||||
id=391853
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Honor's Reward
|
||||
id=391854
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hooded Assassin
|
||||
id=391855
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Humble Defector
|
||||
id=391856
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hungering Yeti
|
||||
id=391857
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hunt the Weak
|
||||
id=391858
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Island
|
||||
id=391859
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Jeskai Barricade
|
||||
id=391861
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Jeskai Infiltrator
|
||||
id=391862
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Jeskai Runemark
|
||||
id=391863
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Jeskai Sage
|
||||
id=391864
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Jungle Hollow
|
||||
id=391865
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kolaghan, the Storm's Fury
|
||||
id=391866
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lightform
|
||||
id=391867
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lightning Shrieker
|
||||
id=391868
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lotus Path Djinn
|
||||
id=391869
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lotus-Eye Mystics
|
||||
id=391870
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Map the Wastes
|
||||
id=391871
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Marang River Prowler
|
||||
id=391872
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mardu Runemark
|
||||
id=391873
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mardu Scout
|
||||
id=391874
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mardu Shadowspear
|
||||
id=391875
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mardu Strike Leader
|
||||
id=391876
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mardu Woe-Reaper
|
||||
id=391877
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mastery of the Unseen
|
||||
id=391878
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Merciless Executioner
|
||||
id=391879
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mindscour Dragon
|
||||
id=391880
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mistfire Adept
|
||||
id=391881
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mob Rule
|
||||
id=391882
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Monastery Mentor
|
||||
id=391883
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Monk Token
|
||||
id=-391883
|
||||
rarity=T
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Monastery Siege
|
||||
id=391884
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mountain
|
||||
id=391885
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Neutralizing Blast
|
||||
id=391887
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Noxious Dragon
|
||||
id=391888
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ojutai, Soul of Winter
|
||||
id=391889
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Orc Sureshot
|
||||
id=391890
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Outpost Siege
|
||||
id=391891
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Palace Siege
|
||||
id=391892
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pilgrim of the Fires
|
||||
id=391893
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plains
|
||||
id=391895
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pressure Point
|
||||
id=391896
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pyrotechnics
|
||||
id=391897
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Qarsi High Priest
|
||||
id=391898
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rageform
|
||||
id=391899
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rakshasa's Disdain
|
||||
id=391900
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rally the Ancestors
|
||||
id=391901
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Reach of Shadows
|
||||
id=391902
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Reality Shift
|
||||
id=391903
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Refocus
|
||||
id=391904
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Renowned Weaponsmith
|
||||
id=391905
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Return to the Earth
|
||||
id=391906
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rite of Undoing
|
||||
id=391907
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rugged Highlands
|
||||
id=391908
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ruthless Instincts
|
||||
id=391909
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sage-Eye Avengers
|
||||
id=391911
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sage's Reverie
|
||||
id=391910
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sandblast
|
||||
id=391912
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sandsteppe Mastodon
|
||||
id=391913
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sandsteppe Outcast
|
||||
id=391914
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Scoured Barrens
|
||||
id=391915
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Scroll of the Masters
|
||||
id=391916
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Shaman of the Great Hunt
|
||||
id=391917
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Shamanic Revelation
|
||||
id=391918
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Shifting Loyalties
|
||||
id=391919
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Shockmaw Dragon
|
||||
id=391920
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Shu Yun, the Silent Tempest
|
||||
id=391921
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sibsig Host
|
||||
id=391922
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sibsig Muckdraggers
|
||||
id=391923
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Silumgar, the Drifting Death
|
||||
id=391924
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Smoldering Efreet
|
||||
id=391925
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Soul Summons
|
||||
id=391926
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Soulfire Grand Master
|
||||
id=391927
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Soulflayer
|
||||
id=391928
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sudden Reclamation
|
||||
id=391929
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sultai Emissary
|
||||
id=391930
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sultai Runemark
|
||||
id=391931
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sultai Skullkeeper
|
||||
id=391932
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Supplant Form
|
||||
id=391933
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swamp
|
||||
id=391934
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swiftwater Cliffs
|
||||
id=391936
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Tasigur, the Golden Fang
|
||||
id=391937
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Tasigur's Cruelty
|
||||
id=391938
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temporal Trespass
|
||||
id=391939
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temur Battle Rage
|
||||
id=391940
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temur Runemark
|
||||
id=391941
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temur Sabertooth
|
||||
id=391942
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temur War Shaman
|
||||
id=391943
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Thornwood Falls
|
||||
id=391944
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Torrent Elemental
|
||||
id=391945
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Tranquil Cove
|
||||
id=391946
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Typhoid Rats
|
||||
id=391947
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ugin, the Spirit Dragon
|
||||
id=391948
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ugin's Construct
|
||||
id=391949
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Valorous Stance
|
||||
id=391950
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Vaultbreaker
|
||||
id=391951
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wandering Champion
|
||||
id=391952
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=War Flare
|
||||
id=391953
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Warden of the First Tree
|
||||
id=391954
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wardscale Dragon
|
||||
id=391955
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Whisk Away
|
||||
id=391956
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Whisperer of the Wilds
|
||||
id=391957
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Whisperwood Elemental
|
||||
id=391958
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wild Slash
|
||||
id=391959
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wildcall
|
||||
id=391960
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Will of the Naga
|
||||
id=391961
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Winds of Qal Sisma
|
||||
id=391962
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wind-Scarred Crag
|
||||
id=391963
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Write into Being
|
||||
id=391964
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Yasova Dragonclaw
|
||||
id=391965
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forest
|
||||
id=391835
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Island
|
||||
id=391860
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mountain
|
||||
id=391886
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Plains
|
||||
id=391894
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swamp
|
||||
id=391935
|
||||
rarity=C
|
||||
[/card]
|
||||
21
projects/mtg/bin/Res/sets/FRF/booster.txt
Normal file
21
projects/mtg/bin/Res/sets/FRF/booster.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
<PACK name="Fate Reforged" type="Booster" pool="all set:FRF;" price="700">
|
||||
<slot copies="1">
|
||||
<random_card>rarity:mythic;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
</slot>
|
||||
<slot copies="3">
|
||||
<random_card>rarity:uncommon;</random_card>
|
||||
</slot>
|
||||
<slot copies="1">
|
||||
<random_card>rarity:special;</random_card>
|
||||
</slot>
|
||||
<slot copies="10">
|
||||
<random_card>rarity:common;</random_card>
|
||||
</slot>
|
||||
</PACK>
|
||||
830
projects/mtg/bin/Res/sets/JOU/_cards.dat
Normal file
830
projects/mtg/bin/Res/sets/JOU/_cards.dat
Normal file
@@ -0,0 +1,830 @@
|
||||
[meta]
|
||||
author=Wagic Team
|
||||
year=2014
|
||||
block=Theros
|
||||
[/meta]
|
||||
[card]
|
||||
primitive=Aegis of the Gods
|
||||
id=380364
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Aerial Formation
|
||||
id=380365
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Agent of Erebos
|
||||
id=380366
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ajani, Mentor of Heroes
|
||||
id=380367
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ajani's Presence
|
||||
id=380368
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Akroan Line Breaker
|
||||
id=380369
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Akroan Mastiff
|
||||
id=380370
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Armament of Nyx
|
||||
id=380371
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Armory of Iroas
|
||||
id=380372
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Aspect of Gorgon
|
||||
id=380373
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Athreos, God of Passage
|
||||
id=380374
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Banishing Light
|
||||
id=380375
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bassara Tower Archer
|
||||
id=380376
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Battlefield Thaumaturge
|
||||
id=380377
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bearer of the Heavens
|
||||
id=380378
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bladetusk Boar
|
||||
id=380379
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Blinding Flare
|
||||
id=380380
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Bloodcrazed Hoplite
|
||||
id=380381
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Brain Maggot
|
||||
id=380382
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cast into Darkness
|
||||
id=380383
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Chariot of Victory
|
||||
id=380384
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cloaked Siren
|
||||
id=380385
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Colossal Heroics
|
||||
id=380386
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Consign to Dust
|
||||
id=380387
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Countermand
|
||||
id=380388
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cruel Feeding
|
||||
id=380389
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Crystalline Nautilus
|
||||
id=380390
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Cyclops of Eternal Fury
|
||||
id=380391
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dakra Mystic
|
||||
id=380392
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Daring Thief
|
||||
id=380393
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dawnbringer Charioteers
|
||||
id=380394
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Deicide
|
||||
id=380395
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Desecration Plague
|
||||
id=380396
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Deserter's Quarters
|
||||
id=380397
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Desperate Stand
|
||||
id=380398
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dictate of Erebos
|
||||
id=380399
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dictate of Heliod
|
||||
id=380400
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dictate of Karametra
|
||||
id=380401
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dictate of Kruphix
|
||||
id=380402
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dictate of the Twin Gods
|
||||
id=380403
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Disciple of Deceit
|
||||
id=380404
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Doomwake Giant
|
||||
id=380405
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Dreadbringer Lampads
|
||||
id=380406
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eagle of the Watch
|
||||
id=380407
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eidolon of Blossoms
|
||||
id=380408
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eidolon of Rhetoric
|
||||
id=380409
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Eidolon of the Great Revel
|
||||
id=380410
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Extinguish All Hope
|
||||
id=380411
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Feast of Dreams
|
||||
id=380412
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Felhide Petrifier
|
||||
id=380413
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Flamespeaker's Will
|
||||
id=380414
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Fleetfeather Cockatrice
|
||||
id=380415
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Flurry of Horns
|
||||
id=380416
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Font of Fertility
|
||||
id=380417
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Font of Fortunes
|
||||
id=380418
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Font of Ire
|
||||
id=380419
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Font of Return
|
||||
id=380420
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Font of Vigor
|
||||
id=380421
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Forgeborn Oreads
|
||||
id=380422
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Gluttonous Cyclops
|
||||
id=380423
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Gnarled Scarhide
|
||||
id=380424
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Godhunter Octopus
|
||||
id=380425
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Godsend
|
||||
id=380426
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Golden Hind
|
||||
id=380427
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Goldenhide Ox
|
||||
id=380428
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Gold-Forged Sentinel
|
||||
id=380429
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Grim Guardian
|
||||
id=380430
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hall of Triumph
|
||||
id=380431
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Harness by Force
|
||||
id=380432
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Harvestguard Alseids
|
||||
id=380433
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Heroes' Bane
|
||||
id=380434
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hour of Need
|
||||
id=380435
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hubris
|
||||
id=380436
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Humbler of Mortals
|
||||
id=380437
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hydra Broodmaster
|
||||
id=380438
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Hypnotic Siren
|
||||
id=380439
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Interpret the Signs
|
||||
id=380440
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Iroas, God of Victory
|
||||
id=380441
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Keranos, God of Storms
|
||||
id=380442
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=King Macar, the Gold-Cursed
|
||||
id=380443
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kiora's Dismissal
|
||||
id=380444
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Knowledge and Power
|
||||
id=380445
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kruphix, God of Horizons
|
||||
id=380446
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Kruphix's Insight
|
||||
id=380447
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lagonna-Band Trailblazer
|
||||
id=380448
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Launch the Fleet
|
||||
id=380449
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Leonin Iconoclast
|
||||
id=380450
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Lightning Diadem
|
||||
id=380451
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Magma Spray
|
||||
id=380452
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mana Confluence
|
||||
id=380453
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Market Festival
|
||||
id=380454
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Master of the Feast
|
||||
id=380455
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mogis's Warhound
|
||||
id=380456
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Mortal Obstinacy
|
||||
id=380457
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Nature's Panoply
|
||||
id=380458
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Nessian Game Warden
|
||||
id=380459
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Nightmarish End
|
||||
id=380460
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Nyx Infusion
|
||||
id=380461
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Nyx Weaver
|
||||
id=380462
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Nyx-Fleece Ram
|
||||
id=380463
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Oakheart Dryads
|
||||
id=380464
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Oppressive Rays
|
||||
id=380465
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Oreskos Swiftclaw
|
||||
id=380466
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pensive Minotaur
|
||||
id=380467
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Phalanx Formation
|
||||
id=380468
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pharika, God of Affliction
|
||||
id=380469
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pharika's Chosen
|
||||
id=380470
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pheres-Band Thunderhoof
|
||||
id=380471
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pheres-Band Warchief
|
||||
id=380472
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pin to the Earth
|
||||
id=380473
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Polymorphous Rush
|
||||
id=380474
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Prophetic Flamespeaker
|
||||
id=380475
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Pull from the Deep
|
||||
id=380476
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Quarry Colossus
|
||||
id=380477
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ravenous Leucrocota
|
||||
id=380478
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Renowned Weaver
|
||||
id=380479
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Reprisal
|
||||
id=380480
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Returned Reveler
|
||||
id=380481
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Revel of the Fallen God
|
||||
id=380482
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Reviving Melody
|
||||
id=380483
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Riddle of Lightning
|
||||
id=380484
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Riptide Chimera
|
||||
id=380485
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rise of Eagles
|
||||
id=380486
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Ritual of the Returned
|
||||
id=380487
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rollick of Abandon
|
||||
id=380488
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rotted Hulk
|
||||
id=380489
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Rouse the Mob
|
||||
id=380490
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sage of Hours
|
||||
id=380491
|
||||
rarity=M
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Satyr Grovedancer
|
||||
id=380492
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Satyr Hoplite
|
||||
id=380493
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Scourge of Fleets
|
||||
id=380494
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Setessan Tactics
|
||||
id=380495
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sightless Brawler
|
||||
id=380496
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sigiled Skink
|
||||
id=380497
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Sigiled Starfish
|
||||
id=380498
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Silence the Believers
|
||||
id=380499
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Skybind
|
||||
id=380500
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Skyspear Cavalry
|
||||
id=380501
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Solidarity of Heroes
|
||||
id=380502
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spawn of Thraxes
|
||||
id=380503
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spirespine
|
||||
id=380504
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spite of Mogis
|
||||
id=380505
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Spiteful Blow
|
||||
id=380506
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Squelching Leeches
|
||||
id=380507
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Starfall
|
||||
id=380508
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Stonewise Fortifier
|
||||
id=380509
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Stormchaser Chimera
|
||||
id=380510
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Strength from the Fallen
|
||||
id=380511
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Supply-Line Cranes
|
||||
id=380512
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Swarmborn Giant
|
||||
id=380513
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temple of Epiphany
|
||||
id=380514
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Temple of Malady
|
||||
id=380515
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Tethmos High Priest
|
||||
id=380516
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Thassa's Devourer
|
||||
id=380517
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Thassa's Ire
|
||||
id=380518
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Thoughtrender Lamia
|
||||
id=380519
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Tormented Thoughts
|
||||
id=380520
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Triton Cavalry
|
||||
id=380521
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Triton Shorestalker
|
||||
id=380522
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Twinflame
|
||||
id=380523
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Underworld Coinsmith
|
||||
id=380524
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=War-Wing Siren
|
||||
id=380525
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Whitewater Naiads
|
||||
id=380526
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Wildfire Cerberus
|
||||
id=380527
|
||||
rarity=U
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Worst Fears
|
||||
id=380528
|
||||
rarity=M
|
||||
[/card]
|
||||
21
projects/mtg/bin/Res/sets/JOU/booster.txt
Normal file
21
projects/mtg/bin/Res/sets/JOU/booster.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
<PACK name="Journey Into Nyx" type="Booster" pool="all set:JOU;" price="700">
|
||||
<slot copies="1">
|
||||
<random_card>rarity:mythic;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
</slot>
|
||||
<slot copies="3">
|
||||
<random_card>rarity:uncommon;</random_card>
|
||||
</slot>
|
||||
<slot copies="1">
|
||||
<random_card>rarity:special;</random_card>
|
||||
</slot>
|
||||
<slot copies="10">
|
||||
<random_card>rarity:common;</random_card>
|
||||
</slot>
|
||||
</PACK>
|
||||
1354
projects/mtg/bin/Res/sets/KTK/_cards.dat
Normal file
1354
projects/mtg/bin/Res/sets/KTK/_cards.dat
Normal file
File diff suppressed because it is too large
Load Diff
21
projects/mtg/bin/Res/sets/KTK/booster.txt
Normal file
21
projects/mtg/bin/Res/sets/KTK/booster.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
<PACK name="Khans of Tarkir" type="Booster" pool="all set:KTK;" price="700">
|
||||
<slot copies="1">
|
||||
<random_card>rarity:mythic;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
<random_card>rarity:rare;</random_card>
|
||||
</slot>
|
||||
<slot copies="3">
|
||||
<random_card>rarity:uncommon;</random_card>
|
||||
</slot>
|
||||
<slot copies="1">
|
||||
<random_card>rarity:special;</random_card>
|
||||
</slot>
|
||||
<slot copies="10">
|
||||
<random_card>rarity:common;</random_card>
|
||||
</slot>
|
||||
</PACK>
|
||||
@@ -1248,3 +1248,8 @@ primitive=Zombie Goliath
|
||||
id=190545
|
||||
rarity=C
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Avatar Token
|
||||
id=-191239
|
||||
rarity=T
|
||||
[/card]
|
||||
|
||||
@@ -1257,4 +1257,9 @@ rarity=U
|
||||
primitive=Yavimaya Wurm
|
||||
id=205221
|
||||
rarity=C
|
||||
[/card]
|
||||
[/card]
|
||||
[card]
|
||||
primitive=Avatar Token
|
||||
id=-205957
|
||||
rarity=T
|
||||
[/card]
|
||||
|
||||
1265
projects/mtg/bin/Res/sets/M14/_cards.dat
Normal file
1265
projects/mtg/bin/Res/sets/M14/_cards.dat
Normal file
File diff suppressed because it is too large
Load Diff
@@ -86,17 +86,6 @@ mana={5}{U}
|
||||
type=Sorcery
|
||||
[/card]
|
||||
[card]
|
||||
name=Gravecrawler
|
||||
abilities=cantblock
|
||||
autograveyard=aslongas(zombie|myBattlefield) {B}:name(cast from graveyard) activate name(cast from graveyard) castcard(normal) assorcery
|
||||
text=Gravecrawler can't block. -- You may cast Gravecrawler from your graveyard as long as you control a Zombie.
|
||||
mana={B}
|
||||
type=Creature
|
||||
subtype=Zombie
|
||||
power=2
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
name=Ivy Seer
|
||||
auto={2}{G}{T}:foreach(*[green]|myhand) 1/1 target(creature)
|
||||
text={2}{G}, {T}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4149,15 +4149,6 @@ mana={U}{U}
|
||||
type=Sorcery
|
||||
[/card]
|
||||
[card]
|
||||
name=Draining Whelk
|
||||
text=Flash (You may cast this spell any time you could cast an instant.) -- Flying -- When Draining Whelk enters the battlefield, counter target spell. Put X +1/+1 counters on Draining Whelk, where X is that spell's converted mana cost.
|
||||
mana={4}{U}{U}
|
||||
type=Creature
|
||||
subtype=Illusion
|
||||
power=1
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
name=Drake Umbra
|
||||
mana={4}{U}
|
||||
type=Enchantment
|
||||
@@ -7045,16 +7036,6 @@ mana={2}{G}
|
||||
type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
name=Heartlash Cinder
|
||||
abilities=haste
|
||||
text=Haste -- Chroma - When Heartlash Cinder enters the battlefield, it gets +X/+0 until end of turn, where X is the number of red mana symbols in the mana costs of permanents you control.
|
||||
mana={1}{R}
|
||||
type=Creature
|
||||
subtype=Elemental Warrior
|
||||
power=1
|
||||
toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
name=Heartstone
|
||||
text=Activated abilities of creatures cost {1} less to activate. This effect can't reduce the amount of mana an ability costs to activate to less than one mana.
|
||||
mana={3}
|
||||
@@ -7686,12 +7667,6 @@ type=Instant
|
||||
text=As an additional cost to cast Induce Despair, reveal a creature card from your hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost.
|
||||
[/card]
|
||||
[card]
|
||||
name=Induce Paranoia
|
||||
text=Counter target spell. If {B} was spent to cast Induce Paranoia, that spell's controller puts the top X cards of his or her library into his or her graveyard, where X is the spell's converted mana cost.
|
||||
mana={2}{U}{U}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
name=Inescapable Brute
|
||||
text=Wither (This deals damage to creatures in the form of -1/-1 counters.) -- Inescapable Brute must be blocked if able.
|
||||
mana={5}{R}
|
||||
@@ -11490,15 +11465,6 @@ mana={X}{R}
|
||||
type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
name=Outrage Shaman
|
||||
text=Chroma - When Outrage Shaman enters the battlefield, it deals damage to target creature equal to the number of red mana symbols in the mana costs of permanents you control.
|
||||
mana={3}{R}{R}
|
||||
type=Creature
|
||||
subtype=Goblin Shaman
|
||||
power=2
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Outrider en-Kor
|
||||
text=Flanking (Whenever a creature without flanking blocks this creature, the blocking creature gets -1/-1 until end of turn.) -- {0}: The next 1 damage that would be dealt to Outrider en-Kor this turn is dealt to target creature you control instead.
|
||||
mana={2}{W}
|
||||
@@ -12350,15 +12316,6 @@ power=2
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Primalcrux
|
||||
text=Trample -- Chroma - Primalcrux's power and toughness are each equal to the number of green mana symbols in the mana costs of permanents you control.
|
||||
mana={G}{G}{G}{G}{G}{G}
|
||||
type=Creature
|
||||
subtype=Elemental
|
||||
power=*
|
||||
toughness=*
|
||||
[/card]
|
||||
[card]
|
||||
name=Primitive Etchings
|
||||
text=Reveal the first card you draw each turn. Whenever you reveal a creature card this way, draw a card.
|
||||
mana={2}{G}{G}
|
||||
@@ -12905,13 +12862,6 @@ mana={R}{R}
|
||||
type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
name=Ral Zarek
|
||||
text=+1: Tap target permanent, then untap another target permanent. -- -2: Ral Zarek deals 3 damage to target creature or player. -- -7: Flip five coins. Take an extra turn after this one for each coin that comes up heads.
|
||||
mana={2}{U}{R}
|
||||
type=Planeswalker
|
||||
subtype=Ral
|
||||
[/card]
|
||||
[card]
|
||||
name=Raiding Party
|
||||
text=Raiding Party can't be the target of white spells or abilities from white sources. -- Sacrifice an Orc: Each player may tap any number of untapped white creatures he or she controls. For each creature tapped this way, that player chooses up to two Plains. Then destroy all Plains that weren't chosen this way by any player.
|
||||
mana={2}{R}
|
||||
@@ -14541,12 +14491,6 @@ mana={W}
|
||||
type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
name=Serum Powder
|
||||
text={T}: Add {1} to your mana pool. -- Any time you could mulligan and Serum Powder is in your hand, you may exile all the cards from your hand, then draw that many cards. (You can do this in addition to taking mulligans.)
|
||||
mana={3}
|
||||
type=Artifact
|
||||
[/card]
|
||||
[card]
|
||||
name=Serum Visions
|
||||
text=Draw a card. -- Scry 2. (To scry 2, look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)
|
||||
mana={U}
|
||||
@@ -15830,15 +15774,6 @@ text={T}: Add {1} to your mana pool. -- {4}, {T}: Put a 0/1 white Goat creature
|
||||
type=Land
|
||||
[/card]
|
||||
[card]
|
||||
name=Springjack Shepherd
|
||||
text=Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control.
|
||||
mana={3}{W}
|
||||
type=Creature
|
||||
subtype=Kithkin Wizard
|
||||
power=1
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Sprout Swarm
|
||||
text=Convoke (Each creature you tap while casting this spell reduces its total cost by {1} or by one mana of that creature's color.) -- Buyback {3} (You may pay an additional {3} as you cast this spell. If you do, put this card into your hand as it resolves.) -- Put a 1/1 green Saproling creature token onto the battlefield.
|
||||
mana={1}{G}
|
||||
@@ -17631,15 +17566,6 @@ toughness=2
|
||||
text=Auras attached to permanents you control have totem armor. (If an enchanted permanent you control would be destroyed, instead remove all damage from it and destroy an Aura attached to it.)
|
||||
[/card]
|
||||
[card]
|
||||
name=Umbra Stalker
|
||||
text=Chroma - Umbra Stalker's power and toughness are each equal to the number of black mana symbols in the mana costs of cards in your graveyard.
|
||||
mana={4}{B}{B}{B}
|
||||
type=Creature
|
||||
subtype=Elemental
|
||||
power=*
|
||||
toughness=*
|
||||
[/card]
|
||||
[card]
|
||||
name=Unblinking Bleb
|
||||
text=Morph {2}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) -- Whenever Unblinking Bleb or another permanent is turned face up, you may scry 2. (To scry 2, look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)
|
||||
mana={3}{U}
|
||||
|
||||
@@ -204,6 +204,7 @@ brass_man.txt
|
||||
brass_man_i161.txt
|
||||
briarhorn.txt
|
||||
bringer_of_the_red_dawn.txt
|
||||
buyback.txt
|
||||
cage_of_hands.txt
|
||||
Call_to_Heel_1.txt
|
||||
Call_to_Heel_2.txt
|
||||
@@ -308,6 +309,9 @@ evil_presence3.txt
|
||||
evil_presence_i647.txt
|
||||
evil_presence_i647_2.txt
|
||||
exaltedsourcekilled.txt
|
||||
executioners_swing.txt
|
||||
executioners_swing2.txt
|
||||
executioners_swing3.txt
|
||||
explore.txt
|
||||
Faceless_Butcher.txt
|
||||
fading.txt
|
||||
@@ -341,6 +345,7 @@ foratog.txt
|
||||
force_of_nature.txt
|
||||
force_of_nature2.txt
|
||||
force_of_nature3.txt
|
||||
formidable.txt
|
||||
fountain_of_youth.txt
|
||||
Frogmite.txt
|
||||
fungus_sliver.txt
|
||||
@@ -657,6 +662,8 @@ tidal_warrior_i649.txt
|
||||
tidal_warrior_i652.txt
|
||||
Timely_Reinforcements.txt
|
||||
titanic_ultimatum.txt
|
||||
tokenizer.txt
|
||||
tokenizer2.txt
|
||||
torture.txt
|
||||
tranquil_domain.txt
|
||||
turn_to_slag.txt
|
||||
@@ -710,4 +717,5 @@ momir/overcost.txt
|
||||
#AI Tests
|
||||
########################
|
||||
ai/goblin_artillery.txt
|
||||
ai/proliferate_simple.txt
|
||||
#I don’t understand why this test works, and it breaks the redo, so I deactivate it.
|
||||
#ai/proliferate_simple.txt
|
||||
|
||||
30
projects/mtg/bin/Res/test/buyback.txt
Normal file
30
projects/mtg/bin/Res/test/buyback.txt
Normal file
@@ -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]
|
||||
42
projects/mtg/bin/Res/test/executioners_swing.txt
Normal file
42
projects/mtg/bin/Res/test/executioners_swing.txt
Normal file
@@ -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]
|
||||
42
projects/mtg/bin/Res/test/executioners_swing2.txt
Normal file
42
projects/mtg/bin/Res/test/executioners_swing2.txt
Normal file
@@ -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]
|
||||
34
projects/mtg/bin/Res/test/executioners_swing3.txt
Normal file
34
projects/mtg/bin/Res/test/executioners_swing3.txt
Normal file
@@ -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]
|
||||
33
projects/mtg/bin/Res/test/formidable.txt
Normal file
33
projects/mtg/bin/Res/test/formidable.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
#Testing Atarka Beastbreaker,Stampeding Elk Herd -- Formidable
|
||||
#Atarka Beastbreaker will become 6/6, and then attacks along with Stampeding Elk Herd, trample effect will trigger
|
||||
#then p2 will block with Steel Wall, p2 must have 13 life...
|
||||
[INIT]
|
||||
COMBATATTACKERS
|
||||
[PLAYER1]
|
||||
inplay:Atarka Beastbreaker,Krosan Tusker,Stampeding Elk Herd
|
||||
manapool:{4}{G}
|
||||
[PLAYER2]
|
||||
inplay:Steel Wall
|
||||
life:20
|
||||
[DO]
|
||||
Atarka Beastbreaker
|
||||
choice 1
|
||||
Atarka Beastbreaker
|
||||
Stampeding Elk Herd
|
||||
next
|
||||
Steel Wall
|
||||
#blockers
|
||||
next
|
||||
#combatdamage 2
|
||||
next
|
||||
next
|
||||
#endofcombat 2
|
||||
[ASSERT]
|
||||
COMBATEND
|
||||
[PLAYER1]
|
||||
inplay:Atarka Beastbreaker,Krosan Tusker,Stampeding Elk Herd
|
||||
manapool:{0}
|
||||
[PLAYER2]
|
||||
graveyard:Steel Wall
|
||||
life:13
|
||||
[END]
|
||||
24
projects/mtg/bin/Res/test/griselbrand.txt
Normal file
24
projects/mtg/bin/Res/test/griselbrand.txt
Normal file
@@ -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]
|
||||
38
projects/mtg/bin/Res/test/guild_keyword.txt
Normal file
38
projects/mtg/bin/Res/test/guild_keyword.txt
Normal file
@@ -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]
|
||||
29
projects/mtg/bin/Res/test/tokenizer.txt
Normal file
29
projects/mtg/bin/Res/test/tokenizer.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
# Testing Tokenizer - Parallel Lives (ISD) 249662
|
||||
# Dragon Fodder (ALA) 174936
|
||||
# text=Put two 1/1 red Goblin creature tokens into play.
|
||||
# Tokens must be 2.. since there are no tokenizer.
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
hand:174936
|
||||
manapool:{R}{1}
|
||||
inplay:249662
|
||||
[PLAYER2]
|
||||
hand:Demystify
|
||||
manapool:{W}
|
||||
[DO]
|
||||
174936
|
||||
no
|
||||
yes
|
||||
Demystify
|
||||
249662
|
||||
endinterruption
|
||||
[ASSERT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
graveyard:249662,174936
|
||||
inplay:-174936,-174936
|
||||
[PLAYER2]
|
||||
graveyard:Demystify
|
||||
life:20
|
||||
[END]
|
||||
27
projects/mtg/bin/Res/test/tokenizer2.txt
Normal file
27
projects/mtg/bin/Res/test/tokenizer2.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
# Testing Tokenizer - Parallel Lives (ISD) 249662
|
||||
# Dragon Fodder (ALA) 174936
|
||||
# text=Put two 1/1 red Goblin creature tokens into play.
|
||||
# Tokens must be 8.. since there are two tokenizer... original value
|
||||
# is 2 with first tokenizer it will become 4, with the second tokenizer
|
||||
# the value will be 8...
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
hand:174936
|
||||
manapool:{R}{1}
|
||||
inplay:249662,249662
|
||||
[PLAYER2]
|
||||
inplay:plains
|
||||
hand:Demystify
|
||||
[DO]
|
||||
174936
|
||||
[ASSERT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
graveyard:174936
|
||||
inplay:249662,249662,-174936,-174936,-174936,-174936,-174936,-174936,-174936,-174936
|
||||
[PLAYER2]
|
||||
hand:Demystify
|
||||
inplay:plains
|
||||
life:20
|
||||
[END]
|
||||
73
projects/mtg/bin/createWindowsZip.py
Normal file
73
projects/mtg/bin/createWindowsZip.py
Normal file
@@ -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()
|
||||
@@ -3,7 +3,7 @@
|
||||
<property file="build.properties" />
|
||||
<property file="build.number.properties" />
|
||||
<property environment="env"/>
|
||||
|
||||
|
||||
<path id="groovy.class.path" >
|
||||
<fileset dir="${groovy.dir}" />
|
||||
</path>
|
||||
@@ -90,7 +90,9 @@ Author: Michael Nguyen
|
||||
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
||||
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
|
||||
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
|
||||
#define WAGIC_RESOURCE_NAME WAGIC_CORE_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
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ using std::vector;
|
||||
class ManaCost;
|
||||
class MTGAbility;
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIHint
|
||||
{
|
||||
public:
|
||||
@@ -66,4 +68,6 @@ public:
|
||||
~AIHints();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "AIPlayerBaka.h"
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIMomirPlayer: public AIPlayerBaka
|
||||
{
|
||||
public:
|
||||
@@ -14,4 +16,6 @@ public:
|
||||
MTGAbility * getMomirAbility();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,20 +18,44 @@
|
||||
#include "Player.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
using std::queue;
|
||||
using std::vector;
|
||||
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIStats;
|
||||
class AIPlayer;
|
||||
|
||||
|
||||
class Action
|
||||
{
|
||||
protected:
|
||||
GameObserver* m_pObserver;
|
||||
bool parseLine(const string& s);
|
||||
|
||||
public:
|
||||
Action(GameObserver* g, const string& s) : m_pObserver(g)
|
||||
{
|
||||
parseLine(s);
|
||||
};
|
||||
|
||||
friend ostream& operator<<(ostream&, const Action&);
|
||||
friend istream& operator>>(istream&, Action&);
|
||||
};
|
||||
|
||||
class AIAction
|
||||
{
|
||||
protected:
|
||||
int clickMultiAct(vector<Targetable*>&actionTargets);
|
||||
|
||||
public:
|
||||
AIPlayer * owner;
|
||||
MTGAbility * ability;
|
||||
NestedAbility * nability;
|
||||
Player * player;
|
||||
int id;
|
||||
// int id;
|
||||
MTGCardInstance * click;
|
||||
MTGCardInstance * target; // TODO Improve
|
||||
vector<Targetable*>mAbilityTargets;
|
||||
@@ -60,7 +84,10 @@ public:
|
||||
{
|
||||
};
|
||||
int Act();
|
||||
int clickMultiAct(vector<Targetable*>&actionTargets);
|
||||
ostream& logSimpleAct(ostream& out, MTGCardInstance* click) const;
|
||||
ostream& logMultiAct(ostream& out, const vector<Targetable *> &actionTargets) const;
|
||||
|
||||
friend ostream& operator<<(ostream& out, const AIAction& a);
|
||||
};
|
||||
|
||||
|
||||
@@ -77,8 +104,20 @@ protected:
|
||||
int clickMultiTarget(TargetChooser * tc,vector<Targetable*>&potentialTargets);
|
||||
int clickSingleTarget(TargetChooser * tc,vector<Targetable*>&potentialTargets, MTGCardInstance * Choosencard = NULL);
|
||||
RandomGenerator randomGenerator;
|
||||
virtual bool canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy);
|
||||
virtual bool canPlay(MTGCardInstance * card);
|
||||
virtual int getCreaturesInfo(Player * player, int neededInfo = INFO_NBCREATURES , int untapMode = 0, int canAttack = 0);
|
||||
|
||||
virtual int createAbilityPotentialsActions(MTGAbility * a, MTGCardInstance * c, vector<AIAction>& actions);
|
||||
|
||||
public:
|
||||
enum {
|
||||
INFO_NBCREATURES,
|
||||
INFO_CREATURESPOWER,
|
||||
INFO_CREATURESRANK,
|
||||
INFO_CREATURESTOUGHNESS,
|
||||
INFO_CREATURESATTACKINGPOWER
|
||||
};
|
||||
|
||||
//These variables are used by TestSuite and Rules.cpp... TODO change that?
|
||||
int agressivity;
|
||||
@@ -89,7 +128,7 @@ public:
|
||||
virtual int receiveEvent(WEvent * event);
|
||||
virtual void Render();
|
||||
|
||||
AIPlayer(GameObserver *observer, string deckFile, string deckFileSmall, MTGDeck * deck = NULL);
|
||||
AIPlayer(GameObserver *observer, string deckFile, string deckFileSmall, string avatarFile, MTGDeck * deck = NULL);
|
||||
virtual ~AIPlayer();
|
||||
|
||||
virtual int chooseTarget(TargetChooser * tc = NULL, Player * forceTarget = NULL, MTGCardInstance * Chosencard = NULL, bool checkonly = false) = 0;
|
||||
@@ -116,5 +155,6 @@ class AIPlayerFactory{
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "AIPlayer.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIStats;
|
||||
class AIHints;
|
||||
class AIHint;
|
||||
@@ -57,7 +59,7 @@ public:
|
||||
OrderedAIAction* a2Ptr = const_cast<OrderedAIAction*>(&a2);
|
||||
int e1 = a1Ptr->getEfficiency();
|
||||
int e2 = a2Ptr->getEfficiency();
|
||||
if (e1 == e2) return a1Ptr->id < a2Ptr->id;
|
||||
// if (e1 == e2) return a1Ptr->id < a2Ptr->id;
|
||||
return (e1 > e2);
|
||||
}
|
||||
};
|
||||
@@ -72,7 +74,7 @@ class AIPlayerBaka: public AIPlayer{
|
||||
virtual int interruptIfICan();
|
||||
virtual int chooseAttackers();
|
||||
virtual int chooseBlockers();
|
||||
virtual int canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy);
|
||||
virtual bool canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy);
|
||||
virtual int effectBadOrGood(MTGCardInstance * card, int mode = MODE_PUTINTOPLAY, TargetChooser * tc = NULL);
|
||||
|
||||
|
||||
@@ -105,19 +107,10 @@ class AIPlayerBaka: public AIPlayer{
|
||||
virtual int getEfficiency(OrderedAIAction * action);
|
||||
virtual int getEfficiency(MTGAbility * ability);
|
||||
virtual bool payTheManaCost(ManaCost * cost, MTGCardInstance * card = NULL,vector<MTGAbility*> gotPayment = vector<MTGAbility*>());
|
||||
virtual int getCreaturesInfo(Player * player, int neededInfo = INFO_NBCREATURES , int untapMode = 0, int canAttack = 0);
|
||||
virtual ManaCost * getPotentialMana(MTGCardInstance * card = NULL);
|
||||
virtual int selectAbility();
|
||||
|
||||
public:
|
||||
enum {
|
||||
INFO_NBCREATURES,
|
||||
INFO_CREATURESPOWER,
|
||||
INFO_CREATURESRANK,
|
||||
INFO_CREATURESTOUGHNESS,
|
||||
INFO_CREATURESATTACKINGPOWER
|
||||
};
|
||||
|
||||
vector<MTGAbility*>gotPayments;
|
||||
|
||||
AIPlayerBaka(GameObserver *observer, string deckFile, string deckfileSmall, string avatarFile, MTGDeck * deck = NULL);
|
||||
@@ -137,4 +130,5 @@ class AIPlayerBaka: public AIPlayer{
|
||||
virtual int createAbilityTargets(MTGAbility * a, MTGCardInstance * c, RankingContainer& ranking);
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,8 @@ class AIStats;
|
||||
class AIHints;
|
||||
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIPlayerBakaB: public AIPlayerBaka{
|
||||
protected:
|
||||
int orderBlockers();
|
||||
@@ -18,7 +20,7 @@ protected:
|
||||
int interruptIfICan();
|
||||
int chooseAttackers();
|
||||
int chooseBlockers();
|
||||
int canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy);
|
||||
bool canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy);
|
||||
int effectBadOrGood(MTGCardInstance * card, int mode = MODE_PUTINTOPLAY, TargetChooser * tc = NULL);
|
||||
|
||||
|
||||
@@ -61,6 +63,8 @@ protected:
|
||||
int createAbilityTargets(MTGAbility * a, MTGCardInstance * c, RankingContainer& ranking);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
34
projects/mtg/include/AIPlayerMinMax.h
Normal file
34
projects/mtg/include/AIPlayerMinMax.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Wagic, The Homebrew ?! is licensed under the BSD license
|
||||
* See LICENSE in the Folder's root
|
||||
* http://wololo.net/wagic/
|
||||
|
||||
AIPlayerMinMax is the MinMax implementation of the AIPlayer interface
|
||||
*/
|
||||
|
||||
#ifndef _IAPLAYER_MINMAX_H
|
||||
#define _IAPLAYER_MINMAX_H
|
||||
|
||||
#include "AIPlayer.h"
|
||||
#include "config.h"
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIPlayerMinMax: public AIPlayer{
|
||||
|
||||
protected:
|
||||
void LookAround();
|
||||
|
||||
public:
|
||||
AIPlayerMinMax(GameObserver *observer, string deckFile, string deckFileSmall, string avatarFile, MTGDeck * deck = NULL);
|
||||
virtual ~AIPlayerMinMax();
|
||||
|
||||
virtual int chooseTarget(TargetChooser * tc = NULL, Player * forceTarget = NULL, MTGCardInstance * Chosencard = NULL, bool checkonly = false) = 0;
|
||||
virtual int affectCombatDamages(CombatStep) = 0;
|
||||
virtual int Act(float dt) = 0;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,6 +18,8 @@ class MTGCard;
|
||||
class Damage;
|
||||
class WEvent;
|
||||
|
||||
namespace AI {
|
||||
|
||||
class AIStat
|
||||
{
|
||||
public:
|
||||
@@ -49,4 +51,6 @@ public:
|
||||
void Render();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -204,7 +204,6 @@ protected:
|
||||
JQuadPtr pspIcons[8];
|
||||
InterruptDecision interruptDecision[2];
|
||||
float timer;
|
||||
int currentState;
|
||||
ActionStackMode mode;
|
||||
int checked;
|
||||
ATutorialMessage* currentTutorial;
|
||||
@@ -224,7 +223,7 @@ public:
|
||||
int getNextIndex(Interruptible * previous, int type = 0, int state = 0 , int display = -1);
|
||||
void Fizzle(Interruptible * action, FizzleMode fizzleMode = PUT_IN_GRAVEARD);
|
||||
Interruptible * getAt(int id);
|
||||
void cancelInterruptOffer(InterruptDecision cancelMode = DONT_INTERRUPT, bool log = true);
|
||||
void cancelInterruptOffer(Player* p = 0, InterruptDecision cancelMode = DONT_INTERRUPT, bool log = true);
|
||||
void endOfInterruption(bool log = true);
|
||||
Interruptible * getLatest(int state);
|
||||
Player * askIfWishesToInterrupt;
|
||||
@@ -251,7 +250,9 @@ public:
|
||||
#endif
|
||||
void setCurrentTutorial(ATutorialMessage* message) {currentTutorial = message;};
|
||||
ATutorialMessage* getCurrentTutorial() {return currentTutorial;};
|
||||
bool isCalm() {return interruptDecision[0] == NOT_DECIDED && interruptDecision[1] == NOT_DECIDED;};
|
||||
bool isNotUndecided() {
|
||||
return (interruptDecision[0] == NOT_DECIDED && interruptDecision[1] == NOT_DECIDED);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,6 +172,206 @@ private:
|
||||
{
|
||||
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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 2);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 3);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 2);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 1);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 1);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 2);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 4);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 3);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 1);
|
||||
intValue += zone->countDevotion(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)&&dp == card->controller())
|
||||
{
|
||||
intValue += zone->countDevotion(dtc, 1);
|
||||
intValue += zone->countDevotion(dtc, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
SAFE_DELETE(dtc);
|
||||
}
|
||||
else if (s.find("type:") != string::npos)
|
||||
{
|
||||
size_t begins = s.find("type:");
|
||||
@@ -435,6 +635,17 @@ private:
|
||||
{
|
||||
intValue = target->controller()->opponent()->game->hand->nb_cards;
|
||||
}
|
||||
else if (s == "powertotalinplay")//Count Total Power of Creatures you control... Formidable
|
||||
{
|
||||
intValue = 0;
|
||||
for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j)
|
||||
{
|
||||
if (card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE))
|
||||
{
|
||||
intValue += card->controller()->game->inPlay->cards[j]->power;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
intValue = atoi(s.c_str());
|
||||
@@ -2929,7 +3140,7 @@ public:
|
||||
SAFE_DELETE(NewPow);
|
||||
SAFE_DELETE(NewTou);
|
||||
}
|
||||
for (int i = 0; i < multiplier->getValue(); ++i)
|
||||
for (int i = 0; i < Tokenizer(); ++i)
|
||||
{
|
||||
//MTGCardInstance * myToken;
|
||||
if (tokenId)
|
||||
@@ -2988,6 +3199,23 @@ public:
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Tokenizer()//tokenizer
|
||||
{
|
||||
int tokenize = 1;
|
||||
if (source->controller()->game->battlefield->hasAbility(Constants::TOKENIZER))
|
||||
{
|
||||
int nbcards = source->controller()->game->battlefield->nb_cards;
|
||||
for (int j = 0; j < nbcards; j++)
|
||||
{
|
||||
if (source->controller()->game->battlefield->cards[j]->has(Constants::TOKENIZER))
|
||||
tokenize *= 2;
|
||||
}
|
||||
return multiplier->getValue()*tokenize;
|
||||
}
|
||||
else
|
||||
return multiplier->getValue();
|
||||
}
|
||||
|
||||
void setTokenOwner()
|
||||
{
|
||||
switch(who)
|
||||
@@ -5329,6 +5557,17 @@ public:
|
||||
AAShuffle * clone() const;
|
||||
};
|
||||
|
||||
//Mulligan
|
||||
class AAMulligan: public ActivatedAbilityTP
|
||||
{
|
||||
public:
|
||||
AAMulligan(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
|
||||
TargetChooser::UNSET);
|
||||
int resolve();
|
||||
const string getMenuText();
|
||||
AAMulligan * clone() const;
|
||||
};
|
||||
|
||||
//Remove Mana From ManaPool
|
||||
class AARemoveMana: public ActivatedAbilityTP
|
||||
{
|
||||
|
||||
@@ -64,6 +64,7 @@ class CardDescriptor: public MTGCardInstance
|
||||
string compareName;
|
||||
int CDopponentDamaged;
|
||||
int CDcontrollerDamaged;
|
||||
int CDdamager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,7 @@ private:
|
||||
static const float x_center;
|
||||
static const float right_border;
|
||||
static const float slide_animation_duration;
|
||||
static const float scroll_animation_duration;
|
||||
|
||||
public:
|
||||
CarouselDeckView();
|
||||
@@ -18,19 +19,21 @@ public:
|
||||
void Reset();
|
||||
|
||||
void UpdateViewState(float dt);
|
||||
void UpdateCardPosition(CardRep &rep, int index);
|
||||
void UpdateCardPosition(int index);
|
||||
void renderCard(int index)
|
||||
{
|
||||
int alpha = (int) (255 * (getCardRep(index).scale + 1.0 - max_scale));
|
||||
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 changePosition(int offset);
|
||||
void changeFilter(int offset);
|
||||
void changePositionAnimated(int offset);
|
||||
void changeFilterAnimated(int offset);
|
||||
|
||||
MTGCard *getActiveCard();
|
||||
private:
|
||||
|
||||
@@ -9,55 +9,233 @@
|
||||
#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;
|
||||
|
||||
public:
|
||||
/*! \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();
|
||||
|
||||
//advances the view and card representations
|
||||
/*! \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);
|
||||
virtual void SetDeck(DeckDataWrapper *toShow);
|
||||
|
||||
/*! \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();
|
||||
void SwitchFilter(int delta);
|
||||
void SwitchPosition(int delta);
|
||||
|
||||
/*! \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;
|
||||
bool ButtonPressed(Buttons button);
|
||||
|
||||
/*! \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;
|
||||
virtual void changePosition(int offset) = 0;
|
||||
virtual void changeFilter(int offset) = 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;
|
||||
|
||||
CardRep& getCardRep(unsigned int index);
|
||||
/*! \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;
|
||||
virtual void UpdateCardPosition(CardRep& rep, int index) = 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_
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
*/
|
||||
void update(float dt)
|
||||
{
|
||||
if(duration > 0)
|
||||
if(time_acc < duration)
|
||||
{
|
||||
time_acc += dt;
|
||||
|
||||
@@ -167,6 +167,50 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*! \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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
//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
|
||||
class LifeorManaCost : public ExtraCost
|
||||
{
|
||||
|
||||
@@ -52,7 +52,6 @@ class GameObserver{
|
||||
string startupGameSerialized;
|
||||
bool parseLine(const string& s);
|
||||
virtual void logAction(const string& s);
|
||||
bool processAction(const string& s);
|
||||
bool processActions(bool undo
|
||||
#ifdef TESTSUITE
|
||||
, TestSuiteGame* testgame
|
||||
@@ -69,6 +68,7 @@ class GameObserver{
|
||||
);
|
||||
|
||||
public:
|
||||
bool processAction(const string& s);
|
||||
int currentPlayerId;
|
||||
CombatStep combatStep;
|
||||
int turn;
|
||||
@@ -78,7 +78,7 @@ class GameObserver{
|
||||
vector<list<Phase*> >gameTurn;
|
||||
int cancelCurrentAction();
|
||||
ExtraCosts * mExtraPayment;
|
||||
int oldGamePhase;
|
||||
GamePhase oldGamePhase;
|
||||
TargetChooser * targetChooser;
|
||||
DuelLayers * mLayers;
|
||||
ReplacementEffects *replacementEffects;
|
||||
@@ -111,6 +111,7 @@ class GameObserver{
|
||||
void loadPlayer(int playerId, PlayerType playerType = PLAYER_TYPE_HUMAN, int decknb=0, bool premadeDeck=false);
|
||||
virtual void loadPlayer(int playerId, Player* player);
|
||||
|
||||
int getPlayerId(Player* player) {if(player == players[0]) return 1; else if(player == players[1]) return 2; else return 0;};
|
||||
Player * currentPlayer;
|
||||
Player * currentActionPlayer;
|
||||
Player * isInterrupting;
|
||||
@@ -138,6 +139,7 @@ class GameObserver{
|
||||
int receiveEvent(WEvent * event);
|
||||
bool connectRule;
|
||||
|
||||
void logActionMomir(MTGCardInstance * card_to_discard, int cardId);
|
||||
void logAction(Player* player, const string& s="");
|
||||
void logAction(int playerId, const string& s="") {
|
||||
logAction(players[playerId], s);
|
||||
@@ -151,6 +153,7 @@ class GameObserver{
|
||||
bool undo();
|
||||
bool isLoading(){ return mLoading; };
|
||||
void Mulligan(Player* player = NULL);
|
||||
void serumMulligan(Player* player = NULL);
|
||||
Player* getPlayer(size_t index) { return players[index];};
|
||||
bool isStarted() { return (mLayers!=NULL);};
|
||||
RandomGenerator* getRandomGenerator() { return &randomGenerator; };
|
||||
|
||||
@@ -17,7 +17,6 @@ private:
|
||||
WSrcCards * setSrc;
|
||||
SimpleMenu * menu;
|
||||
bool showMenu;
|
||||
bool showAlt;
|
||||
bool saveMe;
|
||||
int mState;
|
||||
int mDetailItem;
|
||||
|
||||
@@ -65,7 +65,6 @@ private:
|
||||
JQuadPtr pspIcons[8];
|
||||
WSrcCards * srcCards;
|
||||
TaskList * taskList;
|
||||
float mElapsed;
|
||||
WGuiMenu * shopMenu;
|
||||
WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom.
|
||||
WGuiCardImage * bigDisplay;
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
#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:
|
||||
@@ -12,27 +21,134 @@ private:
|
||||
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);
|
||||
void UpdateCardPosition(CardRep &rep, int index);
|
||||
|
||||
/*! \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);
|
||||
|
||||
void changePosition(int offset);
|
||||
void changeFilter(int offset);
|
||||
/*! \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:
|
||||
int mCols;
|
||||
int mRows;
|
||||
float mScrollOffset, mSlideOffset;
|
||||
/*! \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
|
||||
|
||||
@@ -4,15 +4,25 @@
|
||||
#include "GuiLayers.h"
|
||||
#include "PhaseRing.h"
|
||||
#include "WEvent.h"
|
||||
#include "PlayGuiObject.h"
|
||||
|
||||
#include "Easing.h"
|
||||
|
||||
class GuiPhaseBar: public GuiLayer, public PlayGuiObject
|
||||
{
|
||||
protected:
|
||||
Phase* phase;
|
||||
private:
|
||||
static const float zoom_big;
|
||||
static const float zoom_small;
|
||||
static const float step;
|
||||
|
||||
int displayedPhaseId;
|
||||
float angle;
|
||||
float zoomFactor;
|
||||
DuelLayers* mpDuelLayers;
|
||||
OutQuadEasing angleEasing;
|
||||
InOutQuadEasing zoomFactorEasing;
|
||||
DuelLayers* mpDuelLayers;
|
||||
|
||||
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale);
|
||||
public:
|
||||
GuiPhaseBar(DuelLayers* duelLayers);
|
||||
~GuiPhaseBar();
|
||||
|
||||
@@ -47,7 +47,6 @@ protected:
|
||||
{
|
||||
static const float HEIGHT;
|
||||
unsigned attackers;
|
||||
unsigned blockers;
|
||||
unsigned currentAttacker;
|
||||
float height;
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
bool wasDealtDamage;
|
||||
bool damageToOpponent;
|
||||
bool damageToController;
|
||||
bool damageToCreature;
|
||||
bool mPropertiesChangedSinceLastUpdate;
|
||||
int reduxamount;
|
||||
int flanked;
|
||||
|
||||
@@ -219,7 +219,8 @@ class Constants
|
||||
LURE = 101,
|
||||
NOLEGEND = 102,
|
||||
CANPLAYFROMGRAVEYARD = 103,
|
||||
NB_BASIC_ABILITIES = 104,
|
||||
TOKENIZER = 104,
|
||||
NB_BASIC_ABILITIES = 105,
|
||||
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
|
||||
@@ -98,6 +98,7 @@ class MTGGameZone {
|
||||
unsigned int countByType(const string &value);
|
||||
unsigned int countByCanTarget(TargetChooser * tc);
|
||||
unsigned int countTotalManaSymbols(TargetChooser * tc, int color);
|
||||
unsigned int countDevotion(TargetChooser * tc, int color); //devotion for gods
|
||||
MTGCardInstance * findByName(string name);
|
||||
|
||||
//returns true if one of the cards in the zone has the ability
|
||||
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
string toString();
|
||||
int getCost(int color);
|
||||
int getManaSymbols(int color);
|
||||
int getManaSymbolsHybridMerged(int color);
|
||||
|
||||
//Returns NULL if i is greater than nbhybrids
|
||||
ManaCostHybrid * getHybridCost(unsigned int i);
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
string toString();
|
||||
int getConvertedCost();
|
||||
int getManaSymbols(int color);
|
||||
int getManaSymbolsHybridMerged(int color);
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& out, ManaCostHybrid& m);
|
||||
friend std::ostream& operator<<(std::ostream& out, ManaCostHybrid* m);
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define GUI_OPPONENTHAND 5
|
||||
|
||||
#include <JGui.h>
|
||||
#include "Effects.h"
|
||||
#include "WEvent.h"
|
||||
#include "Pos.h"
|
||||
|
||||
@@ -65,7 +64,6 @@ public:
|
||||
}
|
||||
;
|
||||
virtual ~PlayGuiObject() {};
|
||||
vector<Effect*> effects;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
MTGInPlay * inPlay();
|
||||
ManaPool * getManaPool();
|
||||
void takeMulligan();
|
||||
void serumMulligan();
|
||||
ManaCost * doesntEmpty;
|
||||
ManaCost * poolDoesntEmpty;
|
||||
void cleanupPhase();
|
||||
@@ -105,7 +106,7 @@ public:
|
||||
std::string GetCurrentDeckStatsFile();
|
||||
virtual bool parseLine(const string& s);
|
||||
friend ostream& operator<<(ostream&, const Player&);
|
||||
friend istream& operator>>(istream&, Player&);
|
||||
friend istream& operator>>(istream&, Player&);
|
||||
bool operator<(Player& aPlayer);
|
||||
bool isDead();
|
||||
};
|
||||
|
||||
@@ -20,7 +20,6 @@ class SimplePopup: public JGuiController
|
||||
private:
|
||||
float mWidth, mX, mY;
|
||||
int mMaxLines;
|
||||
int mFontId;
|
||||
DeckMetaData * mDeckInformation;
|
||||
string mTitle;
|
||||
WFont *mTextFont;
|
||||
|
||||
@@ -2,8 +2,15 @@
|
||||
#define TASK_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "Easing.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class GameObserver;
|
||||
class JQuad;
|
||||
class JTexture;
|
||||
|
||||
// Task type constant
|
||||
|
||||
@@ -72,8 +79,11 @@ class TaskList
|
||||
{
|
||||
protected:
|
||||
string fileName;
|
||||
|
||||
float vPos;
|
||||
float mElapsed;
|
||||
OutQuadEasing vPosInEasing;
|
||||
InQuadEasing vPosOutEasing;
|
||||
|
||||
int mState;
|
||||
JQuad * mBg[9];
|
||||
JTexture * mBgTex;
|
||||
@@ -97,7 +107,6 @@ public:
|
||||
{
|
||||
return mState;
|
||||
}
|
||||
;
|
||||
void addTask(string params, bool rand = false);
|
||||
void addTask(Task *task);
|
||||
void addRandomTask(int diff = 100);
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
int run();
|
||||
};
|
||||
|
||||
class TestSuiteAI:public AIPlayerBaka
|
||||
class TestSuiteAI:public AI::AIPlayerBaka
|
||||
{
|
||||
private:
|
||||
MTGCardInstance * getCard(string action);
|
||||
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
WCFilterSet(string arg);
|
||||
bool isMatch(MTGCard *c)
|
||||
{
|
||||
return (setid == MTGSets::ALL_SETS || c->setId == setid);
|
||||
return (setid == MTGSets::ALL_SETS || c->setId == setid) && (c->getRarity() != Constants::RARITY_T); //removes viewing of card tokens. tokens will not display on spoiler and should not affect gameplay :)
|
||||
}
|
||||
;
|
||||
string getCode();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef WRESOURCE_FWD_H
|
||||
#define WRESOURCE_FWD_H
|
||||
|
||||
#ifndef WP8
|
||||
#include <boost/shared_ptr.hpp>
|
||||
typedef boost::shared_ptr<JQuad> JQuadPtr;
|
||||
#else
|
||||
#if (__cplusplus > 199711L)
|
||||
#include <memory>
|
||||
typedef std::shared_ptr<JQuad> JQuadPtr;
|
||||
#else
|
||||
#include <boost/shared_ptr.hpp>
|
||||
typedef boost::shared_ptr<JQuad> JQuadPtr;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _DEBUG_H_
|
||||
#define _DEBUG_H_
|
||||
|
||||
#if ((defined WIN32) || (defined WP8))
|
||||
#if ((defined WIN32) || (defined WP8)) && !defined(__MINGW32__)
|
||||
#define snprintf sprintf_s
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace AI {
|
||||
|
||||
AIHint::AIHint(string _line)
|
||||
{
|
||||
string line = _line;
|
||||
@@ -314,7 +316,7 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB
|
||||
int comboPartsRestriction = 0;
|
||||
|
||||
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())
|
||||
{
|
||||
for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++)
|
||||
@@ -582,3 +584,5 @@ AIAction * AIHints::suggestAbility(ManaCost * potentialMana)
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "AIStats.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
namespace AI {
|
||||
|
||||
AIMomirPlayer::AIMomirPlayer(GameObserver *observer, string file, string fileSmall, string avatarFile, MTGDeck * deck) :
|
||||
AIPlayerBaka(observer, file, fileSmall, avatarFile, deck)
|
||||
{
|
||||
@@ -128,3 +130,4 @@ int AIMomirPlayer::computeActions()
|
||||
return AIPlayerBaka::computeActions();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -13,11 +13,36 @@
|
||||
#include "AIPlayerBakaB.h"
|
||||
#endif
|
||||
|
||||
namespace AI {
|
||||
|
||||
|
||||
bool Action::parseLine(const string& s)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, const Action&)
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
istream& operator>>(istream& in, Action& a)
|
||||
{
|
||||
string s;
|
||||
|
||||
while(std::getline(in, s))
|
||||
{
|
||||
if(!a.parseLine(s))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
int AIPlayer::totalAIDecks = -1;
|
||||
|
||||
const char * const MTG_LAND_TEXTS[] = { "artifact", "forest", "island", "mountain", "swamp", "plains", "other lands" };
|
||||
|
||||
AIAction::AIAction(AIPlayer * owner, MTGCardInstance * c, MTGCardInstance * t)
|
||||
: owner(owner), ability(NULL), player(NULL), click(c), target(t)
|
||||
{
|
||||
@@ -42,6 +67,51 @@ AIAction::AIAction(AIPlayer * owner, MTGCardInstance * c, MTGCardInstance * t)
|
||||
}
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& out, const AIAction& a)
|
||||
{
|
||||
do {
|
||||
if (a.player && !a.playerAbilityTarget)
|
||||
{
|
||||
out << "p" + (a.owner->getObserver()->getPlayerId(a.player) + 1) << endl;
|
||||
break;
|
||||
}
|
||||
if (a.ability)
|
||||
{
|
||||
a.logSimpleAct(out, a.click);
|
||||
// we're ignoring ability and we shouldn't
|
||||
if (a.target && !a.mAbilityTargets.size())
|
||||
{
|
||||
a.logSimpleAct(out, a.target);
|
||||
// sounds broken if target is a player ... or not, it's the following case
|
||||
break;
|
||||
}
|
||||
else if(a.playerAbilityTarget && !a.mAbilityTargets.size())
|
||||
{
|
||||
out << "p" + (a.owner->getObserver()->getPlayerId((Player*)a.playerAbilityTarget) + 1) << endl;
|
||||
// with this log we're losing what player clicked on who ... which is bad.
|
||||
break;
|
||||
}
|
||||
if(a.mAbilityTargets.size())
|
||||
{
|
||||
a.logMultiAct(out, a.mAbilityTargets);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(a.mAbilityTargets.size())
|
||||
{
|
||||
a.logMultiAct(out, a.mAbilityTargets);
|
||||
break;
|
||||
}
|
||||
else if (a.click)
|
||||
{ //Shouldn't be used, really...
|
||||
assert(0);
|
||||
}
|
||||
|
||||
} while(0);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
int AIAction::Act()
|
||||
{
|
||||
GameObserver * g = owner->getObserver();
|
||||
@@ -82,6 +152,46 @@ int AIAction::Act()
|
||||
return 0;
|
||||
}
|
||||
|
||||
ostream& AIAction::logSimpleAct(ostream& out, MTGCardInstance* click) const
|
||||
{
|
||||
string currentPlayer = "p" + (owner->getObserver()->getPlayerId(owner) + 1);
|
||||
out << currentPlayer << click->currentZone->getName() << "[" << click->currentZone->getIndex(click) << "]" << endl;
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream& AIAction::logMultiAct(ostream& out, const vector<Targetable*>& actionTargets) const
|
||||
{
|
||||
GameObserver * g = owner->getObserver();
|
||||
TargetChooser * tc = g->getCurrentTargetChooser();
|
||||
do {
|
||||
if(!tc) break;
|
||||
vector<Targetable*>::const_iterator ite = actionTargets.begin();
|
||||
while(ite != actionTargets.end())
|
||||
{
|
||||
MTGCardInstance * card = ((MTGCardInstance *) (*ite));
|
||||
if(card == (MTGCardInstance*)tc->source)//click source first.
|
||||
{
|
||||
logSimpleAct(out, card);
|
||||
continue;
|
||||
}
|
||||
++ite;
|
||||
}
|
||||
|
||||
// this is just wrong, but at least it should compile
|
||||
for(int k = 0 ;k < int(actionTargets.size()) && k < tc->maxtargets; k++)
|
||||
{
|
||||
if (MTGCardInstance * card = dynamic_cast<MTGCardInstance *>(actionTargets[k]))
|
||||
{
|
||||
if(k+1 == int(actionTargets.size()))
|
||||
tc->done = true;
|
||||
logSimpleAct(out, card);
|
||||
}
|
||||
}
|
||||
tc->attemptsToFill++;
|
||||
} while (0);
|
||||
return out;
|
||||
}
|
||||
|
||||
int AIAction::clickMultiAct(vector<Targetable*>& actionTargets)
|
||||
{
|
||||
GameObserver * g = owner->getObserver();
|
||||
@@ -116,7 +226,7 @@ int AIAction::clickMultiAct(vector<Targetable*>& actionTargets)
|
||||
return 1;
|
||||
}
|
||||
|
||||
AIPlayer::AIPlayer(GameObserver *observer, string file, string fileSmall, MTGDeck * deck) :
|
||||
AIPlayer::AIPlayer(GameObserver *observer, string file, string fileSmall, string avatarFile, MTGDeck * deck) :
|
||||
Player(observer, file, fileSmall, deck)
|
||||
{
|
||||
agressivity = 50;
|
||||
@@ -124,6 +234,33 @@ AIPlayer::AIPlayer(GameObserver *observer, string file, string fileSmall, MTGDec
|
||||
playMode = Player::MODE_AI;
|
||||
mFastTimerMode = false;
|
||||
|
||||
if(avatarFile != "")
|
||||
{
|
||||
if(!loadAvatar(avatarFile, "bakaAvatar"))
|
||||
{
|
||||
avatarFile = "baka.jpg";
|
||||
loadAvatar(avatarFile, "bakaAvatar");
|
||||
}
|
||||
mAvatarName = avatarFile;
|
||||
}
|
||||
else //load a random avatar.
|
||||
{
|
||||
avatarFile = "avatar";
|
||||
char buffer[3];
|
||||
sprintf(buffer, "%i", int(observer->getRandomGenerator()->random()%100));
|
||||
avatarFile.append(buffer);
|
||||
avatarFile.append(".jpg");
|
||||
if(!loadAvatar(avatarFile, "bakaAvatar"))
|
||||
{
|
||||
avatarFile = "baka.jpg";
|
||||
loadAvatar(avatarFile, "bakaAvatar");
|
||||
}
|
||||
mAvatarName = avatarFile;
|
||||
}
|
||||
|
||||
if (fileSmall == "ai_baka_eviltwin")
|
||||
mAvatar->SetHFlip(true);
|
||||
|
||||
}
|
||||
|
||||
AIPlayer::~AIPlayer()
|
||||
@@ -372,3 +509,151 @@ void AIPlayer::invalidateTotalAIDecks()
|
||||
totalAIDecks = -1;
|
||||
}
|
||||
|
||||
bool AIPlayer::canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy)
|
||||
{
|
||||
if (ennemy->has(Constants::FIRSTSTRIKE) || ennemy->has(Constants::DOUBLESTRIKE))
|
||||
return false;
|
||||
if (!(card->has(Constants::FIRSTSTRIKE) || card->has(Constants::DOUBLESTRIKE)))
|
||||
return false;
|
||||
if (!(card->power >= ennemy->toughness))
|
||||
return false;
|
||||
if (!(card->power >= ennemy->toughness + 1) && ennemy->has(Constants::FLANKING))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AIPlayer::canPlay(MTGCardInstance * card)
|
||||
{
|
||||
if (card->hasType(Subtypes::TYPE_LAND))
|
||||
{
|
||||
if (game->playRestrictions->canPutIntoZone(card, game->inPlay) == PlayRestriction::CANT_PLAY)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (game->playRestrictions->canPutIntoZone(card, game->stack) == PlayRestriction::CANT_PLAY)
|
||||
return false;
|
||||
}
|
||||
if (!manaPool->canAfford(card->getManaCost()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int AIPlayer::getCreaturesInfo(Player * player, int neededInfo, int untapMode, int canAttack)
|
||||
{
|
||||
int result = 0;
|
||||
CardDescriptor cd;
|
||||
cd.init();
|
||||
cd.setType("Creature");
|
||||
cd.unsecureSetTapped(untapMode);
|
||||
MTGCardInstance * card = NULL;
|
||||
while ((card = cd.nextmatch(player->game->inPlay, card)))
|
||||
{
|
||||
if (!canAttack || card->canAttack())
|
||||
{
|
||||
if (neededInfo == INFO_NBCREATURES)
|
||||
{
|
||||
result++;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += card->power;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int AIPlayer::createAbilityPotentialsActions(MTGAbility * a, MTGCardInstance * c, vector<AIAction>& actions)
|
||||
{
|
||||
if (!a->getActionTc())
|
||||
{
|
||||
AIAction aiAction(this, a, c, NULL);
|
||||
actions.push_back(aiAction);
|
||||
return 1;
|
||||
}
|
||||
|
||||
vector<Targetable*>potentialTargets;
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Player * p = observer->players[i];
|
||||
MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay,p->game->stack };
|
||||
// try player first
|
||||
if(a->getActionTc()->canTarget((Targetable*)p))
|
||||
{
|
||||
if(a->getActionTc()->maxtargets == 1)
|
||||
{
|
||||
AIAction aiAction(this, a, p, c);
|
||||
actions.push_back(aiAction);
|
||||
}
|
||||
else
|
||||
potentialTargets.push_back(p);
|
||||
}
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
MTGGameZone * zone = playerZones[j];
|
||||
for (int k = 0; k < zone->nb_cards; k++)
|
||||
{
|
||||
MTGCardInstance * t = zone->cards[k];
|
||||
if (a->getActionTc()->canTarget(t))
|
||||
{
|
||||
if(a->getActionTc()->maxtargets == 1)
|
||||
{
|
||||
AIAction aiAction(this, a, c, t);
|
||||
actions.push_back(aiAction);
|
||||
}
|
||||
else
|
||||
{
|
||||
potentialTargets.push_back(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
vector<Targetable*>realTargets;
|
||||
if(a->getActionTc()->maxtargets != 1)
|
||||
{
|
||||
if(a->getActionTc()->getNbTargets() && a->getActionTc()->attemptsToFill > 4)
|
||||
{
|
||||
a->getActionTc()->done = true;
|
||||
return 0;
|
||||
}
|
||||
while(potentialTargets.size())
|
||||
{
|
||||
AIAction * check = NULL;
|
||||
|
||||
Player * pTargeting = 0;
|
||||
MTGCardInstance * cTargeting = dynamic_cast<MTGCardInstance*>(potentialTargets[0]);
|
||||
if(cTargeting)
|
||||
{
|
||||
check = NEW AIAction(this, a,c,cTargeting);
|
||||
}
|
||||
else
|
||||
{
|
||||
pTargeting = dynamic_cast<Player*>(potentialTargets[0]);
|
||||
if(pTargeting)
|
||||
check = NEW AIAction(this, a,pTargeting,c);
|
||||
}
|
||||
|
||||
if(check && pTargeting)
|
||||
{
|
||||
AIAction aiAction(this, a,pTargeting,c);
|
||||
actions.push_back(aiAction);
|
||||
}
|
||||
if(check)
|
||||
realTargets.push_back(potentialTargets[0]);
|
||||
potentialTargets.erase(potentialTargets.begin());
|
||||
SAFE_DELETE(check);
|
||||
}
|
||||
if(!realTargets.size() || (int(realTargets.size()) < a->getActionTc()->maxtargets && a->getActionTc()->targetMin))
|
||||
return 0;
|
||||
AIAction aiAction(this, a, c,realTargets);
|
||||
aiAction.target = dynamic_cast<MTGCardInstance*>(realTargets[0]);
|
||||
aiAction.playerAbilityTarget = dynamic_cast<Player*>(realTargets[0]);
|
||||
actions.push_back(aiAction);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// AIAction
|
||||
//
|
||||
|
||||
namespace AI {
|
||||
|
||||
Player * OrderedAIAction::getPlayerTarget()
|
||||
{
|
||||
@@ -445,7 +446,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 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;
|
||||
}
|
||||
break;
|
||||
@@ -853,7 +854,7 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
|
||||
if (card == target)
|
||||
used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76
|
||||
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);
|
||||
used[card] = true;
|
||||
}
|
||||
@@ -2192,36 +2193,6 @@ int AIPlayerBaka::computeActions()
|
||||
return 1;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Combat //
|
||||
//
|
||||
|
||||
int AIPlayerBaka::getCreaturesInfo(Player * player, int neededInfo, int untapMode, int canAttack)
|
||||
{
|
||||
int result = 0;
|
||||
CardDescriptor cd;
|
||||
cd.init();
|
||||
cd.setType("Creature");
|
||||
cd.unsecureSetTapped(untapMode);
|
||||
MTGCardInstance * card = NULL;
|
||||
while ((card = cd.nextmatch(player->game->inPlay, card)))
|
||||
{
|
||||
if (!canAttack || card->canAttack())
|
||||
{
|
||||
if (neededInfo == INFO_NBCREATURES)
|
||||
{
|
||||
result++;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += card->power;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int AIPlayerBaka::chooseAttackers()
|
||||
{
|
||||
//Attack with all creatures
|
||||
@@ -2268,19 +2239,12 @@ int AIPlayerBaka::chooseAttackers()
|
||||
}
|
||||
|
||||
/* Can I first strike my oponent and get away with murder ? */
|
||||
int AIPlayerBaka::canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy)
|
||||
bool AIPlayerBaka::canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy)
|
||||
{
|
||||
if(hints && hints->HintSaysAlwaysBlock(observer,ennemy))
|
||||
return 1;
|
||||
if (ennemy->has(Constants::FIRSTSTRIKE) || ennemy->has(Constants::DOUBLESTRIKE))
|
||||
return 0;
|
||||
if (!(card->has(Constants::FIRSTSTRIKE) || card->has(Constants::DOUBLESTRIKE)))
|
||||
return 0;
|
||||
if (!(card->power >= ennemy->toughness))
|
||||
return 0;
|
||||
if (!(card->power >= ennemy->toughness + 1) && ennemy->has(Constants::FLANKING))
|
||||
return 0;
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
return AIPlayer::canFirstStrikeKill(card, ennemy);
|
||||
}
|
||||
|
||||
int AIPlayerBaka::chooseBlockers()
|
||||
@@ -2464,7 +2428,7 @@ int AIPlayerBaka::receiveEvent(WEvent * event)
|
||||
|
||||
|
||||
AIPlayerBaka::AIPlayerBaka(GameObserver *observer, string file, string fileSmall, string avatarFile, MTGDeck * deck) :
|
||||
AIPlayer(observer, file, fileSmall, deck)
|
||||
AIPlayer(observer, file, fileSmall, avatarFile, deck)
|
||||
{
|
||||
|
||||
nextCardToPlay = NULL;
|
||||
@@ -2479,34 +2443,6 @@ AIPlayerBaka::AIPlayerBaka(GameObserver *observer, string file, string fileSmall
|
||||
for (size_t i = 0; i < mDeck->meta_AIHints.size(); ++i)
|
||||
hints->add(mDeck->meta_AIHints[i]);
|
||||
}
|
||||
|
||||
|
||||
if(avatarFile != "")
|
||||
{
|
||||
if(!loadAvatar(avatarFile, "bakaAvatar"))
|
||||
{
|
||||
avatarFile = "baka.jpg";
|
||||
loadAvatar(avatarFile, "bakaAvatar");
|
||||
}
|
||||
mAvatarName = avatarFile;
|
||||
}
|
||||
else //load a random avatar.
|
||||
{
|
||||
avatarFile = "avatar";
|
||||
char buffer[3];
|
||||
sprintf(buffer, "%i", int(observer->getRandomGenerator()->random()%100));
|
||||
avatarFile.append(buffer);
|
||||
avatarFile.append(".jpg");
|
||||
if(!loadAvatar(avatarFile, "bakaAvatar"))
|
||||
{
|
||||
avatarFile = "baka.jpg";
|
||||
loadAvatar(avatarFile, "bakaAvatar");
|
||||
}
|
||||
mAvatarName = avatarFile;
|
||||
}
|
||||
|
||||
if (fileSmall == "ai_baka_eviltwin")
|
||||
mAvatar->SetHFlip(true);
|
||||
|
||||
initTimer();
|
||||
}
|
||||
@@ -2598,3 +2534,5 @@ AIPlayerBaka::~AIPlayerBaka() {
|
||||
}
|
||||
SAFE_DELETE(hints);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// Abilities/Target Selection
|
||||
//
|
||||
|
||||
namespace AI {
|
||||
|
||||
MTGCardInstance * AIPlayerBakaB::chooseCard(TargetChooser * tc, MTGCardInstance * source, int random)
|
||||
{
|
||||
@@ -117,7 +118,7 @@ int AIPlayerBakaB::chooseAttackers()
|
||||
}
|
||||
|
||||
/* Can I first strike my oponent and get away with murder ? */
|
||||
int AIPlayerBakaB::canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy)
|
||||
bool AIPlayerBakaB::canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy)
|
||||
{
|
||||
return AIPlayerBaka::canFirstStrikeKill(card, ennemy);
|
||||
}
|
||||
@@ -180,7 +181,7 @@ AIPlayerBakaB::~AIPlayerBakaB() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
78
projects/mtg/src/AIPlayerMinMax.cpp
Normal file
78
projects/mtg/src/AIPlayerMinMax.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
#include "AIPlayerMinMax.h"
|
||||
#include "CardDescriptor.h"
|
||||
#include "AIStats.h"
|
||||
#include "AllAbilities.h"
|
||||
#include "ExtraCost.h"
|
||||
#include "GuiCombat.h"
|
||||
#include "AIHints.h"
|
||||
#include "ManaCostHybrid.h"
|
||||
#include "MTGRules.h"
|
||||
|
||||
namespace AI {
|
||||
|
||||
//
|
||||
// Abilities/Target Selection
|
||||
//
|
||||
|
||||
AIPlayerMinMax::AIPlayerMinMax(GameObserver *observer, string deckFile, string deckFileSmall, string avatarFile, MTGDeck * deck) :
|
||||
AIPlayer(observer, deckFile, deckFileSmall, avatarFile, deck)
|
||||
{
|
||||
}
|
||||
|
||||
int AIPlayerMinMax::Act(float dt)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
|
||||
AIPlayerMinMax::~AIPlayerMinMax()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void AIPlayerMinMax::LookAround()
|
||||
{
|
||||
vector<MTGCardInstance*>::iterator ite;
|
||||
vector<AIAction> potentialActions;
|
||||
|
||||
// look for something useable (including mana)
|
||||
for (size_t i = 1; i < observer->mLayers->actionLayer()->mObjects.size(); i++)
|
||||
{
|
||||
MTGAbility * a = ((MTGAbility *) observer->mLayers->actionLayer()->mObjects[i]);
|
||||
//Make sure we can use the ability
|
||||
for (int j = 0; j < game->inPlay->nb_cards; j++)
|
||||
{
|
||||
MTGCardInstance * card = game->inPlay->cards[j];
|
||||
if (a->isReactingToClick(card, 0))
|
||||
{
|
||||
createAbilityPotentialsActions(a, card, potentialActions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// look for something playable
|
||||
for(ite = game->hand->cards.begin(); ite != game->hand->cards.end(); ite++)
|
||||
{
|
||||
if(canPlay(*ite))
|
||||
{
|
||||
AIAction a(this, (*ite));
|
||||
potentialActions.push_back(a);
|
||||
}
|
||||
}
|
||||
|
||||
stringstream stream;
|
||||
stream << *observer;
|
||||
vector<AIAction>::const_iterator it;
|
||||
for(it = potentialActions.begin(); it != potentialActions.end(); it++)
|
||||
{
|
||||
stringstream theCommand;
|
||||
theCommand << (*it);
|
||||
|
||||
GameObserver g;
|
||||
g.load(stream.str());
|
||||
g.processAction(theCommand.str());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "MTGCardInstance.h"
|
||||
#include "WEvent.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
namespace AI {
|
||||
|
||||
//TODO:better comments this is too cryptic to work on by anyone but original coder.
|
||||
bool compare_aistats(AIStat * first, AIStat * second)
|
||||
{
|
||||
@@ -217,3 +220,5 @@ void AIStats::Render()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ int ActionStack::setIsInterrupting(Player * player, bool log)
|
||||
|
||||
if (!gModRules.game.canInterrupt())
|
||||
{
|
||||
cancelInterruptOffer(DONT_INTERRUPT, log);
|
||||
cancelInterruptOffer(0, DONT_INTERRUPT, log);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -622,9 +622,18 @@ int ActionStack::setIsInterrupting(Player * player, bool log)
|
||||
|
||||
int playerId = (player == observer->players[1]) ? 1 : 0;
|
||||
interruptDecision[playerId] = INTERRUPT;
|
||||
|
||||
Interruptible* latest = getLatest(NOT_RESOLVED);
|
||||
stringstream stream;
|
||||
|
||||
if(latest)
|
||||
stream << "yes " << " " << latest->getDisplayName();
|
||||
else
|
||||
stream << "yes";
|
||||
|
||||
observer->isInterrupting = player;
|
||||
if(log)
|
||||
observer->logAction(player, "yes");
|
||||
observer->logAction(player, stream.str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -672,7 +681,6 @@ ActionStack::ActionStack(GameObserver* game)
|
||||
interruptDecision[i] = NOT_DECIDED;
|
||||
askIfWishesToInterrupt = NULL;
|
||||
timer = -1;
|
||||
currentState = -1;
|
||||
mode = ACTIONSTACK_STANDARD;
|
||||
checked = 0;
|
||||
lastActionController = NULL;
|
||||
@@ -873,8 +881,6 @@ void ActionStack::Update(float dt)
|
||||
//modal = 0;
|
||||
|
||||
TargetChooser * tc = observer->getCurrentTargetChooser();
|
||||
int newState = observer->getCurrentGamePhase();
|
||||
currentState = newState;
|
||||
if (!tc)
|
||||
checked = 0;
|
||||
|
||||
@@ -992,18 +998,33 @@ void ActionStack::Update(float dt)
|
||||
}
|
||||
}
|
||||
|
||||
void ActionStack::cancelInterruptOffer(InterruptDecision cancelMode, bool log)
|
||||
void ActionStack::cancelInterruptOffer(Player* p, InterruptDecision cancelMode, bool log)
|
||||
{
|
||||
int playerId = (observer->isInterrupting == observer->players[1]) ? 1 : 0;
|
||||
assert(observer->isInterrupting!=0);
|
||||
int playerId;
|
||||
if(p) {
|
||||
playerId = observer->getPlayerId(p)-1;
|
||||
} else {
|
||||
if(observer->isInterrupting == observer->players[1]) {
|
||||
playerId = 1;
|
||||
} else {
|
||||
playerId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(log) {
|
||||
stringstream stream;
|
||||
Interruptible* latest = getLatest(NOT_RESOLVED);
|
||||
if(latest)
|
||||
stream << "no " << cancelMode << " " << latest->getDisplayName();
|
||||
else
|
||||
stream << "no " << cancelMode;
|
||||
observer->logAction(playerId, stream.str());
|
||||
}
|
||||
interruptDecision[playerId] = cancelMode;
|
||||
askIfWishesToInterrupt = NULL;
|
||||
observer->isInterrupting = NULL;
|
||||
timer = -1;
|
||||
if(log) {
|
||||
stringstream stream;
|
||||
stream << "no " << cancelMode;
|
||||
observer->logAction(playerId, stream.str());
|
||||
}
|
||||
}
|
||||
|
||||
void ActionStack::endOfInterruption(bool log)
|
||||
@@ -1059,7 +1080,7 @@ bool ActionStack::CheckUserInput(JButton inputKey)
|
||||
}
|
||||
else if ((JGE_BTN_PRI == key))
|
||||
{
|
||||
cancelInterruptOffer(DONT_INTERRUPT_ALL);
|
||||
cancelInterruptOffer(0, DONT_INTERRUPT_ALL);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1359,6 +1359,13 @@ int AAFizzler::resolve()
|
||||
sCard = sTarget->source;
|
||||
if (!sCard || !sTarget || sCard->has(Constants::NOFIZZLE))
|
||||
return 0;
|
||||
if (source->alias == 111057 && sTarget)//Draining Whelk
|
||||
{
|
||||
for (int j = sTarget->cost->getConvertedCost(); j > 0; j--)
|
||||
{
|
||||
source->counters->addCounter(1,1);
|
||||
}
|
||||
}
|
||||
stack->Fizzle(sTarget, fizzleMode);
|
||||
return 1;
|
||||
}
|
||||
@@ -1994,28 +2001,23 @@ int AADynamic::resolve()
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_ITSELF:
|
||||
source = ((MTGCardInstance *) _target);
|
||||
_target = _target;
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER:
|
||||
_target = _target;
|
||||
secondaryTarget = ((MTGCardInstance *) _target)->controller();
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_TARGETOPPONENT:
|
||||
_target = _target;
|
||||
secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent();
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_TOSOURCE:
|
||||
tosrc = true;
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER:
|
||||
_target = _target;
|
||||
secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller();
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT:
|
||||
secondaryTarget = OriginalSrc->controller()->opponent();
|
||||
break;
|
||||
default:
|
||||
_target = _target;
|
||||
break;
|
||||
}
|
||||
if(amountsource == DYNAMIC_MYSELF_AMOUNT)
|
||||
@@ -2487,35 +2489,49 @@ int AACloner::resolve()
|
||||
|
||||
Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller();
|
||||
|
||||
MTGCardInstance * myClone = NEW MTGCardInstance(clone, targetPlayer->game);
|
||||
targetPlayer->game->temp->addCard(myClone);
|
||||
int tokenize = 1;//tokenizer support for cloning
|
||||
if (targetPlayer->game->battlefield->hasAbility(Constants::TOKENIZER))
|
||||
{
|
||||
int nbcards = targetPlayer->game->battlefield->nb_cards;
|
||||
for (int j = 0; j < nbcards; j++)
|
||||
{
|
||||
if (targetPlayer->game->battlefield->cards[j]->has(Constants::TOKENIZER))
|
||||
tokenize *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < tokenize; ++i)
|
||||
{
|
||||
MTGCardInstance * myClone = NEW MTGCardInstance(clone, targetPlayer->game);
|
||||
targetPlayer->game->temp->addCard(myClone);
|
||||
|
||||
Spell * spell = NEW Spell(game, myClone);
|
||||
spell->source->isToken = 1;
|
||||
spell->resolve();
|
||||
spell->source->fresh = 1;
|
||||
spell->source->model = spell->source;
|
||||
spell->source->model->data = spell->source;
|
||||
if(_target->isToken)
|
||||
{
|
||||
spell->source->power = _target->origpower;
|
||||
spell->source->toughness = _target->origtoughness;
|
||||
spell->source->life = _target->origtoughness;
|
||||
Spell * spell = NEW Spell(game, myClone);
|
||||
spell->source->isToken = 1;
|
||||
spell->resolve();
|
||||
spell->source->fresh = 1;
|
||||
spell->source->model = spell->source;
|
||||
spell->source->model->data = spell->source;
|
||||
if(_target->isToken)
|
||||
{
|
||||
spell->source->power = _target->origpower;
|
||||
spell->source->toughness = _target->origtoughness;
|
||||
spell->source->life = _target->origtoughness;
|
||||
}
|
||||
list<int>::iterator it;
|
||||
for (it = awith.begin(); it != awith.end(); it++)
|
||||
{
|
||||
spell->source->basicAbilities[*it] = 1;
|
||||
}
|
||||
for (it = colors.begin(); it != colors.end(); it++)
|
||||
{
|
||||
spell->source->setColor(*it);
|
||||
}
|
||||
for (it = typesToAdd.begin(); it != typesToAdd.end(); it++)
|
||||
{
|
||||
spell->source->addType(*it);
|
||||
}
|
||||
delete spell;
|
||||
}
|
||||
list<int>::iterator it;
|
||||
for (it = awith.begin(); it != awith.end(); it++)
|
||||
{
|
||||
spell->source->basicAbilities[*it] = 1;
|
||||
}
|
||||
for (it = colors.begin(); it != colors.end(); it++)
|
||||
{
|
||||
spell->source->setColor(*it);
|
||||
}
|
||||
for (it = typesToAdd.begin(); it != typesToAdd.end(); it++)
|
||||
{
|
||||
spell->source->addType(*it);
|
||||
}
|
||||
delete spell;
|
||||
return 1;
|
||||
|
||||
}
|
||||
@@ -2946,6 +2962,32 @@ AAShuffle * AAShuffle::clone() const
|
||||
return NEW AAShuffle(*this);
|
||||
}
|
||||
|
||||
// Mulligan
|
||||
AAMulligan::AAMulligan(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int who) :
|
||||
ActivatedAbilityTP(observer, _id, card, _target, _cost, who)
|
||||
{
|
||||
}
|
||||
|
||||
int AAMulligan::resolve()
|
||||
{
|
||||
Player * player = getPlayerFromTarget(getTarget());
|
||||
if (player)
|
||||
{
|
||||
player->serumMulligan();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
const string AAMulligan::getMenuText()
|
||||
{
|
||||
return "Mulligan";
|
||||
}
|
||||
|
||||
AAMulligan * AAMulligan::clone() const
|
||||
{
|
||||
return NEW AAMulligan(*this);
|
||||
}
|
||||
|
||||
// Remove Mana From ManaPool
|
||||
AARemoveMana::AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string manaDesc, int who) :
|
||||
ActivatedAbilityTP(observer, _id, card, _target, NULL, who)
|
||||
@@ -3508,7 +3550,7 @@ int MenuAbility::processAbility()
|
||||
mClone->resolve();
|
||||
SAFE_DELETE(mClone);
|
||||
if (source->controller() == game->isInterrupting)
|
||||
game->mLayers->stackLayer()->cancelInterruptOffer(ActionStack::DONT_INTERRUPT, false);
|
||||
game->mLayers->stackLayer()->cancelInterruptOffer(0, ActionStack::DONT_INTERRUPT, false);
|
||||
}
|
||||
|
||||
processed = true;
|
||||
@@ -3545,7 +3587,7 @@ int MenuAbility::reactToChoiceClick(Targetable * object,int choice,int control)
|
||||
if(!mClone)
|
||||
{
|
||||
if (source->controller() == game->isInterrupting)
|
||||
game->mLayers->stackLayer()->cancelInterruptOffer(ActionStack::DONT_INTERRUPT, false);
|
||||
game->mLayers->stackLayer()->cancelInterruptOffer(0, ActionStack::DONT_INTERRUPT, false);
|
||||
return 0;
|
||||
}
|
||||
mClone->target = abilities[choice]->target;
|
||||
@@ -4728,14 +4770,15 @@ void AVanishing::Update(float dt)
|
||||
|
||||
int AVanishing::resolve()
|
||||
{
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
const string AVanishing::getMenuText()
|
||||
{
|
||||
if(counterName.find("fade") != string::npos)
|
||||
return "Fading";
|
||||
if (counterName.find("fade") != string::npos)
|
||||
{
|
||||
return "Fading";
|
||||
}
|
||||
return "Vanishing";
|
||||
}
|
||||
|
||||
@@ -5708,7 +5751,8 @@ void ATutorialMessage::Update(float dt)
|
||||
|
||||
mElapsed += dt;
|
||||
|
||||
IconButtonsController::Update(dt);
|
||||
if(!mUserCloseRequest)
|
||||
IconButtonsController::Update(dt);
|
||||
|
||||
if (mIsImage)
|
||||
return;
|
||||
|
||||
@@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor()
|
||||
colorComparisonMode = COMPARISON_NONE;
|
||||
CDopponentDamaged = 0;
|
||||
CDcontrollerDamaged = 0;
|
||||
CDdamager = 0;
|
||||
}
|
||||
|
||||
int CardDescriptor::init()
|
||||
@@ -226,16 +227,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
|
||||
{
|
||||
match = NULL;
|
||||
}
|
||||
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()))
|
||||
|
||||
if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature))
|
||||
|| (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1224,6 +1224,18 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
||||
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)
|
||||
{
|
||||
//card is multicolored?
|
||||
|
||||
@@ -4,6 +4,7 @@ const float CarouselDeckView::max_scale = 0.96f;
|
||||
const float CarouselDeckView::x_center = 180;
|
||||
const float CarouselDeckView::right_border = SCREEN_WIDTH + 180;
|
||||
const float CarouselDeckView::slide_animation_duration = 0.6f;
|
||||
const float CarouselDeckView::scroll_animation_duration = 0.3f;
|
||||
|
||||
CarouselDeckView::CarouselDeckView() :
|
||||
DeckView(10), mScrollOffset(0), mSlideOffset(0), mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset)
|
||||
@@ -21,12 +22,12 @@ void CarouselDeckView::UpdateViewState(float dt)
|
||||
|
||||
if(mScrollOffset <= -1.0f)
|
||||
{
|
||||
SwitchPosition(-1);
|
||||
changePosition(-1);
|
||||
mScrollEasing.translate(1.0f);
|
||||
}
|
||||
else if(mScrollOffset >= 1.0f)
|
||||
{
|
||||
SwitchPosition(1);
|
||||
changePosition(1);
|
||||
mScrollEasing.translate(-1.0f);
|
||||
}
|
||||
|
||||
@@ -43,7 +44,7 @@ void CarouselDeckView::UpdateViewState(float dt)
|
||||
if(mSlideOffset < -1.0f)
|
||||
{
|
||||
mSlideEasing.translate(2.0f);
|
||||
SwitchFilter(1);
|
||||
changeFilter(1);
|
||||
}
|
||||
}
|
||||
else if(mSlideOffset > mSlideEasing.start_value)
|
||||
@@ -52,7 +53,7 @@ void CarouselDeckView::UpdateViewState(float dt)
|
||||
if(mSlideOffset > 1.0f)
|
||||
{
|
||||
mSlideEasing.translate(-2.0f);
|
||||
SwitchFilter(-1);
|
||||
changeFilter(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +61,10 @@ void CarouselDeckView::UpdateViewState(float dt)
|
||||
}
|
||||
}
|
||||
|
||||
void CarouselDeckView::UpdateCardPosition(CardRep &rep, int index)
|
||||
void CarouselDeckView::UpdateCardPosition(int index)
|
||||
{
|
||||
CardRep &rep = mCards[index];
|
||||
|
||||
float rotation = mScrollOffset + 8 - index;
|
||||
|
||||
rep.x = x_center + cos((rotation) * M_PI / 12) * (right_border - x_center);
|
||||
@@ -84,13 +87,13 @@ void CarouselDeckView::Render()
|
||||
// in a different order, ie the center card should appear first, then the adjacent ones
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(0).card);
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(3).card);
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(4).card);
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(2).card);
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(5).card);
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(1).card);
|
||||
WResourceManager::Instance()->RetrieveCard(getCardRep(6).card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[0].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[3].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[4].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[2].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[5].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[1].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[6].card);
|
||||
}
|
||||
|
||||
renderCard(6);
|
||||
@@ -118,6 +121,31 @@ void CarouselDeckView::Render()
|
||||
}
|
||||
}
|
||||
|
||||
bool CarouselDeckView::ButtonPressed(Buttons button)
|
||||
{
|
||||
switch(button)
|
||||
{
|
||||
case JGE_BTN_LEFT:
|
||||
changePositionAnimated(-1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_RIGHT:
|
||||
changePositionAnimated(1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_UP:
|
||||
changeFilterAnimated(1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_DOWN:
|
||||
changeFilterAnimated(-1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
MTGCard * CarouselDeckView::Click(int x, int y)
|
||||
{
|
||||
int n = getCardIndexNextTo(x, y);
|
||||
@@ -132,35 +160,41 @@ MTGCard * CarouselDeckView::Click(int x, int y)
|
||||
}
|
||||
else
|
||||
{
|
||||
changePosition(n - 2);
|
||||
changePositionAnimated(n - 2);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CarouselDeckView::changePosition(int offset)
|
||||
MTGCard *CarouselDeckView::Click()
|
||||
{
|
||||
mScrollEasing.start((float)offset, (float)(0.3f*abs(offset)));
|
||||
if(mSlideEasing.finished() && mScrollEasing.finished())
|
||||
{
|
||||
return getActiveCard();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CarouselDeckView::changePositionAnimated(int offset)
|
||||
{
|
||||
if(mScrollEasing.finished())
|
||||
mScrollEasing.start((float)offset, (float)(scroll_animation_duration * abs(offset)));
|
||||
last_user_activity = 0;
|
||||
}
|
||||
|
||||
void CarouselDeckView::changeFilter(int offset)
|
||||
void CarouselDeckView::changeFilterAnimated(int offset)
|
||||
{
|
||||
if(offset < 0)
|
||||
{
|
||||
mSlideEasing.start(-2.0f, slide_animation_duration);
|
||||
}
|
||||
else if(offset > 0)
|
||||
{
|
||||
mSlideEasing.start(2.0f, slide_animation_duration);
|
||||
}
|
||||
if(mSlideEasing.finished())
|
||||
mSlideEasing.start(2.0f * float(offset), float(slide_animation_duration * abs(offset)));
|
||||
last_user_activity = 0;
|
||||
}
|
||||
|
||||
MTGCard *CarouselDeckView::getActiveCard()
|
||||
{
|
||||
return getCardRep(2).card;
|
||||
return mCards[2].card;
|
||||
}
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament,
|
||||
}
|
||||
if (mGamesWon>mGamesPlayed*0.80 && mGamesWon<mGamesPlayed)
|
||||
{
|
||||
CreditBonus * b = NEW CreditBonus(250, _("Won more then 80 percentage of games"));
|
||||
CreditBonus * b = NEW CreditBonus(250, _("Won more than 80 percentage of games"));
|
||||
bonus.push_back(b);
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ int Credits::isDifficultyUnlocked(DeckStats * stats)
|
||||
{
|
||||
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number)
|
||||
return 0;
|
||||
int nbAIDecks = AIPlayer::getTotalAIDecks();
|
||||
int nbAIDecks = AI::AIPlayer::getTotalAIDecks();
|
||||
|
||||
int wins = 0;
|
||||
|
||||
@@ -743,7 +743,7 @@ int Credits::IsMoreAIDecksUnlocked(DeckStats * stats) {
|
||||
// the number of currently unlocked decks in order to go through.
|
||||
if (stats->nbGames() < currentlyUnlocked * 1.2) return 0;
|
||||
|
||||
if (AIPlayer::getTotalAIDecks() > currentlyUnlocked)
|
||||
if (AI::AIPlayer::getTotalAIDecks() > currentlyUnlocked)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -192,8 +192,10 @@ int Damage::resolve()
|
||||
//return the left over amount after effects have been applied to them.
|
||||
a = target->dealDamage(damage);
|
||||
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
|
||||
((MTGCardInstance*)target)->wasDealtDamage = true;
|
||||
((MTGCardInstance*)source)->damageToCreature = true;
|
||||
}
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
||||
{
|
||||
if(target == source->controller())
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user