Ok. This will be a small research of how a smart AI should work in the BattleCards game. I will try to write down all my thoughts in the first chapter, which I will call "Brainstorming". The second chapter I will try to translate my thoughts to a programable explanation of my thoughts... ah well... you'll figure it out once you read it I hope.
P.s.: Yes, this was written BEFORE I actually started writing the other things. I used this as an plan of how to approach this.
Brainstorming
Ok... We have an AI which should try to win. But what also is important that it doesn't want to lose. If you think those two are the same, you are wrong. For example, if the AI only wants to win, it will attack you every turn, no matter what. Rather simple. But the problem is, that it doesn't check whether it will lose or not. So in fact, to win, it must survive. As long as possible, with keeping also an eye on winning. Why? Only Healing doesn't help much either. So there must be a balance between winning and losing...
Let's say a AI is low on health. Let's say 10. It has a DMG15 card, which deals 15 damage to the opponent and a HP+15 card, which will heal 'him' (no offence to girls

1.It's obvious that, if the opponents HP is higher than 15 there is no way of winning the game in this turn. Furthermore, if the opponent still has a DMG10 or even a DMG15 card he could win the next turn if the AI doesn't heal.
2.Let's say the opponent is also low on HP (also 10). It's the AI's turn, so why don't finish the opponent off? If the game is over, it's over, right? Right!
So in fact, the AI has to do several steps.
Step 1. Check whether the AI can win the game with a card on his hand.
Step 2. Check whether the player can win the next turn.
Step 3. If step 1 and step 2 resulted in a 'no', than play a card which fits best to it's person.
What's with the 'person' stuff? Well, I thought it may be a cool addition that an AI is not only based on stats, but also has a also a certain 'taste' and 'strategy'. For example, I could introduce a 'Snake-like' enemy, which could base his strategy on poison his enemy (poison card will be introduced later on to the engine). Another example could be a Monk, which would base his strategy on 'protect' and 'light' cards. Of course the enemy's would get decks based on their strategy (like a real human would build a deck based on his strategy).
Till now I got the following monsters with a strategy.
- Snake will mainly use poison card to poison the enemy and drain cards to get health.
- Tank will use protect cards to block attacks and strength-up cards to power up himself so that he can destroy the player in one great blow.
- Monk will use regenerate and other heal cards to keep his HP high. Light spells will be the main attack source for the monk. Secondly it will use Runes to power himself up.
- Devil will use a lot of fire cards, as well as paralyze the other player to block his attacks.
A more ambitious idea I just got is that the AI even could try to match the strategy of the human player to one of the AI's located in the game and than try to 'guess' what the next step of the human player would be. Or that he tries to find a pattern in the strategy of the human.
Ahhhh... AI, a very interesting subject indeed

End
Hmmm... Well, seems like the second chapter isn't really needed. So I will skip this section.
This is thread is a growing thread, so I might throw in some other idea's, but even better; I always like to get some input of others.
What are your idea's? I really would like to hear! Come on... don't be shy

-kv83