Skip to content

Conversation

Jmlundeen
Copy link
Contributor

This adds immutable permanent interface and classes to save dynamic game state information to the Last Known Instance. Values from CardState and MageObjectAttribute are saved to the permanent copy for future reference. The permanent also blocks any modifications. Tests all pass and it looks like most instances that reference the LKI of permanents are read-only.

* @param game
* @return copy of permanent with values reset
*/
default Permanent getResetPermanent(Game game) {
Copy link
Member

Choose a reason for hiding this comment

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

Need more explain and examples about that -- what are you trying to do in current PR and in the future changes.

Looks like you are try to find all restricted game data modification between game states or game simulations and catch it by fast fail in unit tests or by game error. Or maybe it's about alternative implementation of copyable or historical characteristics.

@Jmlundeen
Copy link
Contributor Author

I forgot to put it in main post, but mostly related to #12506. This is to have read only permanents that actually have characteristics that were present on the battlefield. An example is the [[Excavator]] test, where if you sacrifice a basic land with [[Leyline of the Guildpact]] it only gains landwalk of the lands original type instead of all 5.

Copy link

Excavator - (Gatherer) (Scryfall) (EDHREC)

{2}
Artifact
{T}, Sacrifice a basic land: Target creature gains landwalk of each of the land types of the sacrificed land until end of turn. (It can't be blocked as long as defending player controls a land of any of those types.)

Leyline of the Guildpact - (Gatherer) (Scryfall) (EDHREC)

{G/W}{G/U}{B/G}{R/G}
Enchantment
If this card is in your opening hand, you may begin the game with it on the battlefield.
Each nonland permanent you control is all colors.
Lands you control are every basic land type in addition to their other types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants