Example #1
0
def switch_place():

    text = g.current_cmd
    if text is None:
        text = v.sendkey('场所编号:')

    flag = False
    if text != '0':
        for place in g.maps.values():
            if place.id == text:
                g.current_place = place
                flag = True
        if not flag:
            color.error('--- 没有此场所编号 ---', end=False)
            color.next()
    else:
        color.info('~ 你已经在家里了 ~')

    g.current_cmd = None
Example #2
0
 def pay(self, text):
     color.next('开发中...', header=True)            # 在位置信息中定义的 pay 互动操作函数,必须在此位置类中定义
Example #3
0
 def dine(self, text):
     color.next('开发中...', header=True)            # 在位置信息中定义的 dine 互动操作函数,必须在此位置类中定义
Example #4
0
 def order(self, text):                              # 在位置信息中定义的 order 互动操作函数,必须在此位置类中定义
     color.next('开发中...', header=True)
Example #5
0
 def ending(self, text):
     color.next('开发中...', header=True)
Example #6
0
 def rest(self, text):
     color.next('开发中...', header=True)
Example #7
0
 def feed(self, text):
     color.next('开发中...', header=True)
Example #8
0
 def walk(self, text):
     color.next('开发中...', header=True)
Example #9
0
def sendkey(message='请输入:'):
    while True:
        g.clear()
        current()
        print()
        text = input(color.sendkey(message)).strip()
        if text:
            if text.lower() == 'where':
                print()
                current(_map=False)
                color.next('\n按回车继续')
            elif text.lower() == 'status':
                color.info('\n# 角色当前状态如下:\n')
                g.player.show(_map=False)
                color.next('\n按回车继续')
            elif text.lower() == 'help':
                print()
                for msg in u.help:
                    color.info(msg)
                color.next('\n按回车继续')
            elif text.lower() == 'exit':
                y = confirm()
                if y:
                    g.player.exit()
            elif text.lower() == 'author':
                color.caption('\n' + u.author)
                color.next(' ')
            elif text.lower() == 'version':
                color.caption('\n' + u.version)
                color.next(' ')
            elif text.lower() == 'name':
                color.caption('\n' + g.player.data['name'])
                color.next(' ')
            elif text.lower() == 'rename':
                y = confirm()
                if y:
                    print()
                    name = input(color.rename('请输入新的用户名: '))
                    g.player.rename(name)

                color.info('\n当前用户名: ', end=False)
                color.caption(f' {g.player.data["name"]}')
                color.next(' ')
            elif text.lower() == 'delete':
                y = confirm()
                if y:
                    g.player.delete()
                else:
                    print()
            else:
                break
    return text
Example #10
0
 def dine(self, text):
     color.next('开发中...', header=True)
Example #11
0
 def order(self, text):
     color.next('开发中...', header=True)
Example #12
0
 def pay(self, text):
     color.next('开发中...', header=True)