Commit graph

4077 commits

Author SHA1 Message Date
Oleg Agafonov
aef220a19b tests: added progress bar with all running games in load tests, added error on non-started local server 2024-12-31 22:08:13 +04:00
Oleg Agafonov
60112c6be5 test framework: added commands to check declared attackers and blockers creatures (useful for AI tests, see checkAttackers and checkBlockers) 2024-12-31 22:08:13 +04:00
Grath
6b9532febd
[refactor/bugfix] use rule 802.2a where appropriate. (#13179)
* [refactor/bugfix] use rule 802.2a where appropriate.

Many effects which relied on getDefendingPlayerId would fail if the attacking creature had been removed from combat before they resolved, in which case the defending player ID would be null. This fixes these issues.

* Add test for removing attacking creature with Defending Player triggered ability.

Change allowFormer to be true by default, reduce falses to only necessary cases.
2024-12-25 14:18:01 -05:00
Oleg Agafonov
f4572faf8b AI, combat: fixed that computer blocking an attacker by biggest creature instead optimal;
refactor: fixed that Defiant Vanguard depends on debug data;
2024-12-25 18:43:26 +04:00
Oleg Agafonov
138788659a AI, combat: fixed that computer safely blocks the weakest creature instead most powerfull 2024-12-23 01:54:04 +04:00
AlexKidd29
5928c84026
refactor: fixed wrong packge for RadCounterTriggerTest (#13162) 2024-12-19 01:55:21 +04:00
Cameron Merkel
73b63d14ad
TargetAmount refactors (#13128)
* Add minimum and maximum target counts as parameters for TargetAmount and its subclasses; update/add several rules comments (and one actual text) for clarity; remove unused imports

* Get amount+description from target instead of parameters for DistributeCountersEffect and DamageMultiEffect; additions to TargetImpl.getDescription to accommodate

* Create separate method to check if "any number" phrasing should be used, override it in TargetAmount

* Check instanceof TargetAmount before casting

* Add new constructors to chain off of for TargetCreaturePermanentAmount & TargetCreatureOrPlaneswalkerAmount

* Fix text for Storm the Seedcore

* Use Integer.MAX_VALUE instead of 0 to represent no maximum targets

* Add comment about getUseAnyNumber()

* Use amount-only constructors in some TargetAmount subclasses, add clarifying documentation

* Fix a few calls

* Require more specific filters
2024-12-17 19:23:18 -05:00
Grath
bd1f802f46 Fix DeckValidatorTest. 2024-12-16 13:48:37 -05:00
Oleg Agafonov
2955535927 tests: added tests for auto-lands suggestion in deck editor and tourney (related to #13127) 2024-12-16 21:50:27 +04:00
Oleg Agafonov
4bce1e0a9a When you cast this spell - fixed that it required double cost for cards with alternative costs like Evoke (example: Nulldrifter, #12843) 2024-12-14 21:47:55 +04:00
Oleg Agafonov
38b54beb54 tests: added Grand Abolisher tests for #13099 2024-12-14 18:49:34 +04:00
Oleg Agafonov
12220a7ada tests: added batch event tests for #13089 2024-12-14 18:25:54 +04:00
Oleg Agafonov
ea0b0915a5 Triggered abilities - fixed that sacrice trigger doesn't work on itself (related to #13089, regression from #13088) 2024-12-14 16:59:20 +04:00
Oleg Agafonov
b855434a24 refactor: fixed dies events support in single cards (part 8, related to #13089, continue from #13088); 2024-12-14 15:48:32 +04:00
Oleg Agafonov
a970dc46c7 Havengul Laboratory // Havengul Mystery - fixed that it doesn't transform back on creature leaves 2024-12-14 09:12:25 +04:00
PurpleCrowbar
b559ed6a63 [FDN] Implement Quilled Greatwurm 2024-12-13 19:03:45 +00:00
xenohedron
24687eb4af implement [CLB] Hezrou 2024-12-08 20:27:17 -05:00
Oleg Agafonov
9816ec7c26 tests: added wrong commands order check 2024-12-07 22:40:33 +04:00
Oleg Agafonov
8af7a492c8 refactor: fixed dies events support in single cards (part 7, related to #13089, continue from #13088); 2024-12-07 14:39:52 +04:00
Oleg Agafonov
c6bec887b9 Triggered abilities - fixed that it can trigger from hand or library (related to #13089, regression from #13088) 2024-12-01 15:28:30 +04:00
Oleg Agafonov
57ef74da90 Recover abilities - fixed that it doesn't ask to pay a cost on multiple triggers; 2024-11-30 04:23:36 +04:00
Oleg Agafonov
6d55e4b9e6 refactor: fixed dies events support in single cards (part 5); 2024-11-30 04:23:35 +04:00
Oleg Agafonov
740a9347ae refactor: removed some usages of short LKI, moved static ability's useable zone logic to basic ability implementation; 2024-11-30 04:23:23 +04:00
Oleg Agafonov
0689c56597 refactor: fixed dies events support in single cards (part 4); 2024-11-30 04:23:21 +04:00
Oleg Agafonov
66b338c6fc dies triggers improves:
* tests: added additional tests and verify/runtime checks for wrong die trigger settings;
* refactor: removed some usage of short LKI ;
* fixed dies events support in "or trigger" and "conditional trigger" (use cases like sacrifice cost);
* fixed dies events support in shared triggered abilities (use cases like sacrifice cost);
2024-11-30 04:23:21 +04:00
xenohedron
d6cf207a8b
Introduce new batch event for life lost for a specific player (#13071)
* Introduce new batch event for life lost for a specific player

closes #12202, fix #10805

* implement [DSC] Valgavoth, Harrower of Souls

* text fixes
2024-11-19 23:41:34 -05:00
xenohedron
d06d594934
rework batch events (#13066)
* add new framework for batch triggers

apply for tapped, untapped, sacrificed, milled

simplify Ob Nixilis, Captive Kingpin

* add a verify check

* fix mistakes

* add simple tests

* another test

* zone change - enters battlefield

* zone change: not battlefield

* zone change - leaves battlefield

* fix Kaya Spirit's Justice

* rename OneOrMoreCombatDamagePlayerTriggeredAbility

* refactor OneOrMoreDamagePlayerTriggeredAbility

* new YoureDealtDamageTriggeredAbility

* new OpponentDealtNoncombatDamageTriggeredAbility

* rework Risona, Asari Commander

* simplify War Elemental

* Add damage batch by source

rework some delayed triggered abilities

* fix Mindblade Render

* rework Initiative and a few others

* [temp] initiative test

* refactor: common style for DealsDamageSourceTriggeredAbility

* refactor cards to use common DealsDamageSourceTriggeredAbility

* update damage players batch triggers

* fix mistake in initiative

* new DealtDamageAnyTriggeredAbility

* new DealtCombatDamageToSourceTriggeredAbility

* update dealt damage to permanent batch triggered abilities

* refactor Hot Soup and param in DealtDamageAttachedTriggeredAbility

* a few more permanent batch triggered abilities

* fix mistake

* update some more damage batch triggers

* add test for Phyrexian Negator

* update Felix Five-Boots and enable test

update Wayta, Trainer Prodigy to align

* update damage batch by source triggers

* undo mistaken change

* fix verify

* cleanup unused methods

* Revert "[temp] initiative test"

This reverts commit 11ed19295f.

* Revert "add a verify check"

This reverts commit e7de47a656.

* fixes from checking text discrepancies

* fix Shriekwood Devourer

* merge fix

---------

Co-authored-by: Susucre <34709007+Susucre@users.noreply.github.com>
2024-11-19 21:23:08 -05:00
xenohedron
5b0eba7068
refactor: end step triggered abilities (#13047)
* simplify BeginningOfEndStepTriggeredAbility

* more simplifications

* move to common class

* find and replace to common class

* simplify again

* align parameter order

* package reorg

* simplify BeginningOfCombatTriggeredAbility constructors

* simplify BeginningOfFirstMainTriggeredAbility constructors

* text fixes

* update docs
2024-10-28 01:49:11 -04:00
xenohedron
eee0fee79e
refactor: common logic for "at..." triggered abilities (#13045)
* add new common framework for at step triggered abilities

* move postcombat main and second main triggers to it

* update draw step triggers

* refactor BeginningOfCombatTriggeredAbility

* refactor BeginningOfFirstMainTriggeredAbility

* move Pronoun to constants package

* cleanup some cards to use simpler constructors

* package reorganization
2024-10-27 21:03:40 -04:00
Oleg Agafonov
c0e027f4f4 Verrak, Warped Sengir - improved combo support with phyrexian style effects like K'rrik, Son of Yawgmoth (closes #10119) 2024-10-27 14:57:53 +04:00
xenohedron
8a8773971d
refactor: add new simpler technique for intervening if conditions on triggered abilities (#13037)
too many usages to fix all at once, plus condition text needs updating, but this will give a cleaner option for new implementations
2024-10-27 00:19:57 -04:00
xenohedron
001f9e866f
refactor: PlayFromGraveyardControllerEffect (#13032)
* refactor PlayFromGraveyardControllerEffect for broader usage

* AbandonedSarcophagus to common class

* refactor Player::canPlayCardsFromGraveyard to AsThough common class

* a few more refactors
2024-10-26 16:20:16 -04:00
Oleg Agafonov
e35911ad85 tests: fixed random fails 2024-10-26 12:19:47 +04:00
Oleg Agafonov
a9bdf2eb18 test framework: improved aiXXX commands support:
- added more options for priority control (play single priority, play multiple priorities until stack resolved);
- added more options for step control (play single step, play multiple steps);
- improved compatibility with AI and real time commands (now check commands can be called inside AI controlled steps);
- added tests for assign non-blocked damage;
2024-10-26 11:55:19 +04:00
Oleg Agafonov
2d9ac4e732 refactor: removed outdated Player::assignDamage by multi amount dialog, fixed getMultiAmount to work with min values, added additional checks 2024-10-24 15:31:04 +04:00
ssk97
f2ff4828b3
Alternative solution to problem of unplayable cards from target adjustment (#12842)
* Alternative solution to problem of unplayable cards from target adjustment

* Review fixes
2024-10-19 19:13:39 -07:00
Grath
57deccae61
Fix HideawayPlayEffect to allow you to attempt to play everything (#13009)
* Fix HideawayPlayEffect to allow you to attempt to play everything, in cases of multiple Hideaway triggers.

* Allow users to choose order of cards to be potentially played.

* Update HideawayPlay and Arcane Bombardment to not ask if you want to play the cards you chose.

Update tests, add tests for
- Select the order in which to play cards
- Attempt to play two lands with only one land drop available, only the first land enters play
- Play two lands with extra land drops available.

* Fix no-parameter constructor.
2024-10-18 23:05:06 -04:00
paasar
3265b9a060
Fix Marchesa, Resolute Monarch's upkeep trigger (#12994)
* Fix Marchesa, Resolute Monarch's upkeep trigger

Before fix it was triggering wrongly when player had been dealt damage
since last turn.

* Improve Marchesa test by explicitly checking +1/+1 counters
2024-10-18 23:04:00 -04:00
Evan Kranzler
1484e3b575
Rework "second main phase" abilities (#12970)
* replace all instances of "postcombat main phase" with "second main phase" minus exceptions

* second main trigger now works correctly

* add survival test

* additional text fixes
2024-10-18 23:03:43 -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
17c43f3a44 tests: added more use cases for Connive ability (related to #9101, #9100) 2024-10-13 11:56:05 +04:00
Oleg Agafonov
ccb1a0aeed tests: added additional use cases for Connive ability (related to #9101, #9100) 2024-10-13 11:35:32 +04:00
ssk97
be745cb096
implement [BLB] Dragonhawk, Festival of Embers, Jackdaw Savior, Infamous Cruelclaw (#12906)
* [BLB] Dragonhawk, Fate's Tempest

* [BLB] Festival of Embers

* [BLB] Jackdaw Savior + test

* [BLB] The Infamous Cruelclaw

* Dragonhawk changes

* Create generic GraveyardFromAnywhereExileReplacementEffect

* Hide Cruelclaw Menace reminder text

* fix style errors
2024-10-12 14:07:52 -04:00
xenohedron
c50147b09c tests: add more info to booster generation test output 2024-10-03 20:30:54 -04:00
xenohedron
8bcac56550 tests: improve booster generation summary output 2024-09-29 19:01:12 -04:00
xenohedron
554ba8739e fix #12928 (The Mindskinner) 2024-09-28 22:25:27 -04:00
Oleg Agafonov
701bd68d97 tests: added test for LKI from copied spell (related to Swan Song fix from #12883) 2024-09-25 09:55:19 +04:00
Oleg Agafonov
e1ab0be505 images: fixed wrong miss image message in card hints for dungeons and other command objects (part of #12274); 2024-09-20 17:23:14 +04:00
Oleg Agafonov
f55bc2c4fc [TMP] Implement Phyrexian Splicer (part of #5379) 2024-09-20 15:29:06 +04:00
jimga150
e1f76c2b6c
Fix SacrificeTargetCost and SacrificeAllCost activator checks (#12809)
* Fix Tergrid's Lantern and add test

* Remove custom effect, fix SacrificeTargetCost to avoid checking for activated abilities and sidestepping the controllerID

* Add test to verify change to SacrificeTargetCost

* Add special action test

* Fix canPay check for SacrificeTargetCost

* Remove activated ability check in SacrificeAllCost

* Remove cost-specific activator checks for special actions, as they are redundant

* add null check for game.getPlayer
2024-09-18 19:09:39 -04:00