multiple keywords on 1 card
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
multiple keywords on 1 card
by slapshot5 » 14 Sep 2010, 15:43
Hi all,
I've been digging into the keywords a bit lately, and it looks like we cannot use multiple keywords on one card (e.g. spDestroyTgt and SpBounce). When I tried it, I got exceptions. It would be nice if we could do this for cards like the following:
Perhaps we need to get the restrictions to display from the keywords instead of from card.getText()?
Is this currently possible, and I'm doing something wrong, or is this something we should look into?
-slapshot5
I've been digging into the keywords a bit lately, and it looks like we cannot use multiple keywords on one card (e.g. spDestroyTgt and SpBounce). When I tried it, I got exceptions. It would be nice if we could do this for cards like the following:
- Code: Select all
Active Volcano
R
Instant
Choose one — Destroy target blue permanent; or return target Island to its owner's hand.
spDestroyTgt:Permanent.Blue
spBounce:Land.Island
SVars:Rarity:Uncommon
SVars:Picture:http://www.wizards.com/global/images/magic/general/active_volcano.jpg
Blue Elemental Blast
U
Instant
Choose one — Counter target red spell; or destroy target red permanent.
spCounter:Spell:Color(Red):Graveyard
SpDestroyTgt:Permanent.Red
SVars:Rarity:Common
SVars:Picture:http://www.wizards.com/global/images/magic/general/blue_elemental_blast.jpg
Red Elemental Blast
R
Instant
Choose one — Counter target blue spell; or destroy target blue permanent.
spCounter:Spell:Color(Blue):Graveyard
spDestroyTgt:Permanent.Red
SVars:Rarity:Common
SVars:Picture:http://www.wizards.com/global/images/magic/general/red_elemental_blast.jpg
Perhaps we need to get the restrictions to display from the keywords instead of from card.getText()?
Is this currently possible, and I'm doing something wrong, or is this something we should look into?
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: multiple keywords on 1 card
by DennisBergkamp » 14 Sep 2010, 16:47
It's something we should look into, it currently does not work... I'm not 100% sure, but I think it's because both keywords do a card.clearSpellAbility().
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: multiple keywords on 1 card
by Rob Cashwalker » 14 Sep 2010, 16:54
The only thing holding this back for the human player is that each keyword handler (for a spell, not permanents) clears any previous spell abilities added to the card. The human player will be presented with each available mode of the spell.
However the AI only checks the first ability if it should be played. So in the above cases, it would never attempt to bounce an island.
The way around this is to either modify the AI to check all spell abilities assigned to a card (not all spell abilities assigned to the card may playable in any given situation) OR we create a keyword, like "spCharm". This keyword would take the raw keyword strings as input, and using our proposed AbilityFactory, convert the strings to abilities. Then the AI decision of the Charm keyword queries both abilities for their AI decision, and then chooses between the positive responses. Given a parameter that specifies the number of allowed choices would enable Commands (choose 2 of 4).
The new card format is actually part of this master plan to re-architect the keyword handling.
However the AI only checks the first ability if it should be played. So in the above cases, it would never attempt to bounce an island.
The way around this is to either modify the AI to check all spell abilities assigned to a card (not all spell abilities assigned to the card may playable in any given situation) OR we create a keyword, like "spCharm". This keyword would take the raw keyword strings as input, and using our proposed AbilityFactory, convert the strings to abilities. Then the AI decision of the Charm keyword queries both abilities for their AI decision, and then chooses between the positive responses. Given a parameter that specifies the number of allowed choices would enable Commands (choose 2 of 4).
The new card format is actually part of this master plan to re-architect the keyword handling.
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: multiple keywords on 1 card
by friarsol » 14 Sep 2010, 17:29
Exactly as Rob says. This will probably wait until after we have Abilities that can be added on the fly.
I think I would call this "spModal" instead of "spCharm" but the name really doesn't matter. (Modal)
After we got this working it should be a pretty simple step to add an Entwine ability onto that, so that Barbed Lightning might look like this:
I think I would call this "spModal" instead of "spCharm" but the name really doesn't matter. (Modal)
After we got this working it should be a pretty simple step to add an Entwine ability onto that, so that Barbed Lightning might look like this:
- Code: Select all
k:spModal:<Choose X>:Entwine:<Cost>:<Choose Y>:<List of Keywords>
k:spModal:1:Entwine:2:2:k:spTargetC:3:k:spTargetP:3
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 35 guests