Commit Graph

420 Commits

Author SHA1 Message Date
solo81@web.de
715d498bce Added Shimmer Myr and a test for 'forcedalive'. 2011-06-03 20:16:41 +00:00
wagic.the.homebrew
d32ffc5e10 Moved a bunch of old tests related to (fixed) issues to the tests folder, and added them to the tests list 2011-05-29 07:10:14 +00:00
wagic.the.homebrew
a84eb8dc22 -Fix for issue 583 (fireball crash)
-- converted an array into a vector to avoid weird edge cases
-- fixed bugs with array "backupTargets"
2011-05-26 12:27:44 +00:00
wagic.the.homebrew
2f3e6b56e5 - Fix for issue 660 (changelings have become slower)
-- I removed the string comparison, which was expensive (the test is not necessary anymore, since it was "shielding" us from fake types (names), which are not creature subtypes, and therefore do not go through). I also moved one function call outside of the loop, just in case that wasn't optimized by the compiler.
- Removed unused Subtypes.cpp function (I don't really want people to use it, it can be quite expensive if used incorrectly)
- moved a test for issue 501 that has been fixed a while ago (we forgot to add the test to the test suite)
2011-05-15 14:38:41 +00:00
wagic.the.homebrew
aed68a2cd9 Fix for issue 652 (Use Tidal warrior several times causes a crash) 2011-05-10 11:37:46 +00:00
solo81@web.de
465163cf3b Added a test for Celestial Sword, representing a small card group with complex "newability" structures. 2011-05-08 13:51:30 +00:00
wagic.the.homebrew
2c0b5baab7 Fix for issue 647 (Evil Presence cast on a swamp removes mana ability) 2011-05-08 09:06:56 +00:00
wagic.the.homebrew
f96635541d - Fix for issue 650 (tidal Warrior effect doesn't end at end of turn)
- Fix PSP compilation
2011-05-07 04:10:47 +00:00
wagic.the.homebrew
1e2ed785eb Fix for issue 646 (Tidal Warrior) 2011-05-06 02:27:49 +00:00
wagic.the.homebrew
748af5b461 - Adding a generic "ueot" effect. This will be initially confusing, but the ultimate goal is to get rid of all the particular cases we handled with "until end of turn" effects. this "ueot " works like "may " and "choice ", it has to be at the very beginning of the ability(ies) it targets. The reason is to avoid conflicts with the existing "ueot" we have all over the place. I have only tested it with transforms and loseabilities for now (see "ovinize") but hopefully this will become the new norm. This should also reduce the code inside the parser, long term.
- Adding "Ovinize" as an example of this new keyword.
- moved "parseBetween" in utils as I am using it in other files for wome work in Progress.
2011-05-05 06:18:50 +00:00
wagic.the.homebrew
d922d4fe06 - Added "loseSubtypesOf(type)" ability. For example, loseSubtypesOf(land) means "target loses all its land subtypes"
- Added Evil Presence, as an example of the new keywords loseabilities and losesubtypes. It's quite experimental but I added 3 tests that cover the basics. Please report if you find bugs.
- moved the "lands produce mana" rules outside of the primitives, and into the external rules. This was a necessary step to create cards such as Evil Presence. 
- real support for subtypes. Needs some more testing, but there are now functions in Subtypes.cpp to know if a given subtype is a creature subtype, or a land subtype, etc...
- minor refactor of MTGDeck.cpp

Notes:
- I checked that the AI can still use lands
- This change has a bad impact on primitives loading performance (thanks Wil for the loading time output). This is probably due to suboptimal algorithms and data structures for subtypes. If the impact is strong on lowend devices, I can probably optimize a bit (the map subtypesOf could be changed into a vector with some work)
- The test suite passes, added 3 tests for evil presence.
2011-05-04 04:04:03 +00:00
omegablast2002@yahoo.com
feee31a360 updated kicker test by adding "choice 1" pay kicker, it will have no effect on "always pay" option, but if a player has "offer choice" they will still pass... 2011-04-22 11:18:47 +00:00
omegablast2002@yahoo.com
09dd5dbc52 updated livingland test to show that it is following the rules. 2011-04-19 18:06:46 +00:00
wagic.the.homebrew@gmail.com
70b93482b3 - fix incorrect test generic/trigger_blocking.txt
- Updated version number to 0.15.1
2011-04-11 11:12:56 +00:00
omegablast2002@yahoo.com
dae5478084 move rainbow efferts test to test folder 2011-04-03 10:16:55 +00:00
wagic.the.homebrew@gmail.com
77a1e98bc3 Adding test for issue 616 (Rainbow Efreet phase out) 2011-04-03 03:17:36 +00:00
omegablast2002@yahoo.com
3789c947a3 had to update this test since the hard coded living artifact was actually incorrect. 2011-03-31 16:16:09 +00:00
wagic.the.homebrew@gmail.com
3c691b6741 - Fix for issue 614 (removed hardcoded Howling Mine)
- Fix for issue 615 (Linux/PSP compilation error)
2011-03-31 09:38:04 +00:00
omegablast2002@yahoo.com
32556ff5c7 added 2 test showing that the emperor crocodile is destroyed afterward (shows that the effect is not treated as a oneshot)
and another that shows that it is destroyed immediately when entering an empty battlefield.
2011-03-27 19:46:12 +00:00
omegablast2002@yahoo.com
142ae40133 updated thallid test to look for the correct token id...this is why you should not add multiple tokens for the same creature as entries in card.dat...thallid looks for -1924...the original id....-11492115 is a new card.dat info which was added and i complained about the constant fails in the test suite from these types of additions.
this was intruduced as a workaround to force a card to be able to display muliple types of tokens, which wagic can support with this workaround but causes fails in test suite....

Sarpadian Empires, Vol. VII

this is the card that created this fail.

in the future we need to be careful about adding tokens to card.dat...there are 2 different systems for getting a token to appear for a card. lets use what we have.
2011-03-24 19:07:45 +00:00
wagic.the.homebrew@gmail.com
b021417324 Erwan
-fix for issue 604 (Land play limitation should not apply in all cases)
-- this adds a "castMehod" variable to MTGCardInstance. IF this variable is 0, the card was not "cast" (or for lands, "put into play" as part of the lands rule), but "added" to the battlefield with some other effect. On the other hand, if this variable is set, it means the card was cast 
-- as we discussed, I did not touch the "alternateCostPaid" variable, as I'm still not really sure these two concepts are actually the same
2011-03-02 13:41:24 +00:00
omegablast2002@yahoo.com
4b944bd345 updated this test as it hlycon was changed recently to include "from(myhand)" for "cast" effect...the test now actually cast grizzly bears from your hand.... 2011-02-25 18:22:19 +00:00
wagic.the.homebrew@gmail.com
db0c55b4dd Erwan
- Fixed an issue with maxCast targeting opponent
2011-02-16 14:35:49 +00:00
wagic.the.homebrew@gmail.com
8dd6856453 Erwan
- fixed issue 595 (MaxCast not working). Root cause was the stupidest typo ever in the code (maxCost instead of maxCast...)
- fixed an issue with Storm mentioned by zethfox (was counting only spells played by current player)
- Moved "max lands per turn" rule outside of the code (yay!) Please be sure to update your Rules folder!
2011-02-15 14:17:34 +00:00
wagic.the.homebrew@gmail.com
8eac9c587e Erwan
- added maxCast and maxPlay abilities, this deprecates the following abilities: nospells,nocreatures,onlyonespell,land
I usually don't like to deprecate abilities, but the existing ones, despite having easy to remember names, were really not flexible enough.

If you want to use these old keywords, instead use:
-- nospells  =>  maxCast(*)0
-- onlyOneSpell => maxCast(*)1
--nocreatures => maxCast(creature)0
--land:1 => maxplay(land)+1

note maxPlay and maxCast. They follow similar rules, but maxPlay monitors the number of cards that are going on the Battlefield, while maxCast monitors the stack. In most cases, maxCast should be the one to use, but lands are a special case because they go directly to play.

I unfortunately cannot guarantee I didn't break anything, especially in the AI, but the test suite passes ,and I added a few additional tests yesterday and today, to feel more confident about the change.

next step is removing the creatures keywords that do the same kind of thing (cantcast, etc...) and replace them with maxCast
2011-02-13 08:01:13 +00:00
wagic.the.homebrew@gmail.com
60017a6652 Erwan
- replaced variables canPutLandsIntoPlay and landsPlayerCanStillPlay with a PlayRestrictions class.
- Added  seenThisTurn(TargetChooser * tc) in MTGGameZones, which allows to count how many cards matching a targetChooser have been in a given zone in the current turn. With minor work, this can probably be reused by the ability parser for some cards that need to count how many **** where played or put on the stack during a turn.
-- for example player->game->stack->seenThisTurn([put a TypeTargetChooser("creature") here]) would give you the number of creature spells cast by the player this turn.
- This is the first step of a refactor that aims at removing all the adhoc variables for "cant cast". I plan to get rid of the following variables in Player.h (and the associated code, which hopefully will become smaller):  
    int castedspellsthisturn;
    bool onlyonecast;
    int castcount;
    bool nocreatureinstant;
    bool nospellinstant;
    bool onlyoneinstant;
    bool castrestrictedcreature;
    bool castrestrictedspell;
    bool onlyoneboth;
    bool bothrestrictedspell;
    bool bothrestrictedcreature;

They will be replaced by the PlayRestrictions system, and hopefully I'll have time to update the parser to make this more generic as well.
My initial goal with this change was to move the limit of 1 land per turn outside of the code, and make it an external rule in Rules/mtg.txt. I have yet to do it.
2011-02-12 16:31:07 +00:00
omegablast2002@yahoo.com
22adbe4ab7 i updated this test since i updated corveous dragon to use sacrifice keyword...the test was putting him in play first, which resulted in instant sacrifice...moved him to be the last "inplay:" card 2011-02-03 13:04:37 +00:00
solo81@web.de
938e31a258 Fixed old helm_of_kaldra.txt.
Now that Helm of Kaldra's code is complete i had to add a "choice 0" to this test.
2011-01-29 21:52:53 +00:00
solo81@web.de
ac3b65995b - Added MBS. 124 out of 155 could be added (that's over 80%).
- Added a test for livingweapon.

- Reverted one part of rev2975.
2011-01-29 20:46:37 +00:00
solo81@web.de
5e4902c229 - Completed code for Helm of Kaldra.
- Added Kaldra token (keyword:"newtarget" --> rev2922).

- Added test for Kaldra.
2011-01-29 16:05:01 +00:00
solo81@web.de
2bcf7ecdff Added 650 new cards based on rev2922.
Playable Highlights are:

Psychatog
Grim Lavamancer
Anurid Brushhopper
Flameblast
Thwart
Baron Sengir
Sengir Vampire
Stuffy Doll
Undiscovered Paradise
Gush
Heritage Druid
Mageta the Lion
Faceless Butcher
Mesmeric Fiend
Oblivion Ring
Parallax Wave
Knight of the White Orchid
Contagion
80 creatures with Morph (Exalted Angel,etc.)

Added 27 tests.

Card list -> see comments. The list is separated into the single card groups.
2011-01-23 12:41:11 +00:00
leungclj@googlemail.com
434d527833 leungclj - correction of last submission 2010-12-29 13:06:51 +00:00
leungclj@googlemail.com
0311cfd1eb leungclj - Added test for indestructible, also submitted issue for indestructible bug. Please refer to "indestructible_2_i569.txt" 2010-12-29 12:55:44 +00:00
omegablast2002@yahoo.com
99266ebae4 corrected mikes ABSOLUTE fail attempt at a test. yes, im pissed off. RUN YOUR TEST IN SLOW MOTION PLEASE!!!! THANKS! 2010-12-15 19:26:22 +00:00
wagic.the.homebrew@gmail.com
6c9d2db493 Erwand
-adding tests for issue 562 and issue 563
2010-12-15 13:36:11 +00:00
techdragon.nguyen@gmail.com
2fdf538014 Added another test for 559 to verify cards like Halcyon Glaze works as specified.
Note this particular aspect of the "becomes" ability was not broken prior to the fix for 559.  This is a sanity check as it has nothing to do with color change. but tests ability changes due to "becomes" ability.

Issue: 559
2010-12-13 16:58:37 +00:00
wagic.the.homebrew@gmail.com
1046ffac02 Erwan
- fix for issue 559 based on Mike's suggestions. The test suite passes
2010-12-13 13:59:07 +00:00
solo81@web.de
e5754cbfb4 Fixed issue531. 2010-12-12 16:18:19 +00:00
omegablast2002@yahoo.com
5713a45006 reverting this test back to yesterday 2010-12-09 13:32:34 +00:00
techdragon.nguyen@gmail.com
b595091855 moved tests for rakdos pit dragon into bugs folder until issue 555 is resolved. 2010-12-09 07:58:58 +00:00
techdragon.nguyen@gmail.com
dbb3e04de1 replacing old tests with new more complete tests for radkos pit dragon.
Note: currently two of the four tests fail due to issue 555 which is unresolved.
2010-12-09 06:14:33 +00:00
omegablast2002@yahoo.com
079d2dbd22 updated this test as it uses the trigger step, note: the 7 or so trigger based test dont want to actually test in test suite...i tried correct a typo in the _test.txt they have an extra "S"...but still they did not get tested...any ideas? if you can get them testing, please remember the combat ones need an extra next directly before the "next for combatdamage. 2010-12-08 14:34:17 +00:00
wagic.the.homebrew@gmail.com
c28c14171f Erwan
-fix for issue 489 (protection prevents some triggers to happen)
2010-12-07 14:12:04 +00:00
wrenczes@gmail.com
ffd3b7b074 At Z's request, fixed Issue 184, ExtraCost types with targets such as Siege-Gang Commander/Drowner of secrets combined with targeted abilities bug.
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.
2010-12-06 06:49:36 +00:00
techdragon.nguyen@gmail.com
8c7e06b6dc fix for issue found in forums with reinforcements. Not sure how wide spread the original coding will cause errors but this solution avoids it entirely.
Issue: 527
2010-11-22 21:38:12 +00:00
techdragon.nguyen@gmail.com
f16192f685 added in missing tests for primeval titan and sun titan. ( these were not added on initial change )
fixed definitions for sun titan and primeval titan. ( these were clobbered with the latest changes. )
2010-11-11 17:05:28 +00:00
wagic.the.homebrew@gmail.com
416617fc0d Erwan
- fixed memory leak in AEquip/ATeach 
- Test suite now trims strings correctly (allows to have space between comma-separated card names)
- Added Paradise Mantle (for ATeach test)
- removed a missing wallpaper from wallpapers list
2010-11-07 02:27:54 +00:00
wagic.the.homebrew@gmail.com
f847bff1d4 Erwan
- adding a test for issue 501 (changeling creatures do not get correct creature types)
2010-10-31 03:19:25 +00:00
omegablast2002@yahoo.com
73b7e8d361 adding a test to insure that a <1 aslongas actually remains on the field if the considiation is false. 2010-10-25 14:42:53 +00:00
techdragon.nguyen@gmail.com
d358f14eed reverting change. thought the card was a black permenant. 2010-10-24 19:14:42 +00:00