Commit graph

4077 commits

Author SHA1 Message Date
Oleg Agafonov
eaee358a81 tests: added few use cases for AlternativeCostSourceAbility usage 2023-07-15 17:05:39 +04:00
xenohedron
ee29c38413
Clash adjustments (#10616)
* adjust clash effect

* Make clash not a singleton

* Add unit test for Clash effect

* fix test (skip init shuffling)

* Fix CLASHED event flag logic and add to unit test

* Additional test and comments

* comments in GameEvent

* param name typo
2023-07-14 23:15:01 -04:00
Susucre
2c505bbcac
[LTR] Implement King of the Oathbreakers (#10619)
* make a new BecomesTargetTriggeredAbility to filter on target permanents.
2023-07-14 21:32:23 -04:00
Susucre
6a9340f1aa
Introduce Duration.UntilYourNextUpkeepStep (#10600)
* add new Duration

* refactor cards with new Duration.

* fix both Durations and add unit tests.

* fix text
2023-07-12 19:40:27 -04:00
Susucre
14235b6320
Rework Ring-bearer implementation. Add GUI + gamelogs. (#10596)
* Fix Ring-bearer choosing & add some GUI + logs

* use a ring svg in a separate gold panel

* use a fontawesome svg

* add a couple null checks, group icon with commander

* rework rinbearer logic according to review

* fix typo in game log

* small fixes
2023-07-12 19:40:09 -04:00
Bobby McCann
4065e2e935
[LTR] Implement Bill Ferny, Bree Swindler (#10575) 2023-07-12 19:39:52 -04:00
Bobby McCann
09530f1cdb
[LTR] Implement Glamdring (#10574) 2023-07-12 19:39:31 -04:00
xenohedron
1e1423a101 add test; closes #9646 2023-07-10 07:17:03 -04:00
Bobby McCann
73104f6705
[LTR] Implement Radagast the Brown; also resolves #9419 (#10568)
* Fix #9419 bug with EntersBattlefieldThisOrAnotherTriggeredAbility
* Add test for Radagast as well as Risen Reef and Caldaia Guardian
* Minor associated cleanup for EntersBattlefieldAllTriggeredAbility
* New PermanentEnteringBattlefieldManaValue
2023-07-09 22:04:45 -04:00
Susucre
f8b1ada369
Fix RevealTargetFromHandCost when no target in hand (#10593)
* [CSP] Fix the RevealTargetFromHandCost not allowing payment when no valid card to reveal

* cleanup text of cost

* fix martyr of bones text

* fix test using a Martyr of Sands
2023-07-09 16:42:16 -04:00
Susucre
2b2d3b979e
add unit tests for Shelob, Child of Ungoliant (#10586) 2023-07-08 13:08:41 -04:00
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