Ejemplo n.º 1
0
def handler_world_clash(ctx):
    map = ctx.map
    ui.echo()
    ui.map(map, entities=team_info(ctx.map), show_trace=True)
    ui.echo()
    ui.warn("移动过程中发生路径冲突,移动已中断!")
    ui.echo()
    ui.read("(回车继续)")
    ui.menu(world_menu(ctx.subject), title="请选择你的行动方针:", columns=5, width=15)
Ejemplo n.º 2
0
def handler_battle_start(ac):
    map = ac.battle.map
    if not ui.blankline():
        ui.echo()
    ui.warn("战斗开始!")
    ui.echo()
    ui.read("(回车继续)")
    ui.echo()
    ui.map(map, entities=battle_person_handler(ac.snapshot))
    ui.echo()
    ui.read("(回车继续)")
Ejemplo n.º 3
0
def handler_battle_finish(ac):
    ui.echo()
    result = "胜利" if ac.result else "失败"
    ui.warn("战斗%s!" % result)
    ui.echo()
    for p, exp in ac.explist:
        ui.echo("%s获得了%s点经验。" % (p.name, exp))
        ui.echo()
    for p, node in ac.nodelist:
        ui.echo("%s已经习得了技能%s:%s。" %
                (p.name, ui.rank(node.belongs), ui.rank(node)))
        ui.echo()
    for p, item, quantity in ac.itemlist:
        ui.echo("%s获得了%s×%s。" % (p.name, ui.rank(item), quantity))
        ui.echo()
    ui.read("(回车继续)")
Ejemplo n.º 4
0
def handler_world_give_object(ctx):
    map = ctx.map
    if ctx.pos not in map.loc_entity:
        ui.warn("该坐标下无可赠予对象!")
        ui.echo()
        ui.read("(回车继续)")
        return None
    ui.echo()
    pmenu = person_menu(ctx.pos, map)
    if len(pmenu) > 1:
        rt = ui.menu(pmenu,
                     title="请选择你要赠予的角色:",
                     goback=True,
                     backmethod=lambda: None)
    else:
        rt = pmenu[0].value
    return rt
Ejemplo n.º 5
0
def handler_world_give_position(ctx):
    map = ctx.map
    ui.echo()
    ui.map(map,
           entities=team_info(ctx.map),
           coordinates=ctx.positions,
           coordinate_color="green",
           show_trace=False)
    ui.echo()
    while True:
        rt = ui.read(
            "请输入你想要赠予的对象坐标(绿色表示可赠予范围,坐标用空格分隔,输入#back可返回):",
            handler=lambda x: validate_position(x, ctx.positions, True))
        if rt is not None and rt not in map.loc_entity:
            ui.warn("该坐标下无可赠予对象!")
        else:
            break
        ui.echo()
    return rt
Ejemplo n.º 6
0
def handler_person_join_team(ctx):
    ui.warn("%s加入了%s队。" % (ctx.subject.name, ctx.leader.name))
    ui.echo()
Ejemplo n.º 7
0
def handler_person_attitude_change(ctx):
    ui.warn("%s对你的好感度%s了!" %
            (ctx.subject.name, "提升" if ctx.delta > 0 else "下降"))
    ui.echo()
Ejemplo n.º 8
0
def handler_person_task_update(ctx):
    ui.warn("事件『%s』有更新!" % ctx.task)
    ui.echo()
Ejemplo n.º 9
0
def handler_person_recipe_learn(ctx):
    ui.warn("%s习得了配方:%s" % (ctx.subject.name, ctx.recipe.name))
    ui.read()
Ejemplo n.º 10
0
    team_shaolin.include(p_jy, p_jc, p_snrd)
    team_wudang.include(p_zys, p_lpf)
    team_gaibang.include(p_xfl, p_lcy)
    team_emei.include(p_rwh, p_cg)
    team_huairen.include(p_tw, p_zsj)
    team_youminggong.include(p_qcb, p_yqf)
    team_baibingtang.include(p_sty, p_xh, p_jl)
    team_jialuozu.include(p_ld, p_ysq)
    team_juquemen.include(p_gzq, p_sjy)
    team_beichenpai.include(p_ctz, p_ly)
    team_jiuxipai.include(p_msq, p_hy, p_yq, p_zrb)
    team_caiji.include(p_lx, p_wpf)

    ui.echo()
    ui.warn("欢迎测试本游戏的战斗系统,windows下建议控制台字体调成黑体,谢谢!")
    ui.echo()

    ac = ui.menu([
        ui.menuitem(team_shaolin.label, value=team_shaolin),
        ui.menuitem(team_wudang.label, value=team_wudang),
        ui.menuitem(team_gaibang.label, value=team_gaibang),
        ui.menuitem(team_emei.label, value=team_emei),
        ui.menuitem(team_youminggong.label, value=team_youminggong),
        ui.menuitem(team_juquemen.label, value=team_juquemen),
        ui.menuitem(team_beichenpai.label, value=team_beichenpai),
        ui.menuitem(team_jiuxipai.label, value=team_jiuxipai),
    ],
                 title="请选择参战的阵营:",
                 multiple=True,
                 multiple_range=[2, 2])
Ejemplo n.º 11
0
def handler_game_fail(ctx):
    if not ui.blankline():
        ui.echo()
    ui.warn("休命。")
    ui.read()
    sys.exit(0)
Ejemplo n.º 12
0
def handler_battle_finish_silent(ac):
    if not ui.blankline():
        ui.echo()
    ui.warn("传闻:在一场对决中,%s被%s击败了。" %
            (ac.teamloser.leader.name, ac.teamwinner.leader.name))
    ui.read()