Commit graph

450 commits

Author SHA1 Message Date
Oleg Agafonov
a15a0daa04 Fixed potential NPE errors in getPhase usage (fixed Berserker's Frenzy, etc) 2023-03-25 16:01:27 +04:00
Alex Vasile
f68db93683 Fix minor bug in ComputerPlayer mana handling 2022-10-04 02:01:34 -04:00
Alex Vasile
55a6acba22
Refactor: Significant speed-up for ManaOptions (#9233) 2022-10-04 00:08:20 -04:00
Alex Vasile
b14af42280
[DMU] Karn's Sylex (#9507) 2022-09-17 22:37:56 -04:00
Alex W. Jackson
a6c5209a2a Combat.getAttackers and Combat.getBlockers now return a Set instead of a List, so that two-headed blockers aren't included twice 2022-09-07 22:36:05 -04:00
sprangg
7554a2b6b5
Make Add Land dialog no longer add a random mix of regular and snow-covered basic lands (#9353)
The Add Land dialog now only adds regular basic lands and never snow-covered ones, unless you specifically select a set that only contains snow basics (e.g. MH1) Sets that only contain snow basics are not selectable when adding lands to a Limited deck.
2022-08-10 20:11:01 -04:00
Alex Vasile
8b71e0a444 [DEV] JDK 11+ support. All builds still target Java 1.8. 2022-08-05 00:17:00 -04:00
Alex Vasile
137f02f31b Added AI Targeting for TargetActivatedOrTriggeredAbility. Closes #9276. 2022-07-17 00:29:39 -04:00
DeepCrimson
12595ac651
Refactor: Replace unnecessary Collections.sort with List.sort (#9168) 2022-06-26 22:59:28 -04:00
DeepCrimson
3f96f243b2
Refactor: Remove redundant 'blockers' variable declaration (#9167) 2022-06-26 22:58:55 -04:00
DeepCrimson
7bb851e0a5
Refactor: Fix spelling of 'controller' (#9163) 2022-06-26 22:58:06 -04:00
DeepCrimson
0c8ef41012
Fix spelling of doneChoosing() (#9002) 2022-05-25 22:25:15 -06:00
Alex Vasile
015cdf3136
Revert "Added missing fields to many copy constructors. (#8957)" (#8999)
This reverts commit 82708e4273.

Some of these (AI related result in bloated memory usage, needs more investigation).
2022-05-25 12:57:24 -06:00
Alex Vasile
82708e4273
Added missing fields to many copy constructors. (#8957) 2022-05-25 09:51:18 -06:00
Evan Kranzler
9ead88bacb [SNC] Implemented Endless Detour 2022-04-19 18:40:45 -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
bbb9382150
Reworking effects which allow casting spells from a selection of cards (ready for review) (#8136)
* added function for casting spells with specific attributes from a selection of cards

* updated cascade to use new method

* refactored various cards to use new methods

* added TestPlayer method

* fixed a small error

* text fix

* broke out some repeated code

* added missing notTarget setting

* add additional retain zone check

* some more cards refactored

* more refactoring

* added interface for split/modal cards

* reworked spell casting methods

* reworked multiple cast to prevent unnecessary dialogs

* fixed test failures due to change in functionality

* add AI code

* small nonfunctional change

* reworked Kaya, the Inexorable

* added currently failing test

* added more tests

* updated Geode Golem implementation

* fixed adventure/cascade interaction, added/updated tests

* some nonfunctional refactoring

* added interface for subcards

* [AFC] Implemented Fevered Suspicion

* [AFC] Implemented Extract Brain

* [AFC] updated Arcane Endeavor implementation

* [C17] reworked implementation of Izzet Chemister

* [ZEN] reworked implemented of Chandra Ablaze

* additional merge fix

* [SLD] updated Eleven, the Mage

* [NEO] Implemented Discover the Impossible

* [NEO] Implemented The Dragon-Kami Reborn / Dragon-Kami's Egg

* [NEO] Implemented Invoke Calamity

* [AFR] Implemented Rod of Absorption

* [VOC] Implemented Spectral Arcanist

* [VOC] added additional printings

* [NEO] added all variants

* [SLD] updated implementation of Ken, Burning Brawler
2022-03-09 08:03:54 -05:00
Evan Kranzler
4591ac07cc
Reworking goad effects (ready for review) (#8034)
* changing goad to designation, refactored goad effects to be continuous

* [AFC] Implemented Vengeful Ancestor

* reworked effects which goad an attached creature

* updated goading implementation

* updated combat with new goad logic

* some more changes, added a test

* another fix

* update to test, still fails

* added more failing tests

* more failing tests

* added additional goad check

* small fix to two tests (still failing

* added a regular combat test (passes and fails randomly)

* fixed bug in computer player random selection

* some changes to how TargetDefender is handled

* removed unnecessary class

* more combat fixes, tests pass now

* removed tests which no longer work due to combat changes

* small merge fix

* [NEC] Implemented Komainu Battle Armor

* [NEC] Implemented Kaima, the Fractured Calm

* [NEC] added all variants
2022-02-15 09:18:21 -05:00
Evan Kranzler
54203c16d3
[NEO] Implementing Compleated mechanic and hybrid phyrexian mana (ready for review) (#8677)
* [NEO] Implemented Tamiyo, Compleated Sage

* replaced PhyrexianManaCost calls with ManaCostsImpl calls

* updated phyrexian mana implementation

* added phyrexian hybrid symbol support

* updated starting loyalty implementation for planeswalkers

* change compleated to singleton

* implemented Compleated ability

* added some missing loyalty setters

* changed when loyalty is added to a walker to fix bugs

* slight change to some tests to fix them from failing

* fixed token issue
2022-02-10 10:25:23 -05:00
Oleg Agafonov
58ab020065 Dev: pom clean up, improved parent/child structure; 2021-10-03 18:11:56 +04:00
Oleg Agafonov
f9beed6a89 Dev: clear pom files, fixed wrong test packages and scope, added zip tests; 2021-09-29 16:01:36 +04:00
Oleg Agafonov
42325c7c2e AI improves:
* AI: fixed that AI was able to targeting an invalid player targets in some use cases (#5630);
* AI: fixed that AI was able to ignore targeted triggers in some use cases;
* AI: improved player targeting for not own chooses (if it's make a choice for another player);
2021-09-26 18:40:26 +04:00
Oleg Agafonov
6bc5a00e8a * Alternative costs - fixed that it can be activated on free cast (example: cascade with overload, #6925, #7410, #7741, #6342); 2021-09-21 14:22:46 +04:00
Jeff Wadsworth
77845bd1df Fixed #8286. 2021-09-20 15:54:52 -05:00
Oleg Agafonov
261f32d9b9 Fixed wrong targetId in CAST_SPELL, fixed miss code from 7b7bbcadd69dd717d980e1981031cb29d7c7b891; 2021-09-04 03:01:20 +04:00
Oleg Agafonov
2158d682cc Prepare new release 2021-08-30 14:44:03 +04:00
Oleg Agafonov
14838e670a Merge fix 2021-08-21 17:55:44 +04:00
Oleg Agafonov
7dcdc12c0f * Target permanent or suspended card - added AI support, fixed rollback errors in AI games (example: Shivan Sand-Mage, see #7896); 2021-08-21 17:19:45 +04:00
Oleg Agafonov
9fa487e60a * Suspend ability - fixed that suspend can be activated from opponent's hand; 2021-08-20 15:40:42 +04:00
Oleg Agafonov
c6a3d5e588 Prepare new release 2021-07-25 01:15:33 +04:00
Oleg Agafonov
c1db466d05 AI: fixed computer's errors if all players quit the game; 2021-07-24 05:52:02 +04: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
Oleg Agafonov
62d6675be6 AI: fixed that computer can't play commanders (#7955); 2021-07-01 18:21:15 +04:00
Evan Kranzler
a61d5543fa replaced all instances of converted mana cost with mana value 2021-04-17 17:02:27 -04:00
Daniel Bomar
600cac6fc7
[READY FOR REVIEW] Implement a "multi-amount" dialog (#7528)
* Implemented chooseTargetAmount and new GUI dialog (distribute damage, distribute mana)
* Added tests and AI support;
* Test framework: added aliases support in TargetAmount dialogs;

Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
2021-04-17 14:28:01 +04:00
Oleg Agafonov
2906f86324 Test framework: simplified AI logic and tests, added usage comments. Devs recommendations:
* in card's code use player.isComputer instead player.isHuman (it help to split Human/AI logic and test both by unit tests);
* usage example: AI hint to skip or auto-calculate choices instead call of real choose dialogs;
* unit tests for Human logic: call normal commands;
* unit tests for AI logic: call aiXXX commands;
2021-03-07 23:38:10 +04:00
Oleg Agafonov
dda69cd009 * AI: improved support of "as though mana" abilities (now computer can choose correct mana ability to pay, example: Draugr Necromancer);
* Dev: added card's LKI support of multi part cards (mdf/split/adventure);
* Dev: improved support of adding/removing counters from mdf cards;
* Draugr Necromancer - fixed support of mdf/split/adventure cards (#7620);
2021-02-27 20:14:12 +04:00
Oleg Agafonov
91f4d78992 Changes related to Cascade ability (#7583):
* Cascade: added correct spell ability choose for forced cast of mdf and adventure cards (can contains one or both sides);
* Cascade: added tests from latest oracle changes;
* AI: improved spell ability choose for forced cast (example: cast target card without mana cost);
* GUI: improved spell ability choose for forced cast (now you can see only castable spells to choose);
* Other: fixed wrong PlayFromNotOwnHandZone in some cards, fixed NPE;
2021-02-23 02:00:38 +04:00
Oleg Agafonov
10e557b873 * Performance: memory usage optimization for deck editor (part 2 of removed bloated usage of ManaCosts -> ManaColor objects, see #7515); 2021-02-12 22:12:18 +04:00
Oleg Agafonov
cf216c6802 Prepare new release 2021-02-07 22:24:40 +04:00
Oleg Agafonov
f692a1f097 * Choice of Damnations - improved AI support, fixed rollback error in AI games;
* Pain's Reward - improved AI support, fixed rollback error in AI games;
* Volcano Hellion - improved AI support, fixed rollback error in AI games;
2021-02-06 12:48:53 +04:00
Evan Kranzler
bc99de1a48 [KHM] fixed Frostpyre Arcanist being used incorrectly by AI (#7488) 2021-02-04 10:50:10 -05:00
Oleg Agafonov
64e948e4b3 * AI: improved game performance by x10 for cards with target amount;
AI: added targeting name and amount info to simulation logs;
AI: removed duplicated target variations from target amount simulations;
2020-12-24 15:02:28 +04:00
LevelX2
2daa5aae50 * Fixed that AI fired targeting event twice (fixes #7094). 2020-12-23 15:53:55 +01:00
Oleg Agafonov
255c292104 * Deals damage divided as you choose - fixed that some cards can't choose planeswalkers (example: Arc Lightning, see #7276);
Refactor: simplified FilterCreaturePlayerOrPlaneswalker to use single permanent filter;
2020-12-23 02:31:41 +04:00
Oleg Agafonov
cc5fce4256 Prepare new release 2020-12-19 23:59:44 +04:00
Oleg Agafonov
db239a1055 Refactor: replaced sourceId by source and introduced source param in some methods; 2020-12-12 20:23:19 +04:00
Oleg Agafonov
2b78388eab [CMR] fixed Akroma's Will - missing copy of new condition in modes (#7210);
Improved compatibility of new modes condition with choose dialogs and test framework;
2020-11-28 19:49:16 +04:00
Oleg Agafonov
ea46afbe62 Prepare new release 2020-11-10 13:11:45 +04:00
LevelX2
668a21fc18 * Fixed that computer player could discard cards that did not match the given filter (to pay e.g. discard costs of Mox Diamond - fixes #7028). 2020-08-31 14:20:58 +02:00