414 Commits

Author SHA1 Message Date
xawotihs
ab34d0d366 Removed Werror to work around a bug in the PSP cross-compiler. 2015-08-29 20:31:56 +02:00
xawotihs
963ab2840b Should fix cross-compilation issue on PSP. 2015-08-29 19:23:07 +02:00
xawotihs
a25b010429 Merge branch 'master' into minmax 2015-08-28 23:48:54 +02:00
xawotihs
504160a740 Latest min-max branch 2015-08-25 23:29:58 +02:00
xawotihs
5061f7c37f Merge branch 'master' into minmax 2015-08-25 22:41:44 +02:00
Xawotihs
30f5a49988 Merge pull request #614 from kevlahnota/master
added FRF
2015-08-24 17:56:32 +02:00
Anthony Calosa
2998e95a3b tokenizer should work now for cloning ability
Populate(Put a token onto the battlefield that's a copy of a creature
token you control.)
2015-08-24 22:39:54 +08:00
Anthony Calosa
ac29367ff8 update _tests.txt 2015-08-24 10:05:05 +08:00
Anthony Calosa
dbd7f82eab added tokenizer test 2015-08-24 10:03:34 +08:00
Anthony Calosa
176b74489e added parallel lives
support token doubler... :)
2015-08-23 21:56:23 +08:00
Anthony Calosa
f940f8e303 some corrections
added Induce Paranoia, Draining Whelk
2015-08-22 23:40:31 +08:00
Anthony Calosa
2679213121 added FRF 2015-08-21 17:38:15 +08:00
Anthony Calosa
59c0cf467f serum powder code
serum powder second ability...
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.
2015-08-20 23:11:44 +08:00
Anthony Calosa
5a2637856f Merge remote-tracking branch 'WagicProject/master' 2015-08-20 23:09:12 +08:00
Anthony Calosa
26ecb199d3 Merge remote-tracking branch 'WagicProject/master' 2015-08-20 23:00:56 +08:00
Xawotihs
62d42fb61f Removed local check of mac branch 2015-08-17 23:53:11 +02:00
Xawotihs
19c96e496b More debug 2015-08-17 23:03:53 +02:00
Xawotihs
e982ba50be Removed a suspicous $ from the mac script 2015-08-17 22:27:39 +02:00
Xawotihs
27ad956034 More debug of the mac script 2015-08-17 21:57:29 +02:00
Xawotihs
8c6f694645 Replaced suspicious test 2015-08-16 21:11:41 +02:00
Xawotihs
8ce85636d9 More debug 2015-08-16 20:52:10 +02:00
Xawotihs
07683480b4 build => release => tag => build ... 2015-08-16 18:41:36 +02:00
Xawotihs
7d8fdbfd58 Restored branch removal and added some debug 2015-08-16 18:24:57 +02:00
Xawotihs
2a1cb03484 OMG what a stupid typo 2015-08-16 18:02:22 +02:00
Anthony Calosa
baa90fb605 added Ral Zarek 2015-08-16 14:57:34 +08:00
Anthony Calosa
1b67b736df Merge remote-tracking branch 'WagicProject/master' 2015-08-16 14:29:44 +08:00
Anthony Calosa
e6514a8b33 added gravecrawler
gravecrawler is supported :)
2015-08-16 14:17:26 +08:00
Xawotihs
636b07b350 Try to fix macosx branch deletion 2015-08-15 23:29:47 +02:00
Xawotihs
4b5478530c Merge pull request #612 from kevlahnota/master
Support of "formidable" abilities, added JOU, THS, M14 and fixed various cards.
2015-08-15 21:00:12 +02:00
Anthony Calosa
4a721a7e18 added KTK cards 2015-08-15 23:41:31 +08:00
Anthony Calosa
2470629afd Merge remote-tracking branch 'WagicProject/master' 2015-08-15 22:23:00 +08:00
Anthony Calosa
ccdd16bbc7 Used proper constant 2015-08-15 19:13:48 +08:00
Anthony Calosa
9cf6e621ab Removes viewing of tokens (rarity with T) on Spoiler 2015-08-15 14:51:26 +08:00
Anthony Calosa
94a97a3032 give credits
thanks KF1 and Tacoghandi
2015-08-15 08:18:35 +08:00
Anthony Calosa
f4ef7b9851 added M14 cards 2015-08-15 08:17:21 +08:00
Anthony Calosa
c2be7dd025 Fix M14 card dat 2015-08-15 08:07:36 +08:00
Anthony Calosa
b51dfc7733 added THS cards 2015-08-14 13:19:05 +08:00
Anthony Calosa
9999820a8f added missing cards from theros block 2015-08-13 23:19:20 +08:00
Anthony Calosa
10bc8283ed added JOU cards 2015-08-12 22:40:24 +08:00
Anthony Calosa
66f3ba5a7b removed id collision
avatar token already defined below ajani goldmane
2015-08-12 21:38:19 +08:00
Anthony Calosa
07f0175c5e fix bad line 2015-08-12 21:33:46 +08:00
Anthony Calosa
7376ac382f added missing copy cards 2015-08-12 20:53:30 +08:00
Anthony Calosa
3646219da4 Added missing devotion cards 2015-08-12 20:46:23 +08:00
Anthony Calosa
bfbc073593 added cards 2015-08-12 20:23:46 +08:00
Anthony Calosa
307be96fd6 Added Formidable cards 2015-08-12 20:16:07 +08:00
Anthony Calosa
22f4f21619 Added missing sets 2015-08-12 18:20:03 +08:00
Anthony Calosa
1738e216d0 Delete JOU 2015-08-12 18:05:45 +08:00
Anthony Calosa
567650357f Create JOU 2015-08-12 18:03:46 +08:00
Anthony Calosa
32de6ac124 Minor primitives correction
corrected some typo and added some cards
2015-08-12 17:32:42 +08:00
Anthony Calosa
60f3c87de1 Count Total Power of Creatures you control
example usage:  auto={4}{G}:4/4
restriction{compare(powertotalinplay)~morethan~7}
2015-08-10 22:44:27 +08:00
Xawotihs
d9561118bc Update appveyor.yml
Skip building macosx environment on windows
2015-07-20 22:32:25 +02:00
Xawotihs
228e5342fb Merge pull request #609 from WagicProject/CI-fixes
Ci fixes
2015-07-11 23:47:44 +02:00
Xawotihs
8574154071 Update .travis.yml 2015-07-11 21:58:30 +02:00
Xawotihs
80379ecde5 Update .travis.yml 2015-07-11 21:52:20 +02:00
Xawotihs
31b8ad248f Update .travis.yml
Fixed references to SDK package
2015-07-11 20:03:37 +02:00
Xawotihs
2d02f97f7f Update .travis.yml
Updated android SDK to 24.3.3
2015-07-11 18:51:11 +02:00
Xawotihs
6a37b5e461 Update .travis.yml
And a last one.
2015-07-11 18:36:34 +02:00
Xawotihs
38ed60bf63 Update .travis.yml
Add some \ to try fixing the script
2015-07-11 18:27:23 +02:00
Xawotihs
e664ecfaf5 Update .travis.yml
Updated android build tools to 22.0.1
2015-07-11 18:05:39 +02:00
Xawotihs
e2814c04f4 Merge pull request #607 from WagicProject/coverage
Adds test code coverage support
2014-12-31 13:57:14 +01:00
Xawotihs
8c2836b0c2 Update README.md
Added coverage status
2014-12-29 15:04:00 +01:00
Xawotihs
fcfab4c756 Update .travis.yml
Removed traces
2014-12-27 13:43:38 +01:00
Xawotihs
ddd59c489a Update .travis.yml
trying to fix gcov root
2014-12-27 12:17:03 +01:00
xawotihs
db922a0e77 Activated perf logs with qt console config 2014-12-27 11:47:54 +01:00
Xawotihs
793c4d1d7d Update .travis.yml
Added some traces
2014-12-27 10:39:16 +01:00
Xawotihs
24eab33b6d Update .travis.yml
updating coveralls options
2014-12-27 02:07:38 +01:00
Xawotihs
4985323ad9 Update .travis.yml
Tweaked coveralls config
2014-12-27 01:29:58 +01:00
Xawotihs
9fc551982b Update .travis.yml
Updated android sdk version
2014-12-26 21:23:11 +01:00
xawotihs
8ee67b5af8 Adds coverage support 2014-12-21 22:49:47 +01:00
xawotihs
78ad22479c Added changelog file 2014-12-09 22:18:51 +01:00
Xawotihs
2041aa45f0 Reactivated PSP build 2014-12-08 20:52:04 +01:00
xawotihs
c8b0ce9669 added sudo to install python packages on macosx 2014-12-08 00:10:48 +01:00
xawotihs
11eb6de57e Changed token and redirect push output 2014-12-07 23:33:46 +01:00
xawotihs
c451234bd5 Moved definition of origin 2014-12-07 22:47:04 +01:00
xawotihs
b56862fcf8 Added python dependencies, replaced token and removed "x" option in shell scripts 2014-12-07 22:26:39 +01:00
xawotihs
21a6da91ca Added git remote URL as HTTPS 2014-12-07 21:48:50 +01:00
xawotihs
410108a005 Added email and name to enable git commit 2014-12-07 21:06:53 +01:00
xawotihs
51d5b166a6 Deactivated PSP build and refactored build conditions 2014-12-07 20:29:27 +01:00
xawotihs
1f77243881 Fixed mac build script 2014-12-07 19:48:53 +01:00
xawotihs
f63afb2dd6 Merge branch 'mac-build' 2014-12-07 17:55:25 +01:00
xawotihs
dbe1c6e2ae Moved mac travis file outside of script and update oauth token 2014-12-07 17:26:32 +01:00
xawotihs
6a37425a38 Changed number of processes to 4 2014-12-07 16:48:57 +01:00
xawotihs
02efa4745f Fixed access to mac script and added mac branch to the list of branch authorized to upload binaries 2014-12-07 16:39:15 +01:00
xawotihs
e78754bcd5 Fixed mac script call 2014-12-07 16:24:39 +01:00
xawotihs
16dcf3cc5e - Moved scripts in tools directory
- Added a Mac cross-compiling script
2014-12-07 16:02:56 +01:00
xawotihs
03d168f972 Added MacOS bundle creation in Qt .pro file 2014-12-06 15:13:45 +01:00
Xawotihs
6f6c8b0eb6 Merge pull request #606 from kevlahnota/master
Fix for guild_keywords Devotion, added some "Chroma" cards
2014-12-05 07:47:37 +01:00
Anthony Calosa
fa14219e12 Fix for Devotion, added some "Chroma" cards 2014-12-05 10:18:05 +08:00
Xawotihs
15cd86fad1 Add traces at the end of the upload 2014-12-04 22:51:38 +01:00
Xawotihs
56ccebb720 Merge pull request #605 from kevlahnota/master
added guild keywords, added specific life cost
2014-12-03 07:37:55 +01:00
Anthony Calosa
8ef3789970 reverted sacred foundry 2014-12-03 07:54:13 +08:00
Anthony Calosa
ed7769c373 Revert "update sacred_foundry_i275.txt"
This reverts commit 5745006c35.
2014-12-03 07:47:00 +08:00
Anthony Calosa
5745006c35 update sacred_foundry_i275.txt 2014-12-02 19:19:05 +08:00
Anthony Calosa
16b243c52a Added bng cards to the main primitives. Removed bngGods.txt 2014-12-02 10:39:53 +08:00
Anthony Calosa
bc91eaf5ca updated card primitives that supports specific life cost 2014-11-29 07:10:02 +08:00
Anthony Calosa
6962d1e888 added cards, needs more testing before merging with the main primitives 2014-11-29 06:58:33 +08:00
Anthony Calosa
4d1e8dfb36 Update bngGods.txt
9/15/2013 	The type-changing ability that can make the God not be a creature functions only on the battlefield. It’s always a creature card in other zones, regardless of your devotion to its color.
2014-11-28 15:31:24 +08:00
Anthony Calosa
6ff6f95044 added Xenagos, God of Revels and Phenax, God of Deception for test purpose. 2014-11-28 14:34:37 +08:00
Anthony Calosa
5369983b35 Added BNG set 2014-11-28 14:19:04 +08:00
Anthony Calosa
46a8041c48 Added guild keyword gruul test for Xenagos, God of Revels. You must have Born of the gods set (BNG) 2014-11-28 14:00:58 +08:00
Anthony Calosa
84185a7c78 Added specific life cost test for griselbrand. Pls read note. 2014-11-28 13:35:13 +08:00
Anthony Calosa
4f41248978 Added specific life cost. if we use {l}{l}{l} to pay 3 life, and you have 2 life, you cannot afford to pay the cost but instead the game allows it. if we use specific life cost like: {l:3}, the restriction works. 2014-11-27 14:38:55 +08:00
Anthony Calosa
92d52a78be Update ExtraCost.cpp 2014-11-27 14:33:43 +08:00
Anthony Calosa
a76594046b Update ExtraCost.h 2014-11-27 14:31:25 +08:00
kevlahnota
2214ec66f1 Update AllAbilities.h
keywords for the "gods", "azorius" returns value of devotion to blue and white. ex. auto=azorius/dimir ueot
2014-11-27 11:31:19 +08:00
xawotihs
b8da46ac18 Fixed phonon support. 2014-11-23 16:27:18 +01:00
xawotihs
d656730d3a Fixed phonon support 2014-11-23 16:24:36 +01:00
xawotihs
2f230e4b38 Added buyback.txt to the list of automatic tests 2014-11-23 16:23:18 +01:00
xawotihs
494f64acbd Merge branch 'apollovy-master' 2014-11-23 14:32:02 +01:00
xawotihs
50978200d4 Merge branch 'master' of https://github.com/apollovy/wagic into apollovy-master 2014-11-23 14:30:17 +01:00
xawotihs
a38e1daec7 Updated Android build tools to 21.1.1 2014-11-23 12:44:22 +01:00
Yuriy A. Apollov
57a26b4583 Add test for buyback case. 2014-11-18 06:58:38 +03:00
Yuriy A. Apollov
c018c8fcd1 Fix buyback payed once stayed forever. 2014-11-18 06:51:40 +03:00
xawotihs
3ba4aca8bc Fixed stupid bug in python release creation 2014-08-25 22:16:12 +02:00
xawotihs
870f6e3b58 Fixed python typo 2014-08-25 00:27:40 +02:00
xawotihs
83e0869548 Updated python upload code to re-create new release 'latest-master' for each master commit 2014-08-25 00:02:46 +02:00
xawotihs
90b08db038 Updated travis to use python uploading script 2014-08-24 19:45:18 +02:00
xawotihs
c888e143a1 Fixed python typo 2014-08-24 18:46:42 +02:00
xawotihs
4e727bc164 Fixed python typo 2014-08-24 18:23:08 +02:00
xawotihs
b37afadb01 Fixed typo. 2014-08-24 17:59:04 +02:00
xawotihs
2c2744f6fb Fixed python issue 2014-08-24 17:40:05 +02:00
xawotihs
db2b2fa3b5 Replaced \ by / 2014-08-24 17:07:00 +02:00
xawotihs
0127f7aab9 Tries to activate automatic artifact deployment to github release from appveyor 2014-08-24 16:07:26 +02:00
Xawotihs
ce41791fa4 Remove broken comments 2014-08-23 09:36:46 +02:00
Xawotihs
ec4be4f6b1 Uses real python path 2014-08-23 00:53:33 +02:00
Xawotihs
f82d89b3db Removed empty environment section 2014-08-23 00:47:30 +02:00
xawotihs
202175f2a7 First appveyor script and python windows package build file 2014-08-22 23:26:03 +02:00
xawotihs
165eb699e8 Fixed and activated redo in testsuite 2014-08-17 16:31:21 +02:00
xawotihs
33760f4066 Add minmax in Qt project, fixed small issue in later qtMultimedia code 2014-08-08 18:08:13 +02:00
xawotihs
656ab78cf5 Merge branch 'master' into minmax 2014-08-07 22:29:41 +02:00
xawotihs
d7628b3eb2 Fixed console with Qtmultimedia 2014-08-03 12:20:45 +02:00
Xawotihs
7560db571c Trying without HTTPS to speed up SDK update 2014-08-03 11:43:55 +02:00
Xawotihs
775143355d Add lib pulse-dev 2014-08-03 01:51:41 +02:00
Xawotihs
846ba30821 Tries to fix android sdk update issue 2014-08-03 01:34:53 +02:00
Xawotihs
ad88592229 Replaced pulse-dev with pulseaudio 2014-08-02 23:44:40 +02:00
Xawotihs
6b90956af1 Adding pulse 2014-08-02 23:35:25 +02:00
Xawotihs
26e905a36e Update Androi build tools to 20.0.0 2014-08-02 23:16:22 +02:00
xawotihs
1a9ff38f0c Merge branch 'qtMultimedia' of https://github.com/WagicProject/wagic into qtMultimedia 2014-08-02 21:07:12 +02:00
xawotihs
8b22d032cd Fixed QT version needed for pixelRatio API 2014-08-02 21:05:55 +02:00
Xawotihs
8d58baf4a3 adding qtmultimedia in apt-get 2014-08-02 19:38:11 +02:00
Xawotihs
a447a0c9af Trying with --all 2014-08-02 19:22:38 +02:00
xawotihs
555fb3ae93 Updated Qt building scripts to use qt5 qmake and no fmod 2014-08-02 18:54:28 +02:00
Xawotihs
7053531a4d Added qmake qt5 configuration 2014-08-02 18:37:53 +02:00
Xawotihs
7d4e5177b9 Reordered actions from install to before_install 2014-08-02 18:15:45 +02:00
Xawotihs
06f30eca3a Upgraded travis to use qt5 2014-08-02 17:50:45 +02:00
xawotihs
ac5c14b977 Fixed QtMultimedia port, replaced QSoundEffect by QMediaPlayer as all codecs were not supported by first class. 2014-08-02 17:12:19 +02:00
xawotihs
c3d810bd3b Merge branch 'master' into qtMultimedia 2014-08-02 16:16:19 +02:00
xawotihs
1e24f25c18 Fixed repository against Qt5.3.1 2014-08-02 15:56:52 +02:00
xawotihs
28db884498 Cleaned up cross-compiling travis stuff 2014-07-26 19:45:59 +02:00
xawotihs
36ecc1ffef Cleaned up cross-compiling travis stuff 2014-07-26 19:38:14 +02:00
Xawotihs
9ec6803a02 Merge pull request #602 from WagicProject/feature/ios-update-xcode5.1
Feature/ios update xcode5.1
2014-07-24 23:08:39 +02:00
xawotihs
e87996a7f2 Deactivate window cross-compiling build 2014-07-23 23:20:54 +02:00
xawotihs
f2a5273029 Activating logs on android issue 2014-07-23 22:22:06 +02:00
xawotihs
9bc750da9a Upgrade Android SDK to r23.0.2 2014-07-23 22:05:02 +02:00
Xawotihs
539c5bd18a Trying to fix android build 2014-07-23 20:53:25 +02:00
Xawotihs
bdc1ada090 Update README.md
Added build status on AppVeyor
2014-07-23 00:17:07 +02:00
Michael Nguyen
2efc24a1ce Merge branch 'develop' into feature/ios-update-xcode5.1 2014-04-13 11:50:16 -07:00
Michael Nguyen
63561e6122 update Xcode build preferences as recommended by XCode. 2014-04-13 11:39:40 -07:00
Michael Nguyen
d2390b1227 updated project file for iOS to work with current codebase
- added missing source/headers (GameView.h, CarouselView.h, etc )
- removed dependency on admob static library
- removed CardEffect.h and CardEffect.cpp from project reference
- removed -no_implicit_dylibs flag (apparently no longer supported)
- added -fno-objc-arc (turns off ARC compilation for entire project)
- added -DTIXML_USE_STL
2014-04-13 08:34:21 -07:00
Michael Nguyen
d0799ea3f2 updating to latest code from master
Merge branch 'master' into develop
2014-04-13 08:26:53 -07:00
Xawotihs
44cbfbb1fb Merge pull request #601 from ZobyTwo/cleanup_3
Remove dead code and fix circular initialization
2014-03-13 20:20:12 +01:00
Tobias Loose
b078dd1f6a Fix android makefile 2014-03-11 17:31:25 +01:00
Tobias Loose
225dd23753 Fix makefile 2014-03-11 17:19:05 +01:00
Rolzad73
51b4755242 Update README.md
Added sample play-through video link
2014-02-05 23:39:57 -05:00
Tobias Loose
8f233b3027 Avoid circular initialization 2014-02-03 19:44:51 +01:00
Tobias Loose
197540763e Remove unused Effects.h/.cpp and class Effect
There was an empty vector of effect* in PlayGuiObject.
2014-02-03 13:52:40 +01:00
xawotihs
5d7667dc01 Cleaned Phonon vs QtMultimedia config 2014-01-31 21:53:27 +01:00
xawotihs
18383579e9 Fixed android compilation 2014-01-27 06:31:23 +01:00
xawotihs
03d4f8ffa1 Added Qt Multimedia support in order to replace Phonon. Currently does not work on Mac. 2014-01-26 23:56:15 +01:00
xawotihs
541698f98e Merge branch 'master' into minmax 2014-01-24 23:49:30 +01:00
xawotihs
30d92eb68c Should fix issue #497 with the broken freezing the game. 2014-01-18 22:50:16 +01:00
xawotihs
6e6a0fd5c2 OMG I so hate shells 2014-01-18 16:00:14 +01:00
xawotihs
cd4a980182 More debug 2014-01-18 15:26:09 +01:00
xawotihs
aad54fd98d Adds debug in build script 2014-01-18 14:57:23 +01:00
xawotihs
6b7a49506c Should fix the stringifying issue 2014-01-18 14:23:26 +01:00
xawotihs
7ecf67c176 And again 2014-01-18 13:37:43 +01:00
xawotihs
77aeb2d0ac Fixed release name 2014-01-18 13:29:50 +01:00
xawotihs
7a9f989104 Adds some URL error log 2014-01-18 12:46:27 +01:00
xawotihs
ae06bebd24 Merge branch 'github_downloader' 2014-01-18 12:11:08 +01:00
xawotihs
042fb7b376 Tries to fix Android compilation 2014-01-18 11:18:27 +01:00
xawotihs
c3583ade01 Updated resource name and URL for android project 2014-01-17 23:25:48 +01:00
xawotihs
f97d9805dd Removed build number in released filename and added computation of resource URL based on release name. 2014-01-17 21:50:10 +01:00
xawotihs
1d33de59a9 Fixed compilation issue 2014-01-12 22:56:53 +01:00
xawotihs
0c4b09891b Removed hardcoded testing values and used 32 bits file size instead of 64 bits. 2014-01-12 22:40:45 +01:00
xawotihs
25955303e7 Adds a Downloader component to JGE able to download and cache files. 2014-01-12 22:16:35 +01:00
Rolzad73
27b75eecb0 Merge pull request #600 from WagicProject/android_build_update
update android build tools version
2014-01-09 12:33:11 -08:00
Rolzad73
e40921cf13 update android build tools version 2014-01-09 14:57:06 -05:00
Rolzad73
083cebcc7e updated credits text 2014-01-09 14:46:58 -05:00
Rolzad73
a722736335 Merge pull request #599 from WagicProject/android_travis_explicit
Attempt to make android tools fetching for TravisCI explicit and futureproof
2014-01-08 08:40:47 -08:00
Rolzad73
c483c20c81 attempt to make android tools fetching for TravisCI explicit and futureproof 2014-01-08 11:14:47 -05:00
Dmitry Panin
dec1caa43c Revert "Fixed issue with multiple basic abilities in TargetChooser"
This reverts commit d9816c7ad0.
2014-01-04 18:40:59 -08:00
Dmitry Panin
9526e22118 Fixed grave pact 2014-01-04 18:14:15 -08:00
Dmitry Panin
d9816c7ad0 Fixed issue with multiple basic abilities in TargetChooser
E.g. card create[trample;haste] wasn't handled properly
2014-01-04 18:13:22 -08:00
Dmitry Panin
8e327a27df Fixed formatting 2014-01-04 18:13:22 -08:00
xawotihs
43fe67d7d8 Adds executioners_swing tests in _tests.txt 2013-12-31 18:38:30 +01:00
Xawotihs
a63991bb4e Merge pull request #598 from bjornsnoen/master
Damager keyword
2013-12-31 09:11:20 -08:00
xawotihs
b09db0c60f Removed c++11 warning. 2013-12-22 21:26:06 +01:00
Bjørn Snoen
928ca3497a More code compliance. New tests. 2013-12-21 19:31:32 +01:00
Bjørn Snoen
60219411f6 Coding style compliance 2013-12-21 14:33:44 +01:00
Bjørn Snoen
642f5bb515 Fixed indentation mistakes 2013-12-21 11:18:18 +01:00
Bjørn Snoen
20e878a102 Made damager keyword work. Fixed Executioner's Swing in mtg.txt 2013-12-21 11:05:15 +01:00
xawotihs
da31371d86 Include c++11 threading 2013-12-20 18:39:02 +01:00
xawotihs
0df408793a Tries to fix android sdk installation in Travis 2013-12-20 14:09:30 +01:00
xawotihs
9630bcd56b Removed file wrongly added. 2013-12-20 12:37:25 +01:00
xawotihs
3c38e21b25 Merge branch 'master' into Qt5.2_macx 2013-12-20 11:14:10 +01:00
xawotihs
caec886e22 Fixed issues found by XCode. 2013-12-20 00:24:08 +01:00
Dmitry Panin
927f8955e9 Merge pull request #596 from bjornsnoen/master
Fix a rarity mistake and a grammatical error
2013-12-19 02:44:38 -08:00
Bjørn Snoen
d4e0296d2b Fixed wrong rarity on millstone in M14 2013-12-18 09:37:20 +01:00
Bjørn Snoen
8eb664f93d Fixed grammatical then/than error. 2013-12-18 05:50:30 +01:00
xawotihs
b180c3d1a7 Fixed Qt5 mingw32 build 2013-12-16 22:11:28 +01:00
Dmitry Panin
db9f18a644 Added _cards.dat for M14 (taken from forum) 2013-12-15 22:39:08 +04:00
xawotihs
95805ea387 Fixed QT mingw cross compile with QT4.8 2013-12-15 00:26:04 +01:00
xawotihs
4765890d0a Fixed mouse input with retina display 2013-12-14 23:46:23 +01:00
Xawotihs
2e13f29945 Update README.md 2013-12-14 19:13:26 +01:00
xawotihs
22b1c3b5d8 Fixed zip permission while rezipping PSP package 2013-12-14 14:40:26 +01:00
xawotihs
c7bae65697 Fixed core unzip 2013-12-14 13:18:11 +01:00
xawotihs
2381f0306c Fixed paths 2013-12-14 12:06:51 +01:00
xawotihs
b12e15e4ff Tries to arrange a bit the PSP binary package to make it more usual for users. 2013-12-14 11:55:12 +01:00
xawotihs
9e21751e12 Fixed windows build upload 2013-12-13 22:54:40 +01:00
xawotihs
db60c38eda Added windows build 2013-12-13 23:07:17 +01:00
xawotihs
1a4327a2e6 Fixed mingw32 build linking 2013-12-13 21:54:43 +01:00
xawotihs
88095c67b8 Fixed mingw32 compilation 2013-12-13 21:27:40 +01:00
xawotihs
ec34380668 Fixed mingw gcc package name 2013-12-13 00:12:32 +01:00
xawotihs
89dcd6c71d Added some windows cross compiling of the Qt flavor. 2013-12-12 17:54:43 -05:00
Dmitry Panin
fd3cf574cf Remove previous tag "latest-master" before uploading new one 2013-12-12 21:08:39 +04:00
Dmitry Panin
f21452feec Fixed some Cards:
Rune-Tail, Kitsune Ascendant
Shifting Sky
Flourishing Defenses (thanks to Shadowfireomega)
2013-12-12 20:11:35 +04:00
Dmitry Panin
0f85471216 Enabled automatic releases for each commit in master 2013-12-12 02:20:14 +04:00
Tobias Loose
5d92553017 Fix bug where the phase wheel got out of sync
The phase wheel messures phases within another unit and not
mtg phases. It is important to map between those
2013-12-11 01:53:05 +01:00
xawotihs
f0e6d820c7 Fixed GuiPhaseBar logics. 2013-12-10 22:23:28 +01:00
xawotihs
545fc21260 Merge branch 'more_easing' of https://github.com/ZobyTwo/wagic into ZobyTwo-more_easing 2013-12-10 20:35:47 +01:00
Xawotihs
8b68568106 Merge pull request #585 from bjornsnoen/master
Added Avatar Tokens created by Ajani Goldmane.
2013-12-10 11:12:33 -08:00
xawotihs
739a5d9e2b Removed env traces and change the secure token as it was exposed. 2013-12-09 22:39:25 +01:00
Tobias Loose
4c627f74b6 Add easing to GuiPhaseBar, simplify math a bit. 2013-12-09 22:20:43 +01:00
Tobias Loose
1e610ff653 Add InQuadEasing and OutQuadEasing and make tasklists...
easing more natural
2013-12-09 22:20:43 +01:00
Tobias Loose
5d6557a49f Add easing to task list and fix a bug where
opening the task list a second time was not possible
2013-12-09 22:20:43 +01:00
xawotihs
7528329a58 Add more debug in travis script 2013-12-09 21:54:55 +01:00
xawotihs
c62597dce5 Add some debugging to Travis script 2013-12-09 21:43:26 +01:00
Xawotihs
d8dfcdba67 Merge pull request #583 from ZobyTwo/deck_viewer_1
Cleanup, usability fixes and source code documentation for DeckView.h and GridDeckView.h
2013-12-09 11:51:40 -08:00
Bjørn Snoen
7b5f00260b Added Avatar Tokens created by Ajani Goldmane. 2013-12-09 16:55:31 +01:00
Tobias Loose
f9dc551942 Fix logic error in grid view 2013-12-08 23:05:06 +01:00
Tobias Loose
718ceca919 Do not allow that the selection moves outside in grid view. 2013-12-08 22:43:03 +01:00
xawotihs
89fb76a8e7 Updated scripts to remove any modified artifacts from Res directory.
Not doing it causes side effects on the testsuite.
2013-12-08 12:16:25 +01:00
Tobias Loose
1cc65ab611 Enable rotating over multiple filters, add src code doc 2013-12-08 12:03:13 +01:00
xawotihs
3b22354ad9 Fixed testsuite 2013-12-08 11:36:18 +01:00
Tobias Loose
2b9977a334 Rename methods for consistency and add source code doc
to DeckView.h
2013-12-08 10:48:15 +01:00
Tobias Loose
12c5f31562 Add a buttonMode to grid view to enable it on pointerless devices. 2013-12-08 09:11:44 +01:00
xawotihs
8cfd887375 Fixed upload script 2013-12-08 01:10:29 +01:00
xawotihs
292bf7b1d2 Merge branch 'ci_upload_binaries' 2013-12-08 00:33:42 +01:00
xawotihs
4041fe690b Create a release and parse its ID using jq. 2013-12-08 00:16:52 +01:00
xawotihs
cb73e2b90d Merge branch 'master' into ci_upload_binaries
Fixed Windows compilation.
2013-12-07 22:08:54 +01:00
ZobyTwo
a1fa36a934 Merge pull request #578 from ZobyTwo/deck_viewer_1
Reset positions and filters when reopening the editor. These changes are trivial so I will merge them.
2013-12-07 11:53:16 -08:00
Tobias Loose
bdd0e6c042 Reset positions and filters when reopening the editor 2013-12-07 20:47:50 +01:00
xawotihs
ee217e94a8 Fixed carousel pull request with Visual Studio. 2013-12-07 20:29:42 +01:00
xawotihs
38e19f7d35 Removed mingw32-qt
Merged SDL and QT .pro files
Removed glu dependency in corewrapper and JGfx to enable mingw cross compilation.
2013-12-07 18:57:57 +01:00
xawotihs
0bbfd00d15 Tries to install mingw32-qt on Travis 2013-12-07 18:31:02 +01:00
Tobias Loose
aaceb3c038 Remove unused declaration 2013-12-07 13:33:16 +01:00
Tobias Loose
5efa7e10bd Remove test debug output. Fix HUD fading. 2013-12-07 13:01:14 +01:00
Tobias Loose
14c164364e Cleanups and state reduction.
This mainly moves datamembers around and tries to avoid caching of
results of calculations when the calculations are cheap.
2013-12-07 12:58:20 +01:00
Tobias Loose
4514725aba Make the eased value a reference and add source code doc to Easing.h
This allows to apply multiple easings to the same variable.
2013-12-07 10:05:26 +01:00
Tobias Loose
2b0f50bb88 Remove redundancy and make control flow a bit simpler 2013-12-07 09:04:24 +01:00
xawotihs
a65fc0c0f0 Merge branch 'master' into ci_upload_binaries
sudo pip installation of pyjavaproperties
2013-12-06 22:52:32 +01:00
xawotihs
99db363253 Uses pip to install pyjavaproperties 2013-12-06 22:41:09 +01:00
xawotihs
c25dfec67e Fixed python module installation 2013-12-06 22:17:19 +01:00
xawotihs
dd7210d187 Install pyjavaproperties in travis. 2013-12-06 21:59:29 +01:00
xawotihs
904b7a6d86 Build and upload core resource package 2013-12-06 21:21:01 +01:00
Tobias Loose
31b353c5ec Use easing within the carousel view sliding 2013-12-06 21:04:21 +01:00
Tobias Loose
0d350af1b6 Use easing within the carousel views scrolling
It is visible if you scroll more than one card
2013-12-06 20:51:18 +01:00
xawotihs
3bc9c93bab Build and upload PSP binary archive. 2013-12-06 20:40:02 +01:00
Tobias Loose
2002bb4e16 Fix crash that occured when opening the editor a second time 2013-12-06 20:13:30 +01:00
Tobias Loose
7e9c4ddbdd Fix logic error in optimization introduced in last commit 2013-12-06 19:53:38 +01:00
Tobias Loose
12b71de63c Render small cards as thumbnails 2013-12-06 19:51:42 +01:00
Tobias Loose
15011961f4 Do only prefetch cards if resource management is threaded 2013-12-06 16:43:09 +01:00
xawotihs
b851103711 Commented out the release creation and refered an existing release instead. 2013-12-06 00:47:24 +01:00
xawotihs
67b8af8d15 Merge branch 'ci_upload_binaries' of https://github.com/WagicProject/wagic into ci_upload_binaries 2013-12-06 00:41:16 +01:00
xawotihs
8100e390b1 I'm starting to understand the stuff, the upload only works with a releaseId... 2013-12-06 00:10:36 +01:00
Tobias Loose
72e6876001 Remove temporary and binary files 2013-12-05 23:57:03 +01:00
Tobias Loose
96aeaffa1b Style and logic error. 2013-12-05 23:33:43 +01:00
xawotihs
74faa35b91 Removed useless local file copy before upload. 2013-12-05 23:27:40 +01:00
Tobias Loose
8bb58ca3b1 Put boilerplate code into easing base class 2013-12-05 23:27:28 +01:00
Tobias Loose
93d1a637b6 Style guide 2013-12-05 23:22:50 +01:00
xawotihs
30e86ffcd8 Update script to handle better variables. 2013-12-05 23:09:06 +01:00
Tobias Loose
cbe6c0c842 Parameterize animations in grid deck view 2013-12-05 23:06:32 +01:00
Tobias Loose
77eb7f2777 Add missing header 2013-12-05 23:06:32 +01:00
Tobias Loose
077ab10c05 Rename Button to ButtonPressed 2013-12-05 23:06:32 +01:00
Tobias Loose
1194463349 Let the deck view base class handle buttons 2013-12-05 23:06:32 +01:00
Tobias Loose
8de50532f2 Put easing code into Easing.h. Add easing to sliding 2013-12-05 23:06:31 +01:00
Tobias Loose
334454655d Add Easing code to make scrolling in grid view more fluid 2013-12-05 23:06:31 +01:00
Tobias Loose
d8d52e185d Add another missing include 2013-12-05 23:06:31 +01:00
Tobias Loose
9f1d225259 Add additional source files to various build systems 2013-12-05 23:06:30 +01:00
Tobias Loose
0c72bfd4c4 Make deck views toggleable 2013-12-05 23:06:30 +01:00
Tobias Loose
55e0366f19 Move griddeckview implementation into source file 2013-12-05 23:06:30 +01:00
Tobias Loose
667b95f2b8 Refactor gamestatedeckviewer and add a grid view suited...
for bigger screens.
2013-12-05 23:06:30 +01:00
Tobias Loose
e90f6fe224 Whitespaces and add button to toggle griv/scrolling view 2013-12-05 23:06:30 +01:00
Tobias Loose
2289fffb8d Do not ftbfs when in release mode (-weror, -wunused-.. combination) 2013-12-05 23:06:30 +01:00
xawotihs
826403a512 Fixed upload shell script 2013-12-05 22:44:02 +01:00
xawotihs
35fec3d9a0 Made upload-binaries executable 2013-12-05 22:05:31 +01:00
xawotihs
e9eb86488e Redirect ant update errors to a file and push correct upload-binaries.sh 2013-12-05 21:43:29 +01:00
xawotihs
ae97abbf96 Activates an automatic pre-release and binary upload from Travis. 2013-12-05 21:21:08 +01:00
Xawotihs
a8391112b0 Merge pull request #576 from ZobyTwo/directories_1
Do not specify the system directory in JGE
2013-12-04 13:07:05 -08:00
Rolzad73
4257592568 Updated output of info about Android APIs 2013-12-04 12:58:22 -05:00
Tobias Loose
657479e0e4 Do not specify the system directory in JGE 2013-12-04 11:58:36 +01:00
Dmitry Panin
9e969881fd Added output of info about Android APIs 2013-12-04 12:04:54 +04:00
Dmitry Panin
2b434a7182 Merge pull request #575 from WagicProject/android_travis_sdk_downgrade
Changed Travis build file to use Android API 10 and Android build tools 18.1.1
2013-12-04 00:02:49 -08:00
Rolz73
d2e41f98c3 Changed Travis build file to use Android API 10 and Android build tools 18.1.1 2013-12-03 02:36:11 -05:00
Xawotihs
318fc98a39 Merge pull request #574 from WagicProject/feature/play-from-grave
Feature/play from grave
2013-12-02 12:34:52 -08:00
Dmitry Panin
b7a4b7f6b9 Fixing Yawgmoth's will 2013-12-02 21:26:55 +04:00
Dmitry Panin
ed03fb744d Added [Yawgmoth's Will] 2013-12-02 13:42:31 +04:00
Dmitry Panin
02be213d1e Test for keyword "CanPlayFromGraveyard"
Also added card [Crucible of Worlds] as example of it.
2013-12-02 04:36:58 +04:00
Dmitry Panin
0d4db9ee54 Fixed bug in alternative cost when playing lands 2013-12-02 04:33:39 +04:00
Dmitry Panin
ae927576c5 Draft of new feature: canplayfromgraveyard
this will allow playing cards from graveyard
examples: tbd
2013-12-02 04:20:04 +04:00
Dmitry Panin
f08ddac77b Fixed formatting 2013-12-02 04:16:25 +04:00
xawotihs
746a486e7a Added some comments for the redo tests. 2013-11-30 23:39:29 +01:00
xawotihs
261a6e4780 Merge branch 'master' into minmax 2013-11-30 23:10:24 +01:00
Dmitry Panin
9effa7c975 Slightly changed formatting while investigating src 2013-12-01 01:01:57 +04:00
Dmitry Panin
a70259b5ba Fixed: Assembly-Worker didn't appear as creature type
For artifact creatures the parent type TYPE_ARTIFACT was used
and therefore that creature's subtype wasn't added in full list.
2013-12-01 00:59:16 +04:00
xawotihs
bf0a0a1580 Build the graphics version in release instead of debug. 2013-11-30 19:32:55 +01:00
xawotihs
eb8b22b2d5 Merge branch 'master' of https://github.com/WagicProject/wagic 2013-11-30 12:21:43 +01:00
xawotihs
4095676b6b Fixed memory leak introduced in #555 2013-11-29 22:07:45 +01:00
xawotihs
bedd1e8da8 Merge branch 'valgrind' of https://github.com/ZobyTwo/wagic into ZobyTwo-valgrind 2013-11-29 19:41:46 +01:00
xawotihs
965d4f6d45 Fixes Windows project 2013-11-29 19:31:23 +01:00
Tobias Loose
0db2925e7a Fix initialization orders 2013-11-29 18:44:30 +01:00
Tobias Loose
031f2dbffb Fix Valgrind warnings appearing during the test suit. 2013-11-29 18:21:53 +01:00
Tobias Loose
dbece750f8 Use tabs instead of spaces if the file uses tabs 2013-11-29 13:51:13 +01:00
Tobias Loose
6699902c24 Add TIXML_USE_STL to android builds 2013-11-29 13:34:44 +01:00
Tobias Loose
e8407caa2a Add TIXML_USE_STL compiler flag to psp makefile to make headers compatible 2013-11-29 13:34:35 +01:00
Tobias Loose
69c6745f53 Make getMenuText() return string. 2013-11-29 13:33:33 +01:00
Tobias Loose
6f083389c2 Speedup MTGAllCards::countByType a bit 2013-11-29 11:51:58 +01:00
Tobias Loose
9ee44ca091 Substitute more char arrays with strings 2013-11-29 11:51:22 +01:00
Tobias Loose
3f0dd987f0 Remove bool CardInstance::hasSubtype(const char * _subtype)
There exists bool CardInstance::hasSubtype(const string& _subtype) and the
const char* version converts _subtype into string deeper in the call
hierarchy anyway. So both methods did the same.
2013-11-29 11:43:59 +01:00
Tobias Loose
672b0be7bd Fix a few string bugs add StartsWith for strings 2013-11-29 11:38:49 +01:00
Tobias Loose
9d5a83d588 Replace more strcmp with std::string::compare or std::string::operator==.
This commit also enables TinyXML STL support.
2013-11-28 16:42:29 +01:00
Tobias Loose
5d0d130587 Make MTGGameZone::countByType use string instead of char*
and replace strcmp with std::string operator== calls.
2013-11-28 16:42:29 +01:00
Tobias Loose
c85d857604 Replace constness cast 2013-11-28 16:42:29 +01:00
Tobias Loose
f68568cc1e Replace strcmp with c++ equivalent when comparing std::strings. 2013-11-28 16:42:29 +01:00
Dmitry Panin
89206b3a6b Added testing that QT GUI build is successfull 2013-11-28 16:44:12 +04:00
Michael Nguyen
a8cff5ed8e Merge branch 'master' into develop 2013-11-28 02:19:41 -08:00
xawotihs
dc118c64b8 Fixed compilation on Mac 2013-11-27 23:04:46 +01:00
xawotihs
a43854420d Fixed compilation issue on Windows 2013-11-27 20:33:59 +01:00
xawotihs
a695323bc7 Merge pull request #564 from ZobyTwo/cleanup_1
Add a few namespaces and fix header guards.
2013-11-25 15:42:18 -08:00
xawotihs
02a65ecd82 Merge branch 'cleanup_1' of https://github.com/ZobyTwo/wagic into ZobyTwo-cleanup_1 2013-11-26 00:17:48 +01:00
xawotihs
9ff087ecde Merge pull request #570 from WagicProject/android-travis-ci
Android travis ci
2013-11-25 14:31:15 -08:00
xawotihs
47685f4892 Added installation of 32 bits libs to make Android SDK work. 2013-11-25 22:42:09 +01:00
xawotihs
7aaebdc661 Merge branch 'android_build_fix' into android-travis-ci 2013-11-25 21:23:58 +01:00
Rolzad73
8aa0b8cea0 reverting sdk.buildtools change 2013-11-25 13:41:07 -05:00
Rolzad73
fac44c4b48 - updated AndroidManifest.xml to match desired API values.
- removed CardEffect.cpp reference from Android.mk build file.
- added sdk.buildtools=18.1.1 line to default.properties and project.properties
- updated .gitignore
2013-11-25 11:54:19 -05:00
Dmitry Panin
9889186eab Added missing "echo" statement 2013-11-25 13:41:29 +04:00
xawotihs
73f9319b92 Activates Android build from Travis 2013-11-25 05:27:31 +01:00
xawotihs
fd6bc95539 Merge pull request #562 from citiral/master
Updated deckmenu.cpp to properly render deck description and summary
2013-11-24 10:28:05 -08:00
Tobias Loose
0bb211a581 Remove unused global variables from DeckStats.cpp and add proper...
member variable initialization.
2013-11-24 09:18:34 +01:00
Tobias Loose
e0428ac7b0 Avoid more conflicts. We could now do unit builds...
and make the linker put every data element and function into its own section.
On linktime, we can output every discarded section and get a list of dead
code (for that build).
2013-11-23 17:04:24 +01:00
Tobias Loose
3e94de985f Add more include guards 2013-11-23 16:25:14 +01:00
Tobias Loose
9f0b70d1c9 Put constans into extra namespace as kBackToMainMenuID...
collides with itself. GameStateAwards::kBackToMainMenuID and
GameStateOptions::kBackToMainMenuID define those with different
values.
2013-11-23 16:18:45 +01:00
Tobias Loose
1e8fc81aa3 Add/fix broken include guards 2013-11-23 16:09:11 +01:00
Tobias Loose
352e3c2daa Remove makros and add undefs to avoid clashing names
FRAND and Clamp were not used and Clamp collided when doing unit builds.
SQUARE(x) is longer than x*x and if x is an expression it gets evaluated
twice.
2013-11-23 16:03:04 +01:00
Dmitry Panin
678a4734bb Merge pull request #560 from ZobyTwo/dead_code
Remove some dead code
2013-11-22 00:09:40 -08:00
Dmitry Panin
052e3abdb8 Small fix in match_and ( [-color1; -color2] was handled incorrectly ) 2013-11-22 01:03:07 +04:00
citiral
73c2d17080 Updated deckmenu.cpp to properly render deck description and summary
Deck description and statistics were being drawn as black text, this made it invisible as it was rendered over a black background. I made it change the color to white before drawing, so its shown as its suposed to be.(Did the default text color change?)
2013-11-21 20:38:41 +01:00
Dmitry Panin
ffbb228d2d Fixed wrong activation cost in dragon hatchling 2013-11-21 14:25:01 +04:00
Dmitry Panin
306765c6b6 Merge pull request #561 from ZobyTwo/valgrind
Fix some valgrind memcheck warnings. However there remains one...

... within the threaded texture cache. Once it is resized, some textures
in GetQuad(...) (WCachedResource.cpp:102/103) have uninitialized widths/heights.
2013-11-21 01:58:49 -08:00
Tobias Loose
3cee80e3bc Delete another unused file (GuiMessageBox.cpp) 2013-11-20 14:01:59 +01:00
Tobias Loose
8209716fc9 Remove unused file 2013-11-20 13:53:15 +01:00
Tobias Loose
e76c57d747 Fix some valgrind memcheck warnings. However there remains one...
... within the threaded texture cache. Once it is resized, some textures
in GetQuad(...) (WCachedResource.cpp:102/103) have uninitialized widths/heights.
2013-11-20 12:56:33 +01:00
Tobias Loose
9c282aeb56 Remove CardEffect.o from Makefile 2013-11-20 12:02:33 +01:00
Tobias Loose
bbc310dec7 Remove some dead code 2013-11-20 11:43:27 +01:00
Dmitry Panin
a37af1776a Merge pull request #557 from ZobyTwo/defines
Defines/Typos
2013-11-20 02:34:32 -08:00
Tobias Loose
35697a65b4 Use style guide 2013-11-20 11:13:35 +01:00
Tobias Loose
6bed1666be Merge branch 'master' into defines 2013-11-20 11:06:41 +01:00
Tobias Loose
f021866368 Merge remote-tracking branch 'wp/master' 2013-11-20 11:06:28 +01:00
xawotihs
d7e527166c Merge branch 'show-output-only-for-failing-tests' 2013-11-19 11:14:41 +01:00
xawotihs
a683f5a2b7 Some preliminary work for minmax 2013-11-19 11:09:39 +01:00
Dmitry Panin
071a487100 Fixed compilation error 2013-11-19 11:06:31 +04:00
Dmitry Panin
f370899a8a Thread-safe version of OutputCapturer 2013-11-19 03:58:43 +04:00
Dmitry Panin
331e126787 Added info about total number of tests 2013-11-19 02:57:42 +04:00
Dmitry Panin
6c41e5c92c Added option (#define CAPTURE_STDERR)
if set then the DebugTrace calls only for failing tests are shown
2013-11-19 02:41:30 +04:00
Tobias Loose
82e3ab3977 Merge branch 'cleanup' into defines
Merge cleanup codings style commit as i accidentally used that branch as
the base.
2013-11-17 21:06:56 +01:00
Tobias Loose
f2314ca673 Use proposed coding style 2013-11-17 21:05:07 +01:00
Tobias Loose
94c3ac9ad9 Fix FTBFS 2013-11-17 21:02:08 +01:00
Tobias Loose
5419d87e4e Get rid of two more define groups. 2013-11-17 20:22:03 +01:00
Tobias Loose
e1213d1c1f Remove variables flagged for removal (via conditional TODO comment)
x and y is provided by PlayGuiObject::Pos.
2013-11-17 19:50:17 +01:00
Tobias Loose
446ed20758 Fix typo ActionLayer::receiveEventPlus(...)
This method is rarely used, however it returned 0 after adding stuff.
It now returns the sum.
2013-11-17 19:39:46 +01:00
Tobias Loose
7a48c5e087 Fix some cppcheck warnings (mostly style and postfix vs prefix iteration) 2013-11-17 19:36:24 +01:00
Tobias Loose
3ca2f1c1ed Replace defines in Damage.h with enums. 2013-11-17 17:12:58 +01:00
Tobias Loose
146872797b ActionElement.h: Replace defines, remove superfluous ";"
Defines do not follow scope rules, but enums do. Enum classes
even utilize strong type checking (but i am not sure about compiler
support for c++11 on all target platforms).
2013-11-17 16:08:29 +01:00
Tobias Loose
c6dc51c7d3 Simplify Damage::resolve a bit 2013-11-17 15:37:56 +01:00
Dmitry Panin
0ef92d154a Merge pull request #555 from WagicProject/fix-cranial-plating
Fix cranial plating
2013-11-16 13:58:56 -08:00
Dmitry Panin
2835bdf767 Fixed issue with Cranial Plating.
Issue
	attach then equip: plating will give bonus to both creatures
Fix
	Changed "attach" to "retarget target(creature|mybattlefield)"
	as this doesnot admit this bug
	Attach should become deprecated in future
2013-11-17 01:49:51 +04:00
Dmitry Panin
afc903e31b Added different names for attach and equip
+ moved implementation of AEquip to .cpp
2013-11-17 00:44:37 +04:00
Dmitry Panin
6294bb1eed Added Master of Waves 2013-11-16 23:54:37 +04:00
xawotihs
9f16b2208d Removes the error, it was perfectly detected by Travis CI. 2013-11-09 20:15:00 +01:00
xawotihs
0a765b702b Introducing an error to check if Travis reports correctly a compile
error with the script.
2013-11-09 20:01:57 +01:00
xawotihs
82de6f2840 Fixes stupid typo. 2013-11-09 19:51:47 +01:00
xawotihs
90652fa73d Fixed PSP build and integrates it with Travis CI 2013-11-09 19:40:01 +01:00
Rolzad73
e8c73aaf9d Merge pull request #1 from WagicProject/android_cleanup
Android cleanup
2013-11-07 13:15:41 -08:00
Rolzad73
f95094a429 removing commented lines I had intended to delete outright 2013-11-07 15:56:43 -05:00
Rolzad73
7a57de6608 removed ads on Android version 2013-11-07 15:49:53 -05:00
Rolzad73
14c2d522c2 removed Android gen dir 2013-11-07 15:04:37 -05:00
Dmitry Panin
6bf2147d94 From the Vault: Twenty
// imported accidental commit from svn repo
2013-11-06 12:56:54 +04:00
xawotihs
fea5b04a77 Fixed compilation on Windows. 2013-10-31 23:48:19 +01:00
xawotihs
ea98b769a7 Merge branch 'develop'
Activates full testsuite run in Travis CI. Travis will complain as soon as at least one testcase does not pass successfully after a new commit.
2013-10-30 23:10:03 +01:00
xawotihs
017f6dd1ed Deactivated part of the traces outputted by the testsuite to make Travis
happy.
2013-10-30 22:58:04 +01:00
xawotihs
784d127a6e I think I got it ... messy / not appearing at the end of folders in the
travis linux where it appears fine on mine :(
2013-10-30 22:28:09 +01:00
xawotihs
f6c47b85e3 More debug 2013-10-30 22:02:43 +01:00
xawotihs
dac31994b6 Adding traces for important directories. 2013-10-30 21:44:23 +01:00
xawotihs
74280aef1d Added some traces in the primitives and sets loading. 2013-10-30 20:50:34 +01:00
xawotihs
8013d09e4f Reactivated wagic console in travis CI 2013-10-30 20:30:33 +01:00
Dmitry Panin
6bbe290762 Fixed bug with syncopate to consume all the mana available
Now pay[[{x}]] is not supported because of this.
use "pay[[{value:storedx}]]" instead
2013-10-30 12:39:08 +04:00
xawotihs
57c9940244 Deactivated testsuite from travis, resources are not loaded correctly. 2013-10-30 00:38:34 +01:00
xawotihs
db1c552321 Tries to work around crash of the testsuite in Travis. 2013-10-30 00:20:58 +01:00
xawotihs
f08f0ad3b9 Merge branch 'master' of https://github.com/WagicProject/wagic
Conflicts:
	JGE/include/JTypes.h
2013-10-29 23:36:07 +01:00
xawotihs
a3a1bc2b79 Created a dedicate console Qt based wagic application and run it in the
travis file.
2013-10-29 22:38:37 +01:00
Dmitry Panin
9037699281 Added missing test for syncopate + 2 tests for spell_rupture 2013-10-29 19:49:31 +04:00
Michael Nguyen
8d66f82179 Merge branch 'release/wagic-v0.19.2' 2013-10-28 16:19:28 -07:00
Michael Nguyen
b17d9d3f85 Merge branch 'master' of github.com:WagicProject/wagic 2013-10-28 15:35:45 -07:00
Michael Nguyen
c5190a62cd Merge branch 'develop' 2013-10-28 15:35:18 -07:00
229 changed files with 22194 additions and 3429 deletions

View File

@@ -1,2 +1,60 @@
language: cpp
script: "qmake projects/mtg/wagic-qt.pro CONFIG+=testsuite CONFIG+=debug && make -j 8"
branches:
except:
- latest-master
before_install:
- 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:
- 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
- sudo pip install github3.py
- sudo pip install cpp-coveralls
env:
global:
- 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
View 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

View File

@@ -73,7 +73,7 @@
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SDL_CONFIG;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -101,7 +101,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SDL_CONFIG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
@@ -129,7 +129,7 @@
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SDL_CONFIG;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>

View File

@@ -31,6 +31,7 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
CXXFLAGS = -W -Wall -Werror -Wno-unused
CXXFLAGS += -DTIXML_USE_STL
ifdef DEBUG
CXXFLAGS += -ggdb3

View File

@@ -4,6 +4,8 @@
// dirty, but I get OS header includes this way
#include "JGE.h"
#include "OutputCapturer.h"
#include <ostream>
#include <iostream>
#include <iomanip>
@@ -29,12 +31,23 @@ std::string ToHex(T* pointer)
#if defined (WIN32) || defined (LINUX)
#ifdef QT_CONFIG
#ifdef CAPTURE_STDERR
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
qDebug("%s", stream.str().c_str()); \
stream << inString; \
OutputCapturer::add(stream.str()); \
}
#else // CAPTURE_STDERR
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString; \
qDebug("%s", stream.str().c_str()); \
}
#endif // CAPTURE_STDERR
#elif defined (ANDROID)
#include <android/log.h>
#define DebugTrace(inString) \
@@ -48,7 +61,7 @@ std::string ToHex(T* pointer)
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
OutputDebugString(stream.str().c_str()); \
OutputDebugStringA(stream.str().c_str()); \
}
#endif // QT_CONFIG
#endif // Win32, Linux

