Commit Graph

329 Commits

Author SHA1 Message Date
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
dae5478084 move rainbow efferts test to test folder 2011-04-03 10:16:55 +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
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
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
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
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
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
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
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
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
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
solo81@web.de
04efd4f78f Added 37 cards based on rev2444 and rev2479. (Card list -> First comment)
Fixed Sun Titan and some other reported card bugs.
2010-10-22 19:37:43 +00:00
solo81@web.de
e8a44cc375 - Added 242 successfully tested cards based on rev2444 (Card list --> First comment).
- Optimized 163 cards (Card list --> First comment). 
Most of them profit from the much more detailed combat trigger system and the new types of damage prevention.


- Added 17 tests to save Zethfox's additions for the future.


- Fixed issue182.
2010-10-20 19:13:17 +00:00
wagic.the.homebrew@gmail.com
f5575ac68e Erwan
- Updated fix for Dragon Broodmother
2010-10-18 13:33:54 +00:00
omegablast2002@yahoo.com
1071dbf738 2010-10-17 14:03:51 +00:00
solo81@web.de
98926caaa8 Added 5 tests to safe
aslongas + <
aslongas + >
aslongas + trigger

for future code changes.
2010-10-15 20:32:15 +00:00
omegablast2002@yahoo.com
2f73400cbb updated _test, and rewrote bug test to safe "aslongas" effects in the future. 2010-10-15 15:21:55 +00:00
solo81@web.de
ce934123b0 Added a test for issue483.
Fixed Lux Cannon.
2010-10-12 15:05:52 +00:00
wagic.the.homebrew@gmail.com
508040b3a7 Erwan
- fix for issue 467 (simultaneous triggers + "trigger" keyword)
- MootPoint's patch for some string parsing
- some random int/float compilation warning fixes
2010-10-01 16:33:07 +00:00
wagic.the.homebrew@gmail.com
5de20792fd Erwan
- revert a mistake with tests from r2342
2010-09-28 22:37:28 +00:00
wagic.the.homebrew@gmail.com
b79c7eea53 Erwan
- fix for issue 462 (graphical glitch when cards come back from graveyard)
- adding Kaioshin's wallpaper
- fixed minor issue in mtg.txt
2010-09-28 13:58:22 +00:00
solo81@web.de
56a6c7b6f6 Readded Mephidross Vampire.
Added a few tests.
2010-09-26 13:53:25 +00:00
wagic.the.homebrew@gmail.com
82ab92a61f Erwan
-fix for issue 408 (issues with life + targetcontroller + targets on the stack)
2010-09-26 12:57:12 +00:00
solo81@web.de
04ae98466b Added the correct test.txt. 2010-09-25 22:13:03 +00:00
solo81@web.de
73e420626e Fixed several card bug reports from the forum. 2010-09-25 21:59:48 +00:00
wagic.the.homebrew@gmail.com
a6e4fba26b Erwan
- fix issue 304 (Momir + persist)
- some minor cleanup
2010-09-25 09:13:30 +00:00
wagic.the.homebrew@gmail.com
f3cc20eb31 Erwan
- Fix for issue 284 (Damage not triggering when creature dies in combat phase)
2010-09-25 05:15:09 +00:00
wagic.the.homebrew@gmail.com
a6a75af52a Erwan
- Partial fix for issue 335. This fixes the general problem of triggers not working in the case @movedTo(Battlefield) from(anywhere), but not the specific case of River kelpie not getting to draw a card after being "persisted"
2010-09-23 08:29:35 +00:00
wagic.the.homebrew@gmail.com
bba6274f8b Erwan
- fix from issue 439 (skullclamp)
- reorganized a few files in VC++ project
2010-09-23 04:46:43 +00:00
solo81@web.de
2b81ba33f2 Added 33 successfully tested cards mainly based on rev2272.
2 example cards:

[card]
name=Decree of Justice
auto=token(Angel,Creature Angel,4/4,flying,white)*XX
autohand={2}{W}:cycling
autohand={X}{W}:name(cycle and soldier tokens) && cycling && thisforeach(X) token(Soldier,Creature Soldier,1/1,white)*X
text=Put X 4/4 white Angel creature tokens with flying onto the battlefield. -- Cycling {2}{W} ({2}{W}, Discard this card: Draw a card.) -- When you cycle Decree of Justice, you may pay {X}. If you do, put X 1/1 white Soldier creature tokens onto the battlefield.
mana={X}{X}{2}{W}{W}
type=Sorcery
[/card]

[card]
name=Stormbind
auto={2}{D}:damage:2 target(creature,player)
text={2}, Discard a card at random: Stormbind deals 2 damage to target creature or player.
mana={1}{R}{G}
type=Enchantment
[/card]


Added 2 tests for the keywords introduced in rev2272.


Corrected several card bugs.
2010-09-12 17:45:59 +00:00
solo81@web.de
a417da60c7 Added a test for flashback. 2010-09-11 13:02:04 +00:00