diff --git a/components/Abstracts/PlayerBase.tscn b/components/Abstracts/PlayerBase.tscn index 0b0fc08..d0e0a14 100644 --- a/components/Abstracts/PlayerBase.tscn +++ b/components/Abstracts/PlayerBase.tscn @@ -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("..") diff --git a/components/Abstracts/WeaponCardBase.tscn b/components/Abstracts/WeaponCardBase.tscn index e9c2d0c..a63983a 100644 --- a/components/Abstracts/WeaponCardBase.tscn +++ b/components/Abstracts/WeaponCardBase.tscn @@ -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") diff --git a/components/Characters/MuyangDog.tscn b/components/Characters/MuyangDog.tscn index 632bdc7..3a63532 100644 --- a/components/Characters/MuyangDog.tscn +++ b/components/Characters/MuyangDog.tscn @@ -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")] diff --git a/scripts/Contents/Panels/WeaponPanel.gd b/scripts/Contents/Panels/WeaponPanel.gd index 1877340..b3615c9 100644 --- a/scripts/Contents/Panels/WeaponPanel.gd +++ b/scripts/Contents/Panels/WeaponPanel.gd @@ -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(): diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 8da23f9..b7091ba 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -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, # 无限 diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index a38a7de..f872936 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -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): diff --git a/scripts/Tools/CategoryStore.gd b/scripts/Tools/CategoryStore.gd index 6f3c755..65c4443 100644 --- a/scripts/Tools/CategoryStore.gd +++ b/scripts/Tools/CategoryStore.gd @@ -1,3 +1,4 @@ +@tool class_name CategoryStore enum Quality {