Apparently I am making a 'war game' using cards, but there are bugs and problems

You will need to keep card decks for the player and for the enemy in separate lists, right?

You will also need a general procedure to shuffle a deck (a list.)

Study the intro to lists articles and the simplest shuffle procedure in

I don't see how that / (division) operator is helping you when computing enemy attack. I see that variable shrinking but never increasing.

Could you export and post your aia to help understand the game better?

By the way, you need to use lookup tables for the card values, instead of those if/the/elseif ladders.

Do you have card images for the cards?