* 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.
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 >
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.
I'll also note that the mods I did to getDeckMetaDataById() are completely unnecessary - pragmatically speaking, it's doing the same thing. The only difference is that I'm using std::find_if instead of brute iterator manipulation, and I'm using a predicate function. For a simple check like this, it's kind of pointless, but if you need to do more complex comparisons, predicate operators can become quite powerful.
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.
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!
Also fixed the project includes so that we don't need to always use the indirect include path, ie:
#include "../include/foo.h" -> #include "foo.h"
I'm don't know much about make files - if I busted the linux build, mea culpa, but I think we're okay on that front too. For future reference, here's the most straightforward link on the topic of adding pch support to make files:
http://www.mercs-eng.com/~hulud/index.php?2008/06/13/6-writing-a-good-makefile-for-a-c-project