Esempio n. 1
0
def see_map_flow():
    """
    地图查看流程
    """
    while True:
        py_cmd.clr_cmd()
        input_s = []
        map_cmd = see_map_panel.see_map_panel()
        start_id_1 = len(map_cmd)
        input_s = input_s + map_cmd
        move_path_cmd_data = see_map_panel.see_move_path_panel()
        move_path_cmd = move_path_cmd_data["input_s"]
        move_path_list = move_path_cmd_data["scene_path_list"]
        show_scene_name_list_cmd = see_map_panel.show_scene_name_list_panel()
        see_map_cmd = see_map_panel.back_scene_panel(start_id_1)
        input_s += see_map_cmd + move_path_cmd + [show_scene_name_list_cmd]
        yrn = flow_handle.askfor_all(input_s)
        back_button = str(start_id_1)
        now_position = cache_contorl.character_data["character"][0].position
        now_position_map = map_handle.get_map_for_path(now_position)
        up_map_button = "Null"
        down_map_button = "Null"
        if now_position_map != [] and cache_contorl.now_map != []:
            up_map_button = str(int(start_id_1) + 1)
        if now_position_map != cache_contorl.now_map:
            if up_map_button == "Null":
                down_map_button = str(int(start_id_1) + 1)
            else:
                down_map_button = str(int(start_id_1) + 2)
        now_map = cache_contorl.now_map.copy()
        if yrn in map_cmd:
            now_target_path = map_handle.get_scene_path_for_map_scene_id(
                now_map, yrn)
            character_move.own_charcter_move(now_target_path)
            break
        elif yrn == back_button:
            cache_contorl.now_map = []
            cache_contorl.now_flow_id = "in_scene"
            break
        elif yrn in move_path_cmd:
            move_list_id = move_path_cmd.index(yrn)
            move_id = move_path_list[move_list_id]
            now_target_path = map_handle.get_scene_path_for_map_scene_id(
                now_map, move_id)
            character_move.own_charcter_move(now_target_path)
            break
        elif up_map_button != "Null" and yrn == up_map_button:
            up_map_path = map_handle.get_map_for_path(now_map)
            cache_contorl.now_map = up_map_path
        elif down_map_button != "Null" and yrn == down_map_button:
            character_position = cache_contorl.character_data["character"][
                0].position
            down_map_scene_id = map_handle.get_map_scene_id_for_scene_path(
                cache_contorl.now_map, character_position)
            now_map.append(down_map_scene_id)
            cache_contorl.now_map = now_map
        elif yrn == show_scene_name_list_cmd:
            panel_state_handle.panel_state_change(show_scene_name_list_cmd)
Esempio n. 2
0
def acknowledgment_attribute_func():
    """
    创建角色时用于查看角色属性的流程
    """
    while True:
        character_handle.init_character_list()
        input_s = []
        see_attr_in_every_time_func()
        flow_return = see_character_attr_panel.input_attr_over_panel()
        input_s = flow_return + input_s
        yrn = game_init.askfor_int(input_s)
        py_cmd.clr_cmd()
        if yrn in panel_list:
            panel_state_handle.panel_state_change(yrn)
        elif yrn == "0":
            game_start_flow.init_game_start()
            break
        elif yrn == "1":
            cache_contorl.wframe_mouse.w_frame_re_print = 1
            era_print.next_screen_print()
            cache_contorl.now_flow_id = "title_frame"
            break
