作物优化

This commit is contained in:
2025-07-12 19:12:13 +08:00
parent 5dc4535423
commit aa8707878e
26 changed files with 183 additions and 30417 deletions

View File

@@ -1,20 +1,12 @@
extends Panel
class_name LuckyDrawPanel
## 幸运抽奖系统 - 后端对接版本
## 功能:与服务器对接的抽奖系统,支持实时数据同步和平衡调整
## 奖励平衡性已根据 crop_data.json 调整
# =============================================================================
# 信号定义 - 用于与后端系统通信
# =============================================================================
signal draw_completed(rewards: Array, draw_type: String) # 抽奖完成信号
signal reward_obtained(reward_type: String, amount: int) # 奖励获得信号
signal draw_failed(error_message: String) # 抽奖失败信号
# =============================================================================
# 节点引用
# =============================================================================
#这个展示抽奖获得的奖励
@onready var lucky_draw_reward: RichTextLabel = $LuckyDrawReward
#这个是展示有哪些奖励选项最多15个奖励就在这里面随机挑选
@@ -22,9 +14,6 @@ signal draw_failed(error_message: String) # 抽奖失败信号
#这个是奖励模板
@onready var reward_item: RichTextLabel = $Grid/RewardItem
# =============================================================================
# 数据存储
# =============================================================================
var reward_templates: Array[RichTextLabel] = []
var current_rewards: Array = []
@onready var main_game = get_node("/root/main")
@@ -61,9 +50,6 @@ var template_colors: Array[Color] = [
var anticipation_tween: Tween = null
# =============================================================================
# 基础奖励配置 - 根据 crop_data.json 调整
# =============================================================================
var base_rewards: Dictionary = {
"coins": {"name": "金币", "icon": "💰", "color": "#FFD700"},
"exp": {"name": "经验", "icon": "", "color": "#00BFFF"},
@@ -79,14 +65,8 @@ var draw_costs: Dictionary = {
"ten": 6400 # 800 * 10 * 0.8 = 6400
}
# =============================================================================
# 奖励池配置 - 根据后端数据动态更新
# =============================================================================
var server_reward_pools: Dictionary = {}
# =============================================================================
# 系统初始化
# =============================================================================
func _ready() -> void:
_initialize_system()
@@ -148,9 +128,6 @@ func _get_rarity_color(rarity: String) -> String:
_:
return "#FFFFFF"
# =============================================================================
# 核心功能
# =============================================================================
## 生成15个奖励模板
func _generate_reward_templates() -> void: