-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap_test.py
More file actions
56 lines (48 loc) · 2.19 KB
/
map_test.py
File metadata and controls
56 lines (48 loc) · 2.19 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
import argparse
import CreatureRogue.creature_creator as creature_creator
import CreatureRogue.settings as settings
from CreatureRogue.data_layer.map_loader import MapLoader
from CreatureRogue.data_layer.region import Region
from CreatureRogue.game import Game
from CreatureRogue.models.creature import Creature
from CreatureRogue.models.move import Move
from CreatureRogue.models.player import Player
from CreatureRogue.states.map_state import MapState
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("x", type=int)
parser.add_argument("y", type=int)
# TODO - Allow for selection of other regions (when they're stored in the database
args = parser.parse_args()
game = Game.create()
# TODO - Fix this now that the map data isn't loaded automatically
kanto_region = Region(region_id=1, identifier="kanto", name="kanto")
map_data = MapLoader(db_file=settings.DB_FILE).load_map(
region=kanto_region,
tile_types=game.static_game_data.map_data_tile_types,
default_tile_type=game.static_game_data.map_data_tile_types[11],
)
game.game_data.player = Player("Test Player", game.static_game_data, map_data, args.x, args.y)
game.state = MapState(game, game.game_data, game.map_renderer)
attacking_id = int(input("Enter the pokedex number of the player creature: "))
attacking_level = int(input("Enter the level of the player creature: "))
attacking_species = game.static_game_data.species[attacking_id]
print("You've selected a: Lv." + str(attacking_level) + " " + str(attacking_species))
attacking_moves = [
Move(move_data) for move_data in attacking_species.move_data_at_level(attacking_level)
]
game.game_data.player.creatures.append(
Creature(
attacking_species,
attacking_level,
None,
None,
creature_creator.random_stat_values(game.static_game_data.stats, 1, 15),
creature_creator.zero_stat_values(game.static_game_data.stats),
False,
attacking_moves,
1,
)
)
# game.game_data.player.pokeballs[game.game_data.player.pokeballs.keys()[0]] = 100
game.game_loop()