Page 1 of 1

[fixed/closed]Avalanche doesn't ask for X

PostPosted: 17 Mar 2014, 11:36
by stassy
Describe the Bug:
Avalanche doesn't ask for X and resolve to nothing

Which card did behave improperly ?
Avalanche

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
2014/02/18: Born of the Gods v2 - DUEL

What exactly should be the correct behavior/interaction ?
Avalanche does ask for X and destroy X target snow land

Are any other cards possibly affected by this bug ?
-

Image

Image

Re: [confirmed]Avalanche doesn't ask for X and resolve to no

PostPosted: 18 Mar 2014, 16:21
by Gargaroz
Mmh, there was a bug in the target validation, which I've fixed in 7eaa441, but for the X value, this is one of the particular case that have an additional cost along with X value.
I've rewrote the function following my standard procedure in 2d8878b, but I bet Korath could do better. Hower, the values in 'ct_all' ('2' in 'require colorless') will prevent the engine to ask the 'X' cost if not modified.

Re: [needs csv]Avalanche doesn't ask for X and resolve to no

PostPosted: 18 Mar 2014, 23:10
by Korath
I think all it needed for the X cost was to charge_mana(player, COLOR_COLORLESS, -1) at the start of its EVENT_CAST_SPELL handler.

Its behavior in EVENT_CAST_SPELL (both before and after your changes) can be better handled by pick_up_to_n_targets(), which'll get you both "done" and "cancel" buttons and handle them correctly; you can find the maximum amount of mana that player can spend with has_mana(player, COLOR_ANY, 1).

It should also be castable with X=0 if there's no snow lands to target, which it no longer is.

This doesn't need a csv update, in any case. The {X} {2} {R} {R} cost could conceivably be handled by charging {X} {R} {R} and fizzling if X < 2, but that's even uglier than charging the {X} separately from the {2} {R} {R}. It would require a disproportionate amount of work to get spells, or even general mana costs, to charge both X and a colorless amount at the same time compared to the number of cards printed with that sort of cost.
---
(Bug is fixed, except for the very minor issue of not being castable with X=0 and no snow lands to target. My comment about about the csv was aimed at the [needs csv update] tag that was in place; both the initial code and Gargaroz' fix assume the engine charges 2RR.)

Re: [still bugged]Avalanche doesn't ask for X

PostPosted: 24 Apr 2014, 04:54
by BAgate
Still doesn't ask for x, allows you to target more than one land (including basic lands) but stops on 2nd target and destroys 1st selection without paying for it.

Re: [still bugged]Avalanche doesn't ask for X

PostPosted: 14 May 2014, 15:33
by Gargaroz
Fixed the part regarding not destroying targets > 1 in 778e342