Commit graph

3318 commits

Author SHA1 Message Date
xenohedron
45b54e8cc4 code style: private static final 2023-07-07 23:34:16 -04:00
Susucre
4a3070e6db
[ONE] Fix Elesh Norn, Mother of Machines preventing triggers from non-permanents. (#10582) 2023-07-07 23:10:34 -04:00
ssk97
a3ee34d796
Enable ignored tests that work (#10579)
* Enable ignored tests that work

* Remove Ignore import, fix tests without @Test attribute
2023-07-07 01:26:41 -04:00
ssk97
e1edec542c
Lazotep Convert fix (#10578)
* Fix Lazotep Convert card (add color, need to actually apply the applier)

* Don't copy Transformed status, add test
2023-07-07 01:26:27 -04:00
Bobby McCann
c8564efbb7
[LTR] Implement Witch-king of Angmar (#10563)
* Add card

* Add TapSourceEffect

* De-duplicate watcher logic

* Abstract and fix(?) logic

* Fix sacrifice targets

* Controller instead of Owner

* Add tests, fix, and refactor

* Throw if controller not supported

* Fix test (not supposed to start tapped)
2023-07-05 19:22:21 -04:00
xenohedron
4d6644d095
Cleanup: ExileUntilSourceLeavesEffect (#10527)
* Refactor OnLeaveReturnExiledAbility
to accommodate hand zone as well as battlefield
* Cleanup Brain Maggot and Kitesail Freebooter
* Refactor to include delayed trigger with main effect
* minor cleanup
* merge fix
* further adjustments
* Cleanup Valki, God of Lies
* fix test choices
2023-07-04 20:38:59 -04:00
Susucre
652358a481
Fix #10561 Misery's Shadow (and 3 other cards) replacement effects (#10562)
Did not test the final code for Stone of Erech, when a filter was added to the ReplacementEffect :(

Added an unit test, just to be safer this time around.
2023-07-04 11:47:22 -04:00
Oleg Agafonov
6529ead72f refactor: simplified extra turn code, fixed NPE error on usage (Alchemist's Gambit) 2023-06-30 06:39:01 +04:00
ssk97
918a8931e6
Implement [40K] Squad ability (#10509)
* First try at Squad Mechanic

* Fully functional now, removed cards from unfinished list in 40k

* Improved implementation, removing the generic conditional
and replacing it with a separated ETB trigger and effect.

* Add tests from Susucre (using Strionic Resonator for now, two others currently failing)

* Update comments on tests

Closes #9774 

------
Co-authored by: Susucre <34709007+susucre@users.noreply.github.com>
2023-06-26 20:47:26 -04:00
xenohedron
f623e45d4b add strict choose mode to other recent tests 2023-06-24 01:36:56 -04:00
xenohedron
ec4c2e2170
Cleanup: GainAbilityControlledSpellsEffect (#10446)
* Hide reminder text on Zhulodok

* Use logic from GainAbilitySpellsEffect, fix so that CastFromZonePredicate works

* Text adjustments

* Show cascade ability in hand for Abaddon the Despoiler

* Remove redundant class

* Simplify Cast Through Time

* Don't add additional instances of redundant abilities

* Remove redundant check

* Add option to ignore mana validation when checking playable objects

* Fix null errors

* Fix GainAbilityControlledSpellsEffect to apply ability to playable cards rather than owned cards

* Add unit test

* Revert bad workaround code

This reverts commit 17f5be6a79.
This reverts commit 7ebd2f1815.
This reverts commit 00969d1fe7.

* Remove ownership check on exiled cards

* Another test (currently failing)

* ignore test

* fix test: strict choose mode
2023-06-24 01:15:58 -04:00
Alexander
2db08c6b7d
fix Tadeas, Juniper Ascendant (#10490)
* added Tests for Tadeas
* Fix and cleanup Tadeas Juniper Ascendant
* Fix same power test to attack with creature with same power
* Test: added test for tadeas elusive not applying for creatures without reach
* Fix: creatures without reach can be blocked by higher power blockers
* Fix: use TargetPointer instead of MageObjectReference
---------
Co-authored-by: gravitybone <gravitybone@protonmail.com>
2023-06-23 22:47:55 -04:00
Oleg Agafonov
38be371c25 tests: real fix of Auratouched Mage - miss draw card effect (#9462) 2023-06-18 16:50:51 +04:00
xenohedron
b30e9ec348 Fix #9462 (AuratouchedMageTest) 2023-06-18 00:39:57 -04:00
xenohedron
8c83f60e1b tests: fix #10481 2023-06-17 14:02:56 -04:00
xenohedron
b340ab3b73
Fix some iterators that try to modify themselves (ConcurrentModificationException, #10460)
* Add test to confirm functionality
* Reimplement Whirlwind Denial
* Fix Awaken the Sleeper
2023-06-17 18:06:03 +04:00
Oleg Agafonov
94dfbdfed4 gui: fixed miss playable mark for emblems and other objects from command zone (example: momir emblem) 2023-06-17 17:32:02 +04:00
Oleg Agafonov
7a33ca812c tests: added assert method for emblems, added test for wrong emblem's playable mark in GUI 2023-06-17 09:29:47 +04:00
xenohedron
045bbbf04f
Fix ReturnToHandAttachedEffect with MDFCs (#10452)
* Add tests for ReturnToHandAttachedEffect

* Temporary fix for returning attached MDFC to hand
2023-06-16 22:43:34 -04:00
xenohedron
93726d6dd0 Fix #10472 (Lae'zel, Vlaakith's Champion) 2023-06-16 00:41:47 -04:00
Oleg Agafonov
8f4cc84266 refactor: removed direct counter names usage in some places 2023-06-12 13:53:15 +04:00
Susucre
70fa98f492
Fix Blitz not being cleaned up when the permanent leaved the BF (#9775)
A onCard: false parameter was necessary to clean the effect once the blitz creature leaved the battlefield.
2023-06-11 23:55:23 -04:00
Oleg Agafonov
ce3cf742c9 Blast-Furnace Hellkite - fixed game error on offering an artifact lands and treasures (#9940, #10218) 2023-06-11 11:05:06 +04:00
xenohedron
c7c5378931 Test for Oathkeeper, Takeno's Daisho 2023-06-09 00:39:35 -04:00
Alexander Novotny
a0f8a42699
Fixing copy and cast from exile effects (#10436)
* Added unit test for magefree/mage#10435

* Added test for potential breakage of prosper functionality

* Copies of cards are now created in the right zone

* Added PlayCardTriggeredAbility

This triggered ability checks to make sure a card was actually played (as opposed to a copy of a card).
Common abilities have been refactored to use this new ability

* Added mizzix's mastery overload test

* Fixed Mizzix's mastery overload

* Added new ability to Juju Bubble

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-06-09 05:32:59 +04:00
Alexander Novotny
80cb439862
Added Saruman of Many Colors (#10434)
* Added Saruman of Many Colors

Borrowed functionality in CastSecondSpellTriggeredAbility from magefree/mage#10433
Added new helper class ExileTargetCardCopyAndCastEffect for common effect

* Updated FlawlessForgery to use new ExileTargetCardCopyAndCastEffect

* Fixed overriden Effect copy functions

* Expanded ExileTargetCardCopyAndCastEffect

Added ability for non-free spells

* Removed filter lock

* De-duplicated exile and cast effects

* Fixed demilich
2023-06-08 17:00:28 -04:00
Alexander Novotny
0b2f582d84
Added Storm of Saruman card (#10433)
* Added Storm of Saruman card

Some classes have been added/adjusted for code reusability:
- CastSecondSpellTriggeredAbility has been modified to set a target pointer to either the caster or the spell (used here to set a target pointer to the spell for the copy effect)
- CopyTargetSpellEffect has been modified to allow specifying a copy applier (used here to apply the legenedary-stripping effect)
- RemoveTypeCopyApplier has been added as a generic copy applier for any cards which read "except it isn't <type>"

* Fixed verify failure - Remove ward hint on Storm of Saruman

* Fixed a typo - ammount -> amount

* Modified Double Major to use new CopyTargetSpellEffect

* Re-added ability text for Double Major
2023-06-08 16:58:28 -04:00
xenohedron
49075d6893 Fix #10442 (Unleash the Inferno) 2023-06-08 08:49:31 -04:00
sprangg
99701e08e7
Improvements to limited with Freeform Unlimited Commander (#10114)
* Limited-style sideboarding with unlimited basics enabled for Freeform Unlimited Commander

* FreeformUnlimitedCommander does not depend on FreeformCommanderFreeForAll anymore.
FreeformUnlimitedCommander has sideboarding.
In two-player matches of FreeformUnlimitedCommander, the player who goes first doesn't draw a card on their first turn anymore.

* FreeformUnlimitedCommanderTypeTest takes into account that sideboarding is allowed

* Fix to startingPlayerSkipsDraw condition

---------

Co-authored-by: sprangg <a@b.c>
2023-06-07 19:05:37 -04:00
xenohedron
807a6c95f1
Merge pull request #10369 from xenohedron/refactor-search
Refactor search library effect classes to clean up text generation
2023-06-04 22:18:18 +03:00
xenohedron
913d5dfee8
Cleanup: PreventDamageAndRemoveCountersEffect (#10321)
* Add tests (two passing, one failing due to incorrect implementation)

* Cleanup PreventDamageAndRemoveCountersEffect; fix Protean Hydra
2023-06-02 11:29:51 +03:00
Alexander Novotny
4e7381510a
Fixed maddening hex (#10303)
* Fixed maddening hex

Fixes magefree/mage#10104 and magefree/mage#10302

Added a test, and fixed a bug in printPermanents for permanents which are attached to something other than a permanent

* Formatting fix
2023-06-01 14:35:27 +03:00
Grath
4fae2e799a
Fix Reflection of Kiki-Jiki test to not cheat in the back face. (#10423) 2023-05-31 15:35:15 -04:00
Oleg Agafonov
7596bb833d tests: enabled miss test for Zam Wesell (closes #8463) 2023-05-25 23:20:21 +04:00
theelk801
fa03c6404f fix and rework commander validation (fixes #10345) 2023-05-23 19:25:00 -04:00
Evan Kranzler
60e488cf05
rename classes (#10383) 2023-05-17 18:49:30 -04:00
xenohedron
ae7266efba SearchLibraryPutInHandEffect: simplify constructors 2023-05-13 23:45:35 -04:00
Evan Kranzler
024c3081df
[BRC] Implement Rootpath Purifier (ready for review) (#10363)
* refactor check supertype methods

* change supertype to list to match card type

* refactor various subtype methods

* implement mageobjectattribute for supertype

* a few fixes

* [BRC] Implement Rootpath Purifier

* a few extra fixes

* more fixes

* add test for purifier
2023-05-13 10:48:07 -04:00
Evan Kranzler
a850e3660b
Change supertype method in constructors (#10361)
* replace addSuperType with supertype.add in card constructors

* more supertype replacements

* update MDFC supertype implementation

* remove unnecessary class

* update test
2023-05-12 20:45:07 -04:00
xenohedron
4cc9329b15
New feature: "Chaos Remixed" booster draft (#10328)
* Fix error in draft pick logger that was failing on chaos drafts with fewer than 3 sets

* Implement Remixed Booster Draft

* Add debug test

* minor cleanup

* Cleanup unnecessary checks

* Fix elimination tournament type

* Add note for future improvement
2023-05-12 18:12:23 +04:00
Oleg Agafonov
6d4e353867 Designation - fixed not working abilities like Monarch and Initiative (#10334, #10338); 2023-05-12 18:00:52 +04:00
Oleg Agafonov
b860253624 tests: added monarch check command, added game info in some check fails 2023-05-12 17:08:52 +04:00
Alexander Novotny
c45a546526
Fixes for Vessel of the all-consuming (#10306)
* Added some tests for Vessel of the All-Consuming
* Fixed Vessel of the All-consuming
Fixes magefree/mage#10283

Added more commentsto the test.

The bug was for a few reasons. The map was keeping track of how many times a player was dealt damage, not how much damage was being dealt. As well, creating a MageObjectReference from an ability doesn't seem like it works properly, so retrieving from the map never worked.

---------

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
2023-05-12 11:45:45 +04:00
Oleg Agafonov
9d9916280a Attacking you abilities and filters - fixed that planeswalker removes from a combat can cause a game error (NPE error, example: Curse of Hospitality) 2023-05-09 14:59:44 +04:00
Oleg Agafonov
6882a9a49e Code clean 2023-05-08 22:59:30 +04:00
Oleg Agafonov
5f55c7c667 Tokens and command objects reworked (part 1 of 2):
- fixed that copy effect doesn't restore original image after effect's end;
 - removed outdated availableImageSetCodes (all images auto-selected from tokens database now, related to #10139);
 - refactor command objects to use CommandObjectImpl;
 - refactor planes/emblems/etc objects to use MageObjectImpl, added copyable support;
 - refactor another game objects to remove some duplicated fields;
2023-05-08 02:15:07 +04:00
Evan Kranzler
3503513c4e
Implement The Ring Tempts You mechanic (#10320)
* remove skip

* initial implementation of the ring mechanic

* some changes

* rework ring-bearer choosing

* [LTR] Implement Call of the Ring

* update ring-bearer condition
2023-05-07 14:32:28 -04:00
xenohedron
3e5b392287
Fix Haunt ability to trigger on haunted tokens dying (#7689, #10308); add test (#10310) 2023-05-07 13:31:23 -04:00
Oleg Agafonov
6ed702a7b3 Tokens improved:
- added auto-generated token names for CreatureToken;
 - added verify tests for token names;
 - removed outdated ElementalCreatureToken;
 - fixed wrong indefinite article in some tokens;
 - fixed miss Token in some token names (related to #10139);
2023-05-04 17:38:54 +04:00
Oleg Agafonov
94819ff91c Tokens rework:
- tests: added support of set code in custom ability (see addCustomCardWithAbility);
 - tests: added additional tests for token images (related to #10139, #10222);
 - fixed wrong token images for copied cards/tokens (#10222);
2023-05-01 17:27:26 +04:00