New map: start_town
[realism.git] / main_game / map_functions.py
blob614bcb1ab3d582d02734d7e5067b4d85ae90ad81
1 from engine.game_map import special_keys
2 from random import randint
3 from engine.battle import simple_battle
4 from engine.shop import make_shop
6 def get_map_specials(game_map, pos):
7 for key in special_keys:
8 yield game_map.map_key[key]
10 def wall(game_map, pos, *args):
11 return False
12 wall.tile = "wall"
14 def safe(game_map, pos, *args):
15 game_map.hp_mp_ticks()
16 return True
17 safe.tile = "empty"
19 def normal(game_map, pos, *args):
20 game_map.hp_mp_ticks()
21 if game_map.delay_left > 0:
22 game_map.delay_left -= 1
23 return True
25 (chance, delay, minlvl, maxlvl, mincrits, maxcrits, crittypes, tileset) = \
26 get_map_specials(game_map)
28 if randint(1,100) < int(chance):
29 game_map.delay_left = int(delay)
30 level = randint(int(minlvl),int(maxlvl))
31 crits = randint(int(mincrits),int(maxcrits))
32 game_map.game.ui.battle_mode(simple_battle(level, crits))
34 return True
35 normal.tile = "empty"
37 def object_tutorial(game_map, pos, main = False, *args):
38 return True
39 object_tutorial.tile = "empty"
41 def conversation_tutorial(game_map, pos, main = False, *args):
42 return True
43 conversation_tutorial.tile = "empty"
45 def combat_tutorial(game_map, pos, main = False, *args):
46 return True
47 combat_tutorial.tile = "empty"
49 def menu_tutorial(game_map, pos, main = False, *args):
50 return True
51 menu_tutorial.tile = "empty"
53 def start(game_map, pos, *args):
54 return True
55 start.tile = "empty"
57 def start_and_movement_tutorial(game_map, pos, *args):
58 return True
59 start_and_movement_tutorial.tile = "empty"
61 def door(game_map, pos, *args):
62 return True
63 door.tile = "door"
65 def armor_shop(game_map, pos, level=1, *args):
66 game_map.game.ui.map_mode(make_shop(level, armor=True))
67 return True
68 armor_shop.tile = "armor_door"
70 def weapon_shop(game_map, pos, level=1, *args):
71 game_map.game.ui.map_mode(make_shop(level, weapons=True))
72 return True
73 weapon_shop.tile = "weapon_door"
75 def item_shop(game_map, pos, level=1, *args):
76 game_map.game.ui.map_mode(make_shop(level, other=True))
77 return True
78 item_shop.tile = "item_door"
80 def magic_shop(game_map, pos, level=1, *args):
81 game_map.game.ui.map_mode(make_shop(level, magic=True))
82 return True
83 magic_shop.tile = "magic_door"
85 def welcome_to_start_town_ladies(game_map, pos, *args):
86 game_map.game.ui.conversation_mode('The young lady smiles like a mannequin. "Welcome to Start Town!"')
87 return False
88 welcome_to_start_town_ladies.tile = "lady"
90 def save_point(game_map, pos, *args):
91 return False
92 save_point.tile = "save_point"