-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTipo.py
38 lines (33 loc) · 988 Bytes
/
Tipo.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
25
26
27
28
29
30
31
32
33
34
35
36
class Tipo():
def __init__(self, tipo) -> None:
self.tipo = tipo
def fraqueza(self, dano, tipo="normal"):
"""
Define o dano recebido de acordo com a fraqueza desse pokemon
e o tipo do ataque do pokemon inimigo
:param dano: double
:param tipo: str
:return: double
"""
if self.tipo == "agua":
if tipo == "fogo":
dano = dano * 0.5
if tipo == "planta":
dano = dano * 2
else:
dano = dano
if self.tipo == "planta":
if tipo == "agua":
dano = dano * 0.5
if tipo == "fogo":
dano = dano * 2
else:
dano = dano
if self.tipo == "fogo":
if tipo == "planta":
dano = dano * 0.5
if tipo == "agua":
dano = dano * 2
else:
dano = dano
return dano