ok here goes, first, fixed a crash that would happen when ever a player would gain more then 2000 life or take more then 2000 damage...the buffer was becoming corrupted i imagine because it was too small, increasing it to 10 slots allowed players to successfully take massive amounts of damage, highest i bothered checking was about 35k gained/lost, no crash...
2nd, removed the and refactored cantcaster rule, moved it to stateEffects() and renamed stateeffects to better reflect what it will be handling,
removed sneak attack rule and moved it into stateeffects
the following ints have been converted into bool,
all the cantcasters, canputlandsintoplay is becoming a bool, the amount of lands you can play is now handled by a new varible int landsPlayerCanStillPlay (this is for my ability additional lands increase in support on perminents coming after the release)
the changes to bools were for an obvious reason, they were all ints pretending to be bools, my varibles were confusing as you would often see code like this if(cantblahblah > 0)
which to another coder might not make any sense.
these varible ints were returning 0 as false and 1 as true...changed them all to bools, same goes for putlandsinplay int, in half the places it was being used as a bool, AND it was tracking the amount, when i was coding additional land ability, this made it impossible to maintain correct amounts without damaging the rest of the code.
as a bool, controlled by stateeffects, it can now be used correctly as a bool in all cases, and the stateEffects manages the switch on it to false if you no longer have any landsPlayerCanStillPlay left.
the refactor on cantcaster was also a bug fix, it was reported to me that cantcasters were not correctly working, sometimes ai or player would still be allowed to play a card with one in play, because of the old way i had it setup somecases of bothcantcaster were reseting the cantcast to 0, basically making the check do nothing.
it is now handled in stateeffects if you have one in play, then its true, if not then false...this returns very accurate tracking of the cards instantly instead of checking as cards enter or left play.
the "both" versions now have their own bools to avoid future conflicts with the single player cantcast...
added a case for the fancy moving text, some move to library effects were incorrectly returing fetch.
- computeActions would leak a ManaCost. This was fairly minor.
- AIPlayer::SelectAbility had a major leak. Basically, there's some code that pulls a random number for an efficiency check - if the action's efficiency value was below that random number, the action pointer was cleared, and none of the actions that were to be discarded would be deleted out of the rankings map. I've switched out the rankings container to not contain action pointers, but real action objects, so regardless what kind of logic is implemented, the map will properly clear out its objects upon destruction.
-Attempt at fixing issue 538. This is a wild guess, but basically 1 000 000 bytes is NOT enough to decompress a 512*512*4 texture (32bits png). We need at least 1MB (1024*1024) AND some additional space for the decompression process. Based on that, bumped the 1 000 000 (minimum contiguous ram necessary to start decompressing a picture) to 1 500 000. I've had pretty good results so far but this needs confirmation
- GameObserver <- changes from Win to *nix carriage returns.
This one was a bit of a doozy to fix correctly, but the actual fix ended up being fairly simple - the upshot is that TargetAbility never checked for whether an extra cost needed setting prior doing a target selection. While at it, I discovered and fixed another bug: if you're in the middle of an extra cost choice (like sacrifice, for instance) and hit the next phase button, the game would let you proceed, and then hang in an endless loop.
While at it, did a little cleanup/refactoring around GameObserver's waitForExtraPayment - any time a bool has something that sounds like a verb, it probably deserves to be a function. Now it is. (I needed to refactor it anyway, as I reused that code for the next phase hang.)
Note that after this fix, I had to patch two test cases (siege_gang_commander.txt & seismic_assault.txt) - since I've change the selection order (ie a target ability with a sacrifice cost requires the cost to be paid up front before picking the target), this means that tests involving targeting & sacrifices need to switch the order of the cards to pass.
fixed the bug where the ai "attacks/blocks" its own attackers during the combat phase.
Strangely, creatures only die in this bug when there are two or more suffering from
summoning sickness.
If somebody can double check this code change to make sure that it is appropriate.
My playtesting indicates a success but I don't have the variety of player decks others have.
The check to give the award was lost in some of Jeck's reorg work (R1825), as ShopItem was deprecated & folded into GameStateShop. While at it, I took the liberty to delete ShopItem.h/cpp since they're not used.
I've patched the problem so that ActionLayer checks for a valid ID before doing anything, and does a no-op for IDs it doesn't know how to handle. However, this only fixes the problem during gameplay. It's quite possible that hitting the triangle button in other places in the app might equally cause a crash.
Issue: 544
fixed a Ai related bug, taught Ai not to mill itself to death basically. played a few matches which Ai was just destroying himself with a creature that allowed him to draw cards for each(whatever) in play. Ai will be a little more careful not to kill himself by Mill, also not to draw 30 cards in a turn when it clearly cant play them.
this also fixes the spamming of Abilities like Ai atempting to untap something more then once, or Ai uses regenerate ability multiple times on the same creature.
there will be no noticible difference in Ai game play except now it actually doesnt do the above mentioned bugs.
While debugging this, I noticed a separate issue: when changing profiles, we'd actually call refresh twice. Removed the spurious call, as reloading profiles doesn't need to concern itself with the image cache - that's already covered by the game options menu.
Also did some minor formatting / cleanup in the JGfx code for PSP - stubbed out a bunch of JLOG calls I had put in while debugging the PNG loading code.
added new mana display option "No Glitter" acciddently(?) lost "both" options somehow.
the new "no glitter mana display is basically "eye candy without particle effects" on PC created 2000 mana...no FPS drop...on PSP created an EXTREMELY large amount of mana before i noticed an FPS drop of any kind, this is dramatically better then
what was in previous rev, create 20 mana and crash.
if someone could figure out how i manage to lose the "Both" option, please explain to me why it wasnt showing up, i spent 2 hours trying to get it back.
both "optimize starting hand" and "Unlock all Ai Decks" appear in options under the option to "enable cheats"
optimize gives you decent starting hands, and Unlock all Ai decks is basically just a bypass options for the unlock deck mode varible wololo added.
tweaked abilitygranting Eff in Ai lessons to be divided by the number of cards in hand, this will mean Ai will tend to focus on using mana to cast spells instead of using them to grant abilities, until theres only 1 or less cards in hand, at this point it will go all out. there is a splash of randomness in Ai so it will still often do whatever it freaking wants lol, you should notice a proformence increase from Ai in this aspect. no more giving unblockable to a creature in 2nd main.
please note, one of the recent previous revs broke cheat mode "unlock cards" in deck editor, i filed a bug report. its a probelm i was not able to fix myself so there is no fix included in this rev....i came across the bug while testing cheat mode stuff.
- Added AI Decks unlock system. Please update your graphics folder, and crossing fingers that Ilya B. is still around as I don't have the correct fonts.
with this change please try playing a few matchs against vanguards chosen and wraith feast, my 2 most favorate decks to fight now. youre in for a treat :)
keep in mind that even tho ive taught Ai Foreach in a somewhat crude manner it still does not understand how much mana it can gain from a foreach manaproducer, and this does not make it suddenly use dark ritual correctly. however this change was dramatic enough that i wanted it in for 14.1
this is also still under massive play testing, however no issues were found so far with it as it is presented here.
created new class VerticalTextScroller to handle task display in deck selection screens
modified detailed popup placement on deck selection screen to compensate for lack of border
* created three new utility functions that return a vector of matching abilities, colors and types
* migrated all activated ability impl into AllAbilities.cpp. Perhaps we could break AllAbilities up into separate impl files for manageability?
One for Activated abilities, another for triggers,etc