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

Add card 'War Priest of Thune' #46

Merged
merged 2 commits into from
Jun 13, 2014

Conversation

gseitz
Copy link
Contributor

@gseitz gseitz commented Jun 12, 2014

Since we have askMaybeTarget now, I thought I'd give it a shot :)

@MedeaMelana
Copy link
Owner

Unfortunately targeting with the ability is mandatory, and the choice whether or not to destroy the enchantment is made on resolution of the trigger (after players have been able to respond to it), not when the trigger is put on the stack. So here you need the normal askTarget and you need to ask the player a yes/no question on resolution (which is not supported yet, feel free to add!).

This is relevant for example when the only other creature when you play the priest is a Crystalline Nautilus, then you have to target it since it's the only possible target, and the nautilus' trigger fires even if you didn't mean to destroy it with the war priest's trigger.

@gseitz
Copy link
Contributor Author

gseitz commented Jun 12, 2014

I see, so the may is related to destroying and not to targeting the enchantment. Quite a subtle difference, but also quite obvious when I read the card now. Thanks for the lecture on the rule set :)

Regarding the yes/no question: How would you model the actual Question constructor in a structured way without falling back to something like AskYesNo :: Text -> Question Bool?

Edit: fixed type signature of AskYesNo

@MedeaMelana
Copy link
Owner

I think we need something with Text, we can make specific questions for engine questions or very common card questions but in general there will always be questions asked by cards which we can't know in advance and can't make specific constructors for. So AskYesNo :: Text -> Question Bool is good, or maybe a more general AskChoice :: [Choice] -> Question Choice with data Choice = ChooseYesNo Bool | ChooseColor Color | ..., or maybe even AskChoice :: [(Choice, a)] -> Question a for convenience... I've thought about this often but I haven't found a reason yet to prefer one over the other. Go with whatever you like best. :-)

@gseitz
Copy link
Contributor Author

gseitz commented Jun 12, 2014

I like your AskChoice, I was thinking of a similar construct like this yesterday as well. I'll give it a shot. Thanks for the input.

AskChoice takes an optional question 'Text', and  a list of 'Choice'
values associated with a value of type 'a'. The client is responsible
for displaying the question and choices and inquiring an answer.
@gseitz
Copy link
Contributor Author

gseitz commented Jun 12, 2014

Just pushed the AskChoice changes and the revised War Priest of Thune.

Here's the log of War Priest of Thune destroying Dark Favor attached to Guardian Lions:

[EVENT] Caused by ResolutionOf (Stack,3)
>>> War Priest of Thune moves from the stack to the battlefield
[Player 0] Choose trigger to put on the stack:
1) War Priest of Thune
> 1
[Player 0] Choose target:
1) #1 Dark Favor, Enchantment - Aura, Untapped
> 1
[EVENT] Caused by StackTrigger ((Battlefield,2),War Priest of Thune)
>>> (anonymous) enters the stack
******************************************************************************
Player 0's turn
MainPhase
Player 0: 19 life
Player 1: 20 life
the stack:
#4 (anonymous), (typeless)

the battlefield:
#0 Guardian Lions, 4/7, Creature - Cat, Vigilance, Untapped
#1 Dark Favor, Enchantment - Aura, Untapped
#2 War Priest of Thune, 2/2, Creature - Cleric Human, Untapped

[Player 0] What would you like to do?
1) Pass
> 1
******************************************************************************
Player 0's turn
MainPhase
Player 0: 19 life
Player 1: 20 life
the stack:
#4 (anonymous), (typeless)

the battlefield:
#0 Guardian Lions, 4/7, Creature - Cat, Vigilance, Untapped
#1 Dark Favor, Enchantment - Aura, Untapped
#2 War Priest of Thune, 2/2, Creature - Cleric Human, Untapped

[Player 1] What would you like to do?
1) Pass
2) Play from player 1's hand: #0 Searing Spear, Instant
3) Play from player 1's hand: #3 Searing Spear, Instant
4) Play from player 1's hand: #4 Searing Spear, Instant
5) Play from player 1's hand: #6 Searing Spear, Instant
> 1
[Player 0] Destroy target enchantment?
1) Yes
2) No
> 1
[EVENT] Caused by ResolutionOf (Stack,4)
>>> Dark Favor moves from the battlefield to player 0's graveyard
[EVENT] Caused by ResolutionOf (Stack,4)
>>> (Stack,4) ceases to exist
******************************************************************************
Player 0's turn
MainPhase
Player 0: 19 life
Player 1: 20 life
the battlefield:
#0 Guardian Lions, 1/6, Creature - Cat, Vigilance, Untapped
#2 War Priest of Thune, 2/2, Creature - Cleric Human, Untapped

I'm not too happy that the question doesn't currently refer to the actual enchantment in a structured way, hence the generic question Destroy target enchantment?.

@MedeaMelana
Copy link
Owner

This looks pretty good, the only thing missing from a rules perspective is that the card should generate a DestroyPermanent event instead of a WillMoveObject. This is different because destroy interacts with things like regeneration.

This is the first card to make use of the new 'AskChoice' question.
@gseitz
Copy link
Contributor Author

gseitz commented Jun 12, 2014

That's actually pretty sweet, as the implementation becomes much more straight forward.

@MedeaMelana
Copy link
Owner

I agree, move effects are pretty cumbersome to write right now. That's probably because they're just incorrect right now, I think when they're implemented correctly they will be simpler.

Thanks for another card :-)

MedeaMelana added a commit that referenced this pull request Jun 13, 2014
@MedeaMelana MedeaMelana merged commit a765d5d into MedeaMelana:master Jun 13, 2014
@gseitz gseitz deleted the war_priest_of_thune branch June 13, 2014 21:03
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.

2 participants