diff --git a/GUI/CheckUpdatePanel.gd b/GUI/CheckUpdatePanel.gd index 7598149..51430b4 100644 --- a/GUI/CheckUpdatePanel.gd +++ b/GUI/CheckUpdatePanel.gd @@ -5,7 +5,7 @@ extends Control # 配置 const GAME_ID = "mengyafarm" -const SERVER_URL = "http://47.108.90.0:5000" +const SERVER_URL = "https://app.shumengya.top" const CURRENT_VERSION = GlobalVariables.client_version # 更新信息 @@ -133,8 +133,7 @@ func _on_download_button_pressed() -> void: show_message("无法打开浏览器,下载链接已复制到剪贴板") else: show_message("正在打开下载页面...") - # 可选:隐藏更新面板 - self.hide() + # 关闭更新面板 func _on_close_button_pressed() -> void: diff --git a/GUI/MainMenuPanel.gd b/GUI/MainMenuPanel.gd index d5eab75..cf7a144 100644 --- a/GUI/MainMenuPanel.gd +++ b/GUI/MainMenuPanel.gd @@ -18,6 +18,7 @@ func SetGameVersionLabel(version :String): #开始游戏 func _on_start_game_button_pressed() -> void: + await get_tree().process_frame get_tree().change_scene_to_file('res://MainGame.tscn') pass diff --git a/GUI/MainMenuPanel.tscn b/GUI/MainMenuPanel.tscn index a56bc9c..49e22c2 100644 --- a/GUI/MainMenuPanel.tscn +++ b/GUI/MainMenuPanel.tscn @@ -106,6 +106,12 @@ offset_left = 896.0 offset_top = 205.0 offset_right = 1226.0 offset_bottom = 247.0 +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/shadow_offset_x = 4 +theme_override_constants/shadow_offset_y = 4 +theme_override_constants/outline_size = 15 +theme_override_constants/shadow_outline_size = 0 theme_override_font_sizes/font_size = 30 text = "加群获取最新开发动态!" @@ -142,7 +148,16 @@ offset_left = -896.0 offset_top = -47.0 offset_right = -420.0 offset_bottom = -7.0 +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 15 +theme_override_constants/shadow_offset_y = 0 +theme_override_constants/shadow_offset_x = 0 +theme_override_constants/shadow_outline_size = 0 +theme_override_font_sizes/bold_italics_font_size = 0 +theme_override_font_sizes/italics_font_size = 0 +theme_override_font_sizes/mono_font_size = 0 theme_override_font_sizes/normal_font_size = 30 +theme_override_font_sizes/bold_font_size = 0 bbcode_enabled = true text = "欢迎了解灵创新媒实验室" horizontal_alignment = 1 @@ -191,7 +206,6 @@ theme_override_font_sizes/font_size = 40 text = "退出游戏" [node name="GameAboutPanel" type="Panel" parent="."] -visible = false layout_mode = 0 offset_left = 138.0 offset_top = 80.0 @@ -241,7 +255,7 @@ size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_colors/font_outline_color = Color(0, 0, 0, 1) theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 20 +theme_override_constants/outline_size = 30 theme_override_constants/shadow_outline_size = 10 theme_override_font_sizes/normal_font_size = 70 bbcode_enabled = true diff --git a/GameManager/WeatherSystem.gd b/GameManager/WeatherSystem.gd index dd3f5fa..89c66aa 100644 --- a/GameManager/WeatherSystem.gd +++ b/GameManager/WeatherSystem.gd @@ -15,12 +15,12 @@ var weather_display_enabled: bool = true # 设置天气的统一方法 func set_weather(weather_type: String): # 检查全局设置和动态设置 - if GlobalVariables.DisableWeatherDisplay or not weather_display_enabled: + if not weather_display_enabled: hide_all_weather() return # 先隐藏所有天气效果 - hide_all_weather() + #hide_all_weather() # 根据天气类型显示对应效果 match weather_type: diff --git a/GlobalScript/GlobalVariables.gd b/GlobalScript/GlobalVariables.gd index 55aceef..8c55725 100644 --- a/GlobalScript/GlobalVariables.gd +++ b/GlobalScript/GlobalVariables.gd @@ -1,16 +1,16 @@ extends Node -const client_version :String = "2.0.1" #记录客户端版本 +const client_version :String = "2.2.0" #记录客户端版本 var isZoomDisabled :bool = false const server_configs = [ #{"host": "127.0.0.1", "port": 6060, "name": "本地"}, #{"host": "192.168.31.233", "port": 6060, "name": "家里面局域网"}, - {"host": "192.168.31.205", "port": 6060, "name": "家里面电脑"}, + #{"host": "192.168.31.205", "port": 6060, "name": "家里面电脑"}, #{"host": "192.168.1.110", "port": 4040, "name": "萌芽局域网"}, #{"host": "47.108.90.0", "port": 4040, "name": "成都内网穿透"}#成都内网穿透 - #{"host": "47.108.90.0", "port": 6060, "name": "成都公网"}#成都服务器 + {"host": "47.108.90.0", "port": 6060, "name": "成都公网"}#成都服务器 ] const DisableWeatherDisplay :bool = false #是否禁止显示天气 diff --git a/MainGame.gd b/MainGame.gd index 225a081..86b2bba 100644 --- a/MainGame.gd +++ b/MainGame.gd @@ -66,7 +66,6 @@ extends Node @onready var login_panel: PanelContainer = $UI/BigPanel/LoginPanel #登录面板 @onready var pet_bag_panel: Panel = $UI/BigPanel/PetBagPanel #宠物背包面板 @onready var pet_store_panel: Panel = $UI/BigPanel/PetStorePanel #宠物商店面板 -@onready var pet_fight_panel: Panel = $UI/BigPanel/PetFightPanel #宠物战斗面板 @onready var pet_inform_panel: Panel = $UI/SmallPanel/PetInformPanel #宠物信息面板 @onready var player_store_panel: Panel = $UI/BigPanel/PlayerStorePanel #玩家小卖部面板 @onready var game_setting_panel: Panel = $UI/BigPanel/GameSettingPanel #游戏设置面板 @@ -83,6 +82,7 @@ extends Node @onready var global_server_broadcast_panel: Panel = $UI/SmallPanel/GlobalServerBroadcastPanel #全服大喇叭面板 @onready var scare_crow_panel: Panel = $UI/SmallPanel/ScareCrowPanel #农场稻草人设置面板 @onready var wisdom_tree_panel: Panel = $UI/SmallPanel/WisdomTreePanel #智慧树设置面板 +@onready var today_divination_panel: PanelContainer = $UI/SmallPanel/TodayDivinationPanel #稻草人系统 @@ -103,6 +103,7 @@ extends Node #各种弹窗 @onready var accept_dialog: AcceptDialog = $UI/DiaLog/AcceptDialog @onready var batch_buy_popup: PanelContainer = $UI/DiaLog/BatchBuyPopup +@onready var escape_dialog: ConfirmationDialog = $UI/DiaLog/EscapeDialog #被宠物发现专用弹窗 @onready var load_progress_bar: ProgressBar = $UI/SmallPanel/LoadProgressPanel/LoadProgressBar #显示加载进度进度条 @@ -129,7 +130,6 @@ extends Node #玩家基本信息 var money: int = 500 # 默认每个人初始为100元 var experience: float = 0.0 # 初始每个玩家的经验为0 -#var grow_speed: float = 1 # 作物生长速度 var level: int = 1 # 初始玩家等级为1 var dig_money : int = 1000 #开垦费用 var stamina: int = 20 # 玩家体力值,默认20点 @@ -137,7 +137,6 @@ var stamina: int = 20 # 玩家体力值,默认20点 var user_name : String = "" var user_password : String = "" var login_data : Dictionary = {} -#var data : Dictionary = {} var start_game : bool = false var remaining_likes : int = 10 # 今日剩余点赞次数 @@ -247,6 +246,7 @@ func _ready(): global_server_broadcast_panel.hide() game_setting_panel.hide() accept_dialog.hide() + escape_dialog.hide() @@ -272,6 +272,9 @@ func _ready(): # 连接AcceptDialog的确认信号 accept_dialog.confirmed.connect(_on_accept_dialog_confirmed) + # 连接EscapeDialog的信号(初始化时不连接具体处理函数,使用时再连接) + # escape_dialog信号将在使用时动态连接 + # 连接宠物对战面板的battle_ended信号 pet_battle_panel.battle_ended.connect(_on_pet_battle_ended) @@ -446,8 +449,9 @@ func _handle_visit_player_response(data): show_player_name.text = "玩家昵称:" + target_player_data.get("玩家昵称", "未知") show_farm_name.text = "农场名称:" + target_player_data.get("农场名称", "未知农场") - # 显示被访问玩家的点赞数 - var target_likes = target_player_data.get("点赞数", 0) + # 显示被访问玩家的点赞数 - 从点赞系统中获取总点赞数 + var target_like_system = target_player_data.get("点赞系统", {}) + var target_likes = target_like_system.get("总点赞数", 0) show_like.text = "点赞数:" + str(int(target_likes)) _update_ui() @@ -531,8 +535,9 @@ func _handle_return_my_farm_response(data): show_player_name.text = "玩家昵称:" + player_data.get("玩家昵称", "未知") show_farm_name.text = "农场名称:" + player_data.get("农场名称", "我的农场") - # 显示自己的点赞数 - var my_likes = player_data.get("点赞数", 0) + # 显示自己的点赞数 - 从点赞系统中获取总点赞数 + var my_like_system = player_data.get("点赞系统", {}) + var my_likes = my_like_system.get("总点赞数", 0) show_like.text = "点赞数:" + str(int(my_likes)) # 退出访问模式 @@ -893,8 +898,9 @@ func _update_ui(): show_experience.text = "经验值:" + str(experience) + " 点" show_level.text = "等级:" + str(level) + " 级" show_hunger_value.text = "体力值:" + str(stamina) - # 显示点赞数 - var my_likes = login_data.get("点赞数", 0) + # 显示点赞数 - 从点赞系统中获取总点赞数 + var like_system = login_data.get("点赞系统", {}) + var my_likes = like_system.get("总点赞数", 0) show_like.text = "点赞数:" + str(int(my_likes)) #打开玩家排行榜面板 @@ -967,6 +973,7 @@ func _on_connection_lost(): global_server_broadcast_panel.hide() land_panel.hide() accept_dialog.hide() + escape_dialog.hide() # 重置访问模式 if is_visiting_mode: @@ -1894,11 +1901,15 @@ func _on_one_click_harvestbutton_pressed() -> void: Toast.show("访问模式下无法使用一键收获", Color.ORANGE) return - # 统计有多少成熟的作物 + # 统计有多少成熟的作物(排除杂草) var mature_crops_count = 0 for lot in farm_lots: if lot["is_diged"] and lot["is_planted"] and not lot.get("is_dead", false): if lot["grow_time"] >= lot["max_grow_time"]: + # 检查是否为杂草,如果是杂草则不计入统计 + var crop_type = lot.get("crop_type", "") + if can_planted_crop.has(crop_type) and can_planted_crop[crop_type].get("是否杂草", false): + continue mature_crops_count += 1 # 如果没有成熟的作物 @@ -1925,6 +1936,7 @@ func _execute_one_click_harvest(): var one_click_cost = 400 var harvested_count = 0 var success_count = 0 + var skipped_weeds_count = 0 # 先扣除费用 money -= one_click_cost @@ -1935,6 +1947,13 @@ func _execute_one_click_harvest(): var lot = farm_lots[i] if lot["is_diged"] and lot["is_planted"] and not lot.get("is_dead", false): if lot["grow_time"] >= lot["max_grow_time"]: + # 检查是否为杂草,如果是杂草则跳过 + var crop_type = lot.get("crop_type", "") + if can_planted_crop.has(crop_type) and can_planted_crop[crop_type].get("是否杂草", false): + skipped_weeds_count += 1 + print("跳过杂草:", crop_type, ",地块索引:", i) + continue + harvested_count += 1 # 发送收获请求到服务器 if tcp_network_manager_panel and tcp_network_manager_panel.sendHarvestCrop(i): @@ -1944,8 +1963,11 @@ func _execute_one_click_harvest(): # 显示结果 if success_count > 0: - Toast.show("一键收获完成!成功收获 " + str(success_count) + " 个作物,花费 " + str(one_click_cost) + " 元", Color.GREEN) - print("一键收获完成,收获了 ", success_count, " 个作物") + var message = "一键收获完成!成功收获 " + str(success_count) + " 个作物,花费 " + str(one_click_cost) + " 元" + if skipped_weeds_count > 0: + message += ",跳过 " + str(skipped_weeds_count) + " 个杂草" + Toast.show(message, Color.GREEN) + print("一键收获完成,收获了 ", success_count, " 个作物,跳过了 ", skipped_weeds_count, " 个杂草") else: Toast.show("一键收获失败,请检查网络连接", Color.RED) # 如果失败,退还费用 @@ -2096,7 +2118,9 @@ func _handle_like_player_response(data): Toast.show(message, Color.PINK) # 更新被访问玩家的点赞数显示 - visited_player_data["点赞数"] = target_likes + if not visited_player_data.has("点赞系统"): + visited_player_data["点赞系统"] = {} + visited_player_data["点赞系统"]["总点赞数"] = target_likes show_like.text = "点赞数:" + str(int(target_likes)) # 显示剩余点赞次数提示 @@ -2590,11 +2614,11 @@ func _handle_use_pet_item_response(data: Dictionary): if pet_inform_panel and pet_inform_panel.has_method("show_pet_info"): # 如果宠物信息面板当前有显示的宠物,刷新其信息 if not pet_inform_panel.current_pet_data.is_empty(): - var current_pet_id = pet_inform_panel.current_pet_data.get("基本信息", {}).get("宠物ID", "") + var current_pet_id = pet_inform_panel.current_pet_data.get("pet_id", "") if current_pet_id != "": # 查找更新后的宠物数据 for pet in pet_bag: - if pet.get("基本信息", {}).get("宠物ID", "") == current_pet_id: + if pet.get("pet_id", "") == current_pet_id: pet_inform_panel.show_pet_info(pet_inform_panel.current_pet_name, pet) break @@ -3161,6 +3185,110 @@ func check_battle_patrol_conflict(battle_pet_id: String, patrol_pet_id: String) +# 通用对话框显示函数 +func _show_battle_dialog(title: String, content: String, ok_text: String, cancel_text: String, ok_callback: Callable, cancel_callback: Callable): + # 使用专用的EscapeDialog创建对战选择弹窗 + if not escape_dialog: + print("错误:找不到EscapeDialog") + return + + # 设置对话框 + escape_dialog.title = title + escape_dialog.dialog_text = content + escape_dialog.ok_button_text = ok_text + escape_dialog.cancel_button_text = cancel_text + + # 应用主题美化 + _apply_escape_dialog_theme() + + # 清除之前的信号连接 + if escape_dialog.confirmed.is_connected(_on_steal_battle_confirmed): + escape_dialog.confirmed.disconnect(_on_steal_battle_confirmed) + if escape_dialog.canceled.is_connected(_on_steal_escape_confirmed): + escape_dialog.canceled.disconnect(_on_steal_escape_confirmed) + if escape_dialog.confirmed.is_connected(_on_direct_battle_confirmed): + escape_dialog.confirmed.disconnect(_on_direct_battle_confirmed) + if escape_dialog.canceled.is_connected(_on_direct_battle_canceled): + escape_dialog.canceled.disconnect(_on_direct_battle_canceled) + + # 连接新的信号处理 + escape_dialog.confirmed.connect(ok_callback) + escape_dialog.canceled.connect(cancel_callback) + + # 居中显示对话框 + escape_dialog.popup_centered() + +# 为EscapeDialog应用主题美化 +func _apply_escape_dialog_theme(): + # 设置面板背景样式 + var panel_style := StyleBoxFlat.new() + panel_style.bg_color = Color("#2d3748") # 深蓝灰色背景 + panel_style.set_border_width_all(3) + panel_style.border_color = Color("#4a5568") # 边框颜色 + #panel_style.set_corner_radius_all(12) # 圆角 + panel_style.shadow_color = Color(0, 0, 0, 0.3) + panel_style.shadow_size = 8 + escape_dialog.add_theme_stylebox_override("panel", panel_style) + + # 设置标题样式 + escape_dialog.add_theme_color_override("title_color", Color("#f7fafc")) # 白色标题 + escape_dialog.add_theme_font_size_override("title_size", 24) + + # 设置内容文字样式 + var label = escape_dialog.get_label() + if label: + label.add_theme_color_override("font_color", Color("#e2e8f0")) # 浅灰色文字 + label.add_theme_font_size_override("font_size", 12) + + # 美化确认按钮(宠物对战) + var ok_button = escape_dialog.get_ok_button() + if ok_button: + _customize_escape_button(ok_button, Color("#e53e3e"), Color("#c53030"), Color("#9b2c2c")) # 红色系 + ok_button.custom_minimum_size = Vector2(120, 45) + + # 美化取消按钮(逃跑) + var cancel_button = escape_dialog.get_cancel_button() + if cancel_button: + _customize_escape_button(cancel_button, Color("#38a169"), Color("#2f855a"), Color("#276749")) # 绿色系 + cancel_button.custom_minimum_size = Vector2(120, 45) + + # 设置按钮间距 + escape_dialog.add_theme_constant_override("buttons_separation", 20) + + # 设置对话框最小尺寸 + escape_dialog.min_size = Vector2(500, 350) + +func _customize_escape_button(button: Button, normal_color: Color, hover_color: Color, pressed_color: Color): + # 创建按钮样式 + var button_style_normal := StyleBoxFlat.new() + button_style_normal.bg_color = normal_color + #button_style_normal.set_corner_radius_all(8) + button_style_normal.set_border_width_all(2) + button_style_normal.border_color = normal_color.darkened(0.2) + + var button_style_hover := StyleBoxFlat.new() + button_style_hover.bg_color = hover_color + #button_style_hover.set_corner_radius_all(8) + button_style_hover.set_border_width_all(2) + button_style_hover.border_color = hover_color.darkened(0.2) + + var button_style_pressed := StyleBoxFlat.new() + button_style_pressed.bg_color = pressed_color + button_style_pressed.set_corner_radius_all(8) + button_style_pressed.set_border_width_all(2) + button_style_pressed.border_color = pressed_color.darkened(0.2) + + # 应用样式 + button.add_theme_stylebox_override("normal", button_style_normal) + button.add_theme_stylebox_override("hover", button_style_hover) + button.add_theme_stylebox_override("pressed", button_style_pressed) + + # 设置文字颜色 + button.add_theme_color_override("font_color", Color.WHITE) + button.add_theme_color_override("font_color_hover", Color.WHITE) + button.add_theme_color_override("font_color_pressed", Color.WHITE) + button.add_theme_font_size_override("font_size", 18) + #====================================偷菜被发现-宠物对战处理========================================= # 处理偷菜被发现响应 func _handle_steal_caught_response(data: Dictionary): @@ -3200,11 +3328,6 @@ func _handle_steal_caught_response(data: Dictionary): # 显示偷菜被发现对话框 func _show_steal_caught_dialog(message: String, patrol_pet_data: Dictionary, battle_pet_data: Dictionary, escape_cost: int, battle_cost: int, target_username: String, current_username: String): - # 使用AcceptDialog创建对战选择弹窗 - if not accept_dialog: - print("错误:找不到AcceptDialog") - return - # 构建对话框内容 var dialog_content = message + "\n\n" @@ -3232,32 +3355,15 @@ func _show_steal_caught_dialog(message: String, patrol_pet_data: Dictionary, bat dialog_content += "💰 逃跑:支付 " + str(escape_cost) + " 金币\n" dialog_content += "⚔️ 对战:如果失败支付 " + str(battle_cost) + " 金币" - # 设置对话框 - accept_dialog.set_dialog_title("偷菜被发现!") - accept_dialog.set_dialog_content(dialog_content) - accept_dialog.set_ok_text("宠物对战") - accept_dialog.set_cancel_text("逃跑") - - # 清除之前的信号连接 - if accept_dialog.confirmed.is_connected(_on_steal_battle_confirmed): - accept_dialog.confirmed.disconnect(_on_steal_battle_confirmed) - if accept_dialog.canceled.is_connected(_on_steal_escape_confirmed): - accept_dialog.canceled.disconnect(_on_steal_escape_confirmed) - - # 连接新的信号处理 - accept_dialog.confirmed.connect(_on_steal_battle_confirmed.bind(patrol_pet_data, battle_pet_data, target_username)) - accept_dialog.canceled.connect(_on_steal_escape_confirmed.bind(escape_cost)) - - # 居中显示对话框 - var screen_size = get_viewport().get_visible_rect().size - var dialog_pos = Vector2( - (screen_size.x - 500) / 2, # 假设对话框宽度为500 - (screen_size.y - 400) / 2 # 假设对话框高度为400 + # 使用通用对话框显示函数 + _show_battle_dialog( + "偷菜被发现!", + dialog_content, + "宠物对战", + "逃跑", + _on_steal_battle_confirmed.bind(patrol_pet_data, battle_pet_data, target_username), + _on_steal_escape_confirmed.bind(escape_cost) ) - accept_dialog.set_dialog_position(dialog_pos) - - # 显示对话框 - accept_dialog.popup_centered() print("显示偷菜被发现对话框") # 玩家选择宠物对战 @@ -3377,29 +3483,15 @@ func _show_battle_confirmation_dialog(target_patrol_pet: Dictionary, my_battle_p dialog_content += "\n⚠️ 注意:对战失败可能会有惩罚!" - # 使用现有的accept_dialog - if not accept_dialog: - Toast.show("对话框不可用", Color.RED, 2.0) - return - - # 清除之前的信号连接 - if accept_dialog.confirmed.is_connected(_on_direct_battle_confirmed): - accept_dialog.confirmed.disconnect(_on_direct_battle_confirmed) - if accept_dialog.canceled.is_connected(_on_direct_battle_canceled): - accept_dialog.canceled.disconnect(_on_direct_battle_canceled) - - # 设置对话框内容 - accept_dialog.set_dialog_title("宠物对战确认") - accept_dialog.set_dialog_content(dialog_content) - accept_dialog.set_ok_text("发起对战") - accept_dialog.set_cancel_text("取消") - - # 连接信号 - accept_dialog.confirmed.connect(_on_direct_battle_confirmed.bind(target_patrol_pet, my_battle_pet)) - accept_dialog.canceled.connect(_on_direct_battle_canceled) - - # 显示对话框 - accept_dialog.popup_centered() + # 使用通用对话框显示函数 + _show_battle_dialog( + "宠物对战确认", + dialog_content, + "发起对战", + "取消", + _on_direct_battle_confirmed.bind(target_patrol_pet, my_battle_pet), + _on_direct_battle_canceled + ) # 确认发起对战 func _on_direct_battle_confirmed(target_patrol_pet: Dictionary, my_battle_pet: Dictionary) -> void: @@ -3568,6 +3660,22 @@ func _handle_save_game_settings_response(data): # ======================================= 游戏设置系统 ========================================= +# ======================================= 今日占卜系统 ========================================= +# 处理占卜响应 +func _handle_divination_response(divination_data): + """处理服务器返回的占卜数据,更新本地玩家数据""" + if divination_data.has("今日占卜对象"): + # 更新登录数据中的占卜信息 + login_data["今日占卜对象"] = divination_data["今日占卜对象"] + print("占卜数据已更新到本地") + +# 获取玩家占卜数据 +func get_player_divination_data(): + """获取玩家的占卜数据""" + return login_data.get("今日占卜对象", {}) +# ======================================= 今日占卜系统 ========================================= + + #打开小卖部面板 func _on_my_store_button_pressed() -> void: if is_visiting_mode: @@ -3696,3 +3804,8 @@ func _on_pet_battle_ended(winner_team: String, battle_data: Dictionary): else: Toast.show("很遗憾,您在偷菜对战中失败了。", Color.RED) # ======================================= 宠物对战系统 ========================================= + + +func _on_today_divination_button_pressed() -> void: + today_divination_panel.show() + pass diff --git a/MainGame.tscn b/MainGame.tscn index f267d49..6ec2658 100644 --- a/MainGame.tscn +++ b/MainGame.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=105 format=3 uid="uid://dgh61dttaas5a"] +[gd_scene load_steps=107 format=3 uid="uid://dgh61dttaas5a"] [ext_resource type="Script" uid="uid://2pt11sfcaxf7" path="res://MainGame.gd" id="1_v3yaj"] [ext_resource type="Texture2D" uid="uid://du2pyiojliasy" path="res://assets/游戏UI/经验球.webp" id="2_6jgly"] @@ -30,7 +30,6 @@ [ext_resource type="PackedScene" uid="uid://bseuwniienrqy" path="res://Scene/BigPanel/PlayerBagPanel.tscn" id="19_8kysg"] [ext_resource type="PackedScene" uid="uid://cehw5sx5pgmmc" path="res://Scene/BigPanel/ItemBagPanel.tscn" id="20_n03md"] [ext_resource type="PackedScene" uid="uid://j4ft87o7jk14" path="res://Scene/BigPanel/ItemStorePanel.tscn" id="21_uhubb"] -[ext_resource type="PackedScene" uid="uid://cw8am7nnbgca5" path="res://Scene/Pet/PetFightPanel.tscn" id="23_n03md"] [ext_resource type="Script" uid="uid://bdhwvqsmakna2" path="res://Script/BigPanel/PetBagPanel.gd" id="23_uc6q1"] [ext_resource type="Script" uid="uid://bdavskipn547h" path="res://Script/BigPanel/PlayerStorePanel.gd" id="24_dygid"] [ext_resource type="PackedScene" uid="uid://cnjidcwuv4nn4" path="res://Scene/BigPanel/PetStorePanel.tscn" id="24_uc6q1"] @@ -52,6 +51,8 @@ [ext_resource type="Script" uid="uid://b185o1hjnlrv5" path="res://Script/SmallPanel/CropInformPanel.gd" id="41_iluto"] [ext_resource type="Texture2D" uid="uid://3ff2lnbc0op7" path="res://assets/稻草人图片/稻草人1.webp" id="43_6rkns"] [ext_resource type="Script" uid="uid://dsmmxivba06ab" path="res://Script/Dialog/BatchSellPopup.gd" id="44_av1bx"] +[ext_resource type="Script" uid="uid://bkel88rscubov" path="res://Script/SmallPanel/TodayDivinationPanel.gd" id="44_mw3xw"] +[ext_resource type="FontFile" uid="uid://b81msdfp2ym2g" path="res://assets/字体/MapleMono-NF-CN-BoldItalic.ttf" id="45_vexnj"] [ext_resource type="Texture2D" uid="uid://cbdm5e6s8bf6l" path="res://assets/智慧树图片/智慧树4.webp" id="45_xvovi"] [ext_resource type="Script" uid="uid://cha0uw4ra1trr" path="res://Script/Dialog/AddProduct2StorePopup.gd" id="46_8d602"] [ext_resource type="Texture2D" uid="uid://dilipbs0lncpd" path="res://assets/草地图片/草地10.webp" id="48_2i8fe"] @@ -148,6 +149,13 @@ border_width_right = 15 border_width_bottom = 15 corner_detail = 20 +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bpbm8"] +border_width_left = 15 +border_width_top = 15 +border_width_right = 15 +border_width_bottom = 15 +corner_detail = 20 + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_t4s8j"] border_width_left = 15 border_width_top = 15 @@ -651,6 +659,12 @@ offset_bottom = 408.0 scale = Vector2(0.8, 0.8) alignment = 2 +[node name="TodayDivinationButton" type="Button" parent="UI/GUI/OtherVBox"] +modulate = Color(0.917346, 0.737213, 1, 1) +layout_mode = 2 +theme_override_font_sizes/font_size = 40 +text = "今日占卜" + [node name="MyStoreButton" type="Button" parent="UI/GUI/OtherVBox"] visible = false modulate = Color(0.917346, 0.737213, 1, 1) @@ -936,9 +950,6 @@ offset_bottom = 79.25 theme_override_font_sizes/font_size = 40 text = "刷新" -[node name="PetFightPanel" parent="UI/BigPanel" instance=ExtResource("23_n03md")] -visible = false - [node name="DailyCheckInPanel" parent="UI/BigPanel" instance=ExtResource("18_m6fch")] visible = false @@ -1623,8 +1634,8 @@ offset_bottom = 482.0 [node name="CropInformPanel" type="Panel" parent="UI/SmallPanel"] visible = false -offset_left = 330.0 -offset_right = 958.0 +offset_left = 379.0 +offset_right = 1007.0 offset_bottom = 723.0 theme_override_styles/panel = SubResource("StyleBoxFlat_xyeuq") script = ExtResource("41_iluto") @@ -1716,6 +1727,69 @@ size_flags_vertical = 10 theme_override_font_sizes/font_size = 30 text = "放入小卖部" +[node name="TodayDivinationPanel" type="PanelContainer" parent="UI/SmallPanel"] +visible = false +offset_left = 345.0 +offset_right = 1050.0 +offset_bottom = 713.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_bpbm8") +script = ExtResource("44_mw3xw") + +[node name="VBox" type="VBoxContainer" parent="UI/SmallPanel/TodayDivinationPanel"] +layout_mode = 2 + +[node name="Title" type="Label" parent="UI/SmallPanel/TodayDivinationPanel/VBox"] +layout_mode = 2 +size_flags_vertical = 0 +theme_override_colors/font_color = Color(0.807843, 1, 0, 1) +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/shadow_offset_x = 4 +theme_override_constants/shadow_offset_y = 4 +theme_override_constants/outline_size = 20 +theme_override_constants/shadow_outline_size = 20 +theme_override_font_sizes/font_size = 40 +text = "今日占卜" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Scroll" type="ScrollContainer" parent="UI/SmallPanel/TodayDivinationPanel/VBox"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Contents" type="RichTextLabel" parent="UI/SmallPanel/TodayDivinationPanel/VBox/Scroll"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_fonts/normal_font = ExtResource("45_vexnj") +theme_override_fonts/mono_font = ExtResource("45_vexnj") +theme_override_fonts/italics_font = ExtResource("45_vexnj") +theme_override_fonts/bold_italics_font = ExtResource("45_vexnj") +theme_override_fonts/bold_font = ExtResource("45_vexnj") +theme_override_font_sizes/bold_italics_font_size = 25 +theme_override_font_sizes/italics_font_size = 25 +theme_override_font_sizes/mono_font_size = 25 +theme_override_font_sizes/normal_font_size = 25 +theme_override_font_sizes/bold_font_size = 25 +bbcode_enabled = true +text = "这是占卜内容" +horizontal_alignment = 1 +threaded = true + +[node name="StartButton" type="Button" parent="UI/SmallPanel/TodayDivinationPanel/VBox"] +custom_minimum_size = Vector2(300, 0) +layout_mode = 2 +size_flags_horizontal = 4 +theme_override_font_sizes/font_size = 35 +text = "开始占卜" + +[node name="QuitButton" type="Button" parent="UI/SmallPanel/TodayDivinationPanel/VBox"] +custom_minimum_size = Vector2(300, 0) +layout_mode = 2 +size_flags_horizontal = 4 +theme_override_font_sizes/font_size = 35 +text = "结束占卜" + [node name="DiaLog" type="CanvasLayer" parent="UI"] [node name="AcceptDialog" parent="UI/DiaLog" instance=ExtResource("16_0igvr")] @@ -1905,6 +1979,15 @@ size_flags_horizontal = 3 theme_override_font_sizes/font_size = 30 text = "取消" +[node name="EscapeDialog" type="ConfirmationDialog" parent="UI/DiaLog"] +title = "弹窗标题" +initial_position = 3 +size = Vector2i(600, 500) +current_screen = 0 +content_scale_factor = 1.4 +ok_button_text = "确定" +cancel_button_text = "取消" + [node name="BackgroundUI" type="CanvasLayer" parent="."] layer = -1 @@ -3158,6 +3241,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("63_ekowe") [node name="Name" type="RichTextLabel" parent="Decoration4/DailyCheckinGift"] +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3193,6 +3277,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("64_crc4a") [node name="Name" type="RichTextLabel" parent="Decoration4/OnlineTimeGift"] +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3228,7 +3313,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("50_sqnmr") [node name="Name" type="RichTextLabel" parent="Decoration4/Decoration2"] -visible = false +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3240,7 +3325,6 @@ theme_override_font_sizes/mono_font_size = 40 theme_override_font_sizes/normal_font_size = 40 theme_override_font_sizes/bold_font_size = 40 bbcode_enabled = true -text = "稻草人" horizontal_alignment = 1 vertical_alignment = 1 @@ -3264,7 +3348,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("51_2i8fe") [node name="Name" type="RichTextLabel" parent="Decoration4/Decoration3"] -visible = false +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3276,7 +3360,6 @@ theme_override_font_sizes/mono_font_size = 40 theme_override_font_sizes/normal_font_size = 40 theme_override_font_sizes/bold_font_size = 40 bbcode_enabled = true -text = "稻草人" horizontal_alignment = 1 vertical_alignment = 1 @@ -3300,7 +3383,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("50_sqnmr") [node name="Name" type="RichTextLabel" parent="Decoration4/Decoration4"] -visible = false +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3312,7 +3395,6 @@ theme_override_font_sizes/mono_font_size = 40 theme_override_font_sizes/normal_font_size = 40 theme_override_font_sizes/bold_font_size = 40 bbcode_enabled = true -text = "稻草人" horizontal_alignment = 1 vertical_alignment = 1 @@ -3336,7 +3418,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("49_xjiif") [node name="Name" type="RichTextLabel" parent="Decoration4/Decoration5"] -visible = false +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3348,7 +3430,6 @@ theme_override_font_sizes/mono_font_size = 40 theme_override_font_sizes/normal_font_size = 40 theme_override_font_sizes/bold_font_size = 40 bbcode_enabled = true -text = "稻草人" horizontal_alignment = 1 vertical_alignment = 1 @@ -3372,7 +3453,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("49_xjiif") [node name="Name" type="RichTextLabel" parent="Decoration4/Decoration6"] -visible = false +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3384,7 +3465,6 @@ theme_override_font_sizes/mono_font_size = 40 theme_override_font_sizes/normal_font_size = 40 theme_override_font_sizes/bold_font_size = 40 bbcode_enabled = true -text = "稻草人" horizontal_alignment = 1 vertical_alignment = 1 @@ -3408,6 +3488,7 @@ scale = Vector2(1.2, 1.2) texture = ExtResource("67_onvxb") [node name="Name" type="RichTextLabel" parent="Decoration4/PetBag"] +z_index = 5 layout_mode = 0 offset_left = -65.0 offset_top = -145.0 @@ -3444,6 +3525,7 @@ texture = ExtResource("68_bpbm8") [node name="Name" type="Label" parent="Decoration4/ItemBag"] self_modulate = Color(2, 2, 2, 1) +z_index = 5 layout_mode = 0 offset_top = -145.0 offset_right = 265.0 @@ -3608,6 +3690,7 @@ environment = SubResource("Environment_uyv6e") [connection signal="pressed" from="UI/GUI/VisitVBox/LikeButton" to="." method="_on_like_button_pressed"] [connection signal="pressed" from="UI/GUI/VisitVBox/BattleButton" to="." method="_on_battle_button_pressed"] [connection signal="pressed" from="UI/GUI/VisitVBox/ReturnMyFarmButton" to="." method="_on_return_my_farm_button_pressed"] +[connection signal="pressed" from="UI/GUI/OtherVBox/TodayDivinationButton" to="." method="_on_today_divination_button_pressed"] [connection signal="pressed" from="UI/GUI/OtherVBox/MyStoreButton" to="." method="_on_my_store_button_pressed"] [connection signal="pressed" from="UI/GUI/OtherVBox/AccountSettingButton" to="." method="_on_account_setting_button_pressed"] [connection signal="pressed" from="UI/GUI/OtherVBox/OnlineGiftButton" to="." method="_on_online_gift_button_pressed"] diff --git a/Network/TCPNetworkManager.gd b/Network/TCPNetworkManager.gd index e532e70..7ecdc70 100644 --- a/Network/TCPNetworkManager.gd +++ b/Network/TCPNetworkManager.gd @@ -23,7 +23,7 @@ extends Panel @onready var item_bag_panel: Panel = $'../ItemBagPanel' @onready var pet_store_panel: Panel = $'../PetStorePanel' @onready var pet_bag_panel: Panel = $'../PetBagPanel' -@onready var pet_fight_panel: Panel = $'../PetFightPanel' + #小面板 @onready var land_panel: Panel = $'../../SmallPanel/LandPanel' @onready var load_progress_panel: Panel = $'../../SmallPanel/LoadProgressPanel' @@ -366,6 +366,31 @@ func _on_data_received(data): else: Toast.show(message, Color.RED) + # 宠物喂食响应 + elif action_type == "feed_pet": + if success: + # 更新宠物背包和作物仓库 + main_game.pet_bag = updated_data["宠物背包"] + main_game.crop_warehouse = updated_data["作物仓库"] + + # 更新UI + main_game.pet_bag_panel.update_pet_bag_ui() + main_game.crop_warehouse_panel.update_crop_warehouse_ui() + + # 如果宠物信息面板正在显示当前宠物,刷新显示 + var pet_id = data.get("pet_id", "") + if pet_inform_panel.current_pet_data.get("pet_id", "") == pet_id: + # 从更新后的宠物背包中获取最新的宠物数据 + for pet_data in main_game.pet_bag: + if pet_data.get("pet_id", "") == pet_id: + pet_inform_panel.current_pet_data = pet_data + pet_inform_panel.show_pet_info(pet_data.get("pet_name", ""), pet_data) + break + + Toast.show(message, Color.GREEN) + else: + Toast.show(message, Color.RED) + # 使用道具响应 elif action_type == "use_item": if success: @@ -626,6 +651,21 @@ func _on_data_received(data): # 游戏设置响应 elif message_type == "save_game_settings_response": main_game._handle_save_game_settings_response(data) + + # 占卜响应 + elif message_type == "today_divination_response": + var success = data.get("success", false) + var message = data.get("message", "") + var divination_data = data.get("divination_data", {}) + + # 更新主游戏中的占卜数据 + if success and divination_data.has("今日占卜对象"): + main_game._handle_divination_response(divination_data) + + # 通知占卜面板 + var divination_panel = get_node_or_null("/root/main/UI/SmallPanel/TodayDivinationPanel") + if divination_panel and divination_panel.has_method("handle_divination_response"): + divination_panel.handle_divination_response(success, message, divination_data) # ============================= 客户端与服务端通信核心 ===================================== @@ -1211,6 +1251,17 @@ func send_pet_battle_result(battle_result: Dictionary): }) return true +#发送占卜请求 +func sendDivinationRequest(): + if not client.is_client_connected(): + return false + + client.send_data({ + "type": "today_divination", + "timestamp": Time.get_unix_time_from_system() + }) + return true + #检查是否连接到服务器 func is_connected_to_server(): return client.is_client_connected() diff --git a/Scene/BigPanel/DailyCheckInPanel.tscn b/Scene/BigPanel/DailyCheckInPanel.tscn index 47ef872..f6274a3 100644 --- a/Scene/BigPanel/DailyCheckInPanel.tscn +++ b/Scene/BigPanel/DailyCheckInPanel.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=3 format=3 uid="uid://smypui0vyso5"] +[gd_scene load_steps=4 format=3 uid="uid://smypui0vyso5"] [ext_resource type="Script" uid="uid://c0jfbtkh0mj5b" path="res://Script/BigPanel/DailyCheckInPanel.gd" id="1_fj7a7"] @@ -9,6 +9,8 @@ border_width_right = 15 border_width_bottom = 15 corner_detail = 20 +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4gvib"] + [node name="DailyCheckInPanel" type="Panel"] offset_left = 441.0 offset_right = 1041.0 @@ -33,12 +35,19 @@ text = "📅每日签到📅" horizontal_alignment = 1 [node name="Label" type="Label" parent="."] -modulate = Color(0.642982, 0.510828, 1, 1) layout_mode = 0 -offset_top = 419.0 -offset_right = 600.0 -offset_bottom = 468.0 +offset_left = 23.0 +offset_top = 360.0 +offset_right = 585.0 +offset_bottom = 409.0 +theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/shadow_offset_x = 2 +theme_override_constants/shadow_offset_y = 2 +theme_override_constants/outline_size = 15 +theme_override_constants/shadow_outline_size = 10 theme_override_font_sizes/font_size = 30 +theme_override_styles/normal = SubResource("StyleBoxFlat_4gvib") text = "🎉签到奖励🎉" horizontal_alignment = 1 vertical_alignment = 1 @@ -66,9 +75,10 @@ text = "签到" [node name="Scroll" type="ScrollContainer" parent="."] layout_mode = 0 +offset_left = 23.0 offset_top = 77.0 -offset_right = 600.0 -offset_bottom = 419.0 +offset_right = 577.0 +offset_bottom = 360.0 [node name="DailyCheckInHistory" type="RichTextLabel" parent="Scroll"] layout_mode = 2 @@ -79,13 +89,24 @@ threaded = true [node name="DailyCheckInReward" type="RichTextLabel" parent="."] layout_mode = 0 -offset_top = 481.0 -offset_right = 600.0 -offset_bottom = 649.0 +offset_left = 23.0 +offset_top = 409.0 +offset_right = 577.0 +offset_bottom = 630.0 theme_override_font_sizes/normal_font_size = 20 bbcode_enabled = true text = "+500 经验,+400 钱币,+5 普通-番茄种子,+1 传奇-火龙果种子 " horizontal_alignment = 1 +[node name="ConfirmDialog" type="ConfirmationDialog" parent="."] +title = "标题" +initial_position = 3 +size = Vector2i(450, 350) +current_screen = 0 +ok_button_text = "✅ 确定" +dialog_text = "弹窗内容" +dialog_autowrap = true +cancel_button_text = "❌ 取消" + [connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"] [connection signal="pressed" from="DailyCheckInButton" to="." method="_on_daily_check_in_button_pressed"] diff --git a/Scene/BigPanel/LoginPanel.tscn b/Scene/BigPanel/LoginPanel.tscn index 086f2ab..38cd130 100644 --- a/Scene/BigPanel/LoginPanel.tscn +++ b/Scene/BigPanel/LoginPanel.tscn @@ -18,6 +18,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_n8m38") script = ExtResource("1_xnwaq") [node name="LoginVBox" type="VBoxContainer" parent="."] +visible = false layout_mode = 2 [node name="Title" type="Label" parent="LoginVBox"] @@ -100,7 +101,6 @@ text = "连接状态" horizontal_alignment = 1 [node name="RegisterVbox" type="VBoxContainer" parent="."] -visible = false layout_mode = 2 [node name="Title" type="Label" parent="RegisterVbox"] @@ -226,6 +226,11 @@ layout_mode = 2 theme_override_font_sizes/font_size = 30 text = "注册" +[node name="Register2LoginButton" type="Button" parent="RegisterVbox"] +layout_mode = 2 +theme_override_font_sizes/font_size = 30 +text = "返回登录" + [node name="Note" type="Label" parent="RegisterVbox"] modulate = Color(1, 0.552941, 1, 1) layout_mode = 2 @@ -321,6 +326,11 @@ layout_mode = 2 theme_override_font_sizes/font_size = 30 text = "确认" +[node name="Forget2LoginButton" type="Button" parent="ForgetPasswordVbox"] +layout_mode = 2 +theme_override_font_sizes/font_size = 30 +text = "确认" + [node name="Note" type="Label" parent="ForgetPasswordVbox"] modulate = Color(1, 0.552941, 1, 1) layout_mode = 2 @@ -337,3 +347,6 @@ layout_mode = 2 theme_override_font_sizes/font_size = 30 text = "连接状态" horizontal_alignment = 1 + +[connection signal="pressed" from="RegisterVbox/Register2LoginButton" to="." method="_on_register_2_login_button_pressed"] +[connection signal="pressed" from="ForgetPasswordVbox/Forget2LoginButton" to="." method="_on_forget_2_login_button_pressed"] diff --git a/Scene/BigPanel/LuckyDrawPanel.tscn b/Scene/BigPanel/LuckyDrawPanel.tscn index 094d20a..2ef7ba2 100644 --- a/Scene/BigPanel/LuckyDrawPanel.tscn +++ b/Scene/BigPanel/LuckyDrawPanel.tscn @@ -117,6 +117,16 @@ layout_mode = 2 theme_override_font_sizes/font_size = 35 text = "抽奖" +[node name="ConfirmDialog" type="ConfirmationDialog" parent="."] +title = "标题" +initial_position = 3 +size = Vector2i(450, 350) +current_screen = 0 +ok_button_text = "🎲 确定抽奖" +dialog_text = "弹窗内容" +dialog_autowrap = true +cancel_button_text = "❌ 取消" + [connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"] [connection signal="pressed" from="HBox/FiveLuckyDrawButton" to="." method="_on_five_lucky_draw_button_pressed"] [connection signal="pressed" from="HBox/TenLuckyDrawButton" to="." method="_on_ten_lucky_draw_button_pressed"] diff --git a/Scene/NewPet/NewPetBase.gd b/Scene/NewPet/NewPetBase.gd index 00daf40..30d1de3 100644 --- a/Scene/NewPet/NewPetBase.gd +++ b/Scene/NewPet/NewPetBase.gd @@ -95,7 +95,7 @@ var berserker_triggered: bool = false # 是否已触发过狂暴(防止重复 var is_berserker: bool = false # 是否处于狂暴状态 var berserker_end_time: float = 0.0 # 狂暴结束时间 -#技能-自爆 +#技能-死亡自爆 var enable_self_destruct_skill: bool = false var self_destruct_damage: float = 50.0 # 自爆伤害值 @@ -112,6 +112,12 @@ var respawn_health_percentage: float = 0.3 # 重生时恢复的血量百分比 var max_respawn_count: int = 1 # 最大重生次数 var current_respawn_count: int = 0 # 当前已重生次数 +#技能-反弹伤害 +var enable_damage_reflection_skill: bool = false +var damage_reflection_cooldown: float = 10.0 # 反弹伤害冷却时间(秒) +var damage_reflection_cooldown_end_time: float = 0.0 # 反弹伤害冷却结束时间 +var damage_reflection_percentage: float = 0.5 # 反弹伤害百分比(50%) + #击退效果 var enable_knockback: bool = true # 是否启用击退效果 var knockback_force: float = 300.0 # 击退力度(像素/秒) @@ -179,6 +185,8 @@ var update_ui_timer: float = 0.0 var ui_update_interval: float = 0.2 # UI更新间隔,减少频繁更新 var ai_update_timer: float = 0.0 var ai_update_interval: float = 0.05 # AI更新间隔,平衡性能和反应速度 + +var last_direction_x = -1 # 假设初始向右 #============================杂项未处理=============================== @@ -359,25 +367,31 @@ func move_towards_target(): var direction = (current_target.global_position - global_position).normalized() velocity = direction * move_speed - # 翻转精灵 - if direction.x < 0: - pet_image.flip_h = false - left_tool_image.flip_h = true - right_tool_image.flip_h = true - left_tool_image.position = Vector2(-12.5,3.5) - right_tool_image.position = Vector2(-7.5,-6.25) - #left_tool_image.rotation = 21.8 - #right_tool_image.rotation = -14.5 +#==================只有当方向发生变化时才执行翻转逻辑======================= + if direction.x != last_direction_x: + if direction.x < 0: + # 向左转 + pet_image.flip_h = false + left_tool_image.flip_h = true + right_tool_image.flip_h = true + + # 只翻转一次位置(使用初始位置的相反数) + left_tool_image.position.x = -abs(left_tool_image.position.x) + right_tool_image.position.x = -abs(right_tool_image.position.x) + else: + # 向右转 + pet_image.flip_h = true + left_tool_image.flip_h = false + right_tool_image.flip_h = false + + # 只翻转一次位置(使用初始位置的绝对值) + left_tool_image.position.x = abs(left_tool_image.position.x) + right_tool_image.position.x = abs(right_tool_image.position.x) + # 更新上一次的方向记录 + last_direction_x = direction.x +#==================只有当方向发生变化时才执行翻转逻辑======================= - else: - pet_image.flip_h = true - left_tool_image.flip_h = false - right_tool_image.flip_h = false - left_tool_image.position = Vector2(12.5,3.5) - right_tool_image.position = Vector2(7.5,-6.25) - #left_tool_image.rotation = -21.8 - #right_tool_image.rotation = 14.5 #检查边界碰撞并处理反弹和伤害 func check_boundary_collision(): @@ -462,7 +476,6 @@ func perform_melee_attack(): current_state = PetState.IDLE ) - #应用宠物外观图片 func apply_pet_image(pet: NewPetBase, image_path: String): """应用宠物外观图片""" @@ -614,6 +627,20 @@ func take_damage(damage: float, attacker: NewPetBase): # 闪避成功 return # 闪避成功 + # 反弹伤害技能检查 + if enable_damage_reflection_skill and attacker != null and is_instance_valid(attacker) and attacker != self: + var current_time = Time.get_ticks_msec() / 1000.0 + # 检查冷却时间 + if current_time >= damage_reflection_cooldown_end_time: + # 计算反弹伤害 + var reflection_damage = damage * damage_reflection_percentage + # 对攻击者造成反弹伤害(不会再次触发反弹,避免无限循环) + attacker.take_reflection_damage(reflection_damage, self) + # 设置冷却时间 + damage_reflection_cooldown_end_time = current_time + damage_reflection_cooldown + # 发射技能信号 + pet_skill_used.emit(self, "反弹伤害") + # 护盾优先吸收伤害 if current_shield > 0: var shield_damage = min(current_shield, damage) @@ -638,6 +665,39 @@ func take_damage(damage: float, attacker: NewPetBase): if current_health <= 0: die() +#受到反弹伤害(不会再次触发反弹效果) +func take_reflection_damage(damage: float, reflector: NewPetBase): + """受到反弹伤害(不会再次触发反弹效果)""" + if not is_alive: + return + + # 闪避检查 + if randf() < dodge_rate: + # 闪避成功 + return + + # 护盾优先吸收伤害 + if current_shield > 0: + var shield_damage = min(current_shield, damage) + current_shield -= shield_damage + damage -= shield_damage + + # 护盾消耗完后,剩余伤害扣除生命值 + if damage > 0: + current_health -= damage + + # 受伤视觉效果(短暂变红) + if not is_berserker: + pet_image.modulate = Color(1.3, 0.7, 0.7, 1.0) + get_tree().create_timer(0.15).timeout.connect(func(): + if not is_berserker and is_alive: + pet_image.modulate = Color(1.0, 1.0, 1.0, 1.0) + ) + + # 检查死亡 + if current_health <= 0: + die() + #治疗 func heal(amount: float): """治疗""" @@ -1033,11 +1093,31 @@ func update_patrol_ai(): pet_image.animation = "walk" velocity = direction * patrol_speed - # 翻转精灵 - if direction.x < 0: - pet_image.flip_h = false - else: - pet_image.flip_h = true +#==================只有当方向发生变化时才执行翻转逻辑======================= + if direction.x != last_direction_x: + if direction.x < 0: + # 向左转 + pet_image.flip_h = false + left_tool_image.flip_h = true + right_tool_image.flip_h = true + + # 只翻转一次位置(使用初始位置的相反数) + left_tool_image.position.x = -abs(left_tool_image.position.x) + right_tool_image.position.x = -abs(right_tool_image.position.x) + else: + # 向右转 + pet_image.flip_h = true + left_tool_image.flip_h = false + right_tool_image.flip_h = false + + # 只翻转一次位置(使用初始位置的绝对值) + left_tool_image.position.x = abs(left_tool_image.position.x) + right_tool_image.position.x = abs(right_tool_image.position.x) + + # 更新上一次的方向记录 + last_direction_x = direction.x +#==================只有当方向发生变化时才执行翻转逻辑======================= + else: # 到达目标位置,待机 current_state = PetState.IDLE diff --git a/Scene/NewPet/PetBattlePanel.gd b/Scene/NewPet/PetBattlePanel.gd index f974b1b..d72ae16 100644 --- a/Scene/NewPet/PetBattlePanel.gd +++ b/Scene/NewPet/PetBattlePanel.gd @@ -76,6 +76,11 @@ func _ready(): # 初始化UI battle_end_panel.visible = false return_farm_button.pressed.connect(_on_return_farm_pressed) + # 连接可见性改变信号 + visibility_changed.connect(_on_visibility_changed) + # 连接确认弹窗信号 + confirm_dialog.confirmed.connect(_on_assist_confirmed) + confirm_dialog.canceled.connect(_on_assist_canceled) # 初始化宠物配置系统 pet_config = PetConfig.new() # 等待一帧确保PetConfig的_ready函数执行完毕 @@ -83,9 +88,7 @@ func _ready(): # 初始化战斗日志 battle_details_text.text = "[color=green]战斗准备中...[/color]\n" - # 连接确认弹窗信号 - confirm_dialog.confirmed.connect(_on_assist_confirmed) - confirm_dialog.canceled.connect(_on_assist_canceled) + # 美化确认弹窗 setup_confirm_dialog() @@ -93,11 +96,13 @@ func _ready(): # 延迟一帧后设置演示数据,确保所有节点都已准备好 await get_tree().process_frame #setup_farm_battle() + # 可以调用测试函数进行本地测试 + #setup_test_battle() func _process(delta): # 更新时间显示(无论什么状态都显示) update_time_display() - +# # 更新辅助功能冷却计时器 update_assist_cooldowns(delta) @@ -131,6 +136,72 @@ func _process(delta): #========================基础函数====================== +#=====================本地测试函数=========================== +# 本地测试对战函数 - 方便调试各种宠物属性 +func setup_test_battle(): + """设置本地测试对战,可以快速测试各种宠物配置和属性""" + print("[测试] 开始设置本地测试对战") + + # 清理现有战斗 + clear_all_pets() + + # 设置队伍名称 + team_a_name = "测试队伍A" + team_b_name = "测试队伍B" + + # 创建测试队伍A的宠物数据(进攻方) + var team_a_data = [ + {"config_key": "烈焰鸟"}, # 使用配置文件中的烈焰鸟 + ] + + # 创建测试队伍B的宠物数据(防守方) + var team_b_data = [ + {"config_key": "小蓝虫"}, # 使用配置文件中的小蓝虫 + ] + + # 开始战斗 + start_battle(team_a_data, team_b_data) + + # 等待宠物生成完成 + await get_tree().process_frame + + # 获取生成的宠物进行属性调试 + var redman_pet = null # 烈焰鸟 + var bluebug_pet = null # 大蓝虫 + var smallbug_pet = null # 小蓝虫 + var smallblue_pet = null # 小蓝 + + # 查找特定宠物 + for pet in team_a_pets: + if pet.pet_type == "烈焰鸟": + redman_pet = pet + elif pet.pet_type == "大蓝虫": + bluebug_pet = pet + + for pet in team_b_pets: + if pet.pet_type == "小蓝虫": + smallbug_pet = pet + elif pet.pet_type == "小蓝": + smallblue_pet = pet + + # =================== 在这里可以一行代码调试宠物属性 =================== + # 示例:开启烈焰鸟的反弹伤害技能 + if redman_pet: + redman_pet.enable_damage_reflection_skill = true + redman_pet.damage_reflection_percentage = 0.8 # 反弹80%伤害 + redman_pet.damage_reflection_cooldown = 5.0 # 5秒冷却 + print("[测试] 烈焰鸟开启反弹伤害技能") + + + + print("[测试] 本地测试对战设置完成,可以观察宠物战斗效果") + + # 添加测试日志 + add_battle_log("[color=cyan]本地测试对战开始![/color]") + add_battle_log("[color=yellow]队伍A: 烈焰鸟(反弹伤害) + 大蓝虫(召唤增强)[/color]") + add_battle_log("[color=yellow]队伍B: 小蓝虫(狂暴模式) + 小蓝(自爆技能)[/color]") + + #=====================UI显示=========================== #更新时间显示 func update_time_display(): @@ -276,6 +347,14 @@ func _on_stop_battle_button_pressed() -> void: for bullet in bullets: bullet.queue_free() +# 面板显示时的处理 +func _on_visibility_changed(): + if visible: + GlobalVariables.isZoomDisabled = true + pass + else: + GlobalVariables.isZoomDisabled = false + pass #=====================UI显示=========================== @@ -394,7 +473,11 @@ func apply_server_pet_data(pet: NewPetBase, pet_data: Dictionary): # 生命与防御 if pet_data.has("max_health"): pet.max_health = pet_data["max_health"] - pet.current_health = pet.max_health + # 优先使用服务器返回的当前生命值,否则使用最大生命值 + if pet_data.has("pet_current_health"): + pet.current_health = pet_data["pet_current_health"] + else: + pet.current_health = pet.max_health if pet_data.has("enable_health_regen"): pet.enable_health_regen = pet_data["enable_health_regen"] if pet_data.has("health_regen"): @@ -974,10 +1057,6 @@ func setup_steal_battle(attacker_pets: Array, defender_pets: Array, attacker_nam team_a_name = attacker_name + "(攻击方)" team_b_name = defender_name + "(防守方)" - # 更新UI显示 - #team_a_label.text = team_a_name - #team_b_label.text = team_b_name - # 获取队伍位置点 var team_a_positions = get_team_positions(team_a_node) var team_b_positions = get_team_positions(team_b_node) diff --git a/Scene/NewPet/PetBattlePanel.tscn b/Scene/NewPet/PetBattlePanel.tscn index 9af111c..6bb60c9 100644 --- a/Scene/NewPet/PetBattlePanel.tscn +++ b/Scene/NewPet/PetBattlePanel.tscn @@ -101,7 +101,7 @@ vertical_alignment = 1 layout_mode = 0 offset_top = 50.0 offset_right = 257.0 -offset_bottom = 300.0 +offset_bottom = 578.0 [node name="TeamAHeal" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 @@ -122,67 +122,67 @@ text = "团队护盾" layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test2" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test3" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test4" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test5" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test6" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test7" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test8" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test9" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test10" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="test11" type="Button" parent="PlayerSkillPanel/TeamASkills"] layout_mode = 2 theme_override_font_sizes/font_size = 18 disabled = true -text = "测试" +text = "暂无" [node name="BattleControls" type="VBoxContainer" parent="PlayerSkillPanel"] layout_mode = 0 diff --git a/Scene/NewPet/PetConfig.gd b/Scene/NewPet/PetConfig.gd index 9df6ec2..ade8cba 100644 --- a/Scene/NewPet/PetConfig.gd +++ b/Scene/NewPet/PetConfig.gd @@ -72,6 +72,11 @@ var summon_scale: float = 0.1 # 召唤小弟属性缩放比例(10%) #技能-死亡重生 var enable_death_respawn_skill: bool = false var respawn_health_percentage: float = 0.3 # 重生时恢复的血量百分比(30%) + +#技能-反弹伤害 +var enable_damage_reflection_skill: bool = false +var damage_reflection_cooldown: float = 10.0 # 反弹伤害冷却时间(秒) +var damage_reflection_percentage: float = 0.5 # 反弹伤害百分比(50%) #======================以后有新技能在这里添加============================== # 移动属性 @@ -121,6 +126,9 @@ var pet_configs: Dictionary = { "enable_summon_pet_skill": false, "enable_death_respawn_skill": true, "respawn_health_percentage": 0.4, + "enable_damage_reflection_skill": true, + "damage_reflection_cooldown": 8.0, + "damage_reflection_percentage": 0.6, "move_speed": 180, "dodge_rate": 0.08, "element_type": "FIRE", @@ -160,6 +168,9 @@ var pet_configs: Dictionary = { "summon_count": 2, "summon_scale": 0.15, "enable_death_respawn_skill": false, + "enable_damage_reflection_skill": true, + "damage_reflection_cooldown": 12.0, + "damage_reflection_percentage": 0.4, "move_speed": 120, "dodge_rate": 0.12, "element_type": "WATER", @@ -199,6 +210,9 @@ var pet_configs: Dictionary = { "summon_count": 2, "summon_scale": 0.15, "enable_death_respawn_skill": false, + "enable_damage_reflection_skill": false, + "damage_reflection_cooldown": 10.0, + "damage_reflection_percentage": 0.5, "move_speed": 120, "dodge_rate": 0.12, "element_type": "WATER", @@ -238,6 +252,9 @@ var pet_configs: Dictionary = { "summon_count": 2, "summon_scale": 0.15, "enable_death_respawn_skill": false, + "enable_damage_reflection_skill": false, + "damage_reflection_cooldown": 10.0, + "damage_reflection_percentage": 0.5, "move_speed": 120, "dodge_rate": 0.12, "element_type": "WATER", @@ -315,6 +332,9 @@ func get_default_config() -> Dictionary: "summon_scale": summon_scale, "enable_death_respawn_skill": enable_death_respawn_skill, "respawn_health_percentage": respawn_health_percentage, + "enable_damage_reflection_skill": enable_damage_reflection_skill, + "damage_reflection_cooldown": damage_reflection_cooldown, + "damage_reflection_percentage": damage_reflection_percentage, "move_speed": move_speed, "dodge_rate": dodge_rate, "element_type": element_type, diff --git a/Scene/Pet/BigBeetle.tscn b/Scene/Pet/BigBeetle.tscn deleted file mode 100644 index 05b8ef3..0000000 --- a/Scene/Pet/BigBeetle.tscn +++ /dev/null @@ -1,61 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://bd111pvwvdwv5"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_op7i3"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_c36rm"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_op7i3"] -atlas = ExtResource("2_c36rm") -region = Rect2(72, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_c36rm"] -atlas = ExtResource("2_c36rm") -region = Rect2(120, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"] -atlas = ExtResource("2_c36rm") -region = Rect2(72, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_q454c"] -atlas = ExtResource("2_c36rm") -region = Rect2(96, 48, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_op7i3") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_c36rm") -}], -"loop": true, -"name": &"sleep", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_mjdfm") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_q454c") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[node name="BigBeetle" instance=ExtResource("1_op7i3")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_b73qu") - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false - -[node name="VolumeCollision" parent="." index="1"] -position = Vector2(0.5, 5.5) diff --git a/Scene/Pet/FlyingBird.tscn b/Scene/Pet/FlyingBird.tscn deleted file mode 100644 index 044b88c..0000000 --- a/Scene/Pet/FlyingBird.tscn +++ /dev/null @@ -1,57 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://dia4sld41ne72"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_lgi35"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_wn6km"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_lgi35"] -atlas = ExtResource("2_wn6km") -region = Rect2(192, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_wn6km"] -atlas = ExtResource("2_wn6km") -region = Rect2(144, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_qmpjj"] -atlas = ExtResource("2_wn6km") -region = Rect2(168, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_1mpkc"] -atlas = ExtResource("2_wn6km") -region = Rect2(192, 48, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_lgi35") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_wn6km") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_qmpjj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_1mpkc") -}], -"loop": true, -"name": &"walk", -"speed": 10.0 -}] - -[node name="FlyingBird" instance=ExtResource("1_lgi35")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_b73qu") -frame_progress = 0.111287 - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false - -[node name="VolumeCollision" parent="." index="1"] -position = Vector2(1.5, 1.5) diff --git a/Scene/Pet/GreenSlime.tscn b/Scene/Pet/GreenSlime.tscn deleted file mode 100644 index e1f14a4..0000000 --- a/Scene/Pet/GreenSlime.tscn +++ /dev/null @@ -1,95 +0,0 @@ -[gd_scene load_steps=13 format=3 uid="uid://dqv5q1xhouipa"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_saxlb"] -[ext_resource type="Texture2D" uid="uid://b75oytao5cgjo" path="res://assets/宠物图片/绿色史莱姆.png" id="2_saxlb"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_ou315"] -atlas = ExtResource("2_saxlb") -region = Rect2(0, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_saxlb"] -atlas = ExtResource("2_saxlb") -region = Rect2(72, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_bxslx"] -atlas = ExtResource("2_saxlb") -region = Rect2(48, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dvhl1"] -atlas = ExtResource("2_saxlb") -region = Rect2(24, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_0t1ns"] -atlas = ExtResource("2_saxlb") -region = Rect2(0, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_sbjn0"] -atlas = ExtResource("2_saxlb") -region = Rect2(72, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_qvnbx"] -atlas = ExtResource("2_saxlb") -region = Rect2(48, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_n0kjo"] -atlas = ExtResource("2_saxlb") -region = Rect2(24, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_obu0n"] -atlas = ExtResource("2_saxlb") -region = Rect2(0, 24, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_ou315") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_saxlb") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_bxslx") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dvhl1") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_0t1ns") -}], -"loop": false, -"name": &"wake", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_sbjn0") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_qvnbx") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_n0kjo") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_obu0n") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="GreenSlime" instance=ExtResource("1_saxlb")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_yhcbw") -animation = &"idle" - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false -position = Vector2(-11.25, 3.25) diff --git a/Scene/Pet/LittleKnight.tscn b/Scene/Pet/LittleKnight.tscn deleted file mode 100644 index 70b0373..0000000 --- a/Scene/Pet/LittleKnight.tscn +++ /dev/null @@ -1,167 +0,0 @@ -[gd_scene load_steps=24 format=3 uid="uid://xcigvfp1hms"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_rjt8u"] -[ext_resource type="Texture2D" uid="uid://bal78ts2eq4yu" path="res://assets/宠物图片/护卫.png" id="3_81r1q"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_rjt8u"] -atlas = ExtResource("3_81r1q") -region = Rect2(224, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_81r1q"] -atlas = ExtResource("3_81r1q") -region = Rect2(192, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nliwy"] -atlas = ExtResource("3_81r1q") -region = Rect2(160, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kbr5d"] -atlas = ExtResource("3_81r1q") -region = Rect2(128, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_yhrjc"] -atlas = ExtResource("3_81r1q") -region = Rect2(224, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2dbgw"] -atlas = ExtResource("3_81r1q") -region = Rect2(192, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_h0n46"] -atlas = ExtResource("3_81r1q") -region = Rect2(160, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_1tk7r"] -atlas = ExtResource("3_81r1q") -region = Rect2(128, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ogy1e"] -atlas = ExtResource("3_81r1q") -region = Rect2(96, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mygjj"] -atlas = ExtResource("3_81r1q") -region = Rect2(64, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_rkj0j"] -atlas = ExtResource("3_81r1q") -region = Rect2(32, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_j7anc"] -atlas = ExtResource("3_81r1q") -region = Rect2(0, 64, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_cxgnv"] -atlas = ExtResource("3_81r1q") -region = Rect2(224, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2itrd"] -atlas = ExtResource("3_81r1q") -region = Rect2(192, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_c7ofb"] -atlas = ExtResource("3_81r1q") -region = Rect2(160, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_aa4e4"] -atlas = ExtResource("3_81r1q") -region = Rect2(128, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jx5oo"] -atlas = ExtResource("3_81r1q") -region = Rect2(96, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_umo24"] -atlas = ExtResource("3_81r1q") -region = Rect2(64, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_853s8"] -atlas = ExtResource("3_81r1q") -region = Rect2(32, 96, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6x5xm"] -atlas = ExtResource("3_81r1q") -region = Rect2(0, 96, 32, 32) - -[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_rjt8u") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_81r1q") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_nliwy") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_kbr5d") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_yhrjc") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_2dbgw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_h0n46") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_1tk7r") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ogy1e") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_mygjj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_rkj0j") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_j7anc") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_cxgnv") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_2itrd") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_c7ofb") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_aa4e4") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jx5oo") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_umo24") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_853s8") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_6x5xm") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="LittleKnight" instance=ExtResource("1_rjt8u")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_yhcbw") -frame_progress = 0.272604 - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false -position = Vector2(-8, 4) diff --git a/Scene/Pet/PetBase.tscn b/Scene/Pet/PetBase.tscn deleted file mode 100644 index dbd795d..0000000 --- a/Scene/Pet/PetBase.tscn +++ /dev/null @@ -1,123 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://h66an0p6pl53"] - -[ext_resource type="Script" uid="uid://hucuy8guuj6w" path="res://Script/Pet/PetBase.gd" id="1_xpyyb"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_5si3e"] -[ext_resource type="Texture2D" uid="uid://cdhf25ktn3jp3" path="res://assets/我的世界图片/武器工具/钻石剑.png" id="3_5si3e"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_h4hw6"] -atlas = ExtResource("2_5si3e") -region = Rect2(0, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_51c25"] -atlas = ExtResource("2_5si3e") -region = Rect2(24, 0, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_wmdx5"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_h4hw6") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_h4hw6") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_51c25") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_h4hw6"] -size = Vector2(79, 92) - -[node name="PetBase" type="CharacterBody2D"] -motion_mode = 1 -slide_on_ceiling = false -floor_stop_on_slope = false -floor_block_on_wall = false -script = ExtResource("1_xpyyb") - -[node name="PetImage" type="AnimatedSprite2D" parent="."] -scale = Vector2(4, 4) -sprite_frames = SubResource("SpriteFrames_wmdx5") -animation = &"walk" -autoplay = "walk" - -[node name="PetToolImage" type="Sprite2D" parent="PetImage"] -visible = false -position = Vector2(-10, 0) -texture = ExtResource("3_5si3e") -flip_h = true - -[node name="VolumeCollision" type="CollisionShape2D" parent="."] -position = Vector2(0.5, 2) -shape = SubResource("RectangleShape2D_h4hw6") - -[node name="PetInformVBox" type="VBoxContainer" parent="."] -offset_left = -72.0 -offset_top = -261.0 -offset_right = 430.0 -offset_bottom = 453.0 -scale = Vector2(0.3, 0.3) -alignment = 2 - -[node name="PetNameRichText" type="RichTextLabel" parent="PetInformVBox"] -layout_mode = 2 -size_flags_vertical = 3 -theme_override_font_sizes/normal_font_size = 40 -bbcode_enabled = true -text = "萌芽小绿人" -horizontal_alignment = 1 -vertical_alignment = 2 - -[node name="ArmorBar" type="ProgressBar" parent="PetInformVBox"] -modulate = Color(0.758192, 0.758192, 0.758192, 1) -custom_minimum_size = Vector2(0, 60) -layout_mode = 2 -show_percentage = false - -[node name="ArmorLabel" type="Label" parent="PetInformVBox/ArmorBar"] -layout_mode = 0 -offset_right = 502.0 -offset_bottom = 60.0 -theme_override_font_sizes/font_size = 30 -text = "盔甲值:100/100" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="ShieldBar" type="ProgressBar" parent="PetInformVBox"] -modulate = Color(0, 1, 1, 1) -custom_minimum_size = Vector2(0, 60) -layout_mode = 2 -show_percentage = false - -[node name="ShieldLabel" type="Label" parent="PetInformVBox/ShieldBar"] -layout_mode = 0 -offset_right = 502.0 -offset_bottom = 60.0 -theme_override_font_sizes/font_size = 30 -text = "护盾值:100/100" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="HealthBar" type="ProgressBar" parent="PetInformVBox"] -modulate = Color(0, 1, 0, 1) -custom_minimum_size = Vector2(0, 60) -layout_mode = 2 -show_percentage = false - -[node name="HealthLabel" type="Label" parent="PetInformVBox/HealthBar"] -layout_mode = 0 -offset_right = 502.0 -offset_bottom = 60.0 -theme_override_font_sizes/font_size = 30 -text = "生命值:100/100" -horizontal_alignment = 1 -vertical_alignment = 1 diff --git a/Scene/Pet/PetFightPanel.tscn b/Scene/Pet/PetFightPanel.tscn deleted file mode 100644 index 2cc71da..0000000 --- a/Scene/Pet/PetFightPanel.tscn +++ /dev/null @@ -1,102 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://cw8am7nnbgca5"] - -[ext_resource type="Script" uid="uid://ke4moxwg1gfd" path="res://Script/Pet/PetFightPanel.gd" id="1_h4hw6"] -[ext_resource type="Texture2D" uid="uid://dh0dsw3jr0gra" path="res://assets/宠物对战背景图片/背景2.webp" id="2_h4hw6"] - -[node name="PetFightPanel" type="Panel"] -offset_right = 1400.0 -offset_bottom = 720.0 -script = ExtResource("1_h4hw6") - -[node name="MapBackGround" type="TextureRect" parent="."] -layout_mode = 0 -offset_right = 1557.0 -offset_bottom = 867.0 -scale = Vector2(0.9, 0.9) -texture = ExtResource("2_h4hw6") - -[node name="Title" type="Label" parent="."] -layout_mode = 0 -offset_right = 1400.0 -offset_bottom = 55.0 -theme_override_colors/font_color = Color(0.623819, 1, 0.593898, 1) -theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/shadow_offset_x = 5 -theme_override_constants/shadow_offset_y = 5 -theme_override_constants/outline_size = 20 -theme_override_constants/shadow_outline_size = 10 -theme_override_font_sizes/font_size = 50 -text = "宠物对战" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="team1" type="Node" parent="."] - -[node name="team2" type="Node" parent="."] - -[node name="neutral" type="Node" parent="."] - -[node name="BattleEndPanel" type="Panel" parent="."] -top_level = true -layout_mode = 0 -offset_left = 294.0 -offset_right = 1071.0 -offset_bottom = 720.0 - -[node name="Title" type="Label" parent="BattleEndPanel"] -layout_mode = 0 -offset_right = 777.0 -offset_bottom = 104.0 -theme_override_colors/font_color = Color(0.991435, 0.798103, 0.357309, 1) -theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/shadow_offset_x = 5 -theme_override_constants/shadow_offset_y = 5 -theme_override_constants/outline_size = 20 -theme_override_constants/shadow_outline_size = 20 -theme_override_font_sizes/font_size = 60 -text = "战斗结束" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="Contents" type="Label" parent="BattleEndPanel"] -layout_mode = 0 -offset_top = 104.0 -offset_right = 777.0 -offset_bottom = 567.0 -theme_override_colors/font_color = Color(0, 1, 0, 1) -theme_override_font_sizes/font_size = 30 -text = "[宠物名字]获得300经验, -增加200亲密度" -horizontal_alignment = 1 - -[node name="ReturnFarmButton" type="Button" parent="BattleEndPanel"] -layout_mode = 0 -offset_left = 294.0 -offset_top = 567.0 -offset_right = 502.0 -offset_bottom = 644.0 -theme_override_font_sizes/font_size = 50 -text = "返回农场" - -[node name="PetBattleDetailsPanel" type="Panel" parent="."] -layout_mode = 0 -offset_right = 257.0 -offset_bottom = 720.0 - -[node name="Title" type="Label" parent="PetBattleDetailsPanel"] -layout_mode = 0 -offset_right = 257.0 -offset_bottom = 23.0 -theme_override_font_sizes/font_size = 30 -text = "战斗细节" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="BattleDetails" type="RichTextLabel" parent="PetBattleDetailsPanel"] -layout_mode = 0 -offset_top = 42.0 -offset_right = 257.0 -offset_bottom = 720.0 -bbcode_enabled = true diff --git a/Scene/Pet/Projectile.tscn b/Scene/Pet/Projectile.tscn deleted file mode 100644 index 8e40f1e..0000000 --- a/Scene/Pet/Projectile.tscn +++ /dev/null @@ -1,20 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://bvqkm1n2p6xty"] - -[ext_resource type="Script" uid="uid://cbhhx6st14pse" path="res://Script/Pet/Projectile.gd" id="1_vqkm1"] - -[sub_resource type="CircleShape2D" id="CircleShape2D_1"] -radius = 5.0 - -[node name="Projectile" type="Area2D"] -script = ExtResource("1_vqkm1") - -[node name="ProjectileSprite" type="Sprite2D" parent="."] -modulate = Color(1, 1, 0, 1) -scale = Vector2(0.5, 0.5) - -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource("CircleShape2D_1") - -[node name="Trail" type="Line2D" parent="."] -width = 2.0 -default_color = Color(1, 1, 0, 0.5) diff --git a/Scene/Pet/RedSlime.tscn b/Scene/Pet/RedSlime.tscn deleted file mode 100644 index 7a0316d..0000000 --- a/Scene/Pet/RedSlime.tscn +++ /dev/null @@ -1,96 +0,0 @@ -[gd_scene load_steps=13 format=3 uid="uid://cqfa6ng6x2s8q"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_ff7pm"] -[ext_resource type="Texture2D" uid="uid://cvpsjlje7q3to" path="res://assets/宠物图片/红色史莱姆.png" id="2_ff7pm"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_s7ip1"] -atlas = ExtResource("2_ff7pm") -region = Rect2(0, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ff7pm"] -atlas = ExtResource("2_ff7pm") -region = Rect2(72, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_53j2r"] -atlas = ExtResource("2_ff7pm") -region = Rect2(48, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_0ij01"] -atlas = ExtResource("2_ff7pm") -region = Rect2(24, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_20513"] -atlas = ExtResource("2_ff7pm") -region = Rect2(0, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_3f8fr"] -atlas = ExtResource("2_ff7pm") -region = Rect2(72, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kbexh"] -atlas = ExtResource("2_ff7pm") -region = Rect2(48, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_njkpw"] -atlas = ExtResource("2_ff7pm") -region = Rect2(24, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xbspe"] -atlas = ExtResource("2_ff7pm") -region = Rect2(0, 24, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_s7ip1") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_ff7pm") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_53j2r") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_0ij01") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_20513") -}], -"loop": false, -"name": &"wake", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_3f8fr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_kbexh") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_njkpw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xbspe") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="RedSlime" instance=ExtResource("1_ff7pm")] -position = Vector2(0, -1) - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_yhcbw") -frame_progress = 0.528863 - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false -position = Vector2(-11.25, 3.25) diff --git a/Scene/Pet/SmallBeetle.tscn b/Scene/Pet/SmallBeetle.tscn deleted file mode 100644 index 5d81a0a..0000000 --- a/Scene/Pet/SmallBeetle.tscn +++ /dev/null @@ -1,57 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://ckvagocpiudyu"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_nswws"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_1eo38"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_nswws"] -atlas = ExtResource("2_1eo38") -region = Rect2(0, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"] -atlas = ExtResource("2_1eo38") -region = Rect2(48, 48, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_1eo38"] -atlas = ExtResource("2_1eo38") -region = Rect2(24, 48, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_nswws") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_mjdfm") -}], -"loop": true, -"name": &"sleep", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_nswws") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_1eo38") -}], -"loop": true, -"name": &"walk", -"speed": 5.0 -}] - -[node name="SmallBeetle" instance=ExtResource("1_nswws")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_b73qu") - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false - -[node name="VolumeCollision" parent="." index="1"] -position = Vector2(2, 26) diff --git a/Scene/Pet/SmallBlue.tscn b/Scene/Pet/SmallBlue.tscn deleted file mode 100644 index 556f2ee..0000000 --- a/Scene/Pet/SmallBlue.tscn +++ /dev/null @@ -1,45 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://coryhl8jl4xfg"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_4ggjc"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_stamd"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_stamd"] -atlas = ExtResource("2_stamd") -region = Rect2(48, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_v0b4v"] -atlas = ExtResource("2_stamd") -region = Rect2(72, 0, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_stamd") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_stamd") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_v0b4v") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="SmallBlue" instance=ExtResource("1_4ggjc")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_b2ss3") - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false - -[node name="VolumeCollision" parent="." index="1"] -position = Vector2(0, 1) diff --git a/Scene/Pet/SmallDrillBit.tscn b/Scene/Pet/SmallDrillBit.tscn deleted file mode 100644 index 74fbb33..0000000 --- a/Scene/Pet/SmallDrillBit.tscn +++ /dev/null @@ -1,57 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://cb4spsrxunrrh"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_j2fq3"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_xvdwk"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_j2fq3"] -atlas = ExtResource("2_xvdwk") -region = Rect2(144, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6q1oc"] -atlas = ExtResource("2_xvdwk") -region = Rect2(192, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xvdwk"] -atlas = ExtResource("2_xvdwk") -region = Rect2(168, 24, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_6q1oc"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_j2fq3") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_6q1oc") -}], -"loop": true, -"name": &"sleep", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_j2fq3") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xvdwk") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="SmallDrillBit" instance=ExtResource("1_j2fq3")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_6q1oc") - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false - -[node name="VolumeCollision" parent="." index="1"] -position = Vector2(-1.5, 10.5) diff --git a/Scene/Pet/SmallGreen.tscn b/Scene/Pet/SmallGreen.tscn deleted file mode 100644 index d8f2d4c..0000000 --- a/Scene/Pet/SmallGreen.tscn +++ /dev/null @@ -1,47 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://v8bx7hhl5st6"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_5igge"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_5gxwu"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_5gxwu"] -atlas = ExtResource("2_5gxwu") -region = Rect2(0, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pxsqn"] -atlas = ExtResource("2_5gxwu") -region = Rect2(0, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xxlll"] -atlas = ExtResource("2_5gxwu") -region = Rect2(24, 0, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_k25pl"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_5gxwu") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_pxsqn") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xxlll") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="SmallGreen" instance=ExtResource("1_5igge")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_k25pl") -animation = &"idle" - -[node name="VolumeCollision" parent="." index="1"] -position = Vector2(-0.5, 3) diff --git a/Scene/Pet/SmallOrange.tscn b/Scene/Pet/SmallOrange.tscn deleted file mode 100644 index a45722b..0000000 --- a/Scene/Pet/SmallOrange.tscn +++ /dev/null @@ -1,42 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://c2u0gl7ym1v2e"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_tdtxh"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_5rxf3"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_tdtxh"] -atlas = ExtResource("2_5rxf3") -region = Rect2(0, 24, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_5rxf3"] -atlas = ExtResource("2_5rxf3") -region = Rect2(24, 24, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_ujsmd"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_tdtxh") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_tdtxh") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_5rxf3") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="SmallOrange" instance=ExtResource("1_tdtxh")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_ujsmd") - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false diff --git a/Scene/Pet/SmallPink.tscn b/Scene/Pet/SmallPink.tscn deleted file mode 100644 index f5682a7..0000000 --- a/Scene/Pet/SmallPink.tscn +++ /dev/null @@ -1,47 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://cf76wr07xbxvy"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_cxnqb"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_auciw"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_cxnqb"] -atlas = ExtResource("2_auciw") -region = Rect2(96, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_auciw"] -atlas = ExtResource("2_auciw") -region = Rect2(96, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nrp4g"] -atlas = ExtResource("2_auciw") -region = Rect2(120, 0, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_cxnqb") -}], -"loop": true, -"name": &"idle", -"speed": 8.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_auciw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_nrp4g") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="SmallPink" instance=ExtResource("1_cxnqb")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_b2ss3") -animation = &"idle" - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false diff --git a/Scene/Pet/SmallYellow.tscn b/Scene/Pet/SmallYellow.tscn deleted file mode 100644 index 4252e69..0000000 --- a/Scene/Pet/SmallYellow.tscn +++ /dev/null @@ -1,42 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://i7pgirkgv1u1"] - -[ext_resource type="PackedScene" uid="uid://h66an0p6pl53" path="res://Scene/Pet/PetBase.tscn" id="1_trhvc"] -[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_k5jn7"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_trhvc"] -atlas = ExtResource("2_k5jn7") -region = Rect2(144, 0, 24, 24) - -[sub_resource type="AtlasTexture" id="AtlasTexture_k5jn7"] -atlas = ExtResource("2_k5jn7") -region = Rect2(168, 0, 24, 24) - -[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_trhvc") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_trhvc") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_k5jn7") -}], -"loop": true, -"name": &"walk", -"speed": 8.0 -}] - -[node name="SmallYellow" instance=ExtResource("1_trhvc")] - -[node name="PetImage" parent="." index="0"] -sprite_frames = SubResource("SpriteFrames_yhcbw") - -[node name="PetToolImage" parent="PetImage" index="0"] -visible = false diff --git a/Script/BigPanel/CropStorePanel.gd b/Script/BigPanel/CropStorePanel.gd index 0178f8c..3e1797b 100644 --- a/Script/BigPanel/CropStorePanel.gd +++ b/Script/BigPanel/CropStorePanel.gd @@ -54,16 +54,7 @@ func _ready(): # 隐藏面板(初始默认隐藏) self.hide() -# 面板显示时的处理 -func _on_visibility_changed(): - if visible: - # 面板显示时自动刷新数据 - init_store() - GlobalVariables.isZoomDisabled = true - pass - else: - GlobalVariables.isZoomDisabled = false - pass + # 连接所有按钮信号 func _connect_buttons(): @@ -532,4 +523,15 @@ func _on_refresh_button_pressed() -> void: #关闭种子商店面板 func _on_quit_button_pressed(): self.hide() + +# 面板显示时的处理 +func _on_visibility_changed(): + if visible: + # 面板显示时自动刷新数据 + init_store() + GlobalVariables.isZoomDisabled = true + pass + else: + GlobalVariables.isZoomDisabled = false + pass #=========================面板通用处理========================= diff --git a/Script/BigPanel/CropWarehousePanel.gd b/Script/BigPanel/CropWarehousePanel.gd index a054bda..c3afedc 100644 --- a/Script/BigPanel/CropWarehousePanel.gd +++ b/Script/BigPanel/CropWarehousePanel.gd @@ -32,9 +32,8 @@ extends Panel @onready var login_panel: PanelContainer = $'../LoginPanel' -# 作物图片缓存(复用主游戏的缓存系统) -var crop_textures_cache : Dictionary = {} -var crop_frame_counts : Dictionary = {} +# 注意:作物图片现在使用主游戏的CropTextureManager缓存系统 +# 不再需要本地缓存变量 # 当前过滤和排序设置 var current_filter_quality = "" @@ -84,7 +83,7 @@ func set_pet_feeding_mode(feeding_mode: bool, pet_data: Dictionary = {}): # 更新UI以反映当前模式 if is_pet_feeding_mode: # 宠物喂食模式下,只显示有喂养效果的作物 - var pet_name = pet_data.get("基本信息", {}).get("宠物名称", "未知宠物") + var pet_name = pet_data.get("pet_name", "未知宠物") Toast.show("宠物喂食模式:选择要喂给 " + pet_name + " 的作物", Color.CYAN, 3.0, 1.0) else: # 普通模式 @@ -423,8 +422,8 @@ func _on_crop_feed_selected(crop_name: String, crop_count: int): var feed_effects = crop_data.get("喂养效果", {}) # 获取宠物信息 - var pet_name = current_pet_data.get("基本信息", {}).get("宠物名称", "未知宠物") - var pet_id = current_pet_data.get("基本信息", {}).get("宠物ID", "") + var pet_name = current_pet_data.get("pet_name", "未知宠物") + var pet_id = current_pet_data.get("pet_id", "") if pet_id == "": Toast.show("宠物ID无效", Color.RED, 2.0, 1.0) @@ -511,7 +510,8 @@ func _send_feed_pet_request(crop_name: String, pet_id: String, feed_effects: Dic # 获取作物的收获物图片(用于仓库显示) func _get_crop_harvest_texture(crop_name: String) -> Texture2D: - # 尝试加载"收获物.webp"图片 + # 使用作物键名(而不是成熟物名称)来构建图片路径 + # crop_name 是作物的键名,如"可可豆"、"向日葵"等 var crop_path = "res://assets/作物/" + crop_name + "/" var harvest_texture_path = crop_path + "收获物.webp" @@ -521,8 +521,7 @@ func _get_crop_harvest_texture(crop_name: String) -> Texture2D: print("仓库加载作物收获物图片:", crop_name) return texture - - # 如果都没有找到,使用默认的收获物图片 + # 如果没有找到,使用默认的收获物图片 var default_harvest_path = "res://assets/作物/默认/收获物.webp" if ResourceLoader.exists(default_harvest_path): var texture = load(default_harvest_path) diff --git a/Script/BigPanel/DailyCheckInPanel.gd b/Script/BigPanel/DailyCheckInPanel.gd index 46a419c..8811cdc 100644 --- a/Script/BigPanel/DailyCheckInPanel.gd +++ b/Script/BigPanel/DailyCheckInPanel.gd @@ -10,6 +10,9 @@ signal check_in_failed(error_message: String) @onready var main_game = get_node("/root/main") @onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel' +@onready var confirm_dialog: ConfirmationDialog = $ConfirmDialog #确认弹窗 + + var check_in_history: Dictionary = {} var consecutive_days: int = 0 var has_checked_in_today: bool = false @@ -35,7 +38,9 @@ func handle_daily_check_in_response(response: Dictionary) -> void: consecutive_days = response.get("consecutive_days", 0) has_checked_in_today = true - _show_reward_animation(rewards) + # 显示奖励内容 + _show_reward_content(rewards) + _set_button_state(false, "已签到", Color(0.7, 0.7, 0.7, 1)) check_in_completed.emit(rewards) @@ -86,17 +91,6 @@ func execute_check_in() -> void: daily_check_in_button.disabled = false daily_check_in_button.text = "签到" -func _show_reward_animation(rewards: Dictionary) -> void: - daily_check_in_reward.text = _format_reward_text(rewards) - daily_check_in_reward.show() - - var tween = create_tween() - tween.parallel().tween_method(_animate_reward_display, 0.0, 1.0, 0.5) - -func _animate_reward_display(progress: float) -> void: - daily_check_in_reward.modulate.a = progress - var scale = 0.8 + (0.2 * progress) - daily_check_in_reward.scale = Vector2(scale, scale) func _format_reward_text(rewards: Dictionary) -> String: var text = "" @@ -162,6 +156,11 @@ func _get_rarity_color(rarity: String) -> String: "传奇": return "#FF8C00" _: return "#FFFFFF" +func _show_reward_content(rewards: Dictionary) -> void: + var reward_text = _format_reward_text(rewards) + daily_check_in_reward.text = reward_text + daily_check_in_reward.show() + func _update_display() -> void: var history_text = "[center][color=#FFB6C1]📋 签到历史[/color][/center]\n" @@ -194,6 +193,16 @@ func _on_quit_button_pressed() -> void: self.hide() func _on_daily_check_in_button_pressed() -> void: + # 显示确认弹窗 + confirm_dialog.title = "每日签到确认" + confirm_dialog.dialog_text = "确定要进行今日签到吗?\n签到可获得金币、经验和种子奖励!" + confirm_dialog.popup_centered() + + # 连接确认信号(如果还没连接的话) + if not confirm_dialog.confirmed.is_connected(_on_confirm_check_in): + confirm_dialog.confirmed.connect(_on_confirm_check_in) + +func _on_confirm_check_in() -> void: execute_check_in() func _on_visibility_changed(): diff --git a/Script/BigPanel/ItemBagPanel.gd b/Script/BigPanel/ItemBagPanel.gd index aa9f79f..7047d2e 100644 --- a/Script/BigPanel/ItemBagPanel.gd +++ b/Script/BigPanel/ItemBagPanel.gd @@ -371,8 +371,8 @@ func _show_pet_item_confirmation_dialog(item_name: String, item_count: int): Toast.show("宠物数据丢失,请重新选择宠物", Color.RED, 2.0, 1.0) return - var pet_name = current_pet_data.get("基本信息", {}).get("宠物名称", "未知宠物") - var pet_id = current_pet_data.get("基本信息", {}).get("宠物ID", "") + var pet_name = current_pet_data.get("pet_name", "未知宠物") + var pet_id = current_pet_data.get("pet_id", "") # 获取道具信息 var item_config = _load_item_config() @@ -514,4 +514,4 @@ func get_selected_item_name() -> String: # 检查是否有道具被选择 func is_item_currently_selected() -> bool: - return is_item_selected + return is_item_selected diff --git a/Script/BigPanel/LoginPanel.gd b/Script/BigPanel/LoginPanel.gd index 858a5fa..9843017 100644 --- a/Script/BigPanel/LoginPanel.gd +++ b/Script/BigPanel/LoginPanel.gd @@ -567,3 +567,13 @@ func _set_status(label: Label, text: String, color: Color): #面板显示与隐藏切换处理 func _on_visibility_changed(): GlobalVariables.isZoomDisabled = visible + +#注册面板返回登录面板 +func _on_register_2_login_button_pressed() -> void: + _switch_to_login_panel() + pass + +#找回密码面板返回登录面板 +func _on_forget_2_login_button_pressed() -> void: + _switch_to_login_panel() + pass diff --git a/Script/BigPanel/LuckyDrawPanel.gd b/Script/BigPanel/LuckyDrawPanel.gd index 2bd4d20..7eebdba 100644 --- a/Script/BigPanel/LuckyDrawPanel.gd +++ b/Script/BigPanel/LuckyDrawPanel.gd @@ -10,6 +10,9 @@ signal draw_failed(error_message: String) @onready var main_game = get_node("/root/main") @onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel' +@onready var confirm_dialog: ConfirmationDialog = $ConfirmDialog #确认弹窗 + + var reward_templates: Array[RichTextLabel] = [] var current_rewards: Array = [] var seed_rewards: Dictionary = {} @@ -212,10 +215,8 @@ func _perform_network_draw(draw_type: String) -> void: func _show_waiting_animation() -> void: _set_draw_buttons_enabled(false) lucky_draw_reward.hide() - _play_anticipation_animation() func handle_lucky_draw_response(response: Dictionary) -> void: - _stop_anticipation_animation() _set_draw_buttons_enabled(true) if response.get("success", false): @@ -237,8 +238,7 @@ func _show_server_draw_results(rewards: Array, draw_type: String, cost: int) -> lucky_draw_reward.text = result_text lucky_draw_reward.show() - _play_result_animation() - + func _format_server_draw_results(rewards: Array, draw_type: String, cost: int) -> String: var type_names = {"single": "单抽", "five": "五连抽", "ten": "十连抽"} @@ -338,40 +338,11 @@ func _format_package_content(content: Dictionary) -> String: "seed": return "[color=#90EE90]🌱%sx%d[/color]" % [content.get("name", "种子"), amount] _: return "" -func _play_anticipation_animation() -> void: - _stop_anticipation_animation() - - anticipation_tween = create_tween() - anticipation_tween.set_loops() - - for template in reward_templates: - if template.visible: - anticipation_tween.parallel().tween_method( - func(progress: float): _anticipation_flash(template, progress), - 0.0, 1.0, 0.8 - ) func _anticipation_flash(template: RichTextLabel, progress: float) -> void: var flash_intensity = 1.0 + sin(progress * PI * 2) * 0.2 template.modulate = Color(flash_intensity, flash_intensity, flash_intensity, 1.0) -func _stop_anticipation_animation() -> void: - if anticipation_tween: - anticipation_tween.kill() - anticipation_tween = null - - for template in reward_templates: - template.modulate = Color.WHITE - -func _play_result_animation() -> void: - var tween = create_tween() - - lucky_draw_reward.modulate.a = 0.0 - lucky_draw_reward.scale = Vector2(0.8, 0.8) - - tween.parallel().tween_property(lucky_draw_reward, "modulate:a", 1.0, 0.5) - tween.parallel().tween_property(lucky_draw_reward, "scale", Vector2(1.0, 1.0), 0.5) - tween.tween_callback(func(): lucky_draw_reward.modulate.a = 1.0) func _show_error_message(message: String) -> void: lucky_draw_reward.text = "[center][color=#FF6B6B]❌ %s[/color][/center]" % message @@ -396,13 +367,33 @@ func _on_quit_button_pressed() -> void: self.hide() func _on_lucky_draw_button_pressed() -> void: - _perform_network_draw("single") + _show_draw_confirmation("single") func _on_five_lucky_draw_button_pressed() -> void: - _perform_network_draw("five") + _show_draw_confirmation("five") func _on_ten_lucky_draw_button_pressed() -> void: - _perform_network_draw("ten") + _show_draw_confirmation("ten") + +func _show_draw_confirmation(draw_type: String) -> void: + var cost = draw_costs.get(draw_type, 800) + var type_names = {"single": "单抽", "five": "五连抽", "ten": "十连抽"} + var type_name = type_names.get(draw_type, draw_type) + + confirm_dialog.title = "幸运抽奖确认" + confirm_dialog.dialog_text = "确定要进行%s吗?\n需要花费 %d 金币\n\n可能获得金币、经验、种子等奖励!" % [type_name, cost] + confirm_dialog.popup_centered() + + # 保存当前抽奖类型 + confirm_dialog.set_meta("draw_type", draw_type) + + # 连接确认信号(如果还没连接的话) + if not confirm_dialog.confirmed.is_connected(_on_confirm_draw): + confirm_dialog.confirmed.connect(_on_confirm_draw) + +func _on_confirm_draw() -> void: + var draw_type = confirm_dialog.get_meta("draw_type", "single") + _perform_network_draw(draw_type) func _on_visibility_changed(): if visible: diff --git a/Script/BigPanel/PetStorePanel.gd b/Script/BigPanel/PetStorePanel.gd index e4ce44d..701d4cd 100644 --- a/Script/BigPanel/PetStorePanel.gd +++ b/Script/BigPanel/PetStorePanel.gd @@ -289,6 +289,7 @@ func _on_confirm_buy_pet(pet_name: String, pet_cost: int, dialog: AcceptDialog): # 发送购买请求到服务器 _send_buy_pet_request(pet_name, pet_cost) + init_pet_store() dialog.queue_free() # 取消购买宠物 @@ -310,6 +311,7 @@ func _send_buy_pet_request(pet_name: String, pet_cost: int): #=========================面板通用处理========================= # 手动刷新宠物商店面板 +#刷新按钮点击 func _on_refresh_button_pressed() -> void: # 清空现有配置和请求状态,强制重新获取 pet_config = {} diff --git a/Script/BigPanel/PlayerRankingPanel.gd b/Script/BigPanel/PlayerRankingPanel.gd index 3e3e488..56eb72f 100644 --- a/Script/BigPanel/PlayerRankingPanel.gd +++ b/Script/BigPanel/PlayerRankingPanel.gd @@ -49,6 +49,8 @@ func _ready() -> void: # 隐藏模板 player_info_template.visible = false + # 连接可见性改变信号 + visibility_changed.connect(_on_visibility_changed) # 连接按钮信号 refresh_button.pressed.connect(_on_refresh_button_pressed) quit_button.pressed.connect(_on_quit_button_pressed) @@ -265,6 +267,37 @@ func _on_visit_player_pressed(username): else: Toast.show("网络管理器不可用", Color.RED) + +#搜索按钮点击 - 通过QQ号查询玩家 +func _on_search_button_pressed(): + var search_text = search_line_edit.text.strip_edges() + + # 如果搜索框为空,清除搜索条件 + if search_text == "": + current_search_qq = "" + Toast.show("已清除搜索条件", Color.YELLOW) + else: + # 验证输入是否为数字(QQ号) + if not search_text.is_valid_int(): + Toast.show("请输入有效的QQ号(纯数字)", Color.RED) + return + + current_search_qq = search_text + Toast.show("搜索QQ号:" + search_text, Color.YELLOW) + + # 重新请求排行榜 + request_player_rankings() + +#===================通用面板处理====================== +# 面板显示时的处理 +func _on_visibility_changed(): + if visible: + GlobalVariables.isZoomDisabled = true + pass + else: + GlobalVariables.isZoomDisabled = false + pass + # 刷新按钮点击 func _on_refresh_button_pressed(): # 检查网络连接 @@ -299,22 +332,4 @@ func _on_quit_button_pressed(): self.hide() -#搜索按钮点击 - 通过QQ号查询玩家 -func _on_search_button_pressed(): - var search_text = search_line_edit.text.strip_edges() - - # 如果搜索框为空,清除搜索条件 - if search_text == "": - current_search_qq = "" - Toast.show("已清除搜索条件", Color.YELLOW) - else: - # 验证输入是否为数字(QQ号) - if not search_text.is_valid_int(): - Toast.show("请输入有效的QQ号(纯数字)", Color.RED) - return - - current_search_qq = search_text - Toast.show("搜索QQ号:" + search_text, Color.YELLOW) - - # 重新请求排行榜 - request_player_rankings() +#===================通用面板处理====================== diff --git a/Script/Pet/PetBase.gd b/Script/Pet/PetBase.gd deleted file mode 100644 index 4a01e69..0000000 --- a/Script/Pet/PetBase.gd +++ /dev/null @@ -1,2154 +0,0 @@ -extends CharacterBody2D - -@onready var pet_image: AnimatedSprite2D = $PetImage #这里展示宠物动画 -@onready var pet_tool_image: Sprite2D = $PetImage/PetToolImage #这里展示宠物武器工具 -@onready var pet_name_rich_text: RichTextLabel = $PetInformVBox/PetNameRichText #这里展示主人给宠物命名的名字 -@onready var armor_bar: ProgressBar = $PetInformVBox/ArmorBar #宠物盔甲值进度条 -@onready var armor_label: Label = $PetInformVBox/ArmorBar/ArmorLabel #宠物盔甲值 -@onready var shield_bar: ProgressBar = $PetInformVBox/ShieldBar #宠物护盾值进度条 -@onready var shield_label: Label = $PetInformVBox/ShieldBar/ShieldLabel #宠物护盾值 -@onready var health_bar: ProgressBar = $PetInformVBox/HealthBar #宠物生命值进度条 -@onready var health_label: Label = $PetInformVBox/HealthBar/HealthLabel #宠物生命值 -@onready var volume_collision: CollisionShape2D = $VolumeCollision #宠物碰撞体积 - - -#=====================宠物基本属性===================== -### 一、基础信息 -#- 主人(主人名字) -#- 生日(年月日时分秒) -#- 年龄(从生日开始算 -#- 性格(开朗,内向,活泼,安静,暴躁,温和,调皮,懒惰 -#- 简介 -#- 爱好 -#- 宠物ID(唯一标识,从0000开始) -#- 宠物类型(宠物原本的名字,比如绿史莱姆,红史莱姆,迷你护卫,小绿人) -#- 宠物名称 (主人给宠物命名的名字) -#- 能否购买(true/false) -#- 购买价格(如果可以购买) -#- 出售价格(如果可以出售) - -### 二、生存与防御 -#- 生命值(可恢复,小于等于0则死亡) -#- 护盾值(不可恢复的生命值) -#- 护甲值(折扣伤害) -#- 生命恢复(恢复生命值,多少秒恢复多少生命值,如0.5秒恢复10点生命值) -#- 闪避率(免疫伤害概率) -#- 控制抗性(减免被控时长和概率) -#- 击退抗性(抵消击退力度) -#- 移动速度 - -### 三、攻击与效果 -#- 普通攻击伤害 -#- 普通攻击速度 -#- 暴击率(暴击概率) -#- 暴击伤害 -#- 护甲穿透(忽视敌人护甲) -#- 生命汲取(普攻回血%) -#- 击退(攻击使敌人后退) - -### 四、其他属性 -#- 元素属性(金木水火土,雷) -#- 等级(等级高属性强) -#- 经验值(满额升级) -#- 亲密度(额外加属性) -#- 品质(白/绿/蓝/橙/红/紫) - -#近战 -#近战攻击伤害 -#近战攻击速度 - -#附录 -#- 护甲公式示例:实际伤害 = 基础伤害 × (1 - 护甲值/(护甲值 + 100)),搭配"护甲穿透"可直接减少目标护甲值 -#- 元素克制:火属性攻击对冰属性敌人造成150%伤害,同时被水属性克制(仅造成80%伤害) -#- 成长曲线:低级宠物升级快,高级宠物经验需求指数增长,避免养成周期过短 - -#特殊机制 -#1.伤害反弹,无视防具穿透伤害, -#2.血量低于某个值进入狂暴模式, -#3.死亡后重生一次, -#4.毅力不倒、不死图腾(受到致命伤害抵挡并维持一滴血) -#5.援助 宠物血量低于某个值时,会自动召唤宠物仆从,宠物仆从会自动攻击敌人,唤数量(一次召唤多少个宠物仆从),唤间隔(多少秒召唤一次) -#=====================宠物基本属性===================== - - -# 宠物基本属性(从JSON配置文件加载) -var pet_owner: String = "树萌芽" # 宠物主人 -var pet_name: String = "宠物名称" # 宠物名称 -var pet_team: String = "team1" # 队伍标识:team1, team2, neutral -var pet_id: String = "0001" # 宠物唯一ID -var pet_type: String = "小绿人" # 宠物类型(原本名字) -var pet_birthday: String = "" # 生日(年月日时分秒) -var pet_age: int = 0 # 年龄(天数) -var pet_personality: String = "活泼" # 性格 -var pet_introduction: String = "" # 简介 -var pet_hobby: String = "" # 爱好 - -var pet_level: int = 1 # 宠物等级 -var pet_experience: float = 0.0 # 当前经验值 -var max_experience: float = 100.0 # 升级所需经验值 -var pet_intimacy: float = 0.0 # 亲密度 -var max_intimacy: float = 1000.0 # 最大亲密度 - -var can_buy: bool = true # 能否购买 -var buy_price: int = 100 # 购买价格 -var sell_price: int = 50 # 出售价格 - -# 生命与防御属性 -var max_health: float = 100.0 # 最大生命值 -var current_health: float = 100.0 # 当前生命值 -var health_regen: float = 1.0 # 生命恢复速度(每秒) -var max_shield: float = 0.0 # 最大护盾值 -var current_shield: float = 0.0 # 当前护盾值 -var shield_regen: float = 0.0 # 护盾恢复速度(每秒)- 默认不恢复 -var max_armor: float = 100.0 # 最大护甲值 -var current_armor: float = 100.0 # 当前护甲值 - -# 攻击属性 -var attack_type: AttackType = AttackType.RANGED # 攻击类型 -var attack_damage: float = 20.0 # 基础攻击伤害 -var attack_range: float = 400.0 # 攻击距离 -var crit_rate: float = 0.1 # 暴击率(0.0-1.0) -var crit_damage: float = 1.5 # 暴击伤害倍数 -var life_steal: float = 0.1 # 生命汲取(0.0-1.0) -var armor_penetration: float = 0.0 # 护甲穿透 - -var melee_damage_bonus: float = 0.0 # 近战额外伤害(在基础伤害上加成) -var melee_attack_speed: float = 1.0 # 近战攻击速度 - -var ranged_damage_bonus: float = 0.0 # 远程额外伤害(在基础伤害上加成) -var ranged_attack_speed: float = 1.0 # 远程攻击速度 -var ranged_mode: RangedAttackMode = RangedAttackMode.SINGLE # 远程攻击模式 -var projectile_speed: float = 300.0 # 子弹速度 - -var shotgun_bullets: int = 5 # 散弹数量 -var shotgun_spread_angle: float = 45.0 # 散弹扩散角度(度) - -var burst_rows: int = 2 # 多发射击行数 -var burst_cols: int = 3 # 多发射击列数 -var burst_spacing: float = 30.0 # 多发射击间距 - -var gatling_bullets: int = 8 # 加特林子弹数量 -var gatling_interval: float = 0.1 # 加特林射击间隔 -var gatling_cooldown: float = 2.0 # 加特林冷却时间 - -var pierce_count: int = 3 # 穿透数量 - -# 远程攻击类型枚举 -enum AttackType { - MELEE, # 近战攻击 - RANGED # 远程攻击 -} - -enum RangedAttackMode { - SINGLE, # 普通单发 - SHOTGUN, # 散弹攻击 - BURST, # 多发射击(平行) - GATLING, # 加特林式连射 - PIERCING # 穿透攻击 -} - - -var attack_speed: float = 1.0 # 当前攻击速度(根据攻击类型动态设置) -var gatling_firing: bool = false # 是否正在加特林射击 -var gatling_current_bullet: int = 0 # 当前加特林子弹计数 -var gatling_last_shot: float = 0.0 # 上次加特林射击时间 - -@export var projectile_scene: PackedScene = preload("res://Scene/Pet/Projectile.tscn") # 子弹场景 - -# 移动与闪避属性 -var move_speed: float = 100.0 # 移动速度 -var dodge_rate: float = 0.05 # 闪避率(0.0-1.0) -var knockback_force: float = 300.0 # 击退力度 -var knockback_resist: float = 0.0 # 击退抗性(0.0-1.0) - -# 元素属性 -enum ElementType { - NONE, # 无属性 - METAL, # 金 - WOOD, # 木 - WATER, # 水 - FIRE, # 火 - EARTH, # 土 - THUNDER # 雷 -} -var element_type: ElementType = ElementType.NONE# 宠物元素属性 -var element_damage_bonus: float = 50.0 # 元素克制额外伤害 - -var control_resist: float = 0.0 # 控制抗性(减少眩晕等控制时间) -var damage_reflect: float = 0.0 # 伤害反弹(0.0-1.0) -var death_immunity: bool = false # 死亡免疫(一次性) -var berserker_threshold: float = 0.3 # 狂暴阈值(血量低于此值时触发狂暴) -var berserker_bonus: float = 1.5 # 狂暴状态伤害倍数 - -# 特殊机制开关(布尔值控制是否启用各种特殊机制) -var enable_damage_reflect: bool = false # 启用伤害反弹机制 -var enable_berserker_mode: bool = false # 启用狂暴模式机制 -var enable_death_immunity: bool = false # 启用死亡免疫机制 -var enable_aid_system: bool = false # 启用援助召唤机制 -var enable_resurrection: bool = false # 启用死亡重生机制 -var resurrection_used: bool = false # 重生是否已使用 - -# 援助系统属性 -var aid_threshold: float = 0.2 # 援助触发阈值(血量低于此值时召唤援助) -var aid_summon_count: int = 2 # 一次召唤的援助数量 -var aid_summon_interval: float = 5.0 # 援助召唤间隔(秒) -var aid_last_summon_time: float = 0.0 # 上次召唤援助的时间 -var aid_summoned: bool = false # 是否已经召唤过援助(防止重复召唤) -var aid_minions: Array[CharacterBody2D] = [] # 召唤的援助宠物列表 - -# 品质系统 -enum PetQuality { - COMMON, # 普通(白) - UNCOMMON, # 不凡(绿) - RARE, # 稀有(蓝) - EPIC, # 史诗(紫) - LEGENDARY, # 传说(橙) - MYTHIC # 神话(红) -} -var pet_quality: PetQuality = PetQuality.COMMON # 宠物品质 - -# 战斗状态 -var is_alive: bool = true # 是否存活 -var is_dying: bool = false # 是否正在死亡过程中(防止重复调用die()) -var is_attacking: bool = false # 是否正在攻击 -var is_berserker: bool = false # 是否处于狂暴状态 -var is_stunned: bool = false # 是否被眩晕 -var is_invulnerable: bool = false # 是否无敌 -var current_target: CharacterBody2D = null # 当前目标 -var last_attacker: CharacterBody2D = null # 最后攻击者(用于击杀奖励) -var last_attack_time: float = 0.0 # 上次攻击时间 -var last_regen_time: float = 0.0 # 上次恢复时间 -var last_target_check_time: float = 0.0 # 上次目标检查时间 - -# 受伤动画相关 -var hurt_tween: Tween = null # 受伤动画缓动 -var original_modulate: Color = Color.WHITE # 原始颜色 -var last_hurt_time: float = 0.0 # 上次受伤时间(防止受伤动画过于频繁) -var hurt_animation_cooldown: float = 0.3 # 受伤动画冷却时间 - -# 攻击频率控制 -var min_attack_interval: float = 0.5 # 最小攻击间隔(防止攻击过于频繁) - -# 伤害反弹保护 -var damage_reflect_depth: int = 0 # 伤害反弹递归深度 -var max_reflect_depth: int = 3 # 最大反弹深度(防止无限递归) - -# 性能保护 -var performance_mode: bool = false # 性能模式(减少特效和计算) -var frame_skip_counter: int = 0 # 帧跳跃计数器 - -# 升级系统 - 基础属性列表(每次升级随机选择加点) -var base_upgrade_attributes: Array[String] = [ - "max_health", # 最大生命值 - "attack_damage", # 攻击伤害 - "move_speed", # 移动速度 - "max_shield", # 最大护盾值 - "max_armor", # 最大护甲值 - "crit_rate", # 暴击率 - "health_regen", # 生命恢复 - "attack_range" # 攻击距离 -] - -# 每次升级随机选择的属性数量 -var attributes_per_level: int = 3 - -# 每5级额外属性奖励表 -var level_milestone_bonuses: Dictionary = { - 5: {"max_health": 20, "attack_damage": 5, "crit_rate": 0.02}, - 10: {"max_shield": 30, "armor_penetration": 5, "life_steal": 0.05}, - 15: {"max_armor": 25, "knockback_resist": 0.1, "dodge_rate": 0.03}, - 20: {"health_regen": 2, "move_speed": 15, "attack_range": 30}, - 25: {"max_health": 40, "attack_damage": 10, "enable_berserker_mode": true}, - 30: {"max_shield": 50, "shield_regen": 1, "enable_damage_reflect": true}, - 35: {"crit_damage": 0.3, "berserker_bonus": 0.2, "damage_reflect": 0.05}, - 40: {"max_armor": 40, "control_resist": 0.15, "enable_aid_system": true}, - 45: {"projectile_speed": 50, "pierce_count": 1, "enable_death_immunity": true}, - 50: {"max_health": 100, "attack_damage": 25, "enable_resurrection": true} -} - -# 巡逻状态 -var is_patrolling: bool = false # 是否正在巡逻 -var patrol_path: PackedVector2Array = [] # 巡逻路径点 -var patrol_speed: float = 80.0 # 巡逻移动速度 -var current_patrol_index: int = 0 # 当前巡逻目标点索引 -var patrol_wait_time: float = 0.0 # 在巡逻点等待的时间 -var patrol_max_wait_time: float = 1.0 # 在巡逻点的最大等待时间 - -# 战斗控制 -var combat_enabled: bool = true # 是否启用战斗行为 - -# AI状态 -enum PetState { - IDLE, #站立空闲 - MOVING_TO_TARGET, #移动到目标 - ATTACKING, #攻击 - PATROLLING, #巡逻 - DEAD #死亡 -} -var current_state: PetState = PetState.IDLE # 当前状态 - -# 队伍节点引用 -var team_nodes: Dictionary = {} - -# 从JSON配置文件加载宠物配置(强制要求) -func load_pet_config_from_json(): - var file = FileAccess.open("res://Data/pet_data.json", FileAccess.READ) - if not file: - set_basic_default_values() - return - - var json_string = file.get_as_text() - file.close() - - var json = JSON.new() - var parse_result = json.parse(json_string) - if parse_result != OK: - set_basic_default_values() - return - - var pet_configs = json.data - var pet_name_key = get_pet_name_key() - - if not pet_configs.has(pet_name_key): - set_basic_default_values() - return - - var config = pet_configs[pet_name_key] - apply_json_config(config) - -# 设置基本默认值(当JSON加载失败时使用) -func set_basic_default_values(): - # 基本信息 - pet_owner = "未知主人" - pet_name = "未配置宠物" - pet_team = "team1" - pet_id = "0000" - pet_type = "未知类型" - pet_birthday = "" - pet_age = 0 - pet_personality = "活泼" - pet_introduction = "" - pet_hobby = "" - - # 等级经验 - pet_level = 1 - pet_experience = 0.0 - max_experience = 100.0 - pet_intimacy = 0.0 - max_intimacy = 1000.0 - - # 购买信息 - can_buy = true - buy_price = 100 - sell_price = 50 - - # 生命与防御 - max_health = 100.0 - current_health = 100.0 - health_regen = 1.0 - max_shield = 0.0 - current_shield = 0.0 - shield_regen = 0.0 - max_armor = 100.0 - current_armor = 100.0 - - # 基础攻击属性 - attack_type = AttackType.RANGED - attack_damage = 20.0 - attack_range = 300.0 - crit_rate = 0.1 - crit_damage = 1.5 - life_steal = 0.1 - armor_penetration = 0.0 - - # 近战攻击 - melee_damage_bonus = 0.0 - melee_attack_speed = 1.0 - - # 远程攻击 - ranged_damage_bonus = 0.0 - ranged_attack_speed = 1.0 - ranged_mode = RangedAttackMode.SINGLE - projectile_speed = 300.0 - - # 散弹攻击 - shotgun_bullets = 5 - shotgun_spread_angle = 45.0 - - # 多发射击 - burst_rows = 2 - burst_cols = 3 - burst_spacing = 30.0 - - # 加特林属性 - gatling_bullets = 8 - gatling_interval = 0.1 - gatling_cooldown = 2.0 - - # 穿透属性 - pierce_count = 3 - - # 移动与闪避 - move_speed = 100.0 - dodge_rate = 0.05 - knockback_force = 300.0 - knockback_resist = 0.0 - - # 元素属性 - element_type = ElementType.NONE - element_damage_bonus = 50.0 - - # 特殊属性 - control_resist = 0.0 - damage_reflect = 0.0 - death_immunity = false - berserker_threshold = 0.3 - berserker_bonus = 1.5 - - # 特殊机制开关 - enable_damage_reflect = false - enable_berserker_mode = false - enable_death_immunity = false - enable_aid_system = false - enable_resurrection = false - - # 援助系统 - aid_threshold = 0.2 - aid_summon_count = 2 - aid_summon_interval = 5.0 - - # 品质系统 - pet_quality = PetQuality.COMMON - -# 获取宠物名称键(用于JSON配置查找) -func get_pet_name_key() -> String: - # 直接返回宠物类型作为JSON键 - # 现在pet_type已经是正确的JSON键名了 - return pet_type - -# 应用JSON配置到宠物属性 -func apply_json_config(config: Dictionary): - # 基本信息 - if config.has("基本信息"): - var basic_info = config["基本信息"] - if basic_info.has("宠物主人"): - pet_owner = basic_info["宠物主人"] - if basic_info.has("宠物名称"): - pet_name = basic_info["宠物名称"] - if basic_info.has("队伍标识"): - pet_team = basic_info["队伍标识"] - if basic_info.has("宠物ID"): - pet_id = basic_info["宠物ID"] - if basic_info.has("宠物类型"): - pet_type = basic_info["宠物类型"] - if basic_info.has("生日"): - pet_birthday = basic_info["生日"] - if basic_info.has("年龄"): - pet_age = basic_info["年龄"] - if basic_info.has("性格"): - pet_personality = basic_info["性格"] - if basic_info.has("简介"): - pet_introduction = basic_info["简介"] - if basic_info.has("爱好"): - pet_hobby = basic_info["爱好"] - - # 等级经验 - if config.has("等级经验"): - var level_exp = config["等级经验"] - if level_exp.has("宠物等级"): - pet_level = level_exp["宠物等级"] - if level_exp.has("当前经验"): - pet_experience = level_exp["当前经验"] - if level_exp.has("最大经验"): - max_experience = level_exp["最大经验"] - if level_exp.has("亲密度"): - pet_intimacy = level_exp["亲密度"] - if level_exp.has("最大亲密度"): - max_intimacy = level_exp["最大亲密度"] - - # 购买信息 - if config.has("购买信息"): - var buy_info = config["购买信息"] - if buy_info.has("能否购买"): - can_buy = buy_info["能否购买"] - if buy_info.has("购买价格"): - buy_price = buy_info["购买价格"] - if buy_info.has("出售价格"): - sell_price = buy_info["出售价格"] - - # 生命与防御 - if config.has("生命与防御"): - var health_defense = config["生命与防御"] - if health_defense.has("最大生命值"): - max_health = health_defense["最大生命值"] - if health_defense.has("当前生命值"): - current_health = health_defense["当前生命值"] - if health_defense.has("生命恢复速度"): - health_regen = health_defense["生命恢复速度"] - if health_defense.has("最大护盾值"): - max_shield = health_defense["最大护盾值"] - if health_defense.has("当前护盾值"): - current_shield = health_defense["当前护盾值"] - if health_defense.has("护盾恢复速度"): - shield_regen = health_defense["护盾恢复速度"] - if health_defense.has("最大护甲值"): - max_armor = health_defense["最大护甲值"] - if health_defense.has("当前护甲值"): - current_armor = health_defense["当前护甲值"] - - # 基础攻击属性 - if config.has("基础攻击属性"): - var attack_attr = config["基础攻击属性"] - if attack_attr.has("攻击类型"): - var attack_type_str = attack_attr["攻击类型"] - if attack_type_str == "MELEE": - attack_type = AttackType.MELEE - elif attack_type_str == "RANGED": - attack_type = AttackType.RANGED - if attack_attr.has("基础攻击伤害"): - attack_damage = attack_attr["基础攻击伤害"] - if attack_attr.has("攻击距离"): - attack_range = attack_attr["攻击距离"] - if attack_attr.has("暴击率"): - crit_rate = attack_attr["暴击率"] - if attack_attr.has("暴击伤害倍数"): - crit_damage = attack_attr["暴击伤害倍数"] - if attack_attr.has("生命汲取"): - life_steal = attack_attr["生命汲取"] - if attack_attr.has("护甲穿透"): - armor_penetration = attack_attr["护甲穿透"] - - # 近战攻击 - if config.has("近战攻击"): - var melee_attack = config["近战攻击"] - if melee_attack.has("近战额外伤害"): - melee_damage_bonus = melee_attack["近战额外伤害"] - if melee_attack.has("近战攻击速度"): - melee_attack_speed = melee_attack["近战攻击速度"] - - # 远程攻击 - if config.has("远程攻击"): - var ranged_attack = config["远程攻击"] - if ranged_attack.has("远程额外伤害"): - ranged_damage_bonus = ranged_attack["远程额外伤害"] - if ranged_attack.has("远程攻击速度"): - ranged_attack_speed = ranged_attack["远程攻击速度"] - if ranged_attack.has("远程攻击模式"): - var ranged_mode_str = ranged_attack["远程攻击模式"] - match ranged_mode_str: - "SINGLE": - ranged_mode = RangedAttackMode.SINGLE - "SHOTGUN": - ranged_mode = RangedAttackMode.SHOTGUN - "BURST": - ranged_mode = RangedAttackMode.BURST - "GATLING": - ranged_mode = RangedAttackMode.GATLING - "PIERCING": - ranged_mode = RangedAttackMode.PIERCING - if ranged_attack.has("子弹速度"): - projectile_speed = ranged_attack["子弹速度"] - - # 散弹攻击 - if config.has("散弹攻击"): - var shotgun_attack = config["散弹攻击"] - if shotgun_attack.has("散弹数量"): - shotgun_bullets = shotgun_attack["散弹数量"] - if shotgun_attack.has("散弹扩散角度"): - shotgun_spread_angle = shotgun_attack["散弹扩散角度"] - - # 多发射击 - if config.has("多发射击"): - var burst_attack = config["多发射击"] - if burst_attack.has("多发射击行数"): - burst_rows = burst_attack["多发射击行数"] - if burst_attack.has("多发射击列数"): - burst_cols = burst_attack["多发射击列数"] - if burst_attack.has("多发射击间距"): - burst_spacing = burst_attack["多发射击间距"] - - # 加特林属性 - if config.has("加特林属性"): - var gatling_attr = config["加特林属性"] - if gatling_attr.has("加特林子弹数量"): - gatling_bullets = gatling_attr["加特林子弹数量"] - if gatling_attr.has("加特林射击间隔"): - gatling_interval = gatling_attr["加特林射击间隔"] - if gatling_attr.has("加特林冷却时间"): - gatling_cooldown = gatling_attr["加特林冷却时间"] - - # 穿透属性 - if config.has("穿透属性"): - var pierce_attr = config["穿透属性"] - if pierce_attr.has("穿透数量"): - pierce_count = pierce_attr["穿透数量"] - - # 移动与闪避 - if config.has("移动与闪避"): - var move_dodge = config["移动与闪避"] - if move_dodge.has("移动速度"): - move_speed = move_dodge["移动速度"] - if move_dodge.has("闪避率"): - dodge_rate = move_dodge["闪避率"] - if move_dodge.has("击退力度"): - knockback_force = move_dodge["击退力度"] - if move_dodge.has("击退抗性"): - knockback_resist = move_dodge["击退抗性"] - - # 元素属性 - if config.has("元素属性"): - var element_attr = config["元素属性"] - if element_attr.has("元素类型"): - var element_type_str = element_attr["元素类型"] - match element_type_str: - "NONE": - element_type = ElementType.NONE - "METAL": - element_type = ElementType.METAL - "WOOD": - element_type = ElementType.WOOD - "WATER": - element_type = ElementType.WATER - "FIRE": - element_type = ElementType.FIRE - "EARTH": - element_type = ElementType.EARTH - "THUNDER": - element_type = ElementType.THUNDER - if element_attr.has("元素克制额外伤害"): - element_damage_bonus = element_attr["元素克制额外伤害"] - - # 特殊属性 - if config.has("特殊属性"): - var special_attr = config["特殊属性"] - if special_attr.has("控制抗性"): - control_resist = special_attr["控制抗性"] - if special_attr.has("伤害反弹"): - damage_reflect = special_attr["伤害反弹"] - if special_attr.has("死亡免疫"): - death_immunity = special_attr["死亡免疫"] - if special_attr.has("狂暴阈值"): - berserker_threshold = special_attr["狂暴阈值"] - if special_attr.has("狂暴状态伤害倍数"): - berserker_bonus = special_attr["狂暴状态伤害倍数"] - - # 特殊机制开关 - if config.has("特殊机制开关"): - var special_toggle = config["特殊机制开关"] - if special_toggle.has("启用伤害反弹机制"): - enable_damage_reflect = special_toggle["启用伤害反弹机制"] - if special_toggle.has("启用狂暴模式机制"): - enable_berserker_mode = special_toggle["启用狂暴模式机制"] - if special_toggle.has("启用死亡免疫机制"): - enable_death_immunity = special_toggle["启用死亡免疫机制"] - if special_toggle.has("启用援助召唤机制"): - enable_aid_system = special_toggle["启用援助召唤机制"] - if special_toggle.has("启用死亡重生机制"): - enable_resurrection = special_toggle["启用死亡重生机制"] - - # 援助系统 - if config.has("援助系统"): - var aid_system = config["援助系统"] - if aid_system.has("援助触发阈值"): - aid_threshold = aid_system["援助触发阈值"] - if aid_system.has("援助召唤数量"): - aid_summon_count = aid_system["援助召唤数量"] - if aid_system.has("援助召唤间隔"): - aid_summon_interval = aid_system["援助召唤间隔"] - - # 品质系统 - if config.has("品质系统"): - var quality_system = config["品质系统"] - if quality_system.has("宠物品质"): - var quality_str = quality_system["宠物品质"] - match quality_str: - "COMMON": - pet_quality = PetQuality.COMMON - "UNCOMMON": - pet_quality = PetQuality.UNCOMMON - "RARE": - pet_quality = PetQuality.RARE - "EPIC": - pet_quality = PetQuality.EPIC - "LEGENDARY": - pet_quality = PetQuality.LEGENDARY - "MYTHIC": - pet_quality = PetQuality.MYTHIC - - - -func _ready(): - # 初始化生日 - initialize_birthday() - - # 保存原始颜色 - if pet_image: - original_modulate = pet_image.modulate - - # 延迟初始化UI显示,确保所有节点都已准备好 - call_deferred("update_ui") - - # 设置初始动画为空闲状态 - if pet_image: - pet_image.animation = "idle" - - # 获取队伍节点引用 - call_deferred("setup_team_references") - - # 延迟设置碰撞层,确保队伍信息已设置 - call_deferred("setup_collision_layers") - -# 设置宠物类型并加载对应配置 -func set_pet_type_and_load_config(pet_type_name: String): - pet_type = pet_type_name - load_pet_config_from_json() - -# 设置队伍节点引用 -func setup_team_references(): - var battle_panel = get_parent() - while battle_panel and not battle_panel.has_method("get_team_node"): - battle_panel = battle_panel.get_parent() - - if battle_panel: - team_nodes["team1"] = battle_panel.get_node_or_null("team1") - team_nodes["team2"] = battle_panel.get_node_or_null("team2") - team_nodes["neutral"] = battle_panel.get_node_or_null("neutral") - -# 设置碰撞层,让队友之间不碰撞 -func setup_collision_layers(): - # 简化的碰撞层设计: - # 第1位(值1):team1宠物 - # 第2位(值2):team2宠物 - # 第3位(值4):中立宠物 - - match pet_team: - "team1": - collision_layer = 1 # 第1位 - collision_mask = 2 # 只检测team2 - "team2": - collision_layer = 2 # 第2位 - collision_mask = 1 # 只检测team1 - "neutral": - collision_layer = 4 # 第3位 - collision_mask = 3 # 检测team1和team2 - _: - # 默认设置为team1 - collision_layer = 1 - collision_mask = 2 - -#限制宠物在战斗区域内 -func clamp_to_battle_area(): - var battle_area_min = Vector2(0,0) - var battle_area_max = Vector2(1400, 720) - - # 限制位置 - global_position.x = clamp(global_position.x, battle_area_min.x, battle_area_max.x) - global_position.y = clamp(global_position.y, battle_area_min.y, battle_area_max.y) - -#宠物物理更新(带性能保护) -func _physics_process(delta): - if not is_alive or is_dying: - return - - # 性能保护:每3帧执行一次非关键逻辑 - frame_skip_counter += 1 - var should_skip_frame = performance_mode and (frame_skip_counter % 3 != 0) - - # 检测性能问题(如果帧时间过长,自动启用性能模式) - if delta > 0.025: # 帧时间超过25ms(低于40FPS) - if not performance_mode: - performance_mode = true - print("⚡ " + pet_name + " 启用性能模式(帧时间: " + str("%.3f" % delta) + "s)") - - # 巡逻宠物特殊处理 - if is_patrolling: - handle_patrol(delta) - return - - # 处理生命和护盾恢复 - if not should_skip_frame: - handle_regeneration(delta) - - # 更新年龄和亲密度(低优先级,可跳帧) - if not should_skip_frame: - update_age_and_intimacy(delta) - - # 检查狂暴状态 - if not should_skip_frame: - check_berserker_mode() - - # 检查援助系统(低优先级,可跳帧) - if not should_skip_frame: - check_aid_system() - - # 如果被眩晕则不能行动 - if is_stunned: - return - - # 定期检查目标状态(性能模式下降低检查频率) - var current_time = Time.get_ticks_msec() / 1000.0 - var check_interval = 0.5 if not performance_mode else 1.0 - if current_time - last_target_check_time >= check_interval: - check_target_validity() - last_target_check_time = current_time - - # 更新AI状态机 - update_ai_state(delta) - - # 处理移动 - handle_movement(delta) - - # 处理攻击 - handle_attack(delta) - - # 应用移动 - move_and_slide() - - # 限制在战斗区域内 - clamp_to_battle_area() - -#宠物AI状态机 -func update_ai_state(delta): - match current_state: - PetState.IDLE: - # 播放空闲动画 - if pet_image.animation != "idle": - pet_image.animation = "idle" - - # 只有启用战斗时才寻找敌人 - if combat_enabled: - find_nearest_enemy() - if current_target and is_instance_valid(current_target): - current_state = PetState.MOVING_TO_TARGET - - PetState.MOVING_TO_TARGET: - # 播放行走动画 - if pet_image.animation != "walk": - pet_image.animation = "walk" - - if not current_target or not is_instance_valid(current_target): - current_state = PetState.IDLE - else: - var distance_to_target = global_position.distance_to(current_target.global_position) - if distance_to_target <= attack_range: - # 进入攻击范围开始攻击 - current_state = PetState.ATTACKING - - PetState.ATTACKING: - # 攻击时播放空闲动画(或者你可以添加攻击动画) - if pet_image.animation != "idle": - pet_image.animation = "idle" - - if not current_target or not is_instance_valid(current_target): - current_state = PetState.IDLE - else: - var distance_to_target = global_position.distance_to(current_target.global_position) - if distance_to_target > attack_range * 1.2: - # 目标超出射程,继续追击 - current_state = PetState.MOVING_TO_TARGET - -#宠物移动 -func handle_movement(delta): - if current_state == PetState.MOVING_TO_TARGET and current_target: - var distance_to_target = global_position.distance_to(current_target.global_position) - var direction = (current_target.global_position - global_position).normalized() - - # 根据攻击类型调整移动策略 - if attack_type == AttackType.MELEE: - # 近战:直接冲向目标 - velocity = direction * move_speed - else: - # 远程:保持适当距离 - var optimal_distance = attack_range * 0.8 # 保持在80%射程距离 - if distance_to_target > optimal_distance: - # 太远了,靠近一点 - velocity = direction * move_speed - elif distance_to_target < optimal_distance * 0.6: - # 太近了,后退一点 - velocity = -direction * move_speed * 0.5 - else: - # 距离合适,停止移动 - velocity = Vector2.ZERO - - # 翻转精灵朝向 - if direction.x < 0: - pet_image.flip_h = false - pet_tool_image.flip_h = true - pet_tool_image.position.x = -10 - elif direction.x > 0: - pet_image.flip_h = true - pet_tool_image.flip_h = false - pet_tool_image.position.x = 10 - else: - velocity = Vector2.ZERO - -#宠物攻击(带频率保护) -func handle_attack(delta): - if current_state == PetState.ATTACKING and current_target: - var current_time = Time.get_ticks_msec() / 1000.0 # 转换为秒 - - # 处理加特林连射 - if ranged_mode == RangedAttackMode.GATLING: - handle_gatling_attack(current_time, delta) - else: - # 普通攻击频率控制(确保最小攻击间隔) - var attack_interval = max(1.0 / attack_speed, min_attack_interval) - if current_time - last_attack_time >= attack_interval: - perform_attack(current_target) - last_attack_time = current_time - -# 处理加特林攻击 -func handle_gatling_attack(current_time: float, delta: float): - if gatling_firing: - # 正在连射 - if current_time - gatling_last_shot >= gatling_interval: - fire_projectile_by_mode(current_target) - gatling_current_bullet += 1 - gatling_last_shot = current_time - - if gatling_current_bullet >= gatling_bullets: - # 连射完毕,进入冷却 - gatling_firing = false - gatling_current_bullet = 0 - last_attack_time = current_time + gatling_cooldown - print(pet_name + " 加特林连射完毕,进入冷却") - else: - # 检查是否可以开始新的连射 - if current_time - last_attack_time >= 1.0 / attack_speed: - gatling_firing = true - gatling_current_bullet = 0 - gatling_last_shot = current_time - gatling_interval # 立即开始第一发 - print(pet_name + " 开始加特林连射!") - -#寻找最近的敌人 -func find_nearest_enemy(): - var nearest_enemy: CharacterBody2D = null - var nearest_distance: float = INF - - # 获取所有存活的敌方宠物 - var all_enemies: Array[CharacterBody2D] = [] - - # 直接从pets组中查找敌人(更可靠的方法) - var all_pets = get_tree().get_nodes_in_group("pets") - for pet in all_pets: - if not is_instance_valid(pet) or pet == self or not pet.is_alive: - continue - - # 检查是否为敌人 - if pet.has_method("get_team") and pet.get_team() != pet_team: - all_enemies.append(pet) - - # 如果没有敌人,清除目标 - if all_enemies.is_empty(): - if current_target: - current_target = null - return - - # 寻找最近的敌人 - for enemy in all_enemies: - var distance = global_position.distance_to(enemy.global_position) - if distance < nearest_distance: - nearest_distance = distance - nearest_enemy = enemy - - # 更新目标(只有在没有目标或目标已死亡时才更换) - if not current_target or not is_instance_valid(current_target) or not current_target.is_alive: - if nearest_enemy != current_target: - current_target = nearest_enemy - -# 检查目标有效性 -func check_target_validity(): - if current_target: - # 检查目标是否还存活且有效 - if not is_instance_valid(current_target) or not current_target.is_alive: - current_target = null - current_state = PetState.IDLE - # 检查目标是否还是敌人(防止队伍变更等情况) - elif current_target.get_team() == pet_team: - current_target = null - current_state = PetState.IDLE - -#宠物攻击 -func perform_attack(target: CharacterBody2D): - if not target or not is_instance_valid(target) or not target.is_alive: - # 目标无效或已死亡,重新寻找目标 - current_target = null - current_state = PetState.IDLE - return - - # 根据攻击类型执行不同的攻击方式 - if attack_type == AttackType.MELEE: - perform_melee_attack(target) - else: - fire_projectile_by_mode(target) - -# 执行近战攻击 -func perform_melee_attack(target: CharacterBody2D): - # 计算基础伤害 + 近战额外伤害 - var damage = attack_damage + melee_damage_bonus - - # 狂暴状态加成 - if is_berserker: - damage *= berserker_bonus - - # 护甲穿透计算 - var final_armor_penetration = armor_penetration - - # 暴击计算 - var is_critical = randf() < crit_rate - if is_critical: - damage *= crit_damage - - # 添加战斗细节 - add_battle_detail_to_panel("⚔️ " + pet_name + " 对 " + target.pet_name + " 造成近战攻击 " + str(int(damage)) + " 点伤害" + ("(暴击)" if is_critical else "")) - - # 对目标造成伤害 - target.take_damage(damage, final_armor_penetration, element_type, self) - - # 生命汲取 - if life_steal > 0: - var heal_amount = damage * life_steal - heal(heal_amount) - - # 击退效果已禁用 - # if knockback_force > 0: - # apply_knockback_to_target(target) - -# 根据攻击模式发射子弹 -func fire_projectile_by_mode(target: CharacterBody2D): - # 计算基础伤害 + 远程额外伤害 - var damage = attack_damage + ranged_damage_bonus - - # 狂暴状态加成 - if is_berserker: - damage *= berserker_bonus - - # 护甲穿透计算 - var final_armor_penetration = armor_penetration - - # 暴击计算 - var is_critical = randf() < crit_rate - if is_critical: - damage *= crit_damage - - # 根据远程攻击模式执行不同的射击方式 - match ranged_mode: - RangedAttackMode.SINGLE: - fire_single_projectile(target, damage, final_armor_penetration, is_critical) - RangedAttackMode.SHOTGUN: - fire_shotgun_projectiles(target, damage, final_armor_penetration, is_critical) - RangedAttackMode.BURST: - fire_burst_projectiles(target, damage, final_armor_penetration, is_critical) - RangedAttackMode.GATLING: - fire_single_projectile(target, damage, final_armor_penetration, is_critical) # 加特林也是单发,但频率高 - RangedAttackMode.PIERCING: - fire_piercing_projectile(target, damage, final_armor_penetration, is_critical) - -# 发射单发子弹 -func fire_single_projectile(target: CharacterBody2D, damage: float, armor_pen: float, is_critical: bool): - add_battle_detail_to_panel("🏹 " + pet_name + " 向 " + target.pet_name + " 发射单发子弹 " + str(int(damage)) + " 点伤害" + ("(暴击)" if is_critical else "")) - create_and_fire_projectile(global_position, target.global_position, damage, armor_pen, is_critical, 1) - -# 发射散弹 -func fire_shotgun_projectiles(target: CharacterBody2D, damage: float, armor_pen: float, is_critical: bool): - var base_direction = (target.global_position - global_position).normalized() - var base_angle = atan2(base_direction.y, base_direction.x) - - # 计算每发子弹的角度偏移 - var angle_step = deg_to_rad(shotgun_spread_angle) / (shotgun_bullets - 1) - var start_angle = base_angle - deg_to_rad(shotgun_spread_angle) / 2 - - for i in range(shotgun_bullets): - var bullet_angle = start_angle + i * angle_step - var bullet_direction = Vector2(cos(bullet_angle), sin(bullet_angle)) - var target_pos = global_position + bullet_direction * attack_range - - create_and_fire_projectile(global_position, target_pos, damage * 0.7, armor_pen, is_critical, 1) # 散弹伤害降低 - -# 发射多发射击(平行) -func fire_burst_projectiles(target: CharacterBody2D, damage: float, armor_pen: float, is_critical: bool): - var base_direction = (target.global_position - global_position).normalized() - var perpendicular = Vector2(-base_direction.y, base_direction.x) # 垂直方向 - - # 计算起始位置偏移 - var total_width = (burst_cols - 1) * burst_spacing - var total_height = (burst_rows - 1) * burst_spacing - - for row in range(burst_rows): - for col in range(burst_cols): - var offset_x = (col - (burst_cols - 1) * 0.5) * burst_spacing - var offset_y = (row - (burst_rows - 1) * 0.5) * burst_spacing - - var start_pos = global_position + perpendicular * offset_x + base_direction.rotated(PI/2) * offset_y - var target_pos = target.global_position + perpendicular * offset_x + base_direction.rotated(PI/2) * offset_y - - create_and_fire_projectile(start_pos, target_pos, damage * 0.8, armor_pen, is_critical, 1) # 多发伤害稍微降低 - -# 发射穿透子弹 -func fire_piercing_projectile(target: CharacterBody2D, damage: float, armor_pen: float, is_critical: bool): - create_and_fire_projectile(global_position, target.global_position, damage * 1.2, armor_pen, is_critical, pierce_count) # 穿透子弹伤害更高 - -# 创建并发射子弹的通用函数 -func create_and_fire_projectile(start_pos: Vector2, target_pos: Vector2, damage: float, armor_pen: float, is_critical: bool, pierce: int = 1): - # 直接创建新子弹 - if not projectile_scene: - print("错误:没有设置子弹场景!") - return - - var projectile: Area2D = projectile_scene.instantiate() - if not projectile: - print("错误:无法创建子弹实例") - return - - # 将子弹添加到战斗场景中 - if get_tree(): - var battle_scene = get_tree().current_scene - if battle_scene.has_node("PetFightPanel"): - battle_scene.get_node("PetFightPanel").add_child(projectile) - else: - get_tree().current_scene.add_child(projectile) - else: - # 如果场景树不存在,直接销毁子弹 - projectile.queue_free() - return - - # 设置子弹位置 - projectile.global_position = start_pos - - # 计算射击方向 - var direction = (target_pos - start_pos).normalized() - - # 设置子弹数据 - projectile.set_projectile_data(damage, projectile_speed, direction, pet_team, element_type, armor_pen, pierce, self) - - # 设置子弹颜色 - if projectile.has_node("ProjectileSprite"): - if is_critical: - projectile.get_node("ProjectileSprite").modulate = Color.RED # 暴击红色 - elif pierce > 1: - projectile.get_node("ProjectileSprite").modulate = Color.PURPLE # 穿透紫色 - else: - # 根据攻击模式设置不同颜色 - match ranged_mode: - RangedAttackMode.SINGLE: - projectile.get_node("ProjectileSprite").modulate = Color.YELLOW - RangedAttackMode.SHOTGUN: - projectile.get_node("ProjectileSprite").modulate = Color.ORANGE - RangedAttackMode.BURST: - projectile.get_node("ProjectileSprite").modulate = Color.CYAN - RangedAttackMode.GATLING: - projectile.get_node("ProjectileSprite").modulate = Color.GREEN - RangedAttackMode.PIERCING: - projectile.get_node("ProjectileSprite").modulate = Color.PURPLE - -#宠物受到伤害(带死循环保护) -func take_damage(damage: float, armor_pen: float = 0.0, attacker_element: ElementType = ElementType.NONE, attacker: CharacterBody2D = null): - if not is_alive or is_invulnerable: - return - - # 防止过于频繁的伤害处理(性能保护) - var current_time = Time.get_ticks_msec() / 1000.0 - if current_time - last_attack_time < 0.05: # 50ms最小伤害间隔 - return - - # 增加伤害反弹递归深度 - damage_reflect_depth += 1 - - # 递归深度保护(防止无限反弹) - if damage_reflect_depth > max_reflect_depth: - damage_reflect_depth = max(0, damage_reflect_depth - 1) - return - - # 闪避检测 - if randf() < dodge_rate: - if attacker and is_instance_valid(attacker): - add_battle_detail_to_panel("✨ " + pet_name + " 闪避了 " + attacker.pet_name + " 的攻击!", Color.CYAN) - damage_reflect_depth = max(0, damage_reflect_depth - 1) - return - - var actual_damage = damage - - # 元素克制计算 - 额外伤害 - var element_extra_damage = get_element_multiplier(attacker_element, element_type) - actual_damage += element_extra_damage - - # 护甲减伤计算(考虑护甲穿透) - var effective_armor = max(0, current_armor - armor_pen) - if effective_armor > 0: - var armor_reduction = effective_armor / (effective_armor + 100.0) - actual_damage = actual_damage * (1.0 - armor_reduction) - - # 先扣护盾 - if current_shield > 0: - var shield_damage = min(actual_damage, current_shield) - current_shield -= shield_damage - actual_damage -= shield_damage - - # 再扣血量 - if actual_damage > 0: - current_health -= actual_damage - - # 播放受伤动画(带冷却保护) - play_hurt_animation() - - # 添加受伤细节(性能模式下减少文本输出) - if not performance_mode and attacker and is_instance_valid(attacker): - var damage_text = "💔 " + pet_name + " 受到 " + str(int(actual_damage)) + " 点伤害" - if element_extra_damage > 0: - damage_text += " (元素克制 +" + str(int(element_extra_damage)) + ")" - add_battle_detail_to_panel(damage_text, Color.ORANGE) - - # 记录最后攻击者 - if attacker and is_instance_valid(attacker): - last_attacker = attacker - - # 反击机制:立即将攻击者设为目标(只有启用战斗时才反击) - # 添加反击冷却,防止过于频繁的目标切换 - if combat_enabled and attacker and is_instance_valid(attacker) and attacker.is_alive: - if attacker.get_team() != pet_team: # 确保不攻击队友 - # 只有当前没有目标或当前目标已死亡时才切换目标 - if not current_target or not is_instance_valid(current_target) or not current_target.is_alive: - current_target = attacker - current_state = PetState.MOVING_TO_TARGET - - # 伤害反弹(带递归深度保护) - if enable_damage_reflect and damage_reflect > 0.0 and attacker and is_instance_valid(attacker) and damage_reflect_depth <= max_reflect_depth: - var reflect_damage = damage * damage_reflect * 0.5 # 反弹伤害减半,防止无限递归 - # 延迟反弹,避免同帧内的递归调用 - call_deferred("apply_reflect_damage", attacker, reflect_damage) - - # 检查死亡 - if current_health <= 0: - if enable_death_immunity and death_immunity: - current_health = 1.0 - death_immunity = false - is_invulnerable = true - # 设置短暂无敌时间 - if get_tree(): - var timer = get_tree().create_timer(2.0) - timer.timeout.connect(func(): is_invulnerable = false) - else: - if not is_dying: # 防止重复调用die() - call_deferred("die") - - # 减少伤害反弹递归深度 - damage_reflect_depth = max(0, damage_reflect_depth - 1) - - # 更新UI - call_deferred("update_ui") - -# 延迟应用反弹伤害(防止递归调用) -func apply_reflect_damage(target: CharacterBody2D, reflect_damage: float): - if target and is_instance_valid(target) and target.is_alive: - target.take_damage(reflect_damage, 0.0, element_type, self) - -#宠物死亡 -func die(): - if is_dying: # 如果已经在死亡过程中,直接返回 - return - - # 检查重生机制 - if enable_resurrection and not resurrection_used: - resurrection_used = true - add_battle_detail_to_panel("💀 " + pet_name + " 死亡,但触发重生机制!", Color.GOLD) - resurrect() - return - - is_dying = true # 设置死亡标志 - is_alive = false - current_state = PetState.DEAD - - # 添加死亡细节 - var death_message = "💀 " + pet_name + " 死亡了!" - if last_attacker and is_instance_valid(last_attacker): - death_message += " (被 " + last_attacker.pet_name + " 击杀)" - add_battle_detail_to_panel(death_message, Color.RED) - - # 给击杀者奖励 - if last_attacker and is_instance_valid(last_attacker) and last_attacker.has_method("on_kill_enemy"): - last_attacker.on_kill_enemy(self) - - # 通知其他宠物这个目标已死亡,让它们重新寻找目标 - if get_tree(): # 确保场景树存在 - var all_pets = get_tree().get_nodes_in_group("pets") - for pet in all_pets: - if pet != self and is_instance_valid(pet) and pet.has_method("on_enemy_died"): - pet.on_enemy_died(self) - - # 立即通知战斗面板检查战斗结束 - var battle_panel = get_parent() - while battle_panel and not battle_panel.has_method("check_battle_end"): - battle_panel = battle_panel.get_parent() - - if battle_panel: - battle_panel.call_deferred("check_battle_end") - - # 延迟0.5秒后移除自己,避免在物理回调中操作 - if get_tree(): - await get_tree().create_timer(0.5).timeout - if get_parent(): - get_parent().remove_child(self) - queue_free() - else: - # 如果场景树不存在,直接销毁 - queue_free() - -# 重生机制 -func resurrect(): - # 恢复生命值到50% - current_health = max_health * 0.5 - current_shield = max_shield * 0.5 - current_armor = max_armor * 0.5 - - # 设置短暂无敌状态 - is_invulnerable = true - is_dying = false - is_alive = true - current_state = PetState.IDLE - - # 清除目标,重新开始 - current_target = null - - # 重生特效(变为金色闪烁) - var original_modulate = pet_image.modulate - pet_image.modulate = Color.GOLD - - # 3秒后恢复正常状态 - if get_tree(): - var timer = get_tree().create_timer(3.0) - timer.timeout.connect(func(): - is_invulnerable = false - pet_image.modulate = original_modulate - ) - - call_deferred("update_ui") - -# 显示启用的特殊机制 -func show_enabled_special_abilities(): - var abilities: Array[String] = [] - - if enable_damage_reflect: - abilities.append("伤害反弹(" + str(int(damage_reflect * 100)) + "%)") - if enable_berserker_mode: - abilities.append("狂暴模式(" + str(int(berserker_threshold * 100)) + "%血量触发)") - if enable_death_immunity: - abilities.append("死亡免疫") - if enable_aid_system: - abilities.append("援助召唤(x" + str(aid_summon_count) + ")") - if enable_resurrection: - abilities.append("死亡重生") - - # 可以在这里添加UI显示特殊能力的逻辑,暂时注释掉print - # if abilities.size() > 0: - # print(pet_name + " 启用特殊机制: " + ", ".join(abilities)) - # else: - # print(pet_name + " 无特殊机制") - -#更新宠物状态UI -func update_ui(): - # 检查UI节点是否存在,防止援助宠物或未完全初始化的宠物出错 - if not health_bar or not shield_bar or not armor_bar or not health_label or not shield_label or not armor_label or not pet_name_rich_text: - return - - # 更新血量条 - health_bar.max_value = max_health - health_bar.value = current_health - health_label.text = "生命值:" + str(int(current_health)) + "/" + str(int(max_health)) - - # 更新护盾条 - shield_bar.max_value = max_shield - shield_bar.value = current_shield - shield_label.text = "护盾值:" + str(int(current_shield)) + "/" + str(int(max_shield)) - - # 更新护甲条 - armor_bar.max_value = max_armor - armor_bar.value = current_armor - armor_label.text = "护甲值:" + str(int(current_armor)) + "/" + str(int(max_armor)) - - # 更新名称(包含等级、经验、亲密度信息) - var display_name = pet_name + " [Lv." + str(pet_level) + "]" - display_name += "\n经验:" + str(int(pet_experience)) + "/" + str(int(max_experience)) - display_name += "\n亲密度:" + str(int(pet_intimacy)) + "/" + str(int(max_intimacy)) - if pet_age > 0: - display_name += "\n年龄:" + get_age_display() - pet_name_rich_text.text = display_name - -# 获取友好的年龄显示 -func get_age_display() -> String: - if pet_age == 0: - return "新生" - elif pet_age < 7: - return str(pet_age) + "天" - elif pet_age < 30: - var weeks = pet_age / 7 - return str(weeks) + "周" - elif pet_age < 365: - var months = pet_age / 30 - return str(months) + "个月" - else: - var years = pet_age / 365 - var remaining_days = pet_age % 365 - if remaining_days > 0: - return str(years) + "年" + str(remaining_days) + "天" - else: - return str(years) + "年" - -# 添加战斗细节到对战面板 -func add_battle_detail_to_panel(text: String, color: Color = Color.WHITE): - # 查找战斗面板 - var battle_panel = find_battle_panel() - if battle_panel and battle_panel.has_method("add_battle_detail"): - battle_panel.add_battle_detail(text, color) - -# 查找战斗面板 -func find_battle_panel(): - var current_scene = get_tree().current_scene - if current_scene.has_node("PetFightPanel"): - return current_scene.get_node("PetFightPanel") - else: - # 遍历所有子节点查找 - var queue = [current_scene] - while queue.size() > 0: - var node = queue.pop_front() - if node.name == "PetFightPanel": - return node - for child in node.get_children(): - queue.append(child) - return null - -#设置宠物数据 -func set_pet_data(name: String, team: String, health: float = 100.0, attack: float = 20.0, speed: float = 100.0, quality: PetQuality = PetQuality.COMMON, element: ElementType = ElementType.NONE): - pet_name = name - pet_team = team - max_health = health - current_health = health - attack_damage = attack - move_speed = speed - pet_quality = quality - element_type = element - - # 根据品质调整属性 - apply_quality_bonuses() - - # 更新攻击速度 - update_attack_speed() - - # 设置碰撞层(现在team信息已确定) - setup_collision_layers() - - # 显示启用的特殊机制 - call_deferred("show_enabled_special_abilities") - - call_deferred("update_ui") - -# 更新攻击速度(根据当前攻击类型) -func update_attack_speed(): - if attack_type == AttackType.MELEE: - attack_speed = melee_attack_speed - else: - attack_speed = ranged_attack_speed - -# 根据品质应用属性加成 -func apply_quality_bonuses(): - var quality_multiplier = 1.0 - match pet_quality: - PetQuality.COMMON: - quality_multiplier = 1.0 - PetQuality.UNCOMMON: - quality_multiplier = 1.1 - PetQuality.RARE: - quality_multiplier = 1.25 - PetQuality.EPIC: - quality_multiplier = 1.5 - PetQuality.LEGENDARY: - quality_multiplier = 1.75 - PetQuality.MYTHIC: - quality_multiplier = 2.0 - - # 应用品质加成到基础属性 - max_health *= quality_multiplier - current_health = max_health - max_shield *= quality_multiplier - current_shield = max_shield - max_armor *= quality_multiplier - current_armor = max_armor - attack_damage *= quality_multiplier - - # 高品质宠物获得额外属性 - if pet_quality >= PetQuality.RARE: - crit_rate += 0.05 - life_steal += 0.05 - enable_berserker_mode = true # 稀有品质启用狂暴模式 - if pet_quality >= PetQuality.EPIC: - armor_penetration += 10.0 - health_regen += 1.0 - enable_damage_reflect = true # 史诗品质启用伤害反弹 - damage_reflect += 0.1 - if pet_quality >= PetQuality.LEGENDARY: - knockback_resist += 0.2 - enable_aid_system = true # 传说品质启用援助系统 - enable_death_immunity = true # 传说品质启用死亡免疫 - death_immunity = true - if pet_quality >= PetQuality.MYTHIC: - berserker_bonus += 0.5 - enable_resurrection = true # 神话品质启用重生机制 - -func get_team() -> String: - return pet_team - -# 获取攻击类型(调试用) -func get_attack_type() -> AttackType: - return attack_type - -# 处理生命和护盾恢复 -func handle_regeneration(delta: float): - var current_time = Time.get_ticks_msec() / 1000.0 - if current_time - last_regen_time >= 1.0: # 每秒恢复一次 - # 生命恢复 - if current_health < max_health and health_regen > 0: - current_health = min(max_health, current_health + health_regen) - - # 护盾恢复 - if current_shield < max_shield and shield_regen > 0: - current_shield = min(max_shield, current_shield + shield_regen) - - last_regen_time = current_time - call_deferred("update_ui") - -# 更新亲密度 -var intimacy_timer: float = 0.0 - -func update_age_and_intimacy(delta: float): - # 更新年龄(基于出生日期和现实时间) - update_pet_age() - - # 每10秒增加1点亲密度(战斗中会增加更多) - intimacy_timer += delta - if intimacy_timer >= 10.0: - gain_intimacy(1.0) - intimacy_timer = 0.0 - -# 根据出生日期计算宠物年龄 -func update_pet_age(): - if pet_birthday == "": - return - - # 解析出生日期 - var birth_parts = pet_birthday.split(" ") - if birth_parts.size() != 2: - return - - var date_parts = birth_parts[0].split("-") - var time_parts = birth_parts[1].split(":") - - if date_parts.size() != 3 or time_parts.size() != 3: - return - - # 获取当前时间 - var current_time = Time.get_datetime_dict_from_system() - - # 计算出生时间 - var birth_year = int(date_parts[0]) - var birth_month = int(date_parts[1]) - var birth_day = int(date_parts[2]) - var birth_hour = int(time_parts[0]) - var birth_minute = int(time_parts[1]) - var birth_second = int(time_parts[2]) - - # 创建出生时间的Unix时间戳 - var birth_dict = { - "year": birth_year, - "month": birth_month, - "day": birth_day, - "hour": birth_hour, - "minute": birth_minute, - "second": birth_second - } - - var birth_unix = Time.get_unix_time_from_datetime_dict(birth_dict) - var current_unix = Time.get_unix_time_from_system() - - # 计算年龄(秒差转换为天数) - var age_seconds = current_unix - birth_unix - pet_age = int(age_seconds / 86400) # 86400秒 = 1天 - - if pet_age < 0: - pet_age = 0 # 防止负数年龄 - -# 增加亲密度 -func gain_intimacy(amount: float): - if pet_intimacy < max_intimacy: - pet_intimacy = min(max_intimacy, pet_intimacy + amount) - - # 每100点亲密度提供属性加成 - var intimacy_level = int(pet_intimacy / 100.0) - if intimacy_level > 0: - # 亲密度加成:每100点提供5%属性加成 - var intimacy_bonus = 1.0 + (intimacy_level * 0.05) - # 这里可以应用到各种属性上,暂时先输出提示 - if int(pet_intimacy) % 100 == 0: - pass - -# 增加经验值 -func gain_experience(amount: float): - if pet_level >= 50: # 等级上限 - return - - pet_experience += amount - - # 检查是否升级 - while pet_experience >= max_experience and pet_level < 50: - level_up() - -# 升级(新的随机属性系统) -func level_up(): - pet_experience -= max_experience - pet_level += 1 - - # 计算新的升级经验需求(指数增长) - max_experience = 100.0 * pow(1.2, pet_level - 1) - - # 随机选择属性进行升级 - var upgraded_attributes = apply_random_attribute_upgrade() - - # 检查是否有里程碑奖励(每5级) - var milestone_rewards = apply_milestone_bonus() - - # 升级回血和护盾护甲 - current_health = max_health - current_shield = max_shield - current_armor = max_armor - - # 升级特效 - show_level_up_effect() - - # 添加升级细节 - var upgrade_text = "🎉 " + pet_name + " 升级到 " + str(pet_level) + " 级!" - upgrade_text += "\n📈 随机提升:" + ", ".join(upgraded_attributes) - if milestone_rewards.size() > 0: - upgrade_text += "\n🏆 里程碑奖励:" + ", ".join(milestone_rewards) - - add_battle_detail_to_panel(upgrade_text, Color.GOLD) - - call_deferred("update_ui") - -# 应用随机属性升级 -func apply_random_attribute_upgrade() -> Array[String]: - var upgraded_attributes: Array[String] = [] - var available_attributes = base_upgrade_attributes.duplicate() - - # 随机选择几个属性进行升级 - for i in range(min(attributes_per_level, available_attributes.size())): - var random_index = randi() % available_attributes.size() - var selected_attribute = available_attributes[random_index] - available_attributes.remove_at(random_index) - - # 应用属性升级 - var upgrade_applied = apply_single_attribute_upgrade(selected_attribute) - if upgrade_applied: - upgraded_attributes.append(upgrade_applied) - - return upgraded_attributes - -# 应用单个属性升级 -func apply_single_attribute_upgrade(attribute_name: String) -> String: - match attribute_name: - "max_health": - var bonus = randf_range(8.0, 15.0) # 随机8-15点生命值 - max_health += bonus - return "生命值 +" + str(int(bonus)) - "attack_damage": - var bonus = randf_range(2.0, 5.0) # 随机2-5点攻击力 - attack_damage += bonus - return "攻击力 +" + str(int(bonus)) - "move_speed": - var bonus = randf_range(3.0, 8.0) # 随机3-8点移动速度 - move_speed += bonus - return "移动速度 +" + str(int(bonus)) - "max_shield": - var bonus = randf_range(5.0, 12.0) # 随机5-12点护盾值 - max_shield += bonus - return "护盾值 +" + str(int(bonus)) - "max_armor": - var bonus = randf_range(4.0, 10.0) # 随机4-10点护甲值 - max_armor += bonus - return "护甲值 +" + str(int(bonus)) - "crit_rate": - var bonus = randf_range(0.01, 0.03) # 随机1-3%暴击率 - crit_rate = min(1.0, crit_rate + bonus) # 暴击率上限100% - return "暴击率 +" + str(int(bonus * 100)) + "%" - "health_regen": - var bonus = randf_range(0.3, 0.8) # 随机0.3-0.8点生命恢复 - health_regen += bonus - return "生命恢复 +" + str("%.1f" % bonus) - "attack_range": - var bonus = randf_range(8.0, 20.0) # 随机8-20点攻击距离 - attack_range += bonus - return "攻击距离 +" + str(int(bonus)) - _: - return "" - -# 应用里程碑奖励 -func apply_milestone_bonus() -> Array[String]: - var milestone_rewards: Array[String] = [] - - if not level_milestone_bonuses.has(pet_level): - return milestone_rewards - - var bonuses = level_milestone_bonuses[pet_level] - - for bonus_key in bonuses.keys(): - var bonus_value = bonuses[bonus_key] - var reward_text = apply_milestone_bonus_single(bonus_key, bonus_value) - if reward_text != "": - milestone_rewards.append(reward_text) - - return milestone_rewards - -# 应用单个里程碑奖励 -func apply_milestone_bonus_single(bonus_key: String, bonus_value) -> String: - match bonus_key: - "max_health": - max_health += bonus_value - return "生命值 +" + str(bonus_value) - "attack_damage": - attack_damage += bonus_value - return "攻击力 +" + str(bonus_value) - "max_shield": - max_shield += bonus_value - return "护盾值 +" + str(bonus_value) - "max_armor": - max_armor += bonus_value - return "护甲值 +" + str(bonus_value) - "crit_rate": - crit_rate = min(1.0, crit_rate + bonus_value) - return "暴击率 +" + str(int(bonus_value * 100)) + "%" - "armor_penetration": - armor_penetration += bonus_value - return "护甲穿透 +" + str(bonus_value) - "life_steal": - life_steal = min(1.0, life_steal + bonus_value) - return "生命汲取 +" + str(int(bonus_value * 100)) + "%" - "knockback_resist": - knockback_resist = min(1.0, knockback_resist + bonus_value) - return "击退抗性 +" + str(int(bonus_value * 100)) + "%" - "dodge_rate": - dodge_rate = min(1.0, dodge_rate + bonus_value) - return "闪避率 +" + str(int(bonus_value * 100)) + "%" - "health_regen": - health_regen += bonus_value - return "生命恢复 +" + str(bonus_value) - "move_speed": - move_speed += bonus_value - return "移动速度 +" + str(bonus_value) - "attack_range": - attack_range += bonus_value - return "攻击距离 +" + str(bonus_value) - "shield_regen": - shield_regen += bonus_value - return "护盾恢复 +" + str(bonus_value) - "crit_damage": - crit_damage += bonus_value - return "暴击伤害 +" + str(int(bonus_value * 100)) + "%" - "berserker_bonus": - berserker_bonus += bonus_value - return "狂暴加成 +" + str(int(bonus_value * 100)) + "%" - "damage_reflect": - damage_reflect = min(1.0, damage_reflect + bonus_value) - return "伤害反弹 +" + str(int(bonus_value * 100)) + "%" - "control_resist": - control_resist = min(1.0, control_resist + bonus_value) - return "控制抗性 +" + str(int(bonus_value * 100)) + "%" - "projectile_speed": - projectile_speed += bonus_value - return "子弹速度 +" + str(bonus_value) - "pierce_count": - pierce_count += bonus_value - return "穿透数量 +" + str(bonus_value) - "enable_berserker_mode": - if bonus_value: - enable_berserker_mode = true - return "解锁狂暴模式" - else: - return "" - "enable_damage_reflect": - if bonus_value: - enable_damage_reflect = true - return "解锁伤害反弹" - else: - return "" - "enable_aid_system": - if bonus_value: - enable_aid_system = true - return "解锁援助召唤" - else: - return "" - "enable_death_immunity": - if bonus_value: - enable_death_immunity = true - death_immunity = true - return "解锁死亡免疫" - else: - return "" - "enable_resurrection": - if bonus_value: - enable_resurrection = true - return "解锁死亡重生" - else: - return "" - _: - return "" - -# 显示升级特效 -func show_level_up_effect(): - if not pet_image: - return - - # 保存原始颜色 - var original_color = pet_image.modulate - - # 创建升级特效(金色闪烁) - var tween = create_tween() - tween.set_loops(3) # 闪烁3次 - - # 闪烁效果 - tween.tween_method(func(color): pet_image.modulate = color, original_color, Color.GOLD, 0.2) - tween.tween_method(func(color): pet_image.modulate = color, Color.GOLD, original_color, 0.2) - - # 恢复原始颜色 - tween.tween_callback(func(): pet_image.modulate = original_color) - -# 击杀敌人时获得额外经验 -func on_kill_enemy(enemy: CharacterBody2D): - var kill_exp = enemy.pet_level * 20.0 # 根据敌人等级获得经验 - gain_experience(kill_exp) - gain_intimacy(10.0) # 击杀获得更多亲密度 - -# 初始化生日 -func initialize_birthday(): - if pet_birthday == "": - var time_dict = Time.get_datetime_dict_from_system() - pet_birthday = str(time_dict.year) + "-" + str(time_dict.month).pad_zeros(2) + "-" + str(time_dict.day).pad_zeros(2) + " " + str(time_dict.hour).pad_zeros(2) + ":" + str(time_dict.minute).pad_zeros(2) + ":" + str(time_dict.second).pad_zeros(2) - -# 检查狂暴模式 -func check_berserker_mode(): - if not enable_berserker_mode: - return - - var health_ratio = current_health / max_health - if health_ratio <= berserker_threshold and not is_berserker: - is_berserker = true - pet_image.modulate = Color.RED # 狂暴状态变红色 - add_battle_detail_to_panel("🔥 " + pet_name + " 血量过低,进入狂暴模式!", Color.RED) - elif health_ratio > berserker_threshold and is_berserker: - is_berserker = false - add_battle_detail_to_panel("😌 " + pet_name + " 脱离狂暴模式", Color.GREEN) - # 恢复原来的队伍颜色 - if pet_team == "team1": - pet_image.modulate = Color.CYAN - else: - pet_image.modulate = Color.ORANGE - -# 检查援助系统 -func check_aid_system(): - if not enable_aid_system: - return - - var health_ratio = current_health / max_health - var current_time = Time.get_ticks_msec() / 1000.0 - - # 如果血量低于阈值且还没召唤过援助,或者距离上次召唤已经超过间隔时间 - if health_ratio <= aid_threshold: - if not aid_summoned or (current_time - aid_last_summon_time >= aid_summon_interval): - summon_aid() - aid_last_summon_time = current_time - aid_summoned = true - -# 召唤援助 -func summon_aid(): - # 获取战斗面板引用 - var battle_panel = get_parent() - while battle_panel and not battle_panel.has_method("get_team_node"): - battle_panel = battle_panel.get_parent() - - if not battle_panel: - return - - var team_node = battle_panel.get_team_node(pet_team) - if not team_node: - return - - # 召唤多个援助宠物 - for i in range(aid_summon_count): - var aid_pet = create_aid_minion() - if aid_pet: - team_node.add_child(aid_pet) - aid_minions.append(aid_pet) - - # 设置援助宠物位置(在主宠物周围) - var offset_angle = (PI * 2 / aid_summon_count) * i - var offset_distance = 80.0 - var offset = Vector2(cos(offset_angle), sin(offset_angle)) * offset_distance - aid_pet.global_position = global_position + offset - - # 添加到宠物组 - aid_pet.add_to_group("pets") - aid_pet.add_to_group(pet_team) - aid_pet.add_to_group("aid_minions") - -# 创建援助宠物 -func create_aid_minion() -> CharacterBody2D: - # 使用相同的宠物场景 - var pet_scene = preload("res://Scene/Pet/PetBase.tscn") - var aid_pet = pet_scene.instantiate() - - # 设置援助宠物属性(比主宠物弱一些) - var aid_name = pet_name + "的援助" - var aid_health = max_health * 0.3 # 30%血量 - var aid_attack = attack_damage * 0.5 # 50%攻击力 - var aid_speed = move_speed * 1.2 # 120%移动速度 - - aid_pet.set_pet_data(aid_name, pet_team, aid_health, aid_attack, aid_speed, PetQuality.COMMON, element_type) - - # 援助宠物使用简单的远程攻击 - aid_pet.attack_type = AttackType.RANGED - aid_pet.ranged_mode = RangedAttackMode.SINGLE - aid_pet.attack_range = 250.0 - - # 设置援助宠物的特殊标识(小一点,颜色稍微不同) - aid_pet.scale = Vector2(0.7, 0.7) # 缩小到70% - if aid_pet.pet_image: - aid_pet.pet_image.modulate = aid_pet.pet_image.modulate * Color(1.0, 1.0, 1.0, 0.8) # 半透明 - - # 隐藏援助宠物的UI面板,减少性能开销 - if aid_pet.has_node("PetInformVBox"): - aid_pet.get_node("PetInformVBox").visible = false - - return aid_pet - -# 治疗函数 -func heal(amount: float): - if not is_alive: - return - current_health = min(max_health, current_health + amount) - call_deferred("update_ui") - -# 击退效果已禁用 -func apply_knockback_to_target(target: CharacterBody2D): - # 击退功能暂时禁用 - pass - -# 击退效果已禁用 -func apply_knockback(direction: Vector2, force: float): - # 击退功能暂时禁用 - pass - -# 将位置限制在战斗区域内 -func clamp_position_to_battle_area(pos: Vector2) -> Vector2: - var battle_area_min = Vector2(50, 50) - var battle_area_max = Vector2(1350, 670) - - pos.x = clamp(pos.x, battle_area_min.x, battle_area_max.x) - pos.y = clamp(pos.y, battle_area_min.y, battle_area_max.y) - return pos - -# 元素克制计算 -func get_element_multiplier(attacker_element: ElementType, defender_element: ElementType) -> float: - # 如果攻击者无属性,返回正常伤害 - if attacker_element == ElementType.NONE: - return 0.0 # 无额外伤害 - - # 雷属性克制所有其他属性 - if attacker_element == ElementType.THUNDER and defender_element != ElementType.NONE: - return element_damage_bonus # 雷克制所有 - - # 如果防御者无属性,无克制关系 - if defender_element == ElementType.NONE: - return 0.0 - - # 五行克制:金克木,木克水,水克火,火克土,土克金 - match attacker_element: - ElementType.METAL: - if defender_element == ElementType.WOOD: - return element_damage_bonus # 金克木 - ElementType.WOOD: - if defender_element == ElementType.WATER: - return element_damage_bonus # 木克水 - ElementType.WATER: - if defender_element == ElementType.FIRE: - return element_damage_bonus # 水克火 - ElementType.FIRE: - if defender_element == ElementType.EARTH: - return element_damage_bonus # 火克土 - ElementType.EARTH: - if defender_element == ElementType.METAL: - return element_damage_bonus # 土克金 - - return 0.0 # 无克制关系,无额外伤害 - -# 当敌人死亡时被调用 -func on_enemy_died(dead_enemy: CharacterBody2D): - if current_target == dead_enemy: - current_target = null - current_state = PetState.IDLE - -# 处理巡逻逻辑 -func handle_patrol(delta: float): - if patrol_path.size() == 0: - return - - # 确保当前巡逻索引有效 - if current_patrol_index >= patrol_path.size(): - current_patrol_index = 0 - - var target_point = patrol_path[current_patrol_index] - # 使用本地坐标进行计算(因为宠物现在在巡逻线节点下) - var distance_to_target = position.distance_to(target_point) - - # 如果距离目标点很近,移动到下一个点 - if distance_to_target < 30.0: # 增加检测距离,避免抖动 - patrol_wait_time += delta - if patrol_wait_time >= patrol_max_wait_time: - current_patrol_index = (current_patrol_index + 1) % patrol_path.size() - patrol_wait_time = 0.0 - - # 在等待期间播放空闲动画 - if pet_image and pet_image.animation != "idle": - pet_image.animation = "idle" - velocity = Vector2.ZERO - else: - # 移动到目标点 - var direction = (target_point - position).normalized() - velocity = direction * patrol_speed - - # 播放移动动画 - if pet_image and pet_image.animation != "walk": - pet_image.animation = "walk" - - # 根据移动方向翻转精灵 - if direction.x < 0: - pet_image.flip_h = false - elif direction.x > 0: - pet_image.flip_h = true - - patrol_wait_time = 0.0 - - # 应用移动 - move_and_slide() - - # 限制在巡逻区域内(使用本地坐标) - clamp_to_patrol_area() - -# 设置战斗启用状态 -func set_combat_enabled(enabled: bool): - combat_enabled = enabled - if not enabled: - # 禁用战斗时,清除当前目标 - current_target = null - current_state = PetState.IDLE - -# 限制巡逻宠物在合理的坐标范围内 -func clamp_to_patrol_area(): - # 基于巡逻路径计算合理的边界 - if patrol_path.size() > 0: - var min_x = patrol_path[0].x - var max_x = patrol_path[0].x - var min_y = patrol_path[0].y - var max_y = patrol_path[0].y - - # 找到路径的边界 - for point in patrol_path: - min_x = min(min_x, point.x) - max_x = max(max_x, point.x) - min_y = min(min_y, point.y) - max_y = max(max_y, point.y) - - # 添加一些缓冲区域 - var buffer = 100.0 - min_x -= buffer - max_x += buffer - min_y -= buffer - max_y += buffer - - # 限制位置 - position.x = clamp(position.x, min_x, max_x) - position.y = clamp(position.y, min_y, max_y) - -# 播放受伤动画(带冷却保护) -func play_hurt_animation(): - if not pet_image: - return - - # 检查受伤动画冷却时间 - var current_time = Time.get_ticks_msec() / 1000.0 - if current_time - last_hurt_time < hurt_animation_cooldown: - return # 冷却中,不播放动画 - - last_hurt_time = current_time - - # 如果已经有受伤动画在播放,停止之前的 - if hurt_tween: - hurt_tween.kill() - hurt_tween = null - - # 性能模式下简化动画 - if performance_mode: - # 简单的颜色变化,无需Tween - pet_image.modulate = Color.RED - # 使用计时器恢复颜色(更轻量) - await get_tree().create_timer(0.1).timeout - if pet_image: # 确保宠物还存在 - pet_image.modulate = original_modulate - return - - # 创建受伤动画(闪红效果) - hurt_tween = create_tween() - - # 立即变红 - pet_image.modulate = Color.RED - - # 0.2秒后恢复原色 - hurt_tween.tween_property(pet_image, "modulate", original_modulate, 0.2) - - # 动画结束后清理 - hurt_tween.tween_callback(func(): - hurt_tween = null - ) - -# 切换性能模式 -func toggle_performance_mode(): - performance_mode = !performance_mode - var mode_text = "性能模式" if performance_mode else "正常模式" - add_battle_detail_to_panel("⚡ " + pet_name + " 切换到 " + mode_text, Color.YELLOW) - print("⚡ " + pet_name + " 切换到 " + mode_text) - -# 输出宠物性能状态 -func debug_performance_status(): - print("=== " + pet_name + " 性能状态调试 ===") - print("性能模式: " + str(performance_mode)) - print("伤害反弹深度: " + str(damage_reflect_depth)) - print("帧跳跃计数: " + str(frame_skip_counter)) - print("上次受伤时间: " + str(last_hurt_time)) - print("上次攻击时间: " + str(last_attack_time)) - print("当前状态: " + str(current_state)) - print("是否存活: " + str(is_alive)) - print("是否正在死亡: " + str(is_dying)) - print("============================") - -# 重置性能状态(紧急恢复) -func reset_performance_state(): - performance_mode = false - damage_reflect_depth = 0 - frame_skip_counter = 0 - - # 清理可能卡住的动画 - if hurt_tween: - hurt_tween.kill() - hurt_tween = null - - # 恢复正常颜色 - if pet_image: - pet_image.modulate = original_modulate - - print("🔄 " + pet_name + " 性能状态已重置") - add_battle_detail_to_panel("🔄 " + pet_name + " 性能状态已重置", Color.GREEN) diff --git a/Script/Pet/PetBase.gd.uid b/Script/Pet/PetBase.gd.uid deleted file mode 100644 index 79c8b26..0000000 --- a/Script/Pet/PetBase.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://hucuy8guuj6w diff --git a/Script/Pet/PetFightPanel.gd b/Script/Pet/PetFightPanel.gd deleted file mode 100644 index 4cca55e..0000000 --- a/Script/Pet/PetFightPanel.gd +++ /dev/null @@ -1,579 +0,0 @@ -extends Panel - -# 可用的宠物场景字典(直接使用现有场景文件) -var available_pets: Dictionary = { - "小绿": preload("res://Scene/Pet/SmallGreen.tscn"), - "小蓝": preload("res://Scene/Pet/SmallBlue.tscn"), - "小黄": preload("res://Scene/Pet/SmallYellow.tscn"), - "小橙": preload("res://Scene/Pet/SmallOrange.tscn"), - "小粉": preload("res://Scene/Pet/SmallPink.tscn"), - "红史莱姆": preload("res://Scene/Pet/RedSlime.tscn"), - "绿史莱姆": preload("res://Scene/Pet/GreenSlime.tscn"), - "小骑士": preload("res://Scene/Pet/LittleKnight.tscn"), - "大甲虫": preload("res://Scene/Pet/BigBeetle.tscn"), - "小甲虫": preload("res://Scene/Pet/SmallBeetle.tscn"), - "飞鸟": preload("res://Scene/Pet/FlyingBird.tscn"), - "小钻头": preload("res://Scene/Pet/SmallDrillBit.tscn") -} - -# 宠物配置数据 -var pet_configs: Dictionary = {} - -@onready var battle_end_panel: Panel = $BattleEndPanel #战斗结算面板 -@onready var contents: Label = $BattleEndPanel/Contents #结算内容 -@onready var return_farm_button: Button = $BattleEndPanel/ReturnFarmButton #返回农场按钮 暂时设定为隐藏战斗面板 - -@onready var pet_battle_details_panel: Panel = $PetBattleDetailsPanel #宠物对战细节面板 -@onready var battle_details: RichTextLabel = $PetBattleDetailsPanel/BattleDetails #宠物对战细节 - -@onready var tcp_network_manager_panel: Panel = $'../TCPNetworkManagerPanel' - - -# 对战区域边界 -var battle_area_min: Vector2 = Vector2(50, 50) -var battle_area_max: Vector2 = Vector2(1350, 670) - -# 队伍宠物列表 -var team1_pets: Array[CharacterBody2D] = [] -var team2_pets: Array[CharacterBody2D] = [] - -# 对战状态 -var battle_started: bool = false -var battle_ended: bool = false -var winner_team: String = "" -var auto_battle_enabled: bool = true # 是否启用自动对战 -var is_steal_battle: bool = false # 是否为偷菜对战 -var steal_battle_cost: int = 1300 # 偷菜对战失败的惩罚金币 -var battle_start_time: float = 0.0 # 战斗开始时间 - -# 偷菜对战相关数据 -var current_battle_pet_id: String = "" # 当前出战宠物ID -var current_attacker_name: String = "" # 当前进攻者用户名 - -# 队伍节点引用 -@onready var team1_node: Node = $team1 -@onready var team2_node: Node = $team2 -@onready var neutral_node: Node = $neutral - - -func _ready(): - visibility_changed.connect(_on_visibility_changed) - load_pet_configs() - - # 连接返回农场按钮 - if return_farm_button: - return_farm_button.pressed.connect(_on_return_farm_pressed) - - # 初始隐藏结算面板和细节面板 - if battle_end_panel: - battle_end_panel.visible = false - if pet_battle_details_panel: - pet_battle_details_panel.visible = false - -# 加载宠物配置 -func load_pet_configs(): - var file = FileAccess.open("res://Data/pet_data.json", FileAccess.READ) - if file == null: - return - - var json_string = file.get_as_text() - file.close() - - var json = JSON.new() - var parse_result = json.parse(json_string) - if parse_result != OK: - return - - pet_configs = json.data - -# 添加对战细节到细节面板 -func add_battle_detail(text: String, color: Color = Color.WHITE): - if not battle_details: - return - - # 安全获取当前时间 - var time_parts = Time.get_datetime_string_from_system().split(" ") - var current_time = "" - if time_parts.size() >= 2: - current_time = time_parts[1] # 获取时间部分 - else: - # 如果格式不对,使用简单的时间格式 - var time_dict = Time.get_datetime_dict_from_system() - current_time = str(time_dict.hour).pad_zeros(2) + ":" + str(time_dict.minute).pad_zeros(2) + ":" + str(time_dict.second).pad_zeros(2) - - var detail_text = "[color=#" + color.to_html() + "]" + current_time + " " + text + "[/color]\n" - battle_details.text += detail_text - - # 自动滚动到底部 - await get_tree().process_frame - if battle_details.get_v_scroll_bar(): - battle_details.get_v_scroll_bar().value = battle_details.get_v_scroll_bar().max_value - -# 清空对战细节 -func clear_battle_details(): - if battle_details: - battle_details.text = "" - -# 战斗结束检查计时器 -var battle_check_timer: float = 0.0 -var battle_check_interval: float = 0.5 # 每0.5秒检查一次,减少性能开销 - -func _process(delta): - # 只有启用自动对战时才检查战斗结束,并使用计时器减少检查频率 - if auto_battle_enabled and battle_started and not battle_ended: - battle_check_timer += delta - if battle_check_timer >= battle_check_interval: - battle_check_timer = 0.0 - check_battle_end() - - -# 获取队伍节点 - 供宠物调用 -func get_team_node(team_name: String) -> Node: - match team_name: - "team1": - return team1_node - "team2": - return team2_node - "neutral": - return neutral_node - _: - return null - - - -# 开始战斗 -func start_battle(): - if battle_started: - return - - battle_started = true - battle_ended = false - battle_start_time = Time.get_ticks_msec() / 1000.0 # 记录战斗开始时间 - - # 显示细节面板并初始化内容 - if pet_battle_details_panel: - pet_battle_details_panel.visible = true - add_battle_detail("⚔️ 战斗开始!", Color.YELLOW) - - # 显示双方宠物信息 - var all_pets = get_tree().get_nodes_in_group("pets") - for pet in all_pets: - if pet.pet_team == "team1": - add_battle_detail("🔵 " + pet.pet_name + " 参战!", Color.CYAN) - elif pet.pet_team == "team2": - add_battle_detail("🟠 " + pet.pet_name + " 参战!", Color.ORANGE) - -# 检查战斗是否结束 -func check_battle_end(): - if battle_ended or not battle_started: - return - - # 等待战斗真正开始后再检查(避免立即结束) - if Time.get_ticks_msec() / 1000.0 - battle_start_time < 2.0: - return - - var team1_alive = 0 - var team2_alive = 0 - - # 统计存活宠物数量 - 只检查当前对战面板下的宠物 - for pet in team1_pets: - if is_instance_valid(pet) and pet.is_alive: - team1_alive += 1 - - for pet in team2_pets: - if is_instance_valid(pet) and pet.is_alive: - team2_alive += 1 - - # 判断胜负 - if team1_alive == 0 and team2_alive == 0: - end_battle("draw") - elif team1_alive == 0: - end_battle("team2") - elif team2_alive == 0: - end_battle("team1") - -# 结束战斗 -func end_battle(winner: String): - if battle_ended: - return - - battle_ended = true - winner_team = winner - - # 添加战斗结束细节 - var end_message = "" - var end_color = Color.WHITE - match winner: - "team1": - end_message = "🏆 我方获胜!" - end_color = Color.GREEN - "team2": - end_message = "🏆 敌方获胜!" - end_color = Color.RED - "draw": - end_message = "🤝 平局!双方同归于尽" - end_color = Color.GRAY - - add_battle_detail(end_message, end_color) - - # 显示战斗结算面板 - show_battle_end_panel(winner) - - # 处理偷菜对战结果 - if is_steal_battle: - await get_tree().create_timer(2.0).timeout - handle_steal_battle_result(winner) - - - - -# 显示战斗结算面板 -func show_battle_end_panel(winner: String): - var result_text = "" - - # 统计存活宠物和详细信息 - 从宠物组中获取 - var all_pets = get_tree().get_nodes_in_group("pets") - for pet in all_pets: - if not is_instance_valid(pet): - continue - - # 构建结算文本 - result_text += "=== 战斗结算 ===\n\n" - - match winner: - "team1": - result_text += "🏆 我方获胜!\n\n" - "team2": - result_text += "🏆 敌方获胜!\n\n" - "draw": - result_text += "🤝 平局!双方同归于尽\n\n" - - # 给所有参与对战的宠物奖励经验和亲密度 - for pet in all_pets: - if is_instance_valid(pet): - # 所有宠物获得参与对战奖励 - pet.gain_experience(30.0) # 参与对战随机获得30-100经验 - pet.gain_intimacy(15.0) # 参与对战随机获得1-12亲密度 - - - contents.text = result_text - battle_end_panel.visible = true - -# 设置偷菜对战 -func setup_steal_battle(battle_pet_data: Dictionary, patrol_pet_data: Dictionary, attacker_name: String, defender_name: String): - - # 停止当前对战 - stop_auto_battle() - - # 清理现有宠物 - clear_all_pets() - - # 设置为偷菜对战模式 - is_steal_battle = true - steal_battle_cost = 1300 - - # 记录对战信息 - current_attacker_name = attacker_name - current_battle_pet_id = battle_pet_data.get("基本信息", {}).get("宠物ID", "") - - # 根据宠物数据创建对战宠物 - var battle_pet = create_pet_from_data(battle_pet_data, team1_node, Vector2(200, 300)) - var patrol_pet = create_pet_from_data(patrol_pet_data, team2_node, Vector2(1000, 300)) - - if battle_pet and patrol_pet: - # 设置宠物名称标识 - var battle_original_name = battle_pet_data.get("基本信息", {}).get("宠物名称", "未知宠物") - var patrol_original_name = patrol_pet_data.get("基本信息", {}).get("宠物名称", "未知宠物") - - battle_pet.pet_name = "[出战] " + battle_original_name - patrol_pet.pet_name = "[巡逻] " + patrol_original_name - - # 确保宠物正确设置类型并加载配置 - var battle_pet_type = battle_pet_data.get("基本信息", {}).get("宠物类型", "") - var patrol_pet_type = patrol_pet_data.get("基本信息", {}).get("宠物类型", "") - - if battle_pet_type != "": - battle_pet.set_pet_type_and_load_config(battle_pet_type) - if patrol_pet_type != "": - patrol_pet.set_pet_type_and_load_config(patrol_pet_type) - - # 重新应用宠物数据(覆盖JSON配置) - apply_pet_data_to_instance(battle_pet, battle_pet_data) - apply_pet_data_to_instance(patrol_pet, patrol_pet_data) - - # 强制设置正确的队伍信息(在数据应用之后) - battle_pet.pet_team = "team1" - patrol_pet.pet_team = "team2" - - # 设置碰撞层 - battle_pet.setup_collision_layers() - patrol_pet.setup_collision_layers() - - # 启用战斗模式 - battle_pet.set_combat_enabled(true) - patrol_pet.set_combat_enabled(true) - - # 添加到队伍数组 - team1_pets.clear() - team2_pets.clear() - team1_pets.append(battle_pet) - team2_pets.append(patrol_pet) - - # 添加到宠物组 - battle_pet.add_to_group("pets") - battle_pet.add_to_group("team1") - patrol_pet.add_to_group("pets") - patrol_pet.add_to_group("team2") - - # 重置对战状态 - auto_battle_enabled = true - battle_started = false - battle_ended = false - - # 延迟启动战斗 - await get_tree().create_timer(1.0).timeout - start_battle() - -# 根据宠物数据创建宠物实例 -func create_pet_from_data(pet_data: Dictionary, team_node: Node, spawn_pos: Vector2) -> CharacterBody2D: - var pet_type = pet_data.get("基本信息", {}).get("宠物类型", "") - var scene_path = pet_data.get("场景路径", "") - - # 优先使用场景路径 - var pet_scene = null - if scene_path != "" and ResourceLoader.exists(scene_path): - pet_scene = load(scene_path) - elif available_pets.has(pet_type): - pet_scene = available_pets[pet_type] - else: - return null - - var pet_instance = pet_scene.instantiate() - team_node.add_child(pet_instance) - - # 应用宠物数据 - apply_pet_data_to_instance(pet_instance, pet_data) - - # 设置位置 - pet_instance.global_position = spawn_pos - - return pet_instance - -# 应用宠物数据到实例 -func apply_pet_data_to_instance(pet_instance: CharacterBody2D, pet_data: Dictionary): - var basic_info = pet_data.get("基本信息", {}) - var level_exp = pet_data.get("等级经验", {}) - var health_defense = pet_data.get("生命与防御", {}) - - # 应用基本信息 - pet_instance.pet_owner = basic_info.get("宠物主人", "未知主人") - pet_instance.pet_name = basic_info.get("宠物名称", basic_info.get("宠物类型", "未知宠物")) - pet_instance.pet_id = basic_info.get("宠物ID", "") - pet_instance.pet_type = basic_info.get("宠物类型", "") - pet_instance.pet_birthday = basic_info.get("生日", "") - pet_instance.pet_personality = basic_info.get("性格", "活泼") - - # 应用等级经验 - pet_instance.pet_level = level_exp.get("宠物等级", 1) - pet_instance.pet_experience = level_exp.get("当前经验", 0.0) - pet_instance.max_experience = level_exp.get("最大经验", 100.0) - pet_instance.pet_intimacy = level_exp.get("亲密度", 0.0) - - # 应用生命防御属性 - pet_instance.max_health = health_defense.get("最大生命值", 100.0) - pet_instance.current_health = health_defense.get("当前生命值", pet_instance.max_health) - pet_instance.max_shield = health_defense.get("最大护盾值", 0.0) - pet_instance.current_shield = health_defense.get("当前护盾值", 0.0) - pet_instance.max_armor = health_defense.get("最大护甲值", 0.0) - pet_instance.current_armor = health_defense.get("当前护甲值", 0.0) - - # 启用战斗模式 - if pet_instance.has_method("set_combat_enabled"): - pet_instance.set_combat_enabled(true) - - # 更新UI显示 - if pet_instance.has_method("update_ui"): - pet_instance.update_ui() - -# 清理所有宠物 -func clear_all_pets(): - # 清空对战细节 - clear_battle_details() - - # 批量处理宠物清理,提高性能 - var nodes_to_clear = [team1_node, team2_node, neutral_node] - - for node in nodes_to_clear: - if not is_instance_valid(node): - continue - - # 先移除组标签,再清理节点 - for child in node.get_children(): - if is_instance_valid(child): - # 停止宠物的所有行为,防止在清理过程中继续执行逻辑 - if child.has_method("set_combat_enabled"): - child.set_combat_enabled(false) - - # 移除所有组标签 - child.remove_from_group("pets") - child.remove_from_group("team1") - child.remove_from_group("team2") - child.remove_from_group("neutral") - child.remove_from_group("aid_minions") - - # 立即销毁,避免延迟 - node.remove_child(child) - child.queue_free() - - # 清空队伍数组 - team1_pets.clear() - team2_pets.clear() - - # 清理所有子弹和援助宠物 - var groups_to_clear = ["projectiles", "aid_minions"] - for group_name in groups_to_clear: - var group_nodes = get_tree().get_nodes_in_group(group_name) - for node in group_nodes: - if is_instance_valid(node): - node.remove_from_group(group_name) - node.queue_free() - - # 等待一帧确保清理完成 - await get_tree().process_frame - -# 处理偷菜对战结果 -func handle_steal_battle_result(winner: String): - var main_game = get_node("/root/main") - if not main_game: - return - - # 计算出战宠物获得的经验和亲密度 - var exp_gained = 30.0 # 基础参与经验 - var intimacy_gained = 15.0 # 基础参与亲密度 - - # 获取出战宠物的当前状态 - var battle_pet = null - for pet in team1_pets: - if is_instance_valid(pet): - battle_pet = pet - break - - if not battle_pet: - return - - if winner == "team1": # 出战宠物获胜 - exp_gained += 50.0 # 胜利额外经验 - intimacy_gained += 25.0 # 胜利额外亲密度 - Toast.show("对战胜利!可以继续偷菜", Color.GREEN, 3.0) - else: # 巡逻宠物获胜或平局 - exp_gained += 10.0 # 失败安慰经验 - intimacy_gained += 5.0 # 失败安慰亲密度 - - # 扣除惩罚金币 - if main_game.money >= steal_battle_cost: - main_game.money -= steal_battle_cost - main_game._update_ui() - Toast.show("对战失败!支付了 " + str(steal_battle_cost) + " 金币", Color.RED, 3.0) - else: - Toast.show("对战失败!但金币不足支付惩罚", Color.RED, 3.0) - - # 更新宠物数据到服务器 - update_battle_pet_data(current_battle_pet_id, current_attacker_name, exp_gained, intimacy_gained, battle_pet) - - # 重置偷菜对战状态 - is_steal_battle = false - current_battle_pet_id = "" - current_attacker_name = "" - -# 返回农场按钮点击事件 -func _on_return_farm_pressed(): - # 隐藏结算面板和细节面板 - if battle_end_panel: - battle_end_panel.visible = false - if pet_battle_details_panel: - pet_battle_details_panel.visible = false - - # 完全清理所有宠物和数据 - clear_all_pets() - - # 等待一帧确保清理完成 - await get_tree().process_frame - - # 重置对战状态 - battle_started = false - battle_ended = false - is_steal_battle = false - auto_battle_enabled = true - winner_team = "" - - # 重新启用相机缩放 - GlobalVariables.isZoomDisabled = false - - # 隐藏面板 - self.hide() - -# 更新出战宠物数据到服务器 -func update_battle_pet_data(pet_id: String, attacker_name: String, exp_gained: float, intimacy_gained: float, battle_pet: CharacterBody2D): - if pet_id == "" or attacker_name == "": - return - - # 计算新的经验和亲密度 - var current_exp = battle_pet.pet_experience + exp_gained - var current_intimacy = battle_pet.pet_intimacy + intimacy_gained - var current_level = battle_pet.pet_level - var max_exp = battle_pet.max_experience - - # 检查升级 - var level_ups = 0 - while current_exp >= max_exp and current_level < 50: - current_exp -= max_exp - current_level += 1 - level_ups += 1 - # 重新计算升级经验需求(指数增长) - max_exp = 100.0 * pow(1.2, current_level - 1) - - # 计算升级后的属性加成 - var level_bonus_multiplier = pow(1.1, level_ups) # 每级10%属性加成 - - # 准备发送给服务器的数据 - var update_data = { - "type": "update_battle_pet_data", - "pet_id": pet_id, - "attacker_name": attacker_name, - "exp_gained": exp_gained, - "intimacy_gained": intimacy_gained, - "new_level": current_level, - "new_experience": current_exp, - "new_max_experience": max_exp, - "new_intimacy": current_intimacy, - "level_ups": level_ups, - "level_bonus_multiplier": level_bonus_multiplier, - "is_steal_battle": is_steal_battle, - "battle_winner": winner_team - } - - # 发送数据到服务器 - - if tcp_network_manager_panel: - tcp_network_manager_panel.client.send_data(update_data) - if level_ups > 0: - add_battle_detail("🎉 " + battle_pet.pet_name + " 升级了 " + str(level_ups) + " 级!当前等级:" + str(current_level), Color.GOLD) - add_battle_detail("📈 " + battle_pet.pet_name + " 获得 " + str(int(exp_gained)) + " 经验," + str(int(intimacy_gained)) + " 亲密度", Color.GREEN) - -# 停止自动对战逻辑 -func stop_auto_battle(): - auto_battle_enabled = false - battle_started = false - battle_ended = false - is_steal_battle = false # 重置偷菜对战状态 - battle_start_time = 0.0 # 重置战斗开始时间 - winner_team = "" - -#面板显示与隐藏切换处理 -func _on_visibility_changed(): - if visible: - GlobalVariables.isZoomDisabled = true - pass - else: - GlobalVariables.isZoomDisabled = false - pass diff --git a/Script/Pet/PetFightPanel.gd.uid b/Script/Pet/PetFightPanel.gd.uid deleted file mode 100644 index 20c5bb0..0000000 --- a/Script/Pet/PetFightPanel.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ke4moxwg1gfd diff --git a/Script/Pet/Projectile.gd b/Script/Pet/Projectile.gd deleted file mode 100644 index 27df39a..0000000 --- a/Script/Pet/Projectile.gd +++ /dev/null @@ -1,129 +0,0 @@ -extends Area2D - -# 子弹属性 -var damage: float = 20.0 -var speed: float = 300.0 -var direction: Vector2 = Vector2.ZERO -var attacker_team: String = "" -var attacker_element: int = 0 -var armor_penetration: float = 0.0 -var attacker_pet: CharacterBody2D = null # 攻击者引用 - -# 子弹生存时间(防止子弹飞出边界后一直存在) -var lifetime: float = 3.0 - -var lifetime_timer: float = 0.0 # 生存时间计时器 - -func _ready(): - # 连接碰撞信号 - area_entered.connect(_on_area_entered) - body_entered.connect(_on_body_entered) - - # 设置子弹的碰撞层 - 子弹需要能检测到所有队伍的宠物 - collision_layer = 0 # 子弹本身不需要被检测 - collision_mask = 3 # 检测team1和team2的宠物 (1+2) - - # 创建简单的圆形纹理 - create_circle_texture() - - # 添加到子弹组 - add_to_group("projectiles") - -func _physics_process(delta): - # 子弹移动 - global_position += direction * speed * delta - - # 更新生存时间 - lifetime_timer += delta - if lifetime_timer >= lifetime: - destroy_projectile() - -# 销毁子弹(直接销毁) -func destroy_projectile(): - # 延迟销毁,避免在物理回调中移除节点 - call_deferred("queue_free") - -# 穿透属性 -var pierce_remaining: int = 1 # 剩余穿透次数 -var hit_enemies: Array[CharacterBody2D] = [] # 已击中的敌人列表(防止重复击中) - -func set_projectile_data(dmg: float, spd: float, dir: Vector2, team: String, element: int, armor_pen: float = 0.0, pierce: int = 1, attacker: CharacterBody2D = null): - damage = dmg - speed = spd - direction = dir.normalized() - attacker_team = team - attacker_element = element - armor_penetration = armor_pen - pierce_remaining = pierce - attacker_pet = attacker - -func _on_area_entered(area): - # 这里可以处理与其他Area2D的碰撞(如果需要) - pass - -func _on_body_entered(body): - # 检查是否击中敌方宠物 - if body is CharacterBody2D and body.has_method("get_team"): - var target_team = body.get_team() - - # 不能击中同队伍的宠物 - if target_team == attacker_team: - print("子弹跳过同队伍宠物: " + body.pet_name + " (队伍: " + target_team + ")") - return - - # 不能击中死亡的宠物 - if not body.is_alive: - print("子弹跳过死亡宠物: " + body.pet_name) - return - - # 不能重复击中同一个敌人 - if body in hit_enemies: - print("子弹跳过已击中的宠物: " + body.pet_name) - return - - # 记录击中的敌人 - hit_enemies.append(body) - - # 对目标造成伤害(检查攻击者是否还有效) - var valid_attacker = null - if attacker_pet and is_instance_valid(attacker_pet): - valid_attacker = attacker_pet - body.take_damage(damage, armor_penetration, attacker_element, valid_attacker) - print("子弹击中敌方宠物: " + body.pet_name + " (攻击方: " + attacker_team + " 目标: " + target_team + ") 造成伤害: " + str(damage)) - - # 减少穿透次数 - pierce_remaining -= 1 - - # 如果穿透次数用完,销毁子弹 - if pierce_remaining <= 0: - print("子弹穿透次数用完,销毁") - destroy_projectile() - else: - print("子弹穿透,剩余穿透次数: " + str(pierce_remaining)) - else: - print("子弹击中非宠物对象: " + str(body)) - -# 创建简单的圆形纹理 -func create_circle_texture(): - var sprite = get_node_or_null("ProjectileSprite") - if sprite: - # 创建一个简单的圆形图像纹理 - var image = Image.create(20, 20, false, Image.FORMAT_RGBA8) - var center = Vector2(10, 10) - var radius = 8 - - # 绘制圆形 - for x in range(20): - for y in range(20): - var distance = Vector2(x, y).distance_to(center) - if distance <= radius: - # 设置黄色像素 - image.set_pixel(x, y, Color.YELLOW) - else: - # 设置透明像素 - image.set_pixel(x, y, Color.TRANSPARENT) - - # 创建纹理并应用 - var texture = ImageTexture.new() - texture.set_image(image) - sprite.texture = texture diff --git a/Script/Pet/Projectile.gd.uid b/Script/Pet/Projectile.gd.uid deleted file mode 100644 index d61e055..0000000 --- a/Script/Pet/Projectile.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cbhhx6st14pse diff --git a/Script/SmallPanel/CropInformPanel.gd b/Script/SmallPanel/CropInformPanel.gd index edfb716..158281f 100644 --- a/Script/SmallPanel/CropInformPanel.gd +++ b/Script/SmallPanel/CropInformPanel.gd @@ -186,7 +186,6 @@ func _on_add_to_store_pressed(): _on_cancel_add_to_store ) else: - Toast.show("添加商品功能暂未实现", Color.RED, 2.0, 1.0) print("错误:找不到AddProduct2StorePopup或相关方法") # 确认添加到小卖部回调 diff --git a/Script/SmallPanel/OneClickPlantPanel.gd b/Script/SmallPanel/OneClickPlantPanel.gd index 8685002..44e5512 100644 --- a/Script/SmallPanel/OneClickPlantPanel.gd +++ b/Script/SmallPanel/OneClickPlantPanel.gd @@ -62,9 +62,12 @@ var current_plant_index = 0 var is_waiting_for_lot_selection = false var pending_plant_type = "" +#==================基础函数===================== func _ready(): self.hide() + # 连接可见性改变信号 + visibility_changed.connect(_on_visibility_changed) # 连接按钮信号 full_screen_plant_btn.pressed.connect(_on_full_screen_plant_pressed) one_row_plant_btn.pressed.connect(_on_one_row_plant_pressed) @@ -82,6 +85,7 @@ func _process(delta): if plant_timer >= PLANT_INTERVAL: plant_timer = 0.0 _process_plant_queue() +#==================基础函数===================== #=================================一键种植模式========================================= @@ -293,8 +297,6 @@ func _prepare_random_plant(): #=================================一键种植模式========================================= - - # 开始地块选择模式 func _start_lot_selection_mode(plant_type: String): is_waiting_for_lot_selection = true @@ -593,6 +595,8 @@ func stop_planting(): Toast.show("一键种植已停止", Color.YELLOW) _finish_planting() + +#======================通用面板处理===================== #关闭一键种植面板 func _on_quit_button_pressed() -> void: # 如果正在种植,先停止种植 @@ -604,3 +608,13 @@ func _on_quit_button_pressed() -> void: return self.hide() pass + +#面板显示切换处理 +func _on_visibility_changed(): + if visible: + GlobalVariables.isZoomDisabled = true + pass + else: + GlobalVariables.isZoomDisabled = false + pass +#======================通用面板处理===================== diff --git a/Script/SmallPanel/OnlineGiftPanel.gd b/Script/SmallPanel/OnlineGiftPanel.gd index 9394435..e18c1c8 100644 --- a/Script/SmallPanel/OnlineGiftPanel.gd +++ b/Script/SmallPanel/OnlineGiftPanel.gd @@ -57,6 +57,10 @@ func _ready(): "5小时": five_hours } + + # 连接可见性改变信号 + visibility_changed.connect(_on_visibility_changed) + # 连接按钮信号 for gift_name in button_mapping.keys(): var button = button_mapping[gift_name] @@ -186,6 +190,18 @@ func handle_claim_online_gift_response(data: Dictionary): else: Toast.show(message, Color.RED) + +#================通用面板处理================== #关闭在线礼包面板 func _on_quit_button_pressed() -> void: self.hide() + +# 面板显示时的处理 +func _on_visibility_changed(): + if visible: + GlobalVariables.isZoomDisabled = true + pass + else: + GlobalVariables.isZoomDisabled = false + pass +#================通用面板处理================== diff --git a/Script/SmallPanel/PetInformPanel.gd b/Script/SmallPanel/PetInformPanel.gd index baf68fb..fa7be10 100644 --- a/Script/SmallPanel/PetInformPanel.gd +++ b/Script/SmallPanel/PetInformPanel.gd @@ -32,7 +32,6 @@ var current_pet_name: String = "" @onready var item_bag_panel: Panel = $'../../BigPanel/ItemBagPanel' @onready var pet_store_panel: Panel = $'../../BigPanel/PetStorePanel' @onready var pet_bag_panel: Panel = $'../../BigPanel/PetBagPanel' -@onready var pet_fight_panel: Panel = $'../../BigPanel/PetFightPanel' @@ -202,6 +201,8 @@ func _set_pet_detailed_info(pet_name: String, pet_data: Dictionary): info_text += "召唤技能:[color=cyan]已激活[/color] (数量: " + str(pet_data.get("summon_count", 0)) + ", 缩放: " + str(pet_data.get("summon_scale", 1.0)) + ")\n" if pet_data.get("enable_death_respawn_skill", false): info_text += "死亡重生:[color=purple]已激活[/color] (生命: " + str(pet_data.get("respawn_health_percentage", 0) * 100) + "%)\n" + if pet_data.get("enable_damage_reflection_skill", false): + info_text += "伤害反弹:[color=yellow]已激活[/color] (荆棘护甲)\n" info_text += "\n" # 设置文本 diff --git a/Script/SmallPanel/TodayDivinationPanel.gd b/Script/SmallPanel/TodayDivinationPanel.gd new file mode 100644 index 0000000..27a50cc --- /dev/null +++ b/Script/SmallPanel/TodayDivinationPanel.gd @@ -0,0 +1,123 @@ +extends PanelContainer + +@onready var start_button: Button = $VBox/StartButton #开始占卜 +@onready var quit_button: Button = $VBox/QuitButton #关闭面板 +@onready var contents: RichTextLabel = $VBox/Scroll/Contents #显示占卜内容 用bbcode美化一下 + +@onready var tcp_network_manager_panel: Panel = $'../../BigPanel/TCPNetworkManagerPanel' + +# 占卜状态 +var is_divining: bool = false +var today_divination_data: Dictionary = {} + +func _ready() -> void: + self.hide() + visibility_changed.connect(_on_visibility_changed) + # 连接按钮信号 + start_button.pressed.connect(_on_start_button_pressed) + quit_button.pressed.connect(_on_quit_button_pressed) + +#关闭面板 +func _on_quit_button_pressed() -> void: + self.hide() + +#开始占卜 +func _on_start_button_pressed() -> void: + if is_divining: + return + + # 检查今日是否已经占卜过 + var today_date = Time.get_date_string_from_system() + if today_divination_data.get("占卜日期", "") == today_date: + Toast.show("今日已经占卜过了,明日再来吧!", Color.ORANGE) + return + + # 开始占卜 + is_divining = true + start_button.disabled = true + start_button.text = "占卜中..." + + # 显示占卜进行中的内容 + contents.text = "[center][color=gold]正在为您占卜中...[/color]\n\n[color=cyan]天机不可泄露,请稍候...[/color][/center]" + + # 3秒后显示占卜结果 + await get_tree().create_timer(3.0).timeout + + # 发送占卜请求到服务器 + if tcp_network_manager_panel and tcp_network_manager_panel.has_method("sendDivinationRequest"): + tcp_network_manager_panel.sendDivinationRequest() + else: + Toast.show("网络连接异常,无法进行占卜", Color.RED) + _reset_divination_state() + +# 处理占卜响应 +func handle_divination_response(success: bool, message: String, divination_data: Dictionary = {}): + if success: + # 更新本地占卜数据 + today_divination_data = divination_data.get("今日占卜对象", {}) + + # 显示占卜结果 + _display_divination_result(today_divination_data) + + Toast.show("占卜完成!", Color.GREEN) + else: + contents.text = "[center][color=red]占卜失败:" + message + "[/color][/center]" + Toast.show(message, Color.RED) + + _reset_divination_state() + +# 显示占卜结果 +func _display_divination_result(divination_data: Dictionary): + var divination_date = divination_data.get("占卜日期", "") + var divination_result = divination_data.get("占卜结果", "") + var divination_level = divination_data.get("占卜等级", "") + var divination_hexagram = divination_data.get("卦象", "") + var divination_advice = divination_data.get("建议", "") + + var result_text = "[center][color=gold]═══ 今日占卜结果 ═══[/color]\n\n" + result_text += "[color=cyan]占卜日期:[/color]" + divination_date + "\n\n" + result_text += "[color=yellow]占卜等级:[/color]" + divination_level + "\n\n" + result_text += "[color=purple]卦象:[/color]" + divination_hexagram + "\n\n" + result_text += "[color=blue]占卜结果:[/color]\n" + divination_result + "\n\n" + result_text += "[color=green]建议:[/color]\n" + divination_advice + "\n\n" + result_text += "[color=gold]═══════════════[/color][/center]" + + contents.text = result_text + +# 重置占卜状态 +func _reset_divination_state(): + is_divining = false + start_button.disabled = false + start_button.text = "开始占卜" + +# 面板显示时的处理 +func _on_visibility_changed(): + if visible: + # 面板显示时自动刷新数据 + _refresh_divination_data() + GlobalVariables.isZoomDisabled = true + else: + GlobalVariables.isZoomDisabled = false + +# 刷新占卜数据 +func _refresh_divination_data(): + # 从主游戏获取占卜数据 + var main_game = get_node("/root/main") + if main_game and main_game.has_method("get_player_divination_data"): + today_divination_data = main_game.get_player_divination_data() + + # 检查今日是否已经占卜过 + var today_date = Time.get_date_string_from_system() + if today_divination_data.get("占卜日期", "") == today_date: + # 显示今日占卜结果 + _display_divination_result(today_divination_data) + start_button.text = "今日已占卜" + start_button.disabled = true + else: + # 显示默认内容 + contents.text = "[center][color=gold]═══ 今日占卜 ═══[/color]\n\n[color=cyan]点击下方按钮开始今日占卜\n\n占卜将为您揭示今日运势\n结合易经八卦为您指点迷津[/color]\n\n[color=orange]每日仅可占卜一次[/color][/center]" + start_button.text = "开始占卜" + start_button.disabled = false + else: + # 显示默认内容 + contents.text = "[center][color=gold]═══ 今日占卜 ═══[/color]\n\n[color=cyan]点击下方按钮开始今日占卜\n\n占卜将为您揭示今日运势\n结合易经八卦为您指点迷津[/color]\n\n[color=orange]每日仅可占卜一次[/color][/center]" diff --git a/Script/SmallPanel/TodayDivinationPanel.gd.uid b/Script/SmallPanel/TodayDivinationPanel.gd.uid new file mode 100644 index 0000000..22a45fb --- /dev/null +++ b/Script/SmallPanel/TodayDivinationPanel.gd.uid @@ -0,0 +1 @@ +uid://bkel88rscubov diff --git a/Server/SMYMongoDBAPI.py b/Server/SMYMongoDBAPI.py index 372fe1b..69dce69 100644 --- a/Server/SMYMongoDBAPI.py +++ b/Server/SMYMongoDBAPI.py @@ -399,6 +399,172 @@ class SMYMongoDBAPI: #=====================初始玩家数据模板系统====================== + def batch_update_offline_players_crops(self, growth_multiplier: float = 1.0, exclude_online_players: List[str] = None) -> int: + """ + 批量更新离线玩家的作物生长(优化版本,支持完整的加速效果计算) + + Args: + growth_multiplier: 基础生长倍数,默认1.0 + exclude_online_players: 要排除的在线玩家列表 + + Returns: + int: 更新的玩家数量 + """ + try: + import time + from datetime import datetime + + collection = self.get_collection("playerdata") + + if exclude_online_players is None: + exclude_online_players = [] + + # 查询符合条件的玩家(包含注册时间用于新手奖励判断) + query = { + "玩家账号": {"$nin": exclude_online_players}, + "农场土地": { + "$elemMatch": { + "is_diged": True, + "is_planted": True, + "is_dead": False, + "grow_time": {"$exists": True}, + "max_grow_time": {"$exists": True} + } + } + } + + # 获取需要更新的玩家数据(包含注册时间) + players_cursor = collection.find(query, {"玩家账号": 1, "农场土地": 1, "注册时间": 1}) + updated_count = 0 + + for player in players_cursor: + account_id = player.get("玩家账号") + farm_lands = player.get("农场土地", []) + register_time_str = player.get("注册时间", "") + + # 判断是否享受新手奖励 + is_new_player_bonus = self._is_new_player_bonus_active(register_time_str) + + # 检查是否有需要更新的土地 + has_updates = False + current_time = time.time() + + for land in farm_lands: + if (land.get("is_diged") and land.get("is_planted") and + not land.get("is_dead") and + land.get("grow_time", 0) < land.get("max_grow_time", 0)): + + # 计算生长速度增量(累加方式) + growth_increase = growth_multiplier # 基础生长速度:每次更新增长1秒 + + # 新手奖励:注册后3天内额外增加9秒(总共10倍速度) + if is_new_player_bonus: + growth_increase += 9 + + # 土地等级影响 - 根据不同等级额外增加生长速度 + land_level = land.get("土地等级", 0) + land_speed_bonus = { + 0: 0, # 默认土地:无额外加成 + 1: 1, # 黄土地:额外+1秒(总共2倍速) + 2: 3, # 红土地:额外+3秒(总共4倍速) + 3: 5, # 紫土地:额外+5秒(总共6倍速) + 4: 9 # 黑土地:额外+9秒(总共10倍速) + } + growth_increase += land_speed_bonus.get(land_level, 0) + + # 施肥影响 - 支持不同类型的道具施肥 + if land.get("已施肥", False) and "施肥时间" in land: + fertilize_time = land.get("施肥时间", 0) + + # 获取施肥类型和对应的持续时间、加成 + fertilize_duration = land.get("施肥持续时间", 600) # 默认10分钟 + fertilize_bonus = land.get("施肥加成", 1) # 默认额外+1秒 + + if current_time - fertilize_time <= fertilize_duration: + # 施肥效果仍在有效期内,累加施肥加成 + growth_increase += fertilize_bonus + else: + # 施肥效果过期,清除施肥状态 + land["已施肥"] = False + if "施肥时间" in land: + del land["施肥时间"] + if "施肥类型" in land: + del land["施肥类型"] + if "施肥倍数" in land: + del land["施肥倍数"] + if "施肥持续时间" in land: + del land["施肥持续时间"] + if "施肥加成" in land: + del land["施肥加成"] + + # 确保最小增长量为1 + if growth_increase < 1: + growth_increase = 1 + + # 更新生长时间,但不超过最大生长时间 + new_grow_time = min( + land["grow_time"] + growth_increase, + land["max_grow_time"] + ) + land["grow_time"] = new_grow_time + has_updates = True + + # 如果有更新,保存到数据库 + if has_updates: + update_result = collection.update_one( + {"玩家账号": account_id}, + { + "$set": { + "农场土地": farm_lands, + "updated_at": datetime.now() + } + } + ) + + if update_result.acknowledged and update_result.matched_count > 0: + updated_count += 1 + + self.logger.info(f"批量更新了 {updated_count} 个离线玩家的作物生长(包含完整加速效果)") + return updated_count + + except Exception as e: + self.logger.error(f"批量更新离线玩家作物失败: {e}") + return 0 + + def _is_new_player_bonus_active(self, register_time_str: str) -> bool: + """ + 检查玩家是否在新玩家奖励期内(注册后3天内享受10倍生长速度) + + Args: + register_time_str: 注册时间字符串 + + Returns: + bool: 是否享受新手奖励 + """ + try: + import datetime + + # 如果没有注册时间或者是默认的老玩家时间,则不享受奖励 + if not register_time_str or register_time_str == "2025年05月21日15时00分00秒": + return False + + # 解析注册时间 + register_time = datetime.datetime.strptime(register_time_str, "%Y年%m月%d日%H时%M分%S秒") + current_time = datetime.datetime.now() + + # 计算注册天数 + time_diff = current_time - register_time + days_since_register = time_diff.total_seconds() / 86400 # 转换为天数 + + # 3天内享受新玩家奖励 + return days_since_register <= 3 + + except ValueError as e: + self.logger.warning(f"解析注册时间格式错误: {register_time_str}, 错误: {str(e)}") + return False + + # 注意:get_offline_players_with_crops 方法已被移除 + # 现在使用优化的 batch_update_offline_players_crops 方法直接在 MongoDB 中处理查询和更新 #=====================玩家数据管理====================== # ========================= 验证码系统 ========================= diff --git a/Server/TCPGameServer.py b/Server/TCPGameServer.py index b5850ac..89abb90 100644 --- a/Server/TCPGameServer.py +++ b/Server/TCPGameServer.py @@ -22,7 +22,7 @@ from ConsoleCommandsAPI import ConsoleCommandsAPI #导入控制台命令API模 ==================================================================== """ server_host: str = "0.0.0.0" -server_port: int = 6060 +server_port: int = 7070 buffer_size: int = 4096 server_version: str = "2.0.1" @@ -70,6 +70,7 @@ class TCPGameServer(TCPServer): self.start_weed_growth_timer() self.start_wisdom_tree_health_decay_timer() self.start_verification_code_cleanup_timer() + self.start_offline_crop_update_timer() #初始化MongoDB API def _init_mongodb_api(self): @@ -130,8 +131,6 @@ class TCPGameServer(TCPServer): self.crop_timer.daemon = True self.crop_timer.start() - - #启动杂草生长计时器 def start_weed_growth_timer(self): """启动杂草生长计时器,每天检查一次""" @@ -175,6 +174,18 @@ class TCPGameServer(TCPServer): self.verification_cleanup_timer.daemon = True self.verification_cleanup_timer.start() + def start_offline_crop_update_timer(self): + """启动离线玩家作物更新定时器""" + try: + self.update_offline_players_crops() + except Exception as e: + self.log('ERROR', f"离线玩家作物更新时出错: {str(e)}", 'SERVER') + + # 创建下一个离线作物更新计时器(每1分钟检查一次) + self.offline_crop_timer = threading.Timer(60, self.start_offline_crop_update_timer) # 每1分钟更新一次 + self.offline_crop_timer.daemon = True + self.offline_crop_timer.start() + #获取服务器统计信息 def get_server_stats(self): """获取服务器统计信息""" @@ -213,6 +224,12 @@ class TCPGameServer(TCPServer): self.verification_cleanup_timer = None self.log('INFO', "验证码清理定时器已停止", 'SERVER') + # 停止离线作物更新定时器 + if hasattr(self, 'offline_crop_timer') and self.offline_crop_timer: + self.offline_crop_timer.cancel() + self.offline_crop_timer = None + self.log('INFO', "离线作物更新定时器已停止", 'SERVER') + # 显示服务器统计信息 stats = self.get_server_stats() self.log('INFO', f"服务器统计 - 在线玩家: {stats['online_players']}, 总连接: {stats['total_connections']}", 'SERVER') @@ -321,10 +338,7 @@ class TCPGameServer(TCPServer): except Exception as e: self.log('ERROR', f"保存玩家 {account_id} 的数据时出错: {str(e)}", 'SERVER') return False - - #加载玩家数据(兼容旧方法名) - - + #加载玩家数据 def _load_player_data_with_check(self, client_id, action_type=None): """加载玩家数据并进行错误检查的通用方法""" @@ -446,6 +460,33 @@ class TCPGameServer(TCPServer): except ValueError as e: self.log('WARNING', f"解析注册时间格式错误: {register_time_str}, 错误: {str(e)}", 'SERVER') return False + + def update_offline_players_crops(self): + """更新离线玩家的作物生长""" + try: + if not self.use_mongodb or not self.mongo_api: + self.log('WARNING', 'MongoDB未配置或不可用,无法更新离线玩家作物', 'SERVER') + return + + # 获取当前在线玩家列表 + online_players = [] + for client_id, user_info in self.user_data.items(): + if user_info.get("logged_in", False) and user_info.get("username"): + online_players.append(user_info["username"]) + + # 直接调用优化后的批量更新方法,传入在线玩家列表进行排除 + updated_count = self.mongo_api.batch_update_offline_players_crops( + growth_multiplier=1.0, + exclude_online_players=online_players + ) + + if updated_count > 0: + self.log('INFO', f"成功更新了 {updated_count} 个离线玩家的作物生长", 'SERVER') + else: + self.log('DEBUG', "没有离线玩家的作物需要更新", 'SERVER') + + except Exception as e: + self.log('ERROR', f"更新离线玩家作物时出错: {str(e)}", 'SERVER') #=================================数据管理方法==================================== @@ -485,23 +526,23 @@ class TCPGameServer(TCPServer): if (farm_lot.get("crop_type") and farm_lot.get("is_planted") and not farm_lot.get("is_dead") and farm_lot["grow_time"] < farm_lot["max_grow_time"]): - # 计算生长速度倍数 - growth_multiplier = 1.0 + # 计算生长速度增量(累加方式) + growth_increase = 1 # 基础生长速度:每次更新增长1秒 - # 新玩家注册奖励:注册后3天内享受10倍生长速度 + # 新玩家注册奖励:注册后3天内额外增加9秒(总共10倍速度) if self._is_new_player_bonus_active(player_data): - growth_multiplier *= 10.0 + growth_increase += 9 - # 土地等级影响 - 根据不同等级应用不同倍数 + # 土地等级影响 - 根据不同等级额外增加生长速度 land_level = farm_lot.get("土地等级", 0) - land_speed_multipliers = { - 0: 1.0, # 默认土地:正常生长速度 - 1: 2.0, # 黄土地:2倍速 - 2: 4.0, # 红土地:4倍速 - 3: 6.0, # 紫土地:6倍速 - 4: 10.0 # 黑土地:10倍速 + land_speed_bonus = { + 0: 0, # 默认土地:无额外加成 + 1: 1, # 黄土地:额外+1秒(总共2倍速) + 2: 3, # 红土地:额外+3秒(总共4倍速) + 3: 5, # 紫土地:额外+5秒(总共6倍速) + 4: 9 # 黑土地:额外+9秒(总共10倍速) } - growth_multiplier *= land_speed_multipliers.get(land_level, 1.0) + growth_increase += land_speed_bonus.get(land_level, 0) # 施肥影响 - 支持不同类型的道具施肥 if farm_lot.get("已施肥", False) and "施肥时间" in farm_lot: @@ -511,11 +552,11 @@ class TCPGameServer(TCPServer): # 获取施肥类型和对应的持续时间、倍数 fertilize_type = farm_lot.get("施肥类型", "普通施肥") fertilize_duration = farm_lot.get("施肥持续时间", 600) # 默认10分钟 - fertilize_multiplier = farm_lot.get("施肥倍数", 2.0) # 默认2倍速 + fertilize_bonus = farm_lot.get("施肥加成", 1) # 默认额外+1秒 if current_time - fertilize_time <= fertilize_duration: - # 施肥效果仍在有效期内 - growth_multiplier *= fertilize_multiplier + # 施肥效果仍在有效期内,累加施肥加成 + growth_increase += fertilize_bonus else: # 施肥效果过期,清除施肥状态 farm_lot["已施肥"] = False @@ -527,9 +568,10 @@ class TCPGameServer(TCPServer): del farm_lot["施肥倍数"] if "施肥持续时间" in farm_lot: del farm_lot["施肥持续时间"] + if "施肥加成" in farm_lot: + del farm_lot["施肥加成"] - # 应用生长速度倍数 - growth_increase = int(growth_multiplier) + # 确保最小增长量为1 if growth_increase < 1: growth_increase = 1 @@ -725,6 +767,8 @@ class TCPGameServer(TCPServer): return self._handle_save_game_settings(client_id, message) elif message_type == "pet_battle_result":#宠物对战结果 return self._handle_pet_battle_result(client_id, message) + elif message_type == "today_divination":#今日占卜 + return self._handle_today_divination(client_id, message) #--------------------------------------------------------------------------- elif message_type == "message":#处理聊天消息(暂未实现) @@ -1395,7 +1439,7 @@ class TCPGameServer(TCPServer): # 添加成熟物到作物仓库(如果允许) if will_get_mature_item: - self._add_crop_to_warehouse_optimized(player_data, {"name": crop_type, "count": harvest_count}, mature_item_name, crop_info.get("品质", "普通")) + self._add_crop_to_warehouse_optimized(player_data, {"name": crop_type, "count": harvest_count}, crop_type, crop_info.get("品质", "普通")) # 添加种子奖励到背包 if seed_reward: @@ -1406,7 +1450,7 @@ class TCPGameServer(TCPServer): if player_data["经验值"] >= level_up_experience: player_data["等级"] += 1 player_data["经验值"] -= level_up_experience - self.log('INFO', f"玩家 {username} 升级到 {player_data['level']} 级", 'SERVER') + self.log('INFO', f"玩家 {username} 升级到 {player_data['等级']} 级", 'SERVER') # 清理地块(批量更新) lot.update({ @@ -1528,7 +1572,7 @@ class TCPGameServer(TCPServer): # 添加成熟物到作物仓库(如果允许) if will_get_mature_item: - self._add_crop_to_warehouse_optimized(current_player_data, {"name": crop_type, "count": harvest_count}, mature_item_name, crop_info.get("品质", "普通")) + self._add_crop_to_warehouse_optimized(current_player_data, {"name": crop_type, "count": harvest_count}, crop_type, crop_info.get("品质", "普通")) # 添加种子奖励到背包 if seed_reward: @@ -1539,7 +1583,7 @@ class TCPGameServer(TCPServer): if current_player_data["经验值"] >= level_up_experience: current_player_data["等级"] += 1 current_player_data["经验值"] -= level_up_experience - self.log('INFO', f"玩家 {current_username} 升级到 {current_player_data['level']} 级", 'SERVER') + self.log('INFO', f"玩家 {current_username} 升级到 {current_player_data['等级']} 级", 'SERVER') # 清理目标玩家的地块(批量更新) target_lot.update({ @@ -2361,6 +2405,10 @@ class TCPGameServer(TCPServer): "pet_owner": username }) + # 初始化当前生命值为最大生命值 + max_health = pet_instance.get("max_health", 100) + pet_instance["pet_current_health"] = max_health + return pet_instance #检查玩家是否已拥有某种宠物 @@ -2851,7 +2899,7 @@ class TCPGameServer(TCPServer): return self._send_action_error(client_id, "feed_pet", "作物名称不能为空") # 检查玩家是否有该作物 - crop_warehouse = player_data.get("crop_warehouse", []) + crop_warehouse = player_data.get("作物仓库", []) crop_found = False crop_index = -1 @@ -2916,7 +2964,7 @@ class TCPGameServer(TCPServer): "applied_effects": applied_effects, "updated_data": { "宠物背包": player_data["宠物背包"], - "crop_warehouse": player_data["crop_warehouse"] + "作物仓库": player_data["作物仓库"] } }) else: @@ -2927,7 +2975,7 @@ class TCPGameServer(TCPServer): """处理宠物喂食逻辑,支持多种属性提升""" try: # 消耗作物 - crop_warehouse = player_data.get("crop_warehouse", []) + crop_warehouse = player_data.get("作物仓库", []) if crop_index >= 0 and crop_index < len(crop_warehouse): crop_warehouse[crop_index]["count"] -= 1 # 如果数量为0,移除该作物 @@ -2967,31 +3015,34 @@ class TCPGameServer(TCPServer): # 升级时应用属性加成 self._apply_level_up_bonus(target_pet, level_ups) - # 处理生命值效果 + # 处理生命值效果(增加最大生命值) if "生命值" in feed_effects: - hp_gain = feed_effects["生命值"] - current_hp = target_pet.get("pet_current_health", 100) - max_hp = target_pet.get("pet_max_health", 100) + max_hp_gain = feed_effects["生命值"] + # 增加最大生命值 + current_max_hp = target_pet.get("max_health", 100) + new_max_hp = current_max_hp + max_hp_gain + target_pet["max_health"] = new_max_hp - actual_hp_gain = min(hp_gain, max_hp - current_hp) # 不能超过最大生命值 - if actual_hp_gain > 0: - target_pet["pet_current_health"] = current_hp + actual_hp_gain - applied_effects["生命值"] = actual_hp_gain + # 同时恢复相应的当前生命值 + current_hp = target_pet.get("pet_current_health", current_max_hp) + target_pet["pet_current_health"] = current_hp + max_hp_gain + + applied_effects["生命值"] = max_hp_gain # 处理攻击力效果 if "攻击力" in feed_effects: attack_gain = feed_effects["攻击力"] - current_attack = target_pet.get("pet_attack_damage", 20) + current_attack = target_pet.get("base_attack_damage", 20) new_attack = current_attack + attack_gain - target_pet["pet_attack_damage"] = new_attack + target_pet["base_attack_damage"] = new_attack applied_effects["攻击力"] = attack_gain # 处理移动速度效果 if "移动速度" in feed_effects: speed_gain = feed_effects["移动速度"] - current_speed = target_pet.get("pet_move_speed", 100) + current_speed = target_pet.get("move_speed", 100) new_speed = current_speed + speed_gain - target_pet["pet_move_speed"] = new_speed + target_pet["move_speed"] = new_speed applied_effects["移动速度"] = speed_gain # 处理亲密度效果 @@ -3008,30 +3059,41 @@ class TCPGameServer(TCPServer): # 处理护甲值效果 if "护甲值" in feed_effects: armor_gain = feed_effects["护甲值"] - current_armor = target_pet.get("pet_current_armor", 10) - max_armor = target_pet.get("pet_max_armor", 10) + current_armor = target_pet.get("current_armor", target_pet.get("max_armor", 10)) + max_armor = target_pet.get("max_armor", 10) actual_armor_gain = min(armor_gain, max_armor - current_armor) if actual_armor_gain > 0: - target_pet["pet_current_armor"] = current_armor + actual_armor_gain + target_pet["current_armor"] = current_armor + actual_armor_gain applied_effects["护甲值"] = actual_armor_gain # 处理暴击率效果 if "暴击率" in feed_effects: crit_gain = feed_effects["暴击率"] / 100.0 # 转换为小数 - current_crit = target_pet.get("pet_crit_rate", 0.1) + current_crit = target_pet.get("crit_rate", 0.1) new_crit = min(current_crit + crit_gain, 1.0) # 最大100% - target_pet["pet_crit_rate"] = new_crit + target_pet["crit_rate"] = new_crit applied_effects["暴击率"] = feed_effects["暴击率"] # 处理闪避率效果 if "闪避率" in feed_effects: dodge_gain = feed_effects["闪避率"] / 100.0 # 转换为小数 - current_dodge = movement_data.get("闪避率", 0.05) + current_dodge = target_pet.get("dodge_rate", 0.05) new_dodge = min(current_dodge + dodge_gain, 1.0) # 最大100% - movement_data["闪避率"] = new_dodge + target_pet["dodge_rate"] = new_dodge applied_effects["闪避率"] = feed_effects["闪避率"] + # 处理护盾值效果 + if "护盾值" in feed_effects: + shield_gain = feed_effects["护盾值"] + current_shield = target_pet.get("current_shield", target_pet.get("max_shield", 0)) + max_shield = target_pet.get("max_shield", 0) + + actual_shield_gain = min(shield_gain, max_shield - current_shield) + if actual_shield_gain > 0: + target_pet["current_shield"] = current_shield + actual_shield_gain + applied_effects["护盾值"] = actual_shield_gain + return True, applied_effects except Exception as e: @@ -3045,21 +3107,33 @@ class TCPGameServer(TCPServer): level_bonus_multiplier = 1.1 ** level_ups # 更新生命和防御属性 - old_max_hp = target_pet.get("pet_max_health", 100) - old_max_armor = target_pet.get("pet_max_armor", 10) + old_max_hp = target_pet.get("max_health", 100) + old_max_armor = target_pet.get("max_armor", 10) + old_max_shield = target_pet.get("max_shield", 0) - new_max_hp = old_max_hp * level_bonus_multiplier - new_max_armor = old_max_armor * level_bonus_multiplier + new_max_hp = int(old_max_hp * level_bonus_multiplier) + new_max_armor = int(old_max_armor * level_bonus_multiplier) + new_max_shield = int(old_max_shield * level_bonus_multiplier) - target_pet["pet_max_health"] = new_max_hp + target_pet["max_health"] = new_max_hp target_pet["pet_current_health"] = new_max_hp # 升级回满血 - target_pet["pet_max_armor"] = new_max_armor - target_pet["pet_current_armor"] = new_max_armor + target_pet["max_armor"] = new_max_armor + target_pet["current_armor"] = new_max_armor # 升级回满护甲 + + # 如果有护盾系统,也更新护盾 + if old_max_shield > 0: + target_pet["max_shield"] = new_max_shield + target_pet["current_shield"] = new_max_shield # 升级回满护盾 # 更新攻击属性 - old_attack = target_pet.get("pet_attack_damage", 20) - new_attack = old_attack * level_bonus_multiplier - target_pet["pet_attack_damage"] = new_attack + old_attack = target_pet.get("base_attack_damage", 20) + new_attack = int(old_attack * level_bonus_multiplier) + target_pet["base_attack_damage"] = new_attack + + # 更新移动速度 + old_speed = target_pet.get("move_speed", 100) + new_speed = int(old_speed * level_bonus_multiplier) + target_pet["move_speed"] = new_speed #==========================宠物喂食处理========================== @@ -4077,29 +4151,29 @@ class TCPGameServer(TCPServer): current_time = time.time() if item_name == "农家肥": - # 30分钟内2倍速生长 + # 30分钟内额外+1秒/次生长 lot["已施肥"] = True lot["施肥时间"] = current_time lot["施肥类型"] = "农家肥" - lot["施肥倍数"] = 2.0 + lot["施肥加成"] = 1 lot["施肥持续时间"] = 1800 # 30分钟 - message = f"使用 {item_name} 成功!作物将在30分钟内以2倍速度生长" + message = f"使用 {item_name} 成功!作物将在30分钟内获得额外生长加成" elif item_name == "金坷垃": - # 5分钟内5倍速生长 + # 5分钟内额外+4秒/次生长 lot["已施肥"] = True lot["施肥时间"] = current_time lot["施肥类型"] = "金坷垃" - lot["施肥倍数"] = 5.0 + lot["施肥加成"] = 4 lot["施肥持续时间"] = 300 # 5分钟 - message = f"使用 {item_name} 成功!作物将在5分钟内以5倍速度生长" + message = f"使用 {item_name} 成功!作物将在5分钟内获得强力生长加成" elif item_name == "生长素": - # 10分钟内3倍速生长 + # 10分钟内额外+2秒/次生长 lot["已施肥"] = True lot["施肥时间"] = current_time lot["施肥类型"] = "生长素" - lot["施肥倍数"] = 3.0 + lot["施肥加成"] = 2 lot["施肥持续时间"] = 600 # 10分钟 - message = f"使用 {item_name} 成功!作物将在10分钟内以3倍速度生长" + message = f"使用 {item_name} 成功!作物将在10分钟内获得中等生长加成" else: return self._send_action_error(client_id, "use_item", f"不支持的施肥道具: {item_name}") @@ -4211,29 +4285,29 @@ class TCPGameServer(TCPServer): current_time = time.time() if item_name == "农家肥": - # 30分钟内2倍速生长 + # 30分钟内额外+1秒/次生长 target_lot["已施肥"] = True target_lot["施肥时间"] = current_time target_lot["施肥类型"] = "农家肥" - target_lot["施肥倍数"] = 2.0 + target_lot["施肥加成"] = 1 target_lot["施肥持续时间"] = 1800 # 30分钟 - message = f"帮助施肥成功!{target_username} 的作物将在30分钟内以2倍速度生长" + message = f"帮助施肥成功!{target_username} 的作物将在30分钟内获得额外生长加成" elif item_name == "金坷垃": - # 5分钟内5倍速生长 + # 5分钟内额外+4秒/次生长 target_lot["已施肥"] = True target_lot["施肥时间"] = current_time target_lot["施肥类型"] = "金坷垃" - target_lot["施肥倍数"] = 5.0 + target_lot["施肥加成"] = 4 target_lot["施肥持续时间"] = 300 # 5分钟 - message = f"帮助施肥成功!{target_username} 的作物将在5分钟内以5倍速度生长" + message = f"帮助施肥成功!{target_username} 的作物将在5分钟内获得强力生长加成" elif item_name == "生长素": - # 10分钟内3倍速生长 + # 10分钟内额外+2秒/次生长 target_lot["已施肥"] = True target_lot["施肥时间"] = current_time target_lot["施肥类型"] = "生长素" - target_lot["施肥倍数"] = 3.0 + target_lot["施肥加成"] = 2 target_lot["施肥持续时间"] = 600 # 10分钟 - message = f"帮助施肥成功!{target_username} 的作物将在10分钟内以3倍速度生长" + message = f"帮助施肥成功!{target_username} 的作物将在10分钟内获得中等生长加成" else: return self._send_action_error(client_id, "use_item", f"不支持的施肥道具: {item_name}") @@ -4915,29 +4989,37 @@ class TCPGameServer(TCPServer): try: # 根据道具类型应用不同的效果 if item_name == "不死图腾": - # 启用死亡免疫机制 - pet_data["特殊机制开关"]["启用死亡免疫机制"] = True - pet_data["特殊属性"]["死亡免疫"] = True - return True, f"宠物 {pet_data['pet_name']} 获得了死亡免疫能力!", pet_data + # 启用死亡重生技能 + if "enable_death_respawn_skill" not in pet_data: + pet_data["enable_death_respawn_skill"] = True + else: + pet_data["enable_death_respawn_skill"] = True + if "respawn_health_percentage" not in pet_data: + pet_data["respawn_health_percentage"] = 0.5 # 重生时50%血量 + return True, f"宠物 {pet_data['pet_name']} 获得了死亡重生能力!", pet_data elif item_name == "荆棘护甲": - # 启用伤害反弹机制 - pet_data["特殊机制开关"]["启用伤害反弹机制"] = True - pet_data["特殊属性"]["伤害反弹"] = 0.3 # 反弹30%伤害 + # 启用反伤机制 + if "enable_damage_reflection_skill" not in pet_data: + pet_data["enable_damage_reflection_skill"] = True + else: + pet_data["enable_damage_reflection_skill"] = True return True, f"宠物 {pet_data['pet_name']} 获得了荆棘护甲!", pet_data elif item_name == "狂暴药水": - # 启用狂暴模式机制 - pet_data["特殊机制开关"]["启用狂暴模式机制"] = True - pet_data["特殊属性"]["狂暴阈值"] = 0.3 # 血量低于30%时触发 - pet_data["特殊属性"]["狂暴状态伤害倍数"] = 2.0 # 狂暴时伤害翻倍 + # 启用狂暴技能 + if "enable_berserker_skill" not in pet_data: + pet_data["enable_berserker_skill"] = True + else: + pet_data["enable_berserker_skill"] = True return True, f"宠物 {pet_data['pet_name']} 获得了狂暴能力!", pet_data elif item_name == "援军令牌": - # 启用援助召唤机制 - pet_data["特殊机制开关"]["启用援助召唤机制"] = True - pet_data["援助系统"]["援助触发阈值"] = 0.2 # 血量低于20%时触发 - pet_data["援助系统"]["援助召唤数量"] = 3 # 召唤3个援军 + # 启用召唤宠物技能 + if "enable_summon_pet_skill" not in pet_data: + pet_data["enable_summon_pet_skill"] = True + else: + pet_data["enable_summon_pet_skill"] = True return True, f"宠物 {pet_data['pet_name']} 获得了援军召唤能力!", pet_data elif item_name in ["金刚图腾", "灵木图腾", "潮汐图腾", "烈焰图腾", "敦岩图腾"]: @@ -4961,17 +5043,20 @@ class TCPGameServer(TCPServer): new_element = element_map[item_name] element_name = element_name_map[item_name] - pet_data["元素属性"]["元素类型"] = new_element - pet_data["元素属性"]["元素克制额外伤害"] = 100.0 # 元素克制时额外伤害 + # 根据实际宠物数据结构更新元素类型 + pet_data["element_type"] = new_element + # 如果没有元素伤害加成字段,则添加 + if "element_damage_bonus" not in pet_data: + pet_data["element_damage_bonus"] = 100.0 return True, f"宠物 {pet_data['pet_name']} 的元素属性已改变为{element_name}元素!", pet_data else: - return False, f"未知的宠物道具: {item_name}" + return False, f"未知的宠物道具: {item_name}", None except Exception as e: self.log('ERROR', f"处理宠物道具效果失败: {str(e)}", 'PET_ITEM') - return False, "道具效果处理失败" + return False, "道具效果处理失败", None #==========================宠物使用道具处理========================== @@ -7957,8 +8042,6 @@ class TCPGameServer(TCPServer): #==========================幸运抽奖处理========================== - - #==========================发送游戏操作错误处理========================== #发送游戏操作错误 def _send_action_error(self, client_id, action_type, message): @@ -8152,7 +8235,6 @@ class TCPGameServer(TCPServer): # ================================账户设置处理方法================================ - #==========================稻草人系统处理========================== def _handle_buy_scare_crow(self, client_id, message): """处理购买稻草人请求""" @@ -8393,8 +8475,6 @@ class TCPGameServer(TCPServer): #==========================稻草人系统处理========================== - - #==========================智慧树系统处理========================== def _handle_wisdom_tree_operation(self, client_id, message): """处理智慧树操作请求""" @@ -9558,6 +9638,182 @@ class TCPGameServer(TCPServer): #==========================小卖部管理处理========================== +#==========================今日占卜处理========================== + def _handle_today_divination(self, client_id, message): + """处理今日占卜请求""" + # 检查用户是否已登录 + logged_in, response = self._check_user_logged_in(client_id, "今日占卜", "today_divination") + if not logged_in: + return self.send_data(client_id, response) + + # 获取玩家数据 + player_data, username, response = self._load_player_data_with_check(client_id, "today_divination") + if not player_data: + return self.send_data(client_id, response) + + # 获取今日日期 + today = datetime.datetime.now().strftime("%Y-%m-%d") + + # 检查今日占卜对象是否存在 + if "今日占卜对象" not in player_data: + player_data["今日占卜对象"] = {} + + divination_data = player_data["今日占卜对象"] + + # 检查今日是否已经占卜过 + if "占卜日期" in divination_data and divination_data["占卜日期"] == today: + return self.send_data(client_id, { + "type": "today_divination_response", + "success": False, + "message": "今日已经占卜过了,明天再来吧!", + "divination_data": player_data + }) + + # 生成占卜结果 + divination_result = self._generate_divination_result() + + # 更新玩家占卜数据 + divination_data["占卜日期"] = today + divination_data["占卜结果"] = divination_result["result"] + divination_data["占卜等级"] = divination_result["level"] + divination_data["卦象"] = divination_result["hexagram"] + divination_data["建议"] = divination_result["advice"] + + # 保存玩家数据 + self.save_player_data(username, player_data) + + self.log('INFO', f"玩家 {username} 进行今日占卜,等级:{divination_result['level']}", 'SERVER') + + return self.send_data(client_id, { + "type": "today_divination_response", + "success": True, + "message": "占卜完成!", + "divination_data": player_data + }) + + def _generate_divination_result(self): + """生成占卜结果""" + import random + + # 占卜等级配置(权重越高,出现概率越大) + levels = [ + {"name": "大吉", "weight": 5, "color": "#FFD700"}, + {"name": "中吉", "weight": 15, "color": "#FFA500"}, + {"name": "小吉", "weight": 25, "color": "#90EE90"}, + {"name": "平", "weight": 30, "color": "#87CEEB"}, + {"name": "小凶", "weight": 20, "color": "#DDA0DD"}, + {"name": "凶", "weight": 5, "color": "#FF6347"} + ] + + # 易经八卦 + hexagrams = [ + {"name": "乾卦", "symbol": "☰", "meaning": "天行健,君子以自强不息"}, + {"name": "坤卦", "symbol": "☷", "meaning": "地势坤,君子以厚德载物"}, + {"name": "震卦", "symbol": "☳", "meaning": "雷声隆隆,万物复苏"}, + {"name": "巽卦", "symbol": "☴", "meaning": "风行天下,顺势而为"}, + {"name": "坎卦", "symbol": "☵", "meaning": "水流不息,智慧如泉"}, + {"name": "离卦", "symbol": "☲", "meaning": "火光明亮,照耀前程"}, + {"name": "艮卦", "symbol": "☶", "meaning": "山高水长,稳如磐石"}, + {"name": "兑卦", "symbol": "☱", "meaning": "泽润万物,和谐共生"} + ] + + # 占卜结果文案 + results = { + "大吉": [ + "今日运势如虹,万事皆宜,财运亨通,贵人相助!", + "紫气东来,福星高照,今日必有喜事临门!", + "天时地利人和,今日是您大展宏图的好日子!" + ], + "中吉": [ + "今日运势不错,做事顺利,宜把握机会!", + "春风得意,今日适合开展新计划!", + "运势上升,今日努力必有收获!" + ], + "小吉": [ + "今日运势平稳向好,小有收获!", + "和风细雨,今日宜静心修身!", + "运势渐佳,今日适合稳步前进!" + ], + "平": [ + "今日运势平稳,宜守不宜攻!", + "平平淡淡才是真,今日适合休养生息!", + "运势平和,今日宜保持现状!" + ], + "小凶": [ + "今日运势略有波折,宜谨慎行事!", + "小心驶得万年船,今日宜低调处事!", + "运势稍逊,今日宜多思而后行!" + ], + "凶": [ + "今日运势欠佳,宜静待时机!", + "山雨欲来风满楼,今日宜避其锋芒!", + "运势低迷,今日宜韬光养晦!" + ] + } + + # 建议文案 + advice_list = { + "大吉": [ + "今日宜:投资理财、开展新业务、拜访贵人", + "今日宜:签订合同、举办庆典、求婚表白", + "今日宜:出行旅游、购买重要物品、做重大决定" + ], + "中吉": [ + "今日宜:学习进修、拓展人脉、适度投资", + "今日宜:整理规划、健身运动、与朋友聚会", + "今日宜:处理积压事务、改善居住环境" + ], + "小吉": [ + "今日宜:读书思考、轻松娱乐、关爱家人", + "今日宜:整理物品、制定计划、适度休息", + "今日宜:培养兴趣、与人为善、保持乐观" + ], + "平": [ + "今日宜:维持现状、按部就班、稳中求进", + "今日宜:反思总结、调整心态、积蓄力量", + "今日宜:关注健康、陪伴家人、平和处事" + ], + "小凶": [ + "今日忌:冲动决定、大额消费、与人争执", + "今日忌:签重要合同、做重大变动、外出远行", + "今日宜:谨言慎行、低调做人、耐心等待" + ], + "凶": [ + "今日忌:投资冒险、开展新项目、做重要决定", + "今日忌:与人冲突、外出办事、签署文件", + "今日宜:静心修养、反省自身、等待转机" + ] + } + + # 按权重随机选择等级 + total_weight = sum(level["weight"] for level in levels) + rand_num = random.randint(1, total_weight) + current_weight = 0 + + selected_level = None + for level in levels: + current_weight += level["weight"] + if rand_num <= current_weight: + selected_level = level + break + + # 随机选择卦象 + selected_hexagram = random.choice(hexagrams) + + # 随机选择对应等级的结果和建议 + level_name = selected_level["name"] + selected_result = random.choice(results[level_name]) + selected_advice = random.choice(advice_list[level_name]) + + return { + "level": level_name, + "level_color": selected_level["color"], + "result": selected_result, + "hexagram": f"{selected_hexagram['symbol']} {selected_hexagram['name']}", + "hexagram_meaning": selected_hexagram["meaning"], + "advice": selected_advice + } +#==========================今日占卜处理========================== def console_input_thread(server): diff --git a/Server/__pycache__/ConsoleCommandsAPI.cpython-313.pyc b/Server/__pycache__/ConsoleCommandsAPI.cpython-313.pyc index aa5adb2..769a2d4 100644 Binary files a/Server/__pycache__/ConsoleCommandsAPI.cpython-313.pyc and b/Server/__pycache__/ConsoleCommandsAPI.cpython-313.pyc differ diff --git a/Server/__pycache__/SMYMongoDBAPI.cpython-313.pyc b/Server/__pycache__/SMYMongoDBAPI.cpython-313.pyc index 7e0fa99..cca4660 100644 Binary files a/Server/__pycache__/SMYMongoDBAPI.cpython-313.pyc and b/Server/__pycache__/SMYMongoDBAPI.cpython-313.pyc differ diff --git a/Server/docker-compose.yml b/Server/docker-compose.yml index dc7a190..bce7f39 100644 --- a/Server/docker-compose.yml +++ b/Server/docker-compose.yml @@ -6,7 +6,7 @@ services: container_name: mengyafarm-server restart: unless-stopped ports: - - "6060:6060" + - "7070:7070" volumes: # 持久化游戏存档 - ./game_saves:/app/game_saves diff --git a/Server/test_initial_player_template_migration.py b/Server/test/test_initial_player_template_migration.py similarity index 100% rename from Server/test_initial_player_template_migration.py rename to Server/test/test_initial_player_template_migration.py diff --git a/Server/test_mongodb_migration.py b/Server/test/test_mongodb_migration.py similarity index 100% rename from Server/test_mongodb_migration.py rename to Server/test/test_mongodb_migration.py diff --git a/Server/test_optimized_config_api.py b/Server/test/test_optimized_config_api.py similarity index 100% rename from Server/test_optimized_config_api.py rename to Server/test/test_optimized_config_api.py diff --git a/Server/test_pet_data_migration.py b/Server/test/test_pet_data_migration.py similarity index 100% rename from Server/test_pet_data_migration.py rename to Server/test/test_pet_data_migration.py diff --git a/Server/test_player_data_mongodb_migration.py b/Server/test/test_player_data_mongodb_migration.py similarity index 100% rename from Server/test_player_data_mongodb_migration.py rename to Server/test/test_player_data_mongodb_migration.py diff --git a/Server/test_server_mongodb.py b/Server/test/test_server_mongodb.py similarity index 100% rename from Server/test_server_mongodb.py rename to Server/test/test_server_mongodb.py diff --git a/Server/test_server_pet_functions.py b/Server/test/test_server_pet_functions.py similarity index 100% rename from Server/test_server_pet_functions.py rename to Server/test/test_server_pet_functions.py diff --git a/Test/测试版玩家数据/作物数据.json b/Test/测试版玩家数据/作物数据.json new file mode 100644 index 0000000..666b1e7 --- /dev/null +++ b/Test/测试版玩家数据/作物数据.json @@ -0,0 +1,1083 @@ +{ + "_id": { + "$oid": "687cfb3d8e77ba00a7414bac" + }, + "测试作物": { + "作物名称": "0号作物", + "成熟物名称": "0号作物", + "花费": 1, + "生长时间": 5, + "收益": 10000, + "品质": "普通", + "描述": "仅供测试使用的特殊作物", + "耐候性": 10, + "等级": 1, + "经验": 999, + "能否购买": false + }, + "野草1": { + "作物名称": "野草1", + "成熟物名称": null, + "花费": 0, + "生长时间": 5, + "收益": -110, + "品质": "普通", + "描述": "野草", + "耐候性": 99, + "等级": 1, + "经验": 0, + "能否购买": true, + "是否杂草": true + }, + "野草2": { + "作物名称": "野草2", + "成熟物名称": null, + "花费": 0, + "生长时间": 5, + "收益": -200, + "品质": "普通", + "描述": "野草", + "耐候性": 99, + "等级": 1, + "经验": 0, + "能否购买": true, + "是否杂草": true + }, + "杂草1": { + "作物名称": "杂草1", + "成熟物名称": null, + "花费": 0, + "生长时间": 5, + "收益": -150, + "品质": "普通", + "描述": "杂草", + "耐候性": 99, + "等级": 1, + "经验": 0, + "能否购买": true, + "是否杂草": true + }, + "杂草2": { + "作物名称": "杂草2", + "成熟物名称": null, + "花费": 0, + "生长时间": 5, + "收益": -90, + "品质": "普通", + "描述": "野草", + "耐候性": 99, + "等级": 1, + "经验": 0, + "能否购买": true, + "是否杂草": true + }, + "小麦": { + "作物名称": "小麦", + "成熟物名称": "小麦", + "花费": 50, + "生长时间": 300, + "收益": 75, + "品质": "普通", + "描述": "最基础的粮食作物,生长快速,适合新手练习", + "耐候性": 8, + "等级": 1, + "经验": 8, + "能否购买": true + }, + "胡萝卜": { + "作物名称": "胡萝卜", + "成熟物名称": "胡萝卜", + "花费": 40, + "生长时间": 240, + "收益": 65, + "品质": "普通", + "描述": "营养丰富的根茎类蔬菜,容易种植", + "耐候性": 9, + "等级": 1, + "经验": 7, + "能否购买": true, + "喂养效果": { + "移动速度": 5, + "闪避率": 2 + } + }, + "土豆": { + "作物名称": "土豆", + "成熟物名称": "马铃薯", + "花费": 60, + "生长时间": 480, + "收益": 95, + "品质": "普通", + "描述": "耐寒的块茎作物,产量稳定", + "耐候性": 12, + "等级": 1, + "经验": 10, + "能否购买": true + }, + "稻谷": { + "作物名称": "稻谷", + "成熟物名称": "稻谷", + "花费": 70, + "生长时间": 600, + "收益": 110, + "品质": "普通", + "描述": "重要的主粮作物,需要充足水分", + "耐候性": 7, + "等级": 1, + "经验": 12, + "能否购买": true + }, + "大蒜": { + "作物名称": "大蒜", + "成熟物名称": "大蒜", + "花费": 50, + "生长时间": 550, + "收益": 100, + "品质": "普通", + "描述": "常用调味作物,具有抗菌功效,种植门槛低", + "耐候性": 10, + "等级": 1, + "经验": 8, + "能否购买": true + }, + "生菜": { + "作物名称": "生菜", + "成熟物名称": "生菜", + "花费": 45, + "生长时间": 650, + "收益": 120, + "品质": "普通", + "描述": "速生叶菜,适合沙拉生食,需保持土壤湿润", + "耐候性": 17, + "等级": 1, + "经验": 9, + "能否购买": true + }, + "石榴": { + "作物名称": "石榴", + "成熟物名称": "石榴", + "花费": 45, + "生长时间": 650, + "收益": 120, + "品质": "普通", + "描述": "速生叶菜,适合沙拉生食,需保持土壤湿润", + "耐候性": 17, + "等级": 1, + "经验": 9, + "能否购买": true + }, + "辣椒": { + "作物名称": "辣椒", + "成熟物名称": "辣椒", + "花费": 45, + "生长时间": 650, + "收益": 120, + "品质": "普通", + "描述": "速生叶菜,适合沙拉生食,需保持土壤湿润", + "耐候性": 17, + "等级": 1, + "经验": 9, + "能否购买": true + }, + "番茄": { + "作物名称": "番茄", + "成熟物名称": "番茄", + "花费": 90, + "生长时间": 720, + "收益": 140, + "品质": "普通", + "描述": "多汁的果实,市场需求大", + "耐候性": 8, + "等级": 2, + "经验": 16, + "能否购买": true + }, + "洋葱": { + "作物名称": "洋葱", + "成熟物名称": "洋葱", + "花费": 75, + "生长时间": 840, + "收益": 125, + "品质": "普通", + "描述": "调味蔬菜,储存时间长", + "耐候性": 11, + "等级": 2, + "经验": 14, + "能否购买": true + }, + "大豆": { + "作物名称": "大豆", + "成熟物名称": "大豆", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "普通", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "豌豆": { + "作物名称": "豌豆", + "成熟物名称": "豌豆", + "花费": 65, + "生长时间": 720, + "收益": 110, + "品质": "普通", + "描述": "嫩绿的豆荚蔬菜", + "耐候性": 10, + "等级": 2, + "经验": 15, + "能否购买": true + }, + "黄瓜": { + "作物名称": "黄瓜", + "成熟物名称": "黄瓜", + "花费": 85, + "生长时间": 1200, + "收益": 150, + "品质": "普通", + "描述": "清脆爽口的瓜类", + "耐候性": 8, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "大白菜": { + "作物名称": "大白菜", + "成熟物名称": "大白菜", + "花费": 70, + "生长时间": 900, + "收益": 120, + "品质": "普通", + "描述": "北方冬季的主要蔬菜", + "耐候性": 15, + "等级": 2, + "经验": 16, + "能否购买": true + }, + "葡萄": { + "作物名称": "葡萄", + "成熟物名称": "葡萄", + "花费": 200, + "生长时间": 2700, + "收益": 340, + "品质": "普通", + "描述": "用于酿酒的珍贵果实", + "耐候性": 9, + "等级": 4, + "经验": 35, + "能否购买": true + }, + "南瓜": { + "作物名称": "南瓜", + "成熟物名称": "南瓜", + "花费": 180, + "生长时间": 3600, + "收益": 320, + "品质": "普通", + "描述": "大型瓜果,节庆装饰的首选", + "耐候性": 12, + "等级": 4, + "经验": 38, + "能否购买": true + }, + "茄子": { + "作物名称": "茄子", + "成熟物名称": "茄子", + "花费": 190, + "生长时间": 2400, + "收益": 310, + "品质": "普通", + "描述": "紫色的营养蔬菜", + "耐候性": 10, + "等级": 4, + "经验": 32, + "能否购买": true + }, + "玉米": { + "作物名称": "玉米", + "成熟物名称": "玉米", + "花费": 80, + "生长时间": 900, + "收益": 130, + "品质": "优良", + "描述": "高产的谷物作物,营养价值高", + "耐候性": 10, + "等级": 2, + "经验": 15, + "能否购买": true + }, + "葫芦": { + "作物名称": "葫芦", + "成熟物名称": "葫芦", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "优良", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "柠檬": { + "作物名称": "柠檬树", + "成熟物名称": "柠檬", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "优良", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "枇杷": { + "作物名称": "枇杷树", + "成熟物名称": "枇杷", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "优良", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "山楂": { + "作物名称": "山楂树", + "成熟物名称": "山楂", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "优良", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "仙人掌": { + "作物名称": "仙人掌", + "成熟物名称": "仙人掌", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "优良", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "椰子": { + "作物名称": "椰子树", + "成熟物名称": "椰子", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "优良", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "西瓜": { + "作物名称": "西瓜", + "成熟物名称": "西瓜", + "花费": 250, + "生长时间": 4800, + "收益": 450, + "品质": "优良", + "描述": "夏日消暑的大型水果", + "耐候性": 6, + "等级": 5, + "经验": 50, + "能否购买": true + }, + "甘蔗": { + "作物名称": "甘蔗", + "成熟物名称": "甘蔗", + "花费": 280, + "生长时间": 5400, + "收益": 500, + "品质": "优良", + "描述": "制糖的重要原料", + "耐候性": 5, + "等级": 5, + "经验": 55, + "能否购买": true + }, + "甜菜": { + "作物名称": "甜菜", + "成熟物名称": "甜菜", + "花费": 240, + "生长时间": 4200, + "收益": 420, + "品质": "优良", + "描述": "制糖的另一种选择", + "耐候性": 11, + "等级": 5, + "经验": 45, + "能否购买": true + }, + "郁金香": { + "作物名称": "郁金香", + "成熟物名称": "郁金香", + "花费": 280, + "生长时间": 5100, + "收益": 510, + "品质": "优良", + "描述": "美丽的观赏植物", + "耐候性": 10, + "等级": 5, + "经验": 50, + "能否购买": true + }, + "花椰菜": { + "作物名称": "花椰菜", + "成熟物名称": "花椰菜", + "花费": 110, + "生长时间": 1320, + "收益": 185, + "品质": "优良", + "描述": "营养丰富的十字花科蔬菜", + "耐候性": 8, + "等级": 3, + "经验": 20, + "能否购买": true + }, + "柿子": { + "作物名称": "柿子树", + "成熟物名称": "柿子", + "花费": 140, + "生长时间": 1800, + "收益": 230, + "品质": "优良", + "描述": "秋季成熟的甜美果实", + "耐候性": 10, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "梨子": { + "作物名称": "梨树", + "成熟物名称": "梨子", + "花费": 210, + "生长时间": 2820, + "收益": 350, + "品质": "优良", + "描述": "春季开花的落叶果树", + "耐候性": 10, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "桃子": { + "作物名称": "桃树", + "成熟物名称": "桃子", + "花费": 220, + "生长时间": 2940, + "收益": 360, + "品质": "优良", + "描述": "粉色花海中的果实树种", + "耐候性": 9, + "等级": 3, + "经验": 25, + "能否购买": true, + "作物ID": "作物35", + "喂养效果": { + "经验": 10, + "生命值": 3, + "攻击力": 2, + "移动速度": 1, + "亲密度": 5 + } + }, + "荔枝": { + "作物名称": "荔枝树", + "成熟物名称": "荔枝", + "花费": 230, + "生长时间": 3060, + "收益": 380, + "品质": "优良", + "描述": "亚热带珍稀水果,果肉如凝脂", + "耐候性": 8, + "等级": 3, + "经验": 26, + "能否购买": true + }, + "树莓": { + "作物名称": "树莓", + "成熟物名称": "树莓", + "花费": 140, + "生长时间": 2700, + "收益": 240, + "品质": "优良", + "描述": "小巧精致的浆果", + "耐候性": 9, + "等级": 3, + "经验": 30, + "能否购买": true + }, + "鱼腥草": { + "作物名称": "鱼腥草", + "成熟物名称": "鱼腥草", + "花费": 300, + "生长时间": 7200, + "收益": 600, + "品质": "优良", + "描述": "具有特殊药用价值的野菜", + "耐候性": 18, + "等级": 6, + "经验": 90, + "能否购买": true + }, + "芦笋": { + "作物名称": "芦笋", + "成熟物名称": "芦笋", + "花费": 220, + "生长时间": 3000, + "收益": 370, + "品质": "优良", + "描述": "高档蔬菜,营养价值极高", + "耐候性": 8, + "等级": 4, + "经验": 40, + "能否购买": true + }, + "苹果": { + "作物名称": "苹果树", + "成熟物名称": "苹果", + "花费": 450, + "生长时间": 9600, + "收益": 820, + "品质": "优良", + "描述": "结果丰富的果树", + "耐候性": 14, + "等级": 7, + "经验": 110, + "能否购买": true, + "喂养效果": { + "生命值": 5, + "护甲值": 2 + } + }, + "橘子": { + "作物名称": "橘子树", + "成熟物名称": "橘子", + "花费": 480, + "生长时间": 10200, + "收益": 850, + "品质": "优良", + "描述": "维生素C丰富的果树", + "耐候性": 12, + "等级": 7, + "经验": 115, + "能否购买": true + }, + "香蕉": { + "作物名称": "香蕉树", + "成熟物名称": "香蕉", + "花费": 420, + "生长时间": 8400, + "收益": 780, + "品质": "优良", + "描述": "热带水果之王", + "耐候性": 5, + "等级": 7, + "经验": 100, + "能否购买": true + }, + "牵牛花": { + "作物名称": "牵牛花", + "成熟物名称": "牵牛花", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "稀有", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "百合花": { + "作物名称": "百合花", + "成熟物名称": "百合花", + "花费": 260, + "生长时间": 4800, + "收益": 480, + "品质": "稀有", + "描述": "美丽的观赏植物", + "耐候性": 10, + "等级": 5, + "经验": 50, + "能否购买": true + }, + "山葵": { + "作物名称": "山葵", + "成熟物名称": "山葵", + "花费": 500, + "生长时间": 10800, + "收益": 1000, + "品质": "稀有", + "描述": "日式料理的珍贵调料", + "耐候性": 22, + "等级": 7, + "经验": 150, + "能否购买": true + }, + "草莓": { + "作物名称": "草莓", + "成熟物名称": "草莓", + "花费": 120, + "生长时间": 1440, + "收益": 200, + "品质": "稀有", + "描述": "甜美的浆果,深受喜爱", + "耐候性": 6, + "等级": 3, + "经验": 22, + "能否购买": true, + "喂养效果": { + "经验": 8, + "暴击率": 3, + "亲密度": 10 + } + }, + "蓝莓": { + "作物名称": "蓝莓", + "成熟物名称": "蓝莓", + "花费": 160, + "生长时间": 2100, + "收益": 260, + "品质": "稀有", + "描述": "抗氧化的超级食物", + "耐候性": 7, + "等级": 3, + "经验": 28, + "能否购买": true + }, + "栀子花": { + "作物名称": "栀子花", + "成熟物名称": "栀子花", + "花费": 180, + "生长时间": 2400, + "收益": 300, + "品质": "稀有", + "描述": "美丽的观赏植物", + "耐候性": 10, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "玫瑰花": { + "作物名称": "玫瑰花", + "成熟物名称": "玫瑰花", + "花费": 190, + "生长时间": 2520, + "收益": 310, + "品质": "稀有", + "描述": "美丽的观赏植物", + "耐候性": 10, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "菠萝": { + "作物名称": "菠萝", + "成熟物名称": "菠萝", + "花费": 200, + "生长时间": 2700, + "收益": 340, + "品质": "稀有", + "描述": "热带水果之王", + "耐候性": 10, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "芒果": { + "作物名称": "芒果树", + "成熟物名称": "芒果", + "花费": 240, + "生长时间": 3180, + "收益": 400, + "品质": "稀有", + "描述": "热带阳光孕育的香甜果实", + "耐候性": 10, + "等级": 3, + "经验": 27, + "能否购买": true + }, + "咖啡豆": { + "作物名称": "咖啡豆", + "成熟物名称": "咖啡豆", + "花费": 200, + "生长时间": 2500, + "收益": 340, + "品质": "稀有", + "描述": "热带经济作物,果实经烘焙后可制成饮品,需温暖气候", + "耐候性": 8, + "等级": 4, + "经验": 35, + "能否购买": true + }, + "可可豆": { + "作物名称": "可可树", + "成熟物名称": "可可果", + "花费": 200, + "生长时间": 2500, + "收益": 340, + "品质": "稀有", + "描述": "制作巧克力的原料,需高温高湿环境,经济价值较高", + "耐候性": 10, + "等级": 4, + "经验": 36, + "能否购买": true + }, + "向日葵": { + "作物名称": "向日葵", + "成熟物名称": "向日葵", + "花费": 160, + "生长时间": 3600, + "收益": 280, + "品质": "稀有", + "描述": "向阳而生的美丽花朵", + "耐候性": 13, + "等级": 4, + "经验": 35, + "能否购买": true + }, + "哈密瓜": { + "作物名称": "哈密瓜", + "成熟物名称": "哈密瓜", + "花费": 380, + "生长时间": 7800, + "收益": 700, + "品质": "稀有", + "描述": "甘甜的高级水果", + "耐候性": 8, + "等级": 6, + "经验": 85, + "能否购买": true + }, + "藏红花": { + "作物名称": "藏红花", + "成熟物名称": "藏红花", + "花费": 400, + "生长时间": 7000, + "收益": 710, + "品质": "稀有", + "描述": "世界上最昂贵的香料之一,需精心照料,花朵可提取柱头", + "耐候性": 9, + "等级": 6, + "经验": 80, + "能否购买": true + }, + "龙果": { + "作物名称": "火龙果", + "成熟物名称": "火龙果", + "花费": 800, + "生长时间": 14400, + "收益": 1500, + "品质": "稀有", + "描述": "传说中的神秘果实,蕴含强大能量", + "耐候性": 25, + "等级": 8, + "经验": 200, + "能否购买": true + }, + "杨桃": { + "作物名称": "杨桃", + "成熟物名称": "杨桃", + "花费": 85, + "生长时间": 1080, + "收益": 145, + "品质": "史诗", + "描述": "富含蛋白质的豆类作物", + "耐候性": 9, + "等级": 2, + "经验": 18, + "能否购买": true + }, + "香草": { + "作物名称": "香草", + "成熟物名称": "香草", + "花费": 300, + "生长时间": 6000, + "收益": 550, + "品质": "史诗", + "描述": "珍贵的调料植物", + "耐候性": 7, + "等级": 5, + "经验": 60, + "能否购买": true + }, + "康乃馨": { + "作物名称": "康乃馨", + "成熟物名称": "康乃馨", + "花费": 270, + "生长时间": 5100, + "收益": 510, + "品质": "史诗", + "描述": "美丽的观赏植物", + "耐候性": 10, + "等级": 5, + "经验": 50, + "能否购买": true + }, + "藏羚羊草": { + "作物名称": "藏羚羊草", + "成熟物名称": "藏羚羊草", + "花费": 80, + "生长时间": 200, + "收益": 200, + "品质": "史诗", + "描述": "高原珍稀草种,用于生态修复,对土壤要求苛刻但市场需求大", + "耐候性": 15, + "等级": 5, + "经验": 20, + "能否购买": true + }, + "迷迭香": { + "作物名称": "迷迭香", + "成熟物名称": "迷迭香", + "花费": 100, + "生长时间": 1680, + "收益": 210, + "品质": "史诗", + "描述": "芳香型草本植物,可用于烹饪和精油提取,耐旱易存活", + "耐候性": 12, + "等级": 3, + "经验": 22, + "能否购买": true + }, + "蕨菜": { + "作物名称": "蕨菜", + "成熟物名称": "蕨菜", + "花费": 180, + "生长时间": 2400, + "收益": 300, + "品质": "史诗", + "描述": "野生山菜,口感独特", + "耐候性": 16, + "等级": 4, + "经验": 35, + "能否购买": true + }, + "人参": { + "作物名称": "人参", + "成熟物名称": "人参", + "花费": 400, + "生长时间": 7200, + "收益": 720, + "品质": "史诗", + "描述": "珍贵的药用植物,需要耐心培养", + "耐候性": 15, + "等级": 6, + "经验": 80, + "能否购买": true + }, + "富贵竹": { + "作物名称": "富贵竹", + "成熟物名称": "富贵竹", + "花费": 350, + "生长时间": 6600, + "收益": 650, + "品质": "史诗", + "描述": "寓意吉祥的观赏植物", + "耐候性": 12, + "等级": 6, + "经验": 75, + "能否购买": true + }, + "芦荟": { + "作物名称": "芦荟", + "成熟物名称": "芦荟", + "花费": 320, + "生长时间": 6000, + "收益": 600, + "品质": "史诗", + "描述": "具有药用价值的多肉植物", + "耐候性": 18, + "等级": 6, + "经验": 70, + "能否购买": true + }, + "金橘": { + "作物名称": "金橘子树", + "成熟物名称": "金橘", + "花费": 500, + "生长时间": 10800, + "收益": 900, + "品质": "史诗", + "描述": "金黄色的珍贵柑橘", + "耐候性": 10, + "等级": 7, + "经验": 120, + "能否购买": true + }, + "松露": { + "作物名称": "松露", + "成熟物名称": "松露", + "花费": 1000, + "生长时间": 18000, + "收益": 2000, + "品质": "史诗", + "描述": "地下的黑金,顶级料理的灵魂", + "耐候性": 20, + "等级": 8, + "经验": 250, + "能否购买": true + }, + "冬虫夏草": { + "作物名称": "冬虫夏草", + "成熟物名称": "冬虫夏草", + "花费": 600, + "生长时间": 12000, + "收益": 1200, + "品质": "史诗", + "描述": "稀世珍宝,药王之称", + "耐候性": 30, + "等级": 7, + "经验": 180, + "能否购买": true + }, + "糖果树": { + "作物名称": "糖果树", + "成熟物名称": null, + "花费": 250, + "生长时间": 3300, + "收益": 420, + "品质": "传奇", + "描述": "传说中结出彩色糖果的魔法树", + "耐候性": 7, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "面包树": { + "作物名称": "面包树", + "成熟物名称": null, + "花费": 260, + "生长时间": 3420, + "收益": 440, + "品质": "传奇", + "描述": "热带地区的淀粉质主食树种", + "耐候性": 9, + "等级": 3, + "经验": 25, + "能否购买": true + }, + "幸运草": { + "作物名称": "幸运草", + "成熟物名称": null, + "花费": 150, + "生长时间": 1560, + "收益": 220, + "品质": "传奇", + "描述": "四片叶子的幸运象征植物", + "耐候性": 6, + "等级": 3, + "经验": 20, + "能否购买": true + }, + "幸运花": { + "作物名称": "幸运花", + "成熟物名称": null, + "花费": 170, + "生长时间": 1680, + "收益": 240, + "品质": "传奇", + "描述": "绽放时带来好运的神秘花卉", + "耐候性": 7, + "等级": 3, + "经验": 22, + "能否购买": true + }, + "摇钱树": { + "作物名称": "摇钱树", + "成熟物名称": null, + "花费": 300, + "生长时间": 3600, + "收益": 500, + "品质": "传奇", + "描述": "传说中能结出金币的神树", + "耐候性": 10, + "等级": 3, + "经验": 30, + "能否购买": true + }, + "月光草": { + "作物名称": "月光草", + "成熟物名称": "月光草", + "花费": 700, + "生长时间": 14500, + "收益": 1500, + "品质": "传奇", + "描述": "夜间开花的神秘植物,花瓣在月光下散发荧光,传说具有许愿功效", + "耐候性": 20, + "等级": 8, + "经验": 200, + "能否购买": true + }, + "星芒草": { + "作物名称": "星芒草", + "成熟物名称": "星芒草", + "花费": 700, + "生长时间": 14500, + "收益": 1500, + "品质": "传奇", + "描述": "夜间开花的神秘植物,花瓣在月光下照耀下闪烁星光,传说具有许愿功效", + "耐候性": 20, + "等级": 8, + "经验": 200, + "能否购买": true + }, + "凤凰木": { + "作物名称": "凤凰树", + "成熟物名称": "凤凰木", + "花费": 650, + "生长时间": 12600, + "收益": 1400, + "品质": "传奇", + "描述": "传说中凤凰栖息的神树,开花时如火焰般绚烂,木材可驱邪避灾", + "耐候性": 25, + "等级": 8, + "经验": 210, + "能否购买": true + }, + "杂交树1": { + "作物名称": "0号杂交树", + "成熟物名称": null, + "花费": 1200, + "生长时间": 21600, + "收益": 2500, + "品质": "传奇", + "描述": "初中生物书最后的幻想", + "耐候性": 35, + "等级": 9, + "经验": 300, + "能否购买": true + }, + "杂交树2": { + "作物名称": "1号杂交树", + "成熟物名称": null, + "花费": 1500, + "生长时间": 25200, + "收益": 3000, + "品质": "传奇", + "描述": "初中生物书最后的想象", + "耐候性": 40, + "等级": 10, + "经验": 400, + "能否购买": true + } +} \ No newline at end of file diff --git a/Test/测试版玩家数据/旧版玩家部分数据.txt b/Test/测试版玩家数据/旧版玩家部分数据.txt new file mode 100644 index 0000000..85978ee --- /dev/null +++ b/Test/测试版玩家数据/旧版玩家部分数据.txt @@ -0,0 +1,91 @@ + + "farm_name": "虚空农场", + "user_name": "2221023030", + "player_name": "虚空领主", + "user_password": "wangpeng666", + "last_login_time": "2025年06月09日12时38分55秒", + "total_login_time": "0时45分49秒", + + "farm_name": "天帝阁", + "user_name": "2253536500", + "player_name": "小朋友不哭", + "user_password": "a1567923", + "last_login_time": "2025年06月10日09时10分35秒", + "total_login_time": "1时4分20秒", + + "farm_name": "神经病院", + "user_name": "2427948832", + "player_name": "唐大伟", + "user_password": "mylc205823", + "last_login_time": "2025年06月29日23时35分03秒", + "total_login_time": "5时45分12秒", + + "farm_name": "嘻嘻", + "user_name": "2634726358", + "player_name": "哈哈", + "user_password": "wxt20050712", + "last_login_time": "2025年05月25日19时22分59秒", + "total_login_time": "0时8分43秒", + + "farm_name": "杨亮的家", + "user_name": "2671387804", + "player_name": "杨亮的主人", + "user_password": "woshiyangliang", + "last_login_time": "2025年05月25日21时45分45秒", + "total_login_time": "0时16分13秒", + + "farm_name": "丿Dream丨天辰", + "user_name": "2809548669", + "player_name": "丿Dream丨天辰", + "user_password": "asd123456", + "last_login_time": "2025年05月25日22时06分21秒", + "total_login_time": "0时0分15秒", + + "farm_name": "llsjjz的农村", + "user_name": "2968204579", + "player_name": "llsjjz", + "user_password": "llsjjz0920", + "last_login_time": "2025年06月13日18时57分26秒", + "total_login_time": "0时6分57秒", + + "farm_name": "niuma", + "user_name": "2973419538", + "player_name": "niuma", + "user_password": "247896", + "last_login_time": "2025年06月19日09时27分49秒", + "total_login_time": "3时35分6秒", + + "farm_name": "星露谷物语", + "user_name": "3275498742", + "player_name": "黎贤泽", + "user_password": "327549", + "last_login_time": "2025年06月13日12时45分01秒", + "total_login_time": "0时7分34秒", + + "farm_name": "困困的鼠鼠", + "user_name": "3346964708", + "player_name": "OVO", + "user_password": "123456", + "last_login_time": "2025年06月29日22时48分26秒", + "total_login_time": "0时8分48秒", + + "farm_name": "帅气大蟑螂", + "user_name": "3491961863", + "player_name": "帅气大蟑螂", + "user_password": "yyf198763", + "last_login_time": "2025年06月09日07时07分11秒", + "total_login_time": "0时3分43秒", + + "farm_name": "yuqi的农场", + "user_name": "3961448694", + "player_name": "yuqi", + "user_password": "x123456", + "last_login_time": "2025年06月28日20时54分03秒", + "total_login_time": "0时35分48秒", + + "farm_name": "joker xue", + "user_name": "839151204", + "player_name": "上上谦", + "user_password": "Asxx4522", + "last_login_time": "2025年06月08日22时26分51秒", + "total_login_time": "0时8分30秒", \ No newline at end of file diff --git a/assets/作物/人参/未成熟.webp b/assets/作物/人参/未成熟.webp new file mode 100644 index 0000000..ba663d0 Binary files /dev/null and b/assets/作物/人参/未成熟.webp differ diff --git a/assets/作物/橘子树/成熟.webp.import b/assets/作物/人参/未成熟.webp.import similarity index 67% rename from assets/作物/橘子树/成熟.webp.import rename to assets/作物/人参/未成熟.webp.import index a5748ba..dcc973e 100644 --- a/assets/作物/橘子树/成熟.webp.import +++ b/assets/作物/人参/未成熟.webp.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dese6wd86t4vx" -path="res://.godot/imported/成熟.webp-64820609d8d40542704157c6b55feacd.ctex" +uid="uid://dht24dq7ev7ab" +path="res://.godot/imported/未成熟.webp-b1885ac36df3c3b6bdbfc61c52fafbc0.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/作物/橘子树/成熟.webp" -dest_files=["res://.godot/imported/成熟.webp-64820609d8d40542704157c6b55feacd.ctex"] +source_file="res://assets/作物/人参/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-b1885ac36df3c3b6bdbfc61c52fafbc0.ctex"] [params] diff --git a/assets/作物/冬虫夏草/收获物.webp b/assets/作物/冬虫夏草/收获物.webp new file mode 100644 index 0000000..a3bd025 Binary files /dev/null and b/assets/作物/冬虫夏草/收获物.webp differ diff --git a/assets/作物/冬虫夏草/收获物.webp.import b/assets/作物/冬虫夏草/收获物.webp.import new file mode 100644 index 0000000..dabf579 --- /dev/null +++ b/assets/作物/冬虫夏草/收获物.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4gbtgtdgv1vc" +path="res://.godot/imported/收获物.webp-9a85da2e7eb1c3f518588a0b2d60c908.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/冬虫夏草/收获物.webp" +dest_files=["res://.godot/imported/收获物.webp-9a85da2e7eb1c3f518588a0b2d60c908.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/可可豆/幼苗.webp b/assets/作物/可可豆/幼苗.webp index d9a86bb..786f53b 100644 Binary files a/assets/作物/可可豆/幼苗.webp and b/assets/作物/可可豆/幼苗.webp differ diff --git a/assets/作物/可可豆/幼苗.webp.import b/assets/作物/可可豆/幼苗.webp.import index 89ebd73..cbd9799 100644 --- a/assets/作物/可可豆/幼苗.webp.import +++ b/assets/作物/可可豆/幼苗.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://m0k2go1722l3" +uid="uid://cms57cfucni4i" path="res://.godot/imported/幼苗.webp-afd9dee9030c742a3a58654be7b5150f.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/可可豆/未成熟.webp b/assets/作物/可可豆/未成熟.webp new file mode 100644 index 0000000..ace46d3 Binary files /dev/null and b/assets/作物/可可豆/未成熟.webp differ diff --git a/assets/作物/橘子树/未成熟.webp.import b/assets/作物/可可豆/未成熟.webp.import similarity index 67% rename from assets/作物/橘子树/未成熟.webp.import rename to assets/作物/可可豆/未成熟.webp.import index 1f540a3..b3cd739 100644 --- a/assets/作物/橘子树/未成熟.webp.import +++ b/assets/作物/可可豆/未成熟.webp.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://df5n5hmptoru0" -path="res://.godot/imported/未成熟.webp-30e5eb5c7932e3cfbb03bc7f5ce8af42.ctex" +uid="uid://c4ospsnkijgkq" +path="res://.godot/imported/未成熟.webp-8f4b6ebea1ffdd48512ab8ad92e8c327.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/作物/橘子树/未成熟.webp" -dest_files=["res://.godot/imported/未成熟.webp-30e5eb5c7932e3cfbb03bc7f5ce8af42.ctex"] +source_file="res://assets/作物/可可豆/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-8f4b6ebea1ffdd48512ab8ad92e8c327.ctex"] [params] diff --git a/assets/作物/大蒜/幼苗.webp b/assets/作物/大蒜/幼苗.webp index b02e84e..3dfb03f 100644 Binary files a/assets/作物/大蒜/幼苗.webp and b/assets/作物/大蒜/幼苗.webp differ diff --git a/assets/作物/大蒜/幼苗.webp.import b/assets/作物/大蒜/幼苗.webp.import index 88f149e..7d20416 100644 --- a/assets/作物/大蒜/幼苗.webp.import +++ b/assets/作物/大蒜/幼苗.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://8ncjpot0587o" +uid="uid://dfumn8aoa4ab1" path="res://.godot/imported/幼苗.webp-9ff6d4c1a71eb35de524cfcce9a4d803.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/大蒜/成熟.webp b/assets/作物/大蒜/成熟.webp index 3dfb03f..1defa3a 100644 Binary files a/assets/作物/大蒜/成熟.webp and b/assets/作物/大蒜/成熟.webp differ diff --git a/assets/作物/大蒜/成熟.webp.import b/assets/作物/大蒜/成熟.webp.import index 4932cba..8307f7e 100644 --- a/assets/作物/大蒜/成熟.webp.import +++ b/assets/作物/大蒜/成熟.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dfumn8aoa4ab1" +uid="uid://dowmwib74ut7c" path="res://.godot/imported/成熟.webp-2f446eb21f1d03acc83ecc3ebfa285b5.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/大蒜/未成熟.webp b/assets/作物/大蒜/未成熟.webp new file mode 100644 index 0000000..e2a1f0b Binary files /dev/null and b/assets/作物/大蒜/未成熟.webp differ diff --git a/assets/作物/橘子树/幼苗.webp.import b/assets/作物/大蒜/未成熟.webp.import similarity index 67% rename from assets/作物/橘子树/幼苗.webp.import rename to assets/作物/大蒜/未成熟.webp.import index 65cfb51..6a94d16 100644 --- a/assets/作物/橘子树/幼苗.webp.import +++ b/assets/作物/大蒜/未成熟.webp.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cqbd0y4k4mawt" -path="res://.godot/imported/幼苗.webp-42570383f70a2dae5db5d4b0e9eb44f8.ctex" +uid="uid://bru3mugrqcbky" +path="res://.godot/imported/未成熟.webp-5ae167b5e9243272aa403e0b44dd5172.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/作物/橘子树/幼苗.webp" -dest_files=["res://.godot/imported/幼苗.webp-42570383f70a2dae5db5d4b0e9eb44f8.ctex"] +source_file="res://assets/作物/大蒜/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-5ae167b5e9243272aa403e0b44dd5172.ctex"] [params] diff --git a/assets/作物/摇钱树/幼苗.webp b/assets/作物/摇钱树/幼苗.webp index fbb0034..4f7f4ea 100644 Binary files a/assets/作物/摇钱树/幼苗.webp and b/assets/作物/摇钱树/幼苗.webp differ diff --git a/assets/作物/摇钱树/幼苗.webp.import b/assets/作物/摇钱树/幼苗.webp.import index 3227eb5..a7a00bd 100644 --- a/assets/作物/摇钱树/幼苗.webp.import +++ b/assets/作物/摇钱树/幼苗.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://05kntwqxflx7" +uid="uid://bs63yk2al4558" path="res://.godot/imported/幼苗.webp-825ecd82ac4b5de4aaf87292169682c8.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/摇钱树/未成熟.webp b/assets/作物/摇钱树/未成熟.webp index 19d2952..3cf71f6 100644 Binary files a/assets/作物/摇钱树/未成熟.webp and b/assets/作物/摇钱树/未成熟.webp differ diff --git a/assets/作物/摇钱树/未成熟.webp.import b/assets/作物/摇钱树/未成熟.webp.import index 6f3964d..a7cafd5 100644 --- a/assets/作物/摇钱树/未成熟.webp.import +++ b/assets/作物/摇钱树/未成熟.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dlu4vexq17asb" +uid="uid://cx1fai5oeobv" path="res://.godot/imported/未成熟.webp-f233367294310d8b0d18f55580b3cf27.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/星芒草/1753694208204_nobg.webp b/assets/作物/星芒草/1753694208204_nobg.webp new file mode 100644 index 0000000..cec70ed Binary files /dev/null and b/assets/作物/星芒草/1753694208204_nobg.webp differ diff --git a/assets/作物/星芒草/1753694208204_nobg.webp.import b/assets/作物/星芒草/1753694208204_nobg.webp.import new file mode 100644 index 0000000..244581c --- /dev/null +++ b/assets/作物/星芒草/1753694208204_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://8hvd3tbeo15f" +path="res://.godot/imported/1753694208204_nobg.webp-362289e4bd9536f39238f968bd41b33b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/星芒草/1753694208204_nobg.webp" +dest_files=["res://.godot/imported/1753694208204_nobg.webp-362289e4bd9536f39238f968bd41b33b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/星芒草/收获物.webp b/assets/作物/星芒草/收获物.webp new file mode 100644 index 0000000..2515f08 Binary files /dev/null and b/assets/作物/星芒草/收获物.webp differ diff --git a/assets/作物/星芒草/收获物.webp.import b/assets/作物/星芒草/收获物.webp.import new file mode 100644 index 0000000..3753105 --- /dev/null +++ b/assets/作物/星芒草/收获物.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvwlspjfch6bx" +path="res://.godot/imported/收获物.webp-a424e720696d9de0ba2a1ba38ed5dfc1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/星芒草/收获物.webp" +dest_files=["res://.godot/imported/收获物.webp-a424e720696d9de0ba2a1ba38ed5dfc1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/星芒草/未成熟.webp b/assets/作物/星芒草/未成熟.webp new file mode 100644 index 0000000..fac0318 Binary files /dev/null and b/assets/作物/星芒草/未成熟.webp differ diff --git a/assets/作物/星芒草/未成熟.webp.import b/assets/作物/星芒草/未成熟.webp.import new file mode 100644 index 0000000..31d8e9c --- /dev/null +++ b/assets/作物/星芒草/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ci8orfb0oxebj" +path="res://.godot/imported/未成熟.webp-46e44f3cdf6c0c3622897df8e050f150.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/星芒草/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-46e44f3cdf6c0c3622897df8e050f150.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753692680268_nobg.webp b/assets/作物/杂交树1/1753692680268_nobg.webp new file mode 100644 index 0000000..583a9d5 Binary files /dev/null and b/assets/作物/杂交树1/1753692680268_nobg.webp differ diff --git a/assets/作物/杂交树1/1753692680268_nobg.webp.import b/assets/作物/杂交树1/1753692680268_nobg.webp.import new file mode 100644 index 0000000..9f22b98 --- /dev/null +++ b/assets/作物/杂交树1/1753692680268_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7taufeg82k22" +path="res://.godot/imported/1753692680268_nobg.webp-cfcd72d606e370d591871c9509e1ed3c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753692680268_nobg.webp" +dest_files=["res://.godot/imported/1753692680268_nobg.webp-cfcd72d606e370d591871c9509e1ed3c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753692859819_nobg.webp b/assets/作物/杂交树1/1753692859819_nobg.webp new file mode 100644 index 0000000..ddca70d Binary files /dev/null and b/assets/作物/杂交树1/1753692859819_nobg.webp differ diff --git a/assets/作物/杂交树1/1753692859819_nobg.webp.import b/assets/作物/杂交树1/1753692859819_nobg.webp.import new file mode 100644 index 0000000..3e07514 --- /dev/null +++ b/assets/作物/杂交树1/1753692859819_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dj6t4bfxb7ck3" +path="res://.godot/imported/1753692859819_nobg.webp-ce312e156dbfe30221732926e92de1bd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753692859819_nobg.webp" +dest_files=["res://.godot/imported/1753692859819_nobg.webp-ce312e156dbfe30221732926e92de1bd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753694206281_nobg.webp b/assets/作物/杂交树1/1753694206281_nobg.webp new file mode 100644 index 0000000..d5e11a3 Binary files /dev/null and b/assets/作物/杂交树1/1753694206281_nobg.webp differ diff --git a/assets/作物/杂交树1/1753694206281_nobg.webp.import b/assets/作物/杂交树1/1753694206281_nobg.webp.import new file mode 100644 index 0000000..ab981d4 --- /dev/null +++ b/assets/作物/杂交树1/1753694206281_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://by3ndtqjtx1uj" +path="res://.godot/imported/1753694206281_nobg.webp-c548b1928920940b8897a2f194525955.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753694206281_nobg.webp" +dest_files=["res://.godot/imported/1753694206281_nobg.webp-c548b1928920940b8897a2f194525955.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753697108067_nobg.webp b/assets/作物/杂交树1/1753697108067_nobg.webp new file mode 100644 index 0000000..b301e9f Binary files /dev/null and b/assets/作物/杂交树1/1753697108067_nobg.webp differ diff --git a/assets/作物/杂交树1/1753697108067_nobg.webp.import b/assets/作物/杂交树1/1753697108067_nobg.webp.import new file mode 100644 index 0000000..3ad3daa --- /dev/null +++ b/assets/作物/杂交树1/1753697108067_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bghfvr5svifdj" +path="res://.godot/imported/1753697108067_nobg.webp-8d74b70c1db0bff1e491bf59abe0037d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753697108067_nobg.webp" +dest_files=["res://.godot/imported/1753697108067_nobg.webp-8d74b70c1db0bff1e491bf59abe0037d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753697119760_nobg.webp b/assets/作物/杂交树1/1753697119760_nobg.webp new file mode 100644 index 0000000..4986481 Binary files /dev/null and b/assets/作物/杂交树1/1753697119760_nobg.webp differ diff --git a/assets/作物/杂交树1/1753697119760_nobg.webp.import b/assets/作物/杂交树1/1753697119760_nobg.webp.import new file mode 100644 index 0000000..7bec852 --- /dev/null +++ b/assets/作物/杂交树1/1753697119760_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2te6cquryuvm" +path="res://.godot/imported/1753697119760_nobg.webp-ca9785b7f425a8f850a49f3a2b801099.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753697119760_nobg.webp" +dest_files=["res://.godot/imported/1753697119760_nobg.webp-ca9785b7f425a8f850a49f3a2b801099.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753697233249_nobg.webp b/assets/作物/杂交树1/1753697233249_nobg.webp new file mode 100644 index 0000000..01db25c Binary files /dev/null and b/assets/作物/杂交树1/1753697233249_nobg.webp differ diff --git a/assets/作物/杂交树1/1753697233249_nobg.webp.import b/assets/作物/杂交树1/1753697233249_nobg.webp.import new file mode 100644 index 0000000..48b3a7a --- /dev/null +++ b/assets/作物/杂交树1/1753697233249_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://caww6aq7xo4ek" +path="res://.godot/imported/1753697233249_nobg.webp-65f96426367fa4d856c9f2f064c1305a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753697233249_nobg.webp" +dest_files=["res://.godot/imported/1753697233249_nobg.webp-65f96426367fa4d856c9f2f064c1305a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂交树1/1753697238281_nobg.webp b/assets/作物/杂交树1/1753697238281_nobg.webp new file mode 100644 index 0000000..250911c Binary files /dev/null and b/assets/作物/杂交树1/1753697238281_nobg.webp differ diff --git a/assets/作物/杂交树1/1753697238281_nobg.webp.import b/assets/作物/杂交树1/1753697238281_nobg.webp.import new file mode 100644 index 0000000..2cdfb52 --- /dev/null +++ b/assets/作物/杂交树1/1753697238281_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b81x3v5so0a4s" +path="res://.godot/imported/1753697238281_nobg.webp-024aed856bd82b2c279f192a5d8c119d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂交树1/1753697238281_nobg.webp" +dest_files=["res://.godot/imported/1753697238281_nobg.webp-024aed856bd82b2c279f192a5d8c119d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂草1/未成熟.webp b/assets/作物/杂草1/未成熟.webp new file mode 100644 index 0000000..7a34667 Binary files /dev/null and b/assets/作物/杂草1/未成熟.webp differ diff --git a/assets/作物/杂草1/未成熟.webp.import b/assets/作物/杂草1/未成熟.webp.import new file mode 100644 index 0000000..b2fe519 --- /dev/null +++ b/assets/作物/杂草1/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bxcsi31f1xc0j" +path="res://.godot/imported/未成熟.webp-83490a43fe5568c40c84e3ab64feda97.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂草1/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-83490a43fe5568c40c84e3ab64feda97.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/杂草2/未成熟.webp b/assets/作物/杂草2/未成熟.webp new file mode 100644 index 0000000..3f0ddb3 Binary files /dev/null and b/assets/作物/杂草2/未成熟.webp differ diff --git a/assets/作物/杂草2/未成熟.webp.import b/assets/作物/杂草2/未成熟.webp.import new file mode 100644 index 0000000..48793c0 --- /dev/null +++ b/assets/作物/杂草2/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://btnknnc8wmgd5" +path="res://.godot/imported/未成熟.webp-fe77362f76392127509d452985ba8ce4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/杂草2/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-fe77362f76392127509d452985ba8ce4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/栀子花/幼苗.webp b/assets/作物/栀子花/幼苗.webp index dd75180..21ea82c 100644 Binary files a/assets/作物/栀子花/幼苗.webp and b/assets/作物/栀子花/幼苗.webp differ diff --git a/assets/作物/栀子花/幼苗.webp.import b/assets/作物/栀子花/幼苗.webp.import index b2784f1..7f7266e 100644 --- a/assets/作物/栀子花/幼苗.webp.import +++ b/assets/作物/栀子花/幼苗.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://d3i5818qnp284" +uid="uid://btnl38jttm1g8" path="res://.godot/imported/幼苗.webp-0872e58be453659efbbbfa3a1a452185.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/栀子花/未成熟.webp b/assets/作物/栀子花/未成熟.webp index 6303f0a..5f7b6ae 100644 Binary files a/assets/作物/栀子花/未成熟.webp and b/assets/作物/栀子花/未成熟.webp differ diff --git a/assets/作物/栀子花/未成熟.webp.import b/assets/作物/栀子花/未成熟.webp.import index e67583a..67e0988 100644 --- a/assets/作物/栀子花/未成熟.webp.import +++ b/assets/作物/栀子花/未成熟.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bri7pc5rfss7x" +uid="uid://bn0e7sr11ivga" path="res://.godot/imported/未成熟.webp-0fd92cb72f1f6fc8e47f83f10fd56519.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/桃子/1753698025890_nobg.webp b/assets/作物/桃子/1753698025890_nobg.webp new file mode 100644 index 0000000..cd39287 Binary files /dev/null and b/assets/作物/桃子/1753698025890_nobg.webp differ diff --git a/assets/作物/桃子/1753698025890_nobg.webp.import b/assets/作物/桃子/1753698025890_nobg.webp.import new file mode 100644 index 0000000..362ec37 --- /dev/null +++ b/assets/作物/桃子/1753698025890_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://de7iwdjso0qia" +path="res://.godot/imported/1753698025890_nobg.webp-218aa557f23228bcdb1431dd91094974.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/桃子/1753698025890_nobg.webp" +dest_files=["res://.godot/imported/1753698025890_nobg.webp-218aa557f23228bcdb1431dd91094974.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/桃子/未成熟.webp b/assets/作物/桃子/未成熟.webp index 5d3ebfe..df1c0be 100644 Binary files a/assets/作物/桃子/未成熟.webp and b/assets/作物/桃子/未成熟.webp differ diff --git a/assets/作物/桃子/未成熟.webp.import b/assets/作物/桃子/未成熟.webp.import index f74f151..437dc6d 100644 --- a/assets/作物/桃子/未成熟.webp.import +++ b/assets/作物/桃子/未成熟.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://ckbofxp40yhdv" +uid="uid://k0tnf1st65oh" path="res://.godot/imported/未成熟.webp-0c5cff6ea079e369344f161e91dff85e.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/橘子树/幼苗.webp b/assets/作物/橘子树/幼苗.webp deleted file mode 100644 index d194898..0000000 Binary files a/assets/作物/橘子树/幼苗.webp and /dev/null differ diff --git a/assets/作物/橘子树/成熟.webp b/assets/作物/橘子树/成熟.webp deleted file mode 100644 index c9bbfa6..0000000 Binary files a/assets/作物/橘子树/成熟.webp and /dev/null differ diff --git a/assets/作物/橘子树/未成熟.webp b/assets/作物/橘子树/未成熟.webp deleted file mode 100644 index 7a70055..0000000 Binary files a/assets/作物/橘子树/未成熟.webp and /dev/null differ diff --git a/assets/作物/甘蔗/1753686982870_nobg.webp b/assets/作物/甘蔗/1753686982870_nobg.webp new file mode 100644 index 0000000..87e38e8 Binary files /dev/null and b/assets/作物/甘蔗/1753686982870_nobg.webp differ diff --git a/assets/作物/甘蔗/1753686982870_nobg.webp.import b/assets/作物/甘蔗/1753686982870_nobg.webp.import new file mode 100644 index 0000000..684b20e --- /dev/null +++ b/assets/作物/甘蔗/1753686982870_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvpxgg5xrutau" +path="res://.godot/imported/1753686982870_nobg.webp-d708e20063206a767ba4f1456e72bc2e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/甘蔗/1753686982870_nobg.webp" +dest_files=["res://.godot/imported/1753686982870_nobg.webp-d708e20063206a767ba4f1456e72bc2e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/甘蔗/收获物.webp b/assets/作物/甘蔗/收获物.webp new file mode 100644 index 0000000..214a894 Binary files /dev/null and b/assets/作物/甘蔗/收获物.webp differ diff --git a/assets/作物/甘蔗/收获物.webp.import b/assets/作物/甘蔗/收获物.webp.import new file mode 100644 index 0000000..cb18727 --- /dev/null +++ b/assets/作物/甘蔗/收获物.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddhnigkt5yiky" +path="res://.godot/imported/收获物.webp-90be7297c1fd837b6a6c65c7b9164b05.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/甘蔗/收获物.webp" +dest_files=["res://.godot/imported/收获物.webp-90be7297c1fd837b6a6c65c7b9164b05.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/生菜/1753690518207_nobg.webp b/assets/作物/生菜/1753690518207_nobg.webp new file mode 100644 index 0000000..4429878 Binary files /dev/null and b/assets/作物/生菜/1753690518207_nobg.webp differ diff --git a/assets/作物/生菜/1753690518207_nobg.webp.import b/assets/作物/生菜/1753690518207_nobg.webp.import new file mode 100644 index 0000000..4e19d3a --- /dev/null +++ b/assets/作物/生菜/1753690518207_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bs633xb28loic" +path="res://.godot/imported/1753690518207_nobg.webp-dbfc68ab23f40c2b1dad985e5dda2638.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/生菜/1753690518207_nobg.webp" +dest_files=["res://.godot/imported/1753690518207_nobg.webp-dbfc68ab23f40c2b1dad985e5dda2638.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/生菜/未成熟.webp b/assets/作物/生菜/未成熟.webp new file mode 100644 index 0000000..ccc523d Binary files /dev/null and b/assets/作物/生菜/未成熟.webp differ diff --git a/assets/作物/生菜/未成熟.webp.import b/assets/作物/生菜/未成熟.webp.import new file mode 100644 index 0000000..7e75671 --- /dev/null +++ b/assets/作物/生菜/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwkhioyh4twsh" +path="res://.godot/imported/未成熟.webp-b6ec369bb3f5f6c1a92eaef32667bbb1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/生菜/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-b6ec369bb3f5f6c1a92eaef32667bbb1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/石榴/幼苗.webp b/assets/作物/石榴/幼苗.webp index 708637b..ee73260 100644 Binary files a/assets/作物/石榴/幼苗.webp and b/assets/作物/石榴/幼苗.webp differ diff --git a/assets/作物/石榴/幼苗.webp.import b/assets/作物/石榴/幼苗.webp.import index 711ac6f..1f94107 100644 --- a/assets/作物/石榴/幼苗.webp.import +++ b/assets/作物/石榴/幼苗.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://b6pvu4e4bmll2" +uid="uid://xye6f8ys6t4g" path="res://.godot/imported/幼苗.webp-ff376685db56bea1f7e17ee7f648570f.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/石榴/未成熟.webp b/assets/作物/石榴/未成熟.webp new file mode 100644 index 0000000..445f614 Binary files /dev/null and b/assets/作物/石榴/未成熟.webp differ diff --git a/assets/作物/石榴/未成熟.webp.import b/assets/作物/石榴/未成熟.webp.import new file mode 100644 index 0000000..d232839 --- /dev/null +++ b/assets/作物/石榴/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwiifp016f5wg" +path="res://.godot/imported/未成熟.webp-1b697f1ab2898f2c400ef155f7a3ae89.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/石榴/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-1b697f1ab2898f2c400ef155f7a3ae89.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/荔枝/1753698920281_nobg.webp b/assets/作物/荔枝/1753698920281_nobg.webp new file mode 100644 index 0000000..458b977 Binary files /dev/null and b/assets/作物/荔枝/1753698920281_nobg.webp differ diff --git a/assets/作物/荔枝/1753698920281_nobg.webp.import b/assets/作物/荔枝/1753698920281_nobg.webp.import new file mode 100644 index 0000000..18d6218 --- /dev/null +++ b/assets/作物/荔枝/1753698920281_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dc4s26hux5w0p" +path="res://.godot/imported/1753698920281_nobg.webp-488000703f6901764bec930dd2e42177.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/荔枝/1753698920281_nobg.webp" +dest_files=["res://.godot/imported/1753698920281_nobg.webp-488000703f6901764bec930dd2e42177.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/荔枝/成熟.webp b/assets/作物/荔枝/成熟.webp index b633362..04463cc 100644 Binary files a/assets/作物/荔枝/成熟.webp and b/assets/作物/荔枝/成熟.webp differ diff --git a/assets/作物/荔枝/成熟.webp.import b/assets/作物/荔枝/成熟.webp.import index 1989411..3ec9319 100644 --- a/assets/作物/荔枝/成熟.webp.import +++ b/assets/作物/荔枝/成熟.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://c7qraqbi388c3" +uid="uid://dwwgbbxp6s2qj" path="res://.godot/imported/成熟.webp-c8db769eb816f5406c525ab38d2cbc8b.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/荔枝/未成熟.webp b/assets/作物/荔枝/未成熟.webp index 3e89fb8..c493dc5 100644 Binary files a/assets/作物/荔枝/未成熟.webp and b/assets/作物/荔枝/未成熟.webp differ diff --git a/assets/作物/荔枝/未成熟.webp.import b/assets/作物/荔枝/未成熟.webp.import index 0fc836d..7bf38ae 100644 --- a/assets/作物/荔枝/未成熟.webp.import +++ b/assets/作物/荔枝/未成熟.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bfdf5ahhtoptw" +uid="uid://ovlxt7drxjbi" path="res://.godot/imported/未成熟.webp-23dbdaf149510a607a8c86cb29d8e9cc.ctex" metadata={ "vram_texture": false diff --git a/assets/作物/菊花/收获物.webp b/assets/作物/菊花/收获物.webp new file mode 100644 index 0000000..b1d9880 Binary files /dev/null and b/assets/作物/菊花/收获物.webp differ diff --git a/assets/作物/菊花/收获物.webp.import b/assets/作物/菊花/收获物.webp.import new file mode 100644 index 0000000..5e4e046 --- /dev/null +++ b/assets/作物/菊花/收获物.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwjclna854ssu" +path="res://.godot/imported/收获物.webp-92a4bc22f57c25f1a02c1c822c3a13fa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/菊花/收获物.webp" +dest_files=["res://.godot/imported/收获物.webp-92a4bc22f57c25f1a02c1c822c3a13fa.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/藏红花/未成熟.webp b/assets/作物/藏红花/未成熟.webp new file mode 100644 index 0000000..c346d95 Binary files /dev/null and b/assets/作物/藏红花/未成熟.webp differ diff --git a/assets/作物/藏红花/未成熟.webp.import b/assets/作物/藏红花/未成熟.webp.import new file mode 100644 index 0000000..e1aa5b8 --- /dev/null +++ b/assets/作物/藏红花/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpjt4me88sf47" +path="res://.godot/imported/未成熟.webp-5ee1ab0b885000238a9ce6ac16d1c6a3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/藏红花/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-5ee1ab0b885000238a9ce6ac16d1c6a3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/藏羚羊草/未成熟.webp b/assets/作物/藏羚羊草/未成熟.webp new file mode 100644 index 0000000..6d4bf03 Binary files /dev/null and b/assets/作物/藏羚羊草/未成熟.webp differ diff --git a/assets/作物/藏羚羊草/未成熟.webp.import b/assets/作物/藏羚羊草/未成熟.webp.import new file mode 100644 index 0000000..1e97031 --- /dev/null +++ b/assets/作物/藏羚羊草/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://pqvnn77sln1d" +path="res://.godot/imported/未成熟.webp-0a9d2cc798ecd5193856ebab94d148d0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/藏羚羊草/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-0a9d2cc798ecd5193856ebab94d148d0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/辣椒/收获物.webp b/assets/作物/辣椒/收获物.webp new file mode 100644 index 0000000..d815aeb Binary files /dev/null and b/assets/作物/辣椒/收获物.webp differ diff --git a/assets/作物/辣椒/收获物.webp.import b/assets/作物/辣椒/收获物.webp.import new file mode 100644 index 0000000..671b928 --- /dev/null +++ b/assets/作物/辣椒/收获物.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chd3j72y3hwxl" +path="res://.godot/imported/收获物.webp-a9d70752247956e81fdc45198dc01a46.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/辣椒/收获物.webp" +dest_files=["res://.godot/imported/收获物.webp-a9d70752247956e81fdc45198dc01a46.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/迷迭香/未成熟.webp b/assets/作物/迷迭香/未成熟.webp new file mode 100644 index 0000000..01244ec Binary files /dev/null and b/assets/作物/迷迭香/未成熟.webp differ diff --git a/assets/作物/迷迭香/未成熟.webp.import b/assets/作物/迷迭香/未成熟.webp.import new file mode 100644 index 0000000..9a47d30 --- /dev/null +++ b/assets/作物/迷迭香/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu3q2qmd05y20" +path="res://.godot/imported/未成熟.webp-30025625300bd97b1507a7c51929bcc5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/迷迭香/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-30025625300bd97b1507a7c51929bcc5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/野草1/未成熟.webp b/assets/作物/野草1/未成熟.webp new file mode 100644 index 0000000..c309793 Binary files /dev/null and b/assets/作物/野草1/未成熟.webp differ diff --git a/assets/作物/野草1/未成熟.webp.import b/assets/作物/野草1/未成熟.webp.import new file mode 100644 index 0000000..5383606 --- /dev/null +++ b/assets/作物/野草1/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dho3itll6ccpt" +path="res://.godot/imported/未成熟.webp-c991244b99fd8383f7da7bf1bf2777e9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/野草1/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-c991244b99fd8383f7da7bf1bf2777e9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/野草2/未成熟.webp b/assets/作物/野草2/未成熟.webp new file mode 100644 index 0000000..331b992 Binary files /dev/null and b/assets/作物/野草2/未成熟.webp differ diff --git a/assets/作物/野草2/未成熟.webp.import b/assets/作物/野草2/未成熟.webp.import new file mode 100644 index 0000000..bf1a938 --- /dev/null +++ b/assets/作物/野草2/未成熟.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cetpqphbrwlmf" +path="res://.godot/imported/未成熟.webp-6693ab242c4d4eda5d0b776402c247d4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/野草2/未成熟.webp" +dest_files=["res://.godot/imported/未成熟.webp-6693ab242c4d4eda5d0b776402c247d4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/香草/收获物.webp b/assets/作物/香草/收获物.webp new file mode 100644 index 0000000..60138f3 Binary files /dev/null and b/assets/作物/香草/收获物.webp differ diff --git a/assets/作物/香草/收获物.webp.import b/assets/作物/香草/收获物.webp.import new file mode 100644 index 0000000..aca3f9f --- /dev/null +++ b/assets/作物/香草/收获物.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b1ghewkvtrrqg" +path="res://.godot/imported/收获物.webp-abcbcc3c67b0467ae1708d62eee2c4ec.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/作物/香草/收获物.webp" +dest_files=["res://.godot/imported/收获物.webp-abcbcc3c67b0467ae1708d62eee2c4ec.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/作物/香蕉/收获物.webp b/assets/作物/香蕉/收获物.webp index 50f2dd9..bd493ab 100644 Binary files a/assets/作物/香蕉/收获物.webp and b/assets/作物/香蕉/收获物.webp differ diff --git a/assets/作物/香蕉/收获物.webp.import b/assets/作物/香蕉/收获物.webp.import index 6b39544..d2e3b54 100644 --- a/assets/作物/香蕉/收获物.webp.import +++ b/assets/作物/香蕉/收获物.webp.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cwws0xta5atio" +uid="uid://d1gubuacgxaho" path="res://.godot/imported/收获物.webp-4607e379f81ca205beb7aa8f9b932eae.ctex" metadata={ "vram_texture": false diff --git a/assets/宠物图片/小粉人/Idle (32x32).png b/assets/宠物图片/小粉人/Idle (32x32).png new file mode 100644 index 0000000..620ff92 Binary files /dev/null and b/assets/宠物图片/小粉人/Idle (32x32).png differ diff --git a/assets/宠物图片/小粉人/Idle (32x32).png.import b/assets/宠物图片/小粉人/Idle (32x32).png.import new file mode 100644 index 0000000..4256df1 --- /dev/null +++ b/assets/宠物图片/小粉人/Idle (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dns0dosi44s1l" +path="res://.godot/imported/Idle (32x32).png-59f71553095c39c590015a442cb61470.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/小粉人/Idle (32x32).png" +dest_files=["res://.godot/imported/Idle (32x32).png-59f71553095c39c590015a442cb61470.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/小粉人/Run (32x32).png b/assets/宠物图片/小粉人/Run (32x32).png new file mode 100644 index 0000000..a5d5b9c Binary files /dev/null and b/assets/宠物图片/小粉人/Run (32x32).png differ diff --git a/assets/宠物图片/小粉人/Run (32x32).png.import b/assets/宠物图片/小粉人/Run (32x32).png.import new file mode 100644 index 0000000..8cb6823 --- /dev/null +++ b/assets/宠物图片/小粉人/Run (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dip54aidkampl" +path="res://.godot/imported/Run (32x32).png-8e7bf5c391a3349480a42a109f6b42b2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/小粉人/Run (32x32).png" +dest_files=["res://.godot/imported/Run (32x32).png-8e7bf5c391a3349480a42a109f6b42b2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/小蓝人/Idle (32x32).png b/assets/宠物图片/小蓝人/Idle (32x32).png new file mode 100644 index 0000000..d5b2e58 Binary files /dev/null and b/assets/宠物图片/小蓝人/Idle (32x32).png differ diff --git a/assets/宠物图片/小蓝人/Idle (32x32).png.import b/assets/宠物图片/小蓝人/Idle (32x32).png.import new file mode 100644 index 0000000..716e2c8 --- /dev/null +++ b/assets/宠物图片/小蓝人/Idle (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7q7x0wm1dd03" +path="res://.godot/imported/Idle (32x32).png-7799598e94999487bb213cb5cae05dc6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/小蓝人/Idle (32x32).png" +dest_files=["res://.godot/imported/Idle (32x32).png-7799598e94999487bb213cb5cae05dc6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/小蓝人/Run (32x32).png b/assets/宠物图片/小蓝人/Run (32x32).png new file mode 100644 index 0000000..de4d53e Binary files /dev/null and b/assets/宠物图片/小蓝人/Run (32x32).png differ diff --git a/assets/宠物图片/小蓝人/Run (32x32).png.import b/assets/宠物图片/小蓝人/Run (32x32).png.import new file mode 100644 index 0000000..1bd9749 --- /dev/null +++ b/assets/宠物图片/小蓝人/Run (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5arfmg612u3u" +path="res://.godot/imported/Run (32x32).png-6902c608ad3769a1e11a4de04a2b28d2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/小蓝人/Run (32x32).png" +dest_files=["res://.godot/imported/Run (32x32).png-6902c608ad3769a1e11a4de04a2b28d2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/青蛙人/Idle (32x32).png b/assets/宠物图片/青蛙人/Idle (32x32).png new file mode 100644 index 0000000..4cbc070 Binary files /dev/null and b/assets/宠物图片/青蛙人/Idle (32x32).png differ diff --git a/assets/宠物图片/青蛙人/Idle (32x32).png.import b/assets/宠物图片/青蛙人/Idle (32x32).png.import new file mode 100644 index 0000000..177326e --- /dev/null +++ b/assets/宠物图片/青蛙人/Idle (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cgq841aa7e4t4" +path="res://.godot/imported/Idle (32x32).png-eef9bc971941fa2f3af7558b2be201f8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/青蛙人/Idle (32x32).png" +dest_files=["res://.godot/imported/Idle (32x32).png-eef9bc971941fa2f3af7558b2be201f8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/青蛙人/Run (32x32).png b/assets/宠物图片/青蛙人/Run (32x32).png new file mode 100644 index 0000000..cf7599c Binary files /dev/null and b/assets/宠物图片/青蛙人/Run (32x32).png differ diff --git a/assets/宠物图片/青蛙人/Run (32x32).png.import b/assets/宠物图片/青蛙人/Run (32x32).png.import new file mode 100644 index 0000000..78f4d7e --- /dev/null +++ b/assets/宠物图片/青蛙人/Run (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://trioe3ihtrhb" +path="res://.godot/imported/Run (32x32).png-fa33cd9ef0298f6a3e07a7203dce99e1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/青蛙人/Run (32x32).png" +dest_files=["res://.godot/imported/Run (32x32).png-fa33cd9ef0298f6a3e07a7203dce99e1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/面具人/Idle (32x32).png b/assets/宠物图片/面具人/Idle (32x32).png new file mode 100644 index 0000000..d3ecedb Binary files /dev/null and b/assets/宠物图片/面具人/Idle (32x32).png differ diff --git a/assets/宠物图片/面具人/Idle (32x32).png.import b/assets/宠物图片/面具人/Idle (32x32).png.import new file mode 100644 index 0000000..90cb51e --- /dev/null +++ b/assets/宠物图片/面具人/Idle (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2qwtna8h1icf" +path="res://.godot/imported/Idle (32x32).png-0444583ab1f8986673eafddce4511927.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/面具人/Idle (32x32).png" +dest_files=["res://.godot/imported/Idle (32x32).png-0444583ab1f8986673eafddce4511927.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/宠物图片/面具人/Run (32x32).png b/assets/宠物图片/面具人/Run (32x32).png new file mode 100644 index 0000000..a06b359 Binary files /dev/null and b/assets/宠物图片/面具人/Run (32x32).png differ diff --git a/assets/宠物图片/面具人/Run (32x32).png.import b/assets/宠物图片/面具人/Run (32x32).png.import new file mode 100644 index 0000000..e8acd4d --- /dev/null +++ b/assets/宠物图片/面具人/Run (32x32).png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c28lr7xdns7yb" +path="res://.godot/imported/Run (32x32).png-e982fd14d93517482f289cb8ae56063c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/宠物图片/面具人/Run (32x32).png" +dest_files=["res://.godot/imported/Run (32x32).png-e982fd14d93517482f289cb8ae56063c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/道具图片/1753696817884_nobg.webp b/assets/道具图片/1753696817884_nobg.webp new file mode 100644 index 0000000..b4d08b6 Binary files /dev/null and b/assets/道具图片/1753696817884_nobg.webp differ diff --git a/assets/道具图片/1753696817884_nobg.webp.import b/assets/道具图片/1753696817884_nobg.webp.import new file mode 100644 index 0000000..5438faa --- /dev/null +++ b/assets/道具图片/1753696817884_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bh8xusk6w4rjt" +path="res://.godot/imported/1753696817884_nobg.webp-e84ac7a305a35f0897f56eab9cd3c9ec.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/道具图片/1753696817884_nobg.webp" +dest_files=["res://.godot/imported/1753696817884_nobg.webp-e84ac7a305a35f0897f56eab9cd3c9ec.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/道具图片/1753696949096_nobg.webp b/assets/道具图片/1753696949096_nobg.webp new file mode 100644 index 0000000..79ce55d Binary files /dev/null and b/assets/道具图片/1753696949096_nobg.webp differ diff --git a/assets/道具图片/1753696949096_nobg.webp.import b/assets/道具图片/1753696949096_nobg.webp.import new file mode 100644 index 0000000..148b4ff --- /dev/null +++ b/assets/道具图片/1753696949096_nobg.webp.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://df4hnj5hw2lmf" +path="res://.godot/imported/1753696949096_nobg.webp-84122ad506858d40991d5b24d8039e0a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/道具图片/1753696949096_nobg.webp" +dest_files=["res://.godot/imported/1753696949096_nobg.webp-84122ad506858d40991d5b24d8039e0a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.01 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0