diff --git a/.gitignore b/.gitignore index 3d04059c162c94fd40002b4e945c3e14103d1cb7..6e42511b9089da40ed4afbde283dc9709c8fe10e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -xiuxian_env \ No newline at end of file +xiuxian_env +__pycache__ diff --git a/game/utils.py b/game/utils.py index 9f9e62d18ab811ab5da798571195db43c334bad2..7a1f8965508dc8ba0793335556ff8eef4ccbbdbd 100644 --- a/game/utils.py +++ b/game/utils.py @@ -7,7 +7,48 @@ import os import sys import time -from typing import List +from typing import List, Optional + + +class Colors: + """终端颜色代码""" + RED = '\033[31m' + GREEN = '\033[32m' + YELLOW = '\033[33m' + BLUE = '\033[34m' + MAGENTA = '\033[35m' + CYAN = '\033[36m' + WHITE = '\033[37m' + BRIGHT_RED = '\033[91m' + BRIGHT_GREEN = '\033[92m' + BRIGHT_YELLOW = '\033[93m' + BRIGHT_BLUE = '\033[94m' + BRIGHT_MAGENTA = '\033[95m' + BRIGHT_CYAN = '\033[96m' + BRIGHT_WHITE = '\033[97m' + + # 背景色 + BG_BLACK = '\033[40m' + BG_RED = '\033[41m' + BG_GREEN = '\033[42m' + BG_YELLOW = '\033[43m' + BG_BLUE = '\033[44m' + BG_MAGENTA = '\033[45m' + BG_CYAN = '\033[46m' + BG_WHITE = '\033[47m' + + # 样式 + BOLD = '\033[1m' + DIM = '\033[2m' + UNDERLINE = '\033[4m' + BLINK = '\033[5m' + REVERSE = '\033[7m' + + # 重置 + RESET = '\033[0m' + + # 额外颜色(用于特殊场合) + BRIGHT_GOLD = '\033[93m' def clear_screen(): @@ -15,39 +56,148 @@ def clear_screen(): os.system('cls' if os.name == 'nt' else 'clear') -def print_slowly(text: str, delay: float = 0.05): - """逐字显示文本""" +def print_colored(text: str, color: str = Colors.WHITE, end: str = '\n'): + """打印彩色文本""" + print(f"{color}{text}{Colors.RESET}", end=end) + + +def print_slowly(text: str, delay: float = 0.05, color: str = Colors.WHITE): + """逐字显示彩色文本""" for char in text: - print(char, end='', flush=True) + print(f"{color}{char}{Colors.RESET}", end='', flush=True) time.sleep(delay) print() # 换行 -def get_user_choice(prompt: str, valid_choices: List[str]) -> str: +def print_box(text: str, width: int = 60, color: str = Colors.CYAN, fill_char: str = "═"): + """打印带边框的文本""" + lines = text.strip().split('\n') + max_line_length = max(len(line) for line in lines) if lines else 0 + box_width = max(width, max_line_length + 4) + + # 顶部边框 + print_colored(f"╔{fill_char * (box_width - 2)}╗", color) + + # 内容 + for line in lines: + padding = box_width - len(line) - 2 + left_padding = padding // 2 + right_padding = padding - left_padding + print_colored(f"║{' ' * left_padding}{line}{' ' * right_padding}║", color) + + # 底部边框 + print_colored(f"╚{fill_char * (box_width - 2)}╝", color) + + +def print_title(title: str, subtitle: str = "", color: str = Colors.BRIGHT_CYAN): + """打印标题""" + clear_screen() + title_art = f""" +{Colors.BRIGHT_CYAN}╔══════════════════════════════════════════════════════════╗ +║ {title.center(34)} ║""" + + if subtitle: + title_art += f""" +║ {subtitle.center(38)} ║""" + + title_art += f""" +╚══════════════════════════════════════════════════════════╝{Colors.RESET}""" + + print(title_art) + print() + + +def print_menu(title: str, options: List[str], color: str = Colors.BRIGHT_YELLOW): + """打印菜单""" + print_colored(f"\n{Colors.BOLD}═══ {title} ═══{Colors.RESET}", color) + for i, option in enumerate(options, 1): + icon = "⚡" if i <= 3 else "🔹" if i <= 6 else "⭐" + print_colored(f"{icon} {i}. {option}", Colors.WHITE) + print() + + +def get_user_choice(prompt: str, valid_choices: List[str], color: str = Colors.BRIGHT_GREEN) -> str: """获取用户选择""" while True: - choice = input(prompt).strip() + print_colored(prompt, color, end="") + choice = input().strip() if choice in valid_choices: return choice - print(f"无效选择,请输入: {', '.join(valid_choices)}") + print_colored(f"❌ 无效选择,请输入: {', '.join(valid_choices)}", Colors.BRIGHT_RED) def format_number(num: int) -> str: """格式化数字显示""" - if num >= 10000: + if num >= 100000000: # 亿 + return f"{num//100000000}亿{format_number(num%100000000)}" if num%100000000 > 0 else f"{num//100000000}亿" + elif num >= 10000: # 万 return f"{num//10000}万{num%10000}" if num%10000 > 0 else f"{num//10000}万" return str(num) -def show_progress_bar(current: int, total: int, width: int = 20) -> str: - """显示进度条""" +def show_progress_bar(current: int, total: int, width: int = 30, + color: str = Colors.BRIGHT_GREEN, bg_color: str = Colors.DIM) -> str: + """显示美化的进度条""" if total == 0: - return "[" + "█" * width + "]" + return f"{color}[{'█' * width}]{Colors.RESET}" - progress = current / total + progress = min(current / total, 1.0) filled = int(width * progress) - bar = "█" * filled + "░" * (width - filled) - return f"[{bar}] {current}/{total}" + + # 根据进度选择颜色 + if progress < 0.3: + bar_color = Colors.BRIGHT_RED + elif progress < 0.7: + bar_color = Colors.BRIGHT_YELLOW + else: + bar_color = Colors.BRIGHT_GREEN + + bar = f"{bar_color}{'█' * filled}{bg_color}{'░' * (width - filled)}{Colors.RESET}" + percentage = f"{progress * 100:.1f}%" + + return f"[{bar}] {current}/{total} ({percentage})" + + +def print_status_panel(player): + """打印美化的状态面板""" + from game.utils import format_number, show_progress_bar + + # 根据境界选择颜色 + realm_colors = { + "练气期": Colors.WHITE, + "筑基期": Colors.CYAN, + "结丹期": Colors.BLUE, + "元婴期": Colors.MAGENTA, + "化神期": Colors.YELLOW, + "炼虚期": Colors.BRIGHT_CYAN, + "合体期": Colors.BRIGHT_BLUE, + "大乘期": Colors.BRIGHT_MAGENTA, + "渡劫期": Colors.BRIGHT_YELLOW, + "真仙": Colors.BRIGHT_WHITE + } + + realm_color = realm_colors.get(player.realm, Colors.WHITE) + + print_colored("╔═══════════════════════════════════════════════════════════════╗", Colors.BRIGHT_CYAN) + print_colored(f"║ {Colors.BRIGHT_WHITE}道号: {Colors.BRIGHT_YELLOW}{player.name:<15} {Colors.BRIGHT_WHITE}灵根: {Colors.BRIGHT_MAGENTA}{player.spirit_root}灵根{' ':<15}║", Colors.BRIGHT_CYAN) + print_colored(f"║ {Colors.BRIGHT_WHITE}境界: {realm_color}{player.realm:<12} {Colors.BRIGHT_WHITE}等级: {Colors.BRIGHT_GREEN}Lv.{player.level:<8}{' ':<15}║", Colors.BRIGHT_CYAN) + print_colored("╠═══════════════════════════════════════════════════════════════╣", Colors.BRIGHT_CYAN) + + # 生命值 + hp_bar = show_progress_bar(player.health, player.max_health, 20, Colors.BRIGHT_RED) + print_colored(f"║ {Colors.BRIGHT_RED}♥ 生命: {hp_bar}{' ' * (20 - len(str(player.health)) - len(str(player.max_health)))}║", Colors.BRIGHT_CYAN) + + # 灵力值 + mp_bar = show_progress_bar(player.mana, player.max_mana, 20, Colors.BRIGHT_BLUE) + print_colored(f"║ {Colors.BRIGHT_BLUE}◆ 灵力: {mp_bar}{' ' * (20 - len(str(player.mana)) - len(str(player.max_mana)))}║", Colors.BRIGHT_CYAN) + + # 经验值 + exp_bar = show_progress_bar(player.experience, player.experience_needed, 20, Colors.BRIGHT_YELLOW) + print_colored(f"║ {Colors.BRIGHT_YELLOW}★ 经验: {exp_bar}{' ' * (15 - len(str(player.experience)) - len(str(player.experience_needed)))}║", Colors.BRIGHT_CYAN) + + # 灵石 + print_colored(f"║ {Colors.BRIGHT_WHITE}💎 灵石: {Colors.BRIGHT_YELLOW}{format_number(player.spirit_stones):<25}{' ':<25}║", Colors.BRIGHT_CYAN) + print_colored("╚═══════════════════════════════════════════════════════════════╝", Colors.BRIGHT_CYAN) def roll_dice(sides: int = 6) -> int: @@ -73,4 +223,35 @@ def calculate_success_rate(base_rate: float, level: int, spirit_root: str) -> fl rate += spirit_bonuses.get(spirit_root, 0) - return min(rate, 0.95) # 最大95%成功率 \ No newline at end of file + return min(rate, 0.95) # 最大95%成功率 + + +def print_divider(char: str = "═", length: int = 60, color: str = Colors.CYAN): + """打印分割线""" + print_colored(char * length, color) + + +def print_success(message: str): + """打印成功消息""" + print_colored(f"✅ {message}", Colors.BRIGHT_GREEN) + + +def print_error(message: str): + """打印错误消息""" + print_colored(f"❌ {message}", Colors.BRIGHT_RED) + + +def print_warning(message: str): + """打印警告消息""" + print_colored(f"⚠️ {message}", Colors.BRIGHT_YELLOW) + + +def print_info(message: str): + """打印信息消息""" + print_colored(f"ℹ️ {message}", Colors.BRIGHT_BLUE) + + +def wait_for_input(prompt: str = "按回车键继续...", color: str = Colors.DIM): + """等待用户输入""" + print_colored(prompt, color, end="") + input() \ No newline at end of file diff --git a/main.py b/main.py index 92a581bb1b34eb27b11c55d3704cc264c9734aaa..1b1cd82bc9dcf47ce8366ab9f7227131d99af6a3 100644 --- a/main.py +++ b/main.py @@ -14,7 +14,11 @@ from typing import Dict, List, Optional from game.player import Player from game.world import GameWorld from game.ai_interface import AIInterface -from game.utils import clear_screen, print_slowly, get_user_choice +from game.utils import ( + clear_screen, print_slowly, get_user_choice, print_title, print_menu, + print_box, print_status_panel, print_success, print_error, print_warning, + print_info, wait_for_input, Colors, print_colored, print_divider +) class XiuxianSimulator: @@ -34,10 +38,10 @@ class XiuxianSimulator: with open("config.json", "r", encoding="utf-8") as f: return json.load(f) except FileNotFoundError: - print("配置文件不存在,使用默认配置...") + print_warning("配置文件不存在,使用默认配置...") return { "ai": {"enabled": False}, - "game": {"auto_save": True, "text_speed": 0.05}, + "game": {"auto_save": True, "text_speed": 0.02}, "display": {"use_colors": True} } @@ -53,7 +57,6 @@ class XiuxianSimulator: def start_game(self): """开始游戏""" - clear_screen() self.show_intro() # 创建角色 @@ -65,76 +68,109 @@ class XiuxianSimulator: def show_intro(self): """显示游戏开场""" - intro_text = """ -╔══════════════════════════════════════╗ -║ 修仙模拟器 ║ -║ ║ -║ 在这个神秘的修仙世界中,你将体验 ║ -║ 从凡人到仙人的漫长修炼之路... ║ -║ ║ -╚══════════════════════════════════════╝ - """ - print_slowly(intro_text, self.config["game"]["text_speed"]) - input("\n按回车键继续...") + print_title("修仙模拟器", "踏上仙途,逆天而行") + + intro_text = f"""{Colors.BRIGHT_CYAN} + ✨ 欢迎来到修仙世界 ✨ + + 在这个神秘莫测的修仙界中,你将从一个凡人开始, + 经历练气、筑基、结丹等诸多境界,最终成就仙道。 + + 🌟 修炼功法,提升境界 + ⚔️ 探索秘境,寻找机缘 + 🧪 炼制丹药,增强实力 + 🎯 渡过天劫,证道成仙 + + 你的仙途之路,即将开始...""" + + print_box(intro_text, 70, Colors.BRIGHT_CYAN) + wait_for_input("\n🎮 按回车键开始你的修仙之路...") def create_character(self): """创建角色""" - clear_screen() - print("=== 角色创建 ===\n") + print_title("角色创建", "选择你的修仙之路") - name = input("请输入你的道号: ").strip() + print_colored("🎭 请输入你的道号:", Colors.BRIGHT_YELLOW) + name = input(">>> ").strip() if not name: name = "无名道人" - # 选择灵根属性 - print("\n请选择你的灵根属性:") + print_divider() + print_colored("\n🌈 请选择你的灵根属性:", Colors.BRIGHT_MAGENTA) + spirit_roots = { - "1": ("金灵根", "金"), - "2": ("木灵根", "木"), - "3": ("水灵根", "水"), - "4": ("火灵根", "火"), - "5": ("土灵根", "土"), - "6": ("雷灵根", "雷"), - "7": ("混沌灵根", "混沌") + "1": ("金灵根", "金", "⚔️ 攻击力强,适合剑修", Colors.YELLOW), + "2": ("木灵根", "木", "🌱 恢复力强,生命力旺盛", Colors.GREEN), + "3": ("水灵根", "水", "💧 灵力充沛,法术威力大", Colors.CYAN), + "4": ("火灵根", "火", "🔥 爆发力强,炼丹天赋佳", Colors.RED), + "5": ("土灵根", "土", "🗿 防御力强,根基扎实", Colors.YELLOW), + "6": ("雷灵根", "雷", "⚡ 速度极快,天劫抗性高", Colors.BRIGHT_BLUE), + "7": ("混沌灵根", "混沌", "🌌 万法皆通,天资卓绝", Colors.BRIGHT_MAGENTA) } - for key, (name_root, _) in spirit_roots.items(): - print(f"{key}. {name_root}") + for key, (name_root, _, desc, color) in spirit_roots.items(): + print_colored(f"{key}. {name_root} - {desc}", color) - choice = get_user_choice("请选择(1-7): ", ["1", "2", "3", "4", "5", "6", "7"]) + choice = get_user_choice("\n🎯 请选择灵根(1-7): ", ["1", "2", "3", "4", "5", "6", "7"]) spirit_root = spirit_roots[choice][1] + spirit_name = spirit_roots[choice][0] + spirit_color = spirit_roots[choice][3] self.player = Player(name, spirit_root) - clear_screen() - print(f"=== {name} 的修仙之路开始了 ===\n") - print(f"灵根属性: {spirit_root}灵根") - print(f"修为境界: {self.player.realm}") - print(f"当前等级: {self.player.level}") + print_title("角色创建完成", f"{name}的修仙之路") + + # 显示角色信息 + character_info = f""" +🎭 道号: {name} +{spirit_roots[choice][3]}{spirit_roots[choice][2]} 灵根: {spirit_name}{Colors.RESET} +🏆 修为境界: {self.player.realm} +⭐ 当前等级: Lv.{self.player.level} +💎 初始灵石: {self.player.spirit_stones} + +{spirit_roots[choice][2]}""" + + print_box(character_info, 50, Colors.BRIGHT_GREEN) # 生成开场场景 - background_scenario = f"道号{name}的修仙者,拥有{spirit_root}灵根,刚刚踏上修仙之路。在这个充满机遇与危险的修仙世界中,你的故事即将开始..." - print("\n你的修仙之路:") - print_slowly(background_scenario, self.config["game"]["text_speed"]) + background_text = f""" +{Colors.BRIGHT_WHITE}✨ 修仙之路的开始 ✨ + +道号{Colors.BRIGHT_YELLOW}{name}{Colors.BRIGHT_WHITE}的修仙者,天生具备{spirit_color}{spirit_name}{Colors.BRIGHT_WHITE}, +在这个机缘与危险并存的修仙世界中踏出了第一步。 + +前路虽然充满未知,但你的仙道之心已然点燃, +无论是闭关修炼、探索秘境,还是炼制丹药, +每一个选择都将影响你的修仙道路... + +愿你在这条逆天之路上,能够一路披荆斩棘, +最终证道成仙,傲立九天之上!{Colors.RESET}""" - input("\n按回车键开始修仙之路...") + print_slowly(background_text, self.config["game"]["text_speed"]) + wait_for_input("\n🌟 按回车键踏上修仙之路...") def main_menu(self): """主菜单""" - clear_screen() - self.show_player_status() - - print("\n=== 主菜单 ===") - print("1. 闭关修炼") - print("2. 探索秘境") - print("3. 炼制丹药") - print("4. 修炼功法") - print("5. 查看背包") - print("6. 修仙求道(AI指导)") - print("7. 保存游戏") - print("8. 退出游戏") - - choice = get_user_choice("请选择操作(1-8): ", + print_title("修仙界", f"{self.player.name}的修仙之路") + + # 显示状态面板 + print_status_panel(self.player) + + # 主菜单选项 + menu_options = [ + "闭关修炼 - 提升修为,感悟天道", + "探索秘境 - 寻找机缘,获得宝物", + "炼制丹药 - 炼制各种丹药,提升实力", + "修炼功法 - 学习强大功法,增强战力", + "查看背包 - 管理你的宝物和丹药", + "修仙求道 - AI仙师指导修炼", + "保存游戏 - 保存当前进度", + "退出游戏 - 暂别修仙世界" + ] + + print_menu("主菜单", menu_options) + + choice = get_user_choice("🎯 请选择你的行动(1-8): ", ["1", "2", "3", "4", "5", "6", "7", "8"]) if choice == "1": @@ -154,38 +190,31 @@ class XiuxianSimulator: elif choice == "8": self.quit_game() - def show_player_status(self): - """显示玩家状态""" - print(f"道号: {self.player.name}") - print(f"境界: {self.player.realm}") - print(f"等级: {self.player.level}") - print(f"经验: {self.player.experience}/{self.player.experience_needed}") - print(f"生命: {self.player.health}/{self.player.max_health}") - print(f"灵力: {self.player.mana}/{self.player.max_mana}") - print(f"灵根: {self.player.spirit_root}灵根") - print(f"灵石: {self.player.spirit_stones}") - def meditation(self): """闭关修炼""" - clear_screen() - print("=== 闭关修炼 ===\n") + print_title("闭关修炼", "静心修炼,感悟天道") + + print_colored("🧘‍♂️ 你选择了闭关修炼,进入深度冥想状态...", Colors.BRIGHT_CYAN) + print_divider() # 生成AI驱动的修炼场景 scenario = self.ai.generate_meditation_scenario( self.player.name, self.player.realm, self.player.spirit_root, self.player.level ) - print_slowly(scenario["description"], self.config["game"]["text_speed"]) + print_slowly(scenario["description"], self.config["game"]["text_speed"], Colors.BRIGHT_WHITE) # 显示选择 - print("\n你的选择:") + print_divider() + print_colored("\n💭 你的选择:", Colors.BRIGHT_YELLOW) choices = scenario["choices"] for i, choice in enumerate(choices, 1): - print(f"{i}. {choice['text']}") + icon = "🔥" if "激进" in choice['text'] else "🌊" if "稳健" in choice['text'] else "⚡" + print_colored(f"{icon} {i}. {choice['text']}", Colors.WHITE) # 获取玩家选择 choice_options = [str(i) for i in range(1, len(choices) + 1)] - player_choice = get_user_choice(f"请选择(1-{len(choices)}): ", choice_options) + player_choice = get_user_choice(f"\n🎯 请选择修炼方式(1-{len(choices)}): ", choice_options) selected_choice = choices[int(player_choice) - 1] # 处理选择结果 @@ -193,64 +222,81 @@ class XiuxianSimulator: # 检查是否升级或突破境界 if self.player.check_level_up(): - print(f"\n恭喜!你升级了!当前等级: {self.player.level}") + print_success(f"恭喜!你的修为精进了!当前等级: Lv.{self.player.level}") if self.player.check_realm_breakthrough(): - print("\n=== 境界突破 ===") - print_slowly(f"天地风云变色!你成功突破到{self.player.realm}境界!", self.config["game"]["text_speed"]) + print_title("境界突破", "天地异象,境界提升") + breakthrough_text = f""" +🌟 天地风云变色!雷鸣阵阵! + +{Colors.BRIGHT_YELLOW}{self.player.name}{Colors.BRIGHT_WHITE}历经千辛万苦,终于突破桎梏, +成功晋升至{Colors.BRIGHT_MAGENTA}{self.player.realm}{Colors.BRIGHT_WHITE}境界! + +天道有感,降下甘露,滋润你的肉身和神魂, +你感觉到前所未有的力量在体内流淌... + +🏆 境界提升奖励: +💚 生命值大幅提升 +💙 灵力大幅增强 +💎 获得丰厚灵石奖励""" + + print_box(breakthrough_text, 60, Colors.BRIGHT_GOLD) - input("\n按回车键继续...") + wait_for_input() def explore(self): """探索秘境""" - clear_screen() - print("=== 探索秘境 ===\n") + print_title("探索秘境", "踏遍千山万水,寻觅天地机缘") # 选择探索地点 locations = { - "1": "深山老林", - "2": "古老洞府", - "3": "仙人遗迹", - "4": "灵气山峰", - "5": "神秘峡谷" + "1": ("深山老林", "🌲", "原始森林,危机四伏但宝物丰富"), + "2": ("古老洞府", "🏛️", "前人洞府遗址,可能有珍贵传承"), + "3": ("仙人遗迹", "✨", "传说中仙人居所,机缘造化无穷"), + "4": ("灵气山峰", "⛰️", "灵气浓郁之地,修炼事半功倍"), + "5": ("神秘峡谷", "🏜️", "诡异莫测峡谷,凶险与机遇并存") } - print("请选择探索地点:") - for key, location in locations.items(): - print(f"{key}. {location}") + print_colored("🗺️ 请选择你要探索的地点:", Colors.BRIGHT_YELLOW) + for key, (location, icon, desc) in locations.items(): + print_colored(f"{icon} {key}. {location} - {desc}", Colors.WHITE) - choice = get_user_choice("请选择(1-5): ", ["1", "2", "3", "4", "5"]) - location = locations[choice] + choice = get_user_choice("\n🎯 请选择探索地点(1-5): ", ["1", "2", "3", "4", "5"]) + location_name, location_icon, location_desc = locations[choice] - print(f"\n你选择探索{location}...") - print_slowly("正在前往目的地...", 0.1) + print_divider() + print_colored(f"\n{location_icon} 你选择探索{location_name}...", Colors.BRIGHT_CYAN) + print_slowly("🚶‍♂️ 踏上未知的道路,前往目的地...", 0.02, Colors.DIM) # 生成AI驱动的探索场景 scenario = self.ai.generate_exploration_scenario( self.player.name, self.player.realm, self.player.spirit_root, - self.player.level, location + self.player.level, location_name ) - print(f"\n{scenario['description']}") + print_divider() + print_slowly(f"\n{scenario['description']}", self.config["game"]["text_speed"], Colors.BRIGHT_WHITE) # 显示选择 - print("\n你的选择:") + print_divider() + print_colored("\n🤔 面对此情此景,你的选择:", Colors.BRIGHT_YELLOW) choices = scenario["choices"] for i, choice in enumerate(choices, 1): - print(f"{i}. {choice['text']}") + icon = "🏃" if "逃" in choice['text'] or "离开" in choice['text'] else "⚔️" if "战" in choice['text'] or "斗" in choice['text'] else "🔍" if "探" in choice['text'] or "查" in choice['text'] else "💰" + print_colored(f"{icon} {i}. {choice['text']}", Colors.WHITE) # 获取玩家选择 choice_options = [str(i) for i in range(1, len(choices) + 1)] - player_choice = get_user_choice(f"请选择(1-{len(choices)}): ", choice_options) + player_choice = get_user_choice(f"\n🎯 请选择行动方案(1-{len(choices)}): ", choice_options) selected_choice = choices[int(player_choice) - 1] # 处理选择结果 self.process_choice(selected_choice) # 记录到世界历史 - self.world.add_event(f"{self.player.name}在{location}探索,选择了:{selected_choice['text']}") + self.world.add_event(f"{self.player.name}在{location_name}探索,选择了:{selected_choice['text']}") - input("\n按回车键继续...") + wait_for_input() def process_choice(self, choice): """处理玩家选择的结果""" @@ -259,38 +305,51 @@ class XiuxianSimulator: # 使用AI生成结果描述 result_description = self.ai.process_choice_result(choice, self.player.name) - print(f"\n{result_description}") + print_divider() + print_slowly(f"\n{result_description}", self.config["game"]["text_speed"], Colors.BRIGHT_WHITE) # 根据结果类型给予奖励 if result_type == "experience": exp = value if isinstance(value, int) else 30 self.player.gain_experience(exp) - print(f"你获得了 {exp} 点修炼经验!") + print_success(f"修为精进!获得 {exp} 点修炼经验") elif result_type == "spirit_stones": stones = value if isinstance(value, int) else 50 self.player.spirit_stones += stones - print(f"你获得了 {stones} 枚灵石!") + print_success(f"财富增长!获得 {stones} 枚灵石") elif result_type == "treasure": item = value if isinstance(value, str) else "神秘宝物" self.player.add_item(item) - print(f"你获得了珍贵的 {item}!") + print_success(f"宝物入手!获得珍贵的 {item}") elif result_type == "health": hp = value if isinstance(value, int) else 20 + old_health = self.player.health self.player.health = min(self.player.max_health, self.player.health + hp) - print(f"你恢复了 {hp} 点生命值!") + actual_heal = self.player.health - old_health + print_success(f"气血恢复!恢复 {actual_heal} 点生命值") elif result_type == "mana": mana = value if isinstance(value, int) else 15 + old_mana = self.player.mana self.player.restore_mana(mana) - print(f"你恢复了 {mana} 点灵力!") + actual_restore = self.player.mana - old_mana + print_success(f"灵力充盈!恢复 {actual_restore} 点灵力") elif result_type == "technique": technique = value if isinstance(value, str) else "无名心法" self.player.learn_technique(technique) - print(f"你学会了 {technique}!") + + technique_info = f""" +🎉 恭喜!你领悟了新的功法! + +📜 功法名称: {technique} +✨ 你感受到体内气息流转,实力得到了提升 +🌟 从此你的修仙道路又多了一条康庄大道""" + + print_box(technique_info, 50, Colors.BRIGHT_MAGENTA) elif result_type == "battle": enemy_info = value if isinstance(value, dict) else { @@ -302,9 +361,9 @@ class XiuxianSimulator: loss = value if isinstance(value, int) else 50 if self.player.spirit_stones >= loss: self.player.spirit_stones -= loss - print(f"你失去了 {loss} 枚灵石...") + print_warning(f"损失灵石 {loss} 枚,财富有所减少...") else: - print("你的灵石不够,只能黯然离去...") + print_error("灵石不足,只能黯然离去...") elif result_type == "alchemy_success": success_rate = value if isinstance(value, float) else 0.6 @@ -312,13 +371,31 @@ class XiuxianSimulator: pills = ["回气丹", "疗伤丹", "筑基丹", "凝神丹"] pill = random.choice(pills) self.player.add_item(pill) - print(f"炼制成功!获得了 {pill}!") + + alchemy_success = f""" +🧪 炼丹成功! + +丹炉中紫气升腾,香气扑鼻而来, +你成功炼制出了珍贵的{pill}! + +这枚丹药品质上乘,对修炼大有裨益。""" + + print_box(alchemy_success, 50, Colors.BRIGHT_GREEN) else: - print("炼制失败,药材化为了灰烬...") + print_error("炼制失败,药材在烈火中化为了灰烬...") def ai_battle(self, enemy_info): """AI驱动的战斗""" - print(f"\n=== 战斗开始: {enemy_info['name']} ===") + print_title("战斗开始", f"对战 {enemy_info['name']}") + + # 显示敌人信息 + enemy_display = f""" +⚔️ 敌人: {enemy_info['name']} +💪 威胁等级: {"★" * enemy_info.get('level', 1)} +🩸 生命值: {enemy_info.get('hp', 100)} +📝 特征: {enemy_info.get('description', '神秘莫测的敌人')}""" + + print_box(enemy_display, 60, Colors.BRIGHT_RED) # 生成战斗场景 battle_scenario = self.ai.generate_battle_scenario( @@ -326,17 +403,20 @@ class XiuxianSimulator: self.player.level, enemy_info ) - print(f"\n{battle_scenario['description']}") + print_divider() + print_slowly(f"\n{battle_scenario['description']}", self.config["game"]["text_speed"], Colors.BRIGHT_WHITE) # 显示战斗选择 - print("\n你的战斗策略:") + print_divider() + print_colored("\n⚔️ 选择你的战斗策略:", Colors.BRIGHT_YELLOW) choices = battle_scenario["choices"] for i, choice in enumerate(choices, 1): - print(f"{i}. {choice['text']}") + icon = "🔥" if "激进" in choice['text'] or "猛攻" in choice['text'] else "🛡️" if "防御" in choice['text'] or "守" in choice['text'] else "🏃" if "逃" in choice['text'] else "⚡" + print_colored(f"{icon} {i}. {choice['text']}", Colors.WHITE) # 获取玩家选择 choice_options = [str(i) for i in range(1, len(choices) + 1)] - player_choice = get_user_choice(f"请选择(1-{len(choices)}): ", choice_options) + player_choice = get_user_choice(f"\n🎯 请选择战斗策略(1-{len(choices)}): ", choice_options) selected_choice = choices[int(player_choice) - 1] # 处理战斗结果 @@ -423,79 +503,104 @@ class XiuxianSimulator: def alchemy(self): """炼制丹药""" - clear_screen() - print("=== 炼制丹药 ===\n") + print_title("炼制丹药", "焚香静气,炼化天地精华") - if self.player.spirit_stones < 50: - print("灵石不足!炼制丹药需要50灵石。") - input("按回车键继续...") + required_stones = 50 + if self.player.spirit_stones < required_stones: + error_msg = f""" +❌ 灵石不足! + +💎 当前灵石: {self.player.spirit_stones} +💰 炼丹费用: {required_stones} +📝 炼制丹药需要充足的灵石作为材料费用""" + + print_box(error_msg, 50, Colors.BRIGHT_RED) + wait_for_input() return - self.player.spirit_stones -= 50 - print("你消耗了50枚灵石准备炼制丹药...") + self.player.spirit_stones -= required_stones + + cost_info = f""" +🧪 开始炼丹 + +💰 消耗灵石: {required_stones} +💎 剩余灵石: {self.player.spirit_stones} + +你点燃香炉,准备各种珍贵药材, +开始了神秘的炼丹过程...""" + + print_box(cost_info, 50, Colors.BRIGHT_CYAN) + print_divider() # 生成AI驱动的炼丹场景 scenario = self.ai.generate_alchemy_scenario( self.player.name, self.player.realm, self.player.spirit_root ) - print(f"\n{scenario['description']}") + print_slowly(f"\n{scenario['description']}", self.config["game"]["text_speed"], Colors.BRIGHT_WHITE) # 显示选择 - print("\n你的选择:") + print_divider() + print_colored("\n🔥 炼丹策略选择:", Colors.BRIGHT_YELLOW) choices = scenario["choices"] for i, choice in enumerate(choices, 1): - print(f"{i}. {choice['text']}") + icon = "🌡️" if "温火" in choice['text'] or "慢" in choice['text'] else "🔥" if "烈火" in choice['text'] or "猛" in choice['text'] else "⚗️" + print_colored(f"{icon} {i}. {choice['text']}", Colors.WHITE) # 获取玩家选择 choice_options = [str(i) for i in range(1, len(choices) + 1)] - player_choice = get_user_choice(f"请选择(1-{len(choices)}): ", choice_options) + player_choice = get_user_choice(f"\n🎯 请选择炼制方法(1-{len(choices)}): ", choice_options) selected_choice = choices[int(player_choice) - 1] # 处理选择结果 self.process_choice(selected_choice) - input("按回车键继续...") + wait_for_input() def practice_technique(self): """修炼功法""" - clear_screen() - print("=== 修炼功法 ===\n") + print_title("修炼功法", "参悟天地玄机,掌握无上神通") techniques = { - "1": "基础吐纳术", - "2": "五行调息法", - "3": "太极混元功", - "4": "九转玄功" + "1": ("基础吐纳术", "🌬️", "入门级心法,调息养气,固本培元"), + "2": ("五行调息法", "🌟", "中级心法,调和五行,平衡体内元气"), + "3": ("太极混元功", "☯️", "高级心法,阴阳调和,内外兼修"), + "4": ("九转玄功", "🔮", "顶级心法,九转归一,直指大道本源") } - print("可修炼的功法:") - for key, technique in techniques.items(): - print(f"{key}. {technique}") + print_colored("📚 可修炼的功法:", Colors.BRIGHT_MAGENTA) + for key, (technique, icon, desc) in techniques.items(): + # 检查是否已经学会 + status = "✅ 已掌握" if technique in self.player.techniques else "🆕 可学习" + print_colored(f"{icon} {key}. {technique} - {desc} ({status})", Colors.WHITE) - choice = get_user_choice("选择要修炼的功法(1-4): ", ["1", "2", "3", "4"]) - technique_name = techniques[choice] + choice = get_user_choice("\n🎯 选择要修炼的功法(1-4): ", ["1", "2", "3", "4"]) + technique_name, technique_icon, technique_desc = techniques[choice] - print(f"\n你开始修炼 {technique_name}...") - print_slowly("进入修炼状态...", 0.1) + print_divider() + print_colored(f"\n{technique_icon} 开始修炼 {technique_name}...", Colors.BRIGHT_CYAN) + print_slowly("🧘‍♂️ 盘膝而坐,进入深度修炼状态...", 0.02, Colors.DIM) # 生成功法修炼场景(类似修炼场景) scenario = self.ai.generate_meditation_scenario( self.player.name, self.player.realm, self.player.spirit_root, self.player.level ) - print(f"\n在修炼{technique_name}的过程中...") - print(f"{scenario['description']}") + print_divider() + print_colored(f"\n在修炼{technique_name}的过程中:", Colors.BRIGHT_WHITE) + print_slowly(f"{scenario['description']}", self.config["game"]["text_speed"], Colors.BRIGHT_WHITE) # 显示选择 - print("\n你的修炼方向:") + print_divider() + print_colored("\n💭 选择修炼方向:", Colors.BRIGHT_YELLOW) choices = scenario["choices"] for i, choice in enumerate(choices, 1): - print(f"{i}. {choice['text']}") + icon = "🔥" if "激进" in choice['text'] else "🌊" if "稳健" in choice['text'] else "⚡" + print_colored(f"{icon} {i}. {choice['text']}", Colors.WHITE) # 获取玩家选择 choice_options = [str(i) for i in range(1, len(choices) + 1)] - player_choice = get_user_choice(f"请选择(1-{len(choices)}): ", choice_options) + player_choice = get_user_choice(f"\n🎯 请选择修炼方式(1-{len(choices)}): ", choice_options) selected_choice = choices[int(player_choice) - 1] # 处理选择结果 @@ -504,46 +609,132 @@ class XiuxianSimulator: # 学会功法 if technique_name not in self.player.techniques: self.player.learn_technique(technique_name) - print(f"\n恭喜!你成功掌握了 {technique_name}!") + + mastery_text = f""" +🎉 功法修炼成功! + +📜 你成功掌握了 {technique_name}! +✨ {technique_desc} +🌟 你感觉到体内气息运转更加顺畅, + 修炼效率得到了显著提升!""" + + print_box(mastery_text, 60, Colors.BRIGHT_GREEN) else: - print(f"\n你在 {technique_name} 上的造诣更加深厚了!") + improvement_text = f""" +📈 功法精进! + +你在 {technique_name} 上的造诣更加深厚了! +对此功法的理解又上了一个台阶。""" + + print_box(improvement_text, 50, Colors.BRIGHT_CYAN) - input("按回车键继续...") + wait_for_input() def show_inventory(self): """显示背包""" - clear_screen() - print("=== 储物袋 ===\n") + print_title("储物袋", "查看你的珍贵收藏") + # 显示物品 + print_colored("🎒 物品列表:", Colors.BRIGHT_YELLOW) if not self.player.inventory: - print("储物袋空空如也...") + empty_msg = """ +📦 储物袋空空如也... + +还没有收集到任何宝物, +快去探索秘境寻找机缘吧!""" + print_box(empty_msg, 50, Colors.DIM) else: - print("物品列表:") - for i, item in enumerate(self.player.inventory, 1): - print(f"{i}. {item}") + # 按类型分类显示物品 + item_types = { + "丹药": ["丹", "药"], + "法器": ["剑", "器", "法器"], + "材料": ["矿", "石", "草", "材料"], + "其他": [] + } + + categorized_items = {category: [] for category in item_types} + + for item in self.player.inventory: + found_category = False + for category, keywords in item_types.items(): + if category == "其他": + continue + if any(keyword in item for keyword in keywords): + categorized_items[category].append(item) + found_category = True + break + if not found_category: + categorized_items["其他"].append(item) + + for category, items in categorized_items.items(): + if items: + icons = {"丹药": "💊", "法器": "⚔️", "材料": "🌿", "其他": "📦"} + print_colored(f"\n {icons[category]} {category}:", Colors.BRIGHT_CYAN) + for item in items: + print_colored(f" • {item}", Colors.WHITE) - print(f"\n已修炼功法:") + print_divider() + + # 显示功法 + print_colored("📚 已修炼功法:", Colors.BRIGHT_MAGENTA) if not self.player.techniques: - print("尚未修炼任何功法") + no_technique_msg = """ +📖 尚未修炼任何功法 + +功法是修仙者的根本, +快去修炼一些强大的功法吧!""" + print_box(no_technique_msg, 50, Colors.DIM) else: + technique_icons = { + "基础吐纳术": "🌬️", + "五行调息法": "🌟", + "太极混元功": "☯️", + "九转玄功": "🔮" + } + for technique in self.player.techniques: - print(f"- {technique}") + icon = technique_icons.get(technique, "📜") + print_colored(f" {icon} {technique}", Colors.WHITE) - input("\n按回车键继续...") + wait_for_input() def ai_guidance(self): """AI修仙指导""" - clear_screen() - print("=== 修仙求道 ===\n") - print("一位神秘的前辈现身,愿意为你答疑解惑...") + print_title("修仙求道", "智者解惑,指点迷津") + + guidance_intro = f""" +🧙‍♂️ 仙师现身 + +云雾缥缈中,一位白发苍苍的仙师现身, +他的双眼如星辰般深邃,仿佛看透了天地万物。 + +"道友有何疑惑,老夫愿为你指点迷津..." + +当前状态: +🎭 道号: {self.player.name} +🏆 境界: {self.player.realm} +⭐ 等级: Lv.{self.player.level} +🌈 灵根: {self.player.spirit_root}灵根""" + + print_box(guidance_intro, 70, Colors.BRIGHT_CYAN) + + print_colored("\n💭 请向仙师请教修仙问题:", Colors.BRIGHT_YELLOW) + question = input(">>> ").strip() - question = input("\n请向前辈请教修仙问题: ").strip() if not question: - print("你静静地思考着,没有提出问题...") - input("按回车键继续...") + no_question_msg = """ +🤔 你静静地思考着... + +虽然心中有许多疑惑,但一时间不知从何问起。 +仙师微微一笑:"有疑问时,随时可来求教。\"""" + + print_box(no_question_msg, 60, Colors.DIM) + wait_for_input() return - print("\n前辈思索片刻,缓缓开口...") + print_divider() + print_colored("🧙‍♂️ 仙师沉思片刻,缓缓开口...", Colors.BRIGHT_CYAN) + print_divider() # 获取AI回答 guidance = self.ai.get_cultivation_guidance( @@ -551,11 +742,33 @@ class XiuxianSimulator: self.player.level, self.player.techniques ) - print_slowly(guidance, 0.05) - input("\n按回车键继续...") + print_slowly(guidance, 0.03, Colors.BRIGHT_WHITE) + + wisdom_footer = """ +✨ 仙师的话语如醍醐灌顶,让你受益匪浅。 +💫 你感觉对修仙之道的理解更加深刻了。""" + + print_divider() + print_colored(wisdom_footer, Colors.BRIGHT_MAGENTA) + + wait_for_input() def save_game(self): """保存游戏""" + print_title("保存游戏", "记录你的修仙历程") + + save_info = f""" +💾 正在保存游戏进度... + +🎭 道号: {self.player.name} +🏆 境界: {self.player.realm} +⭐ 等级: Lv.{self.player.level} +💎 灵石: {self.player.spirit_stones} +📦 物品数量: {len(self.player.inventory)} +📚 功法数量: {len(self.player.techniques)}""" + + print_box(save_info, 60, Colors.BRIGHT_CYAN) + save_data = { "player": self.player.to_dict(), "world": self.world.to_dict() @@ -564,11 +777,24 @@ class XiuxianSimulator: try: with open("save_game.json", "w", encoding="utf-8") as f: json.dump(save_data, f, ensure_ascii=False, indent=2) - print("游戏保存成功!") + + success_msg = """ +✅ 游戏保存成功! + +你的修仙历程已经记录在天道轮回之中, +下次可以继续你的仙途之路。""" + + print_box(success_msg, 50, Colors.BRIGHT_GREEN) except Exception as e: - print(f"保存失败: {e}") + error_msg = f""" +❌ 保存失败! + +错误信息: {e} +请检查文件权限或磁盘空间。""" + + print_box(error_msg, 50, Colors.BRIGHT_RED) - input("按回车键继续...") + wait_for_input() def load_game(self): """加载游戏""" @@ -588,14 +814,39 @@ class XiuxianSimulator: def quit_game(self): """退出游戏""" - print("\n是否保存游戏?") - save_choice = get_user_choice("(y/n): ", ["y", "n", "Y", "N"]) + print_title("告别仙界", "暂别修仙世界") + + farewell_msg = f""" +🌟 {self.player.name} 的修仙之路暂时告一段落... + +📊 本次修仙成就: +🏆 最高境界: {self.player.realm} +⭐ 达到等级: Lv.{self.player.level} +💎 累积灵石: {self.player.spirit_stones} +📦 收集物品: {len(self.player.inventory)} 件 +📚 掌握功法: {len(self.player.techniques)} 种 + +💾 是否保存当前进度?""" + + print_box(farewell_msg, 60, Colors.BRIGHT_CYAN) + + save_choice = get_user_choice("🎯 保存游戏?(y/n): ", ["y", "n", "Y", "N"]) if save_choice.lower() == "y": self.save_game() - print("\n感谢游玩《修仙模拟器》!") - print("愿你在修仙之路上勇猛精进!") + final_msg = f""" +✨ 感谢游玩《修仙模拟器》! + +🌈 愿你在现实中也能找到属于自己的道路, + 继续追寻心中的那份仙缘... + +仙途漫漫,来日再会! +愿你在修仙之路上勇猛精进! + +👋 再见!""" + + print_box(final_msg, 60, Colors.BRIGHT_MAGENTA) self.running = False diff --git a/start.py b/start.py index c5bd08ed25812035a57192b78301d9e1b643d673..dc1c3c9f7eeb3feb22a07fb1ba0c29b7c7ef0d18 100644 --- a/start.py +++ b/start.py @@ -9,29 +9,89 @@ import sys def main(): """主函数""" - print("🌟 修仙模拟器 🌟") - print("正在启动游戏...") + # 导入颜色工具 + try: + from game.utils import print_title, print_box, print_colored, print_success, print_error, Colors, wait_for_input + except ImportError: + # 如果无法导入,使用简单的打印 + def print_title(title, subtitle=""): + print(f"\n=== {title} ===") + if subtitle: + print(f"{subtitle}") + + def print_box(text, width=60, color=""): + lines = text.strip().split('\n') + for line in lines: + print(line) + + def print_colored(text, color=""): + print(text) + + def print_success(text): + print(f"✅ {text}") + + def print_error(text): + print(f"❌ {text}") + + def wait_for_input(prompt="按回车键继续..."): + input(prompt) + + class Colors: + BRIGHT_CYAN = "" + BRIGHT_GREEN = "" + BRIGHT_RED = "" + + print_title("修仙模拟器启动器", "开启你的仙途之路") + + startup_info = """ +🌟 欢迎使用修仙模拟器! + +这是一个基于文本的修仙模拟游戏, +你将体验从凡人到仙人的完整修炼历程。 + +🎮 游戏特色: +• 丰富的修仙系统 (练气、筑基、结丹...) +• AI驱动的剧情生成 +• 多样的灵根选择 +• 功法修炼与丹药炼制 +• 秘境探索与战斗系统 + +正在检查游戏环境...""" + + print_box(startup_info, 60, Colors.BRIGHT_CYAN) # 检查配置文件 if not os.path.exists("config.json"): - print("\n首次运行游戏,需要进行配置...") - print("正在启动配置向导...") + print_colored("\n🔧 首次运行检测到,需要进行配置...", Colors.BRIGHT_GREEN) + print_colored("正在启动配置向导...", Colors.BRIGHT_GREEN) try: import setup setup.main() except Exception as e: - print(f"配置失败: {e}") - print("请手动运行: python setup.py") + print_error(f"配置失败: {e}") + print_colored("请手动运行: python setup.py", Colors.BRIGHT_RED) + wait_for_input() return # 启动游戏 try: + print_success("环境检查完成,正在启动游戏...") import main main.main() except Exception as e: - print(f"游戏启动失败: {e}") - print("请检查依赖是否安装: pip install -r requirements.txt") + error_msg = f""" +❌ 游戏启动失败! + +错误信息: {e} + +🔧 解决方案: +1. 检查依赖是否安装: pip install -r requirements.txt +2. 确保Python版本 >= 3.7 +3. 检查文件权限 +""" + print_box(error_msg, 60, Colors.BRIGHT_RED) + wait_for_input() if __name__ == "__main__": main() \ No newline at end of file diff --git a/test_ui.py b/test_ui.py new file mode 100644 index 0000000000000000000000000000000000000000..9f9dd441926dc8a220801154dfe68597006f744c --- /dev/null +++ b/test_ui.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +UI界面测试脚本 - 展示优化后的界面效果 +""" + +import sys +import os + +# 添加项目根目录到路径 +sys.path.append(os.path.dirname(os.path.abspath(__file__))) + +from game.utils import ( + print_title, print_box, print_menu, print_status_panel, + print_colored, print_success, print_error, print_warning, print_info, + print_divider, show_progress_bar, wait_for_input, Colors +) +from game.player import Player + +def test_ui_components(): + """测试UI组件""" + + # 测试标题 + print_title("修仙模拟器UI测试", "展示美化后的界面效果") + + # 测试信息框 + intro_text = """ +✨ 界面优化完成! + +🎨 新增功能: +• 彩色文本显示 +• 美化的边框和进度条 +• 图标和表情符号 +• 更好的信息布局 +• 沉浸式的游戏体验 + +让我们来看看效果吧!""" + + print_box(intro_text, 60, Colors.BRIGHT_CYAN) + wait_for_input() + + # 测试菜单 + menu_options = [ + "闭关修炼 - 提升修为,感悟天道", + "探索秘境 - 寻找机缘,获得宝物", + "炼制丹药 - 炼制各种丹药,提升实力", + "修炼功法 - 学习强大功法,增强战力" + ] + print_menu("主菜单预览", menu_options) + wait_for_input() + + # 测试状态面板 + test_player = Player("测试道友", "混沌") + test_player.level = 15 + test_player.experience = 750 + test_player.spirit_stones = 2580 + test_player.health = 180 + test_player.max_health = 200 + test_player.mana = 95 + test_player.max_mana = 120 + + print_colored("🎭 角色状态面板预览:", Colors.BRIGHT_YELLOW) + print_status_panel(test_player) + wait_for_input() + + # 测试进度条 + print_colored("📊 进度条效果预览:", Colors.BRIGHT_YELLOW) + print_colored(f"🧘‍♂️ 修炼进度: {show_progress_bar(750, 1000)}", Colors.WHITE) + print_colored(f"⚔️ 战斗进度: {show_progress_bar(300, 400)}", Colors.WHITE) + print_colored(f"🔥 炼丹进度: {show_progress_bar(80, 100)}", Colors.WHITE) + wait_for_input() + + # 测试消息类型 + print_colored("💬 消息类型预览:", Colors.BRIGHT_YELLOW) + print_success("修炼成功!获得100点经验值") + print_error("灵石不足,无法进行炼丹") + print_warning("前方有强敌出没,请小心!") + print_info("你发现了一个神秘的洞府") + wait_for_input() + + # 测试分割线 + print_divider() + print_colored("🎉 界面优化测试完成!", Colors.BRIGHT_MAGENTA) + print_divider() + + final_msg = """ +✅ 界面优化测试完成! + +🌟 优化成果: +• 彩色界面,视觉效果更佳 +• 图标化菜单,操作更直观 +• 美化的状态面板 +• 丰富的视觉反馈 +• 沉浸式的游戏体验 + +现在可以启动完整的游戏体验优化后的界面了! + +运行命令: python start.py""" + + print_box(final_msg, 60, Colors.BRIGHT_GREEN) + +if __name__ == "__main__": + test_ui_components() \ No newline at end of file