It is currently 11 Sep 2025, 22:53
   
Text Size

Optional additional costs

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Optional additional costs

Postby Sloth » 05 Sep 2012, 16:11

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?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Optional additional costs

Postby friarsol » 05 Sep 2012, 17:20

Multikicker is probably the most atrocious of the offenders.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Optional additional costs

Postby moomarc » 06 Sep 2012, 06:45

Not sure which ones are most important, but once you've laid a foundation I'll try help convert the remaining ones.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby friarsol » 12 Sep 2012, 02:19

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Optional additional costs

Postby Sloth » 12 Sep 2012, 19:29

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Optional additional costs

Postby moomarc » 13 Sep 2012, 06:58

Thanks Sloth. I'll try find some time to start converting some of those existing ones.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby moomarc » 15 Sep 2012, 14:33

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)
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby Sloth » 15 Sep 2012, 15:33

moomarc wrote:Ertai's Trickery doesn't counter kicked spells anymore.
Fixed! Thanks marc.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Optional additional costs

Postby moomarc » 15 Sep 2012, 15:50

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>
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby moomarc » 15 Sep 2012, 16:07

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 :(
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby moomarc » 15 Sep 2012, 17:03

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.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby friarsol » 15 Sep 2012, 17:37

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Optional additional costs

Postby Sloth » 16 Sep 2012, 12:06

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Optional additional costs

Postby moomarc » 16 Sep 2012, 16:48

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);
}
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Optional additional costs

Postby moomarc » 16 Sep 2012, 17:25

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
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 14 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 14 guests

Login Form