-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_main.py
executable file
·67 lines (52 loc) · 2.03 KB
/
test_main.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
# -*- coding: latin-1 -*-
from pkmn_classes import pokemon_instance
from combat import combat
from party import *
# This is a series of functions to test the actual functions of the program
def test_pokemon_creation():
from ROM import pokemon_dict
# Get an instance of a Pokémon
pokemon_1_instance = pokemon_instance('Ivysaur','d',50)
# Get the data for that Pokémon
pokemon_1_data=pokemon_dict[pokemon_1_instance.species]
# Explore the new Pokémon
pokemon_1_instance.setMoves( [0,1] )
pokemon_1_instance.printMoves()
#print('Types: ' + pokemon_1_data.get_types()[0] + ', ' + pokemon_1_data.get_types()[1])
print(repr(pokemon_1_data))
print(pokemon_1_data)
print(pokemon_1_data.get_types())
foe = pokemon_instance('Goldeen','', 30)
# Put the pokemon_instance into a party, print it.
my_party = party(pokemon_1_instance,None,None,None,None,None)
my_party.print_party()
def test_type_effectiveness():
print('Electric vs Goldeen: ')
print(combat.calculate_effectiveness('Electric','Water',None))
print('Electric vs Diglett: ')
print(combat.calculate_effectiveness('Electric','Ground','Rock'))
print('Electric vs Gyarados: ')
print(combat.calculate_effectiveness('Electric','Water','Flying'))
print('Electric vs Bellsprout: ')
print(combat.calculate_effectiveness('Electric','Grass',None))
print('Ground vs a real Pikachu: ')
from ROM import pokemon_dict
print(pokemon_dict['Pikachu'])
#combat.do_move(3,scene)
def test_move_import():
from ROM import moves
#print('size of moves: ' + sys.getsizeof(moves))
print('Imported ' + str(len(moves)) + ' moves.')
print(moves[0].name + ' has ' + moves[0].accuracy + '% accuracy.')
def test_party_import():
my_party = loadParty()
my_party.print_party()
def mainLoop():
test_pokemon_creation()
print('====================')
test_type_effectiveness()
print('====================')
test_move_import()
print('====================')
test_party_import()
mainLoop()