Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTR] Add Goldberry, River-Daughter #10524

Merged
merged 14 commits into from
Jul 29, 2023

Conversation

alexander-novo
Copy link
Contributor

I've added the card. I've played a few games with her and she looks fine, but I'm gonna add some tests for some unhappy paths.

Also I borrowed the counter choosing interface from Resourceful Defense, which has you go through a dialog for each type of counter on Goldberry and choose the amount for each individual one. But this is a bit clunky and only enforces the 1+ counter rule on the card by forcing you to move the last counter if you haven't moved anything else. So I'd like to vamp up the player.getMultiAmmount UI a bit to support this card.

@alexander-novo
Copy link
Contributor Author

[[Goldberry, River-Daughter]]

[[Resourceful Defense]]

@github-actions
Copy link

Goldberry, River-Daughter - (Gatherer) (Scryfall) (EDHREC)

{1}{U}
Legendary Creature — Nymph
1/3
{T}: Move a counter of each kind not on Goldberry, River-Daughter from another target permanent you control onto Goldberry.
{U}, {T}: Move one or more counters from Goldberry onto another target permanent you control. If you do, draw a card.

Resourceful Defense - (Gatherer) (Scryfall) (EDHREC)

{2}{W}
Enchantment
Whenever a permanent you control leaves the battlefield, if it had counters on it, put those counters on target permanent you control.
{4}{W}: Move any number of counters from target permanent you control to another target permanent you control.

@alexander-novo
Copy link
Contributor Author

alexander-novo commented Jun 26, 2023

image

I made a few changes to make the player.getMultiAmount API a bit beefier. Now it supports min, max on each individual option in addition to a global min, max. I still need to add some tests for this new capability (the previous tests still work but don't test the new functionality), but I think I'm ready for a review on what I've got.

@alexander-novo alexander-novo marked this pull request as ready for review June 26, 2023 17:31
Also modified ResourcefulDefense to use new multi amount api
Default list will properly make sure to stay within individual maximums
If a player is asked for a choice that isn't actually a choice because each choice's min and max are equal, instead the default response is immediately returned. This helps with situations like moving a counter off of Goldberry when she only has one counter on her.
@alexander-novo
Copy link
Contributor Author

Right now the dialog defaults to all 0s, but I've half a mind to change it so that it instead calls MultiAmountType.prepareDefaltValues and uses those values. This would change Goldberry's effect, for instance, to always have the first counter type automatically start with a value of 1.

@xenohedron
Copy link
Contributor

@alexander-novo
Copy link
Contributor Author

No both of those seem to be targeting issues. This is more for choosing amounts among multiple different types of counters.

Copy link
Contributor

@xenohedron xenohedron left a comment

Choose a reason for hiding this comment

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

This looks great to me. I'll ask @JayDi85 to take a look at it as well.

if (movedCounters) {
controller.drawCards(1, source, game);
}
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

should return true? though probably doesn't matter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to be honest, I don't know what the return value for effects is supposed to signify. It's always seemed nonsensical to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure the return value signifies whether the effect actually happened.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like the return value is only used for effects which are part of mana abilities and special actions. In which case it isn't really clear to me when effects like this one should or should not return false (does it even matter?).

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is an inner custom effect that nothing else will call, it does not matter. But the convention is as Grath describes, to return true if something happens and false if nothing happens. It can matter for common effects that have their apply() method called within the apply() method of another effect (either a subclass calling super, or just creating a new effect to use its logic) and trying to take action based on whether or not that effect succeeded. Of course, whenever attempting this it is important to double check that the logic will work as intended. Because it so often doesn't matter, there are lots of effects that don't adhere properly to the convention with no ill effects other than confusing developers.

@xenohedron xenohedron requested a review from JayDi85 July 7, 2023 23:54
@xenohedron xenohedron merged commit a36a7d9 into magefree:master Jul 29, 2023
@alexander-novo alexander-novo deleted the add-goldberry branch July 29, 2023 02:22
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