It is currently 08 May 2024, 22:47
   
Text Size

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

Postby 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:

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

and many others. (Just pretend the syntax is all correct in my examples...)

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

Postby 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().
User avatar
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

Postby 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.
The Force will be with you, Always.
User avatar
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

Postby 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:
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


Return to Developer's Corner

Who is online

Users browsing this forum: Google [Bot] and 35 guests


Who is online

In total there are 36 users online :: 1 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: Google [Bot] and 35 guests

Login Form