Commit graph

2540 commits

Author SHA1 Message Date
Evan Kranzler
7f32ea0be2
Updated implementation of Hexproof abilities (#6451)
* updated implementation of hexproof abilities

* added hexproof from color test

* updated generic in AbilityPredicate
2020-04-23 20:01:13 -04:00
Evan Kranzler
214765ddd8 added a test for The Ozolith 2020-04-21 18:58:58 -04:00
Oleg Agafonov
ccd95cdd71 * Boost effects - fixed wrong text for zero values (-0/-1, -1/-0, etc); 2020-04-19 22:27:03 +04:00
Oleg Agafonov
fa75a89946 Fixed tests 2020-04-18 17:10:15 +04:00
htrajan
1dc305f329 -setStrictChooseMode and assertAllCommandsUsed in every test
-store filter info in GameState
-put instead of putIfAbsent
2020-04-16 19:21:54 -07:00
htrajan
7c4d86f583 add author tag 2020-04-16 18:11:56 -07:00
htrajan
92d6326316 finish 2020-04-16 17:50:17 -07:00
htrajan
a08bd34582 Merge branch 'master' into implement-zilortha
# Conflicts:
#	Mage/src/main/java/mage/game/GameImpl.java
2020-04-16 15:55:24 -07:00
htrajan
cab436e9e5 wip 2020-04-16 15:53:51 -07:00
Evan Kranzler
916ff26070 Update UnpredictableCycloneTest.java 2020-04-16 08:15:52 -04:00
Evan Kranzler
378dfbf89a
Updated implementation of Unpredictable Cyclone (#6423)
* updated implementation of Unpredictable Cyclone, refactored drawCard method

* fixed another small implementation error

* added test for Unpredictable Cyclone

* updated Unpredictable Cyclone test
2020-04-16 08:04:21 -04:00
Oleg Agafonov
10348faaec Fixed missing serialization settings (#6420); 2020-04-16 09:17:41 +04:00
Oleg Agafonov
79c5c7a6a5 Test framework improves (Monte Carlo AI):
* Added support to test Monte Carlo AI (CardTestPlayerBaseWithMonteCarloAIHelps - any aiXXX commands);
* Added Quick Start button to test Monte Carlo AI games (MCTS);
2020-04-14 20:09:36 +04:00
Oleg Agafonov
a7ac35a82d Test framework improves:
* Added AI commands support to play attacker and blocker steps;
* Fixed double triggers of blocker declared event (if block command used with block requirement effect);
2020-04-14 20:05:25 +04:00
Thomas Hess
6fd8b0a80b
Fix booster generation issues with Mystery Booster set.
- Split the foil sheet into a separate set as listed on Scryfall.
- Added unit test cases that verify booster generation.
2020-03-18 14:51:52 +01:00
Oleg Agafonov
2b78ec745c * Mind's Desire - fixed that it doesn't work with split cards (#6337); 2020-03-12 04:07:17 +04:00
Oleg Agafonov
a20bca1b21 Test framework: fixed ai play commands, added more tests 2020-03-12 02:05:06 +04:00
Oleg Agafonov
14ddb6eb28 * AI: fixed wrong targeting for gain control abilities (#6340); 2020-03-11 18:22:58 +04:00
Oleg Agafonov
86f6d39f5a * AI: fixed rollback errors on play cards with target stack (Diplomatic Escort, Not of This World, etc); 2020-03-09 13:49:07 +04:00
Oleg Agafonov
a6ab40dc57 Test framework: added strict mode support for full simulation commands (aiXXX); 2020-03-09 12:34:05 +04:00
Oleg Agafonov
70bf13359a Test framework: improved alias support:
* added alias support in castSpell command;
* added alias support in activateAbility command (example: `@ref ability text from ref card`);
* added alias support in activateMana command;
* added alias support in some assertXXX commands;
2020-03-09 05:49:03 +04:00
Oleg Agafonov
cb8d4dc340 * Non creature tokens - fixed rollback errors in AI games (example: Food token, see #6331);
Fixed other potentially NPE errors with rarity;
2020-03-06 03:27:46 +04:00
Oleg Agafonov
2e73f9d1c5 * UI: added turn number and step info in game logs 2020-02-28 20:27:07 +04:00
Oleg Agafonov
169d9bf761 * Non basic mana abilities - fixed rollback errors in AI games (#6300); 2020-02-25 12:41:45 +04:00
Oleg Agafonov
b5acf64772 * Monohybrid mana cost improves:
* fixed wrong manually pay by mana pool (it pays generic cost instead colored part of monohybrid);
 * fixed not working cost reduction effects (now monohybrid cost will be reduced correctly with some limitation, see #6130);
2020-02-11 22:33:32 +04:00
Oleg Agafonov
13ad86cb21 Test framework improves:
* added aliases support to many assertXXX commands (check objects by alias/GUID instead card name);
 * added mode to test/simulate human's mana pool usage without auto-payment (enable it by command disableManaAutoPayment, fill mana pool by activateManaAbility and simulate clicks on mana icon by setChoice);
 * improves activateManaAbility command (you can activate it multiple times by one command);
 * improves setChoice command (you can activate it multiple times by one command);
2020-02-11 20:04:19 +04:00
Samuel Sandeen
d56f6b991b
Fix Sevinne's Reclamation. (#6275)
This also handles the rather unique case caused by Sevinne's Reclamation where the original spell resolves before the copy of it.
Also fixes a couple typos.
2020-02-10 08:18:12 -05:00
Ingmar Goudt
ae7919cd07 program towards Interface rather than implementations 2020-02-10 10:40:06 +01:00
Oleg Agafonov
b04c436801 Merge pull request #6274 from Dilnu/Rider
Check zone change counters in PutOnLibrarySourceEffect
2020-02-09 19:49:29 +01:00
dilnu
847df3eeb8 Check zone change counters in PutOnLibrarySourceEffect 2020-02-09 11:56:13 -05:00
Oleg Agafonov
db2a556fca Additional comments and tests for #6268 2020-02-09 07:52:24 +04:00
Samuel Sandeen
29ce4b1ad4
Fix Lifelink so it triggers per source instead of per recipient in combat. (#6272)
* Fix Lifelink so it triggers once per source instead of once per recipient in combat.

* Undo an import collapse.

* Add more tests for lifelink.
2020-02-08 20:31:50 -06:00
Samuel Sandeen
51424b1460 Fix Irencrag Feat's spell casting effect. (#6268)
* Create a test for Irencrag Feat to ensure it functions correctly.

* Fix Irencrag Feat so it works correctly.
2020-02-08 18:28:10 -06:00
Oleg Agafonov
6674ca5d20
Merge pull request #6251 from Dilnu/Bonecrusher
Only fire one TARGETTED event per target selected while changing targets.
2020-02-08 16:31:04 +01:00
jeffwadsworth
7cbf999e9b - Fixed Starfield of Nyx test. 2020-02-07 10:22:15 -06:00
dilnu
6d005bae1d Add tests by JayDi85 and fix TestPlayer's Targetting code so it triggers Targetted Events. 2020-02-06 18:55:33 -05:00
jeffwadsworth
d6c2f031d0 - Fixed #6236 2020-02-06 17:47:08 -06:00
dilnu
fc46c0b288 Turn on strict mode for the test and Add documentation for the cards in the test. 2020-02-03 18:01:36 -05:00
Oleg Agafonov
78a9279438 Improved test for #6244 2020-02-04 02:22:26 +04:00
Oleg Agafonov
4c5ea62cea
Merge pull request #6244 from Dilnu/Chaos
Fix Chaos Wand
2020-02-03 23:19:34 +01:00
Oleg Agafonov
ee9abe4699 Fixed test 2020-02-04 01:37:21 +04:00
Oleg Agafonov
88f23bc0ee
Merge pull request #6245 from Dilnu/Despark
Allow players to block creatures attacking destroyed planeswalkers.
2020-02-03 22:34:45 +01:00
dilnu
b6af571779 Only fire one Targetted event per target
This specifically addresses changing the target of a spell or ability on the stack.
Fixes https://github.com/magefree/mage/issues/6158
2020-02-02 19:40:25 -05:00
dilnu
a8d8f4e621 Add tests to debug issues with Bonecrusher Giant
https://github.com/magefree/mage/issues/6158
2020-02-02 18:51:05 -05:00
dilnu
9a80b07d2a Fix Skyfire Phoenix's triggered ability. 2020-02-01 19:05:46 -05:00
dilnu
06e77bd7d6 Allow players to block creatures attacking destroyed planeswalkers.
See Comprehensive rules: 506.4c
Fixes https://github.com/magefree/mage/issues/6240
2020-02-01 17:30:30 -05:00
dilnu
e3e68c4607 Fix Chaos Wand
Fixes https://github.com/magefree/mage/issues/6241
2020-02-01 16:51:19 -05:00
Oleg Agafonov
c767d19534 Test framework: added AI support in basic card tests:
* added new command to play one best action on priority by AI (aiPlayPriority);
* added new command to play all best actions on step by AI (aiPlayStep);
* now you can setup battlefield by standard commands and run AI simulations for single priority/step;
* CardTestPlayerBase - old default class for card tests, it uses simple AI for choosing, but do not play/simulate it;
* CardTestPlayerBaseAI - old default class for AI game tests, auto-playable playerA, you can control only playerB;
* CardTestPlayerBaseWithAIHelps - new improved class for card tests, it uses controllable and real AI with game simulations;
2020-01-29 07:42:20 +04:00
Oleg Agafonov
89394ffe0a Improved ability outcome processing; 2020-01-29 07:33:33 +04:00
Oleg Agafonov
eb93c08a6f Fixed tests 2020-01-28 16:42:44 +04:00
Oleg Agafonov
5c058d8f85 Cleanup code (added logs rotation to tests) 2020-01-28 12:02:56 +04:00
Oleg Agafonov
0525463faf Test framework: added more aliases support, improved logs output for show commands; 2020-01-27 17:31:18 +04:00
Oleg Agafonov
ccdad1f5ca Test framework: added alias support in chooseTarget; 2020-01-27 14:02:21 +04:00
Oleg Agafonov
ffdc884949 Logs cleanup (removed database logs) 2020-01-27 06:01:56 +04:00
Oleg Agafonov
ec6b0b94c6 Test framework: improved aliases support:
* added check commands support;
* added on of the choose method support;
* added todo and checks for wrong test commands setup;
2020-01-27 06:00:46 +04:00
Oleg Agafonov
016f5fa9f5 Merge fix 2020-01-26 20:39:19 +04:00
Oleg Agafonov
b86438b80d Tests for #6222 2020-01-26 20:37:32 +04:00
Oleg Agafonov
9ec6aa83c4 * Infected counters - fixed rollback error on usage; 2020-01-26 18:41:01 +04:00
Oleg Agafonov
ab2fb29270 Code cleanup (removed unused log4j setting files, added extra info, samples and instructions, removed java logs) 2020-01-26 16:30:42 +04:00
Oleg Agafonov
c835fb409d * Bolas's Citadel - fixed that it can't play cards with cycling (#6215); 2020-01-22 14:45:44 +04:00
michaelrfarcasin
cef3b9488f Merge from origin/master 2020-01-20 23:01:31 -06:00
michaelrfarcasin
c3cb54f371 Add Freeform Unlimited Commander game type
Currently there's no multiplayer format that allows players to cast
spells from the command zone and also allows any deck size.

This is a problem for players who want to test EDH Cube decks. These
decks:
- can have any size - often between 40 and 100 - with no standard
- can have cards outside the commander's color identity
- may break the singleton rule

Create a game and deck type to accommodate these types of decks.

Notable differences from Freeform Commander in addition to the above:
- Decks can have any number of cards in the maindeck or sideboard
- Sideboard cards can be any type
- There are no illegal expansions
- Games can have a minimum 2 players
2020-01-20 22:47:27 -06:00
LevelX2
d87a4e4c9b * Karn Liberated - Fixed that a with Karn's ability exiled commander was not put to battlefield after game restart. 2020-01-19 16:48:58 +01:00
Oleg Agafonov
a31da48084 Little fixes 2020-01-16 17:11:19 +04:00
Oleg Agafonov
ec2ea7f070 Reverted some changes, related to #6187, see comments from d20a20fb6a 2020-01-16 08:22:23 +04:00
LevelX2
180c7dfff6 * Updated UnequipEventTest. 2020-01-15 17:32:07 +01:00
LevelX2
7575510c85 * Fixed that Soulfire Grand Master did not work for adventure or split cards (fixes #6182). 2020-01-14 23:26:04 +01:00
LevelX2
55fe1db60d Merge origin/master 2020-01-14 17:43:43 +01:00
LevelX2
6455180765 * Some code clean up and a new test. 2020-01-14 17:42:58 +01:00
Oleg Agafonov
748d14e55e * Thassa, Deep-Dwelling - fixed text; 2020-01-14 18:53:47 +04:00
Oleg Agafonov
e768c375dc * Yorvo, Lord of Garenbrig - fixed that it doesn't add +1 counter is green creature dies before resolve; 2020-01-14 12:55:21 +04:00
Oleg Agafonov
92eba9861d fixed Uro, Titan of Nature's Wrath (getSpellOrLKIStack return ability instead spell after card triggers); 2020-01-14 11:48:15 +04:00
Oleg Agafonov
11976b5c89 Refactor: move player.damage params to default (same as permanent.damage); 2020-01-14 09:15:33 +04:00
Oleg Agafonov
fe0717cbc7 * Goblin Clearcutter - fixed that tapped for mana replacement effects ignore his mana; 2020-01-12 11:19:17 +04:00
Oleg Agafonov
860c57d9d9 * Chrom Mox - fixed that tapped for mana replacement effects ignore his mana; 2020-01-12 10:09:51 +04:00
Oleg Agafonov
589142aeb5 Real fix to prev commit 2020-01-12 09:26:52 +04:00
Oleg Agafonov
92e15283ea * Tapped for mana abilities - fixed that it cause rollback error if you cast second card with that effect (Nyxbloom Ancient, etc); 2020-01-12 09:11:38 +04:00
Oleg Agafonov
e1fea330dd Test framework - multiple improves:
* Added support of spell ability choice in free cast (chooseSpellAbilityForCast);
* Added support of "up to" targets setup in addTargetAmount (use TestPlayer.TARGET_SKIP to stop target choose);
* Restored multiple checks for addTargetAmount;
* Fixed many wrong tests (wrong order or missing commands);
2020-01-12 01:17:39 +04:00
LevelX2
044645aca2 * Added test for split card cast with fuse. 2020-01-10 20:50:24 +01:00
LevelX2
2a0723b7cd * Vivien, Arkbow Ranger - Fixed target handling of +1 ability. 2020-01-10 15:49:55 +01:00
LevelX2
ac2a59fdc2 * Added better handling of TargetAmount for tests. 2020-01-10 15:48:21 +01:00
LevelX2
47a8686958 * Some more move actions replaced and added missing methods for move to command zone. 2020-01-09 23:17:39 +01:00
LevelX2
b6b2103b6c * Kiss, Dissident Mage - Fixed that it did not exile from graveyard casted split cards. 2020-01-09 21:29:27 +01:00
LevelX2
7ce7c2ad70 * Fixed a problem with P/T of permanets that transform back again to the original source card (fixes #6156). 2020-01-09 08:25:29 +01:00
Oleg Agafonov
b366a83a45 Prepare new release 2020-01-09 08:55:26 +04:00
LevelX2
d4ec65cddb Added Test and changed some log messages from info to debug. 2020-01-07 17:56:26 +01:00
Oleg Agafonov
854eaadcc4 Additional fixed for #6147 2020-01-07 06:52:01 +04:00
Oleg Agafonov
b6d76a7c02 * Gain abilities - fixed wrong order effects with changeling ability (all creature type effect, #6147); 2020-01-07 06:38:34 +04:00
Evan Kranzler
5a6f9022c0
Merge pull request #6151 from magefree/refactorSubTypePredicate
Refactored SubTypePredicate to be part of SubType
2020-01-06 18:27:03 -05:00
Evan Kranzler
86906ec25f refactored all instances of SubtypePredicate 2020-01-06 16:48:00 -05:00
LevelX2
79f5d7a358 Merge origin/master 2020-01-06 21:16:09 +01:00
LevelX2
e565863bd2 Added test for Nissa, Sage Animist -7 ability. 2020-01-06 12:58:50 +01:00
LevelX2
7bf213c0ec * Added Hideaway test. 2020-01-05 17:55:38 +01:00
LevelX2
7f0d793544 * Fixed a problem with Licid creatures not dying if the enchanted creature dies. 2020-01-05 17:06:36 +01:00
LevelX2
ebdba3c57e * Added logic to check if a card had a triggered ability in the graveyard if it was moved from graveyard to a hidden zone. Because if not, the ability does not trigger. 2020-01-04 23:53:47 +01:00
Oleg Agafonov
2dd64cf5cd * Kicker abilities - fixed that AI can't cast cards with kicker for normal cost (AI don't use kicker now); 2020-01-05 01:04:35 +04:00
Oleg Agafonov
bb59cedbd9 AI fixes:
* Gain control abilities - fixed wrong target chooses by AI (selects weakest permanent instead most powerful);
* Target of an opponent’s choice abilities - fixed that AI was able to cancel card cast, fixed wrong target chooses (Evangelize, Echo Chamber, Arena, Preacher, etc);
2020-01-04 22:37:16 +04:00
Oleg Agafonov
bcb37992cc * Buyback abilities - fixed that AI can't cast cards with buyback for normal cost (AI don't use buyback now); 2020-01-04 20:26:59 +04:00
Oleg Agafonov
1ae9fc883e * Replicate abilities - fixed that AI can freeze the game after play card with replicate (AI don't use it now); 2020-01-04 20:22:49 +04:00
Oleg Agafonov
b3ec79f467 Test framework: added command to show available mana; 2020-01-04 20:15:43 +04:00