HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

MTG "card" system: need help/ideas!

04-18-2004, 07:14 PM#1
AnarkiNet
Hello, im posting here because i think this is most likely best done in JASS, anyways:
in my MTG: Ice Age Aeon of Strife style map, players will actualy have "cards" (represented by spells in their interface thing), and "decks" (most likely represented by local multiboards). players will also have a "sideboard" (or cardpool) which contains the cards not in their deck.
my problem:
i need to find a way to store which cards each player has, and how many of them. i am aiming to have 75 cards for each color, for a total of 375 (75*5=375) and then, aprox 25 artifact (colorless) cards, with an additional 10-20 land cards.
Idea1:
a string array which stores the value of each card's ability ID and then the amount of it (most likely something like "0 A001")
Idea2:
an abilitycode array, and an integer array, which stores the abilitycodes of each spell, then the amount of each one for each player of the corresponding index number.
these first 2 would have to be something like a simulated 2d array, but if i used the first idea, and made the "card count" part of the string be a number from 0-9 (9 would be the limit on the number of any one card you could own, if you had more than that it would "drop" the card so someone else could take it) so the string would look something like this: "0050430906 A001"
with each digit in the "amount" part of the string being its corresponding players number. ie, if player 4 found 1 copy of A001, it would change to "0051430906 A001"

another thing, im planning on having a "saving" system that will allow players to save ALL their cards, and hero data, etc
04-18-2004, 07:25 PM#2
Vidstige
It might just be that I hate fiddling with string when I don't really have to, but how about just identify each card by a specifik number. The first color might have cards with values between 0 and 99, the next between 100 and 199. If the other needed data about the cards are stored in arrays, the number of the card can be used as index. Depending of what kind and how much information you need to store about each card, the approach with several arrays might prove more or less convenient... Not of much help I guess. :-/
04-18-2004, 09:49 PM#3
AIAndy
I suggest to implement the cards as a class system with the actual cards in the decks as instances of those classes. That way you could store as much info on the cards as you need. Then you could use Lord Vexorians pools to store the actual deck.