def select_location(): #选择出生地 def change_location(selection): # description = a.dat()['location'][location['value']]['description'] # a.t(description) a.tmp()['location_mode'] = selection['index'] a.repeat() pass a.page() a.mode('grid', 1) a.t('何处?') a.divider() a.mode() a.t() a.t() a.radio(['平原'], change_location, a.tmp()['location_mode']) a.t() description = a.dat()['location'][a.tmp()['location_mode']]['description'] a.t(description) a.t() a.divider() a.b('下一步', a.goto, select_inherit) a.t() a.b('何人?', a.back)
def random_create(): #生成简易图纸,1战斗2精英战斗3活动4怪物商人5设施商人6装备商人7黑商8休息9决战 map = {1: [], 19: [], 20: []} for i in range(1, 10 + 1): map[1].append(1) map[19].append(8) map[20].append(9) map[2] = [] for i in range(2, 18 + 1): map[i] = [] for j in range(1, 10 + 1): #提供fate卡出现概率 rand = random.randint(0, 100) t = 1 if rand < 40: t = 1 elif rand < 60: t = 2 elif rand < 70: t = 3 elif rand < 75: t = 4 elif rand < 80: t = 5 elif rand < 85: t = 6 elif rand < 90: t = 7 elif rand <= 100: t = 8 map[i].append(t) a.tmp()['fate_map'] = map
def fate_map(): #每日走向选择展示 a.divider(text='前路') a.mode('grid', 10) random_create() for i in range(1, 20 + 1): for j in range(0, 10): card = fate_card(a.tmp()['fate_map'][21 - i][j]) card.print_card(is_able=True) #a.t(a.tmp()['fate_map'][i][j]) 测试用 a.t()
def status_bar(): data = a.tmp() succubus = data['succubus'] a.divider() #状态栏 a.mode('grid', 4) a.t('第{}天'.format(a.tmp()['day'])) a.t('{}'.format(a.tmp()['day_time']), style={'color': '#ff0'}) a.t() a.t('{}'.format(a.tmp()['succubus'].name)) a.t() a.t('{}G'.format(a.tmp()['money'])) a.t() a.t('{}ml'.format(a.tmp()['s***n'])) a.t() a.t('level:{}'.format(succubus.level)) a.t() a.t('生命') a.progress(succubus.health, succubus.max_health, [{ 'width': '100px' }, { 'background-color': '#0f0' }]) a.t('{}/{}'.format(succubus.health, succubus.max_health)) a.t() a.t('俘虏:{}'.format(len(data['prisoner_list']))) a.t() a.t('succubus:{}'.format(len(data['family_list'])))
def goto_difficulty(difficulty): a.clear() #初始化新游戏,考虑之后用一个函数代替,此处先作测试用途 a.tmp()['day'] = 1 a.tmp()['money'] = 0 a.tmp()['s***n'] = 0 a.tmp()['day_time'] = '日间' a.tmp()['prisoner_list'] = [] a.tmp()['family_list'] = [] a.tmp()['difficulty'] = difficulty show_main()
def show_main(): #此处为测试用界面0.1 data = a.tmp() succubus = data['succubus'] a.page() a.mode() a.t('此处为主界面') status_bar() #状态栏 #考虑放置每日三选一计划或者是地宫结构图? fate_map() #考虑放置一些检查选项,如检查设施情况,查看配方,已经拥有的遗物,查看地宫结构等。 check_buttons() #考虑放置系统相关,如设置,存读档案,回到标题,放弃等 sys_buttons()
pass class Map: def __init__(self): super().__init__() self.__data = {'root': None, 'places': {}} def new_empty_place(self): new_empty_place = { 'name': '', 'id': '', 'data': {}, 'parent': None, 'children': [] } def register_place(self, place): pass def random_hash(): pass if __name__ == "__main__": pass else: if 'map' not in a.tmp(): a.tmp()['map'] = Map()
def __init__(self, value): self.value = value a.tmp()["dig_speed"] = self.value[0]
def goto_select_location(number): a.tmp()['succubus'] = succubus(number) a.tmp()['succubus_mode'] = number a.tmp()['location_mode'] = 0 a.goto(select_location)
def change_location(selection): # description = a.dat()['location'][location['value']]['description'] # a.t(description) a.tmp()['location_mode'] = selection['index'] a.repeat() pass