Esempio n. 3
0
def see_scene_func(judge: bool):
    """
    用于查看当前场景界面的流程
    Keyword argument:
    judge -- 判断是否绘制角色列表界面的开关
    """
    while True:
        input_s = []
        in_scene_panel.see_scene_panel()
        scene_path = cache_contorl.character_data["character"][0].position
        scene_path_str = map_handle.get_map_system_path_str_for_list(
            scene_path
        )
        scene_character_name_list = map_handle.get_scene_character_name_list(
            scene_path_str
        )
        name_list_max = int(game_config.in_scene_see_player_max)
        change_page_judge = False
        if len(scene_character_name_list) == 1:
            cache_contorl.character_data["character_id"] = 0
        in_scene_cmd_list_1 = []
        if judge:
            if cache_contorl.panel_state["SeeSceneCharacterListPage"] == "0":
                input_s = (
                    input_s + in_scene_panel.see_scene_character_list_panel()
                )
                if len(scene_character_name_list) > name_list_max:
                    in_scene_cmd_list_1 = (
                        in_scene_panel.change_scene_character_list_panel()
                    )
                    change_page_judge = True
            input_s.append("SeeSceneCharacterListPage")
        start_id_1 = len(in_scene_cmd_list_1)
        in_scene_panel.see_character_info_panel()
        see_character_attr_panel.see_character_hp_and_mp_in_sence(
            cache_contorl.character_data["character_id"]
        )
        see_character_attr_panel.see_character_status_panel(
            cache_contorl.character_data["character_id"]
        )
        instruct_head = instruct_panel.see_instruct_head_panel()
        in_scene_cmd_list_2 = in_scene_panel.in_scene_button_panel(start_id_1)
        if change_page_judge:
            input_s += (
                in_scene_cmd_list_1 + instruct_head + in_scene_cmd_list_2
            )
        else:
            input_s += instruct_head + in_scene_cmd_list_2
        yrn = game_init.askfor_all(input_s)
        py_cmd.clr_cmd()
        now_page = int(cache_contorl.panel_state["SeeSceneCharacterListPanel"])
        character_max = len(cache_contorl.character_data["character"]) - 1
        page_max = math.floor(character_max / name_list_max)
        if yrn in scene_character_name_list:
            cache_contorl.character_data[
                "character_id"
            ] = map_handle.get_character_id_by_character_name(
                yrn, scene_path_str
            )
        elif (
            judge
            and yrn not in in_scene_cmd_list_2
            and yrn != "SeeSceneCharacterListPage"
            and change_page_judge
        ):
            if yrn == in_scene_cmd_list_1[0]:
                cache_contorl.panel_state["SeeSceneCharacterListPanel"] = 0
            elif yrn == in_scene_cmd_list_1[1]:
                if int(now_page) == 0:
                    cache_contorl.panel_state[
                        "SeeSceneCharacterListPanel"
                    ] = page_max
                else:
                    cache_contorl.panel_state["SeeSceneCharacterListPanel"] = (
                        int(now_page) - 1
                    )
            elif yrn == in_scene_cmd_list_1[2]:
                cache_contorl.panel_state[
                    "SeeSceneCharacterListPanel"
                ] = in_scene_panel.jump_character_list_page_panel()
            elif yrn == in_scene_cmd_list_1[3]:
                if int(now_page) == page_max:
                    cache_contorl.panel_state["SeeSceneCharacterListPanel"] = 0
                else:
                    cache_contorl.panel_state["SeeSceneCharacterListPanel"] = (
                        int(now_page) + 1
                    )
            elif yrn == in_scene_cmd_list_1[4]:
                cache_contorl.panel_state[
                    "SeeSceneCharacterListPanel"
                ] = page_max
        elif yrn == in_scene_cmd_list_2[0]:
            cache_contorl.now_flow_id = "see_map"
            now_map = map_handle.get_map_for_path(
                cache_contorl.character_data["character"][0].position
            )
            cache_contorl.now_map = now_map
            break
        elif yrn in [in_scene_cmd_list_2[1], in_scene_cmd_list_2[2]]:
            if yrn == in_scene_cmd_list_2[2]:
                cache_contorl.old_character_id = cache_contorl.character_data[
                    "character_id"
                ]
                cache_contorl.character_data["character_id"] = 0
            cache_contorl.now_flow_id = "see_character_attr"
            cache_contorl.old_flow_id = "in_scene"
            break
        elif yrn == "SeeSceneCharacterListPage":
            panel_state_handle.panel_state_change(yrn)
        elif yrn in instruct_head:
            if cache_contorl.instruct_filter[yrn] == 0:
                cache_contorl.instruct_filter[yrn] = 1
            else:
                cache_contorl.instruct_filter[yrn] = 0