Commit Graph

4025 Commits

Author SHA1 Message Date
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
Xawotihs
0b6044551a - Added new code for serialization/deserializaiton of full games including initial game and all the player actions.
- Added an undo menu using this code (beware, it's still very very alpha).
- Removed various warning
- Cleaned up avatar loading
- Added full random lists load/save including the deck shuffling (not sure if I could not replace that with seed load/save)
- Moved momir and Co rules configuration out of GameStateDuel
- Create a GameType type to avoid mixing int everywhere
2011-10-13 19:43:51 +00:00
rodrigodemoura@gmail.com
663058cdab Remove all _Myfirs from vectors. 2011-10-13 18:00:16 +00:00
guzhenjie1@gmail.com
71949f636d Corrected Undead Alchemist and rarity of Skaab Ruinator. 2011-10-13 14:44:32 +00:00
rodrigodemoura@gmail.com
e6b199f599 Modifications to make the game more generic.
Included in a new modrules.xml tags.
 <cardgui>
   <background> Stores information concerning the colors </ background>
   <renderbig> Stores information to draw the card </ renderbig>
  <rendertinycrop> Stores information to draw the card </ rendertinycrop>
 </ cardgui>

 Change the variables array for vectors
2011-10-13 12:25:58 +00:00
guzhenjie1@gmail.com
dee49728aa Removed all { } inside "name(" code in following cards:
Azorius Herald
Boros Fury-Shield
Dryad's Caress
Ogre Savant
Patagia Viper
Plaxmanta
Ribbons of Night
Rolling Spoil
Seed Spark
Steamcore Weird
Tin Street Hooligan
Vigor Mortis

Replaced all counter(1/1), counter(1/2) and counter(2/2) to counter(1/1,1), counter(1/2,1) and counter(2/2,1).
2011-10-11 12:46:43 +00:00
omegablast2002@yahoo.com
6fa016ca54 corrected my logic, for some reason i remember clearly already having moved this line, but i guess it didn't make it into the last change i did to choosecard function. THIS is what it was meant to do...
also corrected an issue with the changed logic of ALife eff return. you have to take into account that "{cost}:life:200" <---is not targeted so there is no player targeting involved with such code, making the eff return always 0 in cases where you don't have {cost}:target(player) life:200...i might need to review the eff returns to check that there are not other cases similar to this, :P my original code there was messy but took that into account. so careful with refactors in this area.
to see how this function was intended to work, try the following lines on any card

auto={t(creature|opponentbattlefield)}:life:233
auto={s(creature|mybattlefield)}:damage:4 target(player)
2011-10-11 11:14:55 +00:00
omegablast2002@yahoo.com
e1620c0a5f re-added a line which was removed in r4000, when ai is forced to "chooseCard" through the effects of "choice " or "target(" and a valid target exist, we run into a lock down becuase we don't switch playerZones to the other players game after the first run of the playerZone...the TC will see that there is indeed a valid target however, since it can not target the other side it will contenue to try over and over, locking it up. 2011-10-10 14:34:55 +00:00
omegablast2002@yahoo.com
e3d0ab8ba0 corrected a mistake i made with name and other manacost, I meant to erase the name from value not s this caused strange issues when a name was given to a "other" cost which contained an actual parseable mana cost inside.
do note tho, our text menues will not display "{" and "}" charectors, so its best to keep them out of "name(" anyways as they serve no purpose.
2011-10-10 14:20:50 +00:00
omegablast2002@yahoo.com
516089869d phased cards shouldn't be removed from the game by treason or the effects of unearth if they we're phased out by an effect during the turn in which they were to be destroyed. 2011-10-10 14:09:04 +00:00
omegablast2002@yahoo.com
060164acce copy function grants the source of the abilities the castMethod of "notcast" which is default, however for cards which are played, such as vesuva on "copy" it would be granted a "not_cast" as its play method, allowing players to play another card of the type that a restriction would normally prevent you from playing...this effected all cards which "copy" such as shapeshifters.
note: I do know it's as dirty as "mtgidbackup" but unfortunately I don't think there would be a simpler way to maintain it's cast method.
2011-10-10 13:41:38 +00:00
wagic.the.homebrew
c17d07d476 Minor simplification of MTGRules.cpp 2011-10-10 13:27:30 +00:00
wagic.the.homebrew
e17b20c9d8 Adding a test for issue 718 (vesuva land limit) 2011-10-10 12:47:58 +00:00
wagic.the.homebrew
f0964d9af8 Fix issue 563 (double strike VS regenerate)
-- also made "blocked" variable a private.
2011-10-10 12:29:52 +00:00
guzhenjie1@gmail.com
9b2654997e Added ID for all double faced card.
Corrected ID and typo of following cards:
Deranged Assistant
Gatstaf Shepherd
Ludevic's Test Subject
Mirror-Mad Phantasm
2011-10-09 10:38:03 +00:00
wagic.the.homebrew
9dbe0e2a53 Adding Italian cards translation by kabir94 (don't know why I didn't notice it before) 2011-10-09 07:43:15 +00:00
techdragon.nguyen@gmail.com
a33d862d4b updated XCode project to be on latest SDK
fixed a few minor warnings.
2011-10-09 07:06:32 +00:00
techdragon.nguyen@gmail.com
6f10ef8425 fixed last check in. Test suite passes. Added comments on possible null pointer exceptions.
Updated XCode project file to include AIPlayerBaka classes.
Added test suite to iOS build
2011-10-09 05:51:45 +00:00
wagic.the.homebrew
2bfe76e124 - Android: landscape only ( issue 668 )
- Android:  changed application package name ( issue 730 ) - also changed the publisherID to avoid confusion with the alpha, which is 3tied3 to org.libsdl.app
2011-10-09 04:53:21 +00:00
techdragon.nguyen@gmail.com
fbe2e44814 fixed memory leak in double tap gesture
fixed some compiler warnings
removed dead and useless code
2011-10-08 00:56:07 +00:00
Xawotihs
9f09bbeec3 Removed compilation warnings. 2011-10-07 15:25:15 +00:00
Xawotihs
c0c8688ede Fixed yet-another-retarded warning. 2011-10-05 21:26:40 +00:00
Xawotihs
c2ad12443f Removed compilation warning 2011-10-04 20:06:59 +00:00