Commit graph

11331 commits

Author SHA1 Message Date
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
Alex Vasile
6b5d4abb69
Add documentation to Cards and CardsImpl (#9019)
* Added minor documentation and TODO questions

* Fixed typo

* Address one set of comments

* merge fix

* remove commented code

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-07-02 18:20:28 -04:00
Susucre
496faaf5cb
[LTR] Implement The Balrog, Durin's Bane (#10515)
* [LTR] Implement The Balrog, Durin's Bane

I could use someone more experienced for this card:
Should the watcher `PermanentsSacrificedWatcher` be initialized locally in the card's class, or is a global initializing in GameImpl.java alright? I went for the latter for now, as my base for implementing the static cost reduction was Blood for the Blood God!

* apply review

* no longer instantiate watcher on every game.
2023-07-01 12:53:31 -04:00
xenohedron
f2378a5b3d
Fix Sky Swallower (#10542)
* Static filter for another controlled permanent

* Fix Sky Swallower
2023-06-29 23:38:59 -04:00
Oleg Agafonov
4c59551cf0 number of triggers event - fixed game error with state based triggers (NPE in cards like Veyran, Voice of Duality); 2023-06-30 07:15:21 +04:00
Oleg Agafonov
6529ead72f refactor: simplified extra turn code, fixed NPE error on usage (Alchemist's Gambit) 2023-06-30 06:39:01 +04:00
rullinoiz
6caa46f9d5
[LTC] Implement Moria Scavenger, Saruman The White Hand, Wake The Dragon (#10537)
* Implement Moria Scavenger, Saruman The White Hand, Wake The Dragon

* Remove Ward Hint

* Create Dragon Token Class

* StaticFilters.FILTER_SPELL_A_NON_CREATURE

* Rename TokenTriggeredAbility
2023-06-29 22:04:46 -04:00
Susucre
06cce0ce22
[LTR] Implement Mordor Trebuchet (#10496)
Along with its unique token Ballistic Boulder.
2023-06-29 22:02:55 -04:00
PurpleCrowbar
6e2b35e6a3 Fix shroud denying ninjutsu 2023-06-30 01:39:58 +01:00
Susucre
c92ad45e56
[LTR] Implement Stone of Erech (#10497)
* [LTR] Implement Stone of Erech

Grouped together two other recent cards for that exact same replacement effect.

* refactor some more

This does extend the ReplacementEffect "If ... would die, exile it instead", using a `PermanentFilter`. [[Void Maw]] and [[Lorcan, Warlock Collector]] have thus be refactored to use that instead of a custom replacement effect.

Added a static filter `StaticFilters.FILTER_ANOTHER_CREATURE` for Void Maw that is filtering "another creature".
Found and refactored cards that were declaring that exact filter locally
* [[Flame-Kin War Scout]]
* [[Herd Gnarr]]
* [[Mogg Bombers]]
* [[Timid Drake]]

* fix void maw

* reverse changes on VoidMaw

Void Maw was a linked ability, so not exactly the same replacement effect that was refactored.
2023-06-29 09:17:34 -04:00
Susucre
311bf2e22e
fix #10530 (Unsettled Mariner + Field of Ruin) (#10531)
* fix Unsettled Mariner + Field of Ruin

There was something weird with zcc on TargetOfOpponentsSpellOrAbilityTriggeredAbility
setting the target to the stack object for its triggered effect.

I do not entirely comprehend how FixedTarget works, in particular regarding zcc of stack objects.
However all configurations of the trigger seem to work with the uninitialized FixedTarget constructor,
instead of the one initialized with a game's zcc.

* slight refactor of TargetOfOpponentsSpellOrAbilityTriggeredAbility
2023-06-29 09:16:46 -04:00
ssk97
918a8931e6
Implement [40K] Squad ability (#10509)
* First try at Squad Mechanic

* Fully functional now, removed cards from unfinished list in 40k

* Improved implementation, removing the generic conditional
and replacing it with a separated ETB trigger and effect.

* Add tests from Susucre (using Strionic Resonator for now, two others currently failing)

* Update comments on tests

Closes #9774 

------
Co-authored by: Susucre <34709007+susucre@users.noreply.github.com>
2023-06-26 20:47:26 -04:00
xenohedron
231ab77bcd
New common class CopyTargetStackAbilityEffect (#10525)
- Fix superfluous null check in Lithoform Engine
- Remove hardcoding of controlled abilities in TargetTriggeredAbility (used only in Strionic Resonator)
- EnchantmentSourcePredicate analogous to ArtifactSourcePredicate
2023-06-25 22:20:41 -04:00
xenohedron
5722ae27f6 fix text: Silverskin Armor 2023-06-25 15:15:41 -04:00
xenohedron
ec4c2e2170
Cleanup: GainAbilityControlledSpellsEffect (#10446)
* Hide reminder text on Zhulodok

* Use logic from GainAbilitySpellsEffect, fix so that CastFromZonePredicate works

* Text adjustments

* Show cascade ability in hand for Abaddon the Despoiler

* Remove redundant class

* Simplify Cast Through Time

* Don't add additional instances of redundant abilities

* Remove redundant check

* Add option to ignore mana validation when checking playable objects

* Fix null errors

* Fix GainAbilityControlledSpellsEffect to apply ability to playable cards rather than owned cards

* Add unit test

* Revert bad workaround code

This reverts commit 17f5be6a79.
This reverts commit 7ebd2f1815.
This reverts commit 00969d1fe7.

* Remove ownership check on exiled cards

* Another test (currently failing)

* ignore test

* fix test: strict choose mode
2023-06-24 01:15:58 -04:00
who?!
3896c28572
[LTR] Implement Dawn of a New Age (#10492) 2023-06-23 20:13:50 -04:00
xenohedron
7e15ca92c5 simplify implementation and remove redundant class 2023-06-23 20:11:37 -04:00
xenohedron
23a6185f70 Remove unused effect class 2023-06-23 20:11:04 -04:00
xenohedron
380fea6720 fix some return from exile zone 2023-06-23 01:19:17 -04:00
PurpleCrowbar
63be7589ae Add MUL token images 2023-06-23 02:06:56 +01:00
Susucre
0255761d67
[LTR] Implement The Grey Havens (#10493) 2023-06-22 20:06:10 -04:00
Susucre
a75ec34a45
[LTR] Implement Orcish Bowmasters (#10450)
Refactored [[Xyris, the Writhing Storm]] since the trigger is partly the same.
2023-06-22 20:05:08 -04:00
Susucre
09e0cba992
[LTR] Fix Smaug Token producing food tokens instead of treasures (#10513) 2023-06-22 13:20:45 -04:00
PurpleCrowbar
f85dd656f2 Fix hint text for Tom Bombadil 2023-06-22 00:03:11 +01:00
PurpleCrowbar
e795726efe Revert capitalisation of counter name in CountersOnPermanentsHint 2023-06-21 23:45:54 +01:00
PurpleCrowbar
a3d20bd099 Remove unused imports from CountersOnPermanentsHint 2023-06-21 23:29:03 +01:00
PurpleCrowbar
a9c28c420f Fix Tom Bombadil text 2023-06-21 23:26:00 +01:00
theelk801
2e9eb7fb33 [LTC] Implement Trap the Trespassers 2023-06-19 19:15:48 -04:00
theelk801
3404a34b2d [LTC] Implement Cirdan, the Shipwright 2023-06-19 18:58:28 -04:00
theelk801
fd37be92fe [LTC] Implement Prize Pig 2023-06-19 16:37:33 -04:00