StaticAbilityCostChange
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
25 posts
• Page 2 of 2 • 1, 2
Re: StaticAbilityCostChange
by FabioFLX » 05 Jun 2012, 08:52
What I am doing is to always show the modified cost while a cost change static ability is in effect.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.
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.
Re: StaticAbilityCostChange
by Sloth » 05 Jun 2012, 08:59
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).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.
-
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, 10:47
Ok, the cost change acts while casting and activating an ability, and is not displayed in the costs of the card.
Re: StaticAbilityCostChange
by 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).
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by 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>
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
by timmermac » 15 Jul 2012, 05:01
Fixed it. <evil grin>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'DToasty!!
S:Mode$ IncreaseCost | ValidCard$ Card.Self | Amount$ Y
SVar:MaxTgts:<number of creatures+2>
SVar:Y:Targeted$Count
SVar:Dmg:<XPaid/Y>
"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
Re: StaticAbilityCostChange
by Sloth » 18 Jul 2012, 11:49
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.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.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by friarsol » 18 Jul 2012, 12:13
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)?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.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: StaticAbilityCostChange
by Sloth » 18 Jul 2012, 14:37
I will try to fix this if you don't mind.friarsol wrote:Booo. Maybe I'll etch a little bit of time out to take a look at that.
I can't think of any reson.friarsol wrote:Is there any reason SpellCostChange needs to happen before targeting (aside from the right the variables just aren't around in SpellAbilityRequirements)?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticAbilityCostChange
by friarsol » 18 Jul 2012, 14:46
Of course not. You'll probably get it fixed faster than I'd be able to so feel free.Sloth wrote:I will try to fix this if you don't mind.friarsol wrote:Booo. Maybe I'll etch a little bit of time out to take a look at that.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
25 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 22 guests