-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkmn_classes.py
96 lines (81 loc) · 3.37 KB
/
pkmn_classes.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
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
93
94
95
96
# -*- coding: latin-1 -*-
# Keep track of an individual Pokémon, like what would be in the player's party or PC
class pokemon_instance:
def __init__(self,species,nickname,level,status=None,moves=None):
self.species = species
self.nickname = nickname
self.level = level
self.status = status or 0;
#self.hp = pokemon.getBaseHP(species, level)
self.moves = moves or (None,None,None,None)
# TODO does this make sense to have here?
def printParty(self):
print(self.level, self.species)
def __str__(self):
#return('Pokemon: ' + self.species + ' \tLevel: ' + str(self.level))
return('Pokemon: ' + str(self.species) + ' \tNickname: ' + str(self.nickname) + ' \tLevel: ' + str(self.level))
def printMoves(self):
from ROM import moves
print(self.species + '\'s moves:')
for move in self.moves:
try:
print(moves[move].name)
except:
print('-')
"""
Get and set this Pokémon's moves
Parameters: array with 1 to 4 elements indicating move IDs
"""
def getMoves(self):
#this is where the moves would be gotten from
return self.moves
def setMoves(self, moveset):
#this is where the moves would be set
self.moves = moveset
# Looks up the value of the HP for the Pythonemon by species and level
@staticmethod
def getBaseHP(species, level):
return 50
# Define a class that keeps track of all Generic data for a Pokémon species, i.e. Bulbasaur
class pokemon_data:
def __init__(self,dex_no,species,type1,type2,baseHP,baseAttack,baseDefense,baseSpecialAttack,baseSpecialDefense,baseSpeed,experience_group,dex_info):
self.dex_no = dex_no
self.species = species
self.type1 = type1
self.type2 = type2
self.baseHP = baseHP
self.baseAttack = baseAttack
self.baseDefense = baseDefense
self.baseSpecialAttack = baseSpecialAttack
self.baseSpecialDefense = baseSpecialDefense
self.baseSpeed = baseSpeed
self.experience_group = experience_group
self.dex_info = dex_info
# Define how to print this class for users. Probably useless
def __str__(self):
return 'I am a ' + self.species
# Define how to print this class for debugging. Probably not useless. We'll see...
def __repr__(self):
return self.species + ' are in the ' + self.experience_group + ' experience group.'
# Define some getters and setters
def get_baseStatTotal(self):
return self.baseHP + self.baseAttack + self.baseDefense + self.baseSpecialAttack + self.baseSpecialDefense + self.baseSpeed
def get_types(self):
return [self.type1, self.type2]
# Checks the legality of a move
def check_move_legality(self, move, level):
return True
# Define a class that keeps track of info for a move
class move:
def __init__(self,name,move_type,move_class,power,accuracy,pp,priority,critical_hit_ratio):
self.name = name
self.move_type = move_type
self.move_class = move_class
self.power = power
self.accuracy = accuracy
self.pp = pp
self.priority = priority
self.critical_hit_ratio = critical_hit_ratio
# handle special case moves ()
def special_cases(self,name,conditions):
return 0