-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathai.py
24 lines (22 loc) · 862 Bytes
/
ai.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from random import randint
def playerAI(gameboard):
for i in range(len(gameboard.playerHand)):
if (gameboard.playerIsBasic(i)) and (len(gameboard.oppBench) < 5):
print("ai player is playing basic")
return 1
elif gameboard.playerHand[i].Card_Type == "Energy":
if gameboard.energyPlayed == False:
return 3
elif gameboard.playerHand[i].Card_Type == "Pokemon" and gameboard.playerHand[i].Stage > 0:
if gameboard.playerHand[i].PreEvolution == gameboard.playerActive[0].Name:
return 8
return 6
def oppAI(gameboard):
for i in range(len(gameboard.oppHand)):
if (gameboard.oppIsBasic(i)) and (len(gameboard.oppBench) < 5):
print("ai opponent is playing basic")
return 1
elif gameboard.oppHand[i].Card_Type == "Energy":
if gameboard.energyPlayed == False:
return 3
return 6