Ejemplo n.º 1
0
def see_food_shop_list(type_list: dict) -> list:
    """
    用于查看餐馆出售食物种类的面板
    Keyword arguments:
    type_list -- 种类列表
    Return arguments:
    list --  监听的按钮列表
    """
    era_print.restart_line_print("+")
    now_page_id = int(cache_contorl.panel_state["SeeFoodShopListByFoodPanel"])
    now_page_max = game_config.food_shop_type_max
    now_page_start_id = now_page_id * now_page_max
    now_page_end_id = now_page_start_id + now_page_max
    if not len(type_list):
        era_print.normal_print(
            text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "34")
        )
        era_print.line_feed_print()
        return []
    if now_page_end_id > len(type_list):
        now_page_end_id = len(type_list)
    text_list = []
    tag_text_index = 0
    for i in range(now_page_start_id, now_page_end_id):
        food_name = type_list[list(type_list.keys())[i]]
        text_list.append(food_name)
        tag_text_index += 1
    return cmd_button_queue.option_int(
        "", 4, "left", 1, 0, "center", 0, text_list
    )
Ejemplo n.º 2
0
def see_character_wear_item_list_panel(
    character_id: int, item_type: str, max_page: int
) -> list:
    """
    用于查看角色可穿戴道具列表的面板
    Keyword arguments:
    character_id -- 用户Id
    item_type -- 道具类型
    max_page -- 道具列表最大页数
    """
    era_print.line_feed_print()
    character_wear_item_data = [
        item
        for item in cache_contorl.character_data[character_id].wear_item[
            "Item"
        ]
        if item in cache_contorl.wear_item_type_data[item_type]
    ]
    now_page_id = int(
        cache_contorl.panel_state["SeeCharacterWearItemListPanel"]
    )
    now_page_max = game_config.see_character_wearitem_max
    now_page_start_id = now_page_id * now_page_max
    now_page_end_id = now_page_start_id + now_page_max
    if character_wear_item_data == []:
        era_print.line_feed_print(
            text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "38")
        )
        return []
    if now_page_end_id > len(character_wear_item_data.keys()):
        now_page_end_id = len(character_wear_item_data.keys())
Ejemplo n.º 3
0
def see_character_clothes_cmd(start_id: int, now_clothing_type: str) -> str:
    """
    用于控制查看角色服装列表面板的命令菜单
    Keyword arguments:
    start_id -- cmd命令的初始Id
    now_clothing_type -- 当前列表的服装类型
    """
    era_print.line_feed_print()
    clothing_type_list = list(clothing.clothing_type_text_list.keys())
    cmd_list = text_loading.get_text_data(
        constant.FilePath.CMD_PATH, constant.CmdMenu.SEE_CHARACYTER_CLOTHES
    )
    now_clothing_type_index = clothing_type_list.index(now_clothing_type)
    up_type_id = now_clothing_type_index - 1
    if now_clothing_type_index == 0:
        up_type_id = len(clothing_type_list) - 1
    next_type_id = now_clothing_type_index + 1
    if now_clothing_type_index == len(clothing_type_list) - 1:
        next_type_id = 0
    up_type_text = [
        clothing.clothing_type_text_list[clothing_type_list[up_type_id]]
    ]
    next_type_text = [
        clothing.clothing_type_text_list[clothing_type_list[next_type_id]]
    ]
    cmd_list = up_type_text + cmd_list + next_type_text
    yrn = cmd_button_queue.option_int(
        None,
        5,
        cmd_size="center",
        askfor=False,
        start_id=start_id,
        cmd_list_data=cmd_list,
    )
    return yrn
Ejemplo n.º 4
0
def change_scene_character_list_panel(start_id: int) -> list:
    """
    当前场景角色列表页切换控制面板
    Keyword arguments:
    start_id -- 指令的起始id
    """
    name_list_max = int(game_config.in_scene_see_player_max)
    now_page = int(cache_contorl.panel_state["SeeSceneCharacterListPanel"])
    scene_path = cache_contorl.character_data[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
    )
    character_max = len(scene_character_name_list)
    page_max = math.floor(character_max / name_list_max)
    page_text = "(" + str(now_page) + "/" + str(page_max) + ")"
    input_s = cmd_button_queue.option_int(
        constant.CmdMenu.CHANGE_SCENE_CHARACTER_LIST,
        cmd_column=5,
        askfor=False,
        cmd_size="center",
        start_id=start_id,
    )
    era_print.page_line_print(sample="-", string=page_text)
    era_print.line_feed_print()
    return input_s
