准备发布正式版
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 #是否禁止显示天气
|
||||
|
||||
249
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
|
||||
|
||||
117
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"]
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
#=========================面板通用处理=========================
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,7 +238,6 @@ 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:
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
@@ -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()
|
||||
#===================通用面板处理======================
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
uid://hucuy8guuj6w
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
uid://ke4moxwg1gfd
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
uid://cbhhx6st14pse
|
||||
@@ -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或相关方法")
|
||||
|
||||
# 确认添加到小卖部回调
|
||||
|
||||
@@ -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
|
||||
#======================通用面板处理=====================
|
||||
|
||||
@@ -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
|
||||
#================通用面板处理==================
|
||||
|
||||
@@ -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"
|
||||
|
||||
# 设置文本
|
||||
|
||||
123
Script/SmallPanel/TodayDivinationPanel.gd
Normal file
@@ -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]"
|
||||
1
Script/SmallPanel/TodayDivinationPanel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bkel88rscubov
|
||||
@@ -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 中处理查询和更新
|
||||
#=====================玩家数据管理======================
|
||||
|
||||
# ========================= 验证码系统 =========================
|
||||
|
||||
@@ -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')
|
||||
@@ -322,9 +339,6 @@ class TCPGameServer(TCPServer):
|
||||
self.log('ERROR', f"保存玩家 {account_id} 的数据时出错: {str(e)}", 'SERVER')
|
||||
return False
|
||||
|
||||
#加载玩家数据(兼容旧方法名)
|
||||
|
||||
|
||||
#加载玩家数据
|
||||
def _load_player_data_with_check(self, client_id, action_type=None):
|
||||
"""加载玩家数据并进行错误检查的通用方法"""
|
||||
@@ -447,6 +461,33 @@ class TCPGameServer(TCPServer):
|
||||
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):
|
||||
|
||||
@@ -6,7 +6,7 @@ services:
|
||||
container_name: mengyafarm-server
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6060:6060"
|
||||
- "7070:7070"
|
||||
volumes:
|
||||
# 持久化游戏存档
|
||||
- ./game_saves:/app/game_saves
|
||||
|
||||
1083
Test/测试版玩家数据/作物数据.json
Normal file
91
Test/测试版玩家数据/旧版玩家部分数据.txt
Normal file
@@ -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秒",
|
||||
BIN
assets/作物/人参/未成熟.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
@@ -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]
|
||||
|
||||
BIN
assets/作物/冬虫夏草/收获物.webp
Normal file
|
After Width: | Height: | Size: 18 KiB |
34
assets/作物/冬虫夏草/收获物.webp.import
Normal file
@@ -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
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 17 KiB |
@@ -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
|
||||
|
||||
BIN
assets/作物/可可豆/未成熟.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
@@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 19 KiB |
@@ -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
|
||||
|
||||
BIN
assets/作物/大蒜/未成熟.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 21 KiB |
@@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@@ -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
|
||||
|
||||
BIN
assets/作物/星芒草/1753694208204_nobg.webp
Normal file
|
After Width: | Height: | Size: 15 KiB |
34
assets/作物/星芒草/1753694208204_nobg.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/星芒草/收获物.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
34
assets/作物/星芒草/收获物.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/星芒草/未成熟.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
34
assets/作物/星芒草/未成熟.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/杂交树1/1753692680268_nobg.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
34
assets/作物/杂交树1/1753692680268_nobg.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/杂交树1/1753692859819_nobg.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
34
assets/作物/杂交树1/1753692859819_nobg.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/杂交树1/1753694206281_nobg.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
34
assets/作物/杂交树1/1753694206281_nobg.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/杂交树1/1753697108067_nobg.webp
Normal file
|
After Width: | Height: | Size: 26 KiB |
34
assets/作物/杂交树1/1753697108067_nobg.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/杂交树1/1753697119760_nobg.webp
Normal file
|
After Width: | Height: | Size: 34 KiB |
34
assets/作物/杂交树1/1753697119760_nobg.webp.import
Normal file
@@ -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
|
||||
BIN
assets/作物/杂交树1/1753697233249_nobg.webp
Normal file
|
After Width: | Height: | Size: 28 KiB |
34
assets/作物/杂交树1/1753697233249_nobg.webp.import
Normal file
@@ -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
|
||||