trading card game skill system

Started by
15 comments, last by goowik 11 years, 9 months ago
Hi,

So I'm starting to create a simple 'trading card game'.

I have no issues with the simple 'attack damage' reducing players health, but how should I implement a skill system?
For example a card cost 2 mana. That card has a skill which says if you play 1 more mana you can draw a card.

How to implement this? Also how to store these skills for later use?

I mean I'm still wondering how I should save my cards. XML isn't really secure but can be easy to test out stuff.
So whats your opinion on this?

Kind regards
Advertisement
I dont fully understand the you play 1 more mana, do you mean if you play the card which is 2 mana and play another mana which is a total of 3 you can draw another card?
Well to be honest each player could have a int called mana, this variable can be public or private its your choice, and every turn mana is += to the increaseMana. to check for the mana you would do a simple if statement, in this if statement the "cards" for the game will be stored inside a vector (kinda like a arraylist)

[source lang="cpp"]
if(mana smaller Or equals To cards.at(52).returnManaCost)
{
return true;
}
else
{
return false;
}
[/source]

if it returns true, you can then create a method that will do the card power, if its false do nothing, if you need anymore help just post again
I'm quite sure he meant that each card has a specific "Effect" and in this cards case, lets call it "X" costs two mana too play normally but it inherent this effect that if you pay the normal mana-cost AND the extra mana of one ( Which is a total of 3 Mana ) you may play it AND in addition draw a card. Much like Magic the Gathering, Yugioh, Pokemon ect

Those kind of systems are quite complex, most of them use some kind of scripting system for the card-effects making it flexible and simple, and not requiring to hardcode every card.
Kind of off-topic, but be aware that the gameplay of "trading card game play with goal of reducing the life points of other players to a level below one" specifically with "spells [...] that utilize the energy to enable a player to attack" is patented by Wizards of the Coast. It's probably not exactly the kind of thing one would like to implement before 2017.

Kind of off-topic, but be aware that the gameplay of "trading card game play with goal of reducing the life points of other players to a level below one" specifically with "spells [...] that utilize the energy to enable a player to attack" is patented by Wizards of the Coast. It's probably not exactly the kind of thing one would like to implement before 2017.


God I hate patents, that is such a stupid concept.

I do wonder though what you would have the change to have a similar effect in a game. I mean the wording you have is

"trading card game play with goal of reducing the life points of other players to a level below one"

I mean where is the line drawn? If I create a card game where players aren't "trading" cards, or player have an object is heath point which I am trying to reduce below 1 point?

What if I just don't call it a trading card game or life points, or my life points do not have levels.
@Canvas:
It's as Moonkis suggests, each card will have a list of effects (usually 1 to 2 different effects) which on their turn have a cost.
So you pay mana for your card, when that card is into play, you can play it's effects optionally.

@Moonkis:
Well that all depends how a card is saved. If its xml I thought of doing something like this:

<?xml version="1.0" encoding="UTF-8"?>
<creatures>
<creature name="Skeleton">
<description>This is a skeleton</description>
<damage>3</damage>
<health>2</health>
<cost>2</cost>
<type>ground</type>
<effects>
<effect name="Lightning">
<target>opponent</target>
<skipturn>false</skipturn>
<damage>2</damage>
<cost>2</cost>
<effect>
</effects>
</creature>
<creature name="Slime">
<description>This is a slime</description>
<damage>1</damage>
<health>1</health>
<cost>1</cost>
<type>ground</type>
</creature>
<creature name="Pinguin">
<description>This is a pinguin</description>
<damage>0</damage>
<health>3</health>
<cost>1</cost>
<type>flying</type>
<effects>
<effect name="Heal">
<target>self</target>
<skipturn>false</skipturn>
<damage>-2</damage>
<cost>1</cost>
<effect>
<effect name="Push">
<target>target</target>
<skipturn>true</skipturn>
<damage>0</damage>
<cost>1</cost>
<effect>
</effects>
</creature>
</creatures>


But there are 2 issues I know of:

  • All possible effects (what target you can choose, how much damage, how fast, how much cost, ....) should be implemented in each single creature, whether the effect is doesn't do damage, doesnt target anyone, you always need to implement everything.
  • This isn't safe, everyone can alter an xml file.


@samoth & AlysiumX:
Well I'm not sure about if the combination of the elements you stated is patented. I thought they may only patent the assests and name.
Offcourse if the gameplay is identical thats a different story, But let's say I combine this with the importance of how you position your cards in front of the opponents and with a use of a hero card. I suppose it wont be justified then. And even so, It's not like this game will ever be popular :D
Hoping for an opinion on my reply to Moonkis answer.

regards
Hoping on an answer :)

Regards,
Goowik
If I understood what you needed right, then what samoth suggested:

Kind of off-topic, but be aware that the gameplay of "trading card game play with goal of reducing the life points of other players to a level below one" specifically with "spells [...] that utilize the energy to enable a player to attack" is patented by Wizards of the Coast. It's probably not exactly the kind of thing one would like to implement before 2017.

would be partially what you are looking for. You will have to keep a "pool" of usable energy in some variable, and reduce it whenever they decide to use the effect (or keep it but do a check for cards that benefit from adding to this pool when the energy is added to it).
Yes indeed. I don't have any issues programming that part (the "pool").

But as stated i'm not sure how to retrieve these skills and cards. As of now, I have an xml file and a parser.
Unfortunatly this isn't safe in my opinion. So any advice on that matter would be welcome :)

This topic is closed to new replies.

Advertisement