Commit graph

3344 commits

Author SHA1 Message Date
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
Alexander Novotny
5c6de9815f
Fixed Lynde's triggered ability (#10301)
Fixes magefree/mage#10045.

Lynde wasn't keeping track which zone cards were in before bring them back, let alone zone change counters.

Many similar effects are only looking at the current zone rather than zone change counters.
2023-04-30 18:59:22 -04:00
Oleg Agafonov
f86cf176d7 Tokens rework:
- added reminder / helper tokens support (example: Copy, Morph, Day // Night, related to #10139);
 - added verify checks for reminder tokens;
 - added images download for reminder tokens;
2023-04-27 19:05:31 +04:00
Evan Kranzler
726e289646
Implement DFC tokens for Incubate (#10231)
* remove incubate skip

* initial implementation of DFC tokens

* separate incubator back face to separate class

* small refactor to token copy function

* token copies now have back faces as well

* effects which modify token copies now correctly apply to both faces

* add skip for exception

* tokens now enter transformed correctly

* [MOC] remove skip for incubate

* fix verify failure
2023-04-27 19:03:25 +04:00
Daniel Bomar
92b6d7a531
[BRO] Implemented Gix, Yawgmoth Praetor (#9765)
* [BRO] Implemented Gix, Yawgmoth Praetor

* Add missing TestPlayer, PlayerStub implementations
2023-04-23 11:49:52 -04:00
Oleg Agafonov
7d44057f93 Tokens rework:
- now token images chosen by tokens database instead availableImageSetCodes (related to #10139);
 - added additional verify checks for tokens database;
 - fixed some tokens;
2023-04-22 15:50:46 +04:00
Oleg Agafonov
5474787641 Refactor: added miss Ability source in some choose methods 2023-04-21 10:08:33 +04:00
amoscatelli
6059422afc
[J22] Implement Alandra, Sky Dreamer (#10219)
* Alandra Sky Dreamer
DrawSecondCardTriggeredAbility refactored into DrawCardTriggeredAbility
DynamicValue support for DrawCardTriggeredAbility
DynamicValue support for BoostAllOfChosenSubtypeEffect

* cardNumber as int
static use of cardwatcher

* removing spaces

* FaerieMastermind and ZimoneAndDina using the new generic DrawCardTriggeredAbility

* AlandraSkyDreamer and DrawCardTriggeredAbility test

* renaming DrawCardTriggeredAbility to DrawNthCardTriggeredAbility

* merging the boost effects into a single ability

* merging two effects to the same ability

* text added to effects

---------

Co-authored-by: drago <drago@192.168.1.72>
2023-04-17 09:12:18 -04:00
Evan Kranzler
947351932b
Ready for Review: Implementing Battles (#10156)
* add types and subtypes

* add startingDefense attribute

* [MOM] Implement Invasion of Ravnica / Guildpact Paragon

* fix two small errors

* refactor various instances of "any target"

* fully implement defense counters

* battles can now be attacked

* [MOM] Implement Invasion of Dominaria / Serra Faithkeeper

* [MOM] Implement Invasion of Innistrad / Deluge of the Dead

* [MOM] Implement Invasion of Kaladesh / Aetherwing, Golden-Scale Flagship

* [MOM] Implement Invasion of Kamigawa / Rooftop Saboteurs

* [MOM] Implement Invasion of Karsus / Refraction Elemental

* [MOM] Implement Invasion of Tolvada / The Broken Sky

* simplify battle info ability

* fix verify failure

* some more fixes for attacking battles

* [MOM] Implement Invasion of Kaldheim / Pyre of the World Tree

* [MOM] Implement Invasion of Lorwyn / Winnowing Forces

* [MOM] Implement Invasion of Moag / Bloomwielder Dryads

* [MOM] Implement Invasion of Shandalar / Leyline Surge

* [MOM] Implement Invasion of Belenon / Belenon War Anthem

* [MOM] Implement Invasion of Pyrulea / Gargantuan Slabhorn

* [MOM] Implement Invasion of Vryn / Overloaded Mage-Ring

* [MOM] Implement Marshal of Zhalfir

* [MOM] Implement Sunfall

* implement protectors for sieges

* partially implement siege defeated trigger

* fix verify failure

* some updates to blocking

* [MOM] Implement Invasion of Mercadia / Kyren Flamewright

* [MOM] Implement Invasion of Theros / Ephara, Ever-Sheltering

* [MOM] Implement Invasion of Ulgrotha / Grandmother Ravi Sengir

* [MOM] Implement Invasion of Xerex / Vertex Paladin

* add initial battle test

* fix verify failure

* [MOM] Implement Invasion of Amonkhet / Lazotep Convert

* [MOM] update spoiler

* update how protectors are chosen

* update text

* battles can't block

* add control change test

* rename battle test for duel

* add multiplayer test

* [MOM] Implement Invasion of Alara / Awaken the Maelstrom

* [MOM] Implement Invasion of Eldraine

* [MOM] Implement Invasion of Ergamon / Truga Cliffhanger

* [MOM] Implement Invasion of Ixalan / Belligerent Regisaur

* battles now cast transformed (this is super hacky but we need to refactor TDFCs anyway)

* add TODO

* add ignore for randomly failing test

* a few small fixes

* add defense to MtgJsonCard (unused like loyalty)

* implement ProtectorIdPredicate

* small fixes
2023-04-13 20:03:16 -04:00
Oleg Agafonov
d17df585c5 Tokens reworked:
- removed outdated code;
 - updated logic to choose a set code for a tokens in different use cases (related to #10150);
 - added many tests for client and server token's data (related to #10139);
 - prepare for tokens database (related #6955);
2023-04-13 16:18:53 +04:00
Oleg Agafonov
914cfc1d3a Refactor: fixed getRules usage, clean SplitCard code 2023-04-08 19:27:47 +04:00
Oleg Agafonov
81d9c099fb Tests: improved load tests (fixed AI names, improved logs, improved custom decks support, related to #10154); 2023-04-05 20:48:14 +04:00
Oleg Agafonov
a9f1e15168 Tests: improved load test (added connection errors processing, fixed too long generated usernames, related to #10154); 2023-04-05 18:43:44 +04:00
Oleg Agafonov
a6337fd28a Cheats: improved cheat and test commands to use same set_code-card_name notation, added additional tests (related to #10139, cheat command example: battlefield:Human:XLN-Island:1) 2023-04-04 22:05:22 +04:00
Oleg Agafonov
4bf3e43da6 * GUI: face down cards improved:
* now it show face up cards in game logs on game end;
 * now it show face up cards in battlefield on game end (#4635);
 * fixed that real card face was visible in network data;
2023-04-01 18:40:06 +04:00
Oleg Agafonov
a15a0daa04 Fixed potential NPE errors in getPhase usage (fixed Berserker's Frenzy, etc) 2023-03-25 16:01:27 +04:00
Oleg Agafonov
1d17895caa Tests: fixed travis-ci on too much logs 2023-03-25 15:20:51 +04:00
Oleg Agafonov
c96805a307 Tests: added logs on wrong usage of choice commands in non-strict mode 2023-03-25 14:45:50 +04:00
Oleg Agafonov
66d0ef4b35 Refactor cards and token images code (#10139):
- removed outdated token store format (example: BIRD.W.BIRD.CREATURE.1.1.full.jpg)
 - removed duplicated cache images code;
 - removed duplicated set code fields;
 - removed outdated auto-generated thumb files (also all *.thumb.zip files will be deleted on startup);
2023-03-24 06:44:11 +04:00
Oleg Agafonov
8f742081b6 Tests: improved logs on wrong ability command usage 2023-03-23 23:38:43 +04:00
Oleg Agafonov
d019acbd55 Tests: improved addCard command, now it can add card from specific set (use 40K:Plains as card name param, #10139) 2023-03-23 23:17:34 +04:00