Skip to content

Player Hidden Keywords related to SearchLibrary#10219

Draft
kojotak wants to merge 17 commits intoCard-Forge:masterfrom
kojotak:issue/4760/searchLibrary
Draft

Player Hidden Keywords related to SearchLibrary#10219
kojotak wants to merge 17 commits intoCard-Forge:masterfrom
kojotak:issue/4760/searchLibrary

Conversation

@kojotak
Copy link
Copy Markdown
Contributor

@kojotak kojotak commented Mar 30, 2026

An attempt to refactor 3 hidden player keywords related to "search library" from #4760 :

  • "LimitSearchLibrary"
  • "CantSearchLibrary"
  • "Spells and abilities you control can't cause you to search your library."

Tested using Stoneforge Mystic, Mindlock Orb, Ashiok, Dream Render, Aven Mindcensor. Example of applying library search limit of 4 cards:

image

Comment thread forge-gui/res/cardsfolder/l/leonin_arbiter.txt Outdated
@kojotak kojotak marked this pull request as draft March 31, 2026 07:33
@kojotak kojotak force-pushed the issue/4760/searchLibrary branch from 496b3a5 to 98f3002 Compare March 31, 2026 18:26
}
return targetPlayer == null || !targetPlayer.equals(sa.getActivatingPlayer())
|| !hasKeyword("Spells and abilities you control can't cause you to search your library.");
|| !StaticAbilityCantSearchLibrary.cantCauseToSearchLibrary(this);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should just use the same method above so it can be more dynamic

Copy link
Copy Markdown
Contributor Author

@kojotak kojotak Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean:

  • remove the cantCauseToSearchLibrary() method completely
  • add check for CantCauseToSearchLibrary mode into cantSearchLibrary()?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just a slightly more specific variant, not a different mode
we usually have one entry point, so scripts can just use params for their needs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the unnecessary mode in f7b33c7 but this may break something else, because the if is no longer specific to Ashiok only.

I was thinking about an alternative: add ValidActivatingPlayer$ Opponent for Ashiok card, move the targetPlayer vs activatingPlayer check into new cantCauseToSearchLibrary() method.

Comment thread forge-gui/res/cardsfolder/a/aven_mindcensor.txt
Types:Legendary Planeswalker Ashiok
Loyalty:5
S:Mode$ Continuous | Affected$ Opponent | AddKeyword$ Spells and abilities you control can't cause you to search your library. | Description$ Spells and abilities your opponents control can't cause their controller to search their library.
S:Mode$ CantSearchLibrary | ValidPlayer$ Opponent | Description$ Spells and abilities your opponents control can't cause their controller to search their library.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add ValidCause to check for Spells and Abilities and check if they are controlled by the same player as the one that gets their library searched

Types:Legendary Planeswalker Ashiok
Loyalty:5
S:Mode$ CantSearchLibrary | ValidPlayer$ Opponent | Description$ Spells and abilities your opponents control can't cause their controller to search their library.
S:Mode$ CantSearchLibrary | ValidPlayer$ Opponent | ValidCause$ SpellAbility.OppCtrl | Description$ Spells and abilities your opponents control can't cause their controller to search their library.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not enough, needs to be the same Player,
checkout Params like "BlockerRelative" for similar stuff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, multi player situation, right🤔?

P1 owns Ashiok, P2 causes to P3 to search his library. This should work, since P2 != P3. P2 can not search its own library. But P2 can force P1 to search his library 🙈.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this a little bit and concluded, that there should be just 2 conditions necessary. ValidPlayer and ValidCause, but not this "simple" one (with 1 parameter - the cause), but "relative-like" (with 2 parameters - cause and context - given card causing the search effect, instead of the default context card - source of static abbility) - I've called it ValidPlayerCauseRelative - similar to BlockerRelative.

@kojotak kojotak marked this pull request as ready for review April 10, 2026 19:42
}
return targetPlayer == null || !targetPlayer.equals(sa.getActivatingPlayer())
|| !hasKeyword("Spells and abilities you control can't cause you to search your library.");
return !StaticAbilitySearchLibrary.cantSearchLibrary(this, sa);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit skeptical about the usefulness of these tests in general
(you're not even using targetPlayer any longer)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. These tests help me to understand and experiment with Forge engine and give me some (false?) confidence. I can easily remove them if the rest is OK.

Copy link
Copy Markdown
Contributor

@tool4ever tool4ever Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to break it down:
Ashiok needs the following information
a) SA controller
b) Searcher
c) Searched

then the condition has to check a = b = c = Opponent (all the same player)

I have a hard time seeing that this refactor has this equivalently covered yet

@kojotak kojotak marked this pull request as draft April 12, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants