It is currently 12 Sep 2025, 22:41
   
Text Size

StaticAbilityCostChange

Post MTG Forge Related Programming Questions Here

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

StaticAbilityCostChange

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

Re: StaticAbilityCostChange

Postby 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.
User avatar
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

Postby 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.
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

Postby 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?
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

Postby Sloth » 24 May 2012, 21:18

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

Re: StaticAbilityCostChange

Postby FabioFLX » 25 May 2012, 08:06

Ok, thanks for the info.
I'm checking the lines around Squallmonger to undestand how it is coded.
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

Postby 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.
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

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

Re: StaticAbilityCostChange

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

Re: StaticAbilityCostChange

Postby moomarc » 26 May 2012, 09:10

Enjoy your holiday!
-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: StaticAbilityCostChange

Postby 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 :)
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

Postby FabioFLX » 29 May 2012, 10:47

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?
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

Postby Sloth » 29 May 2012, 18:49

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

Re: StaticAbilityCostChange

Postby 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?
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

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

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 79 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 79 users online :: 0 registered, 0 hidden and 79 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 79 guests

Login Form