It is currently 13 Aug 2025, 22:59
   
Text Size

AbilityFactory TODO list

Post MTG Forge Related Programming Questions Here

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

Re: AbilityFactory TODO list

Postby friarsol » 02 Jul 2011, 16:34

I'm gonna take a crack at AF_Attach. My first iteration will be just for casting Auras. I know Rob and I had a discussion at some point a while back, so each Aura will come with a parameter to tell the AI how it should be doing its logic. I'll be porting & updating some of the Logic that exists in enPump/enCurse/enControl. I think this will help a lot with actually trying to track down what's going on with Auras in general.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: AbilityFactory TODO list

Postby Chris H. » 02 Jul 2011, 17:31

I would not mind seeing an end to the enPump/enCurse/enControl keywords. It served it's purpose back in the early days of "proof of concept" coding while Rob's idea of scripting cards was being developed and advanced. Any plans should probably also eventually include the eqPump keyword.

What about the generic aura keyword? Your plans for an AF_Attach might be able to replace this code at the same time.
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: AbilityFactory TODO list

Postby friarsol » 02 Jul 2011, 21:25

I know this isn't AF specifically, but I just added a new Issue (http://code.google.com/p/cardforge/issues/detail?id=138) with dream that someone will try their hand at Converting Static Effects to a system like AFs and Triggers and figured I'd repost here for more visibility.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: AbilityFactory TODO list

Postby friarsol » 02 Jul 2011, 22:32

Speaking of Attach and Static, is there any functions that exist that I can pass in a card, and get what values are being pumped for Power, Toughness, or Keywords? (Since stPumpEnchanted would be replacing enPump I still need to grab these values for the AI checks.) It seems like this would be a common need, but as far as I can tell the function isn't separated from the calculation code.

Similarly, is there a function that compares a Keywords "Stackability"? Ex. Multiple instances of Flanking are stackable (non-Flanking Blockers get -X/-X). But If I give a Serra Angel Flying it doesn't get to Fly higher than the other Flyers.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: AbilityFactory TODO list

Postby Sloth » 03 Jul 2011, 07:32

friarsol wrote:Similarly, is there a function that compares a Keywords "Stackability"? Ex. Multiple instances of Flanking are stackable (non-Flanking Blockers get -X/-X). But If I give a Serra Angel Flying it doesn't get to Fly higher than the other Flyers.
Use isStackingKeyword in CardUtil.

friarsol wrote:I know this isn't AF specifically, but I just added a new Issue (http://code.google.com/p/cardforge/issues/detail?id=138) with dream that someone will try their hand at Converting Static Effects to a system like AFs and Triggers and figured I'd repost here for more visibility.
I will try to code this. I was thinking about static effects a lot recently anyway. I will start a new topic called StaticEffectFactory.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: AbilityFactory TODO list

Postby slapshot5 » 05 Jul 2011, 12:28

I'm working on ProtectionAll at the moment.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: AbilityFactory TODO list

Postby slapshot5 » 10 Oct 2011, 04:53

Just a heads up that after a long wait, AF_Charm is checked in. You can use it something like this:

Code: Select all
A:SP$ Charm | Cost$ B | Choices$ DBDamage,DBPump,DBTap | SpellDescription$ Choose one - CARDNAME deals 1 damage to target creature and you gain 1 life; or target creature gains first strike until end of turn; or tap target creature.
SVar:DBDamage:DB$ DealDamage | ValidTgts$ Creature | TgtPrompt$ Select target creature to deal damage | NumDmg$ 1 | SubAbility$ DBGain | SpellDescription$ CARDNAME deals 1 damage to target creature and you gain 1 life.
SVar:DBGain:DB$ GainLife | Defined$ You | LifeAmount$ 1
SVar:DBPump:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature to gain First Strike | KW$ First Strike | SpellDescription$ Target creature gains first strike until end of turn.
SVar:DBTap:DB$ Tap | ValidTgts$ Creature | TgtPrompt$ Select target creature to tap | SpellDescription$ Tap target creature.
Two remaining items here:
1. The Commands are not yet supported. (i.e. the CharmNum$ param with a number > 1)
2. AI is not yet implemented

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: AbilityFactory TODO list

