Commit graph

434 commits

Author SHA1 Message Date
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
Oleg Agafonov
920697d2e5 Prepare new release 2020-08-23 01:52:55 +04:00
LevelX2
d51acbf090 * Removed unused imports. 2020-08-22 11:51:34 +02:00
LevelX2
8105d8b26c * Improved handling of asThoughtAs approval by abilities that allows a clear and easy assignment of the approving effect. 2020-08-21 14:58:22 +02:00
LevelX2
6a65e5bb23 * Mana Clash - Fixed use in available mana calculation (related to #6698). 2020-08-12 13:58:06 +02:00
LevelX2
3a82840e66 * Fixed some more available mana calculation problems. Mana of the pool is now taken into account (e.g. Coal Golem problem). Crucible of the Spirit Dragon - Conditional mana curretnly not handled correctly in available mana calculation. Crystalline Crawler works now.Related to #6698. 2020-07-16 22:37:51 +02:00
Oleg Agafonov
c4f028ffa0 Prepare new release 2020-07-10 16:50:38 +04:00
Oleg Agafonov
55f2893fc4 * AI: fixed that computer can cancel "target player or planeswalker" spells on bad effects (can't choose himself); 2020-07-07 06:31:06 +04:00
Oleg Agafonov
3f2a5fc362 Prepare new release 2020-06-20 11:36:13 +04:00
Oleg Agafonov
10cf884923 AI and test framework improved:
* Now AI can see and use special mana payments like convoke, delve, improvise pays;
* Now devs can test special mana payments (disable auto-payment and use choices for mana pool and special pays);
* Fixed broken TargetDiscard in tests;
* Fixed broken same named targets in tests;
2020-06-19 13:16:26 +04:00
Oleg Agafonov
fc5d766ebd * AI: improved exile from graveyard cost (now AI can use it with more efficiency) 2020-06-19 12:43:26 +04:00
Oleg Agafonov
eea808d2d6 Ability refactor: source improves, deprecated code removed; 2020-05-28 22:38:31 +04:00
Oleg Agafonov
8af43dc13a Ability refactor: new code to search abilities in cards and permanents; 2020-05-28 22:34:27 +04:00
Oleg Agafonov
63dbf5f40b * Split cards improves:
* Fixed that fused spells can't be played from non hand zone;
 * Fixed double choose spell dialog (#5506, #6549);
2020-05-19 01:30:46 +04:00
htrajan
51dcaa1725 update simulators 2020-04-16 20:14:43 -07:00
Oleg Agafonov
a20bca1b21 Test framework: fixed ai play commands, added more tests 2020-03-12 02:05:06 +04:00
Oleg Agafonov
86f6d39f5a * AI: fixed rollback errors on play cards with target stack (Diplomatic Escort, Not of This World, etc); 2020-03-09 13:49:07 +04:00