There is room to refactor some of the cards that allow casting from an exile zone (for instance Gonti, Lord of Luxury, Dead Man's Chest or Thief of Sanity), but that felt complex enough I did not want to risk it.
Each one bring some additional complexity to the effect.
Tested that Dryad Arbor can not be cast from the exiled zone, did not attempt morphed Zoetic Cavern.
* 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
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.
* 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
* 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
* [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
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.
* 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>
* [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.
* [LTC] Implement Eowyn, Shieldmaiden
The watcher is a little tricky, as we want to watch for all humans entering for each player.
Then, the condition check will actually check if another human actually entered under the controller's control.
* use MOR and not UUID to identify Eowyn.
---------
Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
* [LTR] Implement Gandalf, White Rider
* Took ideas from the God Eternals, Arwen Undomiel and Enigma Sphinx.
* Tested it with multiple interactions, including murdering a stolen Gandalf with Agent of Treachery.
* Forgot to add myself as author
* Implemented requested fixes
* Changed it to use `DiesSourceTriggeredAbility()`
* Changed to `getValue("permanentLeftBattlefield")`
* Stolen interactions are properly working now
* ZCC comparison
* Based on the God Eternals, hope its up to spec
* 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
* [LTR] Implement Strider, Ranger of the North
* Took ideas from a few cards with similiar effects.
* Creature power check based on Ent's Fury
* Did a few playtests to ensure effects work and tested with additional creatures with landfall in the battlefield
* Forgot to add myself as author
* Update StriderRangerOfTheNorth.java
* Removed unnecessary public access
* Removed redundant `return true;`
* Added a temporary fix to the power check
* Fixed condition
* Fixed it by giving the temporary buff outside of the custom effect
* Tried to implement a condition like Dormant Grove uses but had no success, `First Strike` was still not being applied.
* Also tested the card Ent's Fury, it works because it checks the creature power before giving it any counters
* Fixed static text
* [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.
* 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
* 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>