예제 #1
0
파일: main.py 프로젝트: sujubaima/gmproj
def create_role(args):
    #xing = ui.read("请输入你的姓氏:",
    #               handler=lambda x: x if len(x.strip()) > 0 else None)
    #ui.echo()
    #ming = ui.read("请输入你的名字:",
    #               handler=lambda x: x if len(x.strip()) > 0 else None)
    #ui.echo()
    #sex = ui.menu(sex_menu, title="请选择你的性别:")
    lead = Person.one("PERSON_PLAYER")
    while True:
        #lead = person.create_player(xing, ming, sex)
        lead.random()
        ui.echo()
        ui.echo(ui.colored("你的初始特质如下", attrs=["bold"]))
        ui.echo()
        ui.echo(person_info(lead))
        ui.echo()
        ui.echo(ui.colored("属性介绍", attrs=["bold"]))
        ui.echo()
        ui.echo(attr_info())
        ui.echo()
        if ui.sure(msg.ACCEPT):
            break
    ui.echo()
    runtime.MODULE.scripts.start()
예제 #2
0
def handler_world_scenario_change_ensure(ctx):
    target = ctx.team.scenario.transport_locs[ctx.team.location]
    target = Map.one(target).name
    map = ctx.team.scenario
    ui.map(map, entities=team_info(map), show_trace=True)
    ui.echo()
    ret = ui.sure("当前地块可通往%s,是否前往?" % target)
    return ret
예제 #3
0
파일: battle.py 프로젝트: sujubaima/gmproj
def handler_battle_scope_control(ctrl):
    map = ctrl.battle.map
    ui.echo()
    ui.map(map,
           entities=battle_person_handler(ctrl.snapshot),
           coordinates=[{
               "positions": ctrl.scope,
               "color": "yellow"
           }],
           show_trace=False)
    ui.echo()
    rt = ui.sure("黄色为作用范围,是否确认")
    ctrl.input(rt)
예제 #4
0
파일: battle.py 프로젝트: sujubaima/gmproj
def handler_battle_pos_select_control(ctrl):
    map = ctrl.battle.map
    ui.echo()
    ui.map(map,
           entities=battle_person_handler(ctrl.snapshot),
           coordinates=[{
               "positions": ctrl.positions,
               "color": "green"
           }],
           show_trace=False)
    ui.echo()
    rt = ui.read("%s(绿色表示可移动格子,坐标用空格分隔,输入#back可返回):" % ctrl.text,
                 handler=ctrl.validator)
    ui.echo()
    if ctrl.ensure:
        surert = ui.sure(ctrl.ensure_text)
        if not surert:
            rt = None
    ctrl.select(rt)
예제 #5
0
파일: common.py 프로젝트: sujubaima/gmproj
def handler_pos_select_control(ctrl):
    map = ctrl.scenario
    ui.echo()
    ui.map(map,
           entities=team_info(ctrl),
           coordinates=[{
               "positions": ctrl.positions
           }, {
               "positions": context.guide,
               "color": "yellow"
           }],
           show_trace=False)
    ui.echo()
    rt = ui.read("%s(绿色表示可用格子,坐标用空格分隔,输入#back可返回):" % ctrl.text,
                 handler=ctrl.validator)
    ui.echo()
    if ctrl.ensure:
        surert = ui.sure(ctrl.ensure_text)
        if not surert:
            rt = None
    ctrl.select(rt)
예제 #6
0
def handler_world_rest(ctx):
    ui.echo()
    ui.map(ctx.map, entities=team_info(ctx.map), show_trace=True)
    ui.echo()
    ret = ui.sure("你已经休息过了一段时间,是否继续休息?")
    return ret
예제 #7
0
def handler_world_attack_ensure(ctx):
    ret = ui.sure(
        ui.colored("动手之前要想清楚,是否进行攻击?(若中途参与NPC间的战斗,己方人物的初始位置将是随机的)",
                   color="yellow",
                   attrs=["bold"]))
    return ret
예제 #8
0
파일: scene.py 프로젝트: sujubaima/gmproj
def handler_rest_control(ctrl):
    ui.echo()
    ui.map(ctrl.team.scenario, entities=team_info(ctrl), show_trace=True)
    ui.echo()
    ret = ui.sure("你已经休息过了一段时间,是否继续休息?")
    ctrl.input(ret)
예제 #9
0
파일: scene.py 프로젝트: sujubaima/gmproj
def handler_scenario_change_control(ctrl):
    map = ctrl.team.scenario
    ui.map(map, entities=team_info(ctrl), show_trace=True)
    ui.echo()
    ret = ui.sure(ctrl.text)
    ctrl.input(ret)
예제 #10
0
파일: common.py 프로젝트: sujubaima/gmproj
def handler_ensure_control(ctrl):
    ret = ui.sure(ui.byellow(ctrl.text))
    ctrl.input(ret)