Commit graph

3150 commits

Author SHA1 Message Date
Alex W. Jackson
dc7dcec39a
Refactor LookLibraryAndPickControllerEffect (#8841) 2022-04-16 00:32:24 -04:00
Daniel Bomar
21a1cfbea9
[SNC] Fixed shield counter interaction with damage can't be prevented effects 2022-04-15 08:27:21 -05:00
Daniel Bomar
63239fe8e6
[SNC] Implemented shield counter mechanic (#8830)
* [SNC] Implemented shield counter mechanic

* Rework shield counter to be a global replacement effect

* Add unit test for shield counter

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
2022-04-14 09:43:12 -04:00
Evan Kranzler
6e65db284c
Implemented "Until your next end step" duration (#8831)
* initial implementation of until next end step duration

* added test, reworked effect duration
2022-04-10 17:57:58 -04:00
Alex W. Jackson
a48dedcd76 [ALA] Finish fixing Death Baron and add test 2022-04-08 01:42:41 -04:00
Evan Kranzler
09402609ef [DTK] reworked Living Lore, fixed death trigger 2022-04-04 23:04:09 -04:00
Evan Kranzler
26ae7b7281 replaced various instances of instanceof lambda functions with 2022-04-03 11:11:07 -04:00
Alex W. Jackson
c58eeef77d Fix that Warbringer's cost reduction doesn't apply when checking playable (for real this time) 2022-04-03 10:19:22 -04:00
Alex W. Jackson
081b2f2f39 Replace more custom effects with SavedDamageValue 2022-04-02 02:11:12 -04:00
Alex W. Jackson
46f98a0f88 Fix #8812 and add test 2022-03-31 21:30:46 -04:00
Evan Kranzler
676c3a8bb4 fixed interactions between effects which replace a token and effects which care about tokens after they've been made 2022-03-31 19:58:20 -04:00
Evan Kranzler
f6306630b3 [TSP] fixed implementation of Weatherseed Totem 2022-03-25 22:21:21 -04:00
Evan Kranzler
effdf14579 [VOW] fixed Savior of Ollenbock issues (fixes #8786) 2022-03-25 17:35:27 -04:00
Evan Kranzler
80e11b2052
(WIP) Replacing blocking/blocked by predicates (#8729)
* replaced blocking/blocked by predicates

* added test for knight of dusk (currently fails)

* added source parameter to filters and everything else that needs it

* some changes to various predicates

* test fix

* small changes to filter code

* merge fix

* fixed a test failure

* small change to Karn, Scion of Urza

* removed sourceId from filter methods and other similar places

* added new getobject method to fix some test failures

* a few more fixes

* fixed merge conflicts

* merge fix
2022-03-23 18:45:02 -04:00
Evan Kranzler
0f1375ca60 fixed various instances of mana costs which don't include braces 2022-03-21 19:10:38 -04:00
Evan Kranzler
02017b9a88
Implementing The Prismatic Piper (Ready for review) (#8164)
* [CMR] Implemented The Prismatic Piper

* updated commander validation to handle The Prismatic Piper

* created abstract base class for commander variants

* added ability to prismatic piper

* added game init handling

* small revert

* small reorganization of tests

* added some validation tests for piper

* added more tests for piper

* add another test

* added decklist comments to tests

* added some more piper tests

* added another test

* added mana option tests

* added a companion test

* fix conflict

* updated abstract commander to work with Friends forever

* merge fix

* Deck: added details for illegal validation of companion card;

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
2022-03-17 18:02:29 -04:00
Alex Vasile
b40bde5e12
[AFC] Implemented Share the Spoils (#8583)
* Preliminary implementation of Share the Spoils.

* Added tracking of cards in exile to MageTestPlayerBase in order to help with testing of cards such as Share the Spoils which put and take cards out of exile a lot.

* Moved Share the Spoils to the correct set list.

* Fixed bug with using ’ instead of ' for card text.

* Add method to assert number of cards exiled into a specific exile zone.

* Further implementation of ShareTheSpoils and it's tests.

* Fixed a bug in the calcualtiong of exileNUmber. (I misunderstood what the copy() method was for)

* - Added a watcher which should limit player to only cast the spell once per turn.
- Fixed the tests to run properly (using .LOST instead of .LOSES for the GameEvent).
- A bit of cleaning up of the class

* Updated tests and card to capture both conceding and losing the game through other means.

* Further implementation. All parts are working (though not correctly).

* All pieces are now working. But, both the spend any mana and exile a card off the top of library activate when ANY card is played from exile, not just one exiled with Share the Spoils.

* Replaced changed how I move card from top of library to correct exile zone. Instead of using moveCards() and moveToAnotherZone(), I am not using moveCardsToExile().

* A new card is now properly exiled whenever one is played with Share the Spoils

* Moved inner class out and passing exileId as parameter instead

* Updated text based on comments

* Added several more tests

* Made changes to how exileId is handled based on comments

* Made changes based on comments

* Further changes based on comments

* Add a few more tests (will have to fix them once the exile zone issue is fixed)

* Added workaround for #8706

* Get most of the tests working

* Simplified cardId handling

* Reformat file based on comment

* - Added setStrictChooseMode to all tests
- Properly using checkPlayableAbility for all checks where things can't be played/cast.

* Fixed a missing getMainCardId call that made difficult cards unplayable

* - Simplified handling of casting only once per turn. I don't see the point to keeping the MageReference object. using a simple boolean instead
- This also fixes a bug where multiple cards could be played in the same turn.

* Fixed test for difficult cards.

* Reworked spend mana effect based on Dead Man's chest

* Added a check again a null watcher

* Fixed typo in checkManaSpendingForOtherExileSource

* Fixed tests to use proper checkPlayableAbility syntax.

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
2022-03-15 18:34:36 -04:00
Evan Kranzler
06eeb90b3d replaced some more card moving method calls 2022-03-15 18:08:36 -04:00
Alex Vasile
6a7b2e80ac
Refactoring + Fix of several cards (#8699)
* Simplified Azorius Aethermage

* - Flattened the if statements
- Renamed the custom effects and abilities to be more readable
- Changed certain functiosn to be private

* Flatten Thieves Auction

* Flatten Possibility Storm

* Flatten Aminatous Augury

* Minor refactoring

* Flattening and adjusting access modifiers

* Aetherspouts should have been using getPlayersInRange. Current implementation was affecting all players

* Simplified Akoum Hellkite

* Simplified Ali From Cairo

* Flattened An-Havva Constable

* Flattened Aura Finesse and Autum Willow

* Fixed All Hallow's Eve since it didn't work.

* Several small simplifications

* Flattening/Simplification of several classes

* Added test for Azorius Aethermage

* Added test for Abandoned Sarcophagus

* Updated test with docstring instead of comment

* Update AzoriusAethermageTest.java

* Update BattlegateMimic.java

* Update AetherworksMarvel.java

* Update AetherworksMarvel.java

* Update AzoriusAethermageTest.java

* Update AzoriusAethermageTest.java

Co-authored-by: Jeff Wadsworth <jeffwadsworth@users.noreply.github.com>
2022-03-15 16:57:16 -05:00
Evan Kranzler
9e0ea945ca
Refactoring token names to reflect new rule (ready for review) (#8446)
* updated Riptide Replicator and Volrath's Laboratory

* refactored token names

* some test fixes

* more test fixes

* even more test fixes

* the final test fixes

* fixed a few missed tokens

* merge fix

* fixed a test failure

* fixed test failure

* updated ignored verify test

* fixed token images not appearing

* updated tests
2022-03-14 22:37:21 -04:00
Evan Kranzler
83c94322c6 refactored some instances of Player::moveCardToExileWithInfo 2022-03-14 21:14:12 -04:00
Evan Kranzler
8198322ba5 some changes to ExileSourceCost 2022-03-14 20:31:40 -04:00
Jeff Wadsworth
fe089a9972 - added test for Foretell keyword 2022-03-14 16:51:44 -05:00
Alex W. Jackson
9af399eadb Better changeling token workaround; add additional test (fixes #8766) 2022-03-14 02:43:12 -04:00
Evan Kranzler
82832046b3 fixed issues with changeling tokens not counting as they enter 2022-03-13 22:25:44 -04:00
Evan Kranzler
bbb9382150
Reworking effects which allow casting spells from a selection of cards (ready for review) (#8136)
* added function for casting spells with specific attributes from a selection of cards

* updated cascade to use new method

* refactored various cards to use new methods

* added TestPlayer method

* fixed a small error

* text fix

* broke out some repeated code

* added missing notTarget setting

* add additional retain zone check

* some more cards refactored

* more refactoring

* added interface for split/modal cards

* reworked spell casting methods

* reworked multiple cast to prevent unnecessary dialogs

* fixed test failures due to change in functionality

* add AI code

* small nonfunctional change

* reworked Kaya, the Inexorable

* added currently failing test

* added more tests

* updated Geode Golem implementation

* fixed adventure/cascade interaction, added/updated tests

* some nonfunctional refactoring

* added interface for subcards

* [AFC] Implemented Fevered Suspicion

* [AFC] Implemented Extract Brain

* [AFC] updated Arcane Endeavor implementation

* [C17] reworked implementation of Izzet Chemister

* [ZEN] reworked implemented of Chandra Ablaze

* additional merge fix

* [SLD] updated Eleven, the Mage

* [NEO] Implemented Discover the Impossible

* [NEO] Implemented The Dragon-Kami Reborn / Dragon-Kami's Egg

* [NEO] Implemented Invoke Calamity

* [AFR] Implemented Rod of Absorption

* [VOC] Implemented Spectral Arcanist

* [VOC] added additional printings

* [NEO] added all variants

* [SLD] updated implementation of Ken, Burning Brawler
2022-03-09 08:03:54 -05:00
Evan Kranzler
5b543dc819 fixed test failure 2022-03-08 10:02:44 -05:00
Evan Kranzler
6c643fdc5e [EVE] fixed implementation of Hotheaded Giant 2022-02-28 08:45:13 -05:00
Evan Kranzler
cf9a2f936a a few more getId fixes 2022-02-26 10:23:13 -05:00
Evan Kranzler
3cbfe4d623 [BOK] reworked implementation of Shirei, Shizo's Caretaker and added test 2022-02-24 20:15:15 -05:00
Evan Kranzler
c97039366d added an additional test for conspire 2022-02-24 08:58:18 -05:00
Evan Kranzler
f32d0b3e6e fixed issues with Conspire, added additional tests 2022-02-23 21:37:42 -05:00
Alex Vasile
6d02a902b7
fix what is almost certainly a typo (#8693) 2022-02-20 01:07:55 -05:00
Evan Kranzler
fe42bc6e49 added Heart of Kiran test 2022-02-19 17:19:52 -05:00
Evan Kranzler
972ad38e85 [NEO] added test for Hotshot Mechanic 2022-02-19 14:48:44 -05:00
Evan Kranzler
8040e7d1e8 [NEC] fixed Kotori, Pilot Prodigy's granted crew ability not animating vehicles (fixes #8713) 2022-02-18 22:22:44 -05:00
Alex W. Jackson
4c32272505 [AKR] does *not* have a dedicated nonbasic land slot (see https://youtu.be/XJgQKO5qd44?t=463) 2022-02-18 17:09:25 -05:00
Evan Kranzler
4ede390e40 some reworking of Equip, Fortify, and Reconfigure 2022-02-17 18:08:22 -05:00
Evan Kranzler
e296b62014 [NEO] Implemented Storyweave 2022-02-15 18:18:02 -05:00
Evan Kranzler
4591ac07cc
Reworking goad effects (ready for review) (#8034)
* changing goad to designation, refactored goad effects to be continuous

* [AFC] Implemented Vengeful Ancestor

* reworked effects which goad an attached creature

* updated goading implementation

* updated combat with new goad logic

* some more changes, added a test

* another fix

* update to test, still fails

* added more failing tests

* more failing tests

* added additional goad check

* small fix to two tests (still failing

* added a regular combat test (passes and fails randomly)

* fixed bug in computer player random selection

* some changes to how TargetDefender is handled

* removed unnecessary class

* more combat fixes, tests pass now

* removed tests which no longer work due to combat changes

* small merge fix

* [NEC] Implemented Komainu Battle Armor

* [NEC] Implemented Kaima, the Fractured Calm

* [NEC] added all variants
2022-02-15 09:18:21 -05:00
Evan Kranzler
54203c16d3
[NEO] Implementing Compleated mechanic and hybrid phyrexian mana (ready for review) (#8677)
* [NEO] Implemented Tamiyo, Compleated Sage

* replaced PhyrexianManaCost calls with ManaCostsImpl calls

* updated phyrexian mana implementation

* added phyrexian hybrid symbol support

* updated starting loyalty implementation for planeswalkers

* change compleated to singleton

* implemented Compleated ability

* added some missing loyalty setters

* changed when loyalty is added to a walker to fix bugs

* slight change to some tests to fix them from failing

* fixed token issue
2022-02-10 10:25:23 -05:00
Evan Kranzler
495fc57540 [NEO] Implemented Reconfigure abliity 2022-02-06 12:27:12 -05:00
Evan Kranzler
d030848552
Reworking "as long as you control this" effects (WIP) (#8620)
* added WhileControlled duration, removed SourceOnBattlefieldControlUnchangedCondition

* refactored effects which keep things tapped

* a few additional missed cards

* refactored cards which check for being controlled and tapped

* [NEO] Implemented Kyodai, Soul of Kamigawa
2022-01-30 22:00:10 -05:00
Oleg Agafonov
a5eb025155 * Sneak Attack - fixed that it doesn't give haste to MDF cards (#8474); 2021-11-23 00:55:24 +04:00
Oleg Agafonov
524f46e7e5 * Uba Mask - fixed that it doesn't work with MDF cards (#8222); 2021-11-17 19:23:16 +04:00
Oleg Agafonov
afdae939c3 * Becomes a copy abilities: improved support with MDF cards (#8335); 2021-11-17 16:27:18 +04:00
Evan Kranzler
4a99b7689f fixed a test failure 2021-11-14 10:52:08 -05:00
Alex W. Jackson
bb2546badd
Refactor rules text generation for P/T boost effects. Fixes #8421 2021-11-10 06:40:11 -05:00
Oleg Agafonov
3515647c7b [MID] Tests: added test for disturb ability; 2021-11-09 10:14:50 +04:00
Evan Kranzler
30afb11cd2
Implementing Daybound/Nightbound mechanic (#8200)
* adding initial day/night support in game state

* remove card exclusion for testing

* added functional implementation to abilities from main branch

* functionally implemented NightCondition

* updated DayNightHint

* added support for nightbound entering transformed at night

* [MID] Implemented Unnatural Moonrise

* [MID] Implemented The Celestus

* added some docs

* changed access for state day/night methods

* added transformation to day/night switch

* re-added unfinished filter, removed day/night cards

* fixed some errors with transforming

* added hints to all day/night cards

* added transformation prevention plus a test

* added Immerwolf test

* [MID] Implemented Tovolar, Dire Overlord / Tovolar, The Midnight Scourge

* refactored some cards to not use isTransformable

* removed transformable parameter

* simplified some transform code

* fixed null pointer exception

* removed unnecessary canTransform method

* fixed a small error

* reworked implementation of rule 701.28f

* small change in transform logic

* fixed failiing test

* fixed verify failure

* small merge change

* added support for day/night switching based on spells cast

* [MID] Implemented Curse of Leeches / Leeching Lurkers

* moved day/night handling to untap step

* added tests for cards which set day and trigger from a change

* [MID] Implemented Ludevic, Necrogenius / Olag, Ludevic's Hubris

* added support for creatures transforming to match day/night when necessary

* fixed verify failures

* fixed another verify failure

* remove temporary verify skip

* added transform message

* removed unnecessary transform message

* [MID] Implemented Angelic Enforcer / Enduring Angel

* updated DayNightHint with more information

* fixed verify failure

* merge fix

* fixed Startled Awake / Persistent Nightmare / Moonmist interaction

* added another test for Moonmist

* merge fix

* merge fix

* [MID] Implemented Baneblade Scoundrel / Baneclaw Marauder

* merge fix

* [MID] various text fixes

* [MID] a few more text fixes

* Merge fix

* Improved transform game logs (hints, source), fixed day/night logs, fixed miss game param (due code style);

* fixed a test failure

* Merge fix

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
2021-11-05 23:11:23 +04:00