StaticAbilityCostChange
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
25 posts
• Page 1 of 2 • 1, 2
StaticAbilityCostChange
by Sloth » 23 May 2012, 10:12
I've added the class and hooked it up in the end of getSpellCostChange. The plan is to move the action from getSpellCostChange to the static ability. During the transition it will not be correct 100%, because reduction should happen before increment.
Please post feature requests, comments and concerns.
@Fabio: Don't bother with X-costs, Multi-Kicker, Convoke and Delve. According to the rules, they should happen before the cost changes, so they are misplaced.
Please post feature requests, comments and concerns.
@Fabio: Don't bother with X-costs, Multi-Kicker, Convoke and Delve. According to the rules, they should happen before the cost changes, so they are misplaced.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by Chris H. » 23 May 2012, 10:20
In message: Re: Restricted use mana
Sloth wrote:FabioFLX wrote:Ohhh... Maybe it's I don't speak English as my main language, too.
No prob anyway, I'm here to contribute to Forge whatever the project may need
Well, so, which undercovered and/or understaffed areas need one to work in the most?
A function that is long overdue for an update is getSpellCostChange. This function gets a spell/ability that should be played and returns its modified mana cost (by cards like Helm of Awakening).
Example of current script:
- Code: Select all
K:CostChange:All:Less:1:Spell:All:All:NoSpecial:Spells cost 1 less to cast.
The plan is to convert this to be a static ability and use the modern scripting system.
First Draft:
- Code: Select all
S:Mode$ CostChange | Affected$ Card | Type$ Spell | Reduction$ 1
If you agree to take a shot, I can set up a new class called StaticAbilityCostChange.java and hook it up. Both systems will work parallel. You can then convert the cards from the old system to the new system at your own pace.
Some new cards that can be made possible: Not of This World, Spellwild Ouphe, Elderwood Scion, Dream Chisel, Locket of Yesterdays, Semblance Anvil, Exiled Doomsayer, Kaervek's Torch.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: StaticAbilityCostChange
by FabioFLX » 23 May 2012, 13:43
Ok, I'm checking out the source so I can apply for this mod.
I'll let you know about any request or update.
I'll let you know about any request or update.
Re: StaticAbilityCostChange
by FabioFLX » 24 May 2012, 20:22
Hi, writing the code I choosed not to use a new StaticAbilityCostChange class but adding a new ReduceCostBy$ parameter to the actual S:Mode$ Continuous class.
This is allowing me coding the functionality easly because it is working like setSemiPermanent... power and thoughness methods.
So a question; should I absolutely move to the StaticAbilityCostChange class or can I continue my way?
This is allowing me coding the functionality easly because it is working like setSemiPermanent... power and thoughness methods.
So a question; should I absolutely move to the StaticAbilityCostChange class or can I continue my way?
Re: StaticAbilityCostChange
by Sloth » 24 May 2012, 21:18
There would be a problem if the owner/controller of the card is not the caster/activator (for example with Praetor's Grasp or Squallmonger).FabioFLX wrote:Hi, writing the code I choosed not to use a new StaticAbilityCostChange class but adding a new ReduceCostBy$ parameter to the actual S:Mode$ Continuous class.
This is allowing me coding the functionality easly because it is working like setSemiPermanent... power and thoughness methods.
So a question; should I absolutely move to the StaticAbilityCostChange class or can I continue my way?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by FabioFLX » 25 May 2012, 08:06
Ok, thanks for the info.
I'm checking the lines around Squallmonger to undestand how it is coded.
I'm checking the lines around Squallmonger to undestand how it is coded.
Re: StaticAbilityCostChange
by FabioFLX » 25 May 2012, 08:32
Ok, I found you coded a method which returns the original/modified cost for each ability.
I'm using this as a base to code the modifiedCost return.
I'm using this as a base to code the modifiedCost return.
Re: StaticAbilityCostChange
by Sloth » 25 May 2012, 17:38
I thought about this and want to suggest a little change:
Instead of having one hook for CostChange it's better to have two static abilities RaiseCost and ReduceCost. This way they will be ordered in the right way.
I hope this won't mess with what you did already (you might have to cut'n paste some stuff).
Example script:
Helm of Awakening
Instead of having one hook for CostChange it's better to have two static abilities RaiseCost and ReduceCost. This way they will be ordered in the right way.
I hope this won't mess with what you did already (you might have to cut'n paste some stuff).
Example script:
Helm of Awakening
- Code: Select all
S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Amount$ 1
- Code: Select all
S:Mode$ RaiseCost | ValidCard$ Artifact,Enchantment | Type$ Spell | Activator$ Opponent | Amount$ 2
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by Sloth » 26 May 2012, 06:36
I will be on vacation for the next week, so i will not be able to help much. I hope you figure things out Fabio. 

