Commit graph

168 commits

Author SHA1 Message Date
xenohedron
313651cfc8 fix #14045 (Ultima, Origin of Oblivion)
rename method to correct typo
2025-10-26 18:33:13 -04:00
ssk97
7d7e517084
More target adding, reattach improves (#13807)
* Add Target to Provoke, Soulshift, remove from AttachableToRestrictedAbility

* Add Target to CurseOfInertia, FarrelsMantle, Incendiary, JubilantMascot, MantleOfTheAncients, MuseVessel, SoulSeizer. Fix DreamEater text.

* Fix CardImpl.cantBeAttachedBy to not early return with Protection abilities

* Improve tests
2025-07-01 22:08:27 -07:00
theelk801
501b7e882b fix additional test failures 2025-05-23 18:30:23 -04:00
theelk801
254daea2e8 fix error 2025-05-16 14:35:41 -04:00
theelk801
2f266f6f07 [FIN] fix Ragnarok, Divine Deliverance not being a meld card 2025-05-16 14:24:55 -04:00
Oleg Agafonov
d0fd0c4023 tests: added test and todo for Devoted Druid bug (related to #13583) 2025-04-30 07:45:18 +04:00
theelk801
5e27be4dfa [SPE] Implement Sensational Spider-Man 2025-04-17 20:52:49 -04:00
Jmlundeen
0df5f17603
[TDM] Implement omen mechanic (#13501)
* Abstract AdventureCard to SingleFaceSplitCard

* Fix AdventureCardSpellImpl

* Finish converting adventure card and adventure spell

* Update Brightcap Badger

change finalize call to adventure card

* Update Darksteel Monolith

being cast from hand condition referencing AdventureCardSpell

* Update Tlincalli Hunter

exiled creature condition referencing AdventureCardSpell

* Update Twice Upon a Time

finalizeAdventure called from Adventure card

* Finish abstracting Adventure

missed some more references to adventure cards

* Implement Omen cards

* Implement Dirgur Island Dragon

* Missed some adventureSpellName references

* OmenCardSpell had wrong comma symbol

* Add tests for Omen Cards

* Rename two part card components

change from SingleFaceSplitCard to CardWithSpellOption

* Update comments and variable name
2025-04-08 08:54:18 -04:00
Oleg Agafonov
19269b22b0 refactor: improved ETB rules generations, fixed some cards/abilities (related to #12791) 2025-02-09 17:25:48 +04:00
Oleg Agafonov
0d0661cc92 refactor: added code example for rules auto-replacement in creature's ETB (related to #12791) 2025-02-09 13:51:22 +04:00
Oleg Agafonov
a16215caed tests: removed and restricted empty commands for choices and targets, improved empty name usages in tests (use EmptyNames.xxx.getTestCommand and EmptyNames.xxx.getObjectName for face down objects) 2024-10-16 15:19:46 +04:00
Oleg Agafonov
521a0f6e32 GUI: introduced default card hints:
* refactor: added helper emblems instead rad counter's inherent emblems (use initGameDefaultHelperEmblems to define new card hints or other fake objects);
* refactor: added card hints support for emblems, planes and other command objects;
* GUI: added storm counter as default card hint (use hints tool to see it, closes #12360);
2024-07-27 09:40:41 +04:00
ssk97
78649c1a62
Remove KickerAbility.getSpellKickedCount (#12553)
* Remove KickerAbility.getSpellKickedCount

* Check spell LKI instead of only current spell object

* Remove bad LKI storage under wrong ID
2024-07-22 23:13:48 -04:00
xenohedron
d61de05eb8
refactor: simpler processAction syntax (#12458)
* game.processAction() instead of game.getState().processAction(game)

* add simpler method name and docs

* find/replace to new method

* remove old method

* deprecate applyEffects
2024-06-11 22:55:43 -04:00
ssk97
53a5f53f78
[MH3] Implement Fangs of Kalonia, The Hunger Tide Rises, Wastescape Battlemage (#12383) 2024-06-04 10:46:49 +02:00
Susucre
20b7a115da
prevent direct access of Player->counters ; some cleanup on counter removal effects ; implement [MH3] Izzet Generatorium (#12314) 2024-05-29 22:34:54 +02:00
Oleg Agafonov
0e39d6a833 images: fixed miss token image in some use cases (if it was created from a card and a set contains multiple images); 2024-05-26 12:56:03 +04:00
jimga150
52ddcac59d
refactor: added counter removal events (#11989) 2024-05-02 17:32:55 +04:00
Susucre
5dfe480a5e
[MKM] Implement Perimeter Enforcer & Projektor Inspector (#11719) 2024-04-05 23:55:18 +02:00
Oleg Agafonov
e38a79f231
Face down images and cards rework (#11873)
Face down changes:
* GUI: added visible face down type and real card name for controller/owner (opponent can see it after game ends);
* GUI: added day/night button to view real card for controller/owner (opponent can see it after game ends);
* game: fixed that faced-down card can render symbols, abilities and other hidden data from a real card;
* images: added image support for normal faced-down cards;
* images: added image support for morph and megamorph faced-down cards;
* images: added image support for foretell faced-down cards;

Other changes:
* images: fixed missing tokens from DDD set;
* images: no more client restart to apply newly downloaded images or render settings;
* images: improved backface image quality (use main menu -> symbols to download it);
2024-02-29 01:14:54 +04:00
theelk801
1a8dce83d0 rename face-up/face-down events 2024-01-17 15:56:11 -05:00
xenohedron
1bdacc6676
cleanup: CardsImpl and related (#11585)
* minor cleanup of unused params in ExileZone

* cleanup CardsImpl

standardize logic for different methods

remove unused ownerId param
2023-12-29 22:39:56 -05:00
Oleg Agafonov
00a7cc645d Copy abilities - fixed wrong copy of transformed tokens like Incubator/Phyrexian (related to #11535, #11307, #10801, #10263); 2023-12-10 14:49:47 +04:00
Artemis Kearney
9ba0da00ff
Basic groundwork for extra decks (contraptions, attractions) (#10378)
* extra deck cards not counted in deck size

* extra deck handling in deckbuilder

* move responsibility for extraDeckCard boolean to CardImpl

* remove redundant field copy
2023-08-06 21:06:32 -04:00
xenohedron
8372c358b2
refactor: some code linting (#10624)
* remove obsolete check method
* code clean: PermanentImpl
* code clean: PlayerImpl
* protected constructors in CardImpl
2023-07-16 01:50:24 +04:00
Oleg Agafonov
f0da749e0a refactor: improved some error messages/tests 2023-06-16 07:32:21 +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
Evan Kranzler
60e488cf05
rename classes (#10383) 2023-05-17 18:49: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
Oleg Agafonov
689b93d005 Refactor: improved choose cards method to use source param (fixed NPE like #10233, #9974 and other bugs with choose cards) 2023-04-21 11:02:57 +04:00
Oleg Agafonov
3226b85589 GUI: fixed error on second side switch 2023-04-14 18:13:36 +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
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
4e9ffdfaf9 * GUI: double faced cards improves:
* fixed images download for alternative prints (#9826, #9701);
 * fixed wrong pair of main and second side arts for alternative prints;
2023-03-11 17:35:18 +04:00
Oleg Agafonov
743143acde * GUI: meld cards improves:
* added images download for melds cards (#9660);
 * added switch card side button to view a meld part;
 * fixed NPE and other errors on card side switching;
 * added meld cards support in test render dialog;
2023-03-09 21:36:39 +04:00
Evan Kranzler
5a4d755dba
Some changes to meld implementation (#9620)
* some surface-level tweaks to meld implementation

* add default implementation for meldsWith method

* move nightcard declaration to meldcard constructor

* remove unused variable declaration
2022-10-05 12:00:59 -04:00
Alex Vasile
6035f04140
Disable auto-payment of mana for spells which care about mana color (#9173) 2022-10-03 19:16:45 -04:00
Alex W. Jackson
a94c837ad0
Fix casting of Disturb cards with Auras on the back (#8600) 2022-07-08 23:37:52 -04:00
Alex Vasile
b52576fcf9
Stop permanents getting counters when phased out (#9194) 2022-07-04 09:33:30 -04:00
Jeff Wadsworth
48a96e5e8f - Fixed #8916 2022-06-24 15:31:35 -05:00
Evan Kranzler
44596dba06 moved addAbilities method into the only class that uses it to make my IDE's autocomplete less annoying 2022-04-25 09:09:29 -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
4ede390e40 some reworking of Equip, Fortify, and Reconfigure 2022-02-17 18:08:22 -05: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
Daniel Bomar
5a6bfb710e
Fixed more instances of missing sub abilities 2021-10-22 19:12:19 -05:00
Evan Kranzler
a88427a6d9 [MIC] Implemented Visions of Dominance 2021-09-20 08:48:28 -04:00
Evan Kranzler
2fa76fc7be reworked Clockwork creature implementations (fixes #8292) 2021-09-18 11:08:17 -04:00
Evan Kranzler
d93475a5bb refactored flashback to remove unnecessary timing rule argument 2021-09-11 18:08:35 -04:00
jeff@delmarus.com
5a87664a55 - Fixed #8166 2021-08-28 15:40:46 -05:00
Evan Kranzler
572104b8fc
Reworking card types in preparation for implementing Grist, the Hunger Tide (#7899)
Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
2021-07-09 07:28:43 +04:00