128
JGE/include/Downloader.h Normal file
View 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&currentSize) {
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

View File

@@ -297,7 +297,6 @@ public:
private:
float mTimer;
float mFrameTime;
JAnimator* mAnimator;
vector<JAnimatorObject *> mObjects;
};

View File

@@ -37,7 +37,6 @@ private:
float mTexY;
float mTexWidth;
float mTexHeight;
JTexture* mTexture;
JQuad* mQuad;

View File

@@ -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

View File

@@ -44,6 +44,17 @@ typedef WPARAM LocalKeySym;
#include <X11/keysym.h>
typedef KeySym LocalKeySym;
#define LOCAL_KEY_NONE XK_VoidSymbol
#undef Status
#undef Bool
#undef None
#undef CursorShape
#undef KeyPress
#undef KeyRelease
#undef FocusIn
#undef FocusOut
#undef FontChange
#undef Unsorted
#undef GrayScale
#elif defined(ANDROID) // This is temporary until we understand how to send real key events from Java
typedef long unsigned int LocalKeySym;

View File

@@ -578,7 +578,7 @@ private:
#if (!defined PSP)
GLuint mCurrentTex;
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)
#if ((defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)) && (!defined CONSOLE_CONFIG)
// MVP matrix
ESMatrix theMvpMatrix;