Ejemplo n.º 5
0
def see_scene_character_list_panel() -> list:
    """
    当前场景角色列表面板
    """
    input_s = []
    see_character_text = text_loading.get_text_data(
        constant.FilePath.MESSAGE_PATH, "26")
    era_print.normal_print(see_character_text)
    era_print.line_feed_print()
    scene_path = cache_contorl.character_data["character"][0].position
    scene_path_str = map_handle.get_map_system_path_str_for_list(scene_path)
    name_list = map_handle.get_scene_character_name_list(scene_path_str, True)
    name_list = get_now_page_name_list(name_list)
    character_id = cache_contorl.character_data["character_id"]
    character_data = cache_contorl.character_data["character"][character_id]
    character_name = character_data.name
    input_s = cmd_button_queue.option_str(
        "",
        cmd_column=10,
        cmd_size="center",
        askfor=False,
        cmd_list_data=name_list,
        null_cmd=character_name,
    )
    return input_s
Ejemplo n.º 6
0
def see_character_sex_experience_panel(character_id: int):
    """
    查看角色性经验面板
    Keyword arguments:
    character_id -- 角色Id
    """
    era_print.little_line_print()
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "5")
    )
    character_data = cache_contorl.character_data["character"][character_id]
    character_sex_grade_list = character_data.sex_grade
    character_sex = cache_contorl.character_data["character"][character_id].sex
    character_sex_grade_text_list = attr_text.get_sex_grade_text_list(
        character_sex_grade_list, character_sex
    )
    era_print.list_print(character_sex_grade_text_list, 4, "center")
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "7")
    )
    character_engraving = character_data.engraving
    character_engraving_text = attr_text.get_engraving_text(
        character_engraving
    )
    era_print.list_print(character_engraving_text, 3, "center")
Ejemplo n.º 7
0
def see_character_status_panel(character_id: str):
    """
    查看角色状态面板
    Keyword arguments:
    character_id -- 角色Id
    """
    status_text_data = text_loading.get_text_data(
        constant.FilePath.STAGE_WORD_PATH, "134"
    )
    character_data = cache_contorl.character_data["character"][character_id]
    status_data = character_data.status
    for state_type in status_data:
        era_print.son_title_print(status_text_data[state_type])
        now_status_data = status_data[state_type].copy()
        if state_type == "SexFeel":
            if character_data.sex == "Man":
                del now_status_data["VaginaDelight"]
                del now_status_data["ClitorisDelight"]
                del now_status_data["VaginaLubrication"]
            elif character_data.sex == "Woman":
                del now_status_data["PenisDelight"]
            elif character_data.sex == "Asexual":
                del now_status_data["VaginaDelight"]
                del now_status_data["ClitorisDelight"]
                del now_status_data["VaginaLubrication"]
                del now_status_data["PenisDelight"]
        now_status_text_list = [
            status_text_data[state] + ":" + str(now_status_data[state])
            for state in now_status_data
        ]
        size = 7
        if len(now_status_text_list) < size:
            size = len(now_status_text_list)
        era_print.list_print(now_status_text_list, size, "center")
    era_print.line_feed_print()
Ejemplo n.º 8
0
def input_name_panel() -> str:
    """
    请求玩家输入姓名面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "4"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.CURRENCY_MENU)
    return yrn
Ejemplo n.º 9
0
def detailed_setting_8_panel() -> str:
    """
    询问玩家肥胖程度面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "29"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.DETAILED_SETTING8)
    return yrn
