Page 1 of 2

StaticAbilityCostChange

PostPosted: 23 May 2012, 10:12
by Sloth
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.

Re: StaticAbilityCostChange

PostPosted: 23 May 2012, 10:20
by Chris H.
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.

Re: StaticAbilityCostChange

PostPosted: 23 May 2012, 13:43
by FabioFLX
Ok, I'm checking out the source so I can apply for this mod.

I'll let you know about any request or update.

Re: StaticAbilityCostChange

PostPosted: 24 May 2012, 20:22
by FabioFLX
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?

Re: StaticAbilityCostChange

PostPosted: 24 May 2012, 21:18
by Sloth
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?
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).

Re: StaticAbilityCostChange

PostPosted: 25 May 2012, 08:06
by FabioFLX
Ok, thanks for the info.
I'm checking the lines around Squallmonger to undestand how it is coded.

Re: StaticAbilityCostChange

PostPosted: 25 May 2012, 08:32
by FabioFLX
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.

Re: StaticAbilityCostChange

PostPosted: 25 May 2012, 17:38
by Sloth
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
Code: Select all
S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Amount$ 1
Aura of Silence
Code: Select all
S:Mode$ RaiseCost | ValidCard$ Artifact,Enchantment | Type$ Spell | Activator$ Opponent | Amount$ 2

Re: StaticAbilityCostChange

PostPosted: 26 May 2012, 06:36
by Sloth
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. :D

Re: StaticAbilityCostChange

PostPosted: 26 May 2012, 09:10
by moomarc
Enjoy your holiday!

Re: StaticAbilityCostChange

PostPosted: 29 May 2012, 10:43
by FabioFLX
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 :)

Re: StaticAbilityCostChange

PostPosted: 29 May 2012, 10:47
by FabioFLX
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 Awakening
Code: Select all
S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Amount$ 1
Aura of Silence
Code: Select all
S:Mode$ RaiseCost | ValidCard$ Artifact,Enchantment | Type$ Spell | Activator$ Opponent | Amount$ 2
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.
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

PostPosted: 29 May 2012, 18:49
by Sloth
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.
What cards do you mean? I think all cards either raise or reduce costs.

FabioFLX wrote:Altough it is not mandatory, can I follow my previous path?
No problem, the change wase mainly script cosmetics.

Re: StaticAbilityCostChange

PostPosted: 05 Jun 2012, 08:03
by FabioFLX
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?

Re: StaticAbilityCostChange

PostPosted: 05 Jun 2012, 08:44
by Sloth
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.