Page 1 of 1

Working with creature types

PostPosted: 07 Aug 2012, 20:58
by MisterBenn
Hi again, I am wondering how best to approach the "Choose a creature type" part of cards like Adaptive Automaton. I could hard-code the creature type choice since it will play in a deck with a single creature type throughout, but that's a bit lame and wouldn't be acceptable if someone else managed to put it in play under their own control.

It seems to me that the best way would be to let the player select a creature card and then take its creature type... but what happens if the creature has more than a single creature type? Do functions exist to detect how many types a creature has and be able to loop through the types somehow? Is there a better approach that comes to mind?

Re: Working with creature types

PostPosted: 07 Aug 2012, 21:06
by thefiremind
RiiakShiNal already worked on this, and came up with a nice approach:
viewtopic.php?f=63&t=7644
maybe it's a bit boring to browse through the types one by one, but it's as close as we could get to the original mechanic.

Re: Working with creature types

PostPosted: 07 Aug 2012, 21:23
by RiiakShiNal
I did add for a way to allow the coder of the card to limit the types to the most logical types, so you could do a RSN_FindPlayerCreatureTypesInZone or make a similar function to Find Creature Types in the game and initially limit it to those (though the player can optionally choose to pick from the full list).

Re: Working with creature types

PostPosted: 07 Aug 2012, 23:32
by MisterBenn
Can't believe I missed that thread, it's still on the first page here! The forum activity's picked up a bit, there are too many threads to stay on top of these days. :) I'll have a read through that thread, thanks.