Commit graph

3464 commits

Author SHA1 Message Date
xenohedron
1a13dcd091
Merge pull request #11185 from xenohedron/becomestarget
Rework "whenever ... becomes the target of ..., " abilities
2023-09-24 22:09:14 -04:00
xenohedron
79157a7219 fix Agrus Kos, Eternal Soldier 2023-09-22 23:38:16 -04:00
xenohedron
8f92a23302 rename class for consistency 2023-09-22 23:38:16 -04:00
xenohedron
9ffca1a70b add a bunch of test cases 2023-09-22 23:14:41 -04:00
Oleg Agafonov
abda1fb53b GUI: fixed wrong feedback panel status in computer games (related to #11189) 2023-09-22 11:00:47 +04:00
xenohedron
fa8e93a29d
rework CombatDamageByToughnessAllEffect (#11180)
new CombatDamageByToughnessControlledEffect
add tests
fix #11179
2023-09-19 01:41:55 -04:00
xenohedron
666c03e48c fix ability string in test 2023-09-17 20:39:21 -04:00
Susucre
d3779d9270
Fix Brine Comber not triggering out of disturb auras (#11170) 2023-09-17 20:19:37 -04:00
Susucre
a3f787b170
test framework: allow direct addEmblem (#11164) 2023-09-17 20:18:46 -04:00
Oleg Agafonov
4e77ccb381 refactor: removed unused data from special action, improved code (related to #11137) 2023-09-17 14:37:49 +04:00
ssk97
b6dbc782be
Fix casting Transformed (#10778)
* Combine casting Transformed into a shared SpellAbility, apply transform effect before spell is cast

* Minor cleanup

* Use effect.apply() rather than game.applyEffects()

* Add test with Maskwood Nexus
2023-09-15 17:56:32 -04:00
Susucre
f4b0b83612
[UNF] Implement Comet, Stellar Pup (#10925) 2023-09-15 17:55:11 -04:00
Oleg Agafonov
6f12d62882 tests: fixed random fails in RadiateTest (wrong MOR predicate code, #9550) 2023-09-15 06:30:10 +04:00
Codermann63
e92031a3bb
[WOC] Implement Unfinished Business (#11144)
* [WOC] Implement Unfinished Business

* Added assertIsNotAttachedTo

* Added unittests for [WOC] Unfinished Business

* Remove unused import

* Refactored assertIsAttachedTo & assertIsNotAttachedTo into assertIsAttached.

* Added processAction after return of creature

* Added comments and minor changes

---------

Co-authored-by: Codermann63 <zoiazous@gmail.com>
2023-09-13 21:12:09 -04:00
Vivian Greenslade
aaf8f92db7
fix Gustha's Scepter; add test (#11141) 2023-09-09 15:33:40 -04:00
Vivian Greenslade
dc1e94648b
[BRC] Implement Kayla's Music Box (#11130) 2023-09-09 15:32:34 -04:00
Vivian Greenslade
98324b042a
[40K] Implement Neyam Shai Murad (#11118) 2023-09-09 15:32:20 -04:00
Vivian Greenslade
8c1a4d1fa6
[WOC] Implement Misleading Signpost (#11084)
* [WOC] Implement Misleading Signpost

* moved effect to common file

* added unit test

* added battle to test

* updated effect name, fixed list of defenders

* fix test text

* added text for effect

* fixed target

* made changes as per PR comments

* added unit test for 508.7c
2023-09-09 15:32:04 -04:00
Susucre
8b79053deb
[WOC] Implement Court of Garenbrig (#10970)
* add DoubleCounterOnEachPermanentEffect

* Clean text generation of ConditionalOneShotEffect to prevent "if if"

* [WOC] Implement Court of Garenbrig

* better rule generation

* fix target, add tests
2023-09-09 15:31:49 -04:00
Vivian Greenslade
3e217d992c
[CLB] Implement Dynaheir, Invoker Adept (#11117) 2023-09-08 23:58:09 -04:00
Vivian Greenslade
26012ee135
[40K] Implement Kharn the Betrayer (#10885)
* implements Kharn the Betrayer

* added flavor text

* fixed test

* fixed issue with triggered ability not working

* removed diacritic

* added effect text to test

* fixed several issues as per PR comments

* fixed access

* updated Kharn to use PreventionEffect

* added unit test for control loss via other sources
2023-09-08 23:57:11 -04:00
Susucre
cc4a5f9959
Fix DamagedPlayerBatchOnePlayerEvent not checking the target is the player. (#11128) 2023-09-08 23:56:31 -04:00
xenohedron
4089360cc8 fix wrong choice in test 2023-09-07 02:22:16 -04:00
Oleg Agafonov
ffd32804c8 [C13] Tempt with Immortality - fixed wrong target settings 2023-09-07 05:35:55 +04:00
PurpleCrowbar
692c55e3e1
Do this only once each turn - fixed wrong triggers after optional usage (example: Ondu Spiritdancer, see #11106) (#11107)
* Fix Ondu Spiritdancer. Closes #11106
* Add tests for "Do this only once each turn"
* Add test for Ondu Spiritdancer
2023-09-06 22:12:03 +04:00
Susucre
4ad92d0a35
[C21] Living Lore - fixed wrong mana usage from exiled cards (wrong ZCC usage) (#11103) 2023-09-03 23:44:32 +04:00
Susucre
67ab0bc590
[WOE] Graceful Takedown - fixed that it doesn't work (#11091)
* [WOE] fix Graceful Takedown
* add tests
2023-09-02 16:07:39 +04:00
Oleg Agafonov
8a65b0f149 refactor: removed netbeans's auto-generated comments 2023-09-02 16:05:29 +04:00
Susucre
24315460fe
Bargain ability - fixed that cards can't be cast without full mana (#11089)
* [WOE] Fix Hamlet Glutton & friends
* add tests
2023-09-02 15:38:45 +04:00
Vivian Greenslade
f9708c663e
[WOC] Implement Korvold, Gleeful Glutton (#11072) 2023-08-31 20:00:03 -04:00
arcox
2f0c1d84c5
Lint: fix 'declarations should use interfaces instead of classes' bugs (#11082) 2023-08-31 21:42:45 +04:00
xenohedron
d6c690601d
Merge pull request #11031 from xenohedron/cleanup-7a-7b
More SetBasePowerToughnessSourceEffect cleanup
2023-08-31 00:29:59 -04:00
xenohedron
d0d708ba52 Add tests 2023-08-30 23:40:56 -04:00
Oleg Agafonov
060b8f9dc9 backup ability: fixed wrong duration and discard in Streetwise Negotiator, added related tests and runtime/verify checks (related to #11068) 2023-08-31 07:29:05 +04:00
Vivian Greenslade
a65c2204ce
Rework CombatDamageByToughness effects (#11068)
* split effect into three classes for convenience

* added static filter

* refactored cards using effect

* fixed issues as per PR comments

* changed predicate and fixed text

* added unit test, fixed text issues with Baldin

* set static text

* changed outcome

* added stop to test

* fixs issues as per PR comments
2023-08-30 20:16:14 -04:00
Susucre
fab00d2f27
[WOE] Implement Curse of the Werefox (#11009)
* [WOE] Implement Curse of the Werefox

* apply review

* Fix aura (and equipment?) tokens not checking for protection on target

* fix targetting of reflexive trigger, by creating a custom fight effect.

* fix reflexive ability target.
2023-08-30 19:16:22 -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
Susucre
fe165f1fd0
Fix Adventures exiling themselves before applying their effects (#10793)
* Rework adventures to exiles themself after applying other effects

* fix duelist

* finalize all adventures

* apply review

* add card name to error

* fix remaining adventures

* finalize the last adventures.
2023-08-30 19:15:47 -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
ssk97
c50e913398
Add Smoothed London Mulligan option (#10965)
* Add Smoothed London Mulligan (similar to but weaker than MTGA's)

* Make SmoothedLondonMulligan extend LondonMulligan instead of copying code

* modified to be have no effect within +1/-1 of the expected lands
fixed tests by always putting nonchosen hand on the bottom

* Inherit the primary mulligan logic as well, add comments

* Make drawHand public and part of Mulligan, use it on opening 7
use Card::isLand instead of reimplementing it, remove unused imports
Use standard spacing

* Better account for half-land MDFCs

* Don't count TDFCs as half-lands

* Remove "crossover_point" calculation to make algorithm clearer

* Genericize the tests, undo changed access that's no longer needed, unbox bool

* Use standard case in function naming

* Add Override

* Add mulligan type to TableView info, add tourneyMatchOptions local variable
2023-08-27 15:08:27 -04:00
Oleg Agafonov
c691612526 game: reverted changed in NamePredicate and added additional tests (related to #11041) 2023-08-27 09:06:32 +04:00
xenohedron
f72f88cb35 tests for Primal Clay and friends
(current implementation is workaround)
2023-08-27 00:24:19 -04:00
Susucre
e39e5ee1b0
[WOC] Implement Alela, Cunning Conqueror (#10870)
Add new batch event `DAMAGED_PLAYER_BATCH_ONE_PLAYER`
2023-08-26 19:33:52 -04:00
Evan Kranzler
73dffb8de9
[WOE] Implement Agatha's Soul Cauldron (#11039)
* [WOE] Implement Agatha's Soul Cauldron

* add test

* remove static import
2023-08-26 17:56:46 -04:00
Vivian Greenslade
6852786a10
[WOC] Implement Archmage of Echoes (#11017) 2023-08-26 16:46:15 -04:00
Susucre
5062c84098
Refactor: removed server side objects from a client side game's data (#10788)
* Clean original values transmitted with CardView.originalObject
* Move RateCard to mage.Common, support cardView as argument.
* Clean PermanentView constructor for TestCardRenderDialog
2023-08-24 12:04:07 +04:00
Susucre
27bba74c9f
[WOE] Implement Imodane, the Pyrohammer (#10922)
* [WOE] Implement Imodane, the Pyrohammer

* unit test Imodane

* apply review

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-08-23 20:39:45 -04:00
Alexander Dahmen
6836db0196
[CLB] Implement Kagha Shadow Archdruid (#10919)
Signed-off-by: Alexander Dahmen <dahmena_hws@gmx.de>
2023-08-22 19:25:05 -04:00
Susucre
ecbc1dfa81
[WOE] Implement Icewrought Sentry (#10879)
* [WOE] Implement Icewrought Sentry

* add tests for the new trigger

---------

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
2023-08-21 09:22:29 -04:00
xenohedron
4af977289e
refactor effects "you may cast... from... graveyard... exile it instead" (#10926)
* cleanup exiling cast spells

* common class MayCastTargetThenExileEffect

* fix zcc check

* add test suite
2023-08-21 00:26:09 -04:00