mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-12 22:57:13 +08:00
feat(武器系统): 添加武器灵魂等级功能
- 在Weapon结构体中新增soulLevel属性 - 为WeaponName添加灵魂等级枚举和颜色映射 - 修改武器名称显示格式,加入灵魂等级前缀和颜色 - 移除WeaponCardBase的debugRebuild标志
This commit is contained in:
@@ -28,7 +28,6 @@ offset_right = 350.0
|
||||
offset_bottom = 304.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_n2ewr")
|
||||
script = ExtResource("1_g802t")
|
||||
debugRebuild = true
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="sounds" type="Node2D" parent="."]
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
[ext_resource type="Theme" uid="uid://bje5cd08dyok7" path="res://themes/bigTextAndBold.tres" id="2_y8dft"]
|
||||
[ext_resource type="Script" path="res://scripts/Statemachine/WeaponName.gd" id="3_g750e"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_fglo5"]
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_83mpy"]
|
||||
font_size = 12
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_3tmci"]
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_gcoja"]
|
||||
font_size = 12
|
||||
|
||||
[node name="WeaponName" type="HBoxContainer"]
|
||||
@@ -27,6 +27,13 @@ typeTopicColorMap = {
|
||||
2: Color(0, 1, 1, 1),
|
||||
3: Color(0.851563, 0, 1, 1)
|
||||
}
|
||||
soulLevelColorMap = {
|
||||
0: Color(1, 1, 1, 1),
|
||||
1: Color(0.549081, 1, 0.469515, 1),
|
||||
2: Color(0.496592, 0.690537, 1, 1),
|
||||
3: Color(0.797899, 0.499276, 1, 1),
|
||||
4: Color(1, 0.568473, 0.258116, 1)
|
||||
}
|
||||
metadata/_edit_horizontal_guides_ = [25.0]
|
||||
|
||||
[node name="quality" type="Label" parent="."]
|
||||
@@ -34,14 +41,14 @@ unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
text = "[普通]"
|
||||
label_settings = SubResource("LabelSettings_fglo5")
|
||||
label_settings = SubResource("LabelSettings_83mpy")
|
||||
|
||||
[node name="label" type="RichTextLabel" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_y8dft")
|
||||
bbcode_enabled = true
|
||||
text = "[b]未命名武器[/b]"
|
||||
text = "[b][color=ffffffff]归一[/color] · 未命名武器[/b]"
|
||||
fit_content = true
|
||||
autowrap_mode = 0
|
||||
|
||||
@@ -60,4 +67,4 @@ unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
text = "[冲击]"
|
||||
label_settings = SubResource("LabelSettings_3tmci")
|
||||
label_settings = SubResource("LabelSettings_gcoja")
|
||||
|
||||
@@ -15,10 +15,18 @@ enum TypeTopic {
|
||||
TEMPERATURE,
|
||||
MAGIC,
|
||||
}
|
||||
enum SoulLevel {
|
||||
NORMALIZE,
|
||||
ADD,
|
||||
MULTIPLY,
|
||||
EXPONENT,
|
||||
INFINITY,
|
||||
}
|
||||
|
||||
@export var displayName: String = "未命名武器"
|
||||
@export var quality: Quality = Quality.COMMON
|
||||
@export var typeTopic: TypeTopic = TypeTopic.IMPACT
|
||||
@export var soulLevel: SoulLevel = SoulLevel.NORMALIZE
|
||||
@export var level: int = 0
|
||||
@export var qualityColorMap = {
|
||||
Quality.WASTE: Color(),
|
||||
@@ -60,6 +68,20 @@ enum TypeTopic {
|
||||
TypeTopic.TEMPERATURE: Color(),
|
||||
TypeTopic.MAGIC: Color(),
|
||||
}
|
||||
@export var soulLevelNameMap = {
|
||||
SoulLevel.NORMALIZE: "归一",
|
||||
SoulLevel.ADD: "数增",
|
||||
SoulLevel.MULTIPLY: "倍乘",
|
||||
SoulLevel.EXPONENT: "幂指",
|
||||
SoulLevel.INFINITY: "无量",
|
||||
}
|
||||
@export var soulLevelColorMap = {
|
||||
SoulLevel.NORMALIZE: Color(),
|
||||
SoulLevel.ADD: Color(),
|
||||
SoulLevel.MULTIPLY: Color(),
|
||||
SoulLevel.EXPONENT: Color(),
|
||||
SoulLevel.INFINITY: Color(),
|
||||
}
|
||||
|
||||
@onready var qualityLabel: Label = $"%quality"
|
||||
@onready var typeTopicLabel: Label = $"%typeTopic"
|
||||
@@ -74,11 +96,13 @@ func _physics_process(_delta):
|
||||
qualityLabel.label_settings.font_color = qualityColor()
|
||||
typeTopicLabel.text = "[%s]" % typeTopicNameMap[typeTopic]
|
||||
typeTopicLabel.label_settings.font_color = typeTopicColor()
|
||||
nameLabel.text = "[b]%s[/b]" % displayName
|
||||
nameLabel.text = "[b][color=%s]%s[/color] · %s[/b]" % [soulLevelColor().to_html(), soulLevelNameMap[soulLevel], displayName]
|
||||
levelLabel.text = "[b]Lv.%d[/b]" % (level + 1)
|
||||
func qualityColor():
|
||||
return qualityColorMap[quality] as Color
|
||||
func typeTopicColor():
|
||||
return typeTopicColorMap[typeTopic] as Color
|
||||
func soulLevelColor():
|
||||
return soulLevelColorMap[soulLevel] as Color
|
||||
func weight(player: EntityBase) -> int:
|
||||
return floor(clamp(qualityRandomWeight[quality] + luckInfluence[quality] * player.fields[FieldStore.Entity.LUCK_VALUE], 1, INF))
|
||||
|
||||
@@ -6,6 +6,7 @@ class_name Weapon
|
||||
@export var displayName: String = "未命名饲料"
|
||||
@export var quality: WeaponName.Quality = WeaponName.Quality.COMMON
|
||||
@export var typeTopic: WeaponName.TypeTopic = WeaponName.TypeTopic.IMPACT
|
||||
@export var soulLevel: WeaponName.SoulLevel = WeaponName.SoulLevel.NORMALIZE
|
||||
@export var costBeachball: int = 500
|
||||
@export var store: Dictionary = {
|
||||
"atk": 10
|
||||
@@ -68,6 +69,7 @@ func rebuildInfo():
|
||||
nameLabel.displayName = displayName
|
||||
nameLabel.quality = quality
|
||||
nameLabel.typeTopic = typeTopic
|
||||
nameLabel.soulLevel = soulLevel
|
||||
nameLabel.level = level
|
||||
energyLabel.text = "%.1f" % needEnergy
|
||||
beachballLabel.text = str(costBeachball)
|
||||
|
||||
Reference in New Issue
Block a user