Commit Graph

14 Commits

Author SHA1 Message Date
Tobias Loose
1e8fc81aa3 Add/fix broken include guards 2013-11-23 16:09:11 +01:00
Xawotihs
29132073de - Modified DeckManager class to not use a global instance anymore when used within the game engine
- Modified DuelLayers to not use a global MTGPhaseGame instance anymore
- Moved the reset of currentActionCard out of the ActionLayer render function : that fixes the remaing problematic tests in the multithreaded testsuite
- Added a method in ActionLayer converting a card ability into a menu index
- Used this new method in the game observer to log correctly AI ability actions
- Added a DumpAssert method in the game observer, it can be used to dump the game and assert in order to easy crash reproduction
- Cleaned up TargetList properties access
- Added an optimisation in GuiMana to not compute update code if the rendering is not used (multi-threaded mode)
- Added a deadlock detection in the test AI vs AI multithreaded mode
- Fixed minor bugs in test AI vs AI multithreaded mode
- Added a games/second counter in the test AI vs AI rendering
2011-11-23 19:11:48 +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
techdragon.nguyen@gmail.com
93c63cef3d reimplemented mana color display for deck selection. This is now totally controlled by
stats generation.  No data needs to be written to the deck master files themselves.
Now the mana colors will only show if you have battled with a particular deck at least once.
This is not retroactive, so you will need to battle the ai again.  This can not be edited manually
either to prevent tampering with the statistical data.  Player deck mana color display is also
covered this way.

Decks will still be saved in the new layout if a disk write is necessary.  So any changes via
the deck editor will result in a deck file rewrite is was always the case.:)
2011-02-10 17:19:11 +00:00
techdragon.nguyen@gmail.com
767983631a * moved deck saving to end of match. It now only saves when you've actually completed a game.
* added additional meta data for decks when saving them back to file.
  - decks saved this way now are split into three regions: creatures, spells and lands.  It's more for a visual sorting if a
     player wanted to look at the deck outside of the game.  It does not impact the deck loading negatively at all.  It may
     increase performance in cases where the deck was previously defined using the canonical names of the cards as the numeric ids
     reduce the work done when looking up the cards by name.
* modified ManaCost toString method.
* added toString method for ManaCostHybrid ( possibly make ManaCostHybrid a subclass of ManaCost)
* added additional operator overloading for ManaCost for printing to cover ManaCost when it's a pointer as well as a copy
   ( TODO: might want to check if making usage of ManaCost as a copy as opposed to a ptr is really necessary in most cases. )
* added alternate version of "trim" to handle trimming temporary strings as returned by things like ostringstream.str().
 - This was necessary since the PSP compiler doesn't do the necessary adjustments for those types of calls.
2011-02-04 12:37:44 +00:00
techdragon.nguyen@gmail.com
8af5870d48 * Added new options parameter. "SaveDetailedDeckInfo". This will force the system to save all
deck files in long format.  This is not configurable from the game.  It must be set manually
     inside options.txt.
     ie.  saveDetailedDeckInfo=1

* added extra debug information (line number inside text file) when card parser fails to recognize a line.
    - modified return value from "processConfLine()" to return 0 only when a true error occurs and print out
         "MTGDeck: Bad Line:
         [<line no>]: <line with error>"
    - processConfLine will now return 1 for lines starting with "#".  Previously it returned 0 which is incorrect
         as comments should not be considered as errors.

* removed DeckMetaDataList class from code.  This was duplicating the DeckMetaData storage in DeckManager
* new feature for deck selection screens.
   - player decks will now have an indication of what mana color it consists of.
   - Ai decks will show symbols once the player has played against the AI deck at least once.
   -- This is made possible with a new meta data inside each deck file.
        MANA:<string representing color switches - 0/1 >
2011-01-31 10:04:18 +00:00
wrenczes@gmail.com
6675a7da31 Implemented a lazy load pattern for the deck stats - when the DeckMenu is displaying decks, it calls LoadStats() for only the ones visible in the list. This helps reduces the lag that occurs each time we attempt to load all the AI decks during match selection.
This still could be improved - DeckMetaData's constructor loads an MTGDeck object to parse out the name of a deck from its file.  This means that we crack open 106 files on the first attempt to show the list of opponent decks. I started optimizing this, but reverted, as the list itself is sorted alphabetically.  Currently, with these mods, it's still taking 4 1/2 seconds on my psp to load the opponent list on the first go around.

While at it, did some cleanup - removed the need for passing around a player pointer in some of the DeckStat functions, etc.
2011-01-30 13:06:21 +00:00
wrenczes@gmail.com
32cabc15c2 Forcing LF as the line ending style through SVN properties. No actual code changes here. 2011-01-28 06:00:51 +00:00
techdragon.nguyen@gmail.com
ce7745bfa6 First attempt to reduce load time of player deck selection screens.
This change makes use of caching the DeckStats and DeckStatsWrappers into singleton caches that
get flushed when you quit the game.  The initial load time will be significant as lazy loading has not
been coded yet for the ai decks.

TODO: lazy load the player and ai decks as they appear on the screen.  Currently, each screen loads
all decks.
2011-01-27 16:13:40 +00:00
techdragon.nguyen@gmail.com
e53c16f700 No code change just reformatting of header files.
finishing up my reformatting of the source from November/December following the guidelines that were posted.
some extra things I added:
   * Any empty virtual declarations were kept to one line.  
   * Enums were split up into separate lines to promote uniformity across all headers. ( each header file had a different style for enums)
2011-01-21 18:01:14 +00:00
omegablast2002@yahoo.com
ed03d2f3ef added optimizing of opponents hand if the opponent deck is listed as "easy". slight optimize if listed as "normal" none if listed as "hard" this provides slightly more challange from even poorly constructed Ai decks. taught Ai to pump creatures during combat, and more so if its heading directly at player, taught Ai that its better to use "becomes" and "transforms" during first main. this allow its to actually attack with the manlands ect.
new ability lord...teach(whatever[whatever]) ability.
teach is a targeted lord, it takes the cards current target and lords it the ability. im aware of a tiny memleak it contains, but the leak is happening on parser lvl, so i need more eyes to look at it. teach is ideally used for equipment, and was designed to fix issue 244 taught abilities are not given to the source cards.

forced Ai to pay for sunburst correctly. it was choosing to pay with all of one type of mana. now it pays either max or 1 from max sunburst.

added a tiny double check for Ai to try and find something to use if it suddenly has mana in its pool. it is only a single check in a turn, but i notice it actually does slightly improve the usages of dark ritual and foreach mana producers. ideally i wanted it to check EVERYTIME. but i could not achieve it without putting the game in danger of looping. so once is better then none :/

fixed a bug with affinity where it was not counting duel lands, this is becuase of not setting it up correctly for lands with multiple types SORRY!
2010-11-06 06:59:43 +00:00
omegablast2002@yahoo.com
29baed7d4a tweaked MNguyens menu improvements by Mnguyen 2010-09-17 09:07:09 +00:00
omegablast2002@yahoo.com
5939cbded8 added MnGuyens further improved menu handling and extra options. 2010-09-17 06:34:12 +00:00
omegablast2002@yahoo.com
79ea200d97 Added MNGuyen's improved and alphabatized deck handling(noticeable speed increase btween menus) and almosthumane's automated pass phase option. 2010-09-08 11:44:11 +00:00