Commit graph

3442 commits

Author SHA1 Message Date
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
Vivian Greenslade
bee62063df
[WOE] Implement Faerie Fencing (#10899) 2023-08-20 18:35:54 -04:00
Susucre
343549c4d7
Fix PermanentMeld missing copy constructor ; add more Meld tests. (#10908)
* Add some unit tests on Meld mana value.

* Fix PermanentMeld missing copy constructor. add more Meld tests.

* clean text
2023-08-20 13:30:10 -04:00
Susucre
3d9b0e422c
Fix Mungha Wurm (#10883)
* Fix Mungha Wurm's effect being symmetrical

* add tests.

* fix potential random failure
2023-08-20 13:29:43 -04:00
jbureau88
77d0d3c07e
Implement [BOT] Optimus Prime; adjust Bolster effect (#10129)
* Added implementation for Optimus Prime

* Added setCardName text and switch case for activateAlternateOrAdditionalCosts as disturb instead of default

* Fixed doubling effect bug

* Add only regular card number

* Added back alternate card for Optimus Prime and fixed Autobot Leader colors

* Convert before return from graveyard

* Convert before return from graveyard

* Fix images

* Resolve conflict with master

* don't manually set trigger phrase

* add additional effect capability to BolsterEffect, adjust text, flatten logic

* adjust Optimus Prime, Hero

* reimplement Optimus Prime, Autobot Leader

* add test

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-08-20 13:28:17 -04:00
Susucre
43de68afe3
[WOE] Implement Stroke of midnight (refactor together similar effects) (#10834)
* [WOE] Implement Stroke of Midnight

* refactor similar effects together.

* add tests (and fix a bug)

---------

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
2023-08-18 18:27:36 -04:00
Evan Kranzler
b892562b95
Fixing aura token creation (#10858)
* rework aura token creation

* add missing copy constructor

* add message for token if unable to be created

* add a few extra role tests
2023-08-18 13:25:48 -04:00
Vivian Greenslade
95de216f8e
Implement Chiss-Goria, Forge Tyrant (#10804)
* implements Chiss-Goria, Forge Tyrant

* updated test wording

* changed implementation to ContinuousEffect instead of CostModificationEffect

* fix code granting Affinity for Artifacts ability

* added more test cases to confirm effect working as intended

* add null check

* added artifact check to effect applying

* fix duration

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-08-17 23:50:14 -04:00
Evan Kranzler
b20bdcede7
WIP: Implement Role mechanic (#10816)
* [WOE] Implement Embereth Veteran

* add SBA for role tokens

* [WOE] Implement Cursed Courtier

* [WOE] Implement Conceited Witch

* [WOE] Implement Besotted Knight

* [WOE] Implement Syr Armont, the Redeemer

* [WOE] Implement Living Lectern

* add role test

* [WOE] Implement Lord Skitter's Blessing

* [WOE] Implement Faunsbane Troll

* [WOE] Implement Twisted Fealty

* [WOC] Implement Ellivere of the Wild Court

* [WOE] Implement Monstrous Rage

* [WOE] Implement Spellbook Vendor

* add verify skips

* extra fix
2023-08-17 10:18:21 -04:00
Susucre
8169799213
[WOE] implement Troublemaker Ouphe, Torch the Tower (add Bargain ability) (#10812)
* add start of Bargain

Current version probably has a bunch of bugs related to zcc and copy.

* add Torch the Tower

* add Torch the Tower tests

* add better than nothing activationKey before tag cost tracking gets cleaned up

---------

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
2023-08-16 08:53:02 -04:00
Susucre
cbec9ead63
[WOE] Implement Ash, Party Crasher (add Celebration Condition) (#10818)
* implement Ash, Party Crasher (add Celebration Condition)

* test Celebration with Ash
2023-08-16 08:31:02 -04:00
Susucre
92f0f84b23
[LGN] Rework Whipgrass Entangler (#10802)
* Rework Whipgrass Entangler

Made a class for "Ability linked with an Effect", that also takes responsability of manually calling its effect's newId method.

* apply review & cleanup
2023-08-15 22:40:25 -04:00
Susucre
95deeafa86
fix [CLB] Baba Lysaga counting of card types dynamically (#10796) 2023-08-13 20:43:58 -04:00
xenohedron
6fafbf0d93 new NextSpellCastHasAbilityEffect
cleanup Wand of the Worldsoul, Flockchaser Phantom to use it

text adjustments for gain abilities
2023-08-13 01:17:51 -04:00
Susucre
07ee4661e7
[CMM] Implement Teyo, Geometric Tactician (#10736)
* [CMM] Implement Teyo, Geometric Tactician

* rework as a RestrictionEffect (common class with Mystic Barrier; Pramikon, Sky Rampart)

* add checkMayAttackDefender test

* more Pramikon tests
2023-08-12 19:02:23 -04:00
Matt M
e49020e490
[CLB] Implemented Jade Orb of Dragonkind (#10286)
* Working with oneshot

* Swap to dual effects

* adjust tests

* adjust custom class names, fix text order

* comparison fix, null check, access modifiers

---------

Co-authored-by: Zelane <zelane@hollow.tech>
Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-08-12 18:25:46 -04:00
Susucre
2d53668c96
[LTC] Implement Gilraen, Dunedain Protector (#10728)
* [LTC] Implement Gilraen, Dunedain Protector

* add tests on Gilraen

* apply review
2023-08-12 16:16:02 -04:00
Susucre
eef8f508e4
[CMM] Implement Demon of Fate's Design (#10737)
* refactor SacrificeCostManaValue to be an enum.

* [CMM] Implement Demon of Fates Design

* Add Unit Tests, including one bug on alternative cost.

* fix alternativeCosts made from dynamicCost returning that they were not activated when paid.

* fix small issues, add hint

* cleanup tests and add a couple

* Capitalize enum instances

* Minor fixes

* simplify the ContinuousEffect

* use the ConditionPermanentHint made for the Demon

* fix text
2023-08-12 15:49:06 -04:00
xenohedron
7839c6cbff
Implement [CMM] Hatchery Sliver; fix Replicate ability (#10694)
* Implement [CMM] Hatchery Sliver

* limit ReplicateAbility to only its linked instance

* Add test for multiple instances of replicate

* add another test
2023-08-11 20:41:45 -04:00
Vivian Greenslade
040a9779b5
[LTR] Implement Forge Anew (#10777)
* implements Forge Anew with unit tests

* fixes equip effect and adjusts test

* fixes effect to only apply on controller's turns

* changed test location to set

* fixes comparison, fixes wording of text to match oracle text
2023-08-11 00:00:09 -04:00
Vivian Greenslade
bfb3998fab
Fix Misstep; Pollen Lullaby; Icebreaker Kraken (#10776)
* fixes issues with noted cards and standardizes code formatting, adds tests to confirm bug is fixed

* updates tests to use StrictChooseMode

* cleans up effect implementation for listed cards

* adds comments for choices, fixes mistake in Misstep test

* updates filters, removes unnecessary text being set
2023-08-09 20:45:06 -04:00
xenohedron
35a5cc48a7
Improve DealsCombatDamageEquippedTriggeredAbility (#10767)
* improve variable name

* add test for Jitte trample damage

* fix duplicated triggers when trampling over to player

* bring corresponding ability into alignment

* adjust authorship, comment
2023-08-06 23:04:53 -04:00
Artemis Kearney
9ba0da00ff
Basic groundwork for extra decks (contraptions, attractions) (#10378)
* extra deck cards not counted in deck size

* extra deck handling in deckbuilder

* move responsibility for extraDeckCard boolean to CardImpl

* remove redundant field copy
2023-08-06 21:06:32 -04:00