Commit graph

13110 commits

Author SHA1 Message Date
xenohedron
8372c358b2
refactor: some code linting (#10624)
* remove obsolete check method
* code clean: PermanentImpl
* code clean: PlayerImpl
* protected constructors in CardImpl
2023-07-16 01:50:24 +04:00
Susucre
b960b77774
Refactor name of minimum deck size (was startingHandSize) (#10628)
* Refactor: rename starting hand size, it was actually minimum deck size (40, 60 or 100 most of the time)
2023-07-16 01:45:19 +04:00
xenohedron
a7f78e8190
Clean up triggered ability text generation (#10627)
* move "or battle" to its own class

* move "or planeswalker" to its own class

* remove strange way of setting custom text

* finally remove getTriggerPhrase

* copy constructor visibility

* fix Vraska
2023-07-15 16:49:40 -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
xenohedron
ee29c38413
Clash adjustments (#10616)
* adjust clash effect

* Make clash not a singleton

* Add unit test for Clash effect

* fix test (skip init shuffling)

* Fix CLASHED event flag logic and add to unit test

* Additional test and comments

* comments in GameEvent

* param name typo
2023-07-14 23:15:01 -04:00
xenohedron
0d4c73b385 [LRW] [MOR] [SHM] [EVE] text fixes 2023-07-14 22:40:56 -04:00
xenohedron
aaf99a4c1a followup fixes 2023-07-14 22:12:08 -04:00
xenohedron
ae9f920d87 more [LTR] text fixes / corrections 2023-07-14 21:58:33 -04:00
Susucre
2c505bbcac
[LTR] Implement King of the Oathbreakers (#10619)
* make a new BecomesTargetTriggeredAbility to filter on target permanents.
2023-07-14 21:32:23 -04:00
Susucre
2188c690c6
[LTR] Implement Eomer, Marshal of Rohan (#10617)
Also, small refactor adding EachTurn to the name of both `setTriggersOnce` and `setDoOnlyOnce`.
2023-07-14 21:32:00 -04:00
xenohedron
72ebe2b1f1 minor code cleanup triggered abilities 2023-07-14 20:30:09 -04:00
xenohedron
ef739688fb remove unused duplicated effect class 2023-07-14 20:28:33 -04:00
xenohedron
792224d6dc more followup text fixes 2023-07-14 02:12:57 -04:00
xenohedron
176a61190b Followup text fixes 2023-07-14 01:59:27 -04:00
xenohedron
185fae28a4 Text fixes [10E] 2023-07-14 01:40:12 -04:00
xenohedron
eeffafcc62 Generalize UntapEnchantedEffect to UntapAttachedEffect 2023-07-13 00:28:03 -04:00
Susucre
6a9340f1aa
Introduce Duration.UntilYourNextUpkeepStep (#10600)
* add new Duration

* refactor cards with new Duration.

* fix both Durations and add unit tests.

* fix text
2023-07-12 19:40:27 -04:00
Susucre
14235b6320
Rework Ring-bearer implementation. Add GUI + gamelogs. (#10596)
* Fix Ring-bearer choosing & add some GUI + logs

* use a ring svg in a separate gold panel

* use a fontawesome svg

* add a couple null checks, group icon with commander

* rework rinbearer logic according to review

* fix typo in game log

* small fixes
2023-07-12 19:40:09 -04:00
Bobby McCann
09530f1cdb
[LTR] Implement Glamdring (#10574) 2023-07-12 19:39:31 -04:00
xenohedron
3f346d791c fix file location in source tree 2023-07-10 06:32:04 -04:00
xenohedron
6c9079012c
Cleanup: source deals damage to {this}; mill cards (#10603)
* New common class for "Whenever a source deals damage to {this}, " which resolves #9340 
* Merge `PutLibraryIntoGraveTargetEffect` with functionally identical `MillCardsTargetEffect`
* Text fix on `RevealDragonFromHandCost` noticed in #10593
* Text fix following up on #10594
2023-07-09 22:05:28 -04:00
Bobby McCann
73104f6705
[LTR] Implement Radagast the Brown; also resolves #9419 (#10568)
* Fix #9419 bug with EntersBattlefieldThisOrAnotherTriggeredAbility
* Add test for Radagast as well as Risen Reef and Caldaia Guardian
* Minor associated cleanup for EntersBattlefieldAllTriggeredAbility
* New PermanentEnteringBattlefieldManaValue
2023-07-09 22:04:45 -04:00
Susucre
39904d0ca3
[LTR] Implement Boromir, Warden of the Tower (#10594)
* [LTR] Implement Boromir, Warden of the Tower

* group trigger from Boromir and Lavinia

* fix trigger text
2023-07-09 16:42:29 -04:00
Susucre
f8b1ada369
Fix RevealTargetFromHandCost when no target in hand (#10593)
* [CSP] Fix the RevealTargetFromHandCost not allowing payment when no valid card to reveal

* cleanup text of cost

* fix martyr of bones text

* fix test using a Martyr of Sands
2023-07-09 16:42:16 -04:00
xenohedron
b86014a29c
Text fixes [CSP] (#10599)
* fix text: ExileFromHandCost

* fix text: CumulativeUpkeepAbility

* text fixes: individual CSP cards

* text fix followups
2023-07-09 02:14:42 -04:00
Oleg Agafonov
03f8d72031 merge fix 2023-07-09 03:43:19 +04:00
Oleg Agafonov
0520d0b262 game: fixed miss clear code for permanent's additional info, fixed random sorting; 2023-07-09 02:35:26 +04:00
Oleg Agafonov
4ae5ca8421 docs: card hints usage improved 2023-07-09 02:21:56 +04:00
Susucre
a7d49e1f45
[LTR] Implement Faramir, Prince of Ithilien (#10595) 2023-07-08 13:09:10 -04:00
xenohedron
0fa971514a
code style: eliminate unnecessary static imports (#10585)
* SacrificeTargetCost(StaticFilters)

* remove import static mage.constants.Outcome

* remove import static mage.constants.Duration

* remove other import static

* a few more sacrifice filters

* simpler constructors

* remove import static mage.filter

* remove a few more import static
2023-07-08 13:08:28 -04:00
xenohedron
45b54e8cc4 code style: private static final 2023-07-07 23:34:16 -04:00
ssk97
e1edec542c
Lazotep Convert fix (#10578)
* Fix Lazotep Convert card (add color, need to actually apply the applier)

* Don't copy Transformed status, add test
2023-07-07 01:26:27 -04:00
xenohedron
063429b70a
New StaticFilters.FILTER_ANOTHER_CREATURE_YOU_CONTROL (#10577) 2023-07-07 01:26:11 -04:00
xenohedron
e50f8b05c1
[LTR] [LTC] Text fixes (#10569) 2023-07-06 00:24:12 -04:00
xenohedron
1ccaf06366
Refactor flicker effects to single common class (#10564)
* New common class for flicker target effects

* Update cards to ExileThenReturnTargetEffect

* process game state before returning exiled card
2023-07-05 19:23:08 -04:00
Bobby McCann
c8564efbb7
[LTR] Implement Witch-king of Angmar (#10563)
* Add card

* Add TapSourceEffect

* De-duplicate watcher logic

* Abstract and fix(?) logic

* Fix sacrifice targets

* Controller instead of Owner

* Add tests, fix, and refactor

* Throw if controller not supported

* Fix test (not supposed to start tapped)
2023-07-05 19:22:21 -04:00
Susucre
008662be5e
[LTR] Implement Shelob, Child of Ungoliant (#10558)
* [LTR] Implement Shelob, Child of Ungoliant

This is almost working.

I could not figure out why, but tokens made with the trigger still have subtypes, even though it has only artifact as its type.

* fix subtype of the token copy not being cleaned.

fixed Myrkul, Lord of Bones that had the same issue.
removed game argument from CreateTokenCopyTargetEffect's PermanentModifier. It was only used by Myrkul, and with no effect.
2023-07-05 19:21:52 -04:00
Oleg Agafonov
476fd27f65 fixed miss chosen targets clear in cost implementations (#10566) 2023-07-05 23:11:24 +04:00
Oleg Agafonov
f26b1470fa game: fixed miss state triggers check in multi-steps abilities/effects (#10564) 2023-07-05 09:52:38 +04:00
xenohedron
71a6ee232b minor cleanup 2023-07-05 00:14:36 -04:00
xenohedron
4d6644d095
Cleanup: ExileUntilSourceLeavesEffect (#10527)
* Refactor OnLeaveReturnExiledAbility
to accommodate hand zone as well as battlefield
* Cleanup Brain Maggot and Kitesail Freebooter
* Refactor to include delayed trigger with main effect
* minor cleanup
* merge fix
* further adjustments
* Cleanup Valki, God of Lies
* fix test choices
2023-07-04 20:38:59 -04:00
xenohedron
a287582026 fix Vanish Into Eternity 2023-07-04 17:52:42 -04:00
xenohedron
b8f8e86b8d new StaticFilters.FILTER_SPELL_AN_ARTIFACT 2023-07-04 17:40:24 -04:00
Susucre
652358a481
Fix #10561 Misery's Shadow (and 3 other cards) replacement effects (#10562)
Did not test the final code for Stone of Erech, when a filter was added to the ReplacementEffect :(

Added an unit test, just to be safer this time around.
2023-07-04 11:47:22 -04:00
Alexander Novotny
47456bf9c4
Fixed issue with UntapTargetCost (#10559)
* Fixed issue with UntapTargetCost

The target was allowed to actually target, so things like Halo Fountain wouldn't work on creatures with shroud.

UntapTargetCost also keeps track of the permanents which were untapped, in case those are needed.

Changed Benthic Explorers to use new UntapTargetCost

* Fixed potential bug with Benthic Explorers
2023-07-03 23:42:19 -04:00
Alexander Novotny
f5b4c7b251
Fix [LTC] Aragorn, King of Gondor (#10560) 2023-07-03 23:42:03 -04:00
Alexander Novotny
fb8424556e
Player auto-choose respects required targets (#10557)
* Player auto-choose respects required targets
2023-07-04 07:02:46 +04:00
Alexander Novotny
fae63d9d4b
Add additional ability icons (#10549)
* Slightly revamped basic card icons

All icon classes which were just static text have been removed, and instead replaced with a static instance.

A new icon for reach has been added

Some icons have been reused for new abilities (hexproof for shroud and ward, infect for toxic)

When a card would have two icons of the same type, the icons are instead combines into one with a combined hover tooltip.

* Fixed missing capitalization on ward, hexproof
2023-07-04 01:22:07 +04:00
Tiago Gil
6a20840f4e
[LTR] Implement Barrow-Blade (#10539)
* [LTR] Implement Barrow-Blade

* Took ideas from Wooden Stake, Humble and Shadowspear
* Play tested effects

* Simpler constructor for equip

* Revamped BlocksOrBlockedAttachedTriggeredAbility

* New logic in `BlocksOrBlockedAttachedTriggeredAbility`
* Changed `Ferocity` and `Gift Of The Woods`
* Removed custom class from `Barrow Blade`

* New class, revert changes in cards

* Added the new class `BlocksOrBlockedByCreatureAttachedTriggeredAbility()`
* Reverted changes to `BlocksOrBlockedAttachedTriggeredAbility()` but including `AttachmentType` in constructor
* Reverted changes to `Ferocity` and `GiftOfTheWoods`
* Changed `Barrow-Blade` to use `BlocksOrBlockedByCreatureAttachedTriggeredAbility()`
* Added a few comments
* Tried optimizing the IF statements in the new class but whenever I tried some condition would stop working, accepting suggestions

* Null check added

* Added a null check for game.getPermanent(sourceId)
* Changed checks to the top to avoid unnecessary processing when encountering any null variable
* Removed unnecessary import
2023-07-02 18:21:17 -04:00
Susucre
1f0189a098
fix [LTR] Orcish Bowmasters (#10547)
The "except the first one they draw in each of their draw steps" part of the trigger was not properly checked, and cards drawn on your end step was never triggering an opposing Orcish Bowmasters.

`OpponentDrawCardExceptFirstCardDrawStepTriggeredAbility` is a triggered ability that initializes a watcher `CardsDrawnDuringDrawStepWatcher`.
However `OrTriggeredAbility` was not exposing its sub triggers' watchers to the game engine.
I am not sure the global fix to `OrTriggeredAbility` is better than a `triggeredAbility.addWatcher(...)` in OrcishBowmaster.java.

Also, the trigger text was not set at the proper level.
2023-07-02 18:21:00 -04:00