-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: StaticAbilityCostChange
by FabioFLX » 29 May 2012, 10:43
Hi, I'm working on the feature right now.
As you may have noted, I have to stop developing Forge from friday to monday every week, as well as I can not write on the forum; this is because I develop into my studio and it uses to stay closed that days. ...Just to let you all know
As you may have noted, I have to stop developing Forge from friday to monday every week, as well as I can not write on the forum; this is because I develop into my studio and it uses to stay closed that days. ...Just to let you all know

Re: StaticAbilityCostChange
by FabioFLX » 29 May 2012, 10:47
I was using past method, the one with one shared ability name and two different parameters.Sloth wrote:I thought about this and want to suggest a little change:
Instead of having one hook for CostChange it's better to have two static abilities RaiseCost and ReduceCost. This way they will be ordered in the right way.
I hope this won't mess with what you did already (you might have to cut'n paste some stuff).
Example script:
Helm of AwakeningAura of Silence
- Code: Select all
S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Amount$ 1
- Code: Select all
S:Mode$ RaiseCost | ValidCard$ Artifact,Enchantment | Type$ Spell | Activator$ Opponent | Amount$ 2
This is allowing me to work as a mana transofmation tool because it semplifies cards that changes mana type in the cost.
Altough it is not mandatory, can I follow my previous path?
EDIT: Of course, a card may have both abilities when the cost is changed... I think about it a little and then will tell my opinion. Ok?
Re: StaticAbilityCostChange
by Sloth » 29 May 2012, 18:49
What cards do you mean? I think all cards either raise or reduce costs.FabioFLX wrote:I was using past method, the one with one shared ability name and two different parameters.
This is allowing me to work as a mana transofmation tool because it semplifies cards that changes mana type in the cost.
No problem, the change wase mainly script cosmetics.FabioFLX wrote:Altough it is not mandatory, can I follow my previous path?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by FabioFLX » 05 Jun 2012, 08:03
Hi all,
I have a question about the implementation of the functionality.
Now I have spells' cost correctly changed by played cards and this change is represented in the whole application, but now I have a doubt if this is really correct.
Infacts, I am thinking that spells that count the cmc should still count the "real" cmc, while the changed cost should only be used when one is playing the modified cards.
What do you think about, and how can I made players able to see both the modified casting cost and the real cmc of each card?
I have a question about the implementation of the functionality.
Now I have spells' cost correctly changed by played cards and this change is represented in the whole application, but now I have a doubt if this is really correct.
Infacts, I am thinking that spells that count the cmc should still count the "real" cmc, while the changed cost should only be used when one is playing the modified cards.
What do you think about, and how can I made players able to see both the modified casting cost and the real cmc of each card?
Re: StaticAbilityCostChange
by Sloth » 05 Jun 2012, 08:44
I'm not sure what you are doing Fabio.
I hooked everything up in StaticAbilityCostChange, all your code should be in applyRaiseCostAbility and applyReduceCostAbility. The player will see everything as it is now, which is fine.
I hooked everything up in StaticAbilityCostChange, all your code should be in applyRaiseCostAbility and applyReduceCostAbility. The player will see everything as it is now, which is fine.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
25 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 59 guests