Postby Sloth » 10 Oct 2011, 06:40

slapshot5 wrote:Just a heads up that after a long wait, AF_Charm is checked in. You can use it something like this:

Two remaining items here:
1. The Commands are not yet supported. (i.e. the CharmNum$ param with a number > 1)
2. AI is not yet implemented

-slapshot5
What I expected from AF charm was to be used on triggered abilities. Is there a way to make this work?

Example:
| Open
Name:Inquisitor Exarch
ManaCost:W W
Types:Creature Cleric
Text:no text
PT:2/2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharm | TriggerDescription$ When CARDNAME enters the battlefield, choose one - You gain 2 life; or target opponent loses 2 life.
SVar:TrigCharm:AB$ Charm | Cost$ 0 | Choices$ DBGain,DBLose | SpellDescription$ Choose one - You gain 2 life; or target opponent loses 2 life.
SVar:DBGain:DB$ GainLife | Defined$ You | LifeAmount$ 2 | SpellDescription$ You gain 2 life.
SVar:DBLose:DB$ LoseLife | Defined$ You | LifeAmount$ 2 | ValidTgts$ Opponent | SpellDescription$ Target opponent loses 3 life. | SpellDescription$ Target opponent loses 2 life.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/inquisitor_exarch.jpg
End
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: AbilityFactory TODO list

Postby slapshot5 » 10 Oct 2011, 12:56

It's supposed to work. Doesn't it? What are you seeing?

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: AbilityFactory TODO list

Postby Sloth » 10 Oct 2011, 13:12

slapshot5 wrote:It's supposed to work. Doesn't it? What are you seeing?

-slapshot5
The trigger fires, the ability goes on the stack, but does nothing.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: AbilityFactory TODO list

Postby Hellfish » 10 Oct 2011, 15:28

I think the problem is that Triggers use gameAction.playSpellAbility_NoStack, which doesn't handle charms at all,rather than gameAction.playSpellAbility. I'll try to take care of it.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: AbilityFactory TODO list

Postby slapshot5 » 10 Oct 2011, 15:55

Hellfish wrote:I think the problem is that Triggers use gameAction.playSpellAbility_NoStack, which doesn't handle charms at all,rather than gameAction.playSpellAbility. I'll try to take care of it.
Hellfish,

I can take care of this tonight after work. I realized what the problem was right after I asked the question. I've already got a fix in mind.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: AbilityFactory TODO list

Postby Hellfish » 10 Oct 2011, 15:59

Okay, cool! :)

EDIT: Just thought of something; Will there be support for an entwine parameter?
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: AbilityFactory TODO list

Postby slapshot5 » 10 Oct 2011, 22:40

Hellfish wrote:Okay, cool! :)

EDIT: Just thought of something; Will there be support for an entwine parameter?
I've got Charm working in Triggers now, but I'm still debugging some problems with Defined$. I assume that problem is because I set up SubAbilities after the AF processing, but I'll have to dig into to see how to fix it.

Entwine - Hadn't thought of it recently (I guess I did consider that a couple months ago when I first thought about this.) Once I get Defined and Triggers working, I'll look into it.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: AbilityFactory TODO list

Postby slapshot5 » 10 Oct 2011, 23:29

Well, I'm a couple steps closer to Inquisitor Exarch. Charms are now chosen from Triggers, and Defined works. But targeting when used with a trigger doesn't.

I think the Charm code needs to be added earlier in the Trigger code, but I'm not sure where the targeting takes place.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 33 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 33 users online :: 0 registered, 0 hidden and 33 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 33 guests

Login Form