Commit Graph

4047 Commits

Author SHA1 Message Date
Xawotihs
bdb55945df Fixed crash happening when loading resources from a .zip in a 64bits system 2011-11-16 22:44:51 +00:00
Xawotihs
8a1606a3c6 Compilation fixes for Android+boost 2011-11-16 20:49:26 +00:00
Xawotihs
ee700623d5 Fixed issue 752. 2011-11-15 22:20:58 +00:00
Xawotihs
ae3d97dbeb Include missing JGE files from my last commit 2011-11-14 18:43:51 +00:00
Xawotihs
f68c106e7e - Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).
- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it.
- Various cleanup/refactor of the game observer.
- Added a gameObserver == operator to compare two games
- Added player mode to the player serialization
- Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1.
- Refactored random generator class to use list intead of queue
- Defined a specific type for interrupt decision instead of int
2011-11-13 22:36:34 +00:00
omegablast2002@yahoo.com
2240c14f56 only draw red and blue boarders on cards parent/child relationships if the connect rule is active, there is no way it would works correctly otherwise since connect rule is what handles the clean up and adding of cards to these vectors. 2011-11-13 20:05:25 +00:00
solo81@web.de
a821b2752d Fixed issue757. 2011-11-13 19:34:38 +00:00
wagic.the.homebrew
3ed822f33b - Automated download of resource files for Android
-- There's still lots of things to figure out: scalability of the server (can we host the files someplace else? Can we have several servers in case one of them fails?), versioning, possibility to download several mods, etc... but this is the basic functionality and should be enough for the first version.
-- The Java file should probably be split...it's close to 1000 lines now :/
2011-11-13 08:43:07 +00:00
wagic.the.homebrew
fe83b6b4e8 - moved test for i718
- Added macros for Basic landcycling and cycling
2011-11-12 12:48:00 +00:00
wagic.the.homebrew
d654b050df - fix for issue 756 (cycling not working for first 7 drawn cards)
- minor cleanup of MTGGameZones.cpp
2011-11-12 10:14:27 +00:00
wagic.the.homebrew
a94e0a11cf Fixing Giant growth. This fixes the 5 failing tests from the test suite 2011-11-12 04:47:12 +00:00
solo81@web.de
9a93824539 1) Fixed issue758.
2) Finished updating cards with cycle.

3) Coded some cards with "@cycled...".

Astral Slide
Fleeting Aven
Invigorating Boon
Stoic Champion
Warped Researcher.

