Skip to content

Commit

Permalink
Update typeChart.py
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sussy-impostor authored May 12, 2024
1 parent 4b52f48 commit 6dd7186
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions typeChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ def __init__(self, weak, resist, immune):
tDragon = Type([tDragon,tIce,tFairy],[tGrass,tFire,tWater,tElectric],[])
tIce = Type([tFire,tRock,tSteel,tFighting],[tIce],[])

def match(type1,type2):
# dummy
return 1
def match(attackType,defenseType):
attackT = [tNormal,tFighting,tFlying,tBug,tGrass,tFire,tWater,tElectric,tGround,tRock,tSteel,tPoison,tGhost,tDark,tFairy,tPsychic,tDragon,tIce][attackType]
defenseT = [tNormal,tFighting,tFlying,tBug,tGrass,tFire,tWater,tElectric,tGround,tRock,tSteel,tPoison,tGhost,tDark,tFairy,tPsychic,tDragon,tIce][defenseType]
if attackT in defenseT.weak:
return 2
elif attackT in defenseT.resist:
return 0.5
elif attackT in defenseT.immune:
return 0
else:
return 1

0 comments on commit 6dd7186

Please sign in to comment.