Shandalar - Feature Requests
Allow cards to activate from hand or be cast with alternative costs (implemented)
Probably the best way to do this is to pop up a dialog when you click on the card, asking whether to (for example) cast Cloud of Faeries normally or cycle it; or to cast Force of Will normally or pitch a blue card and pay 1 life.
The dialog should always show up, even if only one option or the other is legal, with the other grayed out.
The only other interface I can think of is to put it in the right-click popup menu, which is visually clumsy and will probably be difficult to integrate into the AI:
The dialog should always show up, even if only one option or the other is legal, with the other grayed out.
The only other interface I can think of is to put it in the right-click popup menu, which is visually clumsy and will probably be difficult to integrate into the AI:
Comments
Posted by Aswan jaguar » 29 May 2015, 13:28
Korath wrote:
Probably the best way to do this is to pop up a dialog when you click on the card, asking whether to (for example) cast Cloud of Faeries normally or cycle it; or to cast Force of Will normally or pitch a blue card and pay 1 life.
I agree it is the best solution for both AI and player,too as it is something that new users will try in order to use cycling.
Probably the best way to do this is to pop up a dialog when you click on the card, asking whether to (for example) cast Cloud of Faeries normally or cycle it; or to cast Force of Will normally or pitch a blue card and pay 1 life.
I agree it is the best solution for both AI and player,too as it is something that new users will try in order to use cycling.
Posted by Korath » 27 Jun 2015, 11:28
...and trigger from hand. Optional reveal-for-effect at the start of the game, as with Leylines and Chancellors, are a special case.
Posted by Korath » 19 Sep 2016, 03:00
Working on activate-from-hand only, not alternate-costs, for now.
Two failing testcases in current draft:
Two failing testcases in current draft:
- On bf: 3*Plains. In hand: Holy Day, Blasted Landscape.
- Cast Holy Day.
- Expected: Game allows me to respond by cycling Blasted Landscape. Actual: Holy Day resolves immediately.
- On bf: 4*Plains. In hand: 2*Holy Day, Blasted Landscape.
- Cast Holy Day.
- Respond by cycling Blasted Landscape.
- Expected: Game allows me to respond by casting the second Holy Day. Actual: Blasted Landscape's cycling resolves immediately; game pauses to allow me to respond to the first Holy Day.
Last edited by Korath on 19 Sep 2016, 03:02, edited 1 time in total.
Posted by Korath » 19 Sep 2016, 06:37
Both testcases work correctly when using a Barkhide Mauler instead of a Blasted Landscape, so it's likely something that specifically checks lands.
Posted by Korath » 19 Sep 2016, 07:12
Case 1 not because it's a land, but because it's a mana source without an activated ability (that activates from the battlefield). Adding an in_play() check to is_mana_source_but_not_act_ability() fixes it.
Case 2 apparently because tapped_for_mana_color remains set after charging mana for the activation cost, so it thinks the cycling activation is a mana ability.
Case 2 apparently because tapped_for_mana_color remains set after charging mana for the activation cost, so it thinks the cycling activation is a mana ability.
Posted by Korath » 19 Sep 2016, 08:02
commit 7876be7133868811862b99036dc133f7f34b30af
Author: Korath <dgk@Beleriand.none>
Date: Sun Sep 18 10:03:10 2016 -0400
[GG] +activation from hand
Mediated by EVENT_ACTIVATE_FROM_HAND_TEXT (which must return a label for a
dialog) and EVENT_CAN_ACTIVATE_FROM_HAND, EVENT_ACTIVATE_FROM_HAND, and
EVENT_RESOLVE_ACTIVATION_FROM_HAND (which are exact analogues to their normal
activation events; the only real difference is that activate() flags a card as
STATE_INVISIBLE while calling EVENT_ACTIVATE).
The card-level API uses ACTIVATE_FROM_HAND(), ACTIVATE_FROM_HAND2(), etc., which
work exactly like ACTIVATE() except their first argument is a label. No
analogue for RETURN_MULTIACTIVATE2() etc. yet.
Implement CYCLING() as exemplar, though it doesn't support costs other than mana
and the discard, nor dispatches a trigger for self-triggering cycle cards or
things like Astral Slide. No cards yet either.
Support:
ActivateDiscardSelf
can_activate_from_hand()
can_activate_from_hand_lite()
choose_play_card_or_activate_from_hand()
play_card_or_activate_from_hand()
Moved into Shandalar.dll:
fx_activation_for_exe()
sprintf_CastingActivatingOrProcessing_CardName()
Incidental:
publicize put_card_on_stack_first_call()
publicize put_card_on_stack_second_call()
publicize put_card_on_stack3()
eliminate put_card_on_stack_for_exe()
eliminate put_card_on_stack3_for_exe()
eliminate put_card_on_stack2()
recopy_card_onto_stack() orphaned in exe
commit 3554d998e1f029ea3545e638e87cd5b4b7ac03d3
Author: Korath <dgk@Beleriand.none>
Date: Mon Sep 19 03:59:09 2016 -0400
[GG] fix response to cycling on land cards
1. is_mana_source_but_not_act_ability() returns 0 for cards not in play, so
lands with EA_MANA_SOURCE set, an activated ability that activates from the
hand, and no activated ability that activates from the battlefield (hence
EA_ACT_ABILITY unset) can be activated in response to other spells or abilities
2. Stash needed_mana_colors, tapped_for_mana_color, and tapped_for_mana[] around
ActivateMana::respond(..EVENT_ACTIVATE...) so a cycling (or other non-mana
ability) activation of a card with EA_MANA_SOURCE can be responded to
Author: Korath <dgk@Beleriand.none>
Date: Sun Sep 18 10:03:10 2016 -0400
[GG] +activation from hand
Mediated by EVENT_ACTIVATE_FROM_HAND_TEXT (which must return a label for a
dialog) and EVENT_CAN_ACTIVATE_FROM_HAND, EVENT_ACTIVATE_FROM_HAND, and
EVENT_RESOLVE_ACTIVATION_FROM_HAND (which are exact analogues to their normal
activation events; the only real difference is that activate() flags a card as
STATE_INVISIBLE while calling EVENT_ACTIVATE).
The card-level API uses ACTIVATE_FROM_HAND(), ACTIVATE_FROM_HAND2(), etc., which
work exactly like ACTIVATE() except their first argument is a label. No
analogue for RETURN_MULTIACTIVATE2() etc. yet.
Implement CYCLING() as exemplar, though it doesn't support costs other than mana
and the discard, nor dispatches a trigger for self-triggering cycle cards or
things like Astral Slide. No cards yet either.
Support:
ActivateDiscardSelf
can_activate_from_hand()
can_activate_from_hand_lite()
choose_play_card_or_activate_from_hand()
play_card_or_activate_from_hand()
Moved into Shandalar.dll:
fx_activation_for_exe()
sprintf_CastingActivatingOrProcessing_CardName()
Incidental:
publicize put_card_on_stack_first_call()
publicize put_card_on_stack_second_call()
publicize put_card_on_stack3()
eliminate put_card_on_stack_for_exe()
eliminate put_card_on_stack3_for_exe()
eliminate put_card_on_stack2()
recopy_card_onto_stack() orphaned in exe
commit 3554d998e1f029ea3545e638e87cd5b4b7ac03d3
Author: Korath <dgk@Beleriand.none>
Date: Mon Sep 19 03:59:09 2016 -0400
[GG] fix response to cycling on land cards
1. is_mana_source_but_not_act_ability() returns 0 for cards not in play, so
lands with EA_MANA_SOURCE set, an activated ability that activates from the
hand, and no activated ability that activates from the battlefield (hence
EA_ACT_ABILITY unset) can be activated in response to other spells or abilities
2. Stash needed_mana_colors, tapped_for_mana_color, and tapped_for_mana[] around
ActivateMana::respond(..EVENT_ACTIVATE...) so a cycling (or other non-mana
ability) activation of a card with EA_MANA_SOURCE can be responded to
6 Posts
• Page 1 of 1
Ticket details
- Ticket ID: 582
- Project: Shandalar
- Status: Implemented
- Component: (unknown)
- Project version: (unknown)
- Priority: Normal
- Assigned to: Korath
- Reported by: Korath
- Reporter's tickets: List all tickets
- Reported on: 26 May 2015, 23:50
- Last visited by Korath » 16 Jun 2017, 03:25.