davewx7 / citadel

A turn based strategy game based on the Anura engine
Other
98 stars 25 forks source link

AI should not kill themselves by playing card when stack is exhausted #153

Open crabel opened 6 years ago

crabel commented 6 years ago

AI sometimes uses the whole deck, especially when playing certain decks. Then it gets damage for each card played.

I had a couple of games now which were totally lost, but had the AI reduced to less than ten life. Since it had burned through all cards, it got one damage for each card played. It played all kinds of useless spells and killed itself.

An easy first fix would be to just stop playing cards when it is down to one life. At least it won't kill itself anymore. Maybe a stronger fix would be to slow down the card usage. Maybe something like: If ((life + stack) < 20) don't discard cards; if card would be discarded, don't play it.