View File

@@ -23,29 +23,32 @@
#include "SLES/OpenSLES_Android.h"
#elif defined USE_PHONON
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#else
#ifdef WIN32
#include <windows.h>
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#elif (defined QT_CONFIG)
#include "QMediaPlayer"
#include "QMediaPlaylist"
#include "QSoundEffect"
#elif defined WIN32
#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"
#endif
#include "../Dependencies/include/fmod.h"
#endif
//------------------------------------------------------------------------------------------------
@@ -68,7 +71,7 @@ public:
#ifdef USE_PHONON
Phonon::AudioOutput* mOutput;
Phonon::MediaObject* mMediaObject;
public slots:
public slots:
void seekAtTheBegining();
#elif defined (PSP)
JMP3* mTrack;
@@ -83,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
@@ -93,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;
@@ -134,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

View File

@@ -75,6 +75,23 @@ enum {
#define SCREEN_HEIGHT_F 272.0f
#ifdef CONSOLE_CONFIG
#define DEFAULT_BLEND 0
#define BLEND_OPTION_ADD 0
#define BLEND_OPTION_BLEND 0
#define BLEND_ZERO 0
#define BLEND_ONE 0
#define BLEND_SRC_COLOR 0
#define BLEND_ONE_MINUS_SRC_COLOR 0
#define BLEND_SRC_ALPHA 0
#define BLEND_ONE_MINUS_SRC_ALPHA 0
#define BLEND_DST_ALPHA 0
#define BLEND_ONE_MINUS_DST_ALPHA 0
#define BLEND_DST_COLOR 0
#define BLEND_ONE_MINUS_DST_COLOR 0
#define BLEND_SRC_ALPHA_SATURATE 0
#define GU_PSM_5551 0
#else
#ifdef WIN32
// #define DEFAULT_BLEND BLEND_DEFAULT
// #define BLEND_OPTION_ADD BLEND_COLORADD
@@ -84,9 +101,10 @@ enum {
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#endif
#endif // CONSOLE_CONFIG
#if (defined WIN32) && (!defined LINUX)
#include <windows.h>
#include <windows.h>
#endif
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
typedef uint8_t byte;
@@ -97,8 +115,21 @@ typedef bool BOOL;
#endif
#endif
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
#define PIXEL_TYPE DWORD
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#ifndef PSP
#define TEXTURE_FORMAT 0
#endif //PSP
#ifndef CONSOLE_CONFIG
#ifndef QT_CONFIG
#if defined (IOS)
#import <OpenGLES/ES2/gl.h>
@@ -113,7 +144,7 @@ typedef bool BOOL;
#include <GL/glu.h>
#endif
#else
# include <QtOpenGL>
#include <QtOpenGL>
#endif
#if (defined FORCE_GLES)
@@ -127,14 +158,12 @@ typedef bool BOOL;
#endif
#if defined (PSP)
#ifndef ABGR8888
#define ABGR8888
#endif
#if defined (ABGR8888)
#define PIXEL_TYPE u32
#ifndef ARGB
#define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format
#endif
@@ -215,13 +244,6 @@ typedef struct
#else //non PSP
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
#define BLEND_ZERO GL_ZERO
#define BLEND_ONE GL_ONE
@@ -235,44 +257,16 @@ typedef uint32_t u32;
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#define TEXTURE_FORMAT 0
#define GU_PSM_8888 0
#define GU_PSM_5551 0
#define GU_PSM_4444 0
#define GU_PSM_5650 0
#define PIXEL_TYPE DWORD
#define GU_PSM_8888 0
#define GU_PSM_5551 0
#define GU_PSM_4444 0
#define GU_PSM_5650 0
#endif
typedef enum Buttons
{
JGE_BTN_NONE = 0, // No button pressed
JGE_BTN_QUIT, // Home on PSP
JGE_BTN_MENU, // Start on PSP
JGE_BTN_CTRL, // Select
JGE_BTN_POWER, // Hold
JGE_BTN_SOUND, // Music note
JGE_BTN_RIGHT,
JGE_BTN_LEFT,
JGE_BTN_UP,
JGE_BTN_DOWN,
JGE_BTN_OK, // Circle in Japan, Cross in Europe
JGE_BTN_CANCEL, // Triangle
JGE_BTN_PRI, // Square (primary)
JGE_BTN_SEC, // Cross or Circle (secondary)
JGE_BTN_PREV, // Left trigger
JGE_BTN_NEXT, // Right trigger
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
} JButton;
#else
typedef uint32_t GLuint;
typedef float GLfloat;
#endif //CONSOLE_CONFIG
//------------------------------------------------------------------------------------------------
struct Vertex
@@ -542,5 +536,28 @@ public:
};
typedef enum Buttons
{
JGE_BTN_NONE = 0, // No button pressed
JGE_BTN_QUIT, // Home on PSP
JGE_BTN_MENU, // Start on PSP
JGE_BTN_CTRL, // Select
JGE_BTN_POWER, // Hold
JGE_BTN_SOUND, // Music note
JGE_BTN_RIGHT,
JGE_BTN_LEFT,
JGE_BTN_UP,
JGE_BTN_DOWN,
JGE_BTN_OK, // Circle in Japan, Cross in Europe
JGE_BTN_CANCEL, // Triangle
JGE_BTN_PRI, // Square (primary)
JGE_BTN_SEC, // Cross or Circle (secondary)
JGE_BTN_PREV, // Left trigger
JGE_BTN_NEXT, // Right trigger
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
} JButton;
#endif

View File

@@ -0,0 +1,23 @@
#ifndef OUTPUTCAPTURER_H
#define OUTPUTCAPTURER_H
#if defined(QT_CONFIG)
#include <Qt>
#include <string>
#include <sstream>
#include "Threading.h"
class OutputCapturer
{
private:
static std::ostringstream stream;
static boost::mutex mMutex;
public:
static void add(const std::string& s);
static void debugAndClear();
static void clear();
};
#endif
#endif // OUTPUTCAPTURER_H

View File

@@ -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>
@@ -315,7 +315,6 @@ namespace boost
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include "../include/DebugRoutines.h"
#include "../include/JLogger.h"
namespace boost
@@ -538,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

View File

@@ -3,15 +3,6 @@
#include <math.h>
/*************************** Macros and constants ***************************/
// returns a number ranging from -1.0 to 1.0
#define FRAND (((float)rand()-(float)rand())/RAND_MAX)
#define Clamp(x, min, max) x = (x<min ? min : x<max ? x : max);
#define SQUARE(x) (x)*(x)
struct Vector3D
{
Vector3D(float x, float y, float z) : x(x), y(y), z(z) {}
@@ -63,7 +54,7 @@ struct Vector3D
float Length()
{
float length = (float)sqrt(SQUARE(x) + SQUARE(y) + SQUARE(z));
float length = sqrt(x*x + y*y + z*z);
return (length != 0.0f) ? length : 1.0f;
}

View File

@@ -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
View 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;
}

View File

@@ -67,7 +67,7 @@ bool JAnimator::Load(const char* scriptFile)
element = script->ToElement();
printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name"));
const char *type[] =
string type[] =
{
"ANIMATION_TYPE_LOOPING",
"ANIMATION_TYPE_ONCE_AND_STAY",
@@ -78,7 +78,7 @@ bool JAnimator::Load(const char* scriptFile)
const char* aniType = element->Attribute("type");
for (int i=0;i<5;i++)
if (strcmp(type[i], aniType)==0)
if (type[i] == aniType)
{
SetAnimationType(i);
break;
@@ -108,7 +108,7 @@ bool JAnimator::Load(const char* scriptFile)
element = param->ToElement();
if (element != NULL)
{
if (strcmp(element->Value(), "settings")==0)
if (element->ValueStr() == "settings")
{
const char* quadName = element->Attribute("quad");
JQuad* quad = mResource->GetQuad(quadName);

View File

@@ -16,9 +16,9 @@ User folder is the only one that is really needed to guarantee both read and wri
The content that users should not be touching.
*/
#if defined(ANDROID)
#include "../../include/PrecompiledHeader.h"
#endif
#ifndef PSP
#include "PrecompiledHeader.h"
#endif //PSP
#ifdef WIN32
#pragma warning(disable : 4786)
@@ -34,6 +34,10 @@ The content that users should not be touching.
#include "../include/JLogger.h"
#include <dirent.h>
#ifdef QT_CONFIG
#include <QDir>
#endif
JFileSystem* JFileSystem::mInstance = NULL;
JZipCache::JZipCache()
@@ -121,13 +125,18 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
DebugTrace("User path " << userPath);
#elif defined (QT_CONFIG)
QDir dir(QDir::homePath());
dir.cd(USERDIR);
QDir sysDir("projects/mtg/bin/Res");
QDir sysDir(RESDIR);
QDir dir(QDir::homePath());
dir.mkdir(USERDIR);
dir.cd(USERDIR);
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
DebugTrace("Current path " << QDir::currentPath().toStdString());
#else
//Find the Res.txt file and matching Res folders for backwards compatibility
ifstream mfile("Res.txt");
@@ -239,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
@@ -304,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)
@@ -544,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)

506
JGE/src/JGfx-fake.cpp Normal file
View File

@@ -0,0 +1,506 @@
//-------------------------------------------------------------------------------------
//
// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows.
#include "../../include/JGE.h"
#include "../../include/JRenderer.h"
#include "../../include/JResourceManager.h"
#include "../../include/JFileSystem.h"
#include "../../include/JAssert.h"
JQuad::JQuad(JTexture *tex, float x, float y, float width, float height)
:mTex(tex), mX(x), mY(y), mWidth(width), mHeight(height)
{
JASSERT(tex != NULL);
JRenderer::GetInstance()->TransferTextureToGLContext(*tex);
mHotSpotX = 0.0f;
mHotSpotY = 0.0f;
//mBlend = BLEND_DEFAULT;
for (int i=0;i<4;i++)
mColor[i].color = 0xFFFFFFFF;
mHFlipped = false;
mVFlipped = false;
SetTextureRect(x, y, width, height);
}
void JQuad::SetTextureRect(float x, float y, float w, float h)
{
mX = x;
mY = y;
mWidth = w;
mHeight = h;
if(mTex)
{
mTX0 = x/mTex->mTexWidth;
mTY0 = y/mTex->mTexHeight;
mTX1 = (x+w)/mTex->mTexWidth;
mTY1 = (y+h)/mTex->mTexHeight;
}
}
void JQuad::GetTextureRect(float *x, float *y, float *w, float *h)
{
*x=mX; *y=mY; *w=mWidth; *h=mHeight;
}
void JQuad::SetColor(PIXEL_TYPE color)
{
for (int i=0;i<4;i++)
mColor[i].color = color;
}
void JQuad::SetHotSpot(float x, float y)
{
mHotSpotX = x;
mHotSpotY = y;
}
//////////////////////////////////////////////////////////////////////////
JTexture::JTexture() : mWidth(0), mHeight(0), mBuffer(NULL)
{
mTexId = -1;
}
JTexture::~JTexture()
{
if (mBuffer)
{
delete [] mBuffer;
mBuffer = NULL;
}
}
void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits)
{
JRenderer::GetInstance()->BindTexture(this);
}
//////////////////////////////////////////////////////////////////////////
JRenderer* JRenderer::mInstance = NULL;
bool JRenderer::m3DEnabled = false;
void JRenderer::Set3DFlag(bool flag) { m3DEnabled = flag; }
JRenderer* JRenderer::GetInstance()
{
if (mInstance == NULL)
{
mInstance = new JRenderer();
JASSERT(mInstance != NULL);
mInstance->InitRenderer();
}
return mInstance;
}
void JRenderer::Destroy()
{
if (mInstance)
{
mInstance->DestroyRenderer();
delete mInstance;
mInstance = NULL;
}
}
JRenderer::JRenderer() : mActualWidth(SCREEN_WIDTH_F), mActualHeight(SCREEN_HEIGHT_F)
{
}
JRenderer::~JRenderer()
{
}
void JRenderer::InitRenderer()
{
mCurrentTextureFilter = TEX_FILTER_NONE;
mImageFilter = NULL;
mCurrTexBlendSrc = BLEND_SRC_ALPHA;
mCurrTexBlendDest = BLEND_ONE_MINUS_SRC_ALPHA;
// mLineWidth = 1.0f;
mCurrentTex = -1;
mFOV = 75.0f;
#ifdef USING_MATH_TABLE
for (int i=0;i<360;i++)
{
mSinTable[i] = sinf(i*DEG2RAD);
mCosTable[i] = cosf(i*DEG2RAD);
}
#endif
mCurrentRenderMode = MODE_UNKNOWN;
}
void JRenderer::DestroyRenderer()
{
}
void JRenderer::BeginScene()
{
}
void JRenderer::EndScene()
{
}
void JRenderer::BindTexture(JTexture *tex)
{
}
void JRenderer::EnableTextureFilter(bool flag)
{
if (flag)
mCurrentTextureFilter = TEX_FILTER_LINEAR;
else
mCurrentTextureFilter = TEX_FILTER_NEAREST;
mCurrentTex = -1;
}
void Swap(float *a, float *b)
{
float n=*a;
*a = *b;
*b = n;
}
void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float xScale, float yScale)
{
//yo = SCREEN_HEIGHT-yo-1;//-(quad->mHeight);
float width = quad->mWidth;
float height = quad->mHeight;
float x = -quad->mHotSpotX;
float y = quad->mHotSpotY;
Vector2D pt[4];
pt[3] = Vector2D(x, y);
pt[2] = Vector2D(x+width, y);
pt[1] = Vector2D(x+width, y-height);
pt[0] = Vector2D(x, y-height);
Vector2D uv[4];
uv[0] = Vector2D(quad->mTX0, quad->mTY1);
uv[1] = Vector2D(quad->mTX1, quad->mTY1);
uv[2] = Vector2D(quad->mTX1, quad->mTY0);
uv[3] = Vector2D(quad->mTX0, quad->mTY0);
if (quad->mHFlipped)
{
Swap(&uv[0].x, &uv[1].x);
Swap(&uv[2].x, &uv[3].x);
}
if (quad->mVFlipped)
{
Swap(&uv[0].y, &uv[2].y);
Swap(&uv[1].y, &uv[3].y);
}
BindTexture(quad->mTex);
yo = SCREEN_HEIGHT_F - yo;
}
void JRenderer::RenderQuad(JQuad* quad, VertexColor* pt)
{
for (int i=0;i<4;i++)
{
pt[i].y = SCREEN_HEIGHT_F - pt[i].y;
quad->mColor[i].color = pt[i].color;
}
Vector2D uv[4];
uv[0] = Vector2D(quad->mTX0, quad->mTY1);
uv[1] = Vector2D(quad->mTX1, quad->mTY1);
uv[2] = Vector2D(quad->mTX1, quad->mTY0);
uv[3] = Vector2D(quad->mTX0, quad->mTY0);
BindTexture(quad->mTex);
}
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color)
{
y = SCREEN_HEIGHT_F - y - height;
JColor col;
col.color = color;
}
void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color)
{
y = SCREEN_HEIGHT_F - y - height;
JColor col;
col.color = color;
}
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE* colors)
{
JColor col[4];
for (int i=0;i<4;i++)
col[i].color = colors[i];
FillRect(x, y, width, height, col);
}
void JRenderer::FillRect(float x, float y, float width, float height, JColor* colors)
{
y = SCREEN_HEIGHT_F - y - height;
}
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color)
{
// glLineWidth (mLineWidth);
JColor col;
col.color = color;
}
void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
{
}
void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
{
}
void JRenderer::ScreenShot(const char* filename __attribute__((unused)))
{
}
void JRenderer::TransferTextureToGLContext(JTexture& inTexture)
{
}
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
{
JTexture *tex = new JTexture();
return tex;
}
JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureFormat)
{
JTexture *tex = new JTexture();
return tex;
}
void JRenderer::EnableVSync(bool flag __attribute__((unused)))
{
// if (flag)
// hge->System_SetState(HGE_FPS, 60); // HGEFPS_VSYNC
// else
// hge->System_SetState(HGE_FPS, HGEFPS_UNLIMITED);
}
void JRenderer::ClearScreen(PIXEL_TYPE color)
{
}
void JRenderer::SetTexBlend(int src, int dest)
{
}
void JRenderer::SetTexBlendSrc(int src)
{
}
void JRenderer::SetTexBlendDest(int dest)
{
}
void JRenderer::Enable2D()
{
}
void JRenderer::Enable3D()
{ /* NOT USED
if (!m3DEnabled)
return;
if (mCurrentRenderMode == MODE_3D)
return;
mCurrentRenderMode = MODE_3D;
glViewport (0, 0, (GLsizei)SCREEN_WIDTH, (GLsizei)SCREEN_HEIGHT); // Reset The Current Viewport
glMatrixMode (GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity (); // Reset The Projection Matrix
gluPerspective (mFOV, (GLfloat)SCREEN_WIDTH/(GLfloat)SCREEN_HEIGHT, // Calculate The Aspect Ratio Of The Window
0.5f, 1000.0f);
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity (); // Reset The Modelview Matrix
glEnable (GL_DEPTH_TEST); */
}
void JRenderer::SetClip(int, int, int, int)
{// NOT USED
//glScissor(x, y, width, height);
}
void JRenderer::LoadIdentity()
{// NOT USED
//glLoadIdentity();
}
void JRenderer::Translate(float, float, float)
{// NOT USED
//glTranslatef(x, y, z);
}
void JRenderer::RotateX(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 1.0f, 0.0f, 0.0f);
}
void JRenderer::RotateY(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 0.0f, 1.0f, 0.0f);
}
void JRenderer::RotateZ(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 0.0f, 0.0f, 1.0f);
}
void JRenderer::PushMatrix()
{// NOT USED
//glPushMatrix();
}
void JRenderer::PopMatrix()
{// NOT USED
//glPopMatrix();
}
void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *vertices, int start, int count)
{
}
void JRenderer::SetFOV(float fov)
{
mFOV = fov;
}
void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
{
}
void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
{
}
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, float lineWidth, PIXEL_TYPE color)
{
float dy=y2-y1;
float dx=x2-x1;
if(dy==0 && dx==0)
return;
float l=(float)hypot(dx,dy);
float x[4];
float y[4];
x[0]=x1+lineWidth*(y2-y1)/l;
y[0]=y1-lineWidth*(x2-x1)/l;
x[1]=x1-lineWidth*(y2-y1)/l;
y[1]=y1+lineWidth*(x2-x1)/l;
x[2]=x2-lineWidth*(y2-y1)/l;
y[2]=y2+lineWidth*(x2-x1)/l;
x[3]=x2+lineWidth*(y2-y1)/l;
y[3]=y2-lineWidth*(x2-x1)/l;
FillPolygon(x, y, 4, color);
}
void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
{
}
void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
{
}
void JRenderer::DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
{
}
void JRenderer::FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
{
}
void JRenderer::SetImageFilter(JImageFilter* imageFilter)
{
mImageFilter = imageFilter;
}
void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
{
}
void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
{
}

View File

@@ -75,10 +75,10 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
int count;
while (filePtr < size)
{
while (filePtr < size)
{
filePtr = ReadLine(tmpLine, buffer, filePtr, size);
{
{
if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3))
{
@@ -89,19 +89,19 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
if (count == 4)
{
if (strcmp(s1, "vn") == 0)
if (string("vn") == s1)
normalList.push_back(vert);
else if (strcmp(s1, "vt") == 0)
else if (string("vt") == s1)
texList.push_back(vert);
else if (strcmp(s1, "v") == 0)
else if (string("v") == s1)
vertList.push_back(vert);
}
else if (count == 3)
{
if (strcmp(s1, "vt") == 0)
if (string("vt") == s1)
texList.push_back(vert);
}
}
else if (tmpLine[0] == 'f')
{
@@ -211,7 +211,7 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
if (textureName != NULL)
mTexture = JRenderer::GetInstance()->LoadTexture(textureName);
return true;
return true;
}

View File

@@ -90,7 +90,7 @@ bool JParticleEffect::Load(const char* filename)
// FIELD_COUNT
// };
const char* lifeValues[] =
const string lifeValues[] =
{
"speed",
"size",
@@ -104,7 +104,7 @@ bool JParticleEffect::Load(const char* filename)
"gravity"
};
const char* typeNames[] =
const string typeNames[] =
{
"POINT",
"AREA",
@@ -113,7 +113,7 @@ bool JParticleEffect::Load(const char* filename)
"CIRCLE"
};
const char* modeNames[] =
const string modeNames[] =
{
"REPEAT",
"ONCE",
@@ -149,32 +149,32 @@ bool JParticleEffect::Load(const char* filename)
{
element = param->ToElement();
if (strcmp(element->Attribute("name"), "settings")==0)
if (string("settings") == element->Attribute("name"))
{
if (strcmp(element->Attribute("blend"), "NORMAL")==0)
if (string("NORMAL") == element->Attribute("blend"))
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
else if (strcmp(element->Attribute("blend"), "ADDITIVE")==0)
else if (string("ADDITIVE") == element->Attribute("blend"))
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE);
for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++)
{
if (strcmp(element->Attribute("mode"), modeNames[i])==0)
if (modeNames[i] == element->Attribute("mode"))
{
mParticleEmitters[mEmitterCount]->mEmitterMode = i;
#if defined (_DEBUG)
printf("emitter mode:%s\n", modeNames[i]);
printf("emitter mode:%s\n", modeNames[i].c_str());
#endif
break;
}
}
for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++)
{
if (strcmp(element->Attribute("type"), typeNames[i])==0)
if (typeNames[i] == element->Attribute("type"))
{
mParticleEmitters[mEmitterCount]->mType = i;
#if defined (_DEBUG)
printf("emitter type:%s\n", typeNames[i]);
printf("emitter type:%s\n", typeNames[i].c_str());
#endif
break;
}
@@ -213,7 +213,7 @@ bool JParticleEffect::Load(const char* filename)
}
}
else if (strcmp(element->Attribute("name"), "quantity")==0)
else if (string("quantity") == element->Attribute("name"))
{
for (key = param->FirstChild(); key; key = key->NextSibling())
{
@@ -227,7 +227,7 @@ bool JParticleEffect::Load(const char* filename)
}
}
else if (strcmp(element->Attribute("name"), "lifex")==0)
else if (string("lifex") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -236,7 +236,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mLifeMax= value;
}
}
else if (strcmp(element->Attribute("name"), "anglex")==0)
else if (string("anglex") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -245,7 +245,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD;
}
}
else if (strcmp(element->Attribute("name"), "speedx")==0)
else if (string("speedx") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -254,7 +254,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mSpeedMax= value;
}
}
else if (strcmp(element->Attribute("name"), "sizex")==0)
else if (string("sizex") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -267,7 +267,7 @@ bool JParticleEffect::Load(const char* filename)
{
for (int i=0;i<FIELD_COUNT;i++)
{
if (strcmp(element->Attribute("name"), lifeValues[i])==0)
if (lifeValues[i] == element->Attribute("name"))
{
for (key = param->FirstChild(); key; key = key->NextSibling())
{

View File

@@ -119,11 +119,11 @@ bool JResourceManager::LoadResource(const string& resourceName)
element = node->ToElement();
if (element != NULL)
{
if (strcmp(element->Value(), "texture")==0)
if (element->ValueStr() == "texture")
{
CreateTexture(element->Attribute("name"));
}
else if (strcmp(element->Value(), "quad")==0)
else if (element->ValueStr() == "quad")
{
string quadName = element->Attribute("name");
string textureName = element->Attribute("texture");
@@ -170,7 +170,7 @@ bool JResourceManager::LoadResource(const string& resourceName)
GetQuad(id)->SetHotSpot(hotspotX, hotspotY);
}
}
else if (strcmp(element->Value(), "font")==0)
else if (element->ValueStr() == "font")
{
}

View File

@@ -0,0 +1,22 @@
#include "../include/OutputCapturer.h"
std::ostringstream OutputCapturer::stream;
boost::mutex OutputCapturer::mMutex;
void OutputCapturer::add(const std::string& s)
{
boost::mutex::scoped_lock lock(mMutex);
stream << s << "\n";
}
void OutputCapturer::debugAndClear()
{
stream.flush();
qDebug("%s", stream.str().c_str());
stream.str("");
}
void OutputCapturer::clear()
{
stream.str("");
}

105
JGE/src/Qtconsole.cpp Normal file
View File

@@ -0,0 +1,105 @@
#include "../include/JGE.h"
#include "../include/JTypes.h"
#include "../include/JApp.h"
#include "../include/JFileSystem.h"
#include "../include/JRenderer.h"
#include "../include/JGameLauncher.h"
#include "TestSuiteAI.h"
#include "GameOptions.h"
#include "MTGDeck.h"
#include "DebugRoutines.h"
#include <QCoreApplication>
#include <QElapsedTimer>
class WagicWrapper
{
public:
WagicWrapper();
virtual ~WagicWrapper();
public:
// used mainly to mesure the delta between 2 updates
static QElapsedTimer g_startTimer;
private:
JGE* m_engine;
JApp* m_app;
JGameLauncher* m_launcher;
};
QElapsedTimer WagicWrapper::g_startTimer;
int JGEGetTime()
{
return (int)WagicWrapper::g_startTimer.elapsed();
}
bool JGEToggleFullscreen()
{
return true;
}
void JGECreateDefaultBindings()
{
}
WagicWrapper::WagicWrapper()
{
m_launcher = new JGameLauncher();
u32 flags = m_launcher->GetInitFlags();
if ((flags&JINIT_FLAG_ENABLE3D)!=0)
{
JRenderer::Set3DFlag(true);
}
JGECreateDefaultBindings();
m_engine = JGE::GetInstance();
m_app = m_launcher->GetGameApp();
m_app->Create();
m_engine->SetApp(m_app);
JRenderer::GetInstance()->Enable2D();
g_startTimer.restart();
}
WagicWrapper::~WagicWrapper()
{
if(m_launcher)
{
delete m_launcher;
m_launcher = NULL;
}
if(m_engine)
m_engine->SetApp(NULL);
if (m_app)
{
m_app->Destroy();
delete m_app;
m_app = NULL;
}
JGE::Destroy();
m_engine = NULL;
}
int main(int argc, char* argv[])
{
QCoreApplication a(argc, argv);
int result = 0;
WagicWrapper* wagicCore = new WagicWrapper();
MTGCollection()->loadFolder("sets/primitives/");
MTGCollection()->loadFolder("sets/", "_cards.dat");
options.reloadProfile();
TestSuite testSuite("test/_tests.txt");
result = testSuite.run();
delete wagicCore;
DebugTrace("TestSuite done: failed test: " << result << " out of " << testSuite.nbTests + testSuite.nbAITests << " total");
#ifdef CAPTURE_STDERR
OutputCapturer::debugAndClear();
#endif
return result;
}

View 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 && strcmp(argv[1], "testsuite")==0)
{
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");

View File

@@ -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

View File

@@ -343,7 +343,7 @@ void JQuad::SetHotSpot(float x, float y)
//////////////////////////////////////////////////////////////////////////
JTexture::JTexture() : mBuffer(NULL)
JTexture::JTexture() : mWidth(0), mHeight(0), mBuffer(NULL)
{
mTexId = -1;
}
@@ -823,7 +823,7 @@ void JRenderer::BeginScene()
esMatrixLoadIdentity(&theMvpMatrix);
esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f);
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
#if (defined WIN32) || ((defined GL_VERSION_ES_CM_1_1) && (!defined IOS))
#if (defined WIN32 && !defined GL_ES_VERSION_2_0) || ((defined GL_VERSION_ES_CM_1_1) && (!defined IOS))
float scaleH = mActualHeight/SCREEN_HEIGHT_F;
float scaleW = mActualWidth/SCREEN_WIDTH_F;
if (scaleH != 1.0f || scaleW != 1.0f)
@@ -2486,7 +2486,7 @@ void JRenderer::Enable2D()
#if (defined GL_VERSION_ES_CM_1_1) || (defined GL_OES_VERSION_1_1)
glOrthof(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
#else
gluOrtho2D(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f);
glOrtho(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
#endif
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix

View File

@@ -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);

View File

@@ -335,7 +335,7 @@ void WagicCore::resizeGL(int width, int height)
#if (defined GL_VERSION_ES_CM_1_1 || defined GL_OES_VERSION_1_1)
glOrthof(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
#else
gluOrtho2D(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f);
glOrtho(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
#endif
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
@@ -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);

View File

@@ -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);

View File

@@ -2,6 +2,8 @@
[![Build Status](https://travis-ci.org/WagicProject/wagic.png?branch=master)](https://travis-ci.org/WagicProject/wagic)
[![Build status](https://ci.appveyor.com/api/projects/status/7j4fbr6m62aqej59/branch/master)](https://ci.appveyor.com/project/xawotihs/wagic/branch/master)
[![Coverage Status](https://coveralls.io/repos/WagicProject/wagic/badge.png?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
-![alt text](http://wololo.net/wagic/wp-content/uploads/2009/10/shop.jpg "Screenshot")
### Sample round play-through video
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/WUFSAPZuDIk/0.jpg)](http://www.youtube.com/watch?v=WUFSAPZuDIk)

76
appveyor.yml Normal file
View 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

View File

@@ -1,2 +1,3 @@
/gen
/bin

View File

@@ -14,5 +14,5 @@
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9"/>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
</manifest>

View File

@@ -1,10 +0,0 @@
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/gen/net/wagic/app/R.java \
: /Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-hdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-ldpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-mdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/layout/main.xml \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/values/strings.xml \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-hdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-ldpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-mdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/AndroidManifest.xml \

View File

@@ -1,6 +0,0 @@
/** Automatically generated file. DO NOT MODIFY */
package net.wagic.app;
public final class BuildConfig {
public final static boolean DEBUG = true;
}

View File

@@ -1,27 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package net.wagic.app;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int mainLayout=0x7f050000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int app_version=0x7f040001;
public static final int info_text=0x7f040002;
}
}

View File

@@ -14,7 +14,7 @@ PNG_PATH := $(JGE_PATH)/Dependencies/libpng
DEBUG ?= DEBUG
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG -D_$(DEBUG)
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC -DTIXML_USE_STL
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
LOCAL_STATIC_LIBRARIES := libpng libjpeg
LOCAL_SHARED_LIBRARIES := SDL
@@ -41,7 +41,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
$(MTG_PATH)/src/AllAbilities.cpp \
$(MTG_PATH)/src/CardDescriptor.cpp \
$(MTG_PATH)/src/CardDisplay.cpp \
$(MTG_PATH)/src/CardEffect.cpp \
$(MTG_PATH)/src/CardGui.cpp \
$(MTG_PATH)/src/CardPrimitive.cpp \
$(MTG_PATH)/src/CardSelector.cpp \
@@ -58,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 \
@@ -137,6 +135,9 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
$(MTG_PATH)/src/WFont.cpp \
$(MTG_PATH)/src/WGui.cpp \
$(MTG_PATH)/src/WResourceManager.cpp \
$(MTG_PATH)/src/DeckView.cpp \
$(MTG_PATH)/src/CarouselDeckView.cpp \
$(MTG_PATH)/src/GridDeckView.cpp \
$(JGE_PATH)/src/SDLmain.cpp \
$(JGE_PATH)/src/Encoding.cpp \
$(JGE_PATH)/src/JAnimator.cpp \

View File

@@ -54,10 +54,6 @@ import android.view.View.OnKeyListener;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;
/**
* SDL Activity
*/
@@ -68,7 +64,6 @@ public class SDLActivity extends Activity implements OnKeyListener
public static String TAG = Activity.class.getCanonicalName();
// Main components
private static AdView mAdView;
private static SDLActivity mSingleton;
private static SDLSurface mSurface;
@@ -85,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;
@@ -312,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.");
@@ -422,25 +416,12 @@ public class SDLActivity extends Activity implements OnKeyListener
SurfaceHolder holder = mSurface.getHolder();
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
// Create the adView
mAdView = new AdView(this, AdSize.BANNER, "a14e9009f88864f"); // "a14dc0ab7b27413" <-- for the alpha);
_videoLayout.addView(mSurface, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
_videoLayout.addView(mAdView, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL));
// mGLView.setFocusableInTouchMode(true);
// mGLView.setFocusable(true);
// adView.requestFreshAd();
setContentView(_videoLayout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mSurface.requestFocus();
AdRequest request = new AdRequest();
request.addTestDevice(AdRequest.TEST_EMULATOR);
request.addTestDevice("1DA1E070BC7D4ABE8BA77EB73C2CB0AA"); // wololo's phone
request.addTestDevice("C386F3830A9789C649098A817BF54C04"); // xawotihs's tablet
// Initiate a generic request to load it with an ad
mAdView.loadAd(request);
}
// Setup
@@ -455,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();
@@ -512,14 +493,6 @@ public class SDLActivity extends Activity implements OnKeyListener
{
return;
}
if ((command.compareTo("entergamestate:menu") == 0) || (command.compareTo("enterduelphase:end") == 0))
{
mAdView.setVisibility(View.VISIBLE);
} else if (command.compareTo("leavegamestate:menu") == 0)
{
mAdView.setVisibility(View.INVISIBLE);
}
}
// Messages from the SDLMain thread
@@ -551,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();

View 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>

Binary file not shown.

View File

@@ -0,0 +1,5 @@
#!/bin/bash
cd ${0%/*/*}/Resources
#cd ../Resources
exec ../MacOS/wagic -platformpluginpath ../PlugIns >> ../logs/out.log 2> ../logs/err.log

View File

@@ -1,4 +1,33 @@
OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIHints.o objs/AIMomirPlayer.o objs/AIPlayer.o objs/AIPlayerBaka.o objs/AIStats.o objs/AllAbilities.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/CardEffect.o objs/CardPrimitive.o objs/CardSelector.o objs/CardSelectorSingleton.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/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 objs/GameStateShop.o objs/GameStateStory.o objs/GameStateTransitions.o objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o objs/IconButton.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/ModRules.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGPack.o objs/MTGRules.o objs/Navigator.o objs/ObjectAnalytics.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PlayRestrictions.o objs/Pos.o objs/PrecompiledHeader.o objs/PriceList.o objs/ReplacementEffects.o objs/Rules.o objs/SimpleMenu.o objs/SimpleButton.o objs/SimpleMenuItem.o objs/SimplePad.o objs/SimplePopup.o objs/StoryFlow.o objs/StyleManager.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.o objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o objs/WFont.o
OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
objs/ActionLayer.o objs/ActionStack.o objs/AIHints.o objs/AIMomirPlayer.o\
objs/AIPlayer.o objs/AIPlayerBaka.o objs/AIStats.o objs/AllAbilities.o\
objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o\
objs/CardPrimitive.o objs/CardSelector.o objs/CardSelectorSingleton.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/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\
objs/GameStateShop.o objs/GameStateStory.o objs/GameStateTransitions.o\
objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o\
objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o\
objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o\
objs/IconButton.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o\
objs/ModRules.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o\
objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o\
objs/MTGPack.o objs/MTGRules.o objs/Navigator.o objs/ObjectAnalytics.o\
objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o\
objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PlayRestrictions.o\
objs/Pos.o objs/PrecompiledHeader.o objs/PriceList.o objs/ReplacementEffects.o\
objs/Rules.o objs/SimpleMenu.o objs/SimpleButton.o objs/SimpleMenuItem.o\
objs/SimplePad.o objs/SimplePopup.o objs/StoryFlow.o objs/StyleManager.o\
objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.o\
objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o\
objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o\
objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\
objs/WFont.o objs/CarouselDeckView.o objs/GridDeckView.o objs/DeckView.o
DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS))
RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache)
@@ -44,7 +73,7 @@ PSP_EBOOT_UNKPNG = pic0.png
PSP_EBOOT_PIC1 = pic1.png
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
LIBDIR = ../../JGE/lib/psp
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL
else
OBJS += objs/TestSuiteAI.o
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
@@ -57,7 +86,7 @@ all: $(DEFAULT_RULE)
endif
CFLAGS := -Wall -W -Werror -Wno-unused $(CFLAGS)
CFLAGS := -Wall -W -Wno-unused $(CFLAGS)
CXXFLAGS += $(CFLAGS)
# -fno-exceptions
@@ -99,7 +128,7 @@ clean:
endif
define compile
$(CXX) -c $(CXXFLAGS) $< -o $@
$(CXX) -c $(CXXFLAGS) $< -o $@
endef
PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h

View File

@@ -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()

View File

@@ -16,6 +16,7 @@ auto=flashbackrule
auto=retracerule
auto=suspendrule
auto=morphrule
auto=playfromgraveyardrule
auto=attackrule
auto=blockrule
auto=combattriggerrule

View 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]

File diff suppressed because it is too large Load Diff

View 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>

View 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]

View 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>

View 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]

View 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>

File diff suppressed because it is too large Load Diff

View 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>

View File

@@ -1248,3 +1248,8 @@ primitive=Zombie Goliath
id=190545
rarity=C
[/card]
[card]
primitive=Avatar Token
id=-191239
rarity=T
[/card]

View File

@@ -1257,4 +1257,9 @@ rarity=U
primitive=Yavimaya Wurm
id=205221
rarity=C
[/card]
[/card]
[card]
primitive=Avatar Token
id=-205957
rarity=T
[/card]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,106 @@
[meta]
author=Wagic Team
name=From the Vault: Twenty
block=Vault
year=2013
[/meta]
[card]
primitive=Akroma's Vengeance
id=373328
rarity=M
[/card]
[card]
primitive=Chainer's Edict
id=373317
rarity=M
[/card]
[card]
primitive=Chameleon Colossus
id=373321
rarity=M
[/card]
[card]
primitive=Char
id=373332
rarity=M
[/card]
[card]
primitive=Cruel Ultimatum
id=373318
rarity=M
[/card]
[card]
primitive=Dark Ritual
id=373329
rarity=M
[/card]
[card]
primitive=Fact or Fiction
id=373325
rarity=M
[/card]
[card]
primitive=Fyndhorn Elves
id=373320
rarity=M
[/card]
[card]
primitive=Gilded Lotus
id=373335
rarity=M
[/card]
[card]
primitive=Green Sun's Zenith
id=373333
rarity=M
[/card]
[card]
primitive=Hymn to Tourach
id=373324
rarity=M
[/card]
[card]
primitive=Impulse
id=373330
rarity=M
[/card]
[card]
primitive=Ink-Eyes, Servant of Oni
id=373327
rarity=M
[/card]
[card]
primitive=Jace, the Mind Sculptor
id=373316
rarity=M
[/card]
[card]
primitive=Kessig Wolf Run
id=373323
rarity=M
[/card]
[card]
primitive=Swords to Plowshares
id=373334
rarity=M
[/card]
[card]
primitive=Tangle Wire
id=373322
rarity=M
[/card]
[card]
primitive=Thran Dynamo
id=373331
rarity=M
[/card]
[card]
primitive=Venser, Shaper Savant
id=373326
rarity=M
[/card]
[card]
primitive=Wall of Blossoms
id=373319
rarity=M
[/card]

View File

@@ -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

View File

@@ -3187,19 +3187,6 @@ mana={2}
type=Artifact
[/card]
[card]
name=Crucible of Worlds
auto={0}:may moveTo(myBattlefield) target(land|mygraveyard) limit:1 myTurnOnly
# Above line does not work: "May moveto" from graveyards does
# not work due to interface issues. The "limit:1" doesn't work
# here either. Even if both worked, then the card would allow
# you to play lands *in addition* to the 1 land you can play per
# turn. Instead it should just give you the option to play this
# 1 land from your hand or your graveyard.
text=You may play land cards from your graveyard.
mana={3}
type=Artifact
[/card]
[card]
name=Cruel Deceiver
text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Cruel Deceiver gains "Whenever Cruel Deceiver deals damage to a creature, destroy that creature" until end of turn. Activate this ability only once each turn.
mana={1}{B}
@@ -4162,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
@@ -7058,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}
@@ -7699,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}
@@ -11503,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}
@@ -12363,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}
@@ -12918,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}
@@ -14554,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}
@@ -15843,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}
@@ -17644,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}

View File

@@ -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
@@ -226,6 +227,7 @@ colossus_of_sardia1.txt
colossus_of_sardia2.txt
composite_golem.txt
conservator.txt
consign_to_dream.txt
Contagion_Clasp.txt
control_magic.txt
control_magic2.txt
@@ -238,7 +240,7 @@ counterspell.txt
counterspell2.txt
counterspell3.txt
counterspell4.txt
counter_unless_pay.txt
counter_unless_pay_x.txt
Covetous_Dragon_ASLONGAS_3.txt
Covetous_Dragon_ASLONGAS_4.txt
cranial_plating.txt
@@ -248,6 +250,7 @@ curiosity2_i217.txt
crimson_kobolds.txt
crosis_s_catacombs_1.txt
crosis_s_catacombs_2.txt
crucible_of_worlds.txt
crumble.txt
crystal_rod_i172.txt
cursed_land1_i188.txt
@@ -306,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
@@ -339,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
@@ -614,6 +621,8 @@ souls_attendant_i489.txt
soul's grace_POWERLIFEGAIN.txt
spark_elemental.txt
spectral_shield_CANTBETARGETOF.txt
spell_rupture.txt
spell_rupture_2.txt
sphinx_summoner.txt
spirit_link.txt
spirit_link_i173.txt
@@ -653,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
@@ -706,4 +717,5 @@ momir/overcost.txt
#AI Tests
########################
ai/goblin_artillery.txt
ai/proliferate_simple.txt
#I dont understand why this test works, and it breaks the redo, so I deactivate it.
#ai/proliferate_simple.txt

View 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]

View File

@@ -0,0 +1,25 @@
# Test TargetChooser based on negation of two colors
# Grizzly bear should be put on top of library
# name=Consign to Dream
# Return target permanent to its owner's hand.
# If that permanent is red or green, put it on top of its owner's library
[INIT]
FIRSTMAIN
[PLAYER1]
hand:Consign to Dream
manapool:{2}{U}
inplay:grizzly bears
[PLAYER2]
[DO]
Consign to Dream
grizzly bears
endinterruption
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:Consign to Dream
library:grizzly bears
[PLAYER2]
[END]

View File

@@ -0,0 +1,27 @@
#Testing Counter unless pay {X} mechanic
#P1 casts Think Twice with {5} left in his mana pool and P2 counters with Syncopate using X = 3. P1 chooses to pay {3} and Think Twice resolves with {2} left in his mana pool.
[INIT]
firstmain
[PLAYER1]
hand:think twice
manapool:{1}{U}{5}
library:counterspell
[PLAYER2]
hand:syncopate
manapool:{3}{U}
[DO]
think twice
no
yes
syncopate
think twice
choice 0
[ASSERT]
firstmain
[PLAYER1]
hand:counterspell
graveyard:think twice
manapool:{2}
[PLAYER2]
graveyard:syncopate
[END]

View File

@@ -0,0 +1,26 @@
# Testing crucible of worlds (keyword: CANPLAYFROMGRAVEYARD)
# name=Crucible of Worlds
# text=You may play land cards from your graveyard.
[INIT]
FIRSTMAIN
[PLAYER1]
hand:island,plains
inplay:crucible of worlds
graveyard:forest,mountain
[PLAYER2]
[DO]
forest
# all next lands shouldn't be played
island
mountain
plains
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:crucible of worlds,forest
hand:island,plains
graveyard:mountain
[PLAYER2]
[END]

View 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]

View 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]

View 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]

View 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]

View 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]

View 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]

View File

@@ -0,0 +1,29 @@
# Testing spell rupture (expression: "pay[[{value:WParsedInt}]]")
# counter opponent spell
[INIT]
firstmain
[PLAYER1]
hand:bad moon
manapool:{1}{B}{4}
inplay:raging goblin
[PLAYER2]
inplay:grizzly bears
hand:spell rupture
manapool:{1}{U}
[DO]
bad moon
no
yes
spell rupture
bad moon
choice 0
[ASSERT]
firstmain
[PLAYER1]
manapool:{2}
inplay:raging goblin,bad moon
[PLAYER2]
graveyard:spell rupture
manapool:{0}
inplay:grizzly bears
[END]

View File

@@ -0,0 +1,25 @@
# Testing spell rupture (expression: "pay[[{value:WParsedInt}]]")
# counter own spell
[INIT]
firstmain
[PLAYER1]
hand:bad moon,spell rupture
manapool:{1}{B}{1}{U}{4}
inplay:raging goblin
[PLAYER2]
inplay:grizzly bears
[DO]
bad moon
yes
spell rupture
bad moon
choice 0
[ASSERT]
firstmain
[PLAYER1]
graveyard:spell rupture
manapool:{3}
inplay:raging goblin,bad moon
[PLAYER2]
inplay:grizzly bears
[END]

View 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]

View 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]

View 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()

View File

@@ -2,7 +2,8 @@
<!-- build.properties should contain the values for major, minor and point -->
<property file="build.properties" />
<property file="build.number.properties" />
<property environment="env"/>
<path id="groovy.class.path" >
<fileset dir="${groovy.dir}" />
</path>
@@ -76,19 +77,22 @@ Author: Michael Nguyen
#define WAGIC_VERSION_MAJOR ${build.major}
#define WAGIC_VERSION_MEDIUM ${build.minor}
#define WAGIC_VERSION_MINOR ${build.point}
#define WAGIC_VERSION_REVISION ${env.TRAVIS_BUILD_NUMBER}
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
#define VERSION_DOT(a, b, c, d) a ##.## b ##.## c ##.## d
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
#define VERSION_GAME(a, b, c) VERSION_DOT(a, b, c)
#define VERSION_GAME(a, b, c, d) VERSION_DOT(a, b, c, d)
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
#define VERSION_TOSTRING(a) #a
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR, WAGIC_VERSION_REVISION)
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_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

View File

@@ -12,6 +12,8 @@ using std::vector;
class ManaCost;
class MTGAbility;
namespace AI {
class AIHint
{
public:
@@ -66,4 +68,6 @@ public:
~AIHints();
};
};
#endif

View File

@@ -3,6 +3,8 @@
#include "AIPlayerBaka.h"
namespace AI {
class AIMomirPlayer: public AIPlayerBaka
{
public:
@@ -14,4 +16,6 @@ public:
MTGAbility * getMomirAbility();
};
};
#endif

View File

@@ -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

View File

@@ -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

View File

@@ -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

View 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

View File

@@ -18,6 +18,8 @@ class MTGCard;
class Damage;
class WEvent;
namespace AI {
class AIStat
{
public:
@@ -49,4 +51,6 @@ public:
void Render();
};
};
#endif

View File

@@ -9,10 +9,6 @@
#include <JGui.h>
#include "MTGDefinitions.h"
#define INACTIVE 0
#define ACTION_REQUESTED 1
#define ACTIVE 2
class MTGCardInstance;
class ManaCost;
class Targetable;
@@ -22,31 +18,33 @@ class WEvent;
class ActionElement: public JGuiObject
{
protected:
int activeState;
enum Activity{
Inactive,
ActionRequested,
Active
};
Activity activity;
TargetChooser * tc;
public:
GamePhase currentPhase;
GamePhase newPhase;
int modal;
int waitingForAnswer;
int getActivity();
virtual void Update(float){};
virtual void Render(){};
virtual void Update(float){}
virtual void Render(){}
virtual int testDestroy()
{
return 0;
}
;
virtual int destroy()
{
return 0;
}
;
virtual bool CheckUserInput(JButton)
{
return false;
}
;
ActionElement(int id);
ActionElement(const ActionElement& copyFromMe);
TargetChooser * getActionTc(){return tc;}
@@ -62,27 +60,22 @@ public:
{
return 0;
}
;
virtual int stillInUse(MTGCardInstance *)
{
return 0;
}
;
virtual int receiveEvent(WEvent *)
{
return 0;
}
;
virtual int reactToClick(MTGCardInstance *)
{
return 0;
}
;
virtual const char * getMenuText()
virtual const string getMenuText()
{
return "Ability";
}
;
virtual ActionElement * clone() const = 0;
};

View File

@@ -41,16 +41,9 @@ class DamageStack;
class ManaCost;
class TargetChooser;
#define ACTIONSTACK_STANDARD 0
#define ACTIONSTACK_TARGET 1
class Interruptible: public PlayGuiObject, public Targetable
{
public:
//TODO : remove these when they are back in PlayGuiObject
float x, y;
int state, display;
MTGCardInstance * source;
virtual void Entering()
@@ -79,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)
{
}
@@ -186,6 +179,11 @@ public:
class ActionStack :public GuiLayer
{
public:
enum ActionStackMode{
ACTIONSTACK_STANDARD = 0,
ACTIONSTACK_TARGET = 1
};
typedef enum
{
NOT_DECIDED = 0,
@@ -206,8 +204,7 @@ protected:
JQuadPtr pspIcons[8];
InterruptDecision interruptDecision[2];
float timer;
int currentState;
int mode;
ActionStackMode mode;
int checked;
ATutorialMessage* currentTutorial;
int interruptBtnXOffset, noBtnXOffset, noToAllBtnXOffset, interruptDialogWidth;
@@ -226,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;
@@ -253,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

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,6 @@
#ifndef _CACHE_ENGINE_H_
#define _CACHE_ENGINE_H_
#include "PrecompiledHeader.h"
#include "Threading.h"
@@ -208,3 +211,5 @@ public:
CardRetrieverBase* CacheEngine::sInstance = NULL;
bool CacheEngine::sIsThreaded = false;
#endif //_CACHE_ENGINE_H_

View File

@@ -9,9 +9,6 @@
#include "MTGGameZones.h"
#include "Counters.h"
#define CD_OR 1
#define CD_AND 2
enum ENUM_COMPARISON_MODES
{
COMPARISON_NONE = 0, // Needs to remain 0 for quick if(comparison_mode) checks
@@ -31,7 +28,12 @@ class CardDescriptor: public MTGCardInstance
MTGCardInstance * match_not(MTGCardInstance * card);
bool valueInRange(int comparisonMode, int value, int criterion);
public:
int mode;
enum Operator{
CD_OR = 1,
CD_AND = 2
};
Operator mode;
int powerComparisonMode;
int toughnessComparisonMode;
int manacostComparisonMode;
@@ -62,6 +64,7 @@ class CardDescriptor: public MTGCardInstance
string compareName;
int CDopponentDamaged;
int CDcontrollerDamaged;
int CDdamager;
};
#endif

View File

@@ -1,21 +0,0 @@
#ifndef _CARDEFFECT_H_
#define _CARDEFFECT_H_
#include <JGE.h>
#include "Effects.h"
struct CardGui;
class CardEffect: public Effect
{
public:
CardEffect(CardGui* target);
~CardEffect();
private:
CardGui* target;
public:
virtual void Render();
};
#endif // _CARDEFFECT_H_

View File

@@ -33,7 +33,7 @@ protected:
/*
** Tries to render the Big version of a card picture, backups to text version in case of failure
*/
static void RenderBig(MTGCard * card, const Pos& pos);
static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false);
static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal);
static void AlternateRender(MTGCard * card, const Pos& pos);
@@ -55,8 +55,8 @@ public:
virtual void Render();
virtual void Update(float dt);
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal);
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal);
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
static JQuadPtr AlternateThumbQuad(MTGCard * card);
virtual ostream& toString(ostream&) const;

View File

@@ -101,10 +101,9 @@ public:
int removeType(string value, int removeAll = 0);
int removeType(int value, int removeAll = 0);
bool hasSubtype(int _subtype);
bool hasSubtype(const char * _subtype);
bool hasSubtype(const string& _subtype);
bool hasType(int _type);
bool hasType(const char * type);
bool hasType(const string& type);
void setManaCost(const string& value);
ManaCost * getManaCost();

View File

@@ -0,0 +1,45 @@
#ifndef _CAROUSEL_DECK_VIEW_H_
#define _CAROUSEL_DECK_VIEW_H_
#include "DeckView.h"
#include "Easing.h"
class CarouselDeckView : public DeckView
{
private:
static const float max_scale;
static const float x_center;
static const float right_border;
static const float slide_animation_duration;
static const float scroll_animation_duration;
public:
CarouselDeckView();
virtual ~CarouselDeckView();
void Reset();
void UpdateViewState(float dt);
void UpdateCardPosition(int index);
void renderCard(int index)
{
int alpha = (int) (255 * (mCards[index].scale + 1.0 - max_scale));
DeckView::renderCard(index, alpha);
}
void Render();
bool ButtonPressed(Buttons button);
MTGCard * Click(int x, int y);
MTGCard * Click();
void changePositionAnimated(int offset);
void changeFilterAnimated(int offset);
MTGCard *getActiveCard();
private:
float mScrollOffset, mSlideOffset;
InOutQuadEasing mScrollEasing;
InOutQuadEasing mSlideEasing;
};
#endif //_CAROUSEL_DECK_VIEW_H_

View File

@@ -11,17 +11,15 @@ class JGuiObject;
class MTGCardInstance;
class GameObserver;
#define DAMAGEABLE_MTGCARDINSTANCE 0
#define DAMAGEABLE_PLAYER 1
#define DAMAGE_ALL_TYPES 0
#define DAMAGE_COMBAT 1
#define DAMAGE_OTHER 2
class Damageable:public Targetable
{
protected:
public:
enum DamageableType{
DAMAGEABLE_MTGCARDINSTANCE = 0,
DAMAGEABLE_PLAYER
};
int life;
int handsize;
int poisonCount;
@@ -29,12 +27,14 @@ public:
int preventable;
int thatmuch;
int lifeLostThisTurn;
int type_as_damageable;
DamageableType type_as_damageable;
Damageable(GameObserver* observer, int _life)
: Targetable(observer)
{life=_life;lifeLostThisTurn = 0;};
int getLife(){return life;};
virtual int dealDamage(int damage){life-=damage;return life;};
: Targetable(observer), life(_life), handsize(0),
poisonCount(0), damageCount(0), preventable(0), thatmuch(0),
lifeLostThisTurn(0), type_as_damageable(DAMAGEABLE_MTGCARDINSTANCE)
{}
int getLife(){return life;}
virtual int dealDamage(int damage){life-=damage;return life;}
virtual int afterDamage(){return 0;}
virtual int poisoned(){return 0;}
virtual int prevented(){return 0;}
@@ -47,17 +47,23 @@ public:
class Damage: public Interruptible
{
protected:
void init(MTGCardInstance * source, Damageable * target, int damage, int typeOfDamage);
public:
enum DamageType{
DAMAGE_ALL_TYPES = 0,
DAMAGE_COMBAT,
DAMAGE_OTHER
};
Damageable * target;
int typeOfDamage;
DamageType typeOfDamage;
int damage;
void Render();
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target);
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target, int damage, int typeOfDamage = DAMAGE_OTHER);
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target, int damage, DamageType typeOfDamage = DAMAGE_OTHER);
int resolve();
virtual ostream& toString(ostream& out) const;
protected:
void init(MTGCardInstance * source, Damageable * target, int damage, DamageType typeOfDamage);
};
class DamageStack : public GuiLayer, public Interruptible

Some files were not shown because too many files have changed in this diff Show More