Ejemplo n.º 10
0
def input_nick_name_panel() -> str:
    """
    请求玩家输入昵称面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "6"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.INPUT_NICK_NAME)
    return yrn
Ejemplo n.º 11
0
def input_sex_choice_panel() -> str:
    """
    玩家性别选择面板
    """
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "7"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.SEX_MENU)
    return yrn
Ejemplo n.º 12
0
def enter_character_nature_end() -> list:
    """
    用户确认角色性格的尾部面板
    Return arguments:
    list -- 按钮列表
    """
    era_print.line_feed_print()
    return cmd_button_queue.option_int(constant.CmdMenu.ENTER_CHARACTER_NATURE,
                                       1, "left", True, False)
Ejemplo n.º 13
0
def input_self_name_panel() -> str:
    """
    请求玩家输入自称面板
    """
    py_cmd.clr_cmd()
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "14"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.INPUT_SELF_NEME)
    return yrn
Ejemplo n.º 14
0
def attribute_generation_branch_panel() -> str:
    """
    玩家确认进行详细设置面板
    """
    py_cmd.clr_cmd()
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "9"))
    yrn = cmd_button_queue.option_int(constant.CmdMenu.CURRENCY_MENU)
    return yrn
Ejemplo n.º 15
0
def input_sex_panel() -> str:
    """
    请求玩家选择性别面板
    """
    sex_id = cache_contorl.character_data[0].sex
    era_print.line_feed_print(
        text_loading.get_text_data(constant.FilePath.MESSAGE_PATH,
                                   "8")[sex_id])
    yrn = cmd_button_queue.option_int(constant.CmdMenu.CURRENCY_MENU)
    return yrn
Ejemplo n.º 16
0
def load_game_panel():
    """
    载入游戏动画绘制
    """
    era_print.next_screen_print()
    era_print.next_screen_print()
    era_print.one_by_one_print(
        1 / 3, text_loading.get_text_data(constant.FilePath.MESSAGE_PATH, "1")
    )
    era_print.line_feed_print()
Ejemplo n.º 17
0
def see_character_social_contact_panel(character_id: int):
    """
    查看角色社交面板
    Keyword arguments:
    character_id -- 角色Id
    """
    era_print.little_title_print(
        text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "145"))
    era_print.line_feed_print(
        attr_text.get_see_attr_panel_head_character_info(character_id))
    see_social_contact_panel.see_character_social_contact_panel(character_id)
Ejemplo n.º 18
0
def see_character_status_head_panel(character_id: str) -> str:
    """
    查看角色状态面板头部面板
    Keyword arguments:
    character_id -- 角色Id
    """
    era_print.little_title_print(
        text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "135"))
    era_print.line_feed_print(
        attr_text.get_see_attr_panel_head_character_info(character_id))
    see_character_status_panel(character_id)
Ejemplo n.º 19
0
def see_character_wear_item_panel(character_id: int):
    """
    查看角色穿戴道具面板
    Keyword arguments:
    character_id -- 角色Id
    """
    era_print.little_title_print(
        text_loading.get_text_data(constant.FilePath.STAGE_WORD_PATH, "40"))
    era_print.line_feed_print(
        attr_text.get_see_attr_panel_head_character_info(character_id))
    wear_item_panel.see_character_wear_item_panel(character_id, False)
Ejemplo n.º 20
0
def print_map(map_path: list) -> list:
    """
    按地图路径绘制地图
    Ketword arguments:
    map_path -- 地图路径
    """
    map_path_str = get_map_system_path_str_for_list(map_path)
    map_draw = get_map_draw_for_map_path(map_path_str)
    character_position = cache_contorl.character_data["character"][0].position
    character_now_scene_id = get_scene_id_in_map_for_scene_path_on_map_path(
        character_position, map_path
    )
    input_s = []
    map_y_list = map_draw["Draw"]
    map_x_cmd_list_data = map_draw["Cmd"]
    map_x_cmd_id_list_data = map_draw["CmdId"]
    for map_x_list_id in range(len(map_y_list)):
        map_x_list = map_y_list[map_x_list_id]
        now_cmd_list = map_x_cmd_list_data[map_x_list_id]
        now_cmd_id_list = map_x_cmd_id_list_data[map_x_list_id]
        cmd_list_str = "".join(now_cmd_list)
        era_print.normal_print(
            text_handle.align(map_x_list + cmd_list_str, "center", True),
            rich_text_judge=False,
        )
        i = 0
        while i in range(len(map_x_list)):
            if now_cmd_id_list != []:
                while i == now_cmd_id_list[0]:
                    if now_cmd_list[0] == character_now_scene_id:
                        era_print.normal_print(
                            now_cmd_list[0], "nowmap", rich_text_judge=False
                        )
                        input_s.append(None)
                    else:
                        py_cmd.pcmd(now_cmd_list[0], now_cmd_list[0], None)
                        input_s.append(now_cmd_list[0])
                    now_cmd_list = now_cmd_list[1:]
                    now_cmd_id_list = now_cmd_id_list[1:]
                    if now_cmd_list == []:
                        break
                if now_cmd_id_list != []:
                    era_print.normal_print(map_x_list[i : now_cmd_id_list[0]])
                    i = now_cmd_id_list[0]
                else:
                    era_print.normal_print(map_x_list[i:])
                    i = len(map_x_list)
            else:
                era_print.normal_print(map_x_list[i:])
                i = len(map_x_list)
        era_print.line_feed_print()
    return input_s
Ejemplo n.º 21
0
def print_hp_and_mp_bar(character_id: str):
    """
    绘制角色的hp和mp(有比例图),自动居中处理,结尾换行
    Keyword arguments:
    character_id -- 角色id
    """
    hp_bar = get_hp_or_mp_bar(character_id, "HitPoint",
                              game_config.text_width / 2 - 4)
    mp_bar = get_hp_or_mp_bar(character_id, "ManaPoint",
                              game_config.text_width / 2 - 4)
    era_print.line_feed_print()
    era_print.list_print([hp_bar, mp_bar], 2, "center")
    era_print.line_feed_print()
Ejemplo n.º 22
0
def remove_save(save_id: str):
    """
    删除存档id对应存档
    Keyword arguments:
    save_id -- 存档id
    """
    save_path = get_save_dir_path(save_id)
    if os.path.isdir(save_path):
        shutil.rmtree(save_path)
    else:
        error_text = text_loading.get_text_data(
            text_loading.error_path, "not_save_error"
        )
        era_print.line_feed_print(error_text)
def ask_load_save_panel() -> list:
    """
    询问读取存档面板
    """
    era_print.line_feed_print()
    cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH,
                                          "loadSaveAsk")
    message_text = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH,
                                              "23")
    era_print.restart_line_print()
    era_print.line_feed_print(message_text)
    yrn = cmd_button_queue.option_int(None,
                                      askfor=False,
                                      cmd_list_data=cmd_list)
    return yrn
def confirmation_remove_save_panel() -> list:
    """
    确认删除存档面板
    """
    era_print.line_feed_print()
    cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH,
                                          "confirmationRemoveSave")
    message_text = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH,
                                              "25")
    era_print.restart_line_print()
    era_print.line_feed_print(message_text)
    yrn = cmd_button_queue.option_int(None,
                                      askfor=False,
                                      cmd_list_data=cmd_list)
    return yrn
Ejemplo n.º 25
0
def in_scene_button_panel(start_id: int) -> list:
    """
    场景页面基础控制菜单面板
    Keyword arguments:
    start_id -- 基础控制菜单命令起始Id
    """
    era_print.line_feed_print()
    input_s = cmd_button_queue.option_int(
        cmd_list=constant.CmdMenu.IN_SCENE_LIST1,
        cmd_column=9,
        askfor=False,
        cmd_size="center",
        start_id=start_id,
    )
    return input_s
Ejemplo n.º 26
0
def handle_talk(behavior_id: int):
    """
    处理行为结算对话
    Keyword arguments:
    behavior_id -- 行为id
    """
    now_target_character = cache_contorl.character_data[
        cache_contorl.character_data[0].target_character_id]
    if (now_target_character.occupation in cache_contorl.talk_data
            and behavior_id
            in cache_contorl.talk_data[now_target_character.occupation]):
        cache_contorl.talk_data[now_target_character.occupation][behavior_id]()
    else:
        era_print.multiple_line_return_print(
            cache_contorl.talk_data["default"][behavior_id]())
    era_print.line_feed_print()
def ask_for_overlay_save_panel() -> list:
    """
    询问覆盖存档面板
    """
    era_print.line_feed_print()
    cmd_list = text_loading.get_text_data(constant.FilePath.CMD_PATH,
                                          "overlay_save")
    message_text = text_loading.get_text_data(constant.FilePath.MESSAGE_PATH,
                                              "21")
    era_print.restart_line_print()
    era_print.normal_print(message_text)
    era_print.line_feed_print()
    yrn = cmd_button_queue.option_int(None,
                                      askfor=False,
                                      cmd_list_data=cmd_list)
    return yrn
Ejemplo n.º 28
0
def ask_see_clothing_info_panel(wear_clothing_judge: bool) -> str:
    """
    用于询问查看或穿戴服装的面板
    Keyword arguments:
    wear_clothing_judge -- 当前服装穿戴状态
    """
    era_print.line_feed_print()
    cmd_data = text_loading.get_text_data(
        constant.FilePath.CMD_PATH,
        constant.CmdMenu.ASK_SEE_CLOTHING_INFO_PANEL,
    ).copy()
    if wear_clothing_judge:
        del cmd_data["0"]
    else:
        del cmd_data["1"]
    cmd_list = list(cmd_data.values())
    return cmd_button_queue.option_int(None, cmd_list_data=cmd_list)
Ejemplo n.º 29
0
def wait_input(int_a: int, int_b: int) -> str:
    """
    等待玩家输入ab之间的一个数
    Keyword arguments:
    int_a -- 输入边界A
    int_b -- 输入边界B
    """
    while True:
        ans = game_init.askfor_str()
        if ans.isdecimal():
            ans = int(ans)
            if int_a <= ans <= int_b:
                break
        era_print.line_feed_print(ans)
        era_print.line_feed_print(
            text_loading.get_text_data(constant.FilePath.ERROR_PATH,
                                       "input_null_error") + "\n")
    return ans
Ejemplo n.º 30
0
def see_clothing_info_ask_panel(wear_clothing_judge: bool) -> str:
    """
    查看服装详细信息的控制面板
    Keyword arguments:
    wear_clothing_judge -- 服装穿戴状态
    """
    era_print.line_feed_print()
    cmd_data = text_loading.get_text_data(
        constant.FilePath.CMD_PATH,
        constant.CmdMenu.SEE_CLOTHING_INFO_ASK_PANEL,
    ).copy()
    if wear_clothing_judge:
        del cmd_data["1"]
    else:
        del cmd_data["2"]
    cmd_list = list(cmd_data.values())
    return cmd_button_queue.option_int(
        None, 4, cmd_size="center", cmd_list_data=cmd_list
    )