Ability Factory
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Ability Factory
by friarsol » 10 Oct 2010, 01:15
Ahh. I thought you had enough done for others to play with it. I'll go in and fix the changes.
Are you done with your changes so my work won't just be overridden again in the SVN?
Are you done with your changes so my work won't just be overridden again in the SVN?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Ability Factory
by Rob Cashwalker » 10 Oct 2010, 01:47
Yeah, I think I've gotten far enough with it.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Ability Factory
by Rob Cashwalker » 10 Oct 2010, 02:34
Now, my question to you, is isCurse "universal"? Or is it really specific to just pumps and counters?
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Ability Factory
by friarsol » 10 Oct 2010, 02:55
I don't see why it wouldn't be. It's an easy way to tell the AI that he should be targeting Opposing cards instead of his own. I think it would be short-sighted to say "well this only applies to two types of keywords we have now, let's make it more difficult for other keywords in the future to take use of it."
However, we probably don't need a variable for it. We could just have a getter in AbilityFactory that says:
Oh and we should probably also delete DealDamage from the SVN, now that you renamed the file.
However, we probably don't need a variable for it. We could just have a getter in AbilityFactory that says:
- Code: Select all
public boolean isCurse(){
return mapParams.containsKey("IsCurse");
}
Oh and we should probably also delete DealDamage from the SVN, now that you renamed the file.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Ability Factory
by Rob Cashwalker » 10 Oct 2010, 03:13
Hmmm... I get your point... and yet I still feel like that sort of check is better handled in the specific API code.
Here's one way to look at a similar thing:
Discard and DrawCards will both be expecting a parameter like "NumCards" (and/or "NumCardsX"). As might some other effects. However, I would not expect this to be a significant enough parameter to make it part of the AbilityFactory public methods.
I would parse it in the API matching code block, then pass it as a parameter to the AbilityFactory_{API}.getAbility.
At the same rate, why should getAbility or getSpell have to take parameters at all? As of last night, it was because getAbility was static, and DealDamage wasn't being instantiated. Now it is, so I should move the NumDmg parsing to the AbilityFactory_DealDamage constructor. Same would apply for NumCards, and IMHO, isCurse.
It doesn't show up in my local archive, since I renamed it. I don't see a way to delete it on the Google code site. If you can do it, go ahead.
Here's one way to look at a similar thing:
Discard and DrawCards will both be expecting a parameter like "NumCards" (and/or "NumCardsX"). As might some other effects. However, I would not expect this to be a significant enough parameter to make it part of the AbilityFactory public methods.
I would parse it in the API matching code block, then pass it as a parameter to the AbilityFactory_{API}.getAbility.
At the same rate, why should getAbility or getSpell have to take parameters at all? As of last night, it was because getAbility was static, and DealDamage wasn't being instantiated. Now it is, so I should move the NumDmg parsing to the AbilityFactory_DealDamage constructor. Same would apply for NumCards, and IMHO, isCurse.
It doesn't show up in my local archive, since I renamed it. I don't see a way to delete it on the Google code site. If you can do it, go ahead.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
20 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 67 guests