Optional additional costs
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
17 posts
• Page 2 of 2 • 1, 2
Re: Optional additional costs
by Sloth » 16 Sep 2012, 18:00
This is a different problem. AbilityFactory.calculateAmount looks at the paid information of the triggered ability (which has no cost), but it should look for the paid info of the SpellPermanent.moomarc wrote: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{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);
}
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Optional additional costs
by Sloth » 16 Sep 2012, 18:47
I've solved the problem. See r16888.moomarc wrote: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: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]
- 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
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
17 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 53 guests