1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(武器系统): 重构武器升华动画及交互逻辑

- 将sublimateToggled信号拆分为sublimateOpened和sublimateClosed
- 添加武器卡片的hide/show动画效果
- 移除MuyangDog角色中的Volcano武器
- 重置EntityBase中钻石的初始数量为0
- 为CategoryStore添加@tool注解
This commit is contained in:
2026-05-10 12:40:15 +08:00
parent aec1db5088
commit 1b3df9727a
7 changed files with 113 additions and 20 deletions
+10 -10
View File
@@ -92,38 +92,38 @@ position = Vector2(0, -54)
amount = 100
process_material = SubResource("ParticleProcessMaterial_joj4g")
[node name="weaponStore" parent="." index="2"]
[node name="weaponStore" parent="." index="2" unique_id=1319091445]
process_mode = 4
[node name="sprint" parent="sounds" index="0"]
[node name="sprint" parent="sounds" parent_id_path=PackedInt32Array(1554185633) index="0" unique_id=771326921]
stream = ExtResource("3_lv2jw")
[node name="heal" parent="sounds" index="1"]
[node name="heal" parent="sounds" parent_id_path=PackedInt32Array(1554185633) index="1" unique_id=522032588]
stream = ExtResource("4_7bgj3")
[node name="miss" parent="sounds" index="2"]
[node name="miss" parent="sounds" parent_id_path=PackedInt32Array(1554185633) index="2" unique_id=254579113]
stream = ExtResource("5_na3ea")
[node name="hurt" parent="sounds" index="3"]
[node name="hurt" parent="sounds" parent_id_path=PackedInt32Array(1554185633) index="3" unique_id=540822672]
stream = ExtResource("6_0o8ke")
[node name="texture" parent="." index="4"]
[node name="texture" parent="." index="4" unique_id=1960766921]
position = Vector2(0, -47)
sprite_frames = SubResource("SpriteFrames_4v2ol")
animation = &"walk"
[node name="staticAnimation" parent="texture" index="1"]
[node name="staticAnimation" parent="texture" index="1" unique_id=2086220178]
position = Vector2(0, -17)
sprite_frames = SubResource("SpriteFrames_jluqw")
animation = &"walk"
[node name="hitbox" parent="texture/hurtbox" index="0"]
[node name="hitbox" parent="texture/hurtbox" parent_id_path=PackedInt32Array(1090146637) index="0" unique_id=1089476696]
position = Vector2(-2, -18)
shape = SubResource("CircleShape2D_h1v0q")
[node name="normal" type="Node2D" parent="texture/weapons" index="0" unique_id=1939030218]
[node name="normal" type="Node2D" parent="texture/weapons" parent_id_path=PackedInt32Array(1686065375) index="0" unique_id=1939030218]
position = Vector2(1, -13)
[node name="statebar" parent="." index="5" node_paths=PackedStringArray("entity")]
[node name="statebar" parent="." index="5" unique_id=1990457668 node_paths=PackedStringArray("entity")]
position = Vector2(0, -150)
entity = NodePath("..")
+84 -3
View File
@@ -101,6 +101,29 @@ tracks/2/keys = {
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath(".:scale:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_mjvvk"]
resource_name = "openSub"
@@ -141,6 +164,34 @@ tracks/2/keys = {
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_goekw"]
resource_name = "hide"
length = 0.25
step = 0.05
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(2, 0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0, 0, 0, 0, 0),
"times": PackedFloat32Array(0, 0.25)
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.25),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_sbvs2"]
resource_name = "openSub"
length = 0.25
@@ -180,16 +231,46 @@ tracks/2/keys = {
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_0wdh4"]
resource_name = "hide"
length = 0.25
step = 0.05
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0, 0, 0, 0, 0, 1, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.25)
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.25),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mjvvk"]
_data = {
&"RESET": SubResource("Animation_75t4v"),
&"closeSub": SubResource("Animation_mjvvk"),
&"openSub": SubResource("Animation_sbvs2")
&"hide": SubResource("Animation_goekw"),
&"openSub": SubResource("Animation_sbvs2"),
&"show": SubResource("Animation_0wdh4")
}
[node name="WeaponCard" type="PanelContainer" unique_id=2085048785]
offset_right = 350.0
offset_bottom = 304.0
offset_right = 352.0
offset_bottom = 660.0
theme_override_styles/panel = SubResource("StyleBoxFlat_n2ewr")
script = ExtResource("1_g802t")
avatarTexture = ExtResource("2_j0w4u")
+1 -4
View File
@@ -2,13 +2,10 @@
[ext_resource type="PackedScene" uid="uid://bs863g2s8r770" path="res://components/Abstracts/PlayerBase.tscn" id="1_y3l4w"]
[ext_resource type="Script" uid="uid://bbmb572iba42l" path="res://scripts/Contents/Characters/MuyangDog.gd" id="2_mr6nm"]
[ext_resource type="PackedScene" uid="uid://u0djqwuuysp8" path="res://components/Weapons/Volcano.tscn" id="3_e236u"]
[ext_resource type="PackedScene" uid="uid://cx7nogfnv7s8t" path="res://components/Weapons/Tree.tscn" id="4_im5m5"]
[node name="MuyangDog" unique_id=1711205167 instance=ExtResource("1_y3l4w")]
script = ExtResource("2_mr6nm")
displayName = "牧羊犬"
[node name="Volcano" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="0" unique_id=204992396 instance=ExtResource("3_e236u")]
[node name="Tree" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="1" unique_id=185228402 instance=ExtResource("4_im5m5")]
[node name="Tree" parent="weaponStore" parent_id_path=PackedInt32Array(1319091445) index="0" unique_id=185228402 instance=ExtResource("4_im5m5")]
+12
View File
@@ -7,6 +7,18 @@ func beforeOpen(_args: Array = []):
for weapon in UIState.player.weapons:
weapon.show()
weapon.rebuildInfo()
weapon.sublimateOpened.connect(
func():
for w in UIState.player.weapons:
if w != weapon:
w.animator.play("hide")
)
weapon.sublimateClosed.connect(
func():
for w in UIState.player.weapons:
if w != weapon:
w.animator.play("show")
)
UIState.player.weaponStore.remove_child(weapon)
box.add_child(weapon)
func afterClose():
+1 -1
View File
@@ -68,7 +68,7 @@ var inventory = {
ItemStore.ItemType.BEACHBALL: 0,
ItemStore.ItemType.SOUL: 0,
ItemStore.ItemType.CRYSTAL: 0,
ItemStore.ItemType.DIAMOND: 10
ItemStore.ItemType.DIAMOND: 0
}
var inventoryMax = {
ItemStore.ItemType.BASEBALL: INF, # 无限
+4 -2
View File
@@ -9,7 +9,8 @@ enum EmitType {
HOLD_LOOP
}
signal sublimateToggled(on: bool)
signal sublimateOpened()
signal sublimateClosed()
@export var avatarTexture: Texture2D = null
@export var displayName: String = "未命名武器"
@@ -71,9 +72,10 @@ func _ready():
func(on: bool):
if on:
animator.play("openSub")
sublimateOpened.emit()
else:
animator.play("closeSub")
sublimateToggled.emit(on)
sublimateClosed.emit()
)
autoUpdateBtn.toggled.connect(
func(on: bool):
+1
View File
@@ -1,3 +1,4 @@
@tool
class_name CategoryStore
enum Quality {