It is currently 12 Sep 2025, 12:05
   
Text Size

StaticAbilityCostChange

Post MTG Forge Related Programming Questions Here

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

Re: StaticAbilityCostChange

Postby FabioFLX » 05 Jun 2012, 08:52

Sloth wrote: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.
What I am doing is to always show the modified cost while a cost change static ability is in effect.
This is working well, but now I think it should be better for the card to always show its real cost instead, and the modified cost to be asked just when playing the card and when the AI checks cards cost.
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:59

FabioFLX wrote:What I am doing is to always show the modified cost while a cost change static ability is in effect.
This is working well, but now I think it should be better for the card to always show its real cost instead, and the modified cost to be asked just when playing the card and when the AI checks cards cost.
According to the rules, the costs of spells and abilities are not modified, it's just that the player has to pay something different. Showing the modified cost is not necessary (and will only confuse when paired with Spell Snare or Inquisition of Kozilek).
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, 10:47

Ok, the cost change acts while casting and activating an ability, and is not displayed in the costs of the card.
User avatar
FabioFLX
 
Posts: 78
Joined: 27 Sep 2011, 13:08
Has thanked: 4 times
Been thanked: 7 times

Re: StaticAbilityCostChange

Postby Sloth » 14 Jul 2012, 21:19

I enabled StaticAbilityCostReduction. It currently can't do more than getSpellCostChange (and has the same errors), but the code and the scripts are much cleaner. It will take a lot of time and work to convert all the special cases in getSpellCostChange over, so this will be WIP for some time (and also some time until gameplay improvements will arise).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticAbilityCostChange

Postby friarsol » 15 Jul 2012, 03:32

I've said for a while that I thought Fireball might be scriptable but never really gave specifics on how. Perhaps with the upcoming CostChange fixes, this will be possible (or attempted). I picture the script being something like this.

A:SP$ DealDamage | Cost$ X R | ValidTgts$ Creature,Player | TargetMin$ 0 | TargetMax$ MaxTgts | NumDmg$ Dmg | SpellDescription$ FIREBALL'D
S:Mode$ IncreaseCost | ValidCard$ Card.Self | Amount$ Y
SVar:MaxTgts:<number of creatures+2>
SVar:Y:Targeted$Count
SVar:Dmg:<XPaid/Y>
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticAbilityCostChange

Postby timmermac » 15 Jul 2012, 05:01

friarsol wrote:I've said for a while that I thought Fireball might be scriptable but never really gave specifics on how. Perhaps with the upcoming CostChange fixes, this will be possible (or attempted). I picture the script being something like this.

A:SP$ DealDamage | Cost$ X R | ValidTgts$ Creature,Player | TargetMin$ 0 | TargetMax$ MaxTgts | NumDmg$ Dmg | SpellDescription$ FIREBALL'D Toasty!!
S:Mode$ IncreaseCost | ValidCard$ Card.Self | Amount$ Y
SVar:MaxTgts:<number of creatures+2>
SVar:Y:Targeted$Count
SVar:Dmg:<XPaid/Y>
Fixed it. <evil grin>
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: StaticAbilityCostChange

Postby Sloth » 18 Jul 2012, 11:49

friarsol wrote:I've said for a while that I thought Fireball might be scriptable but never really gave specifics on how. Perhaps with the upcoming CostChange fixes, this will be possible (or attempted). I picture the script being something like this.
Currently human targets are chosen after getSpellCostChange is called. There is lots of work to do regarding the ordering of additional costs, alternate costs, targeting and cost changing. Sigh.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticAbilityCostChange

Postby friarsol » 18 Jul 2012, 12:13

Sloth wrote:Currently human targets are chosen after getSpellCostChange is called. There is lots of work to do regarding the ordering of additional costs, alternate costs, targeting and cost changing. Sigh.
Booo. Maybe I'll etch a little bit of time out to take a look at that. Is there any reason SpellCostChange needs to happen before targeting (aside from the right the variables just aren't around in SpellAbilityRequirements)?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticAbilityCostChange

Postby Sloth » 18 Jul 2012, 14:37

friarsol wrote:Booo. Maybe I'll etch a little bit of time out to take a look at that.
I will try to fix this if you don't mind.

friarsol wrote:Is there any reason SpellCostChange needs to happen before targeting (aside from the right the variables just aren't around in SpellAbilityRequirements)?
I can't think of any reson.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticAbilityCostChange

Postby friarsol » 18 Jul 2012, 14:46

Sloth wrote:
friarsol wrote:Booo. Maybe I'll etch a little bit of time out to take a look at that.
I will try to fix this if you don't mind.
Of course not. You'll probably get it fixed faster than I'd be able to so feel free.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 61 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form