bug in targeting abilities
 Posted: 13 Jan 2015, 04:57
Posted: 13 Jan 2015, 04:57Here is a complex bug in game play.
In play:
Amok
Mentor of the Meek
Ballyrush Banneret
Activate Amok targeting Mentor of the Meek.
Cast Bind targeting the activation of Amok targeting Mentor of the Meek.
Activate Amok targeting Bellyrush Banneret.
Let the stack resolve.
The activation of Amok on Bellyrush Banneret resolves as expected.
The resolution of Bind does not counter the activation of Amok on Mentor of the Meek, but it does resolves and a card is drawn.
The activation of Amok on Bellyrush Banneret resolves, when it should have been countered.
I think that the problem stems from spell and ability targets being
SpellAbility, not SpellAbilityStackInstance, and when Amok's ability is
activated the second time it interferes with the connection between Bind and the other activation of Amok's ability.
The solution is probably going to involve changing spell and ability targets to SpellAbilityStackInstance. This is a major change, unfortunately. If SpellAbilityStackInstance can be modified to be a GameObject it might be possible to use SpellAbilityStackInstance when needed but coerce back to the underlying SpellAbility (with targets set up correctly) at other times so that less code needs to be changed.
This bug may also occur when a countered spell is copied, but I haven't checked this situation.
			In play:
Amok
Mentor of the Meek
Ballyrush Banneret
Activate Amok targeting Mentor of the Meek.
Cast Bind targeting the activation of Amok targeting Mentor of the Meek.
Activate Amok targeting Bellyrush Banneret.
Let the stack resolve.
The activation of Amok on Bellyrush Banneret resolves as expected.
The resolution of Bind does not counter the activation of Amok on Mentor of the Meek, but it does resolves and a card is drawn.
The activation of Amok on Bellyrush Banneret resolves, when it should have been countered.
I think that the problem stems from spell and ability targets being
SpellAbility, not SpellAbilityStackInstance, and when Amok's ability is
activated the second time it interferes with the connection between Bind and the other activation of Amok's ability.
The solution is probably going to involve changing spell and ability targets to SpellAbilityStackInstance. This is a major change, unfortunately. If SpellAbilityStackInstance can be modified to be a GameObject it might be possible to use SpellAbilityStackInstance when needed but coerce back to the underlying SpellAbility (with targets set up correctly) at other times so that less code needs to be changed.
This bug may also occur when a countered spell is copied, but I haven't checked this situation.

 Something to keep in mind when making these changes, would be nice to have that working as well.
 Something to keep in mind when making these changes, would be nice to have that working as well.