More map system progress, still broken.
[realism.git] / main_game / map_functions.py
blob7650aaa7d26f29579aa708d5f29c929b3fd31200
1 from engine.game_map import special_keys
2 from random import randint
3 from engine.battle import simple_battle
5 def get_map_specials(game_map):
6 for key in special_keys:
7 yield game_map.map_key[key]
9 def wall(game_map, *args):
10 return False
11 wall.tile = "wall"
13 def safe(game_map, *args):
14 game_map.hp_mp_ticks()
15 return True
16 safe.tile = "empty"
18 def normal(game_map, *args):
19 game_map.hp_mp_ticks()
20 if game_map.delay_left > 0:
21 game_map.delay_left -= 1
22 return True
24 (chance, delay, minlvl, maxlvl, mincrits, maxcrits, crittypes, tileset) = \
25 get_map_specials(game_map)
27 if randint(1,100) < int(chance):
28 game_map.delay_left = int(delay)
29 level = randint(int(minlvl),int(maxlvl))
30 crits = randint(int(mincrits),int(maxcrits))
31 game_map.game.ui.battle_mode(simple_battle(level, crits))
33 return True
34 normal.tile = "empty"
36 def object_tutorial(game_map, main = False, *args):
37 return True
38 object_tutorial.tile = "empty"
40 def conversation_tutorial(game_map, main = False, *args):
41 return True
42 conversation_tutorial.tile = "empty"
44 def combat_tutorial(game_map, main = False, *args):
45 return True
46 combat_tutorial.tile = "empty"
48 def menu_tutorial(game_map, main = False, *args):
49 return True
50 menu_tutorial.tile = "empty"
52 def start(game_map, *args):
53 return True
54 start.tile = "empty"
56 def start_and_movement_tutorial(game_map, *args):
57 return True
58 start_and_movement_tutorial.tile = "empty"
60 def door(game_map, *args):
61 return True
62 door.tile = "door"