Page 1 of 2

Optional additional costs

PostPosted: 05 Sep 2012, 16:11
by Sloth
After the next beta release, i plan to create a central point for optional additional costs in the code base. We have a lot of optional additional costs already implemented, but they are all over the place and do not interact well with each other, additional costs and/or modal spells: Kicker, Convoke, Buyback, etc.

I will certainly not have the energy to convert/move all of these keywords. What do you think are the important interactions that need fixing?

Re: Optional additional costs

PostPosted: 05 Sep 2012, 17:20
by friarsol
Multikicker is probably the most atrocious of the offenders.

Re: Optional additional costs

PostPosted: 06 Sep 2012, 06:45
by moomarc
Not sure which ones are most important, but once you've laid a foundation I'll try help convert the remaining ones.

Re: Optional additional costs

PostPosted: 12 Sep 2012, 02:19
by friarsol
Are non-permanent spells with Kicker doable now? Bog Down was the one that I was testing when I was trying to get it working in via additional costs, but never got very far with it.

Re: Optional additional costs

PostPosted: 12 Sep 2012, 19:29
by Sloth
friarsol wrote:Are non-permanent spells with Kicker doable now? Bog Down was the one that I was testing when I was trying to get it working in via additional costs, but never got very far with it.
They are now possible with the new Keyword (see Blood Tribute as example). Most of these spells are scripted already with two spell abilities (which causes incorrectness when cast without paying mana). Only Bog Down, Hunting Wilds, Primal Growth and Prohibit are not.

Re: Optional additional costs

PostPosted: 13 Sep 2012, 06:58
by moomarc
Thanks Sloth. I'll try find some time to start converting some of those existing ones.

Re: Optional additional costs

PostPosted: 15 Sep 2012, 14:33
by moomarc
Ertai's Trickery doesn't counter kicked spells anymore.

EDIT: Actually it just counters the kicked part of the spell but the base resolves as normal. :shock:

EDIT2: Was right the first time. Thought the kicked part was being countered because I tested further on Blood Tribute and the kicked ability didn't happen. Turns out that the kicked ability didn't resolve even without Ertai. So Condition$Kicked isn't working and neither is .kicked valid restriction (at least not outside of etb triggers)

Re: Optional additional costs

PostPosted: 15 Sep 2012, 15:33
by Sloth
moomarc wrote:Ertai's Trickery doesn't counter kicked spells anymore.
Fixed! Thanks marc.

Re: Optional additional costs

PostPosted: 15 Sep 2012, 15:50
by moomarc
Thanks Sloth! Busy converting some of the non-permanent kickers and adding some of the other multi kickers. You did some great work there! =D>

Re: Optional additional costs

PostPosted: 15 Sep 2012, 16:07
by moomarc
The countering part is working and one or two other small bits I had noticed, but Condition$Kicked still seems to be broken. Sorry to keep piling these on you but I tried and I'm just not good enough to find the problem :(

Re: Optional additional costs

PostPosted: 15 Sep 2012, 17:03
by moomarc
And one more thing ( sorry :oops: ) I noticed this with testing Anavolver, but I see it happens with Faerie Squadron too. The ETB triggers of these are duplicated (double flying and four counters). I'm not sure whether it happened before or if it has something to do with the fixes you made.

To help as much as I could I tested a bit further and if you remove the Static$True parameter then the duplicate trigger doesn't happen. Hope that helps pinpoint the problem.

Re: Optional additional costs

PostPosted: 15 Sep 2012, 17:37
by friarsol
moomarc wrote:Thanks Sloth! Busy converting some of the non-permanent kickers and adding some of the other multi kickers. You did some great work there! =D>
Had me confused for a minute here moomarc. I thought you meant multikicker had already been converted.

Re: Optional additional costs

PostPosted: 16 Sep 2012, 12:06
by Sloth
moomarc wrote:The countering part is working and one or two other small bits I had noticed, but Condition$Kicked still seems to be broken. Sorry to keep piling these on you but I tried and I'm just not good enough to find the problem :(
moomarc wrote:And one more thing ( sorry :oops: ) I noticed this with testing Anavolver, but I see it happens with Faerie Squadron too. The ETB triggers of these are duplicated (double flying and four counters). I'm not sure whether it happened before or if it has something to do with the fixes you made.

To help as much as I could I tested a bit further and if you remove the Static$True parameter then the duplicate trigger doesn't happen. Hope that helps pinpoint the problem.
These are fixed. Unleash them 'Volvers.

Re: Optional additional costs

PostPosted: 16 Sep 2012, 16:48
by moomarc
Do optional additional costs paid get added to the paid costs hash? I'm trying to add Dralnu's Pet but no counters are being added.
Script for Dralnu's Pet | Open
Name:Dralnu's Pet
ManaCost:1 U U
Types:Creature Shapeshifter
Text:no text
PT:2/2
K:Kicker 2 B Discard<1/Creature>
T:Mode$ ChangesZone | ValidCard$ Card.Self+kicked | Origin$ Any | Destination$ Battlefield | Execute$ PetLaunch | Static$ True | TriggerDescription$ If CARDNAME was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost.
SVar:PetLaunch:AB$ Pump | Cost$ 0 | Defined$ Self | KW$ Flying | Permanent$ True | SubAbility$ PetStrength
SVar:PetStrength:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ KickedPet | References$ KickedPet
SVar:KickedPet:Discarded$CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/dralnus_pet.jpg
SetInfo:PLS|Rare|http://magiccards.info/scans/en/ps/23.jpg
Oracle:Kicker-{2}{B}, Discard a creature card. (You may pay {2}{B} and discard a creature card in addition to any other costs as you cast this spell.)\nIf Dralnu's Pet was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost.
End

So I added this check in AbilityFactory.calculateAmount in the "Discarded" method and the output is null when the kicker is paid (obviously no output if kicker not paid)
Code: Select all
if (card.getOptionalAdditionalCostsPaid() != null) {
    System.out.println(list);
}

Re: Optional additional costs

PostPosted: 16 Sep 2012, 17:25
by moomarc
702.30e - If part of a spell's ability has its effect only if that spell was kicked, and that part of the ability includes any targets, the spell's controller chooses those targets only if that spell was kicked. Otherwise, the spell is cast as if it did not have those targets. See Rule 601.2c. [CompRules 2009/10/01]
Would it take more effort than it's worth to get this ruling working for cards like Dwarven Landslide? I imaging the functional part of the script would look like this:
Code: Select all
K:Kicker 2 R Sac<1/Land>
A:SP$ Destroy | Cost$ 3 R | ValidTgts$ Land | TargetMin$ X | TargetMax$ X | References$ X | TgtPrompt$ Select target land | SubAbility$ DBKicker | SpellDescription$ Destroy target land. If CARDNAME was kicked, destroy another target land.
SVar:X:Count$KickerSelected:2:1