Commit graph

216 commits

Author SHA1 Message Date
Oleg Agafonov
c8a9a1a9db game: improved game logs for faced-down spells and exiled cards - now it support popup hint to view card/permanent (part of #11884, related to #11881, #8781) 2024-03-01 02:08:25 +04: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
Oleg Agafonov
229e8d3075 game engine, tests and other fixes:
tests: fixed wrong permanent structure for battlefield cards (addCard command);
tests: added docs and additional runtime checks;
game: Modal double-faced cards - improved support, no more other side effects on battlefield;
game: Copy abilities - improved stability and cards support;
game: Player under control - improved stability and related cards support (possible NPE errors, additional runtime checks);
server: fixed bloated logs with game timer;
AI: fixed wrong timer in computer games;
2024-02-17 19:35:44 +04:00
xenohedron
16a8efa7ea text fixes 2024-02-09 23:26:24 -05:00
Evan Kranzler
99c2ffa231
Implementing "collect evidence" mechanic (#11671)
* [MKM] Implement Axebane Ferox

* add exile to cost, fix text

* add targeting message copied from crew ability

* [MKM] Implement Forensic Researcher

* [MKM] Implement Izoni, Center of the Web

* implement requested changes

* merge fix

* [MKM] Implement Sample Collector

* [MKM] Implement Evidence Examiner

* [MKM] Implement Surveillance Monitor

* [MKM] Implement Vitu-Ghazi Inspector

* [MKM] Implement Crimestopper Sprite

* [MKM] Implement Urgent Necropsy

* [MKM] Implement Analyze the Pollen

* implement requested changes

* add can pay cost check to counter unless pays effect

* fix test failure

* add tests

* fix prompt message
2024-01-27 20:26:14 -05:00
Oleg Agafonov
95481cd736 Mana Maze - fixed game error on usage (closes #11572, closes #11575); 2024-01-13 11:42:22 +04:00
Oleg Agafonov
50fd029c3b tests: improved show playable abilities to print playable list instead unique (see showAvailableAbilities), added custom effect for transform tests (see addCustomEffect_TransformTarget); 2023-12-10 14:31:55 +04:00
ssk97
d806a6a3be
Counter text improvements (plus a Magus Lucea Kane gameplay fix) (#11503)
* Improve text generation for some counter abilities

* Magus Lucea Kane must apply to permanent spells (bugfix, related to #11440)

* Further improve text generation of counter text

* Text improvements to a couple cards

* Graft text improvements

* Further remove unused variable

* Be consistent on Backup ability setup, revert Thalia's Lieutenant (filter reuse means it doesn't work)

* Thalia's Lieutenant original text was slightly wrong, fixed
2023-12-03 21:42:16 -05:00
Oleg Agafonov
6e3fe7ec46 Cascade and other "cast spell without paying" abilities - added card popup support for casting card (closes #11355) 2023-11-27 00:49:37 +04:00
Steven Knipe
f44b36fad2 Improve documentation 2023-11-17 02:53:43 -08:00
Steven Knipe
660288dfd7 Use generics to ensure the correct class types stored inside the costs tags. 2023-11-17 02:37:06 -08:00
Steven Knipe
177f72c8d8 Altered ego X value should be separate 2023-11-16 18:21:02 -08:00
Steven Knipe
77dd1711b5 Convert Kicker to costs tag system 2023-11-16 15:07:58 -08:00
ssk97
bea33c7493
Costs Tag Tracking part 2: Tag system and X values, reworked deep copy code (#11406)
* Implement Costs Tag Map system

* Use Costs Tag Map system to store X value for spells, abilities, and resolving permanents

* Store Bestow without target's tags
Change functions for getting tags and storing the tags of a new permanent

* Create and use deep copy function in CardUtil, add Copyable<T> to many classes

* Fix Hall Of the Bandit Lord infinite loop

* Add additional comments

* Don't store null/empty costs tags maps (saves memory)

* Fix two more Watchers with Ability variable

* Add check for exact collection types during deep copy

* Use generics instead of pure type erasure during deep copy

* convert more code to using deep copy helper, everything use Object copier, add EnumMap

* fix documentation

* Don't need the separate null checks anymore (handled in deepCopyObject)

* Minor cleanup
2023-11-16 23:12:32 +04:00
Susucre
41418ffa08 [LCI] Implement Bonehoard Dragon 2023-10-29 15:48:13 +01:00
Aquid
5b845ef7e4
[40K] Implement Anrakyr the Traveller (#11160)
---------

Co-authored-by: gravitybone <7361357+gravitybone@users.noreply.github.com>
Co-authored-by: Aquid <Aquid117@users.noreply.github.com>
2023-10-24 19:03:44 -04:00
xenohedron
59929d2860 new SourceDealsDamageToYouTriggeredAbility
fix #11262

test coverage provided by FlamebladeAngelTest
2023-10-20 21:48:35 -04:00
Susucre
7c454fb24c
Rework AsThough handling to allow choosing/affecting a specific alternate cast (#11114)
* Rework AsThoughEffect

* some cleanup of MageIdentifer

* refactor ActivationStatus

* fix bolas's citadel

* fix a couple of the Alternative Cost being applied too broadly.

* fix Risen Executioneer

* allow cancellation of AsThough choice.

* fix One with the Multiverse

* cleanup cards needing their own MageIdentifier

* last couple of fixes

* apply reviews for cleaner code.

* some more cleanup
2023-10-02 18:42:54 -04:00
xenohedron
1b9bcb92e6 improve targetMap usage, naming, docs per review 2023-09-24 00:22:21 -04:00
xenohedron
0086c5e4a2 add util methods getTargetingStackObject, checkTargetMap 2023-09-22 23:14:41 -04:00
Oleg Agafonov
be4bff6097 game: fixed wrong usage of batch events (related to #10870) 2023-09-13 04:42:46 +04:00
Oleg Agafonov
4b3a19b4d5 refactor: improved target usage, replaced setNotTarget by withNotTarget 2023-09-07 05:35:54 +04:00
Susucre
2a5dd4103c
[WOE] Implement Ashiok, Wicked Manipulator (#10909)
* [WOE] Implement Ashiok, Wicket Manipulator

* Add Ashiok's abilities

* basic pay life replacement tests

* many tests later

* add warning on token expecting watcher

* apply review

* rework text generation
2023-08-30 19:15:56 -04:00
Alex Vasile
a2162ec3e7
Refactor: private fields and performance tweaks (#9625)
1a. Make `costs`, `manaCosts`, and `manaCostsToPay` private in `AbilityImpl` with access through getters/setters 
1b. fix cost adjuster for imprinted cards affected by the above

2a. Lazy instantiation for rarely used `data` field in `TargetPointerImpl`

3a. Pre-allocate certain array sizes in `Modes` and `CostsImpl`

4a. Make `manaTemplate` private in `BasicManaEffect`, copy when passing outside the class 
4b. Don't copy `manaTemplate` in copy constructor since it doesn't change 
4c. Add comments explaining copy usage for `manaTemplate` 
4d. Remove redundant variable assignment and make fields final 

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-08-27 17:58:19 -04:00
Susucre
4cfc6ebc37
[WOE] Implement Beseech the Mirror (#10842)
Co-authored-by: Evan Kranzler <theelk801@gmail.com>
2023-08-18 15:06:37 -04:00
xenohedron
6fafbf0d93 new NextSpellCastHasAbilityEffect
cleanup Wand of the Worldsoul, Flockchaser Phantom to use it

text adjustments for gain abilities
2023-08-13 01:17:51 -04:00
Oleg Agafonov
3d3358cd05 game: turn modification improves:
- fixed miss phase changed events and logs in some use cases;
 - added source info in turn modification logs;
 - added game logs for take and lost control of the spell (example: Word of Command)
 - added game logs for skip step;
 - added game logs for extra step;
 - added game logs for skip phase;
2023-08-01 16:52:53 +04:00
xenohedron
6b23cd25f9 text adjustments and typo fixes 2023-07-25 00:57:41 -04:00
Oleg Agafonov
4ae5ca8421 docs: card hints usage improved 2023-07-09 02:21:56 +04:00
Oleg Agafonov
35b00c3da1 Fixed game errors for non started games (some cards uses dynamic hints with non-protected code) 2023-06-09 07:03:31 +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
3986196aa4 Tokens rework: fixed morph support, fixed test (related to #10139) 2023-05-01 19:41:25 +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
theelk801
b979f47cc3 [ONC] Implement Synthesis Pod 2023-04-24 22:26:50 -04:00
theelk801
747a9b14f7 [ONE] Implement Slobad, Iron Goblin 2023-04-24 19:00:08 -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
1dc7dcc94c Fixed images info copy in morph and other copy abilities 2023-04-21 11:39:03 +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
bc5c381fef GUI: fixed card's defense stat drawing in deck editor 2023-04-14 18:28:25 +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
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
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
Oleg Agafonov
a7480aeab1 * Game: fixed random sort order of choices in choose dialogs 2023-03-21 03:11:55 +04:00
Oleg Agafonov
6b05562336 * Choose an ability - fixed not working cards like Argivian Avenger, Atraxas Skitterfang, Steel Seraph (#10115) 2023-03-21 01:59:12 +04:00
Alex W. Jackson
332db3aecb Fix #9649 and clean up counter effect text generation 2022-10-14 00:41:02 -04:00
Alex W. Jackson
fd281ca483 Improve text generation for some common draw, discard and mill effects 2022-10-08 20:48:59 -04:00
Alex Vasile
55a6acba22
Refactor: Significant speed-up for ManaOptions (#9233) 2022-10-04 00:08:20 -04:00