Tests will follow!
2011-11-09 23:08:54 +00:00
Xawotihs
8c6a0cf9ae Fixed issue 753. 2011-11-09 22:15:26 +00:00
omegablast2002@yahoo.com
3dcd85944c updated cycling cards, I cheated at this and did a replace :cycling with {cycle):draw:1 so forgive me if it screwed up a cycle card...it should be brain dead easy to fix. 2011-11-09 14:29:28 +00:00
omegablast2002@yahoo.com
d2752a5a22 converted cycling into a cost type to bring it more inline with MTGrules {cycle}, also added the cycled trigger @cycled(tc):
this cost type sends both the event for discard and the event for cycled trigger, it no longer automatically draws a card, that is part of this cost ability instead.
standard cycling is autohand={cycle}:draw:1 controller
its trigger is
auto=@cycled(*|myhand):damage:2 target(creature)
"whenever you cycle a card deal 2 damage to a target creature."
2011-11-09 14:27:56 +00:00
omegablast2002@yahoo.com
db6c4795bf removed and moved exalted test 2011-11-09 11:59:03 +00:00
omegablast2002@yahoo.com
86fb600c96 2011-11-09 11:58:21 +00:00
omegablast2002@yahoo.com
ec66ecc101 fixed bug with exalted not ending if source is killed. 2011-11-09 11:56:16 +00:00
wagic.the.homebrew
1f313aa7a4 Adding test for issue 754 2011-11-08 04:04:51 +00:00
Xawotihs
ad5edc224d Symbian^3 compilation fixes. 2011-11-07 23:32:02 +00:00
omegablast2002@yahoo.com
eda32239ab switched it to observer random.... 2011-11-07 22:47:25 +00:00
omegablast2002@yahoo.com
52db4b9ac4 added random avatar fetching for game modes in which you don't fight a specific deck...
fixed a crash from random deck game modes where it was trying to check against a selected deck...but there is no selected deck in random.
(side effect of this is that i can not bypass this, the stat still need to be run through without causing choas so i set it to deckname "" and id 0...we *might* need to find a different id...though it didn't seem to effect deck 0 as the name does not match)
2011-11-07 22:16:02 +00:00
Xawotihs
1ef9489ea0 Fixed compilation on Windows and avoid crashing when the TestSuite is interrupted. 2011-11-06 19:58:23 +00:00
Xawotihs
e50fdba648 - Replaced static parts by per-instance parts of of several classes when they were not threadsafe (AIMomirPlayer, SimpleMenu, Trash, AIAction, MTGCardInstance, ATutorialMessage, MTGRules). The direct consequence is that we could consumme more memory. So, tell me if you have problems with low memory devices (PSP), there are some threadsafe optimizations that could be implemented if needed.
- Reworked the testsuite to be able to work multithreaded. This is deactivated by default everywhere except in QT_CONFIG as one testcase still refuses to pass in multithreaded mode. On my 4 cores linux desktop, the 650 tests passes now in 4 seconds (1 fails).
- Replaced usage of CardSelectorSingleton by a card selector per game observer.
- Modified the resource manager to be optionnal and per game observer instance instead of being a singleton. Two reasons here : threading AND Open Gl access. I only updated the crashing parts called from the game observer, so most of the code is still using the single instance. Beware of copy-paste concerning resources ...
- Cleaned up the game observer constructors
- Fixed several problems in action logging code while testing proliferate decks
- Cleaned up Threading implementation based on QThread
2011-11-06 17:31:44 +00:00
omegablast2002@yahoo.com
b0cb955c53 converted ifthenability into an activatedabilty from mtgability so that it can be targeted without the use of workarounds... 2011-11-05 23:47:43 +00:00
Xawotihs
e4117212cb Fixed the _test references. In details:
renamed generic/triggers_at_movedto_i179.txt
removed Eradicate.txt
renamed frogmite.txt
renamed gelatinous_generations.txt
removed hope_charm_i267.txt
renamed lightmine_field1.txt
removed martial_coup.txt
removed martial_coup2.txt
renamed safe_passage.txt
renamed and fixed soul's_grace_POWERLIFEGAIN.txt
renamed thellon_of_havenwood.txt
removed tolsimir_wolfblood.txt
removed wave_of_reckoning.txt
renamed winds_of_Rath.txt
2011-11-05 17:11:17 +00:00
Xawotihs
1ce9c75b9c Fixed warning on Windows introduced in latest commit. 2011-10-30 18:33:23 +00:00
Xawotihs
2f4dd4cd2a - Added poison counter check into the testsuite
- Decorelated the testsuite AI timer from the game timer to be able to have reproduceable results with AI tests.
- Created a random generator wrapper class
- Used two seperate instances of this random generator for AI and for the game
- Added methods to load randoms into AI from a testcase
- Fixed a probleme with undo and premade decks introduced in r4035
- Added basic test to test AI proliferate code
- Cleaned up goblin_artillery test
- Added AI tests into the testsuite test list
- Fixed looping bug into the multi target AI code
2011-10-30 14:31:27 +00:00
wagic.the.homebrew
53b9bc412f Fix for issue 749 (autohand/autograveyard/etc... don't work for player2) 2011-10-30 09:35:04 +00:00
omegablast2002@yahoo.com
1806e5463d got rid of restriction "fourth turn" it was incorrect from day one (opps), previous commit changed serra's avanger to "turn:7" which is actually your 4th turn. 2011-10-29 11:27:40 +00:00
omegablast2002@yahoo.com
a48011fe2c serra's avanger.... 2011-10-29 11:20:21 +00:00
Xawotihs
b0a720e8c7 Returned the code as it was. In my test, Proliferate works as before... meaning, I got it crashing several times like before my changes. I still need to rework this code to have it log correctly its actions. 2011-10-27 23:36:29 +00:00
Xawotihs
5f9e8e2588 Fixed stupid problems introduced in previous commit. Bloody GCC with Werror is simply not enough :( 2011-10-27 18:58:54 +00:00
Xawotihs
c3dc51aed1 I just played 3 long games and I was able to undo two fully and got an assert on the third one after more than 1000 actions... so I commit what I have:
- Modified undo to stop at "next phase" action
- Added "muligan" and "force library shuffling" to the list of logged action
- Fixed random logging
- Fixed double logging of actions
- Merged all the "next game" functions into a single one
- Created a PlayerType type instead of using int
- Moved the player loading code into the GameObserver and out of GameStateDuel to avoid having player references in both and simplify the initialization and termination. Tweeked a bit the humanplayer class to be able to do that.
- Added a "load" menu available in testsuite mode, I use that to load problematique game. To use it, just copy-paste a game from the traces into Res/test/game/timetwister.txt. Game in traces starts by "rvalues:..." and ends by "[end]"
- Added some untested and commented out code in GuiCombat to use the mouse/touch to setup the damage on the blockers
- Broke the network game ... hoh well, I'll repair it when everything else works !!
- various code cleanup and compilation fixes on Linux
2011-10-26 22:14:12 +00:00
punkeduard@gmail.com
45f09972ad Some fixes to primitives/mtg.txt
Falkenrath Marauders
Witchbane Orb
Nin, the pain artist
walking corpse
Amphin Cutthroat
Serra Avenger

added Gideon's Lawkeeper
2011-10-26 05:24:17 +00:00
omegablast2002@yahoo.com
3757ae2b1a fixed a crash that would occur when you select a player deck then cancel without selecting an ai deck....this also reviles a strange bug, instead of going back to main screen it put you into deck editor. 2011-10-25 11:52:34 +00:00
wagic.the.homebrew
4c42636bd5 - Fixed issues and memory leaks related to decks unlocking
- Fixed an issue where a GameObserver could be null for some mana costs associated to a targetChooser
2011-10-22 13:38:43 +00:00
wagic.the.homebrew
91e9881903 Fix for issue 476 (Test suite debug error in VC++) 2011-10-20 13:22:54 +00:00
Xawotihs
84a074aede Added action logging during attack/block of the AI player. To do that, I wrapped some of the direct access from the player to the action layer into the game observer.
First version where I managed to finish a normal game while undoing several actions until the end. There are still some problems in direct damage spells and interruption management. I added several assert in the code to catch them.
2011-10-16 22:16:47 +00:00
techdragon.nguyen@gmail.com
8554076f3c removed dead code "shuffleTopToBottom()" method. 2011-10-15 21:10:05 +00:00
techdragon.nguyen@gmail.com
189351d82c modified signatures to allow it to pass compilation in XCode 2011-10-15 19:32:00 +00:00
techdragon.nguyen@gmail.com
a1d278a140 updated XCode project file with new class definition 2011-10-15 18:30:12 +00:00
techdragon.nguyen@gmail.com
1018f392b3 changed shuffleTopToBottom method to use STL library to shuffle cards vector.
* This resolves a compiler warning found in XCode.

NOTE: This method is not even called in the code anywhere.  The only reference I can find is in the AladdinsLamp.fire() method, but it's commented out.  This method sounds like it should exist, but nothing is using it.  Was this not working before for Aladdin's lamp, and commented out to get it to sort of work?
2011-10-15 18:29:43 +00:00
wagic.the.homebrew
6825082d6d - Add a simple macro system for auto lines (the goal is to help mostly with repetitive card auto lines such as the ones we have in MotD mod) Check the MotD mod for examples.
-- I added an AbilityParser.cpp file, mid term goal is to move AbilityFactory there, so that MTGAbility.cpp becomes a bit less big.
-- I tried to add the file reference in Makefiles, but only tested windows compilation so far
- Fixed bugs related to "castRestriction" variables in MTGAbility. these variables were declared in both the parent and children classes, leading to bugs and duplicate code/content

The test suite passes
2011-10-15 16:19:29 +00:00
techdragon.nguyen@gmail.com
28069e980b modified iOS touch algorithm to match Android deployment. 2011-10-15 13:48:57 +00:00
wagic.the.homebrew
c32a3b6aa1 Fix a memory leak in test suit player constructor 2011-10-15 02:37:11 +00:00
wagic.the.homebrew
101f2d9ece Adding Google Ads library 2011-10-15 02:06:29 +00:00
wagic.the.homebrew
512f214374 Fix Miraculous Recovery 2011-10-15 02:01:21 +00:00
Xawotihs
5777475340 Fixed a mismatch between the action produced on player click and the related action parsing 2011-10-13 21:34:30 +00:00
Xawotihs
cd4c7ae085 Fixed a crash on undo on windows, and another one when you tried it before any action was done. Undo is still present in the menu even if there is nothing to undo. 2011-10-13 20:58:32 +00:00