-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPokemon.py
More file actions
92 lines (76 loc) · 3.54 KB
/
Pokemon.py
File metadata and controls
92 lines (76 loc) · 3.54 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import random
from TypeChart import *
from Moves import *
from Func import *
import math
pythonmon = {}
class Pokemon:
<<<<<<< HEAD
def __init__(self, Name, Max, Hp, Atk, Def, Spd, Move, Type, CatchRate, Desc, Xp, LvlRate, Lvl = 1, Item = None, MoveList = None):
=======
def __init__(self, Name, Max, Hp, Atk, Def, Spd, Move, Type, Desc, CatchRate, Xp, LvlRate, Item = None, MoveList = None):
>>>>>>> d26af447d3dc2d4f59d1f0e7043e18f648ae9f9c
self.Name = Name
self.Max = Max
self.Hp = Hp
self.Atk = Atk
self.Def = Def
self.Spd = Spd
self.Move = Move
self.Type = Type
self.Desc = Desc
self.Item = Item
self.CatchRate = CatchRate
self.LvlRate = LvlRate
self.Xp = Xp
<<<<<<< HEAD
self.Lvl = self.lvlCalc()
def lvlCalc(self):
if self.LvlRate == 'fast':
return int(((self.Xp*5)/4)**(1/3))
def displayXp(self):
if self.LvlRate == 'fast':
return self.Xp - (((self.Xp**1/3)/4)*5)
def nextLvl(self):
if self.LvlRate == 'fast':
return (self.Xp - ((((self.Xp+1)**1/3)/4)*5)) - (self.Xp - (((self.Xp**1/3)/4)*5))
def __str__(self):
return f'Name:{self.Name}, Lvl:{self.Lvl}, Hp:{self.Hp}, Atk:{self.Atk}, Def:{self.Def}, Spd:{self.Spd}, Type:{self.Type}, Desc:{self.Desc}, Item:{self.Item}, Catch Rate:{self.CatchRate}'
=======
self.MoveList = MoveList
self.Lvl = 1
self.DVHP = random.randint(1,15)
self.DVATK = random.randint(1, 15)
self.DVDEF = random.randint(1, 15)
self.DVSPD = random.randint(1, 15)
pythonmon[self.Name] = self
self.statCalc()
self.Hp = self.Max
def lvlCalc(self):
if self.LvlRate == 'fast':
experience = self.Xp
level = ((experience*5)/4)**(1/3)
self.Lvl = int(level)
def statCalc(self):
default = pythonmon[self.Name]
self.lvlCalc()
self.Max = int(((((default.Hp + self.DVHP) * 2 + (math.sqrt(252))/4)* self.Lvl) / 100) + self.Lvl + 10)
self.Atk = int(((((default.Atk + self.DVATK) * 2 + (math.sqrt(252))/4) * self.Lvl) / 100) + 5)
self.Def = int(((((default.Def + self.DVDEF) * 2 + 252/4) * self.Lvl) / 100) + 5)
self.Spd = int(((((default.Spd + self.DVSPD) * 2 + (math.sqrt(252))/4) * self.Lvl) / 100) + 5)
def __str__(self):
return f'Name:{self.Name} Max Hp:{self.Max} Current Hp:{self.Hp} Atk:{self.Atk} Def:{self.Def} Spd:{self.Spd} Type:{self.Type} Level:{self.Lvl}'
>>>>>>> d26af447d3dc2d4f59d1f0e7043e18f648ae9f9c
squirtle = Pokemon('Squirtle', 44, 44
<<<<<<< HEAD
, 5, 65, 43, [tackle,waterGun,blank,blank], ['water'], 5, 'Shoots water at prey while in the water. Withdraws into its shell when in danger', 100, 'fast')
=======
, 5, 65, 43, [tackle,waterGun,blank,blank], ['water'], 5, 'Shoots water at prey while in the water. Withdraws into its shell when in danger', 50000, 'fast')
>>>>>>> d26af447d3dc2d4f59d1f0e7043e18f648ae9f9c
charmander = Pokemon('Charmander', 39, 39
, 52, 43, 65, [scratch,ember,blank,blank], ['fire'], 50, 'Obviously prefers hot places. When it rains, steam is said to spout from the tip of its tail.', 100, 'fast')
<<<<<<< HEAD
bulbasaur = Pokemon('Bulbasaur', 45, 45, 49, 49, 45, [tackle,vineWhip,blank,blank], ['grass','poison'], 50, 'A strange seed was planted on its back at birth. The plant sprouts and grows with this POKéMON.', 100, 'fast')
=======
bulbasaur = Pokemon('Bulbasaur', 45, 45, 49, 49, 45, [tackle,vineWhip,blank,blank], ['grass','poison'], 5, 'A strange seed was planted on its back at birth. The plant sprouts and grows with this POKéMON.', 800001, 'fast')
>>>>>>> d26af447d3dc2d4f59d1f0e7043e18f648ae9f9c