Commit graph

4077 commits

Author SHA1 Message Date
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
xenohedron
127b7be9b0
more unrelated text fixes (#10761)
* some text fixes [LTR] [LTC] [CMM]

* another batch of text fixes

* followup fixes

* unrelated cleanup

* fix corresponding ability text in test
2023-08-05 20:53:43 -04:00
Susucre
0e5069ccc2
[LTC] Implement Gandalf, Westward Voyager (#10727)
* refactor and cleanup SpellCastControllerTriggeredAbility

* [LTC] Implement Gandalf, Westward Voyager

* throw on unexpected setTargetPointer
2023-08-04 22:26:25 -04:00
Susucre
0c1918e3f5
Fix Keeper of the Mind (#10744)
and add tests
2023-08-03 22:34:11 -04:00
ssk97
b144cb6f03
Minor Backup fixes, add tests (#10732)
* Backup is not optional and its effect should be BoostCreature, not Detriment

* Add tests for Backup ability

* Add Mirror-Shield Hoplite source test

* Use Strict mode for the hoplite source test
2023-08-03 00:26:33 -04:00
Susucre
40e508ac19
Refactor Devour ability; [LTC] Implement Feasting Hobbit (#10708)
* [LTC] Implement Feasting Hobbit

Refactor DevourEffect and its text generation, to be more permissive in the future.

* change DevourAbility to have the constructor parameters of DevourEffect

* only pluralize when there is more than 1 devoured permanent.

* added more unit tests than there are cards with devour

* public -> private filter of Caprichrome.
2023-08-01 09:49:32 -04:00
Oleg Agafonov
3d3358cd05 game: turn modification improves:
- fixed miss phase changed events and logs in some use cases;
 - added source info in turn modification logs;
 - added game logs for take and lost control of the spell (example: Word of Command)
 - added game logs for skip step;
 - added game logs for extra step;
 - added game logs for skip phase;
2023-08-01 16:52:53 +04:00
Susucre
4856c65443
[BOT] Implement Megatron, Tyrant // Megatron, Destructive Force (#10666)
* [BOT] Implement Megatron, Tyrant // Megatron, Destructive Force

* fix verify test.

* cleanup AbilityCastMode for Disturb & MoreThanMeetsTheEye

* cleanup unecessary checks.

* fix duration of silence static effect

* fix Disturb tests
2023-07-29 13:45:09 -04:00
xenohedron
9a877f5b33 java 8 compatibility fix 2023-07-28 23:00:11 -04:00
Alexander Novotny
519b3988be
game timer: Add chess-style buffer time option (#10598)
* UI Changes

* Add new buffer time options

* Main functionality

* Final implementation

Also added player UI for when they are using their buffer time (timer turns green)
2023-07-28 22:05:21 -04:00
Alexander Novotny
a36a7d9b7f
[LTR] Add Goldberry, River-Daughter (#10524)
* Added Goldberry

* Slight optimizaztion

* Happy Path Test

* More unhappy tests

* Sanity check for Goldberry's counter choices

* Updated player.getMultiAmount to support individual constraints

* Some cleanup

Also modified ResourcefulDefense to use new multi amount api

* Updated logging

* Added hint for number of counters

* Fixed issue with Resourceful Defense

* Improvements to defaults

Default list will properly make sure to stay within individual maximums
If a player is asked for a choice that isn't actually a choice because each choice's min and max are equal, instead the default response is immediately returned. This helps with situations like moving a counter off of Goldberry when she only has one counter on her.

* -1/-1 Counter test

* Fixed issue with -1/-1 counters

* Adjusted dialog to properly enforce constraints
2023-07-28 21:29:40 -04:00
Susucre
10b586f4b3
[M21] Fix See the Truth (#10664)
Some copies are actually cast from a zone, and See the Truth was not handling those cases properly.
2023-07-27 00:23:43 -04:00
xenohedron
9e81362ea4
Add logic to PlayerImpl for protection effects when damage can't be prevented (#10652)
* add failing test

* Check against prevent damage event when damaging player

* Add back game log message
2023-07-27 00:23:27 -04:00
Susucre
0c7965a725
Fix Pyrrhic Revival not adding -1/-1 counters on returned creatures. (#10626)
* Add (failing) unit test on Pyrrhic Revival

* fix PyrrhicRevival

reworked ReturnFromGraveyardToBattlefieldWithCounterTargetEffect to support having multiple cards in its targetPointer.

added test for Persist (the card from mh2).

* refactor & cleanup

* add myself as author, the effect was remade.
2023-07-17 20:02:49 -04:00
xenohedron
6c6376d878
Fix #9273 (#10637)
(process game state for two-part effects with zone change in first part)
2023-07-17 00:27:16 -04:00
Susucre
d658bf2265
refactor: expose Player->incrementLandsPlayed for some custom effects. (#10632)
* Expose Player->incrementLandsPlayed for some custom effects.
* also expose resetLandsPlayed
2023-07-17 03:53:22 +04:00
xenohedron
e2cff095b3
Rework Infectious Rage (#10625)
* put custom predicate back with Aura Graft

* Rework Infectious Rage and add unit test

* cleanup Aura Graft
2023-07-15 16:49:26 -04:00
Oleg Agafonov
d11269cb56 tests: improved logs on miss target/choice (it shows all permanents list from all players now) 2023-07-15 18:20:35 +04:00