Commit graph

191 commits

Author SHA1 Message Date
Oleg Agafonov
c265e640bb Keen-Eyed Curator - fixed not working boost effect (#13022) 2024-10-24 22:18:29 +04:00
Grath
e5a351ff58
[DSC] Implement The Lord of Pain. (#12940)
Also adds "their" to the text that CardUtil.addArticle supports and fixes a range of influence bug in SpellCastAllTriggeredAbility.
2024-09-29 13:12:31 -04:00
xenohedron
2f9ba6dba9
fix "any number of targets with total value X or less" (#12808)
* improve UX for Call of the Death-Dweller

* add new utility methods for targets of total value limit

* fix affected cards to use new standard methods

* adjust message

* remove incorrect check

* requested adjustments
2024-09-09 00:18:29 -04:00
theelk801
64774b457f [DSK] Implement Zimone, All-Questioning 2024-08-31 21:48:40 -04:00
Oleg Agafonov
2bf6e3e3a2 GUI: added mana and other symbols support in choose spell dialog (closes #12155) 2024-07-27 10:17:22 +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
e8808c3ae3
Remove duplicate code for X costs (#12551)
* Replace "([a-zA-Z]+).getManaCostsToPay().getX()" with CardUtil.getSourceCostsTag(game, $1, "X", 0)
Fix Disrupting Shoal

* Change final card .getX() calls

* Condense all ManacostVariableValue enum values into "instance"

* Further removal of getX, Display X symbol for non-mana X cards

* Fix test

* Fully remove ManaCosts.getX

* Replace all different X dynamic values with GetXValue

* Remove individual cards checking getAmount for X values (leaving cost reduction that does not use X)

* Add null check for game object inside getSourceCostsTagsMap

* fix build errors

* fix Vicious Betrayal

* text fix
2024-07-23 01:57:47 -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
Evan Kranzler
7fe6ba9c57
Implement "Promise a gift" mechanic (#12578)
* [BLB] Implement Wear Down

* [BLB] Implement Valley Rally

* [BLB] Implement Dawn's Truce

* add initial test

* [BLB] Implement Kitnap

* [BLB] Implement Long River's Pull

* [BLB] Implement Peerless Recycling

* [BLB] Implement Into the Flood Maw

* add more tests

* add verify skip

* remove skip

* a few requested changes

* [BLB] Implement Nocturnal Hunger

* add test for gifting a food token

* [BLB] Implement Starforged Sword

* add comment to activation ket

* add test for adding extra cards
2024-07-18 09:15:45 -04:00
ssk97
7cb669603f
[WHO] Time Reaper, Add target adjuster for "that player controls/owns" damage trigger targets (#12528)
* Implement Time Reaper, start rework

* Create DamagedPlayerControlsTargetAdjuster, convert Aberrant to use it

* Always add targets for EachOpponentPermanentTargetsAdjuster

* Improve target name, finish Time Reaper

* Convert some cards

* Improve documentation, more cards

* More cards, fix cards that needed to use owner instead of controller

* Fix unfinished AlelaCunningConqueror changes

* more cards

* All remaining cards

* Fix target type

* Remove outdated attempt at TargetController.SOURCE_EFFECT_TARGET_POINTER

* Finish removal of SOURCE_EFFECT_TARGET_POINTER

* Change targetAdjuster blueprint target to be set inside setTargetAdjuster, add error checking

* Always add Target Adjuster after Target

* Add comment

* Fix TolarianContemptTest to skip opponent with no valid targets

* Forgot to git add the new abstract GenericTargetAdjuster

* Test now possible after merge, fix missed ChangeOfPlans adjuster order

* Text and optional-ness fixes

* Always set target pointer
2024-07-02 08:46:14 +04:00
Oleg Agafonov
8a4a23bb8f game: improved cost tags to support card hints on stack (example: evidence, fixes #12522); 2024-06-25 18:25:08 +04:00
Oleg Agafonov
e7b8eecd64 Evidence abilities - added improved card hint with available evidence to collect 2024-06-25 10:30:50 +04:00
xenohedron
fc21365847
Fix "becomes the target of" logic to check all modes (#12452)
* check all targets from all modes for getTargetingStackObject

* update logic related to a97dec3
2024-06-11 00:58:12 -04:00
xenohedron
f2d6629313 text fixes 2024-06-06 23:05:44 -04: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
Susucre
0e64a326c6 implement [MH3] Kami of Jealous Thirst 2024-05-25 15:40:35 +02:00
Oleg Agafonov
36d54bc7a9 cheats: improved card commands to support names like ED-E, Lonesome Eyebot (related to #12238) 2024-05-09 11:43:37 +04:00
Susucre
36d6547bf8
Modal double-faced cards - fixed game error on usage with some replacement effects (example: Diluvian Primordial, closes #12176) (#12184) 2024-04-25 23:40:57 +04:00
xenohedron
fc3551fc0a text improvements 2024-04-17 20:54:05 -04:00
Susucre
c77634c843
separate 'you may play'|'you may cast' AsThoughtEffect approuvers
Also, reworked Gonti, Lord of Luxury and checks it now works properly with Zoetic Cavern.
2024-04-13 12:10:53 +02:00
xenohedron
8bf75ed000 text fixes 2024-04-11 00:34:19 -04:00
Susucre
d1de8b8cd3
[OTJ] Implement Tinybones, the Pickpocket + refactor MayCastTargetThenExileEffect (#12040) 2024-04-05 00:16:53 +02:00
Susucre
97ab8074b3
[OTJ] Implement Plot mechanic (+8 cards) (#12017)
[OTJ] Implement Aloe Alchemist
[OTJ] Implement Aven Interrupter
[OTJ] Implement Longhorn Shapshooter
[OTJ] Implement Kellan Joins Up
[OTJ] Implement Make Your Own Luck
[OTJ] Implement Jace Reawakened
[OTJ] Implement Lilah, Undefeated Slickshot
[OTJ] Implement Doc Aurlock, Grizzled Genius
2024-03-31 17:06:55 +02:00
xenohedron
cb28fb5a56
Refactor batch events (#11995)
* create new abstract class for batch event framework

* adjust CardUtil.getEventTargets to support new framework

* update TappedBatchEvent to new framework

* update UntappedBatchEvent to new framework

* slight cleanup

* update LifeLostBatchEvent to new framework

* update ZoneChangeBatchEvent to new framework

* complete refactor by moving damage events to new framework

* remove old code no longer used

* clean up some nonsense code in star wars card

* fix watcher checking id before event type

* fix wrong id usage

* fix missed wrong id usage
2024-03-28 23:19:20 -04:00
Oleg Agafonov
55f1d36695 game: improved visible rules of face down cards, removed visible face up cost (part of #10653, #11884) 2024-03-01 16:47:59